IFClite TypeScript API
    Preparing search index...

    Class IfcLiteBridge

    @ifc-lite/geometry - Geometry processing bridge Now powered by IFC-Lite native Rust WASM (exact-arithmetic CSG kernel)

    Index
    • using bridge = new IfcLiteBridge() support (TS 5.2+ / ES2022 target): frees the WASM handle deterministically at scope exit.

      Returns void

    • Run geometry extraction on the raw IFC content (Uint8Array) and return ONLY its typed CSG / opening diagnostics (the GeometryDiagnostics contract), or undefined when nothing diagnostic-worthy happened. The produced meshes are dropped. Takes bytes (not a string) so there is no input-size cap.

      Parameters

      • content: Uint8Array

      Returns GeometryDiagnostics | undefined

    • Free the underlying WASM IfcAPI handle deterministically (AGENTS.md "Free every WASM handle deterministically"). clearPrePassCache only drops the per-load caches held inside the handle; the handle itself (and everything still cached on it — see the poisoned-mutex recovery note in IfcAPI) is only released here, via wasm-bindgen's generated free(), when the whole bridge is being torn down.

      Idempotent and safe to call more than once, before init(), or after a fatal WASM runtime error already nulled the handle: a missing handle is a no-op. The reference is nulled immediately after freeing (via reset()), so a repeat call can never double-free the same wasm-bindgen pointer.

      Returns void

    • Export tabular CSV. mode ∈ {'entities', 'properties', 'quantities'}; empty delimiter ⇒ ,; includeProperties adds flattened Pset_Prop columns.

      Parameters

      • content: Uint8Array
      • Optionalmode: "entities" | "properties" | "quantities" | "spatial"
      • Optionaldelimiter: string
      • OptionalincludeProperties: boolean

      Returns Uint8Array

    • DFJSON (Dragonfly) export; see energy-export-bridge.ts for the contract.

      Parameters

      • content: Uint8Array
      • name: string

      Returns string

    • Export the render geometry in content as a binary glTF (GLB). emissive self-illuminates each material for renderers without ambient/IBL (#1427). isolated: undefined ⇒ no filter; empty Uint32Array ⇒ active but matching nothing, i.e. hide every mesh — don't collapse the two (#4328).

      Parameters

      • content: Uint8Array
      • OptionalincludeMetadata: boolean
      • Optionalhidden: Uint32Array<ArrayBufferLike>
      • Optionalisolated: Uint32Array<ArrayBufferLike>
      • OptionalhiddenTypesCsv: string
      • Optionallit: boolean
      • Optionalemissive: boolean

      Returns Uint8Array

    • Assemble a GLB from already-produced meshes (flattened parallel arrays) — no re-meshing. Used by the viewer, which already holds the meshes on the GPU.

      Parameters

      • positions: Float32Array
      • normals: Float32Array
      • indices: Uint32Array
      • vertexCounts: Uint32Array
      • indexCounts: Uint32Array
      • colors: Float32Array
      • origins: Float64Array
      • expressIds: Uint32Array
      • includeMetadata: boolean
      • Optionallit: boolean
      • Optionalemissive: boolean

      Returns Uint8Array

    • HBJSON (Honeybee) export; see energy-export-bridge.ts for the contract.

      Parameters

      • content: Uint8Array
      • name: string

      Returns Uint8Array

    • Like exportHbjson; also returns HbjsonStats coverage counts (see energy-export-bridge.ts).

      Parameters

      • content: Uint8Array
      • name: string

      Returns { content: Uint8Array; stats: HbjsonStats }

    • Export IFC5/IFCX (USD-style node graph).

      Parameters

      • content: Uint8Array
      • OptionalonlyKnownProperties: boolean
      • Optionalpretty: boolean

      Returns Uint8Array

    • Export structured JSON (array of entity objects with typed property values).

      Parameters

      • content: Uint8Array
      • Optionalpretty: boolean
      • OptionalincludeProperties: boolean
      • OptionalincludeQuantities: boolean

      Returns Uint8Array

    • Export JSON-LD (@graph of ifc: nodes). Empty context ⇒ buildingSMART IFC4 OWL. included distinguishes no filter (undefined) from an active empty filter and otherwise applies an express-id allowlist like the OBJ/glTF/STEP exporters (#4659).

      Parameters

      • content: Uint8Array
      • Optionalcontext: string
      • OptionalincludeProperties: boolean
      • OptionalincludeQuantities: boolean
      • Optionalpretty: boolean
      • Optionalincluded: Uint32Array<ArrayBufferLike>

      Returns Uint8Array

    • Build a Google-Earth-ready KMZ directly from already-produced meshes (flattened parallel arrays). The model is embedded as COLLADA (model.dae) — the only <Model> format Google Earth loads — with emission-lit, double-sided materials (#1427). xAxisAbscissa/xAxisOrdinate are the IfcMapConversion grid-north components (pass undefined for heading 0). altitudeMode selects the KML vertical placement ('clampToGround' default rests on the terrain and ignores altitude; 'absolute' places the origin at altitude metres MSL).

      Parameters

      • positions: Float32Array
      • normals: Float32Array
      • indices: Uint32Array
      • vertexCounts: Uint32Array
      • indexCounts: Uint32Array
      • colors: Float32Array
      • origins: Float64Array
      • latitude: number
      • longitude: number
      • altitude: number
      • xAxisAbscissa: number | undefined
      • xAxisOrdinate: number | undefined
      • name: string
      • OptionalaltitudeMode: KmzAltitudeMode

      Returns Uint8Array

    • Merge several IFC models into one STEP/IFC string (flat bytes + per-model lengths).

      Parameters

      • concatenated: Uint8Array
      • lengths: Uint32Array
      • Optionalschema: string

      Returns Uint8Array

    • Export the render geometry in content as a Wavefront OBJ string. isolated: undefined ⇒ no filter; empty Uint32Array ⇒ active but matching nothing.

      Parameters

      • content: Uint8Array
      • OptionalincludeNormals: boolean
      • Optionalhidden: Uint32Array<ArrayBufferLike>
      • Optionalisolated: Uint32Array<ArrayBufferLike>

      Returns Uint8Array

    • Re-serialize the model in content to a STEP/IFC string (P1: base re-serialization + reference-closed subset). Empty schema preserves the source; included distinguishes no filter (undefined) from an active empty filter (#4659).

      Parameters

      • content: Uint8Array
      • Optionalschema: string
      • Optionalincluded: Uint32Array<ArrayBufferLike>
      • OptionalmutationsJson: string

      Returns Uint8Array

    • Export OpenUSD (.usda ASCII) — a real Z-up USD stage (geometry-backed).

      Parameters

      • content: Uint8Array

      Returns Uint8Array

    • Exact authored extrusion sources and their world-space product occurrences.

      Parameters

      • content: Uint8Array
      • Optionalids: Uint32Array<ArrayBufferLike>

      Returns ExtrusionDefinitionsJs

    • Extract raw profile polygons from all IfcExtrudedAreaSolid building elements.

      Returns profile outlines + placement transforms for clean 2D projection without the tessellation artifacts that EdgeExtractor produces.

      Parameters

      • content: string

        Raw IFC file text.

      • OptionalmodelIndex: number

        Federation model index (use 0 for single-model files).

      Returns ProfileCollection

    • Exact authored swept-disk definitions and measurements in IFC world metres.

      Parameters

      • content: Uint8Array
      • Optionalids: Uint32Array<ArrayBufferLike>

      Returns SweptDiskDescriptions

    • Read back the active geometry-hash tolerance (null = disabled).

      Returns number | null

    • Read back the merge-layers flag for UI surfaces.

      Returns boolean

    • Read back the active small-cut skip flag.

      Returns boolean

    • Get version

      Returns string

    • Initialize IFC-Lite WASM The WASM binary is automatically resolved from the same location as the JS module

      Returns Promise<void>

    • Check if initialized

      Returns boolean

    • Parse IfcAlignment directrix curves into a flat Float32Array of 3D line-list vertices [x0,y0,z0, x1,y1,z1, …] in renderer Y-up world space (RTC-subtracted, metres). Feed straight to renderer.setLineOverlay('alignment', …). Empty when the file has no alignments.

      Parameters

      • content: string
      • Optionalframe: RtcFrame

      Returns Float32Array

    • Parse IfcGrid / IfcGridAxis into structured per-axis data ({ gridId, axisId, tag, start, end }) in renderer Y-up world space (RTC-subtracted, metres). Use this when you also need the axis tags to render grid bubbles / labels. See issue #945.

      Parameters

      • content: string
      • Optionalframe: RtcFrame

      Returns GridAxisCollection

    • Parse IfcGrid / IfcGridAxis into a flat Float32Array of 3D line-list vertices [x0,y0,z0, x1,y1,z1, …] (one segment per axis) in renderer Y-up world space (RTC-subtracted, metres) — the same frame the streamed meshes render in, so grids overlay the model by construction (issue #945). Feed to setLineOverlay('grid', …), NOT 'annotation' (it expands bounds, #967). Empty when the file has no grids.

      Parameters

      • content: string
      • Optionalframe: RtcFrame

      Returns Float32Array

    • Plan coordinate compatibility patches; all domain math remains in Rust.

      Parameters

      • content: Uint8Array

      Returns string

    • Reset the JS wrapper state. This does not reload wasm-bindgen's module singleton after a fatal WASM panic.

      Returns void

    • Enable / disable per-entity geometry fingerprinting (issue #924). Pass a positive tolerance in metres to enable; null disables. Safe to call before init() — the value is cached and re-applied on the freshly-constructed IfcAPI.

      Parameters

      • tolerance: number | null

      Returns void

    • Enable / disable Revit-style multilayer-wall merging (issue #540). Safe to call before init() — the value is cached and re-applied on the freshly-constructed IfcAPI.

      Parameters

      • enabled: boolean

      Returns void

    • Toggle the tier-independent small-cut skip (issue #1286). Safe to call before init() — the value is cached and re-applied on the freshly constructed IfcAPI. Applies to meshes produced AFTER the call.

      Parameters

      • on: boolean

      Returns void

    • Select the tessellation detail level for curved geometry (issue #976). null restores the engine default ('medium' — output identical to the pre-quality pipeline). Safe to call before init() — the value is cached and re-applied on the freshly-constructed IfcAPI. Applies to meshes produced AFTER the call; already-emitted geometry is not regenerated.

      Parameters

      Returns void

    • Demesher: simplify already-produced element meshes (flattened parallel arrays, one record per MeshData entry) at per-element levels 1-5. Returns the wasm SimplifiedMeshes result object (render meshes in the boundary Y-up convention + IFC-local file-unit geometry per element).

      Parameters

      • expressIds: Uint32Array
      • levels: Uint8Array
      • positions: Float32Array
      • normals: Float32Array
      • indices: Uint32Array
      • vertexCounts: Uint32Array
      • indexCounts: Uint32Array
      • origins: Float64Array
      • localToWorld: Float64Array
      • localToWorldPresent: Uint8Array
      • rtcX: number
      • rtcY: number
      • rtcZ: number
      • unitScale: number
      • yUp: boolean

      Returns SimplifiedMeshes