mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-29 15:25:02 +08:00
Split up arrange
This splits up the finding of new positions with the actual move. This is needed for when we want to place new nodes on model load. CURA-7440
This commit is contained in:
parent
c25351c98a
commit
274dc8d06c
@ -10,7 +10,7 @@ from UM.Operations.RotateOperation import RotateOperation
|
||||
from UM.Operations.TranslateOperation import TranslateOperation
|
||||
|
||||
|
||||
def arrange(nodes_to_arrange, build_volume, fixed_nodes = None, factor = 10000) -> bool:
|
||||
def findNodePlacement(nodes_to_arrange, build_volume, fixed_nodes = None, factor = 10000):
|
||||
machine_width = build_volume.getWidth()
|
||||
machine_depth = build_volume.getDepth()
|
||||
build_plate_bounding_box = Box(machine_width * factor, machine_depth * factor)
|
||||
@ -61,6 +61,13 @@ def arrange(nodes_to_arrange, build_volume, fixed_nodes = None, factor = 10000)
|
||||
node_items = node_items[:-num_disallowed_areas_added]
|
||||
|
||||
found_solution_for_all = num_bins == 1
|
||||
|
||||
return found_solution_for_all, node_items
|
||||
|
||||
|
||||
def arrange(nodes_to_arrange, build_volume, fixed_nodes = None, factor = 10000) -> bool:
|
||||
found_solution_for_all, node_items = findNodePlacement(nodes_to_arrange, build_volume, fixed_nodes, factor)
|
||||
|
||||
not_fit_count = 0
|
||||
grouped_operation = GroupedOperation()
|
||||
for node, node_item in zip(nodes_to_arrange, node_items):
|
||||
@ -78,4 +85,4 @@ def arrange(nodes_to_arrange, build_volume, fixed_nodes = None, factor = 10000)
|
||||
not_fit_count += 1
|
||||
grouped_operation.push()
|
||||
|
||||
return found_solution_for_all
|
||||
return found_solution_for_all
|
||||
|
Loading…
x
Reference in New Issue
Block a user