Expand description
Canonical per-element mesh production — THE single decision tree that turns one IFC product (or type-product RepresentationMap) into renderable meshes.
Both pipelines run this exact code:
- the native orchestrator (
processor.rs) callsproduce_element_meshesfrom its rayon loop with a fresh seeded decoder + router per element; - the browser batch path (
wasm-bindingsprocessGeometryBatch) calls it per job with a warm per-batch decoder + router.
History: the two pipelines used to carry diverging inline copies of this
tree, and fixes had to land twice (#858, #913, #957, #961, #1071). Any
change to mesh-production behaviour belongs HERE, exactly once. The only
sanctioned behavioural fork is TypeGeometryMode — a product
requirement, not drift: an export must never duplicate type geometry,
while the interactive viewer renders it tagged for its Model/Types switch.
The converged decision tree (union of the strongest behaviours of both former copies):
representation gate (IfcAlignment exempt)
├─ TypeProduct job (#957): render each planned RepresentationMap
│ (textures #961, geometry_class tag, styled-item colour)
└─ Product job:
├─ has openings → submesh-aware void cut (per-part colours survive)
├─ else → submesh path for ALL types (per-item colours,
│ per-item error skipping, #858 palette split per item)
└─ fallback chain when the submesh path produced nothing:
void-aware single mesh → plain element → element-level #858 split
→ single coloured meshStructs§
- Element
Mesh Job - One unit of mesh production.
- Element
Mesh Metadata - Element-level metadata stamped on every produced
MeshData. The native pipeline resolves these during its metadata phase; the browser passesNone(its viewer gets metadata from the parser worker instead). - Geometry
Hash Config - RTC-invariant per-element fingerprint configuration (#971/#924).
- Mesh
Production Context - Read-only shared state for one production run. Every field is a borrow of
Syncdata, so&MeshProductionContextcan be captured by a rayon closure (native) or used serially (wasm). - Mesh
Production Options - Produced
Element Meshes - Everything one element produced.
Enums§
- Element
JobKind - What the job renders.
- Type
Geometry Mode - The #957 suppress-vs-tag decision — an explicit product-requirement fork,
not drift. See
plan_type_geometry.
Functions§
- plan_
type_ geometry - The single home of the #957 orphan/instanced RepresentationMap decision.
- produce_
element_ meshes - THE canonical per-element mesh producer.