diff --git a/src/PartSegCore_compiled_backend/triangulation/triangulate.hpp b/src/PartSegCore_compiled_backend/triangulation/triangulate.hpp index 374c766..e362d78 100644 --- a/src/PartSegCore_compiled_backend/triangulation/triangulate.hpp +++ b/src/PartSegCore_compiled_backend/triangulation/triangulate.hpp @@ -1320,6 +1320,9 @@ struct GraphNode { * resulting sub-polygon contains unique edges. This operation can help to * resolve ambiguities in complex or self-intersecting polygons. * + * Note: Polygons with exactly 2 points are treated as single line segments and + * are not processed for edge deduplication between their first and last points. + * * @param polygon The input polygon represented as a list of edges. * * @return A vector of sub-polygons, where each sub-polygon is free of repeated @@ -1327,6 +1330,7 @@ struct GraphNode { */ inline std::vector> split_polygon_on_repeated_edges( const std::vector &polygon) { + if (polygon.size() < 3) return {polygon}; auto edges_dedup = calc_dedup_edges({polygon}); std::vector> result; point::Segment segment;