FIX: tree support crashes when lower_layer is null

Change-Id: I942bdf1dfc253be5ebf659274f230290c5260d63
(cherry picked from commit 05b033cd0dfacadab9ea3e725e364a6156d068f2)
This commit is contained in:
Arthur 2023-04-03 18:04:03 +08:00 committed by Lane.Wei
parent fa1be64652
commit 74d558e612

View file

@ -1146,7 +1146,7 @@ void TreeSupport::detect_overhangs(bool detect_first_sharp_tail_only)
ts_layer->overhang_areas = diff_ex(ts_layer->overhang_areas, offset_ex(blocker, scale_(radius_sample_resolution))); ts_layer->overhang_areas = diff_ex(ts_layer->overhang_areas, offset_ex(blocker, scale_(radius_sample_resolution)));
} }
if (max_bridge_length > 0 && ts_layer->overhang_areas.size() > 0) { if (max_bridge_length > 0 && ts_layer->overhang_areas.size() > 0 && lower_layer) {
// do not break bridge for normal part in TreeHybrid // do not break bridge for normal part in TreeHybrid
bool break_bridge = !(support_style == smsTreeHybrid && area(ts_layer->overhang_areas) > m_support_params.thresh_big_overhang); bool break_bridge = !(support_style == smsTreeHybrid && area(ts_layer->overhang_areas) > m_support_params.thresh_big_overhang);
m_object->remove_bridges_from_contacts(lower_layer, layer, extrusion_width_scaled, &ts_layer->overhang_areas, max_bridge_length, break_bridge); m_object->remove_bridges_from_contacts(lower_layer, layer, extrusion_width_scaled, &ts_layer->overhang_areas, max_bridge_length, break_bridge);