Remove the old arrange from mesh placement on load

For some reaso it was also handling the move up to the buildplate (which it
really shouldn't do)

CURA-7440
This commit is contained in:
Jaime van Kessel 2020-10-05 10:22:39 +02:00
parent 274dc8d06c
commit 2d084c9e2b
No known key found for this signature in database
GPG Key ID: 3710727397403C91

View File

@ -1815,17 +1815,13 @@ class CuraApplication(QtApplication):
for node_ in DepthFirstIterator(root):
if node_.callDecoration("isSliceable") and node_.callDecoration("getBuildPlateNumber") == target_build_plate:
fixed_nodes.append(node_)
machine_width = global_container_stack.getProperty("machine_width", "value")
machine_depth = global_container_stack.getProperty("machine_depth", "value")
arranger = Arrange.create(x = machine_width, y = machine_depth, fixed_nodes = fixed_nodes)
min_offset = 8
default_extruder_position = self.getMachineManager().defaultExtruderPosition
default_extruder_id = self._global_container_stack.extruderList[int(default_extruder_position)].getId()
select_models_on_load = self.getPreferences().getValue("cura/select_models_on_load")
for original_node in nodes:
# Create a CuraSceneNode just if the original node is not that type
if isinstance(original_node, CuraSceneNode):
node = original_node
@ -1834,7 +1830,7 @@ class CuraApplication(QtApplication):
node.setMeshData(original_node.getMeshData())
# Setting meshdata does not apply scaling.
if(original_node.getScale() != Vector(1.0, 1.0, 1.0)):
if original_node.getScale() != Vector(1.0, 1.0, 1.0):
node.scale(original_node.getScale())
node.setSelectable(True)
@ -1865,19 +1861,13 @@ class CuraApplication(QtApplication):
if file_extension != "3mf":
if node.callDecoration("isSliceable"):
# Only check position if it's not already blatantly obvious that it won't fit.
if node.getBoundingBox() is None or self._volume.getBoundingBox() is None or node.getBoundingBox().width < self._volume.getBoundingBox().width or node.getBoundingBox().depth < self._volume.getBoundingBox().depth:
# Find node location
offset_shape_arr, hull_shape_arr = ShapeArray.fromNode(node, min_offset = min_offset)
# Ensure that the bottom of the bounding box is on the build plate
if node.getBoundingBox():
center_y = node.getWorldPosition().y - node.getBoundingBox().bottom
else:
center_y = 0
# If a model is to small then it will not contain any points
if offset_shape_arr is None and hull_shape_arr is None:
Message(self._i18n_catalog.i18nc("@info:status", "The selected model was too small to load."),
title = self._i18n_catalog.i18nc("@info:title", "Warning")).show()
return
# Step is for skipping tests to make it a lot faster. it also makes the outcome somewhat rougher
arranger.findNodePlacement(node, offset_shape_arr, hull_shape_arr, step = 10)
node.translate(Vector(0, center_y, 0))
# This node is deep copied from some other node which already has a BuildPlateDecorator, but the deepcopy
# of BuildPlateDecorator produces one that's associated with build plate -1. So, here we need to check if