@ifc-lite/export 4.0.1 → 4.3.1
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 +7 -0
- package/dist/anonymize-export.d.ts.map +1 -1
- package/dist/anonymize-export.js +10 -4
- package/dist/anonymize-export.js.map +1 -1
- package/dist/anonymize-placement.d.ts.map +1 -1
- package/dist/anonymize-placement.js +5 -6
- package/dist/anonymize-placement.js.map +1 -1
- package/dist/appearance-dependencies.d.ts +12 -0
- package/dist/appearance-dependencies.d.ts.map +1 -0
- package/dist/appearance-dependencies.js +195 -0
- package/dist/appearance-dependencies.js.map +1 -0
- package/dist/authored-resource-cleanup.d.ts +14 -0
- package/dist/authored-resource-cleanup.d.ts.map +1 -0
- package/dist/authored-resource-cleanup.js +156 -0
- package/dist/authored-resource-cleanup.js.map +1 -0
- package/dist/csv-table.d.ts +10 -0
- package/dist/csv-table.d.ts.map +1 -0
- package/dist/csv-table.js +39 -0
- package/dist/csv-table.js.map +1 -0
- package/dist/effective-appearance-record.d.ts +8 -0
- package/dist/effective-appearance-record.d.ts.map +1 -0
- package/dist/effective-appearance-record.js +49 -0
- package/dist/effective-appearance-record.js.map +1 -0
- package/dist/ifc5-appearance.d.ts +20 -0
- package/dist/ifc5-appearance.d.ts.map +1 -0
- package/dist/ifc5-appearance.js +106 -0
- package/dist/ifc5-appearance.js.map +1 -0
- package/dist/ifc5-export-helpers.d.ts +19 -0
- package/dist/ifc5-export-helpers.d.ts.map +1 -1
- package/dist/ifc5-export-helpers.js +41 -0
- package/dist/ifc5-export-helpers.js.map +1 -1
- package/dist/ifc5-exporter.d.ts +12 -10
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +24 -41
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/lod0-generator.js +1 -1
- package/dist/lod0-generator.js.map +1 -1
- package/dist/merged-context.d.ts.map +1 -1
- package/dist/merged-context.js +15 -1
- package/dist/merged-context.js.map +1 -1
- package/dist/merged-empty-containers.d.ts.map +1 -1
- package/dist/merged-empty-containers.js +9 -11
- package/dist/merged-empty-containers.js.map +1 -1
- package/dist/merged-subcontext.d.ts.map +1 -1
- package/dist/merged-subcontext.js +19 -1
- package/dist/merged-subcontext.js.map +1 -1
- package/dist/obj.d.ts +20 -0
- package/dist/obj.d.ts.map +1 -0
- package/dist/obj.js +40 -0
- package/dist/obj.js.map +1 -0
- package/dist/parquet-exporter.d.ts.map +1 -1
- package/dist/parquet-exporter.js +5 -5
- package/dist/parquet-exporter.js.map +1 -1
- package/dist/reference-collector.d.ts +21 -8
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +38 -45
- package/dist/reference-collector.js.map +1 -1
- package/dist/retype.d.ts +1 -1
- package/dist/retype.d.ts.map +1 -1
- package/dist/retype.js +13 -3
- package/dist/retype.js.map +1 -1
- package/dist/schema-converter-attr-remap.d.ts +18 -7
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +42 -48
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/schema-converter.d.ts.map +1 -1
- package/dist/schema-converter.js +16 -78
- package/dist/schema-converter.js.map +1 -1
- package/dist/step-argument-parser.d.ts +20 -3
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +60 -11
- package/dist/step-argument-parser.js.map +1 -1
- package/dist/step-attribute-mutations.d.ts +32 -2
- package/dist/step-attribute-mutations.d.ts.map +1 -1
- package/dist/step-attribute-mutations.js +87 -6
- package/dist/step-attribute-mutations.js.map +1 -1
- package/dist/step-comment-skip.d.ts +13 -0
- package/dist/step-comment-skip.d.ts.map +1 -0
- package/dist/step-comment-skip.js +19 -0
- package/dist/step-comment-skip.js.map +1 -0
- package/dist/step-export-types.d.ts +51 -0
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js +38 -0
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-outer-args.d.ts +27 -0
- package/dist/step-outer-args.d.ts.map +1 -0
- package/dist/step-outer-args.js +64 -0
- package/dist/step-outer-args.js.map +1 -0
- package/dist/step-overlay-attribute-overrides.d.ts.map +1 -1
- package/dist/step-overlay-attribute-overrides.js +6 -2
- package/dist/step-overlay-attribute-overrides.js.map +1 -1
- package/dist/step-property-sets.d.ts.map +1 -1
- package/dist/step-property-sets.js +8 -2
- package/dist/step-property-sets.js.map +1 -1
- package/dist/step-serialization.d.ts +1 -1
- package/dist/step-serialization.js +1 -1
- package/dist/step-slot-grammar.d.ts +24 -0
- package/dist/step-slot-grammar.d.ts.map +1 -0
- package/dist/step-slot-grammar.js +201 -0
- package/dist/step-slot-grammar.js.map +1 -0
- package/dist/step-source-iteration.d.ts.map +1 -1
- package/dist/step-source-iteration.js +26 -2
- package/dist/step-source-iteration.js.map +1 -1
- package/dist/style-closure.d.ts +3 -1
- package/dist/style-closure.d.ts.map +1 -1
- package/dist/style-closure.js +16 -1
- package/dist/style-closure.js.map +1 -1
- package/dist/subset-entity-reader.d.ts +12 -4
- package/dist/subset-entity-reader.d.ts.map +1 -1
- package/dist/subset-entity-reader.js +4 -16
- package/dist/subset-entity-reader.js.map +1 -1
- package/dist/texture-map-closure.d.ts +10 -0
- package/dist/texture-map-closure.d.ts.map +1 -0
- package/dist/texture-map-closure.js +22 -0
- package/dist/texture-map-closure.js.map +1 -0
- package/dist/unit-normalize.d.ts.map +1 -1
- package/dist/unit-normalize.js +12 -49
- package/dist/unit-normalize.js.map +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,201 @@
|
|
|
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
|
+
/**
|
|
5
|
+
* The per-slot half of the STEP argument reader: given ONE part that
|
|
6
|
+
* `splitTopLevelStepArguments` (`step-argument-parser.ts`) separated on a
|
|
7
|
+
* top-level comma, is that part a single well-formed STEP value?
|
|
8
|
+
*
|
|
9
|
+
* Split out of `step-argument-parser.ts` because the two answer different
|
|
10
|
+
* questions and only one of them recurses. The splitter is a flat scan over the
|
|
11
|
+
* whole argument list; this is a small recursive-descent grammar over one slot,
|
|
12
|
+
* and it is the recursion that needs the bound documented below. Keeping them in
|
|
13
|
+
* one file also put that file one line under the module-size ratchet.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* How deep a slot's parentheses may nest before the slot is refused.
|
|
17
|
+
*
|
|
18
|
+
* The grammar below is recursive descent — `parseValue` -> `parseParenList` ->
|
|
19
|
+
* `parseValue`, two stack frames per nesting level — over text this process did
|
|
20
|
+
* not write. Unbounded, deep enough nesting exhausts the JS stack and throws a
|
|
21
|
+
* `RangeError`, and a throw is a THIRD outcome for a function whose two callers
|
|
22
|
+
* (`replaceStepArgument`, and every by-index writer behind
|
|
23
|
+
* `splitTopLevelStepArguments`) are written against exactly two: parts, or
|
|
24
|
+
* `null` meaning "this edit cannot be made". A malformed or adversarial file
|
|
25
|
+
* would abort the whole export instead of refusing one edit. Bounding the
|
|
26
|
+
* nesting and returning `null` past the bound is what makes the contract total.
|
|
27
|
+
*
|
|
28
|
+
* The number is picked between two measurements taken on 2026-09-09 (#4213):
|
|
29
|
+
*
|
|
30
|
+
* - REAL NESTING. Over the repo's whole `tests/models` corpus (122 `.ifc`
|
|
31
|
+
* files, 1.4 GB), the deepest paren nesting inside any top-level slot of any
|
|
32
|
+
* record is 3 — the record-level maximum is 4, and one of those is the slot
|
|
33
|
+
* itself. The deepest shape in the corpus is
|
|
34
|
+
* `IFCINDEXEDPOLYCURVE(#307,(IFCLINEINDEX((1,2)),...),.F.)`.
|
|
35
|
+
* - THE STACK. In a fresh Node 22 process the deepest slot this grammar could
|
|
36
|
+
* validate before throwing `RangeError` was 3763 (eight fresh-process
|
|
37
|
+
* bisections, all eight identical); under vitest, 3768. That floor is the
|
|
38
|
+
* COLD one: once V8 has optimised the frames the same bisection reaches
|
|
39
|
+
* ~7900 in the same process, so the low number is the one to design against,
|
|
40
|
+
* and a real export calls this from far deeper in its own stack than a
|
|
41
|
+
* bisection harness does.
|
|
42
|
+
*
|
|
43
|
+
* 64 is ~21x the deepest nesting real files use and ~59x below the shallowest
|
|
44
|
+
* depth measured to throw: it refuses nothing the corpus contains, and it is
|
|
45
|
+
* reached long before the stack is. Both figures are historical, not
|
|
46
|
+
* invariants: the corpus can gain a file and V8 can change its frame size. What
|
|
47
|
+
* must stay true is the ORDER — comfortably above real nesting, far below the
|
|
48
|
+
* crash floor — and `step-argument-parser.test.ts` pins the two ends of the
|
|
49
|
+
* bound itself, plus one depth measured to throw before it existed.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately NOT mirrored into the two sibling grammars. `step_slot.rs`'s
|
|
52
|
+
* `is_well_formed_step_slot` and `packages/cli/src/commands/step-args.ts`'s
|
|
53
|
+
* `skipToken` are both flat loops with an explicit `depth` counter — the CLI
|
|
54
|
+
* one says so in its own docstring, in as many words — so neither has a stack
|
|
55
|
+
* to exhaust and neither needs a bound; adding one there would only invent a
|
|
56
|
+
* refusal. This grammar was the odd one out, not the one setting the rule.
|
|
57
|
+
*
|
|
58
|
+
* The implementations therefore diverge on what they ACCEPT at extreme depth,
|
|
59
|
+
* which is why this is not in `rust/export/tests/fixtures/step_refuse_vectors.json`
|
|
60
|
+
* — that fixture pins agreement on refusals only, and pinning an accept-side
|
|
61
|
+
* divergence would freeze the divergence as agreement (#4125).
|
|
62
|
+
*/
|
|
63
|
+
const MAX_SLOT_NESTING_DEPTH = 64;
|
|
64
|
+
/**
|
|
65
|
+
* Whether `part` — one slot `splitTopLevelStepArguments` already separated on
|
|
66
|
+
* a top-level comma, raw text including any surrounding whitespace/comments —
|
|
67
|
+
* is a single well-formed STEP value (a string literal, a binary literal
|
|
68
|
+
* (`"..."`), `$`, `*`, a bare keyword / enumeration / number / `#`-reference
|
|
69
|
+
* token, or a typed value or list `NAME(...)` / `(...)`), or is empty.
|
|
70
|
+
*
|
|
71
|
+
* Empty is deliberately accepted, matching `splitTopLevelStepArguments`'s
|
|
72
|
+
* docstring: `a,,b` is one empty part, not a rejection, so slot indices after it
|
|
73
|
+
* stay aligned with what the entity parser counts. A part that is ONLY a comment
|
|
74
|
+
* (no value) is NOT given that same pass — a lone `/* c */` between two commas
|
|
75
|
+
* is not a value at all, so treating it as one more empty slot is exactly the
|
|
76
|
+
* index shift that produces a phantom slot; rejecting the whole split is the
|
|
77
|
+
* correct answer there, same as any other malformed argument list.
|
|
78
|
+
*
|
|
79
|
+
* A `/` that is not opening a comment cannot be swallowed into a bare token:
|
|
80
|
+
* it is outside every token's character set, so it stops the scan and the
|
|
81
|
+
* top-of-function "consumed to the end" check then fails the whole part.
|
|
82
|
+
*
|
|
83
|
+
* Nesting past {@link MAX_SLOT_NESTING_DEPTH} is refused like any other
|
|
84
|
+
* malformed part, for the reason recorded on that constant.
|
|
85
|
+
*/
|
|
86
|
+
export function isWellFormedStepSlot(part) {
|
|
87
|
+
if (part.trim() === '')
|
|
88
|
+
return true;
|
|
89
|
+
let i = 0;
|
|
90
|
+
const n = part.length;
|
|
91
|
+
const skipTrivia = () => {
|
|
92
|
+
for (;;) {
|
|
93
|
+
while (i < n && /\s/.test(part[i]))
|
|
94
|
+
i++;
|
|
95
|
+
if (part[i] === '/' && part[i + 1] === '*') {
|
|
96
|
+
const end = part.indexOf('*/', i + 2);
|
|
97
|
+
if (end === -1) {
|
|
98
|
+
i = n; // unterminated: leave content unconsumed so parseValue fails
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
i = end + 2;
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* `depth` is how many parens are open around this list — 1 for a list that is
|
|
109
|
+
* the slot's own outermost `(`. Checked on ENTRY, before any recursion, so the
|
|
110
|
+
* frame budget is spent by the check rather than by the call it guards.
|
|
111
|
+
*/
|
|
112
|
+
const parseParenList = (depth) => {
|
|
113
|
+
if (depth > MAX_SLOT_NESTING_DEPTH)
|
|
114
|
+
return false;
|
|
115
|
+
// Caller has already consumed the opening '('.
|
|
116
|
+
skipTrivia();
|
|
117
|
+
if (part[i] === ')') {
|
|
118
|
+
i++;
|
|
119
|
+
return true;
|
|
120
|
+
}
|
|
121
|
+
for (;;) {
|
|
122
|
+
if (!parseValue(depth))
|
|
123
|
+
return false;
|
|
124
|
+
skipTrivia();
|
|
125
|
+
if (part[i] === ',') {
|
|
126
|
+
i++;
|
|
127
|
+
skipTrivia();
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (part[i] === ')') {
|
|
131
|
+
i++;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
const parseValue = (depth) => {
|
|
138
|
+
skipTrivia();
|
|
139
|
+
if (i >= n)
|
|
140
|
+
return false;
|
|
141
|
+
const c = part[i];
|
|
142
|
+
if (c === "'") {
|
|
143
|
+
i++;
|
|
144
|
+
while (i < n) {
|
|
145
|
+
if (part[i] === "'") {
|
|
146
|
+
if (part[i + 1] === "'") {
|
|
147
|
+
i += 2;
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
i++;
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
i++;
|
|
154
|
+
}
|
|
155
|
+
return false; // unterminated string
|
|
156
|
+
}
|
|
157
|
+
if (c === '(') {
|
|
158
|
+
i++;
|
|
159
|
+
return parseParenList(depth + 1);
|
|
160
|
+
}
|
|
161
|
+
// Binary literal (ISO 10303-21 `"..."`, e.g. `"0123ABC"` — an
|
|
162
|
+
// IfcBinary-typed value, distinct from the `'...'` string literal above.
|
|
163
|
+
// Unlike a string, `"` has no doubled-quote escape in STEP: ifcopenshell's
|
|
164
|
+
// tokenizer (`IfcParse.cpp`, `GeneralTokenPtr`/`IfcSpfLexer::Next`)
|
|
165
|
+
// classifies a token as binary purely by its leading `"` and does not
|
|
166
|
+
// decode escapes inside it, so the first following `"` ends the literal.
|
|
167
|
+
if (c === '"') {
|
|
168
|
+
i++;
|
|
169
|
+
while (i < n && part[i] !== '"')
|
|
170
|
+
i++;
|
|
171
|
+
if (i >= n)
|
|
172
|
+
return false; // unterminated binary literal
|
|
173
|
+
i++;
|
|
174
|
+
return true;
|
|
175
|
+
}
|
|
176
|
+
if (c === '$' || c === '*') {
|
|
177
|
+
i++;
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
// Bare token: keyword, enumeration (`.NOTDEFINED.`), number (incl.
|
|
181
|
+
// exponent), or an `#`-prefixed entity reference.
|
|
182
|
+
const start = i;
|
|
183
|
+
while (i < n && /[A-Za-z0-9_.+\-#]/.test(part[i]))
|
|
184
|
+
i++;
|
|
185
|
+
if (i === start)
|
|
186
|
+
return false;
|
|
187
|
+
// A typed value: NAME(...), trivia tolerated before '(' the same way
|
|
188
|
+
// `RECORD_PREFIX_RE` tolerates it before a record's own '('.
|
|
189
|
+
skipTrivia();
|
|
190
|
+
if (part[i] === '(') {
|
|
191
|
+
i++;
|
|
192
|
+
return parseParenList(depth + 1);
|
|
193
|
+
}
|
|
194
|
+
return true;
|
|
195
|
+
};
|
|
196
|
+
if (!parseValue(0))
|
|
197
|
+
return false;
|
|
198
|
+
skipTrivia();
|
|
199
|
+
return i === n;
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=step-slot-grammar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-slot-grammar.js","sourceRoot":"","sources":["../src/step-slot-grammar.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAC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,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG;gBAAE,CAAC,EAAE,CAAC;YACrC,IAAI,CAAC,IAAI,CAAC;gBAAE,OAAO,KAAK,CAAC,CAAC,8BAA8B;YACxD,CAAC,EAAE,CAAC;YACJ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,CAAC,EAAE,CAAC;YACJ,OAAO,IAAI,CAAC;QACd,CAAC;QAED,mEAAmE;QACnE,kDAAkD;QAClD,MAAM,KAAK,GAAG,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAAE,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,KAAK,KAAK;YAAE,OAAO,KAAK,CAAC;QAE9B,qEAAqE;QACrE,6DAA6D;QAC7D,UAAU,EAAE,CAAC;QACb,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;YACpB,CAAC,EAAE,CAAC;YACJ,OAAO,cAAc,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IAEF,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACjC,UAAU,EAAE,CAAC;IACb,OAAO,CAAC,KAAK,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-source-iteration.d.ts","sourceRoot":"","sources":["../src/step-source-iteration.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"step-source-i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AE,OAAO,EAC3B,mBAAmB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,EAC5C,GAAG,EAAE,sBAAsB,GAC1B,IAAI,CAgLN"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { filterHiddenRefsFromRelationshipLine } from './reference-collector.js';
|
|
5
5
|
import { STYLE_RESCUE_TYPES } from './style-closure.js';
|
|
6
6
|
import { styleEntityWithheldWarning } from './step-export-types.js';
|
|
7
|
+
import { applySourceLineMutationsReported } from './step-attribute-mutations.js';
|
|
7
8
|
import { convertStepLine } from './schema-converter.js';
|
|
8
9
|
import { nominateDeliveredInPlaceEdits } from './in-place-nomination.js';
|
|
9
10
|
import { decodeRange } from './source-ref-bounds.js';
|
|
@@ -117,8 +118,28 @@ export function writeSourceEntityLines(pass, options, mayNameOmittedRefs, isOmit
|
|
|
117
118
|
// Shared verbatim with the type-object `HasPropertySets` rewrite in
|
|
118
119
|
// `step-property-sets.ts`, which writes the line this pass would
|
|
119
120
|
// otherwise have written — hence injected rather than moved here.
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
// Through `applySourceLineMutationsReported` rather than the injected
|
|
122
|
+
// pipeline directly, so this pass and the type-object rewrite cannot end
|
|
123
|
+
// up reporting different halves of the same refusal.
|
|
124
|
+
//
|
|
125
|
+
// Into a per-entity buffer, NOT straight into `pass.warnings`: both
|
|
126
|
+
// reports the pipeline makes are about the line this iteration is about
|
|
127
|
+
// to write, and the `IFCREL*` and style-rescue branches below can still
|
|
128
|
+
// `continue` — withholding that line entirely and pushing their own
|
|
129
|
+
// warning for it. Reported here, the unreadable-record warning would name
|
|
130
|
+
// an entity whose edits were dropped beside a warning saying that entity
|
|
131
|
+
// has no line in the export at all: two warnings for one outcome, and the
|
|
132
|
+
// reader has to guess which one is about the record they asked for. So the
|
|
133
|
+
// buffer is flushed once the withholding branches have had their say and
|
|
134
|
+
// this line is going out.
|
|
135
|
+
//
|
|
136
|
+
// The flush point is the LAST branch that can withhold, not the last thing
|
|
137
|
+
// that can change the line: `convertStepLine` below still runs on the text
|
|
138
|
+
// this produces. That is deliberate, and it is why the warning itself no
|
|
139
|
+
// longer describes what was written — see
|
|
140
|
+
// `unreadableRecordEditsDroppedWarning` (#4213).
|
|
141
|
+
const mutationWarnings = [];
|
|
142
|
+
const mutated = applySourceLineMutationsReported(ctx.applySourceLineMutations, mutationWarnings, expressId, entityText, entityRef.type, pass.modifiedAttributes.get(expressId), pass.sourceSchema, pass.overlayActive);
|
|
122
143
|
let nextEntityText = mutated.text;
|
|
123
144
|
// A hidden PRODUCT's own line is already out of the export via
|
|
124
145
|
// `allowedEntityIds`, and a TOMBSTONED entity's via `effective` — this
|
|
@@ -164,6 +185,9 @@ export function writeSourceEntityLines(pass, options, mayNameOmittedRefs, isOmit
|
|
|
164
185
|
}
|
|
165
186
|
nextEntityText = filtered;
|
|
166
187
|
}
|
|
188
|
+
// Past every branch that can withhold this line, so the pipeline's own
|
|
189
|
+
// reports are now true statements about a record this pass is writing.
|
|
190
|
+
pass.warnings.push(...mutationWarnings);
|
|
167
191
|
// A retype or a positional edit that CHANGED the line is what makes
|
|
168
192
|
// this entity count; a named attribute edit was already nominated by
|
|
169
193
|
// 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,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,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,mBA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C,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"}
|
package/dist/style-closure.d.ts
CHANGED
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
* referenced id is already in the closure, and if so rescue it.
|
|
14
14
|
*/
|
|
15
15
|
import type { IfcSourceBytes } from '@ifc-lite/parser';
|
|
16
|
+
import type { EffectiveEntityIndex } from './effective-index.js';
|
|
16
17
|
/**
|
|
17
|
-
* The
|
|
18
|
+
* The inverse presentation entity classes `collectStyleEntities` rescues. Exported so
|
|
18
19
|
* `step-source-iteration.ts` can apply the SAME dangling-ref-safe line
|
|
19
20
|
* filter (`filterHiddenRefsFromRelationshipLine`) to a rescued entity's own
|
|
20
21
|
* output line as it already does for `IFCREL*` — a rescued
|
|
@@ -85,6 +86,7 @@ export declare function collectStyleEntities(closure: Set<number>, source: Uint8
|
|
|
85
86
|
} | undefined;
|
|
86
87
|
has(expressId: number): boolean;
|
|
87
88
|
refsOf?(expressId: number): readonly number[] | undefined;
|
|
89
|
+
refGroupsOf?: EffectiveEntityIndex['refGroupsOf'];
|
|
88
90
|
};
|
|
89
91
|
byType: Map<string, number[]>;
|
|
90
92
|
}, excludeIds?: ReadonlySet<number>): void;
|
|
@@ -1 +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,
|
|
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,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAMjD,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;QAC1D,WAAW,CAAC,EAAE,oBAAoB,CAAC,aAAa,CAAC,CAAC;KACnD,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,CAoFN"}
|
package/dist/style-closure.js
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { collectRefsInByteRange } from './reference-collector.js';
|
|
5
5
|
import { isGeometryEntity } from './step-geometry-types.js';
|
|
6
|
+
import { TEXTURE_MAP_TYPES, textureMapTarget } from './texture-map-closure.js';
|
|
6
7
|
/**
|
|
7
|
-
* The
|
|
8
|
+
* The inverse presentation entity classes `collectStyleEntities` rescues. Exported so
|
|
8
9
|
* `step-source-iteration.ts` can apply the SAME dangling-ref-safe line
|
|
9
10
|
* filter (`filterHiddenRefsFromRelationshipLine`) to a rescued entity's own
|
|
10
11
|
* output line as it already does for `IFCREL*` — a rescued
|
|
@@ -17,6 +18,7 @@ export const STYLE_RESCUE_TYPES = new Set([
|
|
|
17
18
|
'IFCSTYLEDREPRESENTATION',
|
|
18
19
|
'IFCPRESENTATIONLAYERASSIGNMENT',
|
|
19
20
|
'IFCPRESENTATIONLAYERWITHSTYLE',
|
|
21
|
+
...TEXTURE_MAP_TYPES,
|
|
20
22
|
]);
|
|
21
23
|
/**
|
|
22
24
|
* Presentation RESOURCE types (colours, surface styles, the assignment that
|
|
@@ -129,6 +131,19 @@ export function collectStyleEntities(closure, source, entityIndex, excludeIds) {
|
|
|
129
131
|
}
|
|
130
132
|
}
|
|
131
133
|
}
|
|
134
|
+
// Texture maps are inverse attachments too, but sharing an image never
|
|
135
|
+
// proves that their MappedTo geometry is visible (#4243).
|
|
136
|
+
for (const type of TEXTURE_MAP_TYPES) {
|
|
137
|
+
for (const id of entityIndex.byType.get(type) ?? []) {
|
|
138
|
+
if (closure.has(id) || excludeIds?.has(id) || !entityIndex.byId.has(id))
|
|
139
|
+
continue;
|
|
140
|
+
const target = textureMapTarget(source, entityIndex.byId, id);
|
|
141
|
+
if (target !== undefined && closure.has(target)) {
|
|
142
|
+
closure.add(id);
|
|
143
|
+
queue.push(id);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
132
147
|
// Walk forward from newly added style entities to pull in their style chain
|
|
133
148
|
// (IfcPresentationStyleAssignment → IfcSurfaceStyle → IfcSurfaceStyleRendering → IfcColourRgb)
|
|
134
149
|
// — but see the function doc for why a geometry-classified id not already
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-closure.js","sourceRoot":"","sources":["../src/style-closure.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAkB/D,OAAO,EAAE,s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,YAAY,CAAC;gBAAE,SAAS;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"}
|
|
@@ -8,12 +8,20 @@
|
|
|
8
8
|
* Deliberately thin: this module owns none of the parsing rules itself. It
|
|
9
9
|
* composes `decodeRange` (`source-ref-bounds.ts`, the same readability gate
|
|
10
10
|
* every other byte-range read in this package uses — #2491) with
|
|
11
|
-
* `
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
11
|
+
* `readStepSlots` (`step-argument-parser.ts`, the same validated record reader
|
|
12
|
+
* `filterHiddenRefsFromRelationshipLine` uses) so a second, independent
|
|
13
|
+
* STEP-line parser cannot disagree with the ones the rest of the exporter
|
|
14
|
+
* already relies on.
|
|
15
15
|
*/
|
|
16
16
|
import type { IfcSourceBytes } from '@ifc-lite/parser';
|
|
17
|
+
/**
|
|
18
|
+
* `#N=TYPE(...);` record, with STEP trivia (whitespace and/or a
|
|
19
|
+
* `/* ... */` comment, #3789) tolerated between the type name and `(` —
|
|
20
|
+
* the same adjacency fix the rest of this package's record readers carry.
|
|
21
|
+
* Without it a wrapped record reads as unparseable, `readEntityArgs` returns
|
|
22
|
+
* `null`, and `anonymize-placement.ts` / `anonymize-scrub.ts` silently skip
|
|
23
|
+
* that entity instead of scrubbing it.
|
|
24
|
+
*/
|
|
17
25
|
/** One entity's parsed STEP record: its type token and top-level arguments,
|
|
18
26
|
* in declaration order (still raw STEP tokens — `#N`, `'text'`, `$`, `.T.`,
|
|
19
27
|
* a nested `(...)` list — not decoded values). */
|
|
@@ -1 +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;
|
|
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;AAMvD;;;;;;;GAOG;AACH;;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,CASzB;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"}
|
|
@@ -1,19 +1,10 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
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
|
-
import {
|
|
4
|
+
import { getAttributeNamesAcrossSchemas, resolveEntityNameAlias } from '@ifc-lite/parser';
|
|
5
5
|
import { ENTITIES_IFC2X3, ENTITIES_IFC4, ENTITIES_IFC4X3 } from '@ifc-lite/data';
|
|
6
6
|
import { createSourceRefReader, decodeRange } from './source-ref-bounds.js';
|
|
7
|
-
import {
|
|
8
|
-
/**
|
|
9
|
-
* `#N=TYPE(...);` record, with STEP trivia (whitespace and/or a
|
|
10
|
-
* `/* ... */` comment, #3789) tolerated between the type name and `(` —
|
|
11
|
-
* the same adjacency fix the rest of this package's record readers carry.
|
|
12
|
-
* Without it a wrapped record reads as unparseable, `readEntityArgs` returns
|
|
13
|
-
* `null`, and `anonymize-placement.ts` / `anonymize-scrub.ts` silently skip
|
|
14
|
-
* that entity instead of scrubbing it.
|
|
15
|
-
*/
|
|
16
|
-
const RECORD_RE = new RegExp(`^#\\d+\\s*=\\s*(\\w+)${STEP_TRIVIA}\\(([\\s\\S]*)\\)\\s*;\\s*$`);
|
|
7
|
+
import { readStepSlots } from './step-argument-parser.js';
|
|
17
8
|
/**
|
|
18
9
|
* Read entity `id`'s STEP record out of `store`'s source and split it into
|
|
19
10
|
* its type token and top-level argument list. Returns `null` when the id has
|
|
@@ -36,11 +27,8 @@ export function readEntityArgs(store, index, id) {
|
|
|
36
27
|
if (!isReadable(ref))
|
|
37
28
|
return null;
|
|
38
29
|
const line = decodeRange(store.source, ref.byteOffset, ref.byteOffset + ref.byteLength);
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
return null;
|
|
42
|
-
const [, type, argsText] = match;
|
|
43
|
-
return { type: type.toUpperCase(), args: splitTopLevelArgs(argsText) };
|
|
30
|
+
const record = readStepSlots(line);
|
|
31
|
+
return record === null ? null : { type: record.type, args: record.slots.map((arg) => arg.trim()) };
|
|
44
32
|
}
|
|
45
33
|
const ATTRIBUTE_NAMES_BY_SCHEMA = {
|
|
46
34
|
IFC2X3: attributeTableByUpperName(ENTITIES_IFC2X3),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subset-entity-reader.js","sourceRoot":"","sources":["../src/subset-entity-reader.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"subset-entity-reader.js","sourceRoot":"","sources":["../src/subset-entity-reader.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,8BAA8B,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAsB,MAAM,gBAAgB,CAAC;AACrG,OAAO,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAyB1D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,cAAc,CAC5B,KAA0C,EAC1C,KAA2B,EAC3B,EAAU;IAEV,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAC1B,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;I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;;;;;;;;;;;;;;;;GAmCG;AACH,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,IAAY,EAAE,MAAyB;IAC7E,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,KAAK,GAAG,yBAAyB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAChG,IAAI,KAAK;YAAE,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,8BAA8B,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type IfcSourceBytes } from '@ifc-lite/parser';
|
|
2
|
+
import { type EntityByteRangeIndex } from './subset-entity-reader.js';
|
|
3
|
+
import type { EffectiveEntityIndex } from './effective-index.js';
|
|
4
|
+
export declare const TEXTURE_MAP_TYPES: readonly ["IFCINDEXEDTRIANGLETEXTUREMAP", "IFCINDEXEDPOLYGONALTEXTUREMAP", "IFCTEXTUREMAP"];
|
|
5
|
+
/** #4243: rescue by MappedTo geometry, never by a shared image or UV resource.
|
|
6
|
+
* Effective reference groups replace overridden targets; refsOf intentionally
|
|
7
|
+
* unions original and edited refs and would resurrect a hidden map after retargeting.
|
|
8
|
+
*/
|
|
9
|
+
export declare function textureMapTarget(source: Uint8Array | IfcSourceBytes, index: EntityByteRangeIndex & Pick<EffectiveEntityIndex, 'refGroupsOf'>, expressId: number): number | undefined;
|
|
10
|
+
//# sourceMappingURL=texture-map-closure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-map-closure.d.ts","sourceRoot":"","sources":["../src/texture-map-closure.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,eAAO,MAAM,iBAAiB,6FAA8F,CAAC;AAE7H;;;GAGG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,GAAG,cAAc,EACnC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC,oBAAoB,EAAE,aAAa,CAAC,EACvE,SAAS,EAAE,MAAM,GAChB,MAAM,GAAG,SAAS,CASpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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 { asSourceBytes } from '@ifc-lite/parser';
|
|
5
|
+
import { refGroupFromArg } from './reference-collector.js';
|
|
6
|
+
import { readEntityArgs } from './subset-entity-reader.js';
|
|
7
|
+
export const TEXTURE_MAP_TYPES = ['IFCINDEXEDTRIANGLETEXTUREMAP', 'IFCINDEXEDPOLYGONALTEXTUREMAP', 'IFCTEXTUREMAP'];
|
|
8
|
+
/** #4243: rescue by MappedTo geometry, never by a shared image or UV resource.
|
|
9
|
+
* Effective reference groups replace overridden targets; refsOf intentionally
|
|
10
|
+
* unions original and edited refs and would resurrect a hidden map after retargeting.
|
|
11
|
+
*/
|
|
12
|
+
export function textureMapTarget(source, index, expressId) {
|
|
13
|
+
const sourceGroups = readEntityArgs({ source: asSourceBytes(source) }, index, expressId)?.args.map(refGroupFromArg);
|
|
14
|
+
const groups = index.refGroupsOf?.(expressId, sourceGroups) ?? sourceGroups ?? [];
|
|
15
|
+
// EXPRESS places MappedTo after inherited Maps (indexed maps), or after
|
|
16
|
+
// Maps and Vertices (IfcTextureMap). Do not narrow its IfcFace target by
|
|
17
|
+
// concrete type: IfcFaceSurface and IfcAdvancedFace are valid targets too.
|
|
18
|
+
const type = index.get(expressId)?.type?.toUpperCase();
|
|
19
|
+
const target = groups[type === 'IFCTEXTUREMAP' ? 2 : 1];
|
|
20
|
+
return typeof target === 'number' ? target : undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=texture-map-closure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"texture-map-closure.js","sourceRoot":"","sources":["../src/texture-map-closure.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAC/D,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAA6B,MAAM,2BAA2B,CAAC;AAGtF,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,8BAA8B,EAAE,+BAA+B,EAAE,eAAe,CAAU,CAAC;AAE7H;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAAmC,EACnC,KAAuE,EACvE,SAAiB;IAEjB,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,MAAM,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACpH,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,IAAI,YAAY,IAAI,EAAE,CAAC;IAClF,wEAAwE;IACxE,yEAAyE;IACzE,2EAA2E;IAC3E,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACvD,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,KAAK,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACxD,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-normalize.d.ts","sourceRoot":"","sources":["../src/unit-normalize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unit-normalize.d.ts","sourceRoot":"","sources":["../src/unit-normalize.ts"],"names":[],"mappings":"AAmFA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,yDAAyD;IACzD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;;;;OAKG;IACH,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,mFAAmF;IACnF,KAAK,EAAE,OAAO,CAAC;CAChB;AA0BD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB,CAMvE;AAqCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMlD;AAYD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAMxE;AA0BD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,MAAM,CAYR;AAqBD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,GACnB,MAAM,CA+DR;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,MAAM,CAKvF"}
|
package/dist/unit-normalize.js
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
import { getAllAttributesForEntity, STEP_TRIVIA } from '@ifc-lite/parser';
|
|
56
56
|
import { formatStepReal } from '@ifc-lite/data';
|
|
57
57
|
import { splitTopLevelStepArguments } from './step-argument-parser.js';
|
|
58
|
+
import { findOuterArgs } from './step-outer-args.js';
|
|
58
59
|
/** IFC defined types whose values are lengths (STEP writes them as bare reals). */
|
|
59
60
|
const LENGTH_MEASURE_TYPES = new Set([
|
|
60
61
|
'IfcLengthMeasure',
|
|
@@ -234,43 +235,6 @@ function scaleScalarArg(arg, factor) {
|
|
|
234
235
|
return arg;
|
|
235
236
|
return toStepRealScaled(n * factor);
|
|
236
237
|
}
|
|
237
|
-
/**
|
|
238
|
-
* Locate the outer STEP argument list of one entity line: the first `(` (nothing
|
|
239
|
-
* is quoted before the type name) and its matching `)`, honouring quoted strings
|
|
240
|
-
* (with the `''` escape) so a literal `)` inside a string never closes early.
|
|
241
|
-
* Returns `null` for a line without arguments.
|
|
242
|
-
*/
|
|
243
|
-
function findOuterArgs(line) {
|
|
244
|
-
const open = line.indexOf('(');
|
|
245
|
-
if (open === -1)
|
|
246
|
-
return null;
|
|
247
|
-
let depth = 0;
|
|
248
|
-
let inString = false;
|
|
249
|
-
for (let i = open; i < line.length; i++) {
|
|
250
|
-
const ch = line[i];
|
|
251
|
-
if (inString) {
|
|
252
|
-
if (ch === "'") {
|
|
253
|
-
if (line[i + 1] === "'")
|
|
254
|
-
i++; // escaped quote
|
|
255
|
-
else
|
|
256
|
-
inString = false;
|
|
257
|
-
}
|
|
258
|
-
continue;
|
|
259
|
-
}
|
|
260
|
-
if (ch === "'") {
|
|
261
|
-
inString = true;
|
|
262
|
-
continue;
|
|
263
|
-
}
|
|
264
|
-
if (ch === '(')
|
|
265
|
-
depth++;
|
|
266
|
-
else if (ch === ')') {
|
|
267
|
-
depth--;
|
|
268
|
-
if (depth === 0)
|
|
269
|
-
return { open, close: i };
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
238
|
/**
|
|
275
239
|
* Rescale every length/area/volume-valued datum of one STEP entity line.
|
|
276
240
|
*
|
|
@@ -299,18 +263,17 @@ export function rescaleEntityLengths(line, typeUpper, lengthFactor, areaFactor,
|
|
|
299
263
|
let skipValues = false;
|
|
300
264
|
if (hasStructural || plan.unitGuardIdx.length > 0) {
|
|
301
265
|
const args = splitTopLevelStepArguments(inner);
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
//
|
|
305
|
-
//
|
|
306
|
-
//
|
|
307
|
-
//
|
|
308
|
-
//
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return line;
|
|
266
|
+
// NOT an unreachable invariant: `findOuterArgs` only guarantees SCAN-state
|
|
267
|
+
// (balanced parens/quotes), while #4173 made `splitTopLevelStepArguments`
|
|
268
|
+
// also reject a per-slot malformed VALUE, which a scan-clean span can
|
|
269
|
+
// still fail. Unlike this module's siblings (`merged-context.ts`,
|
|
270
|
+
// `merged-subcontext.ts`), which fall back to "unknown, don't unify" —
|
|
271
|
+
// safe for a comparison — there is no permissive fallback for a unit
|
|
272
|
+
// conversion: fail loudly rather than leave the data in the wrong unit.
|
|
273
|
+
if (args === null) {
|
|
274
|
+
throw new Error(`rescaleEntityLengths: cannot split "${typeUpper}"'s slots to rescale — refusing `
|
|
275
|
+
+ `to silently leave its length/area/volume data in the wrong unit: ${line}`);
|
|
276
|
+
}
|
|
314
277
|
// A live unit-override reference means the value is already in its own unit.
|
|
315
278
|
skipValues = plan.unitGuardIdx.some((idx) => {
|
|
316
279
|
const u = args[idx]?.trim();
|