mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fixed arranger multiplying too big objects and arrange All. CURA-3676
This commit is contained in:
parent
3e75583f2b
commit
c7a6d42920
2 changed files with 12 additions and 5 deletions
|
@ -984,7 +984,9 @@ class CuraApplication(QtApplication):
|
|||
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
|
||||
if not node.isSelectable():
|
||||
continue # i.e. node with layer data
|
||||
nodes.append(node)
|
||||
# Skip nodes that are too big
|
||||
if node.getBoundingBox().width < self._volume.getBoundingBox().width or node.getBoundingBox().depth < self._volume.getBoundingBox().depth:
|
||||
nodes.append(node)
|
||||
self.arrange(nodes, fixed_nodes = [])
|
||||
|
||||
## Arrange Selection
|
||||
|
|
13
cura/MultiplyObjectsJob.py
Normal file → Executable file
13
cura/MultiplyObjectsJob.py
Normal file → Executable file
|
@ -47,13 +47,18 @@ class MultiplyObjectsJob(Job):
|
|||
|
||||
root = scene.getRoot()
|
||||
arranger = Arrange.create(scene_root=root)
|
||||
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(current_node, min_offset=self._min_offset)
|
||||
node_too_big = False
|
||||
if node.getBoundingBox().width < 300 or node.getBoundingBox().depth < 300:
|
||||
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(current_node, min_offset=self._min_offset)
|
||||
else:
|
||||
node_too_big = True
|
||||
nodes = []
|
||||
found_solution_for_all = True
|
||||
for i in range(self._count):
|
||||
# We do place the nodes one by one, as we want to yield in between.
|
||||
node, solution_found = arranger.findNodePlacement(current_node, offset_shape_arr, hull_shape_arr)
|
||||
if not solution_found:
|
||||
if not node_too_big:
|
||||
node, solution_found = arranger.findNodePlacement(current_node, offset_shape_arr, hull_shape_arr)
|
||||
if node_too_big or not solution_found:
|
||||
found_solution_for_all = False
|
||||
new_location = node.getPosition()
|
||||
new_location = new_location.set(z = 100 - i * 20)
|
||||
|
@ -72,4 +77,4 @@ class MultiplyObjectsJob(Job):
|
|||
|
||||
if not found_solution_for_all:
|
||||
no_full_solution_message = Message(i18n_catalog.i18nc("@info:status", "Unable to find a location within the build volume for all objects"))
|
||||
no_full_solution_message.show()
|
||||
no_full_solution_message.show()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue