From c9f807f4bb94f411ffb15cf44e17be3937ece3bf Mon Sep 17 00:00:00 2001 From: enricoturri1966 Date: Tue, 21 Feb 2023 10:29:02 +0100 Subject: [PATCH] Fixed rotation of volumes in Part Coordinates when the instance matrix contains anisotropic scale --- src/slic3r/GUI/Selection.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 0f6409cd17..e4f59dcc7d 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -1041,10 +1041,9 @@ void Selection::rotate(const Vec3d& rotation, TransformationType transformation_ rotation_matrix = rotation_matrix.inverse(); // ensure that the volume rotates as a rigid body - const Geometry::TransformationSVD svd(world_trafo); - if (svd.anisotropic_scale) { - const Transform3d vol_scale_matrix = vol_trafo.get_scaling_factor_matrix(); - rotation_matrix = vol_scale_matrix.inverse() * rotation_matrix * vol_scale_matrix; + if (Geometry::TransformationSVD(world_trafo).anisotropic_scale) { + const Transform3d inst_scale_matrix = inst_trafo.get_scaling_factor_matrix(); + rotation_matrix = inst_scale_matrix.inverse() * rotation_matrix * inst_scale_matrix; } } } @@ -2762,6 +2761,7 @@ void Selection::render_debug_window() const return; ImGuiWrapper& imgui = *wxGetApp().imgui(); + ImGui::SetNextWindowCollapsed(true, ImGuiCond_Once); imgui.begin(std::string("Selection matrices"), ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoResize); auto volume_name = [this](size_t id) {