kernel: a body's record may be a surface body of open shells

Surface operations make bodies whose faces lie in open shells; the record holds them as such.

(not built: base in progress)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017itGh5fpMEousnZ91cYcVt
This commit is contained in:
jyviko
2026-10-22 07:17:23 -04:00
parent 25b1286987
commit e520c9d424
+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))
}