@ifc-lite/export 3.0.1 → 4.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/README.md +37 -1
- package/dist/anonymize-export.d.ts +60 -0
- package/dist/anonymize-export.d.ts.map +1 -0
- package/dist/anonymize-export.js +217 -0
- package/dist/anonymize-export.js.map +1 -0
- package/dist/anonymize-placement.d.ts +71 -0
- package/dist/anonymize-placement.d.ts.map +1 -0
- package/dist/anonymize-placement.js +266 -0
- package/dist/anonymize-placement.js.map +1 -0
- package/dist/anonymize-scrub.d.ts +64 -0
- package/dist/anonymize-scrub.d.ts.map +1 -0
- package/dist/anonymize-scrub.js +315 -0
- package/dist/anonymize-scrub.js.map +1 -0
- package/dist/anonymize-types.d.ts +235 -0
- package/dist/anonymize-types.d.ts.map +1 -0
- package/dist/anonymize-types.js +5 -0
- package/dist/anonymize-types.js.map +1 -0
- package/dist/declared-property-type.d.ts +15 -0
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +43 -0
- package/dist/declared-property-type.js.map +1 -1
- package/dist/entity-type-sets.d.ts +47 -0
- package/dist/entity-type-sets.d.ts.map +1 -0
- package/dist/entity-type-sets.js +91 -0
- package/dist/entity-type-sets.js.map +1 -0
- package/dist/georef-closure.d.ts +55 -0
- package/dist/georef-closure.d.ts.map +1 -0
- package/dist/georef-closure.js +95 -0
- package/dist/georef-closure.js.map +1 -0
- package/dist/glb.d.ts.map +1 -1
- package/dist/glb.js +26 -2
- package/dist/glb.js.map +1 -1
- package/dist/ifc5-classification.d.ts +36 -0
- package/dist/ifc5-classification.d.ts.map +1 -0
- package/dist/ifc5-classification.js +46 -0
- package/dist/ifc5-classification.js.map +1 -0
- package/dist/ifc5-export-helpers.d.ts +32 -0
- package/dist/ifc5-export-helpers.d.ts.map +1 -0
- package/dist/ifc5-export-helpers.js +84 -0
- package/dist/ifc5-export-helpers.js.map +1 -0
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +14 -86
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/ifc5-material.d.ts +38 -0
- package/dist/ifc5-material.d.ts.map +1 -0
- package/dist/ifc5-material.js +32 -0
- package/dist/ifc5-material.js.map +1 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/merged-context.d.ts +100 -0
- package/dist/merged-context.d.ts.map +1 -0
- package/dist/merged-context.js +211 -0
- package/dist/merged-context.js.map +1 -0
- package/dist/merged-empty-containers.d.ts +63 -0
- package/dist/merged-empty-containers.d.ts.map +1 -0
- package/dist/merged-empty-containers.js +354 -0
- package/dist/merged-empty-containers.js.map +1 -0
- package/dist/merged-exporter.d.ts +28 -67
- package/dist/merged-exporter.d.ts.map +1 -1
- package/dist/merged-exporter.js +134 -258
- package/dist/merged-exporter.js.map +1 -1
- package/dist/merged-guid.d.ts +48 -0
- package/dist/merged-guid.d.ts.map +1 -0
- package/dist/merged-guid.js +128 -0
- package/dist/merged-guid.js.map +1 -0
- package/dist/merged-rel-aggregates.d.ts +63 -0
- package/dist/merged-rel-aggregates.d.ts.map +1 -0
- package/dist/merged-rel-aggregates.js +122 -0
- package/dist/merged-rel-aggregates.js.map +1 -0
- package/dist/merged-remap.d.ts +18 -0
- package/dist/merged-remap.d.ts.map +1 -0
- package/dist/merged-remap.js +66 -0
- package/dist/merged-remap.js.map +1 -0
- package/dist/merged-subcontext.d.ts +41 -0
- package/dist/merged-subcontext.d.ts.map +1 -0
- package/dist/merged-subcontext.js +99 -0
- package/dist/merged-subcontext.js.map +1 -0
- package/dist/parquet-exporter-ondemand.d.ts +34 -0
- package/dist/parquet-exporter-ondemand.d.ts.map +1 -0
- package/dist/parquet-exporter-ondemand.js +89 -0
- package/dist/parquet-exporter-ondemand.js.map +1 -0
- package/dist/parquet-exporter.d.ts +1 -29
- package/dist/parquet-exporter.d.ts.map +1 -1
- package/dist/parquet-exporter.js +68 -90
- package/dist/parquet-exporter.js.map +1 -1
- package/dist/parquet-type-strings.d.ts +11 -0
- package/dist/parquet-type-strings.d.ts.map +1 -0
- package/dist/parquet-type-strings.js +40 -0
- package/dist/parquet-type-strings.js.map +1 -0
- package/dist/parquet-uint32-columns.d.ts +30 -0
- package/dist/parquet-uint32-columns.d.ts.map +1 -0
- package/dist/parquet-uint32-columns.js +38 -0
- package/dist/parquet-uint32-columns.js.map +1 -0
- package/dist/reference-collector.d.ts +47 -51
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +115 -171
- package/dist/reference-collector.js.map +1 -1
- package/dist/related-entities.d.ts +10 -0
- package/dist/related-entities.d.ts.map +1 -0
- package/dist/related-entities.js +274 -0
- package/dist/related-entities.js.map +1 -0
- package/dist/schema-converter-attr-remap.d.ts +53 -0
- package/dist/schema-converter-attr-remap.d.ts.map +1 -0
- package/dist/schema-converter-attr-remap.js +106 -0
- package/dist/schema-converter-attr-remap.js.map +1 -0
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +24 -1
- package/dist/schema-converter.js.map +1 -1
- package/dist/schema-untranslatable.d.ts +35 -0
- package/dist/schema-untranslatable.d.ts.map +1 -0
- package/dist/schema-untranslatable.js +60 -0
- package/dist/schema-untranslatable.js.map +1 -0
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +11 -1
- package/dist/step-argument-parser.js.map +1 -1
- package/dist/step-attribute-mutations.js +14 -11
- package/dist/step-attribute-mutations.js.map +1 -1
- package/dist/step-collection.d.ts.map +1 -1
- package/dist/step-collection.js +51 -8
- package/dist/step-collection.js.map +1 -1
- package/dist/step-export-types.d.ts +42 -0
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js +10 -0
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +9 -1
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-header.d.ts +1 -1
- package/dist/step-header.d.ts.map +1 -1
- package/dist/step-header.js +2 -2
- package/dist/step-header.js.map +1 -1
- package/dist/step-map-unit.d.ts +2 -1
- package/dist/step-map-unit.d.ts.map +1 -1
- package/dist/step-map-unit.js.map +1 -1
- package/dist/step-serialization.d.ts +10 -30
- package/dist/step-serialization.d.ts.map +1 -1
- package/dist/step-serialization.js +10 -60
- package/dist/step-serialization.js.map +1 -1
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +21 -0
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/style-closure.d.ts +91 -0
- package/dist/style-closure.d.ts.map +1 -0
- package/dist/style-closure.js +164 -0
- package/dist/style-closure.js.map +1 -0
- package/dist/subset-entity-reader.d.ts +104 -0
- package/dist/subset-entity-reader.d.ts.map +1 -0
- package/dist/subset-entity-reader.js +112 -0
- package/dist/subset-entity-reader.js.map +1 -0
- package/dist/subset-roots.d.ts +74 -0
- package/dist/subset-roots.d.ts.map +1 -0
- package/dist/subset-roots.js +168 -0
- package/dist/subset-roots.js.map +1 -0
- package/dist/type-owned-psets.d.ts +19 -0
- package/dist/type-owned-psets.d.ts.map +1 -1
- package/dist/type-owned-psets.js +31 -0
- package/dist/type-owned-psets.js.map +1 -1
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +10 -2
- package/dist/unit-normalize.js.map +1 -1
- package/package.json +8 -8
|
@@ -17,7 +17,16 @@
|
|
|
17
17
|
* generic STEP token, and worth reading on its own.
|
|
18
18
|
*/
|
|
19
19
|
import { type IfcAttributeValue } from '@ifc-lite/parser';
|
|
20
|
-
import { QuantityType } from '@ifc-lite/data';
|
|
20
|
+
import { QuantityType, escapeStepString } from '@ifc-lite/data';
|
|
21
|
+
/**
|
|
22
|
+
* Re-exported so every existing `import { escapeStepString } from
|
|
23
|
+
* './step-serialization.js'` call site keeps working. The implementation
|
|
24
|
+
* lives once, in `@ifc-lite/data` (#3300) — this package used to keep its
|
|
25
|
+
* own byte-identical copy, which is exactly the duplication
|
|
26
|
+
* `packages/codegen/test/serialization-generator.test.ts` already forbids
|
|
27
|
+
* for the schema-agnostic serializer bundles.
|
|
28
|
+
*/
|
|
29
|
+
export { escapeStepString };
|
|
21
30
|
/**
|
|
22
31
|
* Resolve an IFC defined type (`IfcLengthMeasure`, `IfcPositiveLengthMeasure`,
|
|
23
32
|
* `IfcBoolean`, …) to its underlying EXPRESS primitive (`REAL`, `BOOLEAN`, …)
|
|
@@ -32,35 +41,6 @@ export declare function resolveExpressBase(typeName: string): string | null;
|
|
|
32
41
|
* inner value is serialized to match that type's underlying primitive.
|
|
33
42
|
*/
|
|
34
43
|
export declare function serializeTypedMarker(type: string, value: string | number | boolean): string;
|
|
35
|
-
/**
|
|
36
|
-
* Escape a string for STEP format: backslash and single-quote doubling, plus
|
|
37
|
-
* non-ASCII directive encoding.
|
|
38
|
-
*
|
|
39
|
-
* Control characters (CR/LF and other C0 codes, plus DEL) are each replaced by
|
|
40
|
-
* ONE space — a run of n control characters becomes n spaces, not one — so
|
|
41
|
-
* every generated STEP entity stays on one physical line and round-trips
|
|
42
|
-
* through the line-oriented merge/convert paths without losing length.
|
|
43
|
-
* Collapsing a run (`/[...]+/`, which this did until #3284) disagreed with
|
|
44
|
-
* `ifc_lite_export::step_text::escape`, which has always mapped each control
|
|
45
|
-
* character to its own space: the same value written by the two halves came
|
|
46
|
-
* out different. ISO 10303-21 6.3.3.4 mandates neither, but preserving the
|
|
47
|
-
* count loses no information.
|
|
48
|
-
*
|
|
49
|
-
* ISO 10303-21 6.3.3.4 restricts a string literal's plain-text bytes to the
|
|
50
|
-
* "basic graphic" range 32-126; every other character is a control directive
|
|
51
|
-
* (`\X\HH`, `\X2\HHHH\X0\`, `\X4\HHHHHHHH\X0\`), never a raw byte — and
|
|
52
|
-
* buildingSMART's IFC string-encoding guidance states the same for the
|
|
53
|
-
* IFC2X3/IFC4/IFC4X3 schemas this exporter targets: characters outside
|
|
54
|
-
* decimal 32-126 "have to be encoded" (e.g. 'Ä' as `\X2\00C4\X0\`). A reader
|
|
55
|
-
* that treats the file's bytes as ISO-8859-1 — the byte encoding the base
|
|
56
|
-
* standard and most real consumers assume for these schemas — turns a raw
|
|
57
|
-
* UTF-8 multi-byte sequence into mojibake or a broken parse; this exact
|
|
58
|
-
* writer shape is a reported, reproduced defect in real IFC tooling
|
|
59
|
-
* (IfcOpenShell#699/#1016; files rejected by Solibri). Encoded one character
|
|
60
|
-
* at a time (never batching a run into one `\X2\...\X0\` block) to keep the
|
|
61
|
-
* encoder trivially correct; ISO 10303-21 allows either.
|
|
62
|
-
*/
|
|
63
|
-
export declare function escapeStepString(str: string): string;
|
|
64
44
|
/**
|
|
65
45
|
* Convert a number to a valid STEP REAL literal.
|
|
66
46
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-serialization.d.ts","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAkB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"step-serialization.d.ts","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAmC,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAkB,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhF;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAK5B;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAqBlE;AAiDD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAI3F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5C;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAWhE;AAGD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGzD;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAsCnF;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,EAAE,SAAS,UAAQ,GAAG,MAAM,CA0BtF;AAED,+EAA+E;AAC/E,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAExD"}
|
|
@@ -20,7 +20,16 @@
|
|
|
20
20
|
* generic STEP token, and worth reading on its own.
|
|
21
21
|
*/
|
|
22
22
|
import { serializeValue, SCHEMA_REGISTRY } from '@ifc-lite/parser';
|
|
23
|
-
import { QuantityType, formatStepReal } from '@ifc-lite/data';
|
|
23
|
+
import { QuantityType, formatStepReal, escapeStepString } from '@ifc-lite/data';
|
|
24
|
+
/**
|
|
25
|
+
* Re-exported so every existing `import { escapeStepString } from
|
|
26
|
+
* './step-serialization.js'` call site keeps working. The implementation
|
|
27
|
+
* lives once, in `@ifc-lite/data` (#3300) — this package used to keep its
|
|
28
|
+
* own byte-identical copy, which is exactly the duplication
|
|
29
|
+
* `packages/codegen/test/serialization-generator.test.ts` already forbids
|
|
30
|
+
* for the schema-agnostic serializer bundles.
|
|
31
|
+
*/
|
|
32
|
+
export { escapeStepString };
|
|
24
33
|
/** EXPRESS base primitives a defined type ultimately resolves to. */
|
|
25
34
|
const EXPRESS_PRIMITIVES = new Set(['BOOLEAN', 'LOGICAL', 'INTEGER', 'REAL', 'NUMBER', 'STRING', 'BINARY']);
|
|
26
35
|
/**
|
|
@@ -116,65 +125,6 @@ export function serializeTypedMarker(type, value) {
|
|
|
116
125
|
token = `IFC${token}`;
|
|
117
126
|
return `${token}(${serializeInnerByBase(value, resolveExpressBase(type))})`;
|
|
118
127
|
}
|
|
119
|
-
/**
|
|
120
|
-
* Escape a string for STEP format: backslash and single-quote doubling, plus
|
|
121
|
-
* non-ASCII directive encoding.
|
|
122
|
-
*
|
|
123
|
-
* Control characters (CR/LF and other C0 codes, plus DEL) are each replaced by
|
|
124
|
-
* ONE space — a run of n control characters becomes n spaces, not one — so
|
|
125
|
-
* every generated STEP entity stays on one physical line and round-trips
|
|
126
|
-
* through the line-oriented merge/convert paths without losing length.
|
|
127
|
-
* Collapsing a run (`/[...]+/`, which this did until #3284) disagreed with
|
|
128
|
-
* `ifc_lite_export::step_text::escape`, which has always mapped each control
|
|
129
|
-
* character to its own space: the same value written by the two halves came
|
|
130
|
-
* out different. ISO 10303-21 6.3.3.4 mandates neither, but preserving the
|
|
131
|
-
* count loses no information.
|
|
132
|
-
*
|
|
133
|
-
* ISO 10303-21 6.3.3.4 restricts a string literal's plain-text bytes to the
|
|
134
|
-
* "basic graphic" range 32-126; every other character is a control directive
|
|
135
|
-
* (`\X\HH`, `\X2\HHHH\X0\`, `\X4\HHHHHHHH\X0\`), never a raw byte — and
|
|
136
|
-
* buildingSMART's IFC string-encoding guidance states the same for the
|
|
137
|
-
* IFC2X3/IFC4/IFC4X3 schemas this exporter targets: characters outside
|
|
138
|
-
* decimal 32-126 "have to be encoded" (e.g. 'Ä' as `\X2\00C4\X0\`). A reader
|
|
139
|
-
* that treats the file's bytes as ISO-8859-1 — the byte encoding the base
|
|
140
|
-
* standard and most real consumers assume for these schemas — turns a raw
|
|
141
|
-
* UTF-8 multi-byte sequence into mojibake or a broken parse; this exact
|
|
142
|
-
* writer shape is a reported, reproduced defect in real IFC tooling
|
|
143
|
-
* (IfcOpenShell#699/#1016; files rejected by Solibri). Encoded one character
|
|
144
|
-
* at a time (never batching a run into one `\X2\...\X0\` block) to keep the
|
|
145
|
-
* encoder trivially correct; ISO 10303-21 allows either.
|
|
146
|
-
*/
|
|
147
|
-
export function escapeStepString(str) {
|
|
148
|
-
const escaped = str
|
|
149
|
-
.replace(/\\/g, '\\\\')
|
|
150
|
-
.replace(/'/g, "''")
|
|
151
|
-
// eslint-disable-next-line no-control-regex
|
|
152
|
-
.replace(/[\x00-\x1F\x7F]/g, ' ');
|
|
153
|
-
return encodeNonAsciiStepDirectives(escaped);
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* Replace every character outside the STEP "basic graphic" range (32-126)
|
|
157
|
-
* with its `\X2\`/`\X4\` directive. Must run AFTER backslash-doubling: the
|
|
158
|
-
* directive's own backslashes are literal syntax the reader expects
|
|
159
|
-
* undoubled, so escaping non-ASCII first would corrupt them when the
|
|
160
|
-
* backslash-doubling pass ran afterward.
|
|
161
|
-
*/
|
|
162
|
-
function encodeNonAsciiStepDirectives(str) {
|
|
163
|
-
let out = '';
|
|
164
|
-
for (const ch of str) {
|
|
165
|
-
const cp = ch.codePointAt(0);
|
|
166
|
-
if (cp >= 32 && cp <= 126) {
|
|
167
|
-
out += ch;
|
|
168
|
-
}
|
|
169
|
-
else if (cp <= 0xFFFF) {
|
|
170
|
-
out += `\\X2\\${cp.toString(16).toUpperCase().padStart(4, '0')}\\X0\\`;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
out += `\\X4\\${cp.toString(16).toUpperCase().padStart(8, '0')}\\X0\\`;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
return out;
|
|
177
|
-
}
|
|
178
128
|
/**
|
|
179
129
|
* Convert a number to a valid STEP REAL literal.
|
|
180
130
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-serialization.js","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"step-serialization.js","sourceRoot":"","sources":["../src/step-serialization.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,cAAc,EAAE,eAAe,EAA0B,MAAM,kBAAkB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEhF;;;;;;;GAOG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAE5B,qEAAqE;AACrE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE5G;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB;IACjD,IAAI,MAAM,GAAuB,QAAQ,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QACnC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QACjB,0EAA0E;QAC1E,yEAAyE;QACzE,0EAA0E;QAC1E,yEAAyE;QACzE,0EAA0E;QAC1E,4EAA4E;QAC5E,MAAM,UAAU,GAAuB,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC;YACxG,CAAC,CAAC,eAAe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BAAiB,EAC1B,kBAAkB,EAAE,OAAO,EAC3B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAC5C,GAAG,EAAE,sBAAsB,GAC1B,IAAI,CA0JN"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { filterHiddenRefsFromRelationshipLine } from './reference-collector.js';
|
|
5
|
+
import { STYLE_RESCUE_TYPES } from './style-closure.js';
|
|
6
|
+
import { styleEntityWithheldWarning } from './step-export-types.js';
|
|
5
7
|
import { convertStepLine } from './schema-converter.js';
|
|
6
8
|
import { nominateDeliveredInPlaceEdits } from './in-place-nomination.js';
|
|
7
9
|
import { decodeRange } from './source-ref-bounds.js';
|
|
@@ -143,6 +145,25 @@ export function writeSourceEntityLines(pass, options, mayNameOmittedRefs, isOmit
|
|
|
143
145
|
}
|
|
144
146
|
nextEntityText = filtered;
|
|
145
147
|
}
|
|
148
|
+
else if (mayNameOmittedRefs && STYLE_RESCUE_TYPES.has(effectiveRelType)) {
|
|
149
|
+
// A rescued IFCSTYLEDITEM/IFCSTYLEDREPRESENTATION/
|
|
150
|
+
// IFCPRESENTATIONLAYERASSIGNMENT/IFCPRESENTATIONLAYERWITHSTYLE
|
|
151
|
+
// (`style-closure.ts`) can legitimately name BOTH a kept item and one
|
|
152
|
+
// this export omits — e.g. a layer assignment shared by a visible and
|
|
153
|
+
// a hidden product's geometry, rescued because the visible one is in
|
|
154
|
+
// the closure. Unlike `IFCREL*`, these lines are otherwise never
|
|
155
|
+
// touched (`step-omission-predicates.ts` documents that as a general
|
|
156
|
+
// gap for non-relationship lines), so left alone this would ship the
|
|
157
|
+
// exact #2398 dangling-`#N` shape on a line the rescue itself just
|
|
158
|
+
// introduced into the closure. Same filter, same withhold-vs-narrow
|
|
159
|
+
// rule, applied to this line for the same reason.
|
|
160
|
+
const filtered = filterHiddenRefsFromRelationshipLine(nextEntityText, isOmittedFromOutput);
|
|
161
|
+
if (filtered === null) {
|
|
162
|
+
pass.warnings.push(styleEntityWithheldWarning(expressId, effectiveRelType));
|
|
163
|
+
continue;
|
|
164
|
+
}
|
|
165
|
+
nextEntityText = filtered;
|
|
166
|
+
}
|
|
146
167
|
// A retype or a positional edit that CHANGED the line is what makes
|
|
147
168
|
// this entity count; a named attribute edit was already nominated by
|
|
148
169
|
// the collection pass. Both flags report effect, so retyping an entity
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-source-iteration.js","sourceRoot":"","sources":["../src/step-source-iteration.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAqD/D,OAAO,EAAE,oCAAoC,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAyB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAA2B,MAAM,gCAAgC,CAAC;AAuC9F;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CACxB,OAAoB,EACpB,gBAAoC,EACpC,KAA6B;IAE7B,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO;IAC/B,2EAA2E;IAC3E,2EAA2E;IAC3E,oEAAoE;IACpE,MAAM,GAAG,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;IACvC,MAAM,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC;IAClD,MAAM,YAAY,GAAG;QACnB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;QACvC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,EAAE,CAAC;KAC5C,CAAC;IACF,KAAK,MAAM,WAAW,IAAI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SAAS,KAAK,IAAI,EAAE,CAAC;oBACvB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;gBAChC,CAAC;gBACD,iFAAiF;YACnF,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;YACrC,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rescue `IFCSTYLEDITEM` / `IFCSTYLEDREPRESENTATION` /
|
|
3
|
+
* `IFCPRESENTATIONLAYERASSIGNMENT` / `IFCPRESENTATIONLAYERWITHSTYLE` into a
|
|
4
|
+
* STEP export closure that otherwise never reaches them.
|
|
5
|
+
*
|
|
6
|
+
* Split out of `reference-collector.ts` (which already sits at its module
|
|
7
|
+
* size budget) rather than grown in place — same reason `georef-closure.ts`
|
|
8
|
+
* was split out: `collectReferencedEntityIds` only walks FORWARD from a
|
|
9
|
+
* product, but a styled item / layer assignment references geometry the
|
|
10
|
+
* OTHER way (item -> style, layer -> assigned item), so nothing reaches it
|
|
11
|
+
* from a product root. This file's `collectStyleEntities` does one reverse
|
|
12
|
+
* pass over the byType index instead: for each candidate, check if any
|
|
13
|
+
* referenced id is already in the closure, and if so rescue it.
|
|
14
|
+
*/
|
|
15
|
+
import type { IfcSourceBytes } from '@ifc-lite/parser';
|
|
16
|
+
/**
|
|
17
|
+
* The four entity classes `collectStyleEntities` rescues. Exported so
|
|
18
|
+
* `step-source-iteration.ts` can apply the SAME dangling-ref-safe line
|
|
19
|
+
* filter (`filterHiddenRefsFromRelationshipLine`) to a rescued entity's own
|
|
20
|
+
* output line as it already does for `IFCREL*` — a rescued
|
|
21
|
+
* `IFCPRESENTATIONLAYERASSIGNMENT` can legitimately end up naming both a
|
|
22
|
+
* kept item and an excluded one (see `collectStyleEntities`'s own doc), and
|
|
23
|
+
* without that filter its `AssignedItems` line would ship a dangling `#N`.
|
|
24
|
+
*/
|
|
25
|
+
export declare const STYLE_RESCUE_TYPES: ReadonlySet<string>;
|
|
26
|
+
/**
|
|
27
|
+
* Collect style and presentation-layer entities (IFCSTYLEDITEM,
|
|
28
|
+
* IFCSTYLEDREPRESENTATION, IFCPRESENTATIONLAYERASSIGNMENT,
|
|
29
|
+
* IFCPRESENTATIONLAYERWITHSTYLE) that reference geometry already in the
|
|
30
|
+
* closure, then transitively follow their own references.
|
|
31
|
+
*
|
|
32
|
+
* In IFC STEP, IFCSTYLEDITEM references a geometry RepresentationItem, but
|
|
33
|
+
* nothing references the StyledItem back — and IFCPRESENTATIONLAYERASSIGNMENT
|
|
34
|
+
* is the same shape: it names the representation/items assigned to a layer
|
|
35
|
+
* (`AssignedItems`) but nothing points back at the assignment itself. So the
|
|
36
|
+
* forward closure walk misses both entirely. This function does one reverse
|
|
37
|
+
* pass using the byType index: for each candidate, check if any referenced ID
|
|
38
|
+
* is in the closure. If yes, add it and walk its own reference chain in.
|
|
39
|
+
*
|
|
40
|
+
* ## Why the forward walk needs more than `excludeIds`
|
|
41
|
+
*
|
|
42
|
+
* `excludeIds` (`hiddenProductIds`) only ever holds PRODUCT ids, never the
|
|
43
|
+
* geometry those products exclusively own. `IfcPresentationLayerAssignment.
|
|
44
|
+
* AssignedItems` routinely names REPRESENTATION-level ids directly (one CAD
|
|
45
|
+
* layer naming every wall's `IfcShapeRepresentation`), so a shared layer
|
|
46
|
+
* assignment can legitimately be rescued by a VISIBLE wall's representation
|
|
47
|
+
* while also naming a HIDDEN wall's — an id nowhere in `excludeIds`. A plain
|
|
48
|
+
* `excludeIds.has(id)` check (the shape `collectGeoreferencingEntities` uses)
|
|
49
|
+
* would miss that id entirely and resurrect the hidden wall's geometry.
|
|
50
|
+
*
|
|
51
|
+
* The fix relies on an invariant this function's own contract already
|
|
52
|
+
* guarantees: it runs strictly AFTER `collectReferencedEntityIds`, which has
|
|
53
|
+
* already walked the FULL forward closure from every visible root. So any
|
|
54
|
+
* geometry/representation-classified entity (`isGeometryEntity`) that is
|
|
55
|
+
* NOT already in `closure` by the time this pass starts has no other path to
|
|
56
|
+
* visibility — it is either exclusively owned by an excluded product, or
|
|
57
|
+
* genuinely unreferenced by any visible root — and must not be resurrected
|
|
58
|
+
* just because it happens to sit in the same `AssignedItems`/`Item` list as
|
|
59
|
+
* something that IS visible. Presentation RESOURCE types (colours, surface
|
|
60
|
+
* styles — see `STYLE_RESOURCE_EXEMPT_TYPES`) are the one exception: they are
|
|
61
|
+
* shared data, never product-exclusive, so the pre-existing "pull in the
|
|
62
|
+
* style chain" behaviour for them is preserved unconditionally.
|
|
63
|
+
*
|
|
64
|
+
* `excludeIds` is still threaded through and checked directly (matching
|
|
65
|
+
* `collectGeoreferencingEntities`'s shape) as a second, cheap guard — e.g. if
|
|
66
|
+
* a future entity ever names an excluded id that is not geometry-classified.
|
|
67
|
+
*
|
|
68
|
+
* Uses byType for O(candidates) instead of O(allEntities), and byte-level
|
|
69
|
+
* scanning for #ID extraction.
|
|
70
|
+
*
|
|
71
|
+
* Must be called AFTER collectReferencedEntityIds so the closure is complete.
|
|
72
|
+
*
|
|
73
|
+
* @param closure - The existing closure set (mutated in place)
|
|
74
|
+
* @param source - The original STEP file source buffer
|
|
75
|
+
* @param entityIndex - Full entity index with type info and byType lookup
|
|
76
|
+
* @param excludeIds - Entity IDs to never add, even if they reference the
|
|
77
|
+
* closure (e.g. `pass.hiddenProductIds` / a subset export's `excludedIds`)
|
|
78
|
+
*/
|
|
79
|
+
export declare function collectStyleEntities(closure: Set<number>, source: Uint8Array | IfcSourceBytes, entityIndex: {
|
|
80
|
+
byId: {
|
|
81
|
+
get(expressId: number): {
|
|
82
|
+
type: string;
|
|
83
|
+
byteOffset: number;
|
|
84
|
+
byteLength: number;
|
|
85
|
+
} | undefined;
|
|
86
|
+
has(expressId: number): boolean;
|
|
87
|
+
refsOf?(expressId: number): readonly number[] | undefined;
|
|
88
|
+
};
|
|
89
|
+
byType: Map<string, number[]>;
|
|
90
|
+
}, excludeIds?: ReadonlySet<number>): void;
|
|
91
|
+
//# sourceMappingURL=style-closure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-closure.d.ts","sourceRoot":"","sources":["../src/style-closure.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAIvD;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAKjD,CAAC;AAuBH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,EACpB,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,WAAW,EAAE;IACX,IAAI,EAAE;QACJ,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAA;SAAE,GAAG,SAAS,CAAC;QAC7F,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;QAChC,MAAM,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,GAAG,SAAS,CAAC;KAC3D,CAAC;IACF,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC/B,EACD,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC/B,IAAI,CA0EN"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
import { collectRefsInByteRange } from './reference-collector.js';
|
|
5
|
+
import { isGeometryEntity } from './step-geometry-types.js';
|
|
6
|
+
/**
|
|
7
|
+
* The four entity classes `collectStyleEntities` rescues. Exported so
|
|
8
|
+
* `step-source-iteration.ts` can apply the SAME dangling-ref-safe line
|
|
9
|
+
* filter (`filterHiddenRefsFromRelationshipLine`) to a rescued entity's own
|
|
10
|
+
* output line as it already does for `IFCREL*` — a rescued
|
|
11
|
+
* `IFCPRESENTATIONLAYERASSIGNMENT` can legitimately end up naming both a
|
|
12
|
+
* kept item and an excluded one (see `collectStyleEntities`'s own doc), and
|
|
13
|
+
* without that filter its `AssignedItems` line would ship a dangling `#N`.
|
|
14
|
+
*/
|
|
15
|
+
export const STYLE_RESCUE_TYPES = new Set([
|
|
16
|
+
'IFCSTYLEDITEM',
|
|
17
|
+
'IFCSTYLEDREPRESENTATION',
|
|
18
|
+
'IFCPRESENTATIONLAYERASSIGNMENT',
|
|
19
|
+
'IFCPRESENTATIONLAYERWITHSTYLE',
|
|
20
|
+
]);
|
|
21
|
+
/**
|
|
22
|
+
* Presentation RESOURCE types (colours, surface styles, the assignment that
|
|
23
|
+
* glues a style to an item) that `isGeometryEntity` also classifies as
|
|
24
|
+
* "geometry" for the unrelated `includeGeometry: false` feature, but that
|
|
25
|
+
* are never exclusively owned by one product the way an
|
|
26
|
+
* `IfcShapeRepresentation` or `IfcExtrudedAreaSolid` is: they are shared
|
|
27
|
+
* presentation data, referenced BY styled items rather than referencing a
|
|
28
|
+
* product's geometry themselves. `IFCSTYLEDITEM` is deliberately NOT in this
|
|
29
|
+
* set — a `IfcStyledRepresentation.Items` list can itself mix a rescued
|
|
30
|
+
* (visible) styled item with one reachable only through a hidden product's
|
|
31
|
+
* OWN styled item (each product can carry its own styling), so it gets the
|
|
32
|
+
* same "must already be in the closure" treatment as any other geometry
|
|
33
|
+
* candidate.
|
|
34
|
+
*/
|
|
35
|
+
const STYLE_RESOURCE_EXEMPT_TYPES = new Set([
|
|
36
|
+
'IFCPRESENTATIONSTYLEASSIGNMENT',
|
|
37
|
+
'IFCSURFACESTYLE',
|
|
38
|
+
'IFCSURFACESTYLERENDERING',
|
|
39
|
+
'IFCCOLOURRGB',
|
|
40
|
+
]);
|
|
41
|
+
/**
|
|
42
|
+
* Collect style and presentation-layer entities (IFCSTYLEDITEM,
|
|
43
|
+
* IFCSTYLEDREPRESENTATION, IFCPRESENTATIONLAYERASSIGNMENT,
|
|
44
|
+
* IFCPRESENTATIONLAYERWITHSTYLE) that reference geometry already in the
|
|
45
|
+
* closure, then transitively follow their own references.
|
|
46
|
+
*
|
|
47
|
+
* In IFC STEP, IFCSTYLEDITEM references a geometry RepresentationItem, but
|
|
48
|
+
* nothing references the StyledItem back — and IFCPRESENTATIONLAYERASSIGNMENT
|
|
49
|
+
* is the same shape: it names the representation/items assigned to a layer
|
|
50
|
+
* (`AssignedItems`) but nothing points back at the assignment itself. So the
|
|
51
|
+
* forward closure walk misses both entirely. This function does one reverse
|
|
52
|
+
* pass using the byType index: for each candidate, check if any referenced ID
|
|
53
|
+
* is in the closure. If yes, add it and walk its own reference chain in.
|
|
54
|
+
*
|
|
55
|
+
* ## Why the forward walk needs more than `excludeIds`
|
|
56
|
+
*
|
|
57
|
+
* `excludeIds` (`hiddenProductIds`) only ever holds PRODUCT ids, never the
|
|
58
|
+
* geometry those products exclusively own. `IfcPresentationLayerAssignment.
|
|
59
|
+
* AssignedItems` routinely names REPRESENTATION-level ids directly (one CAD
|
|
60
|
+
* layer naming every wall's `IfcShapeRepresentation`), so a shared layer
|
|
61
|
+
* assignment can legitimately be rescued by a VISIBLE wall's representation
|
|
62
|
+
* while also naming a HIDDEN wall's — an id nowhere in `excludeIds`. A plain
|
|
63
|
+
* `excludeIds.has(id)` check (the shape `collectGeoreferencingEntities` uses)
|
|
64
|
+
* would miss that id entirely and resurrect the hidden wall's geometry.
|
|
65
|
+
*
|
|
66
|
+
* The fix relies on an invariant this function's own contract already
|
|
67
|
+
* guarantees: it runs strictly AFTER `collectReferencedEntityIds`, which has
|
|
68
|
+
* already walked the FULL forward closure from every visible root. So any
|
|
69
|
+
* geometry/representation-classified entity (`isGeometryEntity`) that is
|
|
70
|
+
* NOT already in `closure` by the time this pass starts has no other path to
|
|
71
|
+
* visibility — it is either exclusively owned by an excluded product, or
|
|
72
|
+
* genuinely unreferenced by any visible root — and must not be resurrected
|
|
73
|
+
* just because it happens to sit in the same `AssignedItems`/`Item` list as
|
|
74
|
+
* something that IS visible. Presentation RESOURCE types (colours, surface
|
|
75
|
+
* styles — see `STYLE_RESOURCE_EXEMPT_TYPES`) are the one exception: they are
|
|
76
|
+
* shared data, never product-exclusive, so the pre-existing "pull in the
|
|
77
|
+
* style chain" behaviour for them is preserved unconditionally.
|
|
78
|
+
*
|
|
79
|
+
* `excludeIds` is still threaded through and checked directly (matching
|
|
80
|
+
* `collectGeoreferencingEntities`'s shape) as a second, cheap guard — e.g. if
|
|
81
|
+
* a future entity ever names an excluded id that is not geometry-classified.
|
|
82
|
+
*
|
|
83
|
+
* Uses byType for O(candidates) instead of O(allEntities), and byte-level
|
|
84
|
+
* scanning for #ID extraction.
|
|
85
|
+
*
|
|
86
|
+
* Must be called AFTER collectReferencedEntityIds so the closure is complete.
|
|
87
|
+
*
|
|
88
|
+
* @param closure - The existing closure set (mutated in place)
|
|
89
|
+
* @param source - The original STEP file source buffer
|
|
90
|
+
* @param entityIndex - Full entity index with type info and byType lookup
|
|
91
|
+
* @param excludeIds - Entity IDs to never add, even if they reference the
|
|
92
|
+
* closure (e.g. `pass.hiddenProductIds` / a subset export's `excludedIds`)
|
|
93
|
+
*/
|
|
94
|
+
export function collectStyleEntities(closure, source, entityIndex, excludeIds) {
|
|
95
|
+
const queue = [];
|
|
96
|
+
const refsOf = (expressId, ref) => {
|
|
97
|
+
const authored = entityIndex.byId.refsOf?.(expressId);
|
|
98
|
+
if (authored)
|
|
99
|
+
return authored.slice();
|
|
100
|
+
return collectRefsInByteRange(source, ref.byteOffset, ref.byteLength);
|
|
101
|
+
};
|
|
102
|
+
// Use byType index for direct lookup — O(candidates) not O(allEntities)
|
|
103
|
+
const styledItemIds = entityIndex.byType.get('IFCSTYLEDITEM') ?? [];
|
|
104
|
+
const styledRepIds = entityIndex.byType.get('IFCSTYLEDREPRESENTATION') ?? [];
|
|
105
|
+
const layerAssignmentIds = entityIndex.byType.get('IFCPRESENTATIONLAYERASSIGNMENT') ?? [];
|
|
106
|
+
// IFCPRESENTATIONLAYERWITHSTYLE is a subtype (adds LayerOn/LayerFrozen/
|
|
107
|
+
// LayerBlocked/LayerStyles) indexed under its own STEP type name, not
|
|
108
|
+
// IFCPRESENTATIONLAYERASSIGNMENT's — a separate byType lookup, same rescue.
|
|
109
|
+
const layerWithStyleIds = entityIndex.byType.get('IFCPRESENTATIONLAYERWITHSTYLE') ?? [];
|
|
110
|
+
for (const ids of [styledItemIds, styledRepIds, layerAssignmentIds, layerWithStyleIds]) {
|
|
111
|
+
for (const expressId of ids) {
|
|
112
|
+
if (closure.has(expressId))
|
|
113
|
+
continue;
|
|
114
|
+
const entityRef = entityIndex.byId.get(expressId);
|
|
115
|
+
if (!entityRef)
|
|
116
|
+
continue;
|
|
117
|
+
// Check if any referenced ID is in the closure
|
|
118
|
+
const refs = refsOf(expressId, entityRef);
|
|
119
|
+
let referencesClosureEntity = false;
|
|
120
|
+
for (let i = 0; i < refs.length; i++) {
|
|
121
|
+
if (closure.has(refs[i])) {
|
|
122
|
+
referencesClosureEntity = true;
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
if (referencesClosureEntity) {
|
|
127
|
+
closure.add(expressId);
|
|
128
|
+
queue.push(expressId);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Walk forward from newly added style entities to pull in their style chain
|
|
133
|
+
// (IfcPresentationStyleAssignment → IfcSurfaceStyle → IfcSurfaceStyleRendering → IfcColourRgb)
|
|
134
|
+
// — but see the function doc for why a geometry-classified id not already
|
|
135
|
+
// in the closure is refused here rather than resurrected.
|
|
136
|
+
while (queue.length > 0) {
|
|
137
|
+
const entityId = queue.pop();
|
|
138
|
+
const ref = entityIndex.byId.get(entityId);
|
|
139
|
+
if (!ref)
|
|
140
|
+
continue;
|
|
141
|
+
const refs = refsOf(entityId, ref);
|
|
142
|
+
for (let i = 0; i < refs.length; i++) {
|
|
143
|
+
const referencedId = refs[i];
|
|
144
|
+
if (closure.has(referencedId))
|
|
145
|
+
continue;
|
|
146
|
+
if (excludeIds?.has(referencedId))
|
|
147
|
+
continue;
|
|
148
|
+
const targetRef = entityIndex.byId.get(referencedId);
|
|
149
|
+
if (!targetRef)
|
|
150
|
+
continue;
|
|
151
|
+
const targetType = targetRef.type.toUpperCase();
|
|
152
|
+
if (isGeometryEntity(targetType) && !STYLE_RESOURCE_EXEMPT_TYPES.has(targetType)) {
|
|
153
|
+
// A representation/geometry id this pass has not already proven
|
|
154
|
+
// visible — refusing it is what stops a shared layer assignment or
|
|
155
|
+
// styled representation from resurrecting a hidden product's
|
|
156
|
+
// exclusively-owned geometry (see function doc).
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
closure.add(referencedId);
|
|
160
|
+
queue.push(referencedId);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=style-closure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-closure.js","sourceRoot":"","sources":["../src/style-closure.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkB/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,eAAe;IACf,yBAAyB;IACzB,gCAAgC;IAChC,+BAA+B;CAChC,CAAC,CAAC;AAEH;;;;;;;;;;;;;GAaG;AACH,MAAM,2BAA2B,GAAwB,IAAI,GAAG,CAA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AS;YACxC,IAAI,UAAU,EAAE,GAAG,CAAC,YAAY,CAAC;gBAAE,SAAS;YAE5C,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YACrD,IAAI,CAAC,SAAS;gBAAE,SAAS;YAEzB,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YAChD,IAAI,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,2BAA2B,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;gBACjF,gEAAgE;gBAChE,mEAAmE;gBACnE,6DAA6D;gBAC7D,iDAAiD;gBACjD,SAAS;YACX,CAAC;YAED,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Read one entity's parsed STEP arguments and resolve a named attribute to
|
|
3
|
+
* its positional slot — the two primitives `anonymize-placement.ts` and
|
|
4
|
+
* `anonymize-scrub.ts` (#2934) need to walk a placement chain and locate a
|
|
5
|
+
* `Name`/`LongName`/`GlobalId` slot by EXPRESS name rather than a hardcoded
|
|
6
|
+
* index that would silently drift from the schema.
|
|
7
|
+
*
|
|
8
|
+
* Deliberately thin: this module owns none of the parsing rules itself. It
|
|
9
|
+
* composes `decodeRange` (`source-ref-bounds.ts`, the same readability gate
|
|
10
|
+
* every other byte-range read in this package uses — #2491) with
|
|
11
|
+
* `splitTopLevelArgs` (`step-argument-parser.ts`, the same quote/paren-aware
|
|
12
|
+
* splitter `filterHiddenRefsFromRelationshipLine` uses) so a second,
|
|
13
|
+
* independent STEP-line parser cannot disagree with the ones the rest of the
|
|
14
|
+
* exporter already relies on.
|
|
15
|
+
*/
|
|
16
|
+
import type { IfcSourceBytes } from '@ifc-lite/parser';
|
|
17
|
+
/** One entity's parsed STEP record: its type token and top-level arguments,
|
|
18
|
+
* in declaration order (still raw STEP tokens — `#N`, `'text'`, `$`, `.T.`,
|
|
19
|
+
* a nested `(...)` list — not decoded values). */
|
|
20
|
+
export interface SubsetEntityArgs {
|
|
21
|
+
/** UPPERCASE STEP type token, e.g. `IFCLOCALPLACEMENT`. */
|
|
22
|
+
readonly type: string;
|
|
23
|
+
readonly args: readonly string[];
|
|
24
|
+
}
|
|
25
|
+
/** The slice of an entity index this module reads: a byte-range lookup, same
|
|
26
|
+
* shape `collectReferencedEntityIds` and `collectStyleEntities` already take. */
|
|
27
|
+
export interface EntityByteRangeIndex {
|
|
28
|
+
get(id: number): {
|
|
29
|
+
byteOffset: number;
|
|
30
|
+
byteLength: number;
|
|
31
|
+
type?: string;
|
|
32
|
+
} | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read entity `id`'s STEP record out of `store`'s source and split it into
|
|
36
|
+
* its type token and top-level argument list. Returns `null` when the id has
|
|
37
|
+
* no entry in `index`, or when `index`'s byte range cannot actually be read
|
|
38
|
+
* out of `store.source` (`createSourceRefReader` — the same gate
|
|
39
|
+
* `step-pass-builder.ts`'s `isReadableSourceRef` applies), or when the bytes
|
|
40
|
+
* at that range do not parse as a single `#N=TYPE(...);` record.
|
|
41
|
+
*
|
|
42
|
+
* Only reads SOURCE-backed records. An overlay-created entity (no bytes to
|
|
43
|
+
* decode) is out of scope for this module: `anonymize-placement.ts` and
|
|
44
|
+
* `anonymize-scrub.ts` only ever walk/mutate the entities a freshly-parsed
|
|
45
|
+
* source model contains, never ones the private `MutablePropertyView` they
|
|
46
|
+
* build has itself just created.
|
|
47
|
+
*/
|
|
48
|
+
export declare function readEntityArgs(store: {
|
|
49
|
+
readonly source: IfcSourceBytes;
|
|
50
|
+
}, index: EntityByteRangeIndex, id: number): SubsetEntityArgs | null;
|
|
51
|
+
/**
|
|
52
|
+
* A STEP source schema `attrIndex` can resolve slots against DIRECTLY, one
|
|
53
|
+
* per bundled EXPRESS table (`@ifc-lite/data`'s `ENTITIES_IFC2X3` /
|
|
54
|
+
* `ENTITIES_IFC4` / `ENTITIES_IFC4X3`). `IFC5` (ifcx — JSON-native, no
|
|
55
|
+
* positional STEP records at all) never reaches this module, so it has no
|
|
56
|
+
* table and is deliberately not a member.
|
|
57
|
+
*/
|
|
58
|
+
export type SourceStepSchema = 'IFC2X3' | 'IFC4' | 'IFC4X3';
|
|
59
|
+
/**
|
|
60
|
+
* Narrow an `IfcDataStore.schemaVersion` to a {@link SourceStepSchema}
|
|
61
|
+
* `attrIndex` can resolve against, or `undefined` for anything that isn't
|
|
62
|
+
* one of the three bundled STEP schemas (`IFC5`, or an absent/unrecognized
|
|
63
|
+
* value) — callers pass that straight through to `attrIndex`, which then
|
|
64
|
+
* falls back to the pinned-first cross-schema union exactly as it always did.
|
|
65
|
+
*/
|
|
66
|
+
export declare function stepSourceSchema(schemaVersion: string | undefined): SourceStepSchema | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Zero-based positional index of attribute `name` on `type`, or `-1` when
|
|
69
|
+
* `type` declares no such attribute (an unknown type, or a genuine typo).
|
|
70
|
+
*
|
|
71
|
+
* When `schema` is given (the exported model's OWN schema, via
|
|
72
|
+
* {@link stepSourceSchema}), resolves against THAT schema's table first: the
|
|
73
|
+
* three bundled schemas do not always agree on a class's attribute order —
|
|
74
|
+
* e.g. IFC2X3's `IfcApprovalRelationship` puts `Name` at slot 3, IFC4 puts it
|
|
75
|
+
* at slot 0 — so a caller walking an arbitrary, non-fixed type (anything
|
|
76
|
+
* `pseudonymizeAllNames` reaches in `anonymize-scrub.ts`) has to resolve
|
|
77
|
+
* against the source model's actual schema or it silently reads/writes the
|
|
78
|
+
* wrong slot on every class the schemas disagree about. Falls back to
|
|
79
|
+
* `getAttributeNamesAcrossSchemas` — the pinned-IFC4-first cross-schema
|
|
80
|
+
* union this function always used before schema-aware resolution existed —
|
|
81
|
+
* when `schema` is omitted, or when `schema`'s own table doesn't know `type`
|
|
82
|
+
* (e.g. an IFC4X3-only class read out of an `IFC4` store).
|
|
83
|
+
*
|
|
84
|
+
* A caller that resolves a slot declared on a FIXED, verified-stable type —
|
|
85
|
+
* `IfcRoot.GlobalId` (slot 0 on every bundled schema), or a literal type
|
|
86
|
+
* token whose declared order was checked directly against all three
|
|
87
|
+
* `ENTITIES_*` tables — may omit `schema`: the union answers identically to
|
|
88
|
+
* a schema-specific lookup for those, and several call sites in
|
|
89
|
+
* `anonymize-placement.ts` and `anonymize-scrub.ts` do exactly that, each
|
|
90
|
+
* noting at the call site why its type is fixed rather than caller-supplied.
|
|
91
|
+
*
|
|
92
|
+
* `MutablePropertyView.setAttribute(id, name, value)` re-resolves `name` to a
|
|
93
|
+
* slot by its own lookup at STEP-serialize time
|
|
94
|
+
* (`step-attribute-mutations.ts`'s `applyAttributeMutations`), which now
|
|
95
|
+
* calls THIS function with the source entity's own `stepSourceSchema` too —
|
|
96
|
+
* so a `setAttribute` edit resolves the same slot this function would report
|
|
97
|
+
* for the same type/schema. `anonymize-scrub.ts` still writes through
|
|
98
|
+
* `MutablePropertyView.setPositionalAttribute(id, index, value)` with an
|
|
99
|
+
* `index` resolved here directly (#3309); that path needs no re-resolution
|
|
100
|
+
* at serialize time at all, so it stays the more direct choice for a caller
|
|
101
|
+
* that already has the index in hand.
|
|
102
|
+
*/
|
|
103
|
+
export declare function attrIndex(type: string, name: string, schema?: SourceStepSchema): number;
|
|
104
|
+
//# sourceMappingURL=subset-entity-reader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subset-entity-reader.d.ts","sourceRoot":"","sources":["../src/subset-entity-reader.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAgBvD;;mDAEmD;AACnD,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AAED;kFACkF;AAClF,MAAM,WAAW,oBAAoB;IACnC,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CACxF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAA;CAAE,EAC1C,KAAK,EAAE,oBAAoB,EAC3B,EAAE,EAAE,MAAM,GACT,gBAAgB,GAAG,IAAI,CAWzB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAc5D;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAIhG;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAMvF"}
|