From 08c2bf665c1e108f6f18108776a928831541e5a1 Mon Sep 17 00:00:00 2001 From: "shuai.liu" Date: Thu, 15 Jun 2023 16:39:27 +0800 Subject: [PATCH] FIX: STUDIO-2246 flatten bug Fix the flatten bug Change-Id: I448704dc9180cdd3f1142c988d0000f053417c9c (cherry picked from commit a8e35d1fef183f907e78124a3b73bd0cabb69e9b) --- src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp b/src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp index 9c65f18eb..4ad8136bb 100644 --- a/src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp +++ b/src/slic3r/GUI/Gizmos/GLGizmoFlatten.cpp @@ -141,6 +141,7 @@ void GLGizmoFlatten::update_planes() // Following constants are used for discarding too small polygons. const float minimal_area = 5.f; // in square mm (world coordinates) const float minimal_side = 1.f; // mm + const float minimal_angle = 1.f; // degree, initial value was 10, but cause bugs // Now we'll go through all the facets and append Points of facets sharing the same normal. // This part is still performed in mesh coordinate system. @@ -235,7 +236,7 @@ void GLGizmoFlatten::update_planes() discard = true; else { // We also check the inner angles and discard polygons with angles smaller than the following threshold - const double angle_threshold = ::cos(10.0 * (double)PI / 180.0); + const double angle_threshold = ::cos(minimal_angle * (double)PI / 180.0); for (unsigned int i = 0; i < polygon.size(); ++i) { const Vec3d& prec = polygon[(i == 0) ? polygon.size() - 1 : i - 1];