From d8590ac0a83e3d34d903bb4726d7e8a7b9f6cef1 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 19 Nov 2021 10:56:07 +0100 Subject: [PATCH] Tiny eigen vectorization beautification. --- src/slic3r/GUI/MeshUtils.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/slic3r/GUI/MeshUtils.cpp b/src/slic3r/GUI/MeshUtils.cpp index 0c1e91c56..1e6812319 100644 --- a/src/slic3r/GUI/MeshUtils.cpp +++ b/src/slic3r/GUI/MeshUtils.cpp @@ -80,10 +80,9 @@ void MeshClipper::render_cut() void MeshClipper::recalculate_triangles() { const Transform3f& instance_matrix_no_translation_no_scaling = m_trafo.get_matrix(true,false,true).cast(); - const Vec3f& scaling = m_trafo.get_scaling_factor().cast(); // Calculate clipping plane normal in mesh coordinates. const Vec3f up_noscale = instance_matrix_no_translation_no_scaling.inverse() * m_plane.get_normal().cast(); - const Vec3d up (up_noscale(0)*scaling(0), up_noscale(1)*scaling(1), up_noscale(2)*scaling(2)); + const Vec3d up = up_noscale.cast().cwiseProduct(m_trafo.get_scaling_factor()); // Calculate distance from mesh origin to the clipping plane (in mesh coordinates). const float height_mesh = m_plane.distance(m_trafo.get_offset()) * (up_noscale.norm()/up.norm());