mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Prevent crash when the start_idx could not be found
CURA-59
This commit is contained in:
parent
670a106957
commit
7c70ace8f0
1 changed files with 4 additions and 1 deletions
|
@ -173,7 +173,10 @@ class Arrange:
|
||||||
def bestSpot(self, shape_arr, start_prio = 0, step = 1):
|
def bestSpot(self, shape_arr, start_prio = 0, step = 1):
|
||||||
start_idx_list = numpy.where(self._priority_unique_values == start_prio)
|
start_idx_list = numpy.where(self._priority_unique_values == start_prio)
|
||||||
if start_idx_list:
|
if start_idx_list:
|
||||||
start_idx = start_idx_list[0][0]
|
try:
|
||||||
|
start_idx = start_idx_list[0][0]
|
||||||
|
except IndexError:
|
||||||
|
start_idx = 0
|
||||||
else:
|
else:
|
||||||
start_idx = 0
|
start_idx = 0
|
||||||
for priority in self._priority_unique_values[start_idx::step]:
|
for priority in self._priority_unique_values[start_idx::step]:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue