mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-25 13:27:56 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user