pub fn resolve_unit_scales(
content: &[u8],
project_id_hint: Option<u32>,
decoder: &mut EntityDecoder<'_>,
) -> UnitScalesExpand description
Resolve BOTH unit scales once, against the decoder’s (possibly partial) entity index, with the documented fallback ladder:
project_idhint (recorded by the scan) — O(1) decode via the index.- No hint? Find
IFCPROJECTby SIMD substring search (it is a singleton and many exporters — IfcOpenShell, Revit — emit it near the END of the file, after the scan’s early-meta point). - Resolution chain incomplete on a PARTIAL index (streaming early-meta: the IFCSIUNIT chain may sit past the scan point)? Re-resolve against a freshly built FULL index rather than silently defaulting — a millimetre model resolved as metres renders 1000× oversized.
This is the only sanctioned place that hunts for IFCPROJECT; per-element
decoders are seeded from the result (EntityDecoder::seed_unit_scales) so
the historic O(file)-scan-per-decoder stall class stays dead.