IfcAPI - Web-IFC API Shim Implementation for full read functionality

Constructors

Properties

_isCoordinated: boolean = false
conwaywasm: ConwayGeometry = ...
fs: any = undefined
globalModelIDCounter: number = 0
identity: number[] = ...
isWasmPathAbsolute: boolean = false
linearScalingFactor: number = 1
models: Map<number, IfcApiModelPassthrough> = ...
NormalizeMat: mat4 = ...
properties: Properties = ...
settings: undefined | Loadersettings
wasmModule: any = undefined
wasmPath: string = ''

Methods

  • Closes a model and frees all related memory

    Parameters

    • modelID: number

      Model handle retrieved by OpenModel, model must not be closed

    Returns void

  • Creates a map between element ExpressIDs and GlobalIDs. Each element has two entries, (ExpressID -> GlobalID) and (GlobalID -> ExpressID).

    Parameters

    • modelID: number

      handle retrieved by OpenModel

    Returns void

  • Creates a new model and returns a modelID number (unimplemented)

    Parameters

    • Optionalsettings: Loadersettings

      settings for generating data the model

    Returns number

    model ID

  • Parameters

    • modelID: number

    Returns Uint8Array<ArrayBufferLike>

    unimplemented

  • Parameters

    • modelID: number
    • line: any

    Returns void

  • Parameters

    • modelID: number

    Returns Vector<number>

  • The conway version string like "0.23.940-WebMT"

    Returns string

  • Parameters

    • modelID: number

    Returns number[]

  • Load geometry for a single element

    Parameters

    • modelID: number

      handle retrieved by OpenModel

    • expressID: number

      express ID of flat mesh

    Returns FlatMesh

  • Opens a model and returns a modelID number

    Parameters

    • modelID: number

      handle retrieved by OpenModel, model must not be closed

    • geometryExpressID: number

      containing IFC data (bytes)

    Returns IfcGeometry

  • Parameters

    • ptr: number
    • size: number

    Returns Uint32Array<ArrayBufferLike>

  • Parameters

    • modelID: number
    • expressID: number
    • flatten: boolean = false

    Returns string | void

    line data

  • Get all line ids with the matching type

    Parameters

    • modelID: number
    • type: number

    Returns Vector<number>

    The matching express IDs

  • Parameters

    • modelID: number
    • expressID: number

    Returns RawLineData

  • Parameters

    • heap: Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>
    • startPtr: number
    • sizeBytes: number

    Returns Uint32Array<ArrayBufferLike> | Float32Array<ArrayBufferLike>

  • Parameters

    • ptr: number
    • size: number

    Returns Float32Array<ArrayBufferLike>

  • Initializes the WASM module (WebIFCWasm), required before using any other functionality.

    Parameters

    • OptionalcustomLocateFileHandler: FileHandlerFunction

      An optional locateFile function that let's you override the path from which the wasm module is loaded.

    Returns Promise<void>

  • Checks if a specific model ID is open or closed

    Parameters

    • modelID: number

      handle retrieved by OpenModel

    Returns boolean

  • Load all geometry in a model

    Parameters

    • modelID: number

      handle retrieved by OpenModel

    Returns Vector<FlatMesh>

  • Opens a model and returns a modelID number

    Parameters

    • data: Uint8Array<ArrayBufferLike>

      containing IFC data (bytes)

    • Optionalsettings: Loadersettings

      settings for loading the model

    Returns number

    model ID

  • Cooperative variant of OpenModel (conway extension; feature-detect with typeof api.OpenModelAsync === 'function'). Identical parse/extraction, but periodically yields to the event loop so browsers can repaint progress UI (settings.ON_PROGRESS) and the tab is not flagged as stalled — conway issue #301 §2. Currently cooperative for IFC input; AP214/AP203/AP242 fall back to the synchronous path.

    Parameters

    • data: Uint8Array<ArrayBufferLike>

      containing IFC data (bytes)

    • Optionalsettings: Loadersettings

      settings for loading the model

    Returns Promise<number>

    model ID

  • Streamed-open variant of OpenModelAsync (conway extension; feature-detect with typeof api.OpenModelStreamed === 'function'). IFC input parses through the streaming columnar indexer, so the model's record index is columnar from birth and the classic per-record object phase — the dominant JS-heap cost of parsing large models — never exists. Everything downstream is identical to OpenModelAsync: same cooperative geometry extraction, same meshes/properties surface, and SpillModelSource works afterwards as usual.

    Never does worse than OpenModelAsync: non-IFC formats and any streamed-parse failure fall back to the classic path internally, so -1 here means the classic open would have failed too.

    Parameters

    • data: Uint8Array<ArrayBufferLike>

      containing IFC data (bytes)

    • Optionalsettings: Loadersettings

      settings for loading the model

    Returns Promise<number>

    model ID

  • Conway extension (no web-ifc equivalent): drop the model's materialised entity/descriptor caches, returning that memory to the JS heap. Entities and attributes rematerialise transparently on the next property access, so callers can invoke this between UI interactions to keep the property working set bounded to what the active UI is touching.

    Parameters

    • modelID: number

    Returns void

  • Conway extension: lazily iterate the express IDs of all root-derived (GlobalId-bearing) entities — products, relationships, property sets, quantities — straight from the type index. No entity descriptors are materialised and the source buffer is never touched, so this is safe and cheap even after SpillModelSource, and lets property sweeps skip the geometric-resource records that dominate large models.

    Multi-mapped entities may be yielded once per mapping; callers that need distinct IDs should dedupe. Returns undefined when the model doesn't exist or its schema has no root-type notion (e.g. AP214).

    Parameters

    • modelID: number

      The model to iterate.

    Returns undefined | IterableIterator<number, any, any>

    Lazy express ID iterator, or undefined when unsupported.

  • Parameters

    • modelID: number
    • transformationMatrix: number[]

    Returns void

  • Set conway's console-echo log threshold, web-ifc compatible surface (numeric LogLevel enum). Embedders (e.g. Share) use this to quiet a clean load's console down to warnings/errors — conway issue #301.

    Parameters

    • level: LogLevel

      the web-ifc style numeric log level

    Returns void

  • Parameters

    • path: string

      new wasm path

    • absolute: boolean = false

      is the path absolute?

    Returns void

  • Conway extension: release the model's resident source buffer and serve subsequent record reads through fixed-size windows paged in from an external byte store (which must hold exactly the model's source bytes — e.g. the original file already sitting in OPFS).

    After a spill, asynchronous property APIs page ranges in on demand; SYNCHRONOUS record reads (getLine on the passthrough) require the range to be resident and throw otherwise. Call this only after load-time sweeps (geometry extraction, spatial tree, GLB property capture) are done.

    Parameters

    • modelID: number

      The model to spill.

    • store: StepExternalByteStore

      The external byte store holding the source bytes.

    • OptionalchunkBytes: number

      Optional window size in bytes (default 4MiB).

    • OptionalmaxResidentChunks: number

      Optional residency cap (default 16 windows).

    Returns boolean

    True when the spill happened.

  • Parameters

    • modelID: number
    • meshCallback: ((mesh: FlatMesh) => void)
        • (mesh): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • modelID: number
    • types: number[]
    • meshCallback: ((mesh: FlatMesh) => void)
        • (mesh): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • modelID: number
    • lineObject: any

    Returns void