Skip to content

@ifc-lite/parser@3.3.0

Choose a tag to compare

@louistrue louistrue released this 17 Jun 14:14
· 27 commits to main since this release
730490b

Minor Changes

  • #1143 248f2c0 Thanks @louistrue! - Preserve source IFC HEADER fields on round-trip export. Re-exporting an
    imported file previously regenerated a fresh ifc-lite header, silently dropping
    the source FILE_DESCRIPTION items (any ViewDefinition [...] label and vendor
    identifier / coordinate-reference strings) and flattening the exact
    FILE_SCHEMA token (e.g. IFC4X3_ADD2IFC4X3, which some toolchains
    reject).

    The parser now captures the verbatim HEADER onto a new
    IfcDataStore.sourceHeader (IfcSourceHeader, exported from @ifc-lite/data;
    parser also exports parseSourceHeader), threaded through the worker transport.
    StepExporter reproduces the source FILE_DESCRIPTION items and the exact
    FILE_SCHEMA token when not converting schemas, falling back to parsing the
    source bytes for cache-restored stores. Provenance stays honest:
    preprocessor_version is set to ifc-lite while the source authoring tool is
    kept as originating_system, and when mutations exist exactly one
    Re-exported by ifc-lite, N modification(s) item is appended without removing
    the source items. generateHeader now accepts description/author/organization
    arrays plus a free-form schema token and STEP-escapes all fields; it also emits
    a properly parenthesised FILE_DESCRIPTION list (the prior single-string form
    was malformed STEP). Created-from-scratch (IfcCreator) and federated/merged
    exports are unaffected — they keep their own provenance headers by design.

Patch Changes

  • #1151 bfd9004 Thanks @louistrue! - De-duplicate the STEP serializer into a single source of truth. The
    schema-agnostic STEP serialization logic (serializeValue, generateHeader,
    parseStepValue, ref/enumVal/isEntityRef/isEnumValue, and the
    registry-injected toStepLineWithRegistry / generateStepFileWithRegistry)
    previously existed as four hand-synced copies — the codegen template plus three
    generated serializers.ts files — which had already silently drifted (the
    runtime copy carried a ?? [] hardening the template lacked). It now lives once
    in @ifc-lite/data; the per-schema bundles (parser runtime + codegen outputs)
    are thin re-exports that only bind their own SCHEMA_REGISTRY to the
    registry-coupled helpers, so the copies can never diverge again. A codegen test
    asserts the generated bundle stays a thin re-export rather than re-inlining
    logic.

    Also fixes the broken generate:ifc4 script (it pointed at a non-existent
    schemas/IFC4.exp; the real file is schemas/IFC4_ADD2_TC1.exp). No public
    behaviour change: @ifc-lite/parser re-exports the same serializer symbols as
    before; @ifc-lite/data gains the shared primitives; @ifc-lite/codegen now
    declares @ifc-lite/data as a dependency since the generated bundle imports it.

  • #1145 ddae2b0 Thanks @louistrue! - Resolve names for IfcGroup-family entities and make zones/systems listable (#1075 follow-up).

    IfcZone, IfcGroup, IfcSystem and IfcDistributionSystem are not IfcProduct subtypes, so the columnar parser categorised them as CAT_SKIP and never added them to the EntityTable. As a result getName() returned '' (the UI showed "Group #"), getByType() could not find them (so they were absent from lists), and the "By Zone" lens fell back to an arbitrary first group because getTypeName() returned Unknown. IfcSpatialZone was in the table but its Name was never extracted.

    This routes the group family into the EntityTable with Name (falling back to LongName for systems/zones that leave Name empty) plus Description and ObjectType (the system designation), and extracts names for the previously-unnamed "other relevant" products (including IfcSpatialZone). New IfcSystem / IfcDistributionSystem IfcTypeEnum entries make systems addressable by getByType. Zones, spatial zones and systems are now selectable in the list builder and ship a "Zones & Systems" preset, the relationship card and "By Zone" lens legend show real names (with an ObjectType fallback for unnamed systems), and selecting a group surfaces its attributes.

    The cache FORMAT_VERSION is bumped (6 → 7) so models cached before the fix re-parse and pick up the resolved names.

  • Updated dependencies [bfd9004, 248f2c0, ddae2b0]:

    • @ifc-lite/data@2.1.0