IFClite TypeScript API
    Preparing search index...

    Interface MergeExportOptions

    Options for merged STEP export

    interface MergeExportOptions {
        application?: string;
        author?: string;
        description?: string;
        dropEmptyContainers?: boolean;
        filename?: string;
        hiddenEntityIdsByModel?: Map<string, Set<number>>;
        isolatedEntityIdsByModel?: Map<string, Set<number> | null>;
        mergeBuildings?: "single" | "by-name";
        mergeSites?: "single" | "by-name";
        mergeStoreys?: "by-name" | "by-elevation" | "by-name-then-elevation";
        onProgress?: (progress: ExportProgress) => void;
        organization?: string;
        projectStrategy?: "keep-first";
        schema: "IFC2X3" | "IFC4" | "IFC4X3" | "IFC5";
        unitReconciliation?: "auto" | "normalize" | "assume-shared";
        visibleOnly?: boolean;
    }
    Index
    application?: string

    Application name (defaults to 'ifc-lite')

    author?: string

    Author name

    description?: string

    File description

    dropEmptyContainers?: boolean

    Drop spatial containers (IfcSite / IfcBuilding / IfcBuildingStorey / IfcSpace) the merge leaves holding nothing — the "Merge Projects" recipe step the matching options above do not cover (#3643). Emptiness is judged on the MERGED model, after visibility filtering and spatial unification, so a container only a later model fills is kept; see merged-empty-containers.ts for the exact rule. Off by default: output is byte-identical to a merge that never asked for it.

    filename?: string

    Output filename

    hiddenEntityIdsByModel?: Map<string, Set<number>>

    Hidden entity IDs per model (local expressIds)

    isolatedEntityIdsByModel?: Map<string, Set<number> | null>

    Isolated entity IDs per model (null = no isolation)

    mergeBuildings?: "single" | "by-name"

    Same matching strategy as mergeSites, applied to IfcBuilding.

    mergeSites?: "single" | "by-name"

    How IfcSite instances are matched across models for spatial unification (mirrors IfcOpenShell/BlenderBIM's "Merge Projects" recipe). Omitted (default) keeps today's combined heuristic: match by Name (case-insensitive), else unify when both models contribute exactly one site.

    • 'single': unify only when each model contributes exactly one IfcSite — Name is ignored entirely.
    • 'by-name': unify only sites with a matching Name; a lone, differently-named site in each model is kept as two separate roots.
    mergeStoreys?: "by-name" | "by-elevation" | "by-name-then-elevation"

    How IfcBuildingStorey instances are matched across models. Omitted (default) is 'by-name-then-elevation' — today's behavior.

    • 'by-name': match only by Name (case-insensitive); no elevation fallback.
    • 'by-elevation': match only by Elevation (±0.5 model-unit tolerance, same as today), ignoring Name entirely.
    • 'by-name-then-elevation': try Name first, fall back to Elevation.
    onProgress?: (progress: ExportProgress) => void

    Progress callback for async export

    organization?: string

    Organization name

    projectStrategy?: "keep-first"

    Strategy for merging the project hierarchy.

    • 'keep-first': Keep the first model's IfcProject as the root
    schema: "IFC2X3" | "IFC4" | "IFC4X3" | "IFC5"

    IFC schema version for the output file (any version, will convert if needed)

    unitReconciliation?: "auto" | "normalize" | "assume-shared"

    How to reconcile models whose length unit differs from the first model's.

    • 'auto' (default): unit-aware merge. Models that share the first model's length unit are unified into a single IfcProject (spatial structure and infrastructure deduplicated). A model with a different length unit is federated — it keeps its own IfcProject, IfcUnitAssignment and representation contexts so its coordinates stay correctly scaled, instead of being silently reinterpreted under the first model's unit. The output then contains more than one IfcProject (a deliberate relaxation of the IfcSingleProjectInstance rule, flagged in stats.warnings) — the only way to preserve mixed units in one file without rewriting every length-valued attribute.
    • 'normalize': single-unit merge. A model with a different length unit is rescaled — every length-valued datum (all IfcCartesianPoint coordinates, extrusion depths, profile dimensions, radii, thicknesses, storey elevations, placement offsets, IfcLengthMeasure property values, IfcQuantityLength/Area/Volume, …) is converted from its own unit into the first model's unit — and then unified into the single first IfcProject (its IfcUnitAssignment and contexts deduplicated). The output is one ordinary single-unit IFC that opens correctly everywhere (BIM Vision included). Angles, ratios, counts and georeferencing offsets are left as-is. Area/volume values assume the SI-derived unit (square/cube of the length unit). See ./unit-normalize.ts for the exact set of rescaled attributes.
    • 'assume-shared': treat every model as sharing the first model's unit (the pre-1332 behaviour). Use only when the caller has already normalised units; mixing real units under this mode mis-scales geometry.
    visibleOnly?: boolean

    Apply visibility filtering to each model before merging