Expand description
Canonical prepass resolution — the single post-scan step that turns the
entity spans a scan collected into the style / material / void context the
per-element producer (crate::element) consumes.
Both pipelines run this exact code:
- the native orchestrator (
processor.rs) span-stashes during its scan and resolves here before the rayon loop; - the browser prepasses (
buildPrePassOnce/buildPrePassStreaminginwasm-bindings) span-stash during their scans and resolve here before serialising the flat wire arrays.
The two scan loops remain per-pipeline (they are mechanical match-arms
over type names with pipeline-specific extras: quick-metadata, properties,
incremental job emission), but everything SEMANTIC — styled-item
precedence, IfcIndexedColourMap fallback, the #407 material chain, void
collection and aggregate propagation (#845), and unit-scale resolution —
lives here exactly once. The historic #858/#913-class drift was always in
this resolution layer, not in the span stashing.
Structs§
- Prepass
Spans - Entity spans a scan collected for post-scan resolution. Both scan loops fill this; neither decodes these entities mid-scan.
- Resolve
Options - Resolution switches. Both pipelines use the same resolver with different collection needs.
- Resolved
Prepass - Everything the post-scan resolution produces.
- Unit
Scales - The file’s unit scales, resolved exactly once per parse.
Functions§
- find_
ifcproject_ id - Find the singleton
IFCPROJECT’s express id by SIMD substring search — no full entity scan. ReturnsNonewhen the file has no project. - flat_
material_ colors - Flat wire encoding of the element material colour lists (#407/#913 §2.3):
(element_ids, counts, rgba8)—counts[i]colours belong toelement_ids[i], in order, 4 bytes each. - flat_
styles_ rgba8 - Flat wire encodings of the resolved styles for the browser’s
styleIds/styleColorsarrays: the rich style index flattened to(ids, rgba8), with IfcIndexedColourMap dominants, flat material colours, and per-element first material colours filling the gaps — the exact layered precedence the browser prepasses have always shipped. - flat_
voids - Flat wire encoding of the void index:
(keys, counts, values)in the shapeprocessGeometryBatchaccepts. - material_
colors_ from_ flat - Decode the flat material-colour wire arrays back into the canonical map —
the inverse of
flat_material_colors, used byprocessGeometryBatch. - merge_
indexed_ colours - Fold
IfcIndexedColourMapdominant colours into the style index, keyed by target geometry id.or_insertpreserves IFCSTYLEDITEM precedence: a geometry that already has a direct style keeps it; the indexed colour only fills the gaps (#913). - resolve_
prepass - THE canonical post-scan resolution. Spans are processed in file order so first-wins precedence matches what the historic inline scans produced.
- resolve_
styled_ item_ spans - Resolve geometry-attached styled-item spans into a style index — the
defer-mode replay (
fast_first_batch), and the building blockresolve_prepassuses internally. - resolve_
unit_ scales - Resolve BOTH unit scales once, against the decoder’s (possibly partial) entity index, with the documented fallback ladder:
Type Aliases§
- Span
- One stashed entity span:
(express_id, start, end).