@ifc-lite/export 4.0.1 → 4.2.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 +7 -0
- package/dist/anonymize-placement.d.ts.map +1 -1
- package/dist/anonymize-placement.js +3 -4
- 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 +191 -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/effective-appearance-record.d.ts +8 -0
- package/dist/effective-appearance-record.d.ts.map +1 -0
- package/dist/effective-appearance-record.js +45 -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-exporter.d.ts +3 -0
- package/dist/ifc5-exporter.d.ts.map +1 -1
- package/dist/ifc5-exporter.js +19 -9
- package/dist/ifc5-exporter.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- 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 +3 -2
- 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 +1 -0
- package/dist/reference-collector.d.ts.map +1 -1
- package/dist/reference-collector.js +5 -4
- 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 +26 -4
- package/dist/schema-converter-attr-remap.d.ts.map +1 -1
- package/dist/schema-converter-attr-remap.js +28 -46
- package/dist/schema-converter-attr-remap.js.map +1 -1
- package/dist/step-argument-parser.d.ts +8 -1
- package/dist/step-argument-parser.d.ts.map +1 -1
- package/dist/step-argument-parser.js +40 -1
- 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-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-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/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,64 @@
|
|
|
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
|
+
* Locate the outer STEP argument list of one entity line: the first `(` (nothing
|
|
6
|
+
* is quoted before the type name) and its matching `)`, honouring quoted strings
|
|
7
|
+
* (with the `''` escape) and `/* ... */` comments so a literal `)`, `'`, or `(`
|
|
8
|
+
* inside either never shifts the match. Returns `null` for a line without
|
|
9
|
+
* arguments, or one whose span this scan cannot delimit cleanly.
|
|
10
|
+
*
|
|
11
|
+
* Split out of `unit-normalize.ts` (which has no line-count headroom left under
|
|
12
|
+
* `scripts/check-module-size.mjs`) so this scan — shared in spirit with
|
|
13
|
+
* `splitTopLevelStepArguments`'s outer scan in `step-argument-parser.ts` — has
|
|
14
|
+
* somewhere to carry its comment-awareness fix.
|
|
15
|
+
*
|
|
16
|
+
* ISO-10303-21 comment content is unrestricted: a `/* ... */` can hold an
|
|
17
|
+
* apostrophe or an unbalanced paren, neither of which is argument-list
|
|
18
|
+
* structure. Before this fix, an apostrophe inside a comment toggled quote
|
|
19
|
+
* state and an unbalanced paren inside one shifted the depth count, so a scan
|
|
20
|
+
* over an otherwise well-formed line could miss the record's real closing `)`
|
|
21
|
+
* and return `null` — which `rescaleEntityLengths` reads as "no arguments to
|
|
22
|
+
* rescale" and silently hands the line back with its length/area/volume data
|
|
23
|
+
* UNSCALED, the same silent-corruption class `splitTopLevelStepArguments` was
|
|
24
|
+
* hardened against for LTplus-AG/ifc-lite#4162.
|
|
25
|
+
*/
|
|
26
|
+
export function findOuterArgs(line) {
|
|
27
|
+
const open = line.indexOf('(');
|
|
28
|
+
if (open === -1)
|
|
29
|
+
return null;
|
|
30
|
+
let depth = 0;
|
|
31
|
+
let inString = false;
|
|
32
|
+
for (let i = open; i < line.length; i++) {
|
|
33
|
+
const ch = line[i];
|
|
34
|
+
if (!inString && ch === '/' && line[i + 1] === '*') {
|
|
35
|
+
const end = line.indexOf('*/', i + 2);
|
|
36
|
+
if (end === -1)
|
|
37
|
+
return null; // unterminated comment: nothing past it is trustworthy
|
|
38
|
+
i = end + 1; // loop's i++ lands one past the closing '/'
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (inString) {
|
|
42
|
+
if (ch === "'") {
|
|
43
|
+
if (line[i + 1] === "'")
|
|
44
|
+
i++; // escaped quote
|
|
45
|
+
else
|
|
46
|
+
inString = false;
|
|
47
|
+
}
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
if (ch === "'") {
|
|
51
|
+
inString = true;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (ch === '(')
|
|
55
|
+
depth++;
|
|
56
|
+
else if (ch === ')') {
|
|
57
|
+
depth--;
|
|
58
|
+
if (depth === 0)
|
|
59
|
+
return { open, close: i };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=step-outer-args.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-outer-args.js","sourceRoot":"","sources":["../src/step-outer-args.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;GAqBG;A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AAC;gBAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAC7C,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-sets.d.ts","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step-property-sets.d.ts","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"AAmCA,OAAO,EAAE,KAAK,kBAAkB,EAAsB,MAAM,gCAAgC,CAAC;AAE7F,OAAO,KAAK,EAAE,UAAU,EAAuB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG7F;;;;;;;;;GASG;AACH,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,UAAU,EAChB,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,kBAAkB,GACtB,IAAI,CAmLN"}
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
import { decodeRange } from './source-ref-bounds.js';
|
|
26
26
|
import { resolveTypeOwnedPsetIds, rewriteTypeOwnedPsetLine, typeOwnedPsetRewriteWarning, } from './type-owned-psets.js';
|
|
27
27
|
import { recordSourceLineDelivery } from './delta-modification-ledger.js';
|
|
28
|
+
import { applySourceLineMutationsReported } from './step-attribute-mutations.js';
|
|
28
29
|
import { nominateDeliveredInPlaceEdits } from './in-place-nomination.js';
|
|
29
30
|
import { getPropertySetName } from './step-property-set-readers.js';
|
|
30
31
|
import { generatePropertySetEntities, generateQuantitySetEntities } from './step-property-set-generators.js';
|
|
@@ -97,8 +98,13 @@ export function generatePropertyAndQuantitySetEntities(pass, options, ctx) {
|
|
|
97
98
|
sourceLine = decodeRange(ctx.dataStore.source, record.byteOffset, record.byteOffset + record.byteLength);
|
|
98
99
|
// The RECORD's class is the from-type: the bytes are still the source
|
|
99
100
|
// class, whatever `typeOf` now says the entity effectively is.
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
//
|
|
102
|
+
// The reporting travels with the call (`applySourceLineMutationsReported`)
|
|
103
|
+
// because this rewrite REPLACES the source-iteration pass's line for these
|
|
104
|
+
// ids (`rewrittenEntityIds`) — a refusal reported only there would be
|
|
105
|
+
// silent for exactly the entities this branch owns, and a pass that
|
|
106
|
+
// remembered one of the two warnings would be silent about the other.
|
|
107
|
+
mutated = applySourceLineMutationsReported(ctx.applySourceLineMutations, pass.warnings, entityId, sourceLine, record.type, pass.modifiedAttributes.get(entityId), pass.sourceSchema, pass.overlayActive);
|
|
102
108
|
}
|
|
103
109
|
if (mutated === null) {
|
|
104
110
|
// `willBeEmitted` already required real source bytes for a non-overlay
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step-property-sets.js","sourceRoot":"","sources":["../src/step-property-sets.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAA2B,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,OAAO,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAI7G;;;;;;;;;GASG;AACH,MAAM,UAAU,sCAAsC,CACpD,IAAgB,EAChB,OAA0B,EAC1B,GAAuB;IAEvB,gFAAgF;IAChF,MAAM,yBAAyB,GAAG,IAAI,GAAG,EAA+B,CAAC;IACzE,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACvD,oEAAoE;QACpE,6CAA6C;QAC7C,IAAI,CAAC,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,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAChD,CAAC;QACD,+DAA+D;QAC/D,oEAAoE;QACpE,uEAAuE;QACvE,kEAAkE;QAClE,sEAAsE;QACtE,yCAAyC;QACzC,IAAI,OAAO,EAAE,CAAC;YACZ,wBAAwB,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;YAChE,oEAAoE;YACpE,wEAAwE;YACxE,6BAA6B,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC7F,CAAC;IACH,CAAC;IAED,+CAA+C;IAC/C,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,IAAI,CAAC,eAAe,EAAE,CAAC;QACvD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC;YAAE,SAAS;QAC5C,MAAM,WAAW,GAAG,2BAA2B,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;QAC9G,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;QACzC,IAAI,CAAC,cAAc,IAAI,WAAW,CAAC,KAAK,CAAC;QACzC,IAAI,WAAW,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC;YAAE,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;IAC/F,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `part` — one slot `splitTopLevelStepArguments` already separated on
|
|
3
|
+
* a top-level comma, raw text including any surrounding whitespace/comments —
|
|
4
|
+
* is a single well-formed STEP value (a string literal, a binary literal
|
|
5
|
+
* (`"..."`), `$`, `*`, a bare keyword / enumeration / number / `#`-reference
|
|
6
|
+
* token, or a typed value or list `NAME(...)` / `(...)`), or is empty.
|
|
7
|
+
*
|
|
8
|
+
* Empty is deliberately accepted, matching `splitTopLevelStepArguments`'s
|
|
9
|
+
* docstring: `a,,b` is one empty part, not a rejection, so slot indices after it
|
|
10
|
+
* stay aligned with what the entity parser counts. A part that is ONLY a comment
|
|
11
|
+
* (no value) is NOT given that same pass — a lone `/* c */` between two commas
|
|
12
|
+
* is not a value at all, so treating it as one more empty slot is exactly the
|
|
13
|
+
* index shift that produces a phantom slot; rejecting the whole split is the
|
|
14
|
+
* correct answer there, same as any other malformed argument list.
|
|
15
|
+
*
|
|
16
|
+
* A `/` that is not opening a comment cannot be swallowed into a bare token:
|
|
17
|
+
* it is outside every token's character set, so it stops the scan and the
|
|
18
|
+
* top-of-function "consumed to the end" check then fails the whole part.
|
|
19
|
+
*
|
|
20
|
+
* Nesting past {@link MAX_SLOT_NESTING_DEPTH} is refused like any other
|
|
21
|
+
* malformed part, for the reason recorded on that constant.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isWellFormedStepSlot(part: string): boolean;
|
|
24
|
+
//# sourceMappingURL=step-slot-grammar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-slot-grammar.d.ts","sourceRoot":"","sources":["../src/step-slot-grammar.ts"],"names":[],"mappings":"AAkEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAmH1D"}
|
|
@@ -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;AACH,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,oBAAoB,CAAC,IA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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-iteration.d.ts","sourceRoot":"","sources":["../src/step-source-iteration.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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I,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,mBAAmB,EAA2B,MAAM,gCAAgC,CAAC;AAuC9F;;;;;;;;;;;;GAYG;AACH,SAAS,iBAAiB,CACxB,OAAoB,EACpB,gBAAoC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AAI,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,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3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,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,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"}
|