IFClite TypeScript API
    Preparing search index...

    Class MeshCollection

    Collection of mesh data for returning multiple meshes

    Index
    buildingRotation: number | undefined

    Get building rotation angle in radians (from IfcSite placement) Returns None if no rotation was detected

    diagnostics: any

    The batch's typed CSG / opening diagnostics as a JS object (the GeometryDiagnostics contract), or undefined if none were recorded. The worker merges these across batches. One serialized value keeps the rich nested shape as a single FFI crossing instead of dozens of getters.

    geometryAabbValues: Float64Array

    Per-entity world-space AABBs as a Float64Array, SIX values per entry (minx, miny, minz, maxx, maxy, maxz), in the same order as [Self::geometry_hash_ids] — entry i spans [6*i, 6*i+6). Empty unless geometry hashing was enabled; the same IfcAPI.setComputeGeometryHashes switch gates both, so nothing is computed when the diff feature is off.

    Unquantized world f64 (the file's RTC folded back in), so two revisions that chose different RTC offsets report the same box. This is what lets a consumer say "MOVED" honestly instead of inferring it from a changed hash, which also fires on reshape and on retriangulation.

    Frame: WebGL Y-up, like every other box, position, origin and placement that crosses this boundary (see MeshDataJs::local_bounds). The hasher accumulates in the producer's IFC Z-up frame, so the swap (x,y,z) -> (x,z,-y) is applied here, on the way out. Unconverted, the boxes would not enclose the very meshes processGeometryBatch returns alongside them. Positions are RTC-relative and this box is absolute, so a consumer comparing the two folds rtcOffset* in — itself Y-up-swapped.

    Present for every hashed entity. Its companion [Self::geometry_volume_values] is not — see there.

    geometryClosureFlags: Uint8Array

    Per-entity topology verdict as a Uint8Array, one packed byte per entry in [Self::geometry_hash_ids] order:

    • bit 0 (1) — every segment closed (no boundary / non-manifold edge)
    • bit 1 (2) — every segment orientable
    • bit 2 (4) — every segment a single connected component
    • bit 3 (8) — the entity produced exactly one segment

    0x0F is exactly the set that carries a volume in [Self::geometry_volume_values]. The individual bits are the diagnosis: a model checker can distinguish "this wall is an open shell" (bit 0 clear) from "this door is a multi-item assembly whose parts may overlap" (bit 3 clear), which are different findings with different fixes.

    geometryHashCount: number

    Number of per-entity geometry fingerprints recorded.

    geometryHashIds: Uint32Array

    Express ids for the per-entity geometry fingerprints, parallel to [Self::geometry_hash_values]. Empty unless geometry hashing was enabled via IfcAPI.setComputeGeometryHashes.

    geometryHashValues: BigUint64Array

    Per-entity geometry fingerprints as a BigUint64Array, parallel to [Self::geometry_hash_ids]. u64 is exposed (not hex strings) so JS can compare with === and key maps without allocation. Empty unless geometry hashing was enabled.

    geometryVolumeValues: Float64Array

    Per-entity enclosed volume in CUBIC METRES as a Float64Array, one value per entry in [Self::geometry_hash_ids] order. NaN means NO TRUSTWORTHY VOLUME — the same absent convention as [Self::geometry_aabb_values] — and it is NaN for roughly a third of entities by design, not by failure.

    A value is emitted only when that entity's produced geometry was PROVABLY a single closed, orientable, single-component solid, as decided by the mesher's own orientation pass. Read ifc_lite_geometry::GeometryHasher::volume before treating a NaN as a bug: an open SurfaceModel, a material-layered wall (whose slices are open bands by construction), and any element assembled from more than one representation item all correctly report nothing rather than a plausible wrong number. [Self::geometry_closure_flags] says which.

    This is NOT a substitute for an IFC BaseQuantities GrossVolume: it is the volume of the geometry that was actually meshed, after opening cuts, and it says nothing about whether a CSG degradation left the host uncut (see the diagnostics getter).

    length: number

    Get number of meshes

    rtcOffsetX: number

    Get RTC offset X (for converting local coords back to world coords) Add this to local X coordinates to get world X coordinates

    rtcOffsetY: number

    Get RTC offset Y

    rtcOffsetZ: number

    Get RTC offset Z

    totalTriangles: number

    Get total triangle count across all meshes

    totalVertices: number

    Get total vertex count across all meshes

    • Returns void

    • Returns void

    • Get mesh at index (clones — non-destructive). Prefer takeMesh on the hot streaming path; this stays for callers that read meshes more than once.

      Parameters

      • index: number

      Returns MeshDataJs | undefined

    • Check if an RTC offset was applied to these meshes (any non-zero component). It can be inside 10 km: the placement-bounds fallback re-bases on the bbox centre when a corner is past 10 km (#4643).

      Returns boolean

    • #1097 perf: MOVE the mesh at index out of the collection (the Vec buffers are std::mem::take-n, leaving an empty stub). The streaming worker reads each mesh exactly once, so moving avoids the full vertex- data clone get pays — one fewer copy of positions/normals/indices/uvs/ texture per mesh (the JS getters still do the single Rust→JS copy). Calling it twice for the same index yields the second call a DEFAULT mesh: expressId 0 and every buffer empty, rather than the metadata-bearing husk the hand-written copy used to leave. The method is read-once by contract and the wasm-contract test pins this.

      Parameters

      • index: number

      Returns MeshDataJs | undefined