Expand description
Canonical resolution of a file’s declared units for display.
Where crate::units resolves only the LENGTH and PLANEANGLE scale
factors needed to normalise geometry, this module resolves the file’s whole
IfcUnitAssignment into a per-unit-type table of display symbols + SI scale
factors, covering IfcSIUnit (with prefixes), IfcDerivedUnit (composed,
e.g. m\u{00B3}/s), IfcConversionBasedUnit (\u{00B0}, ft, …) and
IfcMonetaryUnit. It also maps a property’s IFC measure value type (e.g.
IfcVolumetricFlowRateMeasure) onto the unit it is shown in.
This is the source of truth for unit display; the viewer mirrors it in
packages/parser/src/project-units.ts, pinned by the shared parity vectors
in rust/core/tests/fixtures/unit_symbol_vectors.json.
Re-exports§
pub use measure::measure_unit;pub use measure::MeasureUnit;
Modules§
- measure
- Canonical mapping from an IFC measure value type (e.g.
IfcVolumetricFlowRateMeasure) to the IFC unit type it is expressed in (VOLUMETRICFLOWRATEUNIT) plus the IFC-canonical SI display symbol used when the file does not declare that unit. - symbols
- Display-symbol formatting for IFC units:
IfcSIUnitNamesymbols, SI prefix symbols,IfcDerivedUnitcomposition (e.g.m\u{00B3}/s) and friendly symbols for commonIfcConversionBasedUnitnames (\u{00B0}, ft, in, …).
Structs§
- Project
Units - The set of units a file declares in its
IfcUnitAssignment, keyed by unit-type token ("LENGTHUNIT","VOLUMETRICFLOWRATEUNIT", …). Only the unit-types the file actually declares are present; anything else falls back to the IFC-canonical SI default inProjectUnits::unit_for_measure. - Resolved
Unit - A resolved display unit: the symbol to render plus the factor that converts a
value expressed in this unit to its canonical SI base (
mm->1e-3,m\u{00B3}/h->1/3600,\u{00B0}->0.01745...).si_scaleis1.0for units already at the SI base and for monetary units.
Functions§
- resolve_
unit_ by_ ref - Resolve a single unit entity (referenced from a
IfcUnitAssignment, or from a per-property / per-quantityUnitoverride). Returns(unit_type_token, resolved, is_monetary).