Expand description
Shared streaming pre-pass meta resolution.
The browser pre-passes (buildPrePassOnce / buildPrePassStreaming in
wasm-bindings) each need the same bundle of load-time metadata before
workers can start meshing: the length/plane-angle unit scales, the RTC
(relative-to-centre) offset plus its needs-shift flag, and the building
rotation from IfcSite. This module is the single home for that
resolution logic so the three call sites can no longer drift.
Only the RESOLUTION logic lives here — the wasm side keeps ownership of
WHEN the resulting StreamMeta is emitted. In particular the streaming
pre-pass still emits its meta event MID-SCAN (as soon as
RTC_SAMPLE_THRESHOLD geometry jobs are buffered, near the top of the
file) so workers spin up early — the ~17 s → ~3 s time-to-first-geometry
win on a 986 MB file. This helper does not change that timing; it only
factors out the two-vs-three-stage RTC ladder that the two emission sites
previously copied.
Everything here COMPOSES the existing canonical primitives:
resolve_unit_scales,
EntityDecoder::seed_unit_scales,
GeometryRouter::with_scale,
GeometryRouter::detect_rtc_offset_from_jobs,
GeometryRouter::detect_rtc_offset_with_fallback, and the shared
LARGE_COORD_THRESHOLD_METERS
needs-shift constant.
Structs§
- Stream
Meta - The load-time metadata both pre-passes emit before workers start meshing.
Enums§
- Meta
Mode - Which RTC-detection ladder
resolve_stream_metashould run.
Functions§
- coord_
is_ large - True when any component of the offset exceeds the shared large-coordinate
threshold — the single needs-shift predicate, sharing
LARGE_COORD_THRESHOLD_METERSwith the router’s own sampling so both sides make the identical decision. - resolve_
stream_ meta - Resolve the full
StreamMetabundle for one pre-pass emission point.
Type Aliases§
- Job
- A geometry job span as the pre-passes carry it:
(id, start, end, type).