mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:09:00 +08:00
Don't let arranger place all objects on the same spot if they don't fit
CURA-7440
This commit is contained in:
parent
a14135be5e
commit
59b9639d87
@ -36,14 +36,9 @@ class MultiplyObjectsJob(Job):
|
||||
status_message.show()
|
||||
scene = Application.getInstance().getController().getScene()
|
||||
|
||||
total_progress = len(self._objects) * self._count
|
||||
current_progress = 0
|
||||
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
if global_container_stack is None:
|
||||
return # We can't do anything in this case.
|
||||
machine_width = global_container_stack.getProperty("machine_width", "value")
|
||||
machine_depth = global_container_stack.getProperty("machine_depth", "value")
|
||||
|
||||
root = scene.getRoot()
|
||||
|
||||
@ -80,7 +75,7 @@ class MultiplyObjectsJob(Job):
|
||||
nodes.append(new_node)
|
||||
factor = 10000
|
||||
found_solution_for_all, node_items = findNodePlacement(nodes, Application.getInstance().getBuildVolume(), fixed_nodes, factor = 10000)
|
||||
|
||||
not_fit_count = 0
|
||||
if nodes:
|
||||
operation = GroupedOperation()
|
||||
for new_node, node_item in zip(nodes, node_items):
|
||||
@ -98,6 +93,7 @@ class MultiplyObjectsJob(Job):
|
||||
# We didn't find a spot
|
||||
operation.addOperation(
|
||||
TranslateOperation(new_node, Vector(200, 0, -not_fit_count * 20), set_position=True))
|
||||
not_fit_count += 1
|
||||
|
||||
operation.push()
|
||||
status_message.hide()
|
||||
|
Loading…
x
Reference in New Issue
Block a user