From 7c58cf267fbc23a98e6019ce17cdda6043170a2b Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Tue, 14 Feb 2023 08:25:59 +0100 Subject: [PATCH] Fixed rotation of parts, in Part Coordinates, when mirror is applied --- src/slic3r/GUI/Selection.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 099d54fa7a..5b44f4fd58 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1031,8 +1031,14 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_ rotation_matrix = rotation_matrix.inverse(); v.set_volume_transformation(vol_trafo.get_matrix() * cached_vol_rotation_matrix.inverse() * rotation_matrix * cached_vol_rotation_matrix); } - else + else { + if (transformation_type.local()) { + const Geometry::Transformation& vol_trafo = volume_data.get_volume_transform(); + if ((inst_trafo * vol_trafo).is_left_handed() && !rotation.normalized().isApprox(Vec3d::UnitX())) + rotation_matrix = rotation_matrix.inverse(); + } transform_volume_relative(v, volume_data, transformation_type, rotation_matrix, m_cache.dragging_center); + } } } }