fix crash in malformations estimation - the nearest line of the current support extrusion may not be in the previous layer lines for some reason (maybe per object ordering?)

This commit is contained in:
Pavel Mikus 2023-01-02 10:51:57 +01:00 committed by Pavel Mikuš
parent ec4cc2e694
commit dbaa0f72d1

View File

@ -905,7 +905,7 @@ void estimate_supports_malformations(SupportLayerPtrs &layers, float flow_width,
ExtrusionLine line_out{i > 0 ? annotated_points[i - 1].position.cast<float>() : curr_point.position.cast<float>(), ExtrusionLine line_out{i > 0 ? annotated_points[i - 1].position.cast<float>() : curr_point.position.cast<float>(),
curr_point.position.cast<float>(), line_len, extrusion}; curr_point.position.cast<float>(), line_len, extrusion};
const ExtrusionLine nearest_prev_layer_line = prev_layer_lines.get_lines().size() > 0 ? const ExtrusionLine nearest_prev_layer_line = prev_layer_lines.get_lines().size() > curr_point.nearest_prev_layer_line ?
prev_layer_lines.get_line(curr_point.nearest_prev_layer_line) : prev_layer_lines.get_line(curr_point.nearest_prev_layer_line) :
ExtrusionLine{}; ExtrusionLine{};