Skip to main content

ifc_material/
lib.rs

1//! Borrowed, codec-independent IFC MaterialResource views.
2//!
3//! The crate projects typed material identity, constituents, layers, profiles,
4//! usage assignments, relationships, and material property sets from
5//! [`ifc_model::Model`]. Accessors distinguish absent optional values from
6//! malformed values and enforce immediate aggregate shape, required slots, and
7//! MaterialResource WHERE constraints. Authored placement and offset values are
8//! exposed here; geometric interpretation remains in `ifc-geometry`.
9//!
10//! Views and authoring bind to the release the model's header declares
11//! (IFC2X3 TC1, IFC4 ADD2 TC1 or IFC4X3 ADD2; see [`material_schema`]):
12//! every slot position comes from that release's bundled schema table. An
13//! attribute the release lacks is [`MaterialError::NotInSchema`], and a record
14//! type it lacks is [`MaterialError::EntityNotInSchema`]; neither is read from
15//! another release's slot.
16
17pub mod authoring;
18pub mod constituent;
19pub mod error;
20pub mod layer;
21pub mod material;
22pub mod profile;
23mod release;
24pub mod types;
25pub mod usage;
26pub mod view;
27
28pub use authoring::{
29    associate_material, associate_material_with_owner_history, create_constituent,
30    create_constituent_set, create_layer, create_layer_set, create_layer_set_usage,
31    create_layer_with_offsets, create_material, create_material_classification_relationship,
32    create_material_definition_representation, create_material_list, create_material_properties,
33    create_material_relationship, create_profile, create_profile_set, create_profile_set_usage,
34    create_profile_set_usage_tapering, create_profile_with_offsets, ConstituentDraft, LayerDraft,
35    LayerSetDraft, MaterialAssignmentDraft, MaterialDraft, ProfileDraft,
36};
37pub use constituent::{ConstituentFractionDiagnostic, MaterialConstituent, MaterialConstituentSet};
38pub use error::{MaterialError, MaterialResult};
39/// The IFC release a material read or write binds to (re-exported from
40/// `ifc-schema`).
41pub use ifc_schema::SchemaVersion;
42pub use layer::{MaterialLayer, MaterialLayerSet, MaterialLayerSetUsage, MaterialLayerWithOffsets};
43pub use material::{
44    Material, MaterialClassificationRelationship, MaterialList, MaterialProperties,
45    MaterialRelationship,
46};
47pub use profile::{
48    MaterialProfile, MaterialProfileSet, MaterialProfileSetUsage, MaterialProfileSetUsageTapering,
49    MaterialProfileWithOffsets,
50};
51pub use release::material_schema;
52pub use types::{
53    CardinalPointReference, DirectionSense, LayerSetDirection, LogicalValue, MaterialSelect,
54    StandardCardinalPoint, IFC4_MATERIAL_RESOURCE_ENTITIES, IFC4_MATERIAL_RESOURCE_TYPES,
55};
56pub use usage::{
57    AssignmentSource, MaterialAssignment, MaterialDefinition, MaterialUsageDefinition,
58    ResolvedAssignment, ResolvedMaterialSelect,
59};
60pub use view::MaterialView;