@ifc-lite/export 4.13.3 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/affected-set.d.ts.map +1 -1
- package/dist/affected-set.js +9 -2
- package/dist/affected-set.js.map +1 -1
- package/dist/anonymize-export.js +2 -2
- package/dist/anonymize-export.js.map +1 -1
- package/dist/anonymize-scrub.js +3 -3
- package/dist/anonymize-scrub.js.map +1 -1
- package/dist/appearance-dependencies.js +1 -1
- package/dist/appearance-dependencies.js.map +1 -1
- package/dist/attribute-real-slots.js +1 -1
- package/dist/attribute-real-slots.js.map +1 -1
- package/dist/attribute-slot-types.d.ts.map +1 -1
- package/dist/attribute-slot-types.js +22 -14
- package/dist/attribute-slot-types.js.map +1 -1
- package/dist/authored-resource-cleanup.js +1 -1
- package/dist/authored-resource-cleanup.js.map +1 -1
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +5 -4
- package/dist/declared-property-type.js.map +1 -1
- package/dist/edit-ownership.d.ts +8 -0
- package/dist/edit-ownership.d.ts.map +1 -1
- package/dist/edit-ownership.js +58 -44
- package/dist/edit-ownership.js.map +1 -1
- package/dist/effective-index-created-rows.d.ts +22 -0
- package/dist/effective-index-created-rows.d.ts.map +1 -0
- package/dist/effective-index-created-rows.js +48 -0
- package/dist/effective-index-created-rows.js.map +1 -0
- package/dist/effective-index.d.ts.map +1 -1
- package/dist/effective-index.js +4 -3
- package/dist/effective-index.js.map +1 -1
- package/dist/effective-source-record.js +1 -1
- package/dist/effective-source-record.js.map +1 -1
- package/dist/entity-subgraph.d.ts +6 -2
- package/dist/entity-subgraph.d.ts.map +1 -1
- package/dist/entity-subgraph.js +70 -5
- package/dist/entity-subgraph.js.map +1 -1
- package/dist/entity-type-sets.d.ts +2 -19
- package/dist/entity-type-sets.d.ts.map +1 -1
- package/dist/entity-type-sets.js +14 -4
- package/dist/entity-type-sets.js.map +1 -1
- package/dist/georef-closure.d.ts +12 -0
- package/dist/georef-closure.d.ts.map +1 -1
- package/dist/georef-closure.js +3 -1
- package/dist/georef-closure.js.map +1 -1
- package/dist/ifc4-registry.d.ts +14 -0
- package/dist/ifc4-registry.d.ts.map +1 -0
- package/dist/ifc4-registry.js +22 -0
- package/dist/ifc4-registry.js.map +1 -0
- package/dist/ifc5-effective-rows.js +1 -1
- package/dist/ifc5-effective-rows.js.map +1 -1
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +3 -10
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/ifc5-tree-scope.js +2 -2
- package/dist/ifc5-tree-scope.js.map +1 -1
- package/dist/index.d.ts +8 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/lod0-generator.d.ts.map +1 -1
- package/dist/lod0-generator.js +14 -8
- package/dist/lod0-generator.js.map +1 -1
- package/dist/merged-bake.d.ts +32 -0
- package/dist/merged-bake.d.ts.map +1 -0
- package/dist/merged-bake.js +120 -0
- package/dist/merged-bake.js.map +1 -0
- package/dist/merged-context.d.ts +49 -6
- package/dist/merged-context.d.ts.map +1 -1
- package/dist/merged-context.js +165 -53
- package/dist/merged-context.js.map +1 -1
- package/dist/merged-exporter.d.ts +7 -14
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +48 -113
- package/dist/merged-exporter.js.map +1 -1
- package/dist/merged-georef-normalize.d.ts +54 -0
- package/dist/merged-georef-normalize.d.ts.map +1 -0
- package/dist/merged-georef-normalize.js +260 -0
- package/dist/merged-georef-normalize.js.map +1 -0
- package/dist/merged-project-contexts.d.ts +12 -0
- package/dist/merged-project-contexts.d.ts.map +1 -0
- package/dist/merged-project-contexts.js +56 -0
- package/dist/merged-project-contexts.js.map +1 -0
- package/dist/merged-remap.d.ts +2 -0
- package/dist/merged-remap.d.ts.map +1 -1
- package/dist/merged-remap.js +10 -0
- package/dist/merged-remap.js.map +1 -1
- package/dist/merged-subcontext.d.ts +22 -0
- package/dist/merged-subcontext.d.ts.map +1 -1
- package/dist/merged-subcontext.js +14 -18
- package/dist/merged-subcontext.js.map +1 -1
- package/dist/nonrel-positional-ref-narrowing.js +6 -6
- package/dist/nonrel-positional-ref-narrowing.js.map +1 -1
- package/dist/nonrel-ref-list-types.d.ts +4 -4
- package/dist/nonrel-ref-list-types.d.ts.map +1 -1
- package/dist/nonrel-ref-list-types.js +19 -7
- package/dist/nonrel-ref-list-types.js.map +1 -1
- package/dist/parquet-created-entity-rows.js +1 -1
- package/dist/parquet-created-entity-rows.js.map +1 -1
- package/dist/parquet-relationship-rows.js +1 -1
- package/dist/parquet-relationship-rows.js.map +1 -1
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +2 -2
- package/dist/reference-collector.js.map +1 -1
- package/dist/registry-entity-names.d.ts +6 -2
- package/dist/registry-entity-names.d.ts.map +1 -1
- package/dist/registry-entity-names.js +10 -2
- package/dist/registry-entity-names.js.map +1 -1
- package/dist/relationship-slot-bounds.js +4 -4
- package/dist/relationship-slot-bounds.js.map +1 -1
- package/dist/remesh-context-roots.d.ts +13 -6
- package/dist/remesh-context-roots.d.ts.map +1 -1
- package/dist/remesh-context-roots.js +51 -22
- package/dist/remesh-context-roots.js.map +1 -1
- package/dist/renumber-step-ids.d.ts +43 -0
- package/dist/renumber-step-ids.d.ts.map +1 -0
- package/dist/renumber-step-ids.js +237 -0
- package/dist/renumber-step-ids.js.map +1 -0
- package/dist/retype.d.ts.map +1 -1
- package/dist/retype.js +23 -12
- package/dist/retype.js.map +1 -1
- package/dist/schema-conversion-description.d.ts +6 -0
- package/dist/schema-conversion-description.d.ts.map +1 -0
- package/dist/schema-conversion-description.js +25 -0
- package/dist/schema-conversion-description.js.map +1 -0
- package/dist/schema-conversion-loss-report.d.ts +20 -34
- package/dist/schema-conversion-loss-report.d.ts.map +1 -1
- package/dist/schema-conversion-loss-report.js +177 -14
- package/dist/schema-conversion-loss-report.js.map +1 -1
- package/dist/schema-converter-attr-maps.d.ts +51 -0
- package/dist/schema-converter-attr-maps.d.ts.map +1 -0
- package/dist/schema-converter-attr-maps.js +142 -0
- package/dist/schema-converter-attr-maps.js.map +1 -0
- package/dist/schema-converter-attr-remap.d.ts +8 -0
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +15 -1
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter-document-links.d.ts +23 -0
- package/dist/schema-converter-document-links.d.ts.map +1 -0
- package/dist/schema-converter-document-links.js +146 -0
- package/dist/schema-converter-document-links.js.map +1 -0
- package/dist/schema-converter-enums.d.ts +13 -1
- package/dist/schema-converter-enums.d.ts.map +1 -1
- package/dist/schema-converter-enums.js +30 -4
- package/dist/schema-converter-enums.js.map +1 -1
- package/dist/schema-converter-ifc4-slots.d.ts +4 -3
- package/dist/schema-converter-ifc4-slots.d.ts.map +1 -1
- package/dist/schema-converter-ifc4-slots.js +4 -3
- package/dist/schema-converter-ifc4-slots.js.map +1 -1
- package/dist/schema-converter-renames.d.ts +17 -0
- package/dist/schema-converter-renames.d.ts.map +1 -1
- package/dist/schema-converter-renames.js +34 -2
- package/dist/schema-converter-renames.js.map +1 -1
- package/dist/schema-converter-retyped.d.ts +17 -0
- package/dist/schema-converter-retyped.d.ts.map +1 -0
- package/dist/schema-converter-retyped.js +68 -0
- package/dist/schema-converter-retyped.js.map +1 -0
- package/dist/schema-converter-structural-axes.d.ts +55 -0
- package/dist/schema-converter-structural-axes.d.ts.map +1 -0
- package/dist/schema-converter-structural-axes.js +378 -0
- package/dist/schema-converter-structural-axes.js.map +1 -0
- package/dist/schema-converter-structural-carriers.d.ts +76 -0
- package/dist/schema-converter-structural-carriers.d.ts.map +1 -0
- package/dist/schema-converter-structural-carriers.js +330 -0
- package/dist/schema-converter-structural-carriers.js.map +1 -0
- package/dist/schema-converter-structural-diagnostics.d.ts +64 -0
- package/dist/schema-converter-structural-diagnostics.d.ts.map +1 -0
- package/dist/schema-converter-structural-diagnostics.js +219 -0
- package/dist/schema-converter-structural-diagnostics.js.map +1 -0
- package/dist/schema-converter-structural-links.d.ts +21 -0
- package/dist/schema-converter-structural-links.d.ts.map +1 -0
- package/dist/schema-converter-structural-links.js +38 -0
- package/dist/schema-converter-structural-links.js.map +1 -0
- package/dist/schema-converter-structural-source.d.ts +76 -0
- package/dist/schema-converter-structural-source.d.ts.map +1 -0
- package/dist/schema-converter-structural-source.js +197 -0
- package/dist/schema-converter-structural-source.js.map +1 -0
- package/dist/schema-converter-structural-thickness.d.ts +33 -0
- package/dist/schema-converter-structural-thickness.d.ts.map +1 -0
- package/dist/schema-converter-structural-thickness.js +155 -0
- package/dist/schema-converter-structural-thickness.js.map +1 -0
- package/dist/schema-converter-structural-varying.d.ts +50 -0
- package/dist/schema-converter-structural-varying.d.ts.map +1 -0
- package/dist/schema-converter-structural-varying.js +170 -0
- package/dist/schema-converter-structural-varying.js.map +1 -0
- package/dist/schema-converter-structural.d.ts +8 -0
- package/dist/schema-converter-structural.d.ts.map +1 -0
- package/dist/schema-converter-structural.js +81 -0
- package/dist/schema-converter-structural.js.map +1 -0
- package/dist/schema-converter-userdefined-label.d.ts +8 -0
- package/dist/schema-converter-userdefined-label.d.ts.map +1 -0
- package/dist/schema-converter-userdefined-label.js +60 -0
- package/dist/schema-converter-userdefined-label.js.map +1 -0
- package/dist/schema-converter-userdefined.d.ts +15 -0
- package/dist/schema-converter-userdefined.d.ts.map +1 -0
- package/dist/schema-converter-userdefined.js +59 -0
- package/dist/schema-converter-userdefined.js.map +1 -0
- package/dist/schema-converter-value-forms.d.ts +12 -0
- package/dist/schema-converter-value-forms.d.ts.map +1 -0
- package/dist/schema-converter-value-forms.js +188 -0
- package/dist/schema-converter-value-forms.js.map +1 -0
- package/dist/schema-converter.d.ts +2 -8
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +57 -68
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-enum-policy.d.ts +5 -1
- package/dist/schema-enum-policy.d.ts.map +1 -1
- package/dist/schema-enum-policy.js +21 -1
- package/dist/schema-enum-policy.js.map +1 -1
- package/dist/schema-grid-frames.d.ts +19 -0
- package/dist/schema-grid-frames.d.ts.map +1 -0
- package/dist/schema-grid-frames.js +84 -0
- package/dist/schema-grid-frames.js.map +1 -0
- package/dist/schema-ifc2x3-placements.d.ts +12 -0
- package/dist/schema-ifc2x3-placements.d.ts.map +1 -0
- package/dist/schema-ifc2x3-placements.js +297 -0
- package/dist/schema-ifc2x3-placements.js.map +1 -0
- package/dist/schema-ifc2x3-records.d.ts +58 -0
- package/dist/schema-ifc2x3-records.d.ts.map +1 -0
- package/dist/schema-ifc2x3-records.js +179 -0
- package/dist/schema-ifc2x3-records.js.map +1 -0
- package/dist/schema-style-flatten.d.ts +7 -2
- package/dist/schema-style-flatten.d.ts.map +1 -1
- package/dist/schema-style-flatten.js +34 -2
- package/dist/schema-style-flatten.js.map +1 -1
- package/dist/schema-value-form-policy.d.ts +129 -0
- package/dist/schema-value-form-policy.d.ts.map +1 -0
- package/dist/schema-value-form-policy.js +222 -0
- package/dist/schema-value-form-policy.js.map +1 -0
- package/dist/section-export.d.ts.map +1 -1
- package/dist/section-export.js +3 -2
- package/dist/section-export.js.map +1 -1
- package/dist/select-qualification.d.ts.map +1 -1
- package/dist/select-qualification.js +6 -5
- package/dist/select-qualification.js.map +1 -1
- package/dist/step-collection.d.ts.map +1 -1
- package/dist/step-collection.js +5 -0
- package/dist/step-collection.js.map +1 -1
- package/dist/step-comment-skip.d.ts +8 -0
- package/dist/step-comment-skip.d.ts.map +1 -1
- package/dist/step-comment-skip.js +28 -0
- package/dist/step-comment-skip.js.map +1 -1
- package/dist/step-coordinate-options.d.ts +15 -0
- package/dist/step-coordinate-options.d.ts.map +1 -1
- package/dist/step-coordinate-options.js +13 -1
- package/dist/step-coordinate-options.js.map +1 -1
- package/dist/step-derived-quantities.d.ts +23 -0
- package/dist/step-derived-quantities.d.ts.map +1 -0
- package/dist/step-derived-quantities.js +50 -0
- package/dist/step-derived-quantities.js.map +1 -0
- package/dist/step-export-types.d.ts +2 -1
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts +0 -6
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +11 -7
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-georeferencing.d.ts +2 -0
- package/dist/step-georeferencing.d.ts.map +1 -1
- package/dist/step-georeferencing.js +122 -46
- package/dist/step-georeferencing.js.map +1 -1
- package/dist/step-header.d.ts.map +1 -1
- package/dist/step-header.js +4 -1
- package/dist/step-header.js.map +1 -1
- package/dist/step-internal-pset-ids.d.ts +7 -0
- package/dist/step-internal-pset-ids.d.ts.map +1 -0
- package/dist/step-internal-pset-ids.js +25 -0
- package/dist/step-internal-pset-ids.js.map +1 -0
- package/dist/step-map-unit-normalization.d.ts.map +1 -1
- package/dist/step-map-unit-normalization.js +10 -3
- package/dist/step-map-unit-normalization.js.map +1 -1
- package/dist/step-map-unit.d.ts +8 -1
- package/dist/step-map-unit.d.ts.map +1 -1
- package/dist/step-map-unit.js +13 -5
- package/dist/step-map-unit.js.map +1 -1
- package/dist/step-native-set-record.d.ts +2 -0
- package/dist/step-native-set-record.d.ts.map +1 -1
- package/dist/step-native-set-record.js +10 -0
- package/dist/step-native-set-record.js.map +1 -1
- package/dist/step-omission-predicates.d.ts.map +1 -1
- package/dist/step-omission-predicates.js +1 -0
- package/dist/step-omission-predicates.js.map +1 -1
- package/dist/step-overlay-entities.d.ts +0 -35
- package/dist/step-overlay-entities.d.ts.map +1 -1
- package/dist/step-overlay-entities.js +40 -4
- package/dist/step-overlay-entities.js.map +1 -1
- package/dist/step-overlay-property-base.d.ts +13 -0
- package/dist/step-overlay-property-base.d.ts.map +1 -0
- package/dist/step-overlay-property-base.js +30 -0
- package/dist/step-overlay-property-base.js.map +1 -0
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +13 -0
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-property-set-collection.d.ts.map +1 -1
- package/dist/step-property-set-collection.js +7 -2
- package/dist/step-property-set-collection.js.map +1 -1
- package/dist/step-property-set-generators.d.ts.map +1 -1
- package/dist/step-property-set-generators.js +8 -4
- package/dist/step-property-set-generators.js.map +1 -1
- package/dist/step-property-set-index.js +1 -1
- package/dist/step-property-set-index.js.map +1 -1
- package/dist/step-property-set-readers.d.ts.map +1 -1
- package/dist/step-property-set-readers.js +6 -5
- package/dist/step-property-set-readers.js.map +1 -1
- package/dist/step-pset-copy-on-write.d.ts.map +1 -1
- package/dist/step-pset-copy-on-write.js +9 -7
- package/dist/step-pset-copy-on-write.js.map +1 -1
- package/dist/step-record-frame.d.ts +5 -3
- package/dist/step-record-frame.d.ts.map +1 -1
- package/dist/step-record-frame.js +12 -8
- package/dist/step-record-frame.js.map +1 -1
- package/dist/step-ref-scan.d.ts +7 -0
- package/dist/step-ref-scan.d.ts.map +1 -1
- package/dist/step-ref-scan.js +24 -3
- package/dist/step-ref-scan.js.map +1 -1
- package/dist/step-serialization.d.ts +13 -1
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +29 -2
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-shared-atom-retention.js +1 -1
- package/dist/step-shared-atom-retention.js.map +1 -1
- package/dist/step-slot-grammar.d.ts +2 -0
- package/dist/step-slot-grammar.d.ts.map +1 -1
- package/dist/step-slot-grammar.js +5 -0
- package/dist/step-slot-grammar.js.map +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +7 -2
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/subset-entity-reader.d.ts.map +1 -1
- package/dist/subset-entity-reader.js +15 -8
- package/dist/subset-entity-reader.js.map +1 -1
- package/dist/subset-roots.d.ts +4 -14
- package/dist/subset-roots.d.ts.map +1 -1
- package/dist/subset-roots.js +14 -4
- package/dist/subset-roots.js.map +1 -1
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +4 -3
- package/dist/unit-normalize.js.map +1 -1
- package/dist/viewer-georef-scale.d.ts +14 -0
- package/dist/viewer-georef-scale.d.ts.map +1 -0
- package/dist/viewer-georef-scale.js +20 -0
- package/dist/viewer-georef-scale.js.map +1 -0
- package/package.json +43 -10
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/**
|
|
3
|
+
* Structural values one of IFC2X3 and IFC4 holds in an attribute and the other
|
|
4
|
+
* holds elsewhere (#9668). Each carrier is written so the other direction reads
|
|
5
|
+
* it back:
|
|
6
|
+
*
|
|
7
|
+
* - CausedBy. IFC4 deleted IfcStructuralAction.CausedBy; an action caused by a
|
|
8
|
+
* reaction is the RelatingProduct of an IfcRelAssignsToProduct named 'Causes'
|
|
9
|
+
* whose RelatedObjects is the reaction (IFC4 IfcStructuralAction, "IFC4
|
|
10
|
+
* CHANGE ... use IfcRelAssignsToProduct via ReferencedBy instead"). The
|
|
11
|
+
* upgrade adds that relationship; the downgrade keeps it (IFC2X3 has the same
|
|
12
|
+
* entity) and fills CausedBy from it.
|
|
13
|
+
* - SharedPlacement. IFC4's informal proposition on IfcStructuralAnalysisModel:
|
|
14
|
+
* every structural item grouped into the model uses SharedPlacement as its
|
|
15
|
+
* ObjectPlacement. IFC2X3 gives each product its own placement record
|
|
16
|
+
* (IfcObjectPlacement PlacesObject is SET [1:1] there), so the downgrade
|
|
17
|
+
* leaves equal copies. The upgrade writes the lowest-id copy as
|
|
18
|
+
* SharedPlacement and places the items by it. A model sharing an item with
|
|
19
|
+
* another model is left alone.
|
|
20
|
+
* - IfcStructuralLoadCase. IFC2X3 folds it into IfcStructuralLoadGroup and has
|
|
21
|
+
* no slot for SelfWeightCoefficients. The downgrade attaches a property set
|
|
22
|
+
* (`LOAD_CASE_PSET`) holding them; the upgrade turns a LOAD_CASE group that
|
|
23
|
+
* carries it back into the load case and leaves the property set out.
|
|
24
|
+
*
|
|
25
|
+
* The upgrade decides in `fromStore`: an IFC4 target withholds no ids
|
|
26
|
+
* (`computeWithheldRefIds`), and `StructuralDiagnostics` adds no records when
|
|
27
|
+
* one does. The downgrade checks withheld ids per record, where it writes.
|
|
28
|
+
* Reads the source store, so only an unedited full export arms it.
|
|
29
|
+
*/
|
|
30
|
+
import { deterministicGlobalId } from '@ifc-lite/parser';
|
|
31
|
+
import { listItems } from './schema-converter-structural-axes.js';
|
|
32
|
+
import { bareMeasure, conversionMode, isSubtype, namesWithheld, readCarrierSets, slotRef, slotUnset, stepString, writeCarrierSet, } from './schema-converter-structural-source.js';
|
|
33
|
+
import { readStepSlots, replaceStepArgument } from './step-argument-parser.js';
|
|
34
|
+
/** The property set an IFC2X3 load group carries when it was an IFC4 IfcStructuralLoadCase. */
|
|
35
|
+
export const LOAD_CASE_PSET = 'IFC4 IfcStructuralLoadCase';
|
|
36
|
+
const COEFFICIENTS = 'SelfWeightCoefficients';
|
|
37
|
+
const CAUSES = 'Causes';
|
|
38
|
+
/** IfcStructuralAction.CausedBy in IFC2X3 (IFC2X3_TC1.exp:7237): slot 10 of every action. */
|
|
39
|
+
export const CAUSED_BY = 10;
|
|
40
|
+
/** IfcProduct.ObjectPlacement. */
|
|
41
|
+
const OBJECT_PLACEMENT = 5;
|
|
42
|
+
const IFC2X3_ACTIONS = new Set(['IFCSTRUCTURALPOINTACTION', 'IFCSTRUCTURALLINEARACTION', 'IFCSTRUCTURALPLANARACTION', 'IFCSTRUCTURALLINEARACTIONVARYING', 'IFCSTRUCTURALPLANARACTIONVARYING']);
|
|
43
|
+
const CAUSED_BY_AMONG = "IFC2X3 CausedBy is one of several reactions the action's 'Causes' relationships name in IFC4, so IFC2X3 CausedBy cannot be restored from them";
|
|
44
|
+
const CAUSED_BY_WRITTEN = "IFC2X3 CausedBy is written as an IfcRelAssignsToProduct named 'Causes' from the action to the reaction, as IFC4 holds it";
|
|
45
|
+
const CAUSED_BY_READ = "an IfcRelAssignsToProduct named 'Causes' from an action to one point reaction also fills the IFC2X3 CausedBy";
|
|
46
|
+
const LOAD_CASE_WRITTEN = `IfcStructuralLoadCase is written as an IfcStructuralLoadGroup with a '${LOAD_CASE_PSET}' property set holding ${COEFFICIENTS}`;
|
|
47
|
+
const LOAD_CASE_READ = `an IfcStructuralLoadGroup with a '${LOAD_CASE_PSET}' property set is written as the IFC4 IfcStructuralLoadCase it came from`;
|
|
48
|
+
const SHARED_PLACEMENT = 'IfcStructuralAnalysisModel.SharedPlacement is written as the local placement all of its grouped structural items use or copy, and they are placed by it';
|
|
49
|
+
export class StructuralCarriers {
|
|
50
|
+
/** The exporter's express-id allocator, shared with every other record it appends. */
|
|
51
|
+
ids = null;
|
|
52
|
+
/** Whether to find what the reverse conversion restores (`restored`, `restoredFrom`); only the loss report asks. */
|
|
53
|
+
roundTrip = false;
|
|
54
|
+
pending = [];
|
|
55
|
+
mode = null;
|
|
56
|
+
/** Upgrade: action id -> reaction ids a source 'Causes' relationship already names. */
|
|
57
|
+
causesWritten = new Map();
|
|
58
|
+
/** Upgrade: the source's point reactions, the only reactions IFC2X3 has. */
|
|
59
|
+
reactions = new Set();
|
|
60
|
+
/** Downgrade: action id -> the one point reaction that causes it. */
|
|
61
|
+
causedBy = new Map();
|
|
62
|
+
/** Upgrade: analysis model id -> its SharedPlacement; item id -> the placement it is moved to. */
|
|
63
|
+
shared = new Map();
|
|
64
|
+
itemPlacements = new Map();
|
|
65
|
+
/** Upgrade: load group id -> its SelfWeightCoefficients token; the carrier records left out. */
|
|
66
|
+
loadCases = new Map();
|
|
67
|
+
consumed = new Set();
|
|
68
|
+
/** Downgrade: load cases that already have a carrier property set, so the upgrade would find two and read neither. */
|
|
69
|
+
carrierLoadCases = new Set();
|
|
70
|
+
/** Downgrade: analysis models whose SharedPlacement the upgrade derives again from their items' placements. */
|
|
71
|
+
sharedBack = new Set();
|
|
72
|
+
fromStore(source, from, to) {
|
|
73
|
+
this.mode = conversionMode(from, to);
|
|
74
|
+
if (!this.mode)
|
|
75
|
+
return;
|
|
76
|
+
const schema = from;
|
|
77
|
+
const hasActions = [...IFC2X3_ACTIONS, 'IFCSTRUCTURALCURVEACTION', 'IFCSTRUCTURALSURFACEACTION'].some((t) => source.ids(t).length);
|
|
78
|
+
const causes = hasActions ? this.readCauses(source, schema) : new Map();
|
|
79
|
+
if (this.mode === 'downgrade') {
|
|
80
|
+
// IFC2X3 CausedBy names one reaction, and IFC2X3 has only point reactions.
|
|
81
|
+
for (const [action, reactions] of causes) {
|
|
82
|
+
const [only] = reactions;
|
|
83
|
+
if (reactions.size === 1 && source.type(only) === 'IFCSTRUCTURALPOINTREACTION')
|
|
84
|
+
this.causedBy.set(action, only);
|
|
85
|
+
}
|
|
86
|
+
if (!this.roundTrip)
|
|
87
|
+
return;
|
|
88
|
+
if (source.ids('IFCSTRUCTURALLOADCASE').length) {
|
|
89
|
+
for (const set of readCarrierSets(source, LOAD_CASE_PSET, false))
|
|
90
|
+
for (const g of set.related)
|
|
91
|
+
this.carrierLoadCases.add(g);
|
|
92
|
+
}
|
|
93
|
+
if (source.ids('IFCSTRUCTURALANALYSISMODEL').length) {
|
|
94
|
+
for (const [model, items] of soleModelItems(source, 'IFC4')) {
|
|
95
|
+
// The upgrade takes the placement all items share; it is this one when this one shares it too.
|
|
96
|
+
const args = source.slots(model);
|
|
97
|
+
if (args?.length === 10 && items.size && commonPlacement(source, [slotRef(args[9]), ...items.values()]) !== null)
|
|
98
|
+
this.sharedBack.add(model);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.causesWritten = causes;
|
|
104
|
+
if (hasActions)
|
|
105
|
+
this.reactions = new Set(source.ids('IFCSTRUCTURALPOINTREACTION'));
|
|
106
|
+
if (source.ids('IFCSTRUCTURALANALYSISMODEL').length) {
|
|
107
|
+
for (const [model, items] of soleModelItems(source, 'IFC2X3'))
|
|
108
|
+
this.findSharedPlacement(source, model, items);
|
|
109
|
+
}
|
|
110
|
+
if (source.ids('IFCSTRUCTURALLOADGROUP').length)
|
|
111
|
+
this.findLoadCases(source);
|
|
112
|
+
}
|
|
113
|
+
/** Action id -> the reactions 'Causes' relationships name for it. */
|
|
114
|
+
readCauses(source, schema) {
|
|
115
|
+
const causes = new Map();
|
|
116
|
+
for (const id of source.ids('IFCRELASSIGNSTOPRODUCT')) {
|
|
117
|
+
const args = source.slots(id);
|
|
118
|
+
if (args?.length !== 7 || stepString(args[2]) !== CAUSES)
|
|
119
|
+
continue;
|
|
120
|
+
const action = slotRef(args[6]);
|
|
121
|
+
if (action === null || !isSubtype(schema, source.type(action), 'IfcStructuralAction'))
|
|
122
|
+
continue;
|
|
123
|
+
const reactions = listItems(args[4])?.map(slotRef);
|
|
124
|
+
if (!reactions || reactions.includes(null))
|
|
125
|
+
continue;
|
|
126
|
+
for (const r of reactions) {
|
|
127
|
+
if (r !== null && isSubtype(schema, source.type(r), 'IfcStructuralReaction'))
|
|
128
|
+
causes.set(action, (causes.get(action) ?? new Set()).add(r));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return causes;
|
|
132
|
+
}
|
|
133
|
+
/** IFC2X3 -> IFC4: the SharedPlacement of a model whose items' local placements are one or equal copies of one. */
|
|
134
|
+
findSharedPlacement(source, model, items) {
|
|
135
|
+
if (source.slots(model)?.length !== 9 || !items.size)
|
|
136
|
+
return;
|
|
137
|
+
const placement = commonPlacement(source, items.values());
|
|
138
|
+
if (placement === null)
|
|
139
|
+
return;
|
|
140
|
+
this.shared.set(model, placement);
|
|
141
|
+
for (const [item, own] of items)
|
|
142
|
+
if (own !== placement)
|
|
143
|
+
this.itemPlacements.set(item, placement);
|
|
144
|
+
}
|
|
145
|
+
findLoadCases(source) {
|
|
146
|
+
const sets = readCarrierSets(source, LOAD_CASE_PSET);
|
|
147
|
+
const perGroup = new Map();
|
|
148
|
+
for (const set of sets)
|
|
149
|
+
for (const g of set.related)
|
|
150
|
+
perGroup.set(g, (perGroup.get(g) ?? 0) + 1);
|
|
151
|
+
for (const set of sets) {
|
|
152
|
+
const group = set.related.length === 1 ? set.related[0] : null;
|
|
153
|
+
const prop = set.props.size === 1 ? set.props.get(COEFFICIENTS) : undefined;
|
|
154
|
+
// A group with two carriers is ambiguous, so it keeps both and stays a load group.
|
|
155
|
+
if (!set.exclusive || group === null || prop === undefined || perGroup.get(group) !== 1 || source.type(group) !== 'IFCSTRUCTURALLOADGROUP')
|
|
156
|
+
continue;
|
|
157
|
+
if (!isLoadCase(source.slots(group)))
|
|
158
|
+
continue;
|
|
159
|
+
const coefficients = this.coefficients(source.type(prop), source.slots(prop));
|
|
160
|
+
if (coefficients === null)
|
|
161
|
+
continue;
|
|
162
|
+
this.loadCases.set(group, coefficients);
|
|
163
|
+
for (const id of [set.rel, set.pset, prop])
|
|
164
|
+
this.consumed.add(id);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/** The IFC4 SelfWeightCoefficients a carrier property holds: three ratios, or `$` from a value-less single value. */
|
|
168
|
+
coefficients(type, args) {
|
|
169
|
+
if (args?.length !== 4)
|
|
170
|
+
return null;
|
|
171
|
+
if (type === 'IFCPROPERTYSINGLEVALUE' && slotUnset(args[2]))
|
|
172
|
+
return '$';
|
|
173
|
+
if (type !== 'IFCPROPERTYLISTVALUE')
|
|
174
|
+
return null;
|
|
175
|
+
const values = threeRatios(args[2]);
|
|
176
|
+
return values ? `(${values.join(',')})` : null;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The target body for one source record, `null` to leave it out, or
|
|
180
|
+
* undefined to convert it as before. Records consumed as a carrier are left
|
|
181
|
+
* out; a load group or analysis model gains its IFC4 value.
|
|
182
|
+
*/
|
|
183
|
+
rewrite(id, entity, args, withheld) {
|
|
184
|
+
if (this.mode === 'upgrade') {
|
|
185
|
+
if (this.consumed.has(id))
|
|
186
|
+
return { body: null, losses: [] };
|
|
187
|
+
const coefficients = this.loadCases.get(id);
|
|
188
|
+
if (coefficients !== undefined)
|
|
189
|
+
return { body: `IFCSTRUCTURALLOADCASE(${[...args, coefficients].join(',')})`, losses: [LOAD_CASE_READ] };
|
|
190
|
+
const placement = this.shared.get(id);
|
|
191
|
+
if (placement !== undefined)
|
|
192
|
+
return { body: `IFCSTRUCTURALANALYSISMODEL(${[...args, `#${placement}`].join(',')})`, losses: [SHARED_PLACEMENT] };
|
|
193
|
+
}
|
|
194
|
+
else if (this.mode === 'downgrade' && entity === 'IFCSTRUCTURALLOADCASE' && args.length === 11 && this.ids && !namesWithheld(args, withheld)) {
|
|
195
|
+
const property = coefficientsProperty(args[10]);
|
|
196
|
+
if (property === null)
|
|
197
|
+
return undefined;
|
|
198
|
+
this.pending.push(...writeCarrierSet(this.ids, `ifc4-load-case:${args[0].trim()}`, args[1], LOAD_CASE_PSET, id, [property]));
|
|
199
|
+
const group = args.slice(0, 10);
|
|
200
|
+
// The upgrade reads the set back only from a LOAD_CASE group that has no other.
|
|
201
|
+
const restored = isLoadCase(group) && !this.carrierLoadCases.has(id) ? [[id, [COEFFICIENTS]]] : [];
|
|
202
|
+
return { body: `IFCSTRUCTURALLOADGROUP(${group.join(',')})`, losses: [LOAD_CASE_WRITTEN], restored };
|
|
203
|
+
}
|
|
204
|
+
return undefined;
|
|
205
|
+
}
|
|
206
|
+
/** IFC4 -> IFC2X3: the attributes of record `id` that IFC2X3 leaves out and the upgrade derives again. */
|
|
207
|
+
restoredFrom(id) {
|
|
208
|
+
return this.sharedBack.has(id) ? ['SharedPlacement'] : [];
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* IFC2X3 -> IFC4: the 'Causes' relationship for an action's CausedBy, added
|
|
212
|
+
* unless the source's 'Causes' relationships already name that reaction.
|
|
213
|
+
* Returns the message to report when IFC4 holds the cause and whether the
|
|
214
|
+
* downgrade reads it back: it does when the action ends with that one cause
|
|
215
|
+
* (CAUSED_BY_WRITTEN), not with several (CAUSED_BY_AMONG). Null when the carrier is not
|
|
216
|
+
* armed (no upgrade, no id allocator, a withheld set) or the record is not an
|
|
217
|
+
* IFC2X3 action whose CausedBy names a point reaction; `inspect` then reports
|
|
218
|
+
* a set CausedBy omitted.
|
|
219
|
+
*/
|
|
220
|
+
noteCause(id, entity, args, withheld) {
|
|
221
|
+
const reaction = this.causeOf(entity, args, withheld);
|
|
222
|
+
if (reaction === null || !this.ids)
|
|
223
|
+
return null;
|
|
224
|
+
const written = this.causesWritten.get(id) ?? new Set();
|
|
225
|
+
if (!written.has(reaction)) {
|
|
226
|
+
const guid = deterministicGlobalId(`ifc2x3-caused-by:${args[0].trim()}:#${reaction}`);
|
|
227
|
+
this.pending.push(`#${this.ids()}=IFCRELASSIGNSTOPRODUCT('${guid}',${args[1]},'${CAUSES}',$,(#${reaction}),$,#${id});`);
|
|
228
|
+
}
|
|
229
|
+
// The downgrade restores CausedBy only for an action with exactly one cause.
|
|
230
|
+
const total = written.size + (written.has(reaction) ? 0 : 1);
|
|
231
|
+
return total === 1 ? { message: CAUSED_BY_WRITTEN, restored: true } : { message: CAUSED_BY_AMONG, restored: false };
|
|
232
|
+
}
|
|
233
|
+
/** IFC2X3 -> IFC4: the point reaction an action's CausedBy names that a 'Causes' relationship would carry, or null. */
|
|
234
|
+
causeOf(entity, args, withheld) {
|
|
235
|
+
// The added relationship names ids the source has; an IFC4 target withholds none, so none is checked.
|
|
236
|
+
if (this.mode !== 'upgrade' || !this.ids || withheld?.size || !IFC2X3_ACTIONS.has(entity))
|
|
237
|
+
return null;
|
|
238
|
+
const reaction = slotRef(args[CAUSED_BY]);
|
|
239
|
+
return reaction !== null && this.reactions.has(reaction) ? reaction : null;
|
|
240
|
+
}
|
|
241
|
+
/** Whether `after` may change a converted line, so callers parse its id only then. */
|
|
242
|
+
get rewritesAfter() { return this.causedBy.size > 0 || this.itemPlacements.size > 0; }
|
|
243
|
+
/**
|
|
244
|
+
* Record `id`, already converted to `line`, with what a carrier fills in
|
|
245
|
+
* place: on the downgrade an action's CausedBy from its 'Causes'
|
|
246
|
+
* relationship, on the upgrade a grouped item's ObjectPlacement as its
|
|
247
|
+
* model's SharedPlacement. Undefined when nothing changes.
|
|
248
|
+
*/
|
|
249
|
+
after(id, line, withheld) {
|
|
250
|
+
const placement = this.itemPlacements.get(id);
|
|
251
|
+
// SHARED_PLACEMENT, recorded once for the model, reports the move.
|
|
252
|
+
if (placement !== undefined) {
|
|
253
|
+
const filled = replaceStepArgument(line, OBJECT_PLACEMENT, `#${placement}`);
|
|
254
|
+
return filled ? { line: filled } : undefined;
|
|
255
|
+
}
|
|
256
|
+
const reaction = this.causedBy.get(id);
|
|
257
|
+
if (reaction === undefined || withheld?.has(reaction))
|
|
258
|
+
return undefined;
|
|
259
|
+
const rec = readStepSlots(line);
|
|
260
|
+
const slot = rec && IFC2X3_ACTIONS.has(rec.type) ? rec.slots[CAUSED_BY] : undefined;
|
|
261
|
+
const filled = slot !== undefined && slotUnset(slot) ? replaceStepArgument(line, CAUSED_BY, `#${reaction}`) : null;
|
|
262
|
+
return filled ? { line: filled, loss: CAUSED_BY_READ } : undefined;
|
|
263
|
+
}
|
|
264
|
+
/** Records written so far, to append after the source records. */
|
|
265
|
+
added() { return this.pending.splice(0); }
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* The structural items an IFC2X3 IfcRelAssignsToGroup groups into each
|
|
269
|
+
* analysis model, with each item's ObjectPlacement id, for the models none of
|
|
270
|
+
* whose items another model also groups (IFC4 would require both models to
|
|
271
|
+
* share one placement) and each of whose groupings lists only references.
|
|
272
|
+
*/
|
|
273
|
+
function soleModelItems(source, schema) {
|
|
274
|
+
const models = new Map();
|
|
275
|
+
const owners = new Map();
|
|
276
|
+
// A model one of whose groupings cannot be read in full is not known to share a placement.
|
|
277
|
+
const unread = new Set();
|
|
278
|
+
for (const id of source.ids('IFCRELASSIGNSTOGROUP')) {
|
|
279
|
+
const args = source.slots(id);
|
|
280
|
+
const model = slotRef(args?.[6]);
|
|
281
|
+
if (!args || model === null || source.type(model) !== 'IFCSTRUCTURALANALYSISMODEL')
|
|
282
|
+
continue;
|
|
283
|
+
const items = models.get(model) ?? new Map();
|
|
284
|
+
models.set(model, items);
|
|
285
|
+
const listed = listItems(args[4])?.map(slotRef);
|
|
286
|
+
if (!listed || listed.includes(null))
|
|
287
|
+
unread.add(model);
|
|
288
|
+
for (const item of listed ?? []) {
|
|
289
|
+
if (item === null || !isSubtype(schema, source.type(item), 'IfcStructuralItem'))
|
|
290
|
+
continue;
|
|
291
|
+
items.set(item, slotRef(source.slots(item)?.[OBJECT_PLACEMENT]));
|
|
292
|
+
owners.set(item, (owners.get(item) ?? new Set()).add(model));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
for (const [model, items] of models)
|
|
296
|
+
if (unread.has(model) || [...items.keys()].some((i) => owners.get(i).size > 1))
|
|
297
|
+
models.delete(model);
|
|
298
|
+
return models;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* The lowest-id local placement of `placements` when each is a local placement
|
|
302
|
+
* and all are equal copies, or null. The upgrade writes it as SharedPlacement,
|
|
303
|
+
* so the downgrade asks the same of the IFC4 one and its items' placements.
|
|
304
|
+
*/
|
|
305
|
+
function commonPlacement(source, placements) {
|
|
306
|
+
const keys = new Set();
|
|
307
|
+
let placement = Infinity;
|
|
308
|
+
for (const p of placements) {
|
|
309
|
+
if (p === null || source.type(p) !== 'IFCLOCALPLACEMENT')
|
|
310
|
+
return null;
|
|
311
|
+
keys.add(source.slots(p)?.map((a) => a.trim()).join(',') ?? '');
|
|
312
|
+
placement = Math.min(placement, p);
|
|
313
|
+
}
|
|
314
|
+
return keys.size === 1 ? placement : null;
|
|
315
|
+
}
|
|
316
|
+
/** Whether IFC2X3 load group slots are a LOAD_CASE group, the only kind the upgrade turns back into a load case. */
|
|
317
|
+
const isLoadCase = (args) => args?.length === 10 && args[5].trim().toUpperCase() === '.LOAD_CASE.';
|
|
318
|
+
/** Three ratios, each `0.` or `IFCRATIOMEASURE(0.)`, as bare numbers, or null. */
|
|
319
|
+
function threeRatios(token) {
|
|
320
|
+
const values = (listItems(token) ?? []).map((v) => bareMeasure(v, 'IFCRATIOMEASURE'));
|
|
321
|
+
return values.length === 3 && values.every((v) => v !== null) ? values : null;
|
|
322
|
+
}
|
|
323
|
+
/** The carrier property for an IFC4 SelfWeightCoefficients slot, or null when it is not three ratios or `$`. */
|
|
324
|
+
function coefficientsProperty(token) {
|
|
325
|
+
if (slotUnset(token))
|
|
326
|
+
return `IFCPROPERTYSINGLEVALUE('${COEFFICIENTS}',$,$,$)`;
|
|
327
|
+
const values = threeRatios(token);
|
|
328
|
+
return values ? `IFCPROPERTYLISTVALUE('${COEFFICIENTS}',$,(${values.map((v) => `IFCRATIOMEASURE(${v})`).join(',')}),$)` : null;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=schema-converter-structural-carriers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-carriers.js","sourceRoot":"","sources":["../src/schema-converter-structural-carriers.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,uCAAuC,CAAC;AAClE,OAAO,EACL,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,SAAS,EAAiB,UAAU,EAAE,eAAe,GAEvI,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE/E,+FAA+F;AAC/F,MAAM,CAAC,MAAM,cAAc,GAAG,4BAA4B,CAAC;AAC3D,MAAM,YAAY,GAAG,wBAAwB,CAAC;AAC9C,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,6FAA6F;AAC7F,MAAM,CAAC,MAAM,SAAS,G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AAI,EAAE,MAAM,KAAK,EAAE,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,KAAK,aAAa,CAAC;AAE3I,kFAAkF;AAClF,SAAS,WAAW,CAAC,KAAa;IAChC,MAAM,MAAM,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACtF,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,MAAkB,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,CAAC;AAED,gHAAgH;AAChH,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,2BAA2B,YAAY,UAAU,CAAC;IAC/E,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC,CAAC,CAAC,yBAAyB,YAAY,QAAQ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjI,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StructuralAxes } from './schema-converter-structural-axes.js';
|
|
2
|
+
import { StructuralCarriers } from './schema-converter-structural-carriers.js';
|
|
3
|
+
import { SourceRecords, type SourceStore } from './schema-converter-structural-source.js';
|
|
4
|
+
import { StructuralThickness } from './schema-converter-structural-thickness.js';
|
|
5
|
+
import { StructuralLinks } from './schema-converter-structural-links.js';
|
|
6
|
+
import { StructuralVarying } from './schema-converter-structural-varying.js';
|
|
7
|
+
export declare class StructuralDiagnostics {
|
|
8
|
+
private readonly roundTrip;
|
|
9
|
+
readonly axes: StructuralAxes;
|
|
10
|
+
readonly links: StructuralLinks;
|
|
11
|
+
readonly varying: StructuralVarying;
|
|
12
|
+
readonly carriers: StructuralCarriers;
|
|
13
|
+
readonly thickness: StructuralThickness;
|
|
14
|
+
private readonly losses;
|
|
15
|
+
/** Source record id -> attributes the target holds elsewhere (`note*`), which `inspect` does not report lost. */
|
|
16
|
+
private readonly carried;
|
|
17
|
+
/** Source record id -> attributes the target leaves out or holds elsewhere that the reverse conversion writes back. */
|
|
18
|
+
private readonly restored;
|
|
19
|
+
/** Source record id -> the type an IFC2X3 varying action is written as when the export reports its CausedBy (`strandedAs`). */
|
|
20
|
+
private readonly stranded;
|
|
21
|
+
/** `roundTrip`: also find what the reverse conversion restores (`structuralRoundTrip`); an export does not. */
|
|
22
|
+
constructor(roundTrip?: boolean);
|
|
23
|
+
/**
|
|
24
|
+
* The source prepasses for an IFC2X3 <-> IFC4 export; the caller arms them
|
|
25
|
+
* only for an unedited full export.
|
|
26
|
+
*/
|
|
27
|
+
fromStore(store: SourceStore, from: string, to: string, source?: SourceRecords): void;
|
|
28
|
+
/** The exporter's express-id allocator, for the records the prepasses add. */
|
|
29
|
+
set ids(next: () => number);
|
|
30
|
+
/** Records the prepasses added, to append after the source records. */
|
|
31
|
+
added(): string[];
|
|
32
|
+
/** An already converted IFC2X3 <-> IFC4 line with the values carriers fill in place (`StructuralCarriers.after`). */
|
|
33
|
+
after(line: string, withheld: ReadonlySet<number> | undefined): string;
|
|
34
|
+
inspect(id: number, line: string, from: string, to: string): void;
|
|
35
|
+
/**
|
|
36
|
+
* A record written as another entity from source-derived facts (`StructuralLinks`,
|
|
37
|
+
* `StructuralVarying`, `StructuralCarriers`, `StructuralThickness`, each armed only for its schema pair):
|
|
38
|
+
* the target record body, or `null` for a carrier record the target leaves out.
|
|
39
|
+
* A body still naming a `withheld` id is refused, and then nothing is reported.
|
|
40
|
+
*/
|
|
41
|
+
rewrite(id: number, entity: string, args: readonly string[], withheld: ReadonlySet<number> | undefined): string | null | undefined;
|
|
42
|
+
private restore;
|
|
43
|
+
/** What `rewrite` found: per source record id, the attributes a carrier writes back on the reverse conversion, and the target type of a varying action whose CausedBy the export reports. */
|
|
44
|
+
roundTripResult(): StructuralRoundTrip;
|
|
45
|
+
private record;
|
|
46
|
+
warnings(): string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* For an IFC2X3 <-> IFC4 conversion, the attributes of `ids` that a carrier
|
|
50
|
+
* brings back on the round trip, per source record id. It runs the export's own
|
|
51
|
+
* carrier decisions (`StructuralDiagnostics.rewrite`) on a throwaway instance,
|
|
52
|
+
* so a carrier and what the loss report leaves out cannot disagree. Every record
|
|
53
|
+
* a carrier writes back is an IfcStructural* entity; only those are read.
|
|
54
|
+
* Describes an unedited full export, the only one that arms the carriers. Empty
|
|
55
|
+
* for any other schema pair, and for a file the export refuses.
|
|
56
|
+
*/
|
|
57
|
+
export interface StructuralRoundTrip {
|
|
58
|
+
readonly restored: ReadonlyMap<number, ReadonlySet<string>>;
|
|
59
|
+
readonly stranded: ReadonlyMap<number, string>;
|
|
60
|
+
}
|
|
61
|
+
/** The round trip of a file the carriers do not run for. */
|
|
62
|
+
export declare const NO_ROUND_TRIP: StructuralRoundTrip;
|
|
63
|
+
export declare function structuralRoundTrip(store: SourceStore, from: string, to: string, ids: readonly number[]): StructuralRoundTrip;
|
|
64
|
+
//# sourceMappingURL=schema-converter-structural-diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-converter-structural-diagnostics.d.ts","sourceRoot":"","sources":["../src/schema-converter-structural-diagnostics.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AACvE,OAAO,EAAa,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAC1F,OAAO,EAAiC,aAAa,EAAE,KAAK,WAAW,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AE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;IAiClI,OAAO,CAAC,OAAO;IAOf,6LAA6L;IAC7L,eAAe,IAAI,mBAAmB;IAEtC,OAAO,CAAC,MAAM;IACd,QAAQ,IAAI,MAAM,EAAE;CACrB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5D,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD;AAED,4DAA4D;AAC5D,eAAO,MAAM,aAAa,EAAE,mBAAkE,CAAC;AAE/F,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,mBAAmB,CAwB7H"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/* SPDX-License-Identifier: MPL-2.0 */
|
|
2
|
+
/** Matches rust/export/src/schema_structural_diagnostics.rs (#9668). */
|
|
3
|
+
import { getSchemaRegistryForVersion, getCanonicalEntityName } from '@ifc-lite/parser';
|
|
4
|
+
import { convertEntityType } from './schema-converter.js';
|
|
5
|
+
import { destabilizingUnknown, isStructuralAssignmentConversion } from './schema-converter-structural.js';
|
|
6
|
+
import { StructuralAxes } from './schema-converter-structural-axes.js';
|
|
7
|
+
import { CAUSED_BY, StructuralCarriers } from './schema-converter-structural-carriers.js';
|
|
8
|
+
import { conversionMode, namesWithheld, SourceRecords } from './schema-converter-structural-source.js';
|
|
9
|
+
import { holdsValue, withoutComments } from './step-comment-skip.js';
|
|
10
|
+
import { StructuralThickness, THICKNESS_WRITTEN } from './schema-converter-structural-thickness.js';
|
|
11
|
+
import { StructuralLinks } from './schema-converter-structural-links.js';
|
|
12
|
+
import { SHARED_CONFIGURATION, StructuralVarying, varyingTarget } from './schema-converter-structural-varying.js';
|
|
13
|
+
import { computeWithheldRefIds } from './schema-untranslatable.js';
|
|
14
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
15
|
+
import { referencesAnyExpressId } from './step-ref-scan.js';
|
|
16
|
+
const NONE = new Set();
|
|
17
|
+
const CAUSED_BY_UNCONVERTED = "IFC2X3 CausedBy of a varying action that stays unconverted is kept only in that IFC2X3 record; no 'Causes' relationship is written";
|
|
18
|
+
const LINK = 'IfcRelAssignsToProduct linking one structural member to its element is written as IfcRelConnectsStructuralElement, the IFC2X3 physical-to-analytical link';
|
|
19
|
+
/**
|
|
20
|
+
* IFC2X3 -> IFC4: the type the export writes varying action `entity` as when
|
|
21
|
+
* it reports its CausedBy as not coming back: an unconverted action naming a
|
|
22
|
+
* point reaction keeps it only in its IFC2X3 record, and a converted one loses
|
|
23
|
+
* it unless one 'Causes' relationship restores it (`cause`, from `noteCause`).
|
|
24
|
+
* Null when it reports nothing.
|
|
25
|
+
*/
|
|
26
|
+
function strandedAs(entity, args, unconverted, reaction, cause) {
|
|
27
|
+
const target = varyingTarget(entity);
|
|
28
|
+
// The export's own warning test (#10779): `$`, `*` or empty, comments aside, is no value.
|
|
29
|
+
if (!target || !holdsValue(args[CAUSED_BY] ?? ''))
|
|
30
|
+
return null;
|
|
31
|
+
// An unconverted action naming no point reaction keeps CausedBy unreported.
|
|
32
|
+
if (unconverted)
|
|
33
|
+
return reaction ? entity : null;
|
|
34
|
+
return cause?.restored ? null : target;
|
|
35
|
+
}
|
|
36
|
+
export class StructuralDiagnostics {
|
|
37
|
+
roundTrip;
|
|
38
|
+
axes = new StructuralAxes();
|
|
39
|
+
links = new StructuralLinks();
|
|
40
|
+
varying = new StructuralVarying();
|
|
41
|
+
carriers = new StructuralCarriers();
|
|
42
|
+
thickness = new StructuralThickness();
|
|
43
|
+
losses = new Map();
|
|
44
|
+
/** Source record id -> attributes the target holds elsewhere (`note*`), which `inspect` does not report lost. */
|
|
45
|
+
carried = new Map();
|
|
46
|
+
/** Source record id -> attributes the target leaves out or holds elsewhere that the reverse conversion writes back. */
|
|
47
|
+
restored = new Map();
|
|
48
|
+
/** Source record id -> the type an IFC2X3 varying action is written as when the export reports its CausedBy (`strandedAs`). */
|
|
49
|
+
stranded = new Map();
|
|
50
|
+
/** `roundTrip`: also find what the reverse conversion restores (`structuralRoundTrip`); an export does not. */
|
|
51
|
+
constructor(roundTrip = false) {
|
|
52
|
+
this.roundTrip = roundTrip;
|
|
53
|
+
this.carriers.roundTrip = roundTrip;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The source prepasses for an IFC2X3 <-> IFC4 export; the caller arms them
|
|
57
|
+
* only for an unedited full export.
|
|
58
|
+
*/
|
|
59
|
+
fromStore(store, from, to, source = new SourceRecords(store)) {
|
|
60
|
+
if (from !== 'IFC2X3')
|
|
61
|
+
this.links.fromStore(store);
|
|
62
|
+
this.varying.fromSource(source, from, to);
|
|
63
|
+
this.axes.fromStore(source, from, to);
|
|
64
|
+
this.carriers.fromStore(source, from, to);
|
|
65
|
+
this.thickness.fromStore(source, from, to);
|
|
66
|
+
}
|
|
67
|
+
/** The exporter's express-id allocator, for the records the prepasses add. */
|
|
68
|
+
set ids(next) { this.varying.ids = next; this.carriers.ids = next; this.thickness.ids = next; this.axes.ids = next; }
|
|
69
|
+
/** Records the prepasses added, to append after the source records. */
|
|
70
|
+
added() { return [...this.varying.added(), ...this.carriers.added(), ...this.thickness.added(), ...this.axes.added()]; }
|
|
71
|
+
/** An already converted IFC2X3 <-> IFC4 line with the values carriers fill in place (`StructuralCarriers.after`). */
|
|
72
|
+
after(line, withheld) {
|
|
73
|
+
if (!this.carriers.rewritesAfter)
|
|
74
|
+
return line;
|
|
75
|
+
const filled = this.carriers.after(Number(/^\s*#(\d+)/.exec(line)?.[1]), line, withheld);
|
|
76
|
+
if (!filled)
|
|
77
|
+
return line;
|
|
78
|
+
if (filled.loss)
|
|
79
|
+
this.record(filled.loss);
|
|
80
|
+
return filled.line;
|
|
81
|
+
}
|
|
82
|
+
inspect(id, line, from, to) {
|
|
83
|
+
const assignment = /^\s*#\d+\s*=\s*IFCRELCONNECTSSTRUCTURALELEMENT\s*\(/i.test(line) ? readStepSlots(line) : null;
|
|
84
|
+
if (assignment && isStructuralAssignmentConversion(assignment.type, from, to)) {
|
|
85
|
+
this.record('IfcRelConnectsStructuralElement is mapped to IfcRelAssignsToProduct; the relationship kind is not kept in the target file');
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (!((from === 'IFC2X3' && to === 'IFC4') || (from === 'IFC4' && to === 'IFC2X3')))
|
|
89
|
+
return;
|
|
90
|
+
if (!/^\s*#\d+\s*=\s*(?:IFCSTRUCTURAL|IFCRELCONNECTSSTRUCTURAL|IFCRELASSOCIATESPROFILEPROPERTIES)/i.test(line))
|
|
91
|
+
return;
|
|
92
|
+
const rec = readStepSlots(line);
|
|
93
|
+
if (!rec || !(rec.type.startsWith('IFCSTRUCTURAL') || rec.type.startsWith('IFCRELCONNECTSSTRUCTURAL') || rec.type === 'IFCRELASSOCIATESPROFILEPROPERTIES'))
|
|
94
|
+
return;
|
|
95
|
+
// Recorded here, where the record takes the generic path, never for one withheld or rewritten.
|
|
96
|
+
const notice = this.thickness.notice(id, rec.type, rec.slots);
|
|
97
|
+
if (notice)
|
|
98
|
+
this.record(notice);
|
|
99
|
+
const source = getSchemaRegistryForVersion(from), target = getSchemaRegistryForVersion(to);
|
|
100
|
+
const name = getCanonicalEntityName(source, rec.type);
|
|
101
|
+
if (!name)
|
|
102
|
+
return;
|
|
103
|
+
const targetName = getCanonicalEntityName(target, convertEntityType(rec.type, from, to));
|
|
104
|
+
const src = source.entities[name].allAttributes ?? source.entities[name].attributes;
|
|
105
|
+
const meta = targetName ? target.entities[targetName] : undefined;
|
|
106
|
+
if (!meta) {
|
|
107
|
+
const outcome = to === 'IFC4' ? 'record remains unconverted; output does not conform to IFC4' : 'the original entity semantics cannot be retained';
|
|
108
|
+
this.record(`${rec.type} has no representation in ${to}; ${outcome}`);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const tgt = (meta.allAttributes ?? meta.attributes).map(a => a.name);
|
|
112
|
+
const carried = this.carried.get(id);
|
|
113
|
+
this.carried.delete(id);
|
|
114
|
+
src.forEach((attr, i) => {
|
|
115
|
+
// CONST is intrinsic to IFC2X3 linear/planar actions, not lost data.
|
|
116
|
+
if (attr.name === 'PredefinedType' && withoutComments(rec.slots[i] ?? '') === '.CONST.'
|
|
117
|
+
&& ['IFCSTRUCTURALCURVEACTION', 'IFCSTRUCTURALSURFACEACTION', 'IFCSTRUCTURALLINEARACTION', 'IFCSTRUCTURALPLANARACTION'].includes(rec.type))
|
|
118
|
+
return;
|
|
119
|
+
if (attr.name === 'DestabilizingLoad' && withoutComments(rec.slots[i] ?? '') === '$' && to === 'IFC2X3')
|
|
120
|
+
this.record(destabilizingUnknown(rec.type));
|
|
121
|
+
if (carried?.has(attr.name))
|
|
122
|
+
return;
|
|
123
|
+
// The dropped count's own test (#10779): a comment-only slot is no value.
|
|
124
|
+
if (!tgt.includes(attr.name) && holdsValue(rec.slots[i] ?? '')) {
|
|
125
|
+
const effect = attr.name === 'ConditionCoordinateSystem' ? '; restraint directions in that coordinate system are not preserved' : '';
|
|
126
|
+
this.record(`${rec.type}.${attr.name} has no slot in ${to}; its value is omitted${effect}`);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
// A tangent does not determine the local section z-axis. Do not invent one.
|
|
130
|
+
if (to === 'IFC4' && tgt.includes('Axis') && !src.some(a => a.name === 'Axis') && !this.axes.axis(line))
|
|
131
|
+
this.record(`${rec.type}.Axis is required by IFC4 but unknown; output does not conform until the model's section orientation is resolved`);
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A record written as another entity from source-derived facts (`StructuralLinks`,
|
|
135
|
+
* `StructuralVarying`, `StructuralCarriers`, `StructuralThickness`, each armed only for its schema pair):
|
|
136
|
+
* the target record body, or `null` for a carrier record the target leaves out.
|
|
137
|
+
* A body still naming a `withheld` id is refused, and then nothing is reported.
|
|
138
|
+
*/
|
|
139
|
+
rewrite(id, entity, args, withheld) {
|
|
140
|
+
// A record naming a withheld id becomes a proxy, which the reverse conversion derives nothing for.
|
|
141
|
+
if (this.roundTrip && !namesWithheld(args, withheld))
|
|
142
|
+
this.restore(id, this.carriers.restoredFrom(id));
|
|
143
|
+
// An IFC2X3 varying action that stays unconverted is no IFC4 product a 'Causes' relationship could name.
|
|
144
|
+
const unconverted = this.varying.staysUnconverted(entity, args);
|
|
145
|
+
const reaction = this.carriers.causeOf(entity, args, withheld) !== null;
|
|
146
|
+
if (unconverted && reaction)
|
|
147
|
+
this.record(CAUSED_BY_UNCONVERTED);
|
|
148
|
+
const cause = unconverted ? null : this.carriers.noteCause(id, entity, args, withheld);
|
|
149
|
+
const stranded = this.roundTrip ? strandedAs(entity, args, unconverted, reaction, cause) : null;
|
|
150
|
+
if (stranded)
|
|
151
|
+
this.stranded.set(id, stranded);
|
|
152
|
+
const thickness = cause ? [] : this.thickness.note(id, entity, args, withheld);
|
|
153
|
+
const axis = cause || thickness.length ? null : this.axes.hold(id, args, withheld);
|
|
154
|
+
const held = cause ? ['CausedBy'] : axis ? ['Axis'] : thickness;
|
|
155
|
+
let carried = NONE;
|
|
156
|
+
if (held.length) {
|
|
157
|
+
carried = new Set(held);
|
|
158
|
+
this.record(cause?.message ?? axis ?? THICKNESS_WRITTEN);
|
|
159
|
+
this.carried.set(id, carried);
|
|
160
|
+
// The downgrade reads a held thickness back (`StructuralThickness.rewrite`); a cause only when it says so.
|
|
161
|
+
if (this.roundTrip && cause?.restored !== false && (!axis || this.axes.fillWritten(id)))
|
|
162
|
+
this.restore(id, held);
|
|
163
|
+
}
|
|
164
|
+
const attrs = this.links.link(entity, args);
|
|
165
|
+
const rewrite = attrs ? { body: `IFCRELCONNECTSSTRUCTURALELEMENT(${attrs})`, losses: [LINK] }
|
|
166
|
+
: this.varying.rewrite(id, entity, args, carried) ?? this.carriers.rewrite(id, entity, args, withheld)
|
|
167
|
+
?? this.thickness.rewrite(id, entity, args) ?? this.axes.rewrite(id, args, withheld);
|
|
168
|
+
if (!rewrite || (withheld && rewrite.body !== null && referencesAnyExpressId(rewrite.body, withheld)))
|
|
169
|
+
return undefined;
|
|
170
|
+
rewrite.losses.forEach((loss) => this.record(loss));
|
|
171
|
+
rewrite.restored?.forEach(([source, attributes]) => this.restore(source, attributes));
|
|
172
|
+
// A rewritten record skips `inspect`, which would free this.
|
|
173
|
+
this.carried.delete(id);
|
|
174
|
+
return rewrite.body;
|
|
175
|
+
}
|
|
176
|
+
restore(id, attributes) {
|
|
177
|
+
if (!this.roundTrip || !attributes.length)
|
|
178
|
+
return;
|
|
179
|
+
const set = this.restored.get(id) ?? new Set();
|
|
180
|
+
attributes.forEach((a) => set.add(a));
|
|
181
|
+
this.restored.set(id, set);
|
|
182
|
+
}
|
|
183
|
+
/** What `rewrite` found: per source record id, the attributes a carrier writes back on the reverse conversion, and the target type of a varying action whose CausedBy the export reports. */
|
|
184
|
+
roundTripResult() { return { restored: this.restored, stranded: this.stranded }; }
|
|
185
|
+
record(message) { this.losses.set(message, (this.losses.get(message) ?? 0) + 1); }
|
|
186
|
+
warnings() { return [...this.losses].sort(([a], [b]) => a.localeCompare(b)).map(([message, count]) => `${count} structural conversion record(s): ${message} (#9668).`); }
|
|
187
|
+
}
|
|
188
|
+
/** The round trip of a file the carriers do not run for. */
|
|
189
|
+
export const NO_ROUND_TRIP = { restored: new Map(), stranded: new Map() };
|
|
190
|
+
export function structuralRoundTrip(store, from, to, ids) {
|
|
191
|
+
if (!conversionMode(from, to) || !ids.length)
|
|
192
|
+
return NO_ROUND_TRIP;
|
|
193
|
+
try {
|
|
194
|
+
const source = new SourceRecords(store);
|
|
195
|
+
const records = ids.filter((id) => source.type(id)?.startsWith('IFCSTRUCTURAL'));
|
|
196
|
+
if (!records.length)
|
|
197
|
+
return NO_ROUND_TRIP;
|
|
198
|
+
const run = new StructuralDiagnostics(true);
|
|
199
|
+
run.fromStore(store, from, to, source);
|
|
200
|
+
// Nothing is written, so every added record may take the same id.
|
|
201
|
+
run.ids = () => 0;
|
|
202
|
+
// Only an IFC2X3 target withholds ids.
|
|
203
|
+
const withheld = to === 'IFC2X3' ? computeWithheldRefIds(store, to) : undefined;
|
|
204
|
+
for (const id of records) {
|
|
205
|
+
const slots = source.slots(id);
|
|
206
|
+
if (slots)
|
|
207
|
+
run.rewrite(id, source.type(id), slots, withheld);
|
|
208
|
+
}
|
|
209
|
+
return run.roundTripResult();
|
|
210
|
+
}
|
|
211
|
+
catch (error) {
|
|
212
|
+
// The schema-only preview remains available even when the carrier prepass fails.
|
|
213
|
+
if (!(error instanceof Error && error.message === SHARED_CONFIGURATION)) {
|
|
214
|
+
console.warn('[analyzeConversionLoss] Could not evaluate structural carriers', error);
|
|
215
|
+
}
|
|
216
|
+
return NO_ROUND_TRIP;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=schema-converter-structural-diagnostics.js.map
|