mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix accidentally always taking 0th line along
The input array here is 2D, but always 1 by N long. The output of where then gives a tuple of two arrays, one indicating the Y positions and the other the X positions. The X positions were therefore always 0. The amin and amax functions were then always taking this index 0 along in their results, regardless of whether the line at that index was visible at all or not. This will also improve performance since it's checking the limits now only for half as many indices.
This commit is contained in:
parent
9b1941a4a2
commit
6209a08121
1 changed files with 2 additions and 2 deletions
|
@ -501,8 +501,8 @@ class SimulationView(CuraView):
|
|||
for layer_index in layer_data.getLayers():
|
||||
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.
|
||||
visible_indices = numpy.where(is_visible)[0]
|
||||
if visible_indices.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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue