From 81d85c56cf36c85ba0185f1abca3ee3f20395a0b Mon Sep 17 00:00:00 2001 From: Florian Fontan Date: Tue, 28 Apr 2026 10:48:17 +0200 Subject: [PATCH] Fix boolean operation with Full element and single intersection --- src/boolean_operations.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/boolean_operations.cpp b/src/boolean_operations.cpp index 3292ba4..4b2dfc9 100644 --- a/src/boolean_operations.cpp +++ b/src/boolean_operations.cpp @@ -502,6 +502,19 @@ ComputeSplittedElementsOutput compute_splitted_elements( << " component_id " << component_id << std::endl; #endif + + // A Full circle with exactly one intersection point cannot be split into + // two arcs. Add the antipodal point as a fake second split point so the + // existing splitting logic produces two proper anticlockwise arcs. + if (element.type == ShapeElementType::CircularArc + && element.orientation == ShapeElementOrientation::Full + && elements_intersections[element_pos].size() == 1) { + const Point& p = elements_intersections[element_pos].front(); + elements_intersections[element_pos].push_back({ + 2 * element.center.x - p.x, + 2 * element.center.y - p.y}); + } + // Sort intersection points of this element. std::sort( elements_intersections[element_pos].begin(),