From 75f3d1bddbc5d39eaf360c63113ab0a0c8ba04cc Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Mon, 19 Sep 2022 10:56:32 +0200 Subject: [PATCH] Cut: fix cutting plane when object is anisotropically scaled --- src/slic3r/GUI/MeshUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MeshUtils.cpp b/src/slic3r/GUI/MeshUtils.cpp index 74fe82494..e7c1d0fe9 100644 --- a/src/slic3r/GUI/MeshUtils.cpp +++ b/src/slic3r/GUI/MeshUtils.cpp @@ -177,7 +177,7 @@ void MeshClipper::recalculate_triangles() // Now do the cutting MeshSlicingParams slicing_params; - slicing_params.trafo.rotate(Eigen::Quaternion::FromTwoVectors(up, Vec3d::UnitZ())); + slicing_params.trafo.rotate(Eigen::Quaternion::FromTwoVectors(up_noscale.cast(), Vec3d::UnitZ())); ExPolygons expolys = union_ex(slice_mesh(m_mesh->its, height_mesh, slicing_params)); @@ -188,7 +188,7 @@ void MeshClipper::recalculate_triangles() // Triangulate and rotate the cut into world coords: Eigen::Quaterniond q; - q.setFromTwoVectors(Vec3d::UnitZ(), up); + q.setFromTwoVectors(Vec3d::UnitZ(), up_noscale.cast()); Transform3d tr = Transform3d::Identity(); tr.rotate(q); tr = m_trafo.get_matrix() * tr;