IFClite TypeScript API
    Preparing search index...

    Class MergedExporter

    Merges multiple IFC models into a single STEP file.

    Uses the same approach as IfcOpenShell's MergeProjects recipe, extended with spatial hierarchy unification and unit-aware federation:

    1. First model's entities use their original IDs
    2. Subsequent models' IDs are offset to avoid collisions
    3. A model that shares the first model's length unit is unified: its IfcProject is remapped to the first model's, spatial structure (Site, Building, Storey) is unified by name/elevation, and shared infrastructure (units, contexts) is deduplicated.
    4. A model with a different length unit is federated: it keeps its own IfcProject, IfcUnitAssignment and representation contexts, so its raw coordinates remain correctly scaled rather than being reinterpreted under the first model's unit (the mis-scale bug, issue #1332).
    5. GlobalIds are reconciled, not blindly duplicated: a non-relationship rooted entity that repeats a GlobalId already emitted in the same unit space is unified (references remapped to the one instance). Otherwise — a federated/different-unit instance, or an objectified relationship whose payload (RelatedObjects) may differ — it is kept and re-stamped with a fresh deterministic GlobalId so the file has no duplicate-GlobalId errors and no relationship membership is lost.

    Conformance trade-off: when federation triggers (under the default 'auto'), the file contains more than one IfcProject, which intentionally relaxes the IfcSingleProjectInstance EXPRESS rule (SIZEOF(IfcProject) <= 1). This preserves both units without rewriting coordinates, and is strictly better than a silent mis-scale. MergeExportResult.stats.warnings flags it. To instead get one ordinary single-unit IfcProject, pass unitReconciliation: 'normalize' — it rescales every length-valued datum of the differing-unit models into the first model's unit (see ./unit-normalize.ts). Use 'assume-shared' only when the caller has already normalised units.

    Limitation: federation only unifies a model against the first model's unit group. Two non-first models that share a unit different from the first are each kept as independent projects (correct, just less deduplicated).

    Index
    • Like exportAsync, but assembles the merged STEP file as an off-heap multi-part Blob (via assembleStepBlob) rather than one contiguous Uint8Array. The merged file is the largest STEP output ifc-lite produces (every federated model concatenated), so skipping the final contiguous buffer is where the memory saving matters most; the browser download path hands the Blob straight to downloadBlob with no Uint8Array-to-BlobPart copy. Byte content is identical to exportAsync.

      Parameters

      Returns Promise<MergeBlobExportResult>