From 297e922daf7c2125bebef71ed5e581fbae559780 Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Tue, 16 May 2023 12:04:50 +0800 Subject: [PATCH] FIX: crash when slicing(make perimeters) Udesk: https://bblcs.s5.udesk.cn/entry/ticket/show/2193141 Change-Id: Ibb2e20e9e6d159821e96dc81fd4e384f773a39dc --- src/libslic3r/Geometry/VoronoiOffset.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libslic3r/Geometry/VoronoiOffset.cpp b/src/libslic3r/Geometry/VoronoiOffset.cpp index 46105220a..ed8d9c2b1 100644 --- a/src/libslic3r/Geometry/VoronoiOffset.cpp +++ b/src/libslic3r/Geometry/VoronoiOffset.cpp @@ -782,6 +782,9 @@ void annotate_inside_outside(VD &vd, const Lines &lines) for (const VD::edge_type &edge : vd.edges()) if (edge.vertex1() == nullptr) { + if (edge.vertex0() == nullptr) + continue; + // Infinite Voronoi edge separating two Point sites or a Point site and a Segment site. // Infinite edge is always outside and it references at least one valid vertex. assert(edge.is_infinite()); @@ -888,6 +891,9 @@ void annotate_inside_outside(VD &vd, const Lines &lines) for (const VD::edge_type &edge : vd.edges()) { assert((edge_category(edge) == EdgeCategory::Unknown) == (edge_category(edge.twin()) == EdgeCategory::Unknown)); if (edge_category(edge) == EdgeCategory::Unknown) { + if (!edge.is_finite()) + continue; + assert(edge.is_finite()); const VD::cell_type &cell = *edge.cell(); const VD::cell_type &cell2 = *edge.twin()->cell();