Don't crash if there are no visible lines in a polyline

This commit is contained in:
Ghostkeeper 2021-04-03 17:07:01 +02:00
parent b5bc4aecd5
commit 9b1941a4a2
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -499,11 +499,11 @@ class SimulationView(CuraView):
continue
for layer_index in layer_data.getLayers():
if len(layer_data.getLayer(layer_index).polygons) <= 0: # Empty layer.
continue # Skip for performance.
for polyline in layer_data.getLayer(layer_index).polygons:
is_visible = numpy.isin(polyline.types, visible_line_types)
visible_indices = numpy.where(is_visible)
if visible_indices[0].size == 0: # No items to take maximum or minimum of.
continue
visible_feedrates = numpy.take(polyline.lineFeedrates, visible_indices)
visible_linewidths = numpy.take(polyline.lineWidths, visible_indices)
visible_thicknesses = numpy.take(polyline.lineThicknesses, visible_indices)