Skip to content

Commit

Permalink
Revert "Use absolute transformation to set location for arrange"
Browse files Browse the repository at this point in the history
This reverts commit 920809f.
  • Loading branch information
casperlamboo authored and vadim-danilchik committed Dec 8, 2023
1 parent ae00b46 commit 61d7755
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions cura/Arranging/Nest2DArrange.py
Expand Up @@ -14,7 +14,7 @@
from UM.Math.Vector import Vector
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.GroupedOperation import GroupedOperation
from UM.Operations.SetTransformOperation import SetTransformOperation
from UM.Operations.RotateOperation import RotateOperation
from UM.Operations.TranslateOperation import TranslateOperation
from cura.Arranging.Arranger import Arranger

Expand Down Expand Up @@ -140,17 +140,13 @@ def createGroupOperationForArrange(self, add_new_nodes_in_scene: bool = False) -
grouped_operation.addOperation(AddSceneNodeOperation(node, scene_root))

if node_item.binId() == 0:
# We found a spot for it
rotation_matrix = Matrix()
rotation_matrix.setByRotationAxis(node_item.rotation(), Vector(0, -1, 0))

orientation = node.getWorldOrientation() * Quaternion.fromMatrix(rotation_matrix)
translation = node.getWorldPosition().preMultiply(rotation_matrix) + Vector(
node_item.translation().x() / self._factor,
0,
node_item.translation().y() / self._factor
)
grouped_operation.addOperation(RotateOperation(node, Quaternion.fromMatrix(rotation_matrix)))
grouped_operation.addOperation(
SetTransformOperation(node, orientation=orientation, translation=translation))
TranslateOperation(node, Vector(node_item.translation().x() / self._factor, 0,
node_item.translation().y() / self._factor)))
else:
# We didn't find a spot
grouped_operation.addOperation(
Expand Down

0 comments on commit 61d7755

Please sign in to comment.