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 (no mid-scan decode).
- Resolve
Options - Resolution switches (both pipelines share the resolver).
- 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 (file-order, first-wins precedence).
- resolve_
prepass_ with_ style_ seeds resolve_prepasswith PRE-RESOLVED styled maps (sharded pre-pass). Seeds MUST install before the material/void loops: the material chain consultsorphan_styled_items— injecting after loses material-dependent styles.- 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_
styled_ items_ into - The styled-item classification/resolution loop of [
resolve_prepass], exposed so the browser’s SHARDED pre-pass can fan slices of the (file- ordered) styled-item span list across workers: each worker resolves its contiguous slice with this exact loop, and the host merges shard results in shard order with first-wins per geometry id — reproducing the serial resolver’s file-order first-wins precedence (collect_geometry_style_infoskips ids already present). - 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). - Style
Seeds - Pre-resolved styled maps:
(orphan id -> rgba, geometry id -> style info).