mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
multiplying objects place them in a grid
CURA-7951
This commit is contained in:
parent
023dd3a9c5
commit
209162fbce
2 changed files with 197 additions and 6 deletions
|
@ -14,6 +14,7 @@ from UM.Operations.TranslateOperation import TranslateOperation
|
|||
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
|
||||
from UM.Scene.SceneNode import SceneNode
|
||||
from UM.i18n import i18nCatalog
|
||||
from cura.Arranging.GridArrange import GridArrange
|
||||
from cura.Arranging.Nest2DArrange import arrange, createGroupOperationForArrange
|
||||
|
||||
i18n_catalog = i18nCatalog("cura")
|
||||
|
@ -77,12 +78,17 @@ class MultiplyObjectsJob(Job):
|
|||
found_solution_for_all = True
|
||||
group_operation = GroupedOperation()
|
||||
if nodes:
|
||||
group_operation, not_fit_count = createGroupOperationForArrange(nodes,
|
||||
Application.getInstance().getBuildVolume(),
|
||||
fixed_nodes,
|
||||
factor=10000,
|
||||
add_new_nodes_in_scene=True,
|
||||
lock_rotation=self._lock_rotation)
|
||||
grid_arrange = GridArrange(nodes,Application.getInstance().getBuildVolume(),
|
||||
fixed_nodes)
|
||||
|
||||
group_operation, not_fit_count = grid_arrange.arrange()
|
||||
print("group_operation", group_operation)
|
||||
# group_operation, not_fit_count = createGroupOperationForArrange(nodes,
|
||||
# Application.getInstance().getBuildVolume(),
|
||||
# fixed_nodes,
|
||||
# factor=10000,
|
||||
# add_new_nodes_in_scene=True,
|
||||
# lock_rotation=self._lock_rotation)
|
||||
found_solution_for_all = not_fit_count == 0
|
||||
|
||||
if nodes_to_add_without_arrange:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue