feat: pick sketch profiles by their bounding curve ids so features keep the same region when parameters move the geometry, matching curves cut into pieces, refusing ambiguous or missing picks instead of taking another region, and storing point picks by curves
This commit is contained in:
1 parent
22672585c9
commit
848e7aec0e
11 files changed
+342
-60
No files matched your search
@@ -2682,19 +2682,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(),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user