From 2de1f3aa45cd609f4c6adad3a56137fc9955bada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Hejl?= Date: Wed, 17 Apr 2024 14:10:42 +0200 Subject: [PATCH] SPE-2256: Fix the issue that we used the old Voronoi graph during the detection of invalid Voronoi diagrams. This happens because we didn't set a modified flag that is required to be set before we use the new Voronoi graph. Possibly related to #12385 --- src/libslic3r/Geometry/Voronoi.cpp | 6 +++--- tests/libslic3r/test_voronoi.cpp | 7 ++----- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libslic3r/Geometry/Voronoi.cpp b/src/libslic3r/Geometry/Voronoi.cpp index e1df7322a4..947c56a707 100644 --- a/src/libslic3r/Geometry/Voronoi.cpp +++ b/src/libslic3r/Geometry/Voronoi.cpp @@ -147,6 +147,9 @@ void VoronoiDiagram::copy_to_local(voronoi_diagram_type &voronoi_diagram) { new_edge.prev(&m_edges[prev_edge_idx]); } } + + m_voronoi_diagram.clear(); + m_is_modified = true; } template @@ -345,9 +348,6 @@ VoronoiDiagram::try_to_repair_degenerated_voronoi_diagram_by_rotation(const Segm for (vertex_type &vertex : m_vertices) vertex.color(0); - m_voronoi_diagram.clear(); - m_is_modified = true; - return issue_type; } diff --git a/tests/libslic3r/test_voronoi.cpp b/tests/libslic3r/test_voronoi.cpp index f5fe098818..cd022bf616 100644 --- a/tests/libslic3r/test_voronoi.cpp +++ b/tests/libslic3r/test_voronoi.cpp @@ -1,12 +1,8 @@ #include -#include #include #include #include -#include -#include "libslic3r/Geometry/VoronoiUtilsCgal.hpp" - #include #include @@ -15,7 +11,8 @@ // #define VORONOI_DEBUG_OUT #ifdef VORONOI_DEBUG_OUT -#include +#include +#include #endif using boost::polygon::voronoi_builder;