diff options
author | Remco Burema <r.burema@ultimaker.com> | 2019-09-10 00:25:16 +0300 |
---|---|---|
committer | Remco Burema <r.burema@ultimaker.com> | 2019-09-10 00:25:16 +0300 |
commit | c7bae1e8fc665ff04272dbd2ff2f3d29273bfb10 (patch) | |
tree | 1bafab83775693996cc39c8fd0ddc9171c736d8f | |
parent | ddcd8e40cc5fa030a08f2742848f916cba0506ef (diff) |
Move 'lay flat by face' operation to Uranium.
-rw-r--r-- | cura/CuraActions.py | 33 |
1 files changed, 0 insertions, 33 deletions
diff --git a/cura/CuraActions.py b/cura/CuraActions.py index 3a1b35d987..b92abbe706 100644 --- a/cura/CuraActions.py +++ b/cura/CuraActions.py @@ -75,39 +75,6 @@ class CuraActions(QObject): operation.addOperation(center_operation) operation.push() - # Rotate the selection, so that the face that the mouse-pointer is on, faces the build-plate. - @pyqtSlot() - def bottomFaceSelection(self) -> None: - selected_face = Selection.getSelectedFace() - if not selected_face: - Logger.log("e", "Bottom face operation shouldn't have been called without a selected face.") - return - - original_node, face_id = selected_face - meshdata = original_node.getMeshDataTransformed() - if not meshdata or face_id < 0 or face_id > Selection.getMaxFaceSelectionId(): - return - - rotation_point, face_normal = meshdata.getFacePlane(face_id) - rotation_point_vector = Vector(rotation_point[0], rotation_point[1], rotation_point[2]) - face_normal_vector = Vector(face_normal[0], face_normal[1], face_normal[2]) - rotation_quaternion = Quaternion.rotationTo(face_normal_vector.normalized(), Vector(0.0, -1.0, 0.0)) - - operation = GroupedOperation() - current_node = None # type: Optional[SceneNode] - for node in Selection.getAllSelectedObjects(): - current_node = node - parent_node = current_node.getParent() - while parent_node and parent_node.callDecoration("isGroup"): - current_node = parent_node - parent_node = current_node.getParent() - if current_node is None: - return - - rotate_operation = RotateOperation(current_node, rotation_quaternion, rotation_point_vector) - operation.addOperation(rotate_operation) - operation.push() - ## Multiply all objects in the selection # # \param count The number of times to multiply the selection. |