mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Added message if arrange all could not find location for all objects
CURA-3239
This commit is contained in:
parent
2008383118
commit
b2183352b8
2 changed files with 7 additions and 1 deletions
|
@ -53,7 +53,7 @@ class Arrange:
|
||||||
points = copy.deepcopy(vertices._points)
|
points = copy.deepcopy(vertices._points)
|
||||||
shape_arr = ShapeArray.fromPolygon(points, scale = scale)
|
shape_arr = ShapeArray.fromPolygon(points, scale = scale)
|
||||||
arranger.place(0, 0, shape_arr)
|
arranger.place(0, 0, shape_arr)
|
||||||
|
|
||||||
# If a build volume was set, add the disallowed areas
|
# If a build volume was set, add the disallowed areas
|
||||||
if Arrange.build_volume:
|
if Arrange.build_volume:
|
||||||
disallowed_areas = Arrange.build_volume.getDisallowedAreas()
|
disallowed_areas = Arrange.build_volume.getDisallowedAreas()
|
||||||
|
|
|
@ -46,6 +46,7 @@ class ArrangeObjectsJob(Job):
|
||||||
last_priority = start_priority
|
last_priority = start_priority
|
||||||
last_size = None
|
last_size = None
|
||||||
grouped_operation = GroupedOperation()
|
grouped_operation = GroupedOperation()
|
||||||
|
found_solution_for_all = True
|
||||||
for idx, (size, node, offset_shape_arr, hull_shape_arr) in enumerate(nodes_arr):
|
for idx, (size, node, offset_shape_arr, hull_shape_arr) in enumerate(nodes_arr):
|
||||||
# For performance reasons, we assume that when a location does not fit,
|
# For performance reasons, we assume that when a location does not fit,
|
||||||
# it will also not fit for the next object (while what can be untrue).
|
# it will also not fit for the next object (while what can be untrue).
|
||||||
|
@ -70,6 +71,7 @@ class ArrangeObjectsJob(Job):
|
||||||
grouped_operation.addOperation(TranslateOperation(node, Vector(x, center_y, y), set_position = True))
|
grouped_operation.addOperation(TranslateOperation(node, Vector(x, center_y, y), set_position = True))
|
||||||
else:
|
else:
|
||||||
Logger.log("d", "Arrange all: could not find spot!")
|
Logger.log("d", "Arrange all: could not find spot!")
|
||||||
|
found_solution_for_all = False
|
||||||
grouped_operation.addOperation(TranslateOperation(node, Vector(200, center_y, - idx * 20), set_position = True))
|
grouped_operation.addOperation(TranslateOperation(node, Vector(200, center_y, - idx * 20), set_position = True))
|
||||||
|
|
||||||
status_message.setProgress((idx + 1) / len(nodes_arr) * 100)
|
status_message.setProgress((idx + 1) / len(nodes_arr) * 100)
|
||||||
|
@ -78,3 +80,7 @@ class ArrangeObjectsJob(Job):
|
||||||
grouped_operation.push()
|
grouped_operation.push()
|
||||||
|
|
||||||
status_message.hide()
|
status_message.hide()
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue