Expand description
ifc-geometry — the IFC side of geometry.
§What this crate is
It answers “what does this IFC entity mean geometrically” and lowers
implemented slices into the format-neutral axiolid-model DAG. It does not
triangulate, evaluate NURBS, or perform booleans itself.
The opt-in compile feature is the one narrow exception: it hands the
lowered DAG to an Axiolid provider and returns triangles. It is off by
default because selecting a provider and a memory budget is application
policy, not something the IFC file determines. See the compile module
and ADR 0004.
ifc-model this crate geometry package
(untyped graph) --> typed/family views --> GeometryGraph
+ IFC resolution (implemented elsewhere)§Scope
The three IFC geometry resource schemas, counted from IFC4 ADD2 TC1:
| Schema | Entities | Types | Functions |
|---|---|---|---|
IfcGeometryResource | 59 | 14 | 25 |
IfcGeometricModelResource | 42 | 4 | 2 |
IfcGeometricConstraintResource | 11 | 5 | 1 |
§Design
Views and explicit inventory. The 89 concrete entities are represented by dedicated or shared subtype-aware borrowed views. The 23 abstract entities are inheritance/inventory entries, not falsely presented as constructible views. All 23 schema types are modeled.
Honest lowering. The dispatcher’s IMPLEMENTED list (in
lower::dispatch) names every representation-item type it lowers: swept,
CSG, boolean and half-space solids, faceted and advanced B-reps,
tessellated face sets, surfaces, curves, surface models, collections and
mapped items. Every other concrete IFC4 representation item has a
recorded disposition in data/ifc4-representation-item-dispositions.tsv
(nested input, non-shape, or typed refusal). Input that cannot be lowered
exactly returns a typed crate::GeometryError, such as
crate::GeometryError::Unsupported, rather than panicking or
substituting approximate geometry.
Neutral DAG output. Implemented lowerers resolve IFC units, placements,
profiles, and representation relationships into axiolid-model nodes. Active
lowering owns no duplicate geometry types and never selects a CPU/GPU
provider.
Feature lowering (default on) carries the neutral geometry crates.
Without it this crate is representation selection only – contexts,
plan/body choice, profiles, curves, surfaces, solids, units and
placements – and links no geometry code at all.
Re-exports§
pub use constraint::product_world_transform;pub use constraint::products_world_transforms;pub use error::GeometryError;pub use error::GeometryResult;pub use slots::Slots;pub use transform::Transform;pub use units::UnitScale;
Modules§
- authoring
- Author IFC geometry entities from plain numbers.
- constraint
IfcGeometricConstraintResource: object placement and grids.- curve
- Typed read-only views of the
IfcCurvefamily. - error
- Why interpreting a geometry entity failed.
- lower
- IFC-to-neutral-geometry lowering entry points.
- resource
IfcGeometryResource: the primitives everything else is built from.- rules
- EXPRESS
WHERErules: the schema’s own correctness conditions. - select
- EXPRESS
SELECTand defined types of the IFC geometry schema. - slots
- Shared attribute access for typed geometry views.
- solid
IfcGeometricModelResource: solids, tessellation and booleans.- surface
- Typed read-only views of the
IfcSurfacefamily. - transform
- Rigid transforms: the composition algebra placements reduce to.
- units
- Unit resolution: what one coordinate unit actually means.
Structs§
- Body
Description - The Body representation of one product, one entry per geometric item.
- Body
Item - One geometric representation item of a body.
- Cardinal
Point - Positive IFC cardinal reference. Standard values are 1 through 19.
- Geometry
Graph - Immutable acyclic geometry graph with one or more roots.
- Material
Layer SetUsage Geometry - Geometry-only projection of
IfcMaterialLayerSetUsage. - Material
Profile Geometry - Geometry-only projection of
IfcMaterialProfile. - Material
Profile SetUsage Geometry - Geometry-only projection of
IfcMaterialProfileSetUsage. - Material
Profile SetUsage Tapering Geometry - Geometry-only projection of
IfcMaterialProfileSetUsageTapering. - NodeId
- Stable index owned by one immutable
crate::GeometryGraph. - Product
Shape - One IfcProductRepresentation: the ordered representations of a product.
- Profile
Description - One
IfcProfileDef, resolved into its family parameters. - Profile
Operator IfcDerivedProfileDef.Operator: a 2D affine map applied to the parent.- Profile
Outline - An arbitrary profile’s boundaries as rings of vertices.
- Profile
Position IfcParameterizedProfileDef.Position: where the parameterised section sits in the profile plane.- Representation
- One IfcRepresentation: a named set of items in a context.
- Representation
Context - One
IfcGeometricRepresentationContextor its sub-context. - Swept
Solid - A swept-area solid: its profile, where it sits, and the path it follows.
- Voiding
Conflict - An opening that the file makes void a second host.
Enums§
- Analytic
Primitive - Exact primitive solid; tessellation is a separate operation.
- Body
Kind - How one representation item models its shape.
- Direction
Sense - Whether layer thickness accumulates along the axis or against it.
- Exact
Profile - Format-neutral profile representation.
- Geometry
Boolean Operator - Regularized boolean set operation on solids.
- Geometry
Node - One node in an immutable geometry DAG.
- Layer
SetDirection - Axis along which an IFC material layer set affects product geometry.
- Profile
Parameters - The parameters of one profile family, in metres and radians.
- Representation
Purpose - Caller intent for representation selection.
- Solid
Operation - Relationship that constructs a solid from lower-level geometry.
- Sweep
Path - The path of a swept-area solid, in world coordinates.
- Target
View - The intended presentation of a sub-context.
Constants§
- PLAN_
IDENTIFIERS - Representation identifiers that carry 2D drawing geometry, best first.
- SOLID_
IDENTIFIERS - Representation identifiers that carry solid geometry, best first.
Functions§
- all_
contexts - Every representation context in the model, in file order.
- body_
description - Describe the Body representation of
product. - context_
of - The context a representation is authored into.
- describe_
profile - Read one
IfcProfileDefinto its family parameters, in metres and radians. - geometric_
products - Products in the model that carry geometry, in stable id order.
- openings_
of - The openings voiding
host, in ascending id. - plan_
contexts - Sub-contexts whose
TargetViewis a plan view. - product_
representation_ frame - The frame a product’s representation of
purposeis placed in, in metres: the representation context’sWorldCoordinateSystemcomposed above the product’s placement chain, exactly as lowering andcrate::body_descriptionplace its items. - profile_
outline - Read an arbitrary closed profile’s outline, in metres.
- select_
plan_ representation - Pick the representation a 2D drawing should use for this product.
- select_
product_ representation - Select a product representation using an explicit consumer purpose.
- select_
shape_ representation - Pick the representation a viewer should draw for this product.
- voiding_
conflicts - Openings the file makes void more than one host, in relation order.