Wave 158/509: solidcraft-smlib: Brep::split_faces and Brep::split_body on the fork's split shims (and 1 more)

2 commits, squashed; the originals stay reachable from tag archive/merge-main-develop.

- e520c9d42 jyviko: kernel: a body's record may be a surface body of open shells
- befcfecb7 jyviko: solidcraft-smlib: Brep::split_faces and Brep::split_body on the fork's split shims

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DtL5M41G8Nua7HvuFPZkmJ
This commit is contained in:
jyviko
2026-10-22 00:42:30 -04:00
parent 60244c2dcd
commit b885929d8a
7 changed files with 135 additions and 4 deletions
+6 -4
View File
@@ -358,10 +358,11 @@ fn same_shared<T: PartialEq>(a: &Option<std::sync::Arc<T>>, b: &Option<std::sync
}
/// `record`, checked to be a body's: valid structure (budgets, references, loops, regions,
/// canonical order) and some bounded material.
/// canonical order) and at least one face. A solid's faces bound material; a surface body's lie
/// in open shells.
fn solid_record(record: Brep) -> Result<Brep> {
record.validate().map_err(|e| KernelError::Invalid(e.to_string()))?;
if record.faces.is_empty() || record.material_regions().is_empty() {
if record.faces.is_empty() {
return Err(KernelError::Failed("empty result".into()));
}
Ok(record)
@@ -405,8 +406,9 @@ impl Body {
}
}
/// The solid body of a schema 4 record: checked for structure (budgets, references, loops,
/// regions, canonical order) and for bounding material. Its faces face as the record says.
/// The body of a schema 4 record (a solid, or a surface body of open shells): checked for
/// structure (budgets, references, loops, regions, canonical order). Its faces face as the
/// record says.
pub(crate) fn from_record(record: Brep) -> Result<Body> {
Ok(Body::bare(solid_record(record)?, None, None))
}