mirror of
https://github.com/bherbruck/solidcraft.git
synced 2026-11-04 02:55:54 +00:00
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:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user