Skip to main content

Module solid

Module solid 

Source
Expand description

IfcGeometricModelResource: solids, tessellation and booleans.

§What this module is

Read-only typed views over the 42 entities of the IFC4 ADD2 TC1 IfcGeometricModelResource schema. Each view is a newtype over (EntityId, &Entity) with named accessors and a mod slot block citing the EXPRESS declaration. Views borrow and own nothing, so constructing one is free and the model remains the single source of truth.

§What this module deliberately does NOT do

It does not triangulate, evaluate booleans, build meshes, or resolve units. Those belong to a geometry kernel and to crate::units. A view’s job is to say faithfully what the file contains, including the parts a naive reader gets wrong.

§The three counting conventions that must not be confused

  1. Attribute slots are absolute. Inherited attributes come first, so IfcExtrudedAreaSolid.SweptArea is slot 0 (inherited from IfcSweptAreaSolid) and Depth is slot 3. Local, per-subtype numbering is never used anywhere in this module.
  2. Vertex indices are 1-based. CoordIndex, PnIndex and InnerCoordIndices all count from 1. See tessellated.
  3. Measures are in file units. Lengths and angles are returned raw; IfcRevolvedAreaSolid.Angle is very often in degrees.

§The map from schema to module

ModuleEntities
sweptthe 9 swept solids plus IfcSectionedSpine
brepthe 5 IfcManifoldSolidBrep types
csgIfcCsgSolid plus the 6 primitive types
halfspacethe 3 half spaces
booleanIfcBooleanResult, IfcBooleanClippingResult
tessellatedthe 6 tessellation types
surface_modelthe 2 surface models and 2 geometric sets
bboxIfcBoundingBox

§Volume semantics, in one place

Only some of these entities enclose a volume, and confusing the categories is the most consequential mistake a consumer can make:

  • Finite solids: swept solids, breps, CSG solids and primitives.
  • Infinite: IfcHalfSpaceSolid and its subtypes. Only ever a boolean operand; never tessellate one on its own. See halfspace.
  • Conditionally solid: the tessellated face sets, but only when Closed is TRUE.
  • Never solid: the surface models and geometric sets in surface_model, and IfcBoundingBox, which is a proxy extent.

SolidKind::classify turns that table into a dispatch a caller can use rather than re-deriving from type names.

Re-exports§

pub use bbox::BoundingBox;
pub use boolean::BooleanClippingResult;
pub use boolean::BooleanOperator;
pub use boolean::BooleanResult;
pub use boolean::IfcBooleanOperator;
pub use boolean::OperandKind;
pub use boolean::ParseIfcBooleanOperatorError;
pub use brep::AdvancedBrep;
pub use brep::AdvancedBrepWithVoids;
pub use brep::FacetedBrep;
pub use brep::FacetedBrepWithVoids;
pub use brep::ManifoldSolidBrep;
pub use csg::Block;
pub use csg::CsgPrimitive3D;
pub use csg::CsgSolid;
pub use csg::RectangularPyramid;
pub use csg::RightCircularCone;
pub use csg::RightCircularCylinder;
pub use csg::Sphere;
pub use halfspace::BoxedHalfSpace;
pub use halfspace::HalfSpaceSolid;
pub use halfspace::PolygonalBoundedHalfSpace;
pub use surface_model::FaceBasedSurfaceModel;
pub use surface_model::GeometricCurveSet;
pub use surface_model::GeometricSet;
pub use surface_model::ShellBasedSurfaceModel;
pub use swept::ExtrudedAreaSolid;
pub use swept::ExtrudedAreaSolidTapered;
pub use swept::FixedReferenceSweptAreaSolid;
pub use swept::RevolvedAreaSolid;
pub use swept::RevolvedAreaSolidTapered;
pub use swept::SectionedSpine;
pub use swept::SurfaceCurveSweptAreaSolid;
pub use swept::SweptAreaSolid;
pub use swept::SweptDiskSolid;
pub use swept::SweptDiskSolidPolygonal;
pub use swept::TrimMeasure;
pub use tessellated::IndexedPolygonalFace;
pub use tessellated::IndexedPolygonalFaceWithVoids;
pub use tessellated::PolygonalFaceSet;
pub use tessellated::TessellatedFaceSet;
pub use tessellated::TessellatedItem;
pub use tessellated::TriangulatedFaceSet;

Modules§

bbox
IfcBoundingBox: an axis-aligned box, and the trap in what it is aligned to.
boolean
Booleans: IfcBooleanResult and the clipping specialisation.
brep
Boundary representations: IfcManifoldSolidBrep and its subtypes.
csg
CSG: analytic primitives and the solid that roots a CSG tree.
halfspace
Half spaces: infinite solids, valid only as boolean operands.
surface_model
Surface models and geometric sets: collections that are not solids.
swept
Swept solids: a cross section dragged along a path.
tessellated
Tessellated geometry: explicit meshes addressed by index.

Enums§

SolidKind
Which family of IfcGeometricModelResource an entity belongs to.