Skip to content

ifc-material ​

Material definitions: layer sets, profile sets, constituents, usage.

StatusImplemented
Latest release0.6.4 (2026-10-30)
Registriescrates.io ifc-material
Via the facadeopenbim-ifc feature material
API documentationrustdoc · docs.rs
Sourcecrates/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 ​

FeatureDefaultEnables
ifc2x3yesifc-schema/ifc2x3
ifc4yesifc-schema/ifc4
ifc4x1yesifc-schema/ifc4x1
ifc4x2yesifc-schema/ifc4x2
ifc4x3yesifc-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 the IfcRelAssociatesMaterial and IfcRelDefinesByType records 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's RelatedObjects once. assigned_material and assignments_for then cost the relationships that name the object, not the model or the length of a shared RelatedObjects. Every answer, refusals included, equals MaterialView's. Measured (provisional: loaded machine; see benchmarks/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), where MaterialView::assigned_material costs 3.1 ms per wall without a model reverse index at that size.

Changed (#609) ​

  • assigned_material counts the distinct RelatingMaterials (by entity id) of an object's IfcRelAssociatesMaterials, at the occurrence and at its type: several relationships naming the same material resolve, and ResolvedAssignment::assignment is the lowest-id one. AmbiguousAssignment::count is the number of distinct materials (was relationships); the message reads "object #N is assigned K distinct materials". Every relationship's RelatingMaterial is read first, so one that is missing or not a reference refuses with its own error instead of AmbiguousAssignment. Two IfcRelDefinesByType on one object remain AmbiguousType even when they name one type: no release allows it (IFC2X3 IfcObject WR1; IFC4 and IFC4X3 IsTypedBy SET [0:1]).

Full history: crates/ifc-material/CHANGELOG.md

Dual-licensed under AGPL-3.0-or-later or a commercial licence. ISO and CEN standards material is not redistributed.