From f4b114ae781a950939c3471701e83985bd49108e Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 20 Nov 2026 19:16:06 -0800 Subject: [PATCH] Path Precision Tools: check each place along the first segment once When the same segment appears more than once among the second segments, its roots were found once per copy, and each copy's places were checked against every second segment. The sorted places now drop exact repeats before they are checked. Places that differ, however close, are all kept, so the circles found do not change. --- .../pathops/src/addons/pathtools/tangent_circle/on_segments.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/pathops/src/addons/pathtools/tangent_circle/on_segments.rs b/crates/pathops/src/addons/pathtools/tangent_circle/on_segments.rs index f5d4df2647..82d2f2c7a0 100644 --- a/crates/pathops/src/addons/pathtools/tangent_circle/on_segments.rs +++ b/crates/pathops/src/addons/pathtools/tangent_circle/on_segments.rs @@ -265,7 +265,9 @@ pub fn circles_of_radius(first: CubicBez, second: &[CubicBez], radius: f64) -> V roots(&samples, dist, CONTACT * radius) }) .collect(); + // A segment repeated in `second` gives the same places again; each is checked once. ts.sort_by(f64::total_cmp); + ts.dedup(); for t in ts { if let Some(c) = center(t) && let Some(touch) = touching(c, radius, second, own)