mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Don't crash if there are no visible lines in a polyline
This commit is contained in:
parent
b5bc4aecd5
commit
9b1941a4a2
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue