From 3cce9b09ede4b41481d7ae55dc642b594fc25a6a Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Sun, 31 May 2026 22:34:32 +0800 Subject: [PATCH] Cut: Make sure x offset is considered when checking multi dovetail (#13945) Make sure x offset is considered when checking multi dovetail (OrcaSlicer/OrcaSlicer#13940) --- src/slic3r/GUI/Gizmos/GLGizmoCut.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp index ea8d3c374f..d978c0d47f 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoCut.cpp @@ -793,6 +793,8 @@ indexed_triangle_set GLGizmoCut3D::its_make_groove_plane() indexed_triangle_set mesh; // handle multiple dovetails/grooves + m_groove_vertices.clear(); + m_groove_vertices.reserve(8 * groove_count); for (int i = 0; i < groove_count; ++i) { bool is_first_groove = i == 0; // when a groove is not the last groove, then limit the extent of the right plane so that it doesnt overlap the next groove bool is_last_groove = i == groove_count - 1; // do the same in reverse if a groove is not the first groove @@ -806,17 +808,14 @@ indexed_triangle_set GLGizmoCut3D::its_make_groove_plane() // Vertices of the groove used to detection if groove is valid (not used in mesh) { - m_groove_vertices.clear(); - m_groove_vertices.reserve(8); - - m_groove_vertices.emplace_back(Vec3f(-slot_neck_outer_x, -plane_half_height, slot_front_z).cast()); - m_groove_vertices.emplace_back(Vec3f(-slot_mouth_inner_x, plane_half_height, slot_front_z).cast()); - m_groove_vertices.emplace_back(Vec3f(-slot_mouth_outer_x, -plane_half_height, slot_back_z).cast()); - m_groove_vertices.emplace_back(Vec3f(-slot_neck_outer_x, plane_half_height, slot_back_z).cast()); - m_groove_vertices.emplace_back(Vec3f(slot_neck_outer_x, -plane_half_height, slot_front_z).cast()); - m_groove_vertices.emplace_back(Vec3f(slot_mouth_inner_x, plane_half_height, slot_front_z).cast()); - m_groove_vertices.emplace_back(Vec3f(slot_mouth_outer_x, -plane_half_height, slot_back_z).cast()); - m_groove_vertices.emplace_back(Vec3f(slot_neck_outer_x, plane_half_height, slot_back_z).cast()); + m_groove_vertices.emplace_back(Vec3f(-slot_neck_outer_x + offset_x, -plane_half_height, slot_front_z).cast()); + m_groove_vertices.emplace_back(Vec3f(-slot_mouth_inner_x + offset_x, plane_half_height, slot_front_z).cast()); + m_groove_vertices.emplace_back(Vec3f(-slot_mouth_outer_x + offset_x, -plane_half_height, slot_back_z).cast()); + m_groove_vertices.emplace_back(Vec3f(-slot_neck_outer_x + offset_x, plane_half_height, slot_back_z).cast()); + m_groove_vertices.emplace_back(Vec3f(slot_neck_outer_x + offset_x, -plane_half_height, slot_front_z).cast()); + m_groove_vertices.emplace_back(Vec3f(slot_mouth_inner_x + offset_x, plane_half_height, slot_front_z).cast()); + m_groove_vertices.emplace_back(Vec3f(slot_mouth_outer_x + offset_x, -plane_half_height, slot_back_z).cast()); + m_groove_vertices.emplace_back(Vec3f(slot_neck_outer_x + offset_x, plane_half_height, slot_back_z).cast()); } // ___