Skip to main content

Module element

Module element 

Source
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) calls produce_element_meshes from its rayon loop with a fresh seeded decoder + router per element;
  • the browser batch path (wasm-bindings processGeometryBatch) 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 mesh

Structs§

ElementMeshJob
One unit of mesh production.
ElementMeshMetadata
Element-level metadata stamped on every produced MeshData. The native pipeline resolves these during its metadata phase; the browser passes None (its viewer gets metadata from the parser worker instead).
GeometryHashConfig
RTC-invariant per-element fingerprint configuration (#971/#924).
MeshProductionContext
Read-only shared state for one production run. Every field is a borrow of Sync data, so &MeshProductionContext can be captured by a rayon closure (native) or used serially (wasm).
MeshProductionOptions
ProducedElementMeshes
Everything one element produced.

Enums§

ElementJobKind
What the job renders.
TypeGeometryMode
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.