Fix testing multiple arrange strategies

CURA-12169
Some items were still set from previous tryes, giving a final result that could have inconsistencies (e.g. objects over disallowed ares)
This commit is contained in:
Erwan MATHIEU 2025-03-06 10:59:55 +01:00
parent e19f5ee330
commit 01d03f7e21

View file

@ -57,6 +57,10 @@ class Nest2DArrange(Arranger):
if self._fixed_nodes is None:
self._fixed_nodes = []
strategies = [NfpConfig.Alignment.CENTER] * 3 + [NfpConfig.Alignment.BOTTOM_LEFT] * 3
found_solution_for_all = False
while not found_solution_for_all and len(strategies) > 0:
# Add all the items we want to arrange
node_items = []
for node in self._nodes_to_arrange:
@ -108,9 +112,6 @@ class Nest2DArrange(Arranger):
item.markAsFixedInBin(0)
node_items.append(item)
strategies = [NfpConfig.Alignment.CENTER] * 3 + [NfpConfig.Alignment.BOTTOM_LEFT] * 3
found_solution_for_all = False
while not found_solution_for_all and len(strategies) > 0:
config = NfpConfig()
config.accuracy = 1.0
config.alignment = NfpConfig.Alignment.CENTER