Split pieces stay separate faces: Measure counts them apart and Offset Face moves only the picked piece
The merged face count no longer joins faces across a Split Face line, and Offset Face's same-surface grouping stops there. A piece whose move the body's topology cannot follow (its neighbour stays put) is swept along its normal and joined on or cut in, giving walls along the split line as in Fusion. Engine test: a split box top counts 7 faces; one half up 5 (27000 mm³), the other down 3 (25200 mm³). Fixes #12 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT
This commit is contained in:
1 parent
a00153fc99
commit
141f3acc85
5 files changed
+51
-5
No files matched your search
@@ -746,7 +746,7 @@ pub(crate) fn draft_walls(b: &Body, chosen: &[usize], neutral: &solvecraft_geom:
|
||||
}
|
||||
|
||||
/// The chosen faces and every face on the same surface joined to them (the halves of a hole's
|
||||
/// wall), as face indices.
|
||||
/// wall), as face indices. Pieces of a face split on purpose (Split Face) stay apart.
|
||||
pub fn with_same_surface(b: &Body, chosen: &[usize]) -> Vec<usize> {
|
||||
let faces: Vec<mt::Face> = b.solid.face_iter().cloned().collect();
|
||||
let size = b.size();
|
||||
@@ -766,6 +766,7 @@ pub fn with_same_surface(b: &Body, chosen: &[usize]) -> Vec<usize> {
|
||||
}
|
||||
_ => false,
|
||||
};
|
||||
let keep = b.split_keep();
|
||||
let mut out: Vec<usize> = chosen.to_vec();
|
||||
let mut grew = true;
|
||||
while grew {
|
||||
@@ -777,7 +778,12 @@ pub fn with_same_surface(b: &Body, chosen: &[usize]) -> Vec<usize> {
|
||||
let Some(Some(si)) = surfs.get(i) else { continue };
|
||||
let joins = out.iter().any(|j| {
|
||||
surfs.get(*j).and_then(|x| x.as_ref()).is_some_and(|sj| same(si, sj))
|
||||
&& faces.get(*j).is_some_and(|g| g.edge_iter().any(|e| f.edge_iter().any(|x| x.id() == e.id())))
|
||||
&& faces.get(*j).is_some_and(|g| {
|
||||
g.edge_iter().any(|e| {
|
||||
f.edge_iter().any(|x| x.id() == e.id())
|
||||
&& (keep.is_empty() || !crate::heal::on_split_line(&crate::heal::edge_points(&e), keep))
|
||||
})
|
||||
})
|
||||
});
|
||||
if joins {
|
||||
out.push(i);
|
||||
|
||||
Reference in new issue
Block a user