ReadonlycolorGet color as [r, g, b, a] array
ReadonlyexpressGet express ID
ReadonlygeometryGeometry provenance for the viewer's Model/Types switch (#957 follow-up): 0 = occurrence, 1 = orphan type geometry (no occurrence), 2 = instanced type geometry (hidden in Model mode, shown in Types mode).
ReadonlygeometrySource IfcRepresentationItem, or undefined where identity is merged
away. Never set alongside materialId (#3199).
ReadonlyhasTrue when this mesh carries a surface texture (#961).
ReadonlyifcGet IFC type name (e.g., "IfcWall", "IfcSpace")
ReadonlyindicesGet indices as Uint32Array (copy to JS)
ReadonlylocalLocal (pre-placement, object-space) AABB (issue #1474), WebGL Y-up,
[minX,minY,minZ,maxX,maxY,maxZ]. undefined when not captured
(wasm-bindgen maps Option::None to undefined, not null).
ReadonlylocalThe resolved IfcLocalPlacement chain for this mesh (issue #1474),
row-major 4×4, WebGL Y-up. undefined when not captured (see
local_bounds above).
ReadonlymaterialIfcMaterial layer sliced, or undefined (#3199).
ReadonlymetallicIFC-authored metallic/roughness (#5582). undefined when unauthored.
ReadonlynormalsGet normals as Float32Array (copy to JS)
ReadonlyoriginPer-element local-frame origin (Float64Array[3], WebGL Y-up, metres):
world position of vertex i = origin + positions[3i..3i+3]. Returns
[0,0,0] when positions are absolute (legacy / local frame off).
ReadonlypositionsGet positions as Float32Array (copy to JS)
ReadonlyroughnessReadonlyshadingOptional SurfaceColour for the "Shading" GLB-export choice — only
present when the file authored a distinct DiffuseColour. JS sees
undefined when absent (most files).
ReadonlytextureReadonlytextureStable texture dedup key (IfcSurfaceTexture express id, #1781).
0 when the mesh is untextured.
ReadonlytextureSampler wrap for the S axis (IfcSurfaceTexture.RepeatS): true = repeat.
ReadonlytextureSampler wrap for the T axis (IfcSurfaceTexture.RepeatT): true = repeat.
ReadonlytextureDecoded RGBA8 texture bytes (width*height*4). Empty when untextured.
ReadonlytextureExternal image reference (IfcImageTexture.URLReference, #1781) for the
host to resolve — e.g. a sibling image inside the .ifcZIP. undefined
for untextured meshes and Rust-decoded blob/pixel textures.
ReadonlytextureReadonlytriangleGet triangle count
ReadonlyuvsPer-vertex texture coordinates as Float32Array (u, v pairs). Empty when the mesh is untextured.
ReadonlyvertexGet vertex count
Individual mesh data with express ID and color (matches MeshData interface)
Cloneis derived so the three sites that used to enumerate all 21 fields by hand --get,takeMeshandMeshCollection's ownClone-- reduce to.cloned(),mem::takeand.clone(). Adding a field to #3199 meant editing three literals in lockstep; the allowlist row for this file records exactly that cost.To be precise about what this does and does not buy, because the obvious claim is wrong: an exhaustive struct literal that OMITS a field is a compile error, so those literals were never silently lossy. What they were is three places to edit for one field, and
..Default::default()is the shortcut a hurried author reaches for when the compiler complains -- which WOULD be silently lossy.Defaultis what makestakeMesha one-liner, so the rule is: TWO literals remain,newandDefaultbelow (both spelledSelf { .. }, which is why a grep forMeshDataJs {finds neither). Both must stay exhaustive AND must agree on every fieldnewdoes not take as an argument. The compiler catches an omitted field in either; it cannot catch the two DISAGREEING, which is the failure the pair exists to prevent, sodefault_agrees_with_new_on_the_fields_new_does_not_takecovers that. Never spreadDefaultintonew--newis the only place a field's initial value is decided, so a field defaulted there is inert everywhere.