Merge pull request #117 from CypherNaught-0x/feat/profiles-by-curve-ids

Profiles can be picked by the curves around them, and point picks are stored that way
This commit is contained in:
bherbruck authored and GitHub committed 2026-10-11 09:28:43 -04:00
commit ce46faa19d
11 files changed
+343 -61

No files matched your search

+2 -13
View File
@@ -2923,19 +2923,8 @@ pub(crate) fn profile_indices(ss: &solvecraft_engine::doc::SolvedSketch, sel: &P
match sel {
ProfileSel::All => (0..ps.len()).collect(),
ProfileSel::Indices { indices } => indices.iter().copied().filter(|i| *i < ps.len()).collect(),
ProfileSel::Curves { loops } => loops
.iter()
.filter_map(|l| {
let mut want: Vec<&String> = l.iter().collect();
want.sort();
ps.iter().position(|p| {
let mut have: Vec<&String> = p.outer_curves.iter().collect();
have.sort();
have == want
})
})
.collect(),
ProfileSel::Points { points } => points.iter().filter_map(|q| ps.iter().position(|p| p.region.contains(*q))).collect(),
ProfileSel::Curves { loops } => loops.iter().filter_map(|l| solvecraft_engine::doc::sketch::profile_by_curves(ps, l).ok()).collect(),
ProfileSel::Points { points } => points.iter().filter_map(|q| solvecraft_engine::doc::sketch::profile_at_point(ps, *q)).collect(),
}
}