pub enum SolidKind {
Swept,
Brep,
Csg,
HalfSpace,
Boolean,
Tessellated,
SurfaceModel,
BoundingBox,
SectionedSpine,
}Expand description
Which family of IfcGeometricModelResource an entity belongs to.
§Why classify at all
A representation item arrives as an untyped entity, and the correct handling differs by family in ways that are not recoverable later: a half space must be routed into a boolean, a boolean must be walked as a tree, a face set must have its 1-based indices converted. Deciding once, by name, keeps that dispatch out of every call site and keeps the volume semantics table in a single place.
Variants§
Swept
A swept solid: extrusion, revolution, directrix sweep or swept disk.
Brep
A boundary representation.
Csg
A CSG solid or one of the analytic primitives.
HalfSpace
A half space. Infinite; only valid as a boolean operand.
Boolean
A boolean result. Its operands form a tree and may nest.
Tessellated
A tessellated face set. Solid only when its Closed flag is TRUE.
SurfaceModel
A surface model or geometric set. Never encloses a volume.
BoundingBox
An IfcBoundingBox: a proxy extent, not geometry to build.
SectionedSpine
IfcSectionedSpine: cross sections along a spine.
Kept apart from Self::Swept because it subtypes
IfcGeometricRepresentationItem directly, has a different slot layout,
and needs interpolation a plain sweep does not.
Implementations§
Source§impl SolidKind
impl SolidKind
Sourcepub fn classify(type_name: &str) -> Option<Self>
pub fn classify(type_name: &str) -> Option<Self>
Classify an IFC type name, case-insensitively.
Returns None for anything outside this schema, so a caller can pass
any representation item and route the rest elsewhere.
Sourcepub fn is_finite_solid(self) -> bool
pub fn is_finite_solid(self) -> bool
Does this family enclose a finite volume on its own?
false for half spaces (infinite), booleans (depends on the operands),
tessellated sets (depends on Closed), surface models and bounding
boxes. A true here is the only safe licence to compute a volume
without further checks.
Sourcepub fn requires_boolean_context(self) -> bool
pub fn requires_boolean_context(self) -> bool
Must this be routed through a boolean rather than built directly?
true only for half spaces. Anything else may be built standalone,
though not everything built will have a volume.