fix(trim): arc-arc intersections tested against wrong circle (#370)

cc_angles returns angles on the TARGET circle, but the arc-boundary arm
of arc_seg_ts filtered them against the BOUNDARY arc's angular span —
wrong circle, so arc×arc (and circle×arc, EXTEND-to-arc, bulge-polyline
segment) intersections were dropped and TRIM neither highlighted nor
cut. Re-express the intersection point as an angle on the boundary
circle before the span test, matching line_seg_ts/ellipse_seg_ts.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-21 22:45:28 +03:00
1 parent dc10c5dfba
commit bd27ee31d0
1 file changed
+8 -1
+8 -1
View File
@@ -543,7 +543,14 @@ fn arc_seg_ts(
}
cc_angles(cx, cy, r, *cx2, *cy2, *r2)
.into_iter()
.filter(|&a| in_arc(a, *a02, *a12))
.filter(|&a| {
// `a` lies on the TARGET circle — re-express the
// intersection point as an angle on the BOUNDARY
// circle before testing that arc's span (#370).
let px = cx + r * a.cos();
let py = cy + r * a.sin();
in_arc((py - cy2).atan2(px - cx2), *a02, *a12)
})
.collect()
}
Geo::Circle {