ifc-material
Material definitions: layer sets, profile sets, constituents, usage.
| Status | Implemented |
| Latest release | 0.4.0 (2026-09-29) |
| 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.
Depends on
Changes
Latest release, 0.4.0 (2026-09-29):
Changed (breaking)
MaterialView::profile_set_usages()also yieldsIfcMaterialProfileSetUsageTapering, the schema subtype ofIfcMaterialProfileSetUsagein IFC4 and IFC4X3, in entity-id order, andMaterialProfileSetUsage::try_new/try_from_viewaccept it (#136). A caller that iterated bothprofile_set_usages()andtapering_profile_set_usages()sees each tapering usage twice; iterateprofile_set_usages()alone and branch on the newMaterialProfileSetUsage::tapering(), which returns the tapering projection (end_profile_set_id,cardinal_end_point) orNone.- The authoring drafts
MaterialDraft,LayerDraft,LayerSetDraft,MaterialAssignmentDraft,ConstituentDraftandProfileDraftare#[non_exhaustive]: build them withMaterialDraft::new(name),LayerDraft::new(thickness),LayerSetDraft::new(layers),MaterialAssignmentDraft::new(global_id, related_objects, relating_material),ConstituentDraft::new(material)orProfileDraft::new(profile)and a setter named after each optional field (LayerDraft::new(0.2).material(brick).priority(80)). Fields stay public. ResolvedAssignmentis#[non_exhaustive].
Changed
- Depends on
ifc-schemawith its default features named explicitly (every bundled release), now that the workspace dependency turns them off for the facade's per-release features (#112). UnsupportedSchemareads "a release this crate has no verified layout for" instead of "no bundled schema table".- A model whose header declares
IFC4X1orIFC4X2is refused with the existing unsupported-schema error.ifc-schemanow bundles both releases, but no layout here is verified against them, so they are never read as IFC4 or IFC4X3.
Full history: crates/ifc-material/CHANGELOG.md