Skip to main content

Crate ifc_geometry

Crate ifc_geometry 

Source
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:

SchemaEntitiesTypesFunctions
IfcGeometryResource591425
IfcGeometricModelResource4242
IfcGeometricConstraintResource1151

§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 IfcCurve family.
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 WHERE rules: the schema’s own correctness conditions.
select
EXPRESS SELECT and 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 IfcSurface family.
transform
Rigid transforms: the composition algebra placements reduce to.
units
Unit resolution: what one coordinate unit actually means.

Structs§

BodyDescription
The Body representation of one product, one entry per geometric item.
BodyItem
One geometric representation item of a body.
CardinalPoint
Positive IFC cardinal reference. Standard values are 1 through 19.
GeometryGraph
Immutable acyclic geometry graph with one or more roots.
MaterialLayerSetUsageGeometry
Geometry-only projection of IfcMaterialLayerSetUsage.
MaterialProfileGeometry
Geometry-only projection of IfcMaterialProfile.
MaterialProfileSetUsageGeometry
Geometry-only projection of IfcMaterialProfileSetUsage.
MaterialProfileSetUsageTaperingGeometry
Geometry-only projection of IfcMaterialProfileSetUsageTapering.
NodeId
Stable index owned by one immutable crate::GeometryGraph.
ProductShape
One IfcProductRepresentation: the ordered representations of a product.
ProfileDescription
One IfcProfileDef, resolved into its family parameters.
ProfileOperator
IfcDerivedProfileDef.Operator: a 2D affine map applied to the parent.
ProfileOutline
An arbitrary profile’s boundaries as rings of vertices.
ProfilePosition
IfcParameterizedProfileDef.Position: where the parameterised section sits in the profile plane.
Representation
One IfcRepresentation: a named set of items in a context.
RepresentationContext
One IfcGeometricRepresentationContext or its sub-context.
SweptSolid
A swept-area solid: its profile, where it sits, and the path it follows.
VoidingConflict
An opening that the file makes void a second host.

Enums§

AnalyticPrimitive
Exact primitive solid; tessellation is a separate operation.
BodyKind
How one representation item models its shape.
DirectionSense
Whether layer thickness accumulates along the axis or against it.
ExactProfile
Format-neutral profile representation.
GeometryBooleanOperator
Regularized boolean set operation on solids.
GeometryNode
One node in an immutable geometry DAG.
LayerSetDirection
Axis along which an IFC material layer set affects product geometry.
ProfileParameters
The parameters of one profile family, in metres and radians.
RepresentationPurpose
Caller intent for representation selection.
SolidOperation
Relationship that constructs a solid from lower-level geometry.
SweepPath
The path of a swept-area solid, in world coordinates.
TargetView
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 IfcProfileDef into 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 TargetView is a plan view.
product_representation_frame
The frame a product’s representation of purpose is placed in, in metres: the representation context’s WorldCoordinateSystem composed above the product’s placement chain, exactly as lowering and crate::body_description place 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.