ifc-material
Material definitions: layer sets, profile sets, constituents, usage.
| Status | Implemented |
| Latest release | 0.6.4 (2026-10-30) |
| Registries | crates.io ifc-material |
| Via the facade | openbim-ifc feature material |
| API documentation | rustdoc · docs.rs |
| Source | crates/ifc-material/ |
Overview
Borrowed, codec-independent IFC MaterialResource views.
The crate projects typed material identity, constituents, layers, profiles, usage assignments, relationships, and material property sets from ifc_model::Model. Accessors distinguish absent optional values from malformed values and enforce immediate aggregate shape, required slots, and MaterialResource WHERE constraints. Authored placement and offset values are exposed here; geometric interpretation remains in ifc-geometry.
Views and authoring bind to the release the model's header declares (IFC2X3 TC1, IFC4 ADD2 TC1 or IFC4X3 ADD2; see material_schema): every slot position comes from that release's bundled schema table. An attribute the release lacks is MaterialError::NotInSchema, and a record type it lacks is MaterialError::EntityNotInSchema; neither is read from another release's slot.
Features
| Feature | Default | Enables |
|---|---|---|
ifc2x3 | yes | ifc-schema/ifc2x3 |
ifc4 | yes | ifc-schema/ifc4 |
ifc4x1 | yes | ifc-schema/ifc4x1 |
ifc4x2 | yes | ifc-schema/ifc4x2 |
ifc4x3 | yes | ifc-schema/ifc4x3 |
Depends on
Changes
Latest release, 0.6.4 (2026-10-30):
Added (#609)
MaterialIndex: the material of many objects in one pass.MaterialIndex::new(view)reads theIfcRelAssociatesMaterialandIfcRelDefinesByTyperecords once (through the model's reverse index when something built it, else an index over those records only, never left on the model) and checks each one'sRelatedObjectsonce.assigned_materialandassignments_forthen cost the relationships that name the object, not the model or the length of a sharedRelatedObjects. Every answer, refusals included, equalsMaterialView's. Measured (provisional: loaded machine; seebenchmarks/baseline.md): every wall of a 100,000-wall model resolves in 149 ms (1.5 microseconds per wall, 1.4 times the cost per wall at 1,000 walls), whereMaterialView::assigned_materialcosts 3.1 ms per wall without a model reverse index at that size.
Changed (#609)
assigned_materialcounts the distinctRelatingMaterials (by entity id) of an object'sIfcRelAssociatesMaterials, at the occurrence and at its type: several relationships naming the same material resolve, andResolvedAssignment::assignmentis the lowest-id one.AmbiguousAssignment::countis the number of distinct materials (was relationships); the message reads "object #N is assigned K distinct materials". Every relationship'sRelatingMaterialis read first, so one that is missing or not a reference refuses with its own error instead ofAmbiguousAssignment. TwoIfcRelDefinesByTypeon one object remainAmbiguousTypeeven when they name one type: no release allows it (IFC2X3IfcObjectWR1; IFC4 and IFC4X3IsTypedBy SET [0:1]).
Full history: crates/ifc-material/CHANGELOG.md