@ifc-lite/export 4.7.2 → 4.8.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.
Files changed (96) hide show
  1. package/dist/entity-subgraph.d.ts +56 -0
  2. package/dist/entity-subgraph.d.ts.map +1 -0
  3. package/dist/entity-subgraph.js +138 -0
  4. package/dist/entity-subgraph.js.map +1 -0
  5. package/dist/index.d.ts +2 -0
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +7 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/lod0-generator.d.ts.map +1 -1
  10. package/dist/lod0-generator.js +4 -1
  11. package/dist/lod0-generator.js.map +1 -1
  12. package/dist/merged-empty-containers-refs.d.ts +24 -0
  13. package/dist/merged-empty-containers-refs.d.ts.map +1 -0
  14. package/dist/merged-empty-containers-refs.js +126 -0
  15. package/dist/merged-empty-containers-refs.js.map +1 -0
  16. package/dist/merged-empty-containers.d.ts +36 -1
  17. package/dist/merged-empty-containers.d.ts.map +1 -1
  18. package/dist/merged-empty-containers.js +21 -126
  19. package/dist/merged-empty-containers.js.map +1 -1
  20. package/dist/merged-exporter.d.ts +4 -1
  21. package/dist/merged-exporter.d.ts.map +1 -1
  22. package/dist/merged-exporter.js +42 -39
  23. package/dist/merged-exporter.js.map +1 -1
  24. package/dist/merged-guid.d.ts +4 -0
  25. package/dist/merged-guid.d.ts.map +1 -1
  26. package/dist/merged-guid.js +14 -0
  27. package/dist/merged-guid.js.map +1 -1
  28. package/dist/merged-inverse-claims.d.ts +154 -0
  29. package/dist/merged-inverse-claims.d.ts.map +1 -0
  30. package/dist/merged-inverse-claims.js +306 -0
  31. package/dist/merged-inverse-claims.js.map +1 -0
  32. package/dist/merged-planner-guids.d.ts +32 -0
  33. package/dist/merged-planner-guids.d.ts.map +1 -0
  34. package/dist/merged-planner-guids.js +79 -0
  35. package/dist/merged-planner-guids.js.map +1 -0
  36. package/dist/merged-subcontext.d.ts.map +1 -1
  37. package/dist/merged-subcontext.js +1 -0
  38. package/dist/merged-subcontext.js.map +1 -1
  39. package/dist/parquet-exporter.d.ts.map +1 -1
  40. package/dist/parquet-exporter.js +25 -23
  41. package/dist/parquet-exporter.js.map +1 -1
  42. package/dist/parquet-spatial-rows.d.ts +14 -0
  43. package/dist/parquet-spatial-rows.d.ts.map +1 -0
  44. package/dist/parquet-spatial-rows.js +57 -0
  45. package/dist/parquet-spatial-rows.js.map +1 -0
  46. package/dist/property-value-serialization.d.ts.map +1 -1
  47. package/dist/property-value-serialization.js +2 -1
  48. package/dist/property-value-serialization.js.map +1 -1
  49. package/dist/reference-collector.js +3 -0
  50. package/dist/reference-collector.js.map +1 -1
  51. package/dist/related-entities.d.ts.map +1 -1
  52. package/dist/related-entities.js +6 -0
  53. package/dist/related-entities.js.map +1 -1
  54. package/dist/remesh-context-roots.d.ts +36 -0
  55. package/dist/remesh-context-roots.d.ts.map +1 -0
  56. package/dist/remesh-context-roots.js +126 -0
  57. package/dist/remesh-context-roots.js.map +1 -0
  58. package/dist/step-collection.js +1 -1
  59. package/dist/step-collection.js.map +1 -1
  60. package/dist/step-export-types.d.ts +2 -0
  61. package/dist/step-export-types.d.ts.map +1 -1
  62. package/dist/step-omission-predicates.d.ts +8 -0
  63. package/dist/step-omission-predicates.d.ts.map +1 -1
  64. package/dist/step-omission-predicates.js +11 -1
  65. package/dist/step-omission-predicates.js.map +1 -1
  66. package/dist/step-overlay-entities.d.ts.map +1 -1
  67. package/dist/step-overlay-entities.js +23 -1
  68. package/dist/step-overlay-entities.js.map +1 -1
  69. package/dist/step-pass-builder.d.ts.map +1 -1
  70. package/dist/step-pass-builder.js +1 -0
  71. package/dist/step-pass-builder.js.map +1 -1
  72. package/dist/step-property-set-collection.d.ts +2 -0
  73. package/dist/step-property-set-collection.d.ts.map +1 -1
  74. package/dist/step-property-set-collection.js +42 -21
  75. package/dist/step-property-set-collection.js.map +1 -1
  76. package/dist/step-property-set-generators.d.ts +1 -1
  77. package/dist/step-property-set-generators.d.ts.map +1 -1
  78. package/dist/step-property-set-generators.js +19 -2
  79. package/dist/step-property-set-generators.js.map +1 -1
  80. package/dist/step-property-set-index.js +5 -2
  81. package/dist/step-property-set-index.js.map +1 -1
  82. package/dist/step-property-sets.d.ts.map +1 -1
  83. package/dist/step-property-sets.js +5 -2
  84. package/dist/step-property-sets.js.map +1 -1
  85. package/dist/step-pset-copy-on-write.d.ts +75 -0
  86. package/dist/step-pset-copy-on-write.d.ts.map +1 -0
  87. package/dist/step-pset-copy-on-write.js +146 -0
  88. package/dist/step-pset-copy-on-write.js.map +1 -0
  89. package/dist/step-source-iteration.d.ts.map +1 -1
  90. package/dist/step-source-iteration.js +7 -0
  91. package/dist/step-source-iteration.js.map +1 -1
  92. package/package.json +11 -10
  93. package/dist/merged-rel-aggregates.d.ts +0 -63
  94. package/dist/merged-rel-aggregates.d.ts.map +0 -1
  95. package/dist/merged-rel-aggregates.js +0 -122
  96. package/dist/merged-rel-aggregates.js.map +0 -1
@@ -0,0 +1,306 @@
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 { filterHiddenRefsFromRelationshipLine } from './reference-collector.js';
5
+ import { readStepSlots, replaceStepArgument } from './step-argument-parser.js';
6
+ /** Shorthand for a row: `inverse` on attribute `claimed`, related to attribute `partner`. */
7
+ const rule = (inverse, claimed, partner, extra = {}) => ({ inverse, claimed, partner, ...extra });
8
+ /**
9
+ * Rows every schema shares (#5923): containment, voids and fills, coverings,
10
+ * flow control, ports, services and structural activity. Each is `SET [0:1]`
11
+ * (or exactly one) on the claimed side in IFC2X3, IFC4 and IFC4X3.
12
+ */
13
+ const SHARED_ROWS = [
14
+ ['IFCRELCONTAINEDINSPATIALSTRUCTURE', [rule('ContainedInStructure', 4, 5)]],
15
+ ['IFCRELVOIDSELEMENT', [rule('VoidsElements', 5, 4)]],
16
+ ['IFCRELFILLSELEMENT', [rule('FillsVoids', 5, 4)]],
17
+ ['IFCRELPROJECTSELEMENT', [rule('ProjectsElements', 5, 4)]],
18
+ ['IFCRELCOVERSSPACES', [rule('CoversSpaces', 5, 4)]],
19
+ ['IFCRELFLOWCONTROLELEMENTS', [rule('AssignedToFlowElement', 4, 5), rule('HasControlElements', 5, 4)]],
20
+ ['IFCRELCONNECTSPORTS', [rule('ConnectedTo', 4, 5), rule('ConnectedFrom', 5, 4)]],
21
+ ['IFCRELSERVICESBUILDINGS', [rule('ServicesBuildings', 4, 5)]],
22
+ ];
23
+ /**
24
+ * Relationship type (uppercase) → its single-valued inverses, per OUTPUT
25
+ * schema, list-side rules first. Every row is checked against the EXPRESS
26
+ * schemas in `merged-inverse-claims.test.ts`, which also lists the one
27
+ * single-valued relationship inverse left out and why.
28
+ *
29
+ * IFC2X3: `IfcObjectDefinition.Decomposes : SET [0:1] OF IfcRelDecomposes`,
30
+ * and IfcRelAggregates and IfcRelNests are both IfcRelDecomposes, so one
31
+ * nesting and one aggregation parent together are already two (#5726).
32
+ * `IfcPropertySetDefinition.PropertyDefinitionOf : SET [0:1] OF
33
+ * IfcRelDefinesByProperties` (#5774). A type has one IfcRelDefinesByType
34
+ * (`ObjectTypeOf`), and `IfcObject.WR1` (a WHERE rule, not an inverse bound)
35
+ * allows an object one. IFC4 and later split `Nests : SET [0:1] OF IfcRelNests`
36
+ * off `Decomposes : SET [0:1] OF IfcRelAggregates`, name the typing inverses
37
+ * `IsTypedBy`/`Types`, and relax the property-set side to
38
+ * `DefinesOccurrence : SET [0:?]`, so a property set may be shared by several
39
+ * IfcRelDefinesByProperties there.
40
+ */
41
+ const PROPERTY_DEFINITION_OF = rule('PropertyDefinitionOf', 5, 4);
42
+ const IFC2X3_RULES = new Map([
43
+ ...SHARED_ROWS,
44
+ ['IFCRELAGGREGATES', [rule('Decomposes', 5, 4)]],
45
+ ['IFCRELNESTS', [rule('Decomposes', 5, 4)]],
46
+ ['IFCRELDEFINESBYPROPERTIES', [PROPERTY_DEFINITION_OF]],
47
+ // `IfcRelOverridesProperties.WR1`: `SIZEOF(RelatedObjects) = 1`.
48
+ ['IFCRELOVERRIDESPROPERTIES', [{ ...PROPERTY_DEFINITION_OF, onePartner: true }]],
49
+ ['IFCRELDEFINESBYTYPE', [rule('IsDefinedBy', 4, 5, { where: 'IfcObject.WR1' }), rule('ObjectTypeOf', 5, 4)]],
50
+ ['IFCRELCOVERSBLDGELEMENTS', [rule('Covers', 5, 4)]],
51
+ ['IFCRELCONNECTSPORTTOELEMENT', [rule('ContainedIn', 4, 5)]],
52
+ ['IFCRELCONNECTSSTRUCTURALACTIVITY', [rule('AssignedToStructuralItem', 5, 4)]],
53
+ ['IFCRELASSIGNSTOGROUP', [rule('IsGroupedBy', 6, 4)]],
54
+ ['IFCRELASSIGNSTASKS', [rule('ScheduleTimeControlAssigned', 7, 6)]],
55
+ ]);
56
+ const IFC4_ROWS = [
57
+ ...SHARED_ROWS,
58
+ ['IFCRELAGGREGATES', [rule('Decomposes', 5, 4)]],
59
+ ['IFCRELNESTS', [rule('Nests', 5, 4)]],
60
+ ['IFCRELDEFINESBYTYPE', [rule('IsTypedBy', 4, 5), rule('Types', 5, 4)]],
61
+ ['IFCRELDEFINESBYOBJECT', [rule('IsDeclaredBy', 4, 5)]],
62
+ ['IFCRELDECLARES', [rule('HasContext', 5, 4)]],
63
+ ['IFCRELCOVERSBLDGELEMENTS', [rule('CoversElements', 5, 4)]],
64
+ ['IFCRELCONNECTSPORTTOELEMENT', [rule('ContainedIn', 4, 5)]],
65
+ ['IFCRELCONNECTSSTRUCTURALACTIVITY', [rule('AssignedToStructuralItem', 5, 4)]],
66
+ ];
67
+ const IFC4_RULES = new Map(IFC4_ROWS);
68
+ const IFC4X3_RULES = new Map([...IFC4_ROWS, ['IFCRELADHERESTOELEMENT', [rule('AdheresToElement', 5, 4)]]]);
69
+ /** The rule table of an output schema (IFC5 falls back to IFC4X3's). */
70
+ export function inverseRules(outputSchema) {
71
+ return outputSchema === 'IFC2X3' ? IFC2X3_RULES : outputSchema === 'IFC4' ? IFC4_RULES : IFC4X3_RULES;
72
+ }
73
+ /**
74
+ * Which final ids already fill each single-valued inverse in the merge output.
75
+ * One instance per merge, grown model by model in merge order.
76
+ */
77
+ export class InverseClaims {
78
+ /** Relationship type (uppercase) → the rules it is claimed under. */
79
+ rules;
80
+ /** Claimed through a list side (RelatedObjects, RelatedElements): the ids alone. */
81
+ members = new Map();
82
+ /** Claimed through a single side (RelatingPropertyDefinition): the rel that owns each. */
83
+ owners = new Map();
84
+ /** Final rel id → partner ids a later, folded rel adds to its partner list. */
85
+ folds = new Map();
86
+ /** Later rels withheld with partners no owner could take: final rel id → how many. */
87
+ unfolded = new Map();
88
+ /** `only` narrows the claimed relationship types (the #5725 drop planner's view). */
89
+ constructor(outputSchema, only = () => true) {
90
+ this.rules = new Map([...inverseRules(outputSchema)].filter(([relType]) => only(relType)));
91
+ }
92
+ membersOf(inverse) {
93
+ let ids = this.members.get(inverse);
94
+ if (ids === undefined)
95
+ this.members.set(inverse, (ids = new Set()));
96
+ return ids;
97
+ }
98
+ ownersOf(inverse) {
99
+ let owners = this.owners.get(inverse);
100
+ if (owners === undefined)
101
+ this.owners.set(inverse, (owners = new Map()));
102
+ return owners;
103
+ }
104
+ /** Move `ids` onto `owner`'s partner list, in place of a rel that would have been a second one. */
105
+ fold(owner, ids) {
106
+ for (const id of ids)
107
+ owner.partners.add(id);
108
+ const fold = this.folds.get(owner.rel);
109
+ if (fold === undefined)
110
+ this.folds.set(owner.rel, { partnerIndex: owner.partnerIndex, ids: [...ids] });
111
+ else
112
+ fold.ids.push(...ids);
113
+ }
114
+ }
115
+ /**
116
+ * Keep one written rel per entity and single-valued inverse across a merge
117
+ * (#5471, #5726, #5774).
118
+ *
119
+ * Called once per model in merge order, after all of that model's unification
120
+ * and container drops. `claims` holds what the output already says: every rel
121
+ * the model will write records its claims. A rel that will not be written
122
+ * (skipped, outside the visibility closure, or with a hidden or dropped
123
+ * single-valued side) claims nothing, and neither does a member narrowed out
124
+ * of it, so a later model's rel stays in place for an entity whose primary rel
125
+ * is not in the output.
126
+ *
127
+ * With `dedupe`, a later rel naming an already-claimed entity is resolved by
128
+ * the claimed side's shape:
129
+ * - a LIST side (an object's parent, #5471): the claimed members are stripped
130
+ * into `relMemberStrip` for {@link applyRelMemberStrip}, and a rel left with
131
+ * none is skipped. The first parent wins. A unified member with no parent yet
132
+ * is kept, since that rel is then its only parentage statement (#3550).
133
+ * - a SINGLE side (a property set's one definer, #5774): the rel is skipped.
134
+ * If its partner side is a list naming objects the owning rel does not, those
135
+ * are folded into the owning rel ({@link InverseClaims.fold}, written by
136
+ * {@link applyInverseFolds}), so the entity keeps one rel and loses no member.
137
+ * Where no fold is possible (a single partner, an owner of another rel type,
138
+ * or a partner list a WHERE rule bounds to one) the first rel wins, and
139
+ * {@link applyInverseFolds} reports the objects that lost the relationship.
140
+ */
141
+ export function claimInverses(input, claims, findEntitiesByType, extractStepAttribute) {
142
+ const { dataStore, sharedRemap, idOffset, skipEntityIds, relMemberStrip, isEmitted, isIncluded, dedupe } = input;
143
+ const finalId = (ref) => sharedRemap.get(ref) ?? ref + idOffset;
144
+ for (const [relType, rules] of claims.rules) {
145
+ const indices = [...new Set(rules.flatMap(rule => [rule.claimed, rule.partner]))];
146
+ for (const relId of findEntitiesByType(dataStore, relType)) {
147
+ if (skipEntityIds.has(relId) || !isIncluded(relId))
148
+ continue;
149
+ const sides = new Map();
150
+ let written = true;
151
+ for (const index of indices) {
152
+ const side = readSide(extractStepAttribute(relId, dataStore, index), isEmitted);
153
+ if (side === 'withheld')
154
+ written = false;
155
+ else if (side !== null)
156
+ sides.set(index, side);
157
+ }
158
+ if (!written)
159
+ continue;
160
+ const strip = new Set();
161
+ const live = (index) => (sides.get(index)?.refs ?? []).filter(ref => !strip.has(ref));
162
+ let skip = false;
163
+ let fold;
164
+ const newOwners = [];
165
+ // List sides first: what they strip is no longer a partner a single side can fold.
166
+ for (const rule of [...rules].sort((a, b) => Number(!sides.get(a.claimed)?.list) - Number(!sides.get(b.claimed)?.list))) {
167
+ const claimed = sides.get(rule.claimed);
168
+ if (claimed === undefined)
169
+ continue;
170
+ if (claimed.list) {
171
+ const members = live(rule.claimed);
172
+ const claimedIds = claims.membersOf(rule.inverse);
173
+ const redundant = dedupe ? members.filter(ref => claimedIds.has(finalId(ref))) : [];
174
+ for (const ref of redundant)
175
+ strip.add(ref);
176
+ if (redundant.length > 0 && redundant.length === members.length)
177
+ skip = true;
178
+ }
179
+ else {
180
+ const owners = claims.ownersOf(rule.inverse);
181
+ const owner = owners.get(finalId(claimed.refs[0]));
182
+ if (owner === undefined)
183
+ newOwners.push([owners, claimed.refs[0], rule]);
184
+ else if (dedupe) {
185
+ skip = true;
186
+ const fresh = [...new Set(live(rule.partner).map(finalId))].filter(id => !owner.partners.has(id));
187
+ const foldable = sides.get(rule.partner)?.list && owner.relType === relType && !rule.onePartner;
188
+ if (fresh.length > 0 && foldable)
189
+ fold = { owner, ids: fresh };
190
+ else if (fresh.length > 0)
191
+ claims.unfolded.set(finalId(relId), fresh.length);
192
+ }
193
+ }
194
+ if (skip)
195
+ break;
196
+ }
197
+ if (fold !== undefined)
198
+ claims.fold(fold.owner, fold.ids);
199
+ if (skip && fold === undefined) {
200
+ skipEntityIds.add(relId);
201
+ continue;
202
+ }
203
+ // Kept, or folded into its owner: either way its surviving members are now written.
204
+ for (const rule of rules) {
205
+ if (sides.get(rule.claimed)?.list)
206
+ for (const ref of live(rule.claimed))
207
+ claims.membersOf(rule.inverse).add(finalId(ref));
208
+ }
209
+ if (skip) {
210
+ skipEntityIds.add(relId);
211
+ continue;
212
+ }
213
+ if (strip.size > 0)
214
+ relMemberStrip.set(relId, strip);
215
+ for (const [owners, ref, rule] of newOwners) {
216
+ owners.set(finalId(ref), { rel: finalId(relId), relType, partnerIndex: rule.partner, partners: new Set(live(rule.partner).map(finalId)) });
217
+ }
218
+ }
219
+ }
220
+ }
221
+ /**
222
+ * One rel attribute as the output will carry it: `null` when it names nothing
223
+ * (`$`, a value), `'withheld'` when the line is not written because of it (a
224
+ * single ref, or every member of a list, that is not emitted).
225
+ */
226
+ function readSide(attr, isEmitted) {
227
+ if (!attr)
228
+ return null;
229
+ const trimmed = attr.trim();
230
+ const list = trimmed.startsWith('(');
231
+ // A single side is claimable only as a bare ref: an IFC4 IfcPropertySetDefinitionSet(...) is not one entity.
232
+ if (!list && !/^#\d+$/.test(trimmed))
233
+ return null;
234
+ const all = listRefs(trimmed);
235
+ if (all.length === 0)
236
+ return null;
237
+ const refs = all.filter(isEmitted);
238
+ return refs.length === 0 ? 'withheld' : { list, refs };
239
+ }
240
+ /** The `#id`s in one STEP attribute, in order; `[]` for a missing one. */
241
+ function listRefs(attr) {
242
+ const refs = [];
243
+ const refRegex = /#(\d+)/g;
244
+ let match;
245
+ while ((match = refRegex.exec(attr)) !== null)
246
+ refs.push(parseInt(match[1], 10));
247
+ return refs;
248
+ }
249
+ /**
250
+ * Render-time counterpart of {@link claimInverses}: drop the claimed members
251
+ * of a partially redundant rel that already fill that inverse in the output.
252
+ * Reuses the same list/scalar-aware ref filter the `visibleOnly`/deletion
253
+ * dangling-ref path uses. Must run in LOCAL id space, before any id
254
+ * offset/remap — `localId` and the ids inside `relMemberStrip` are both local
255
+ * to the model being rendered.
256
+ *
257
+ * Returns `entityText` unchanged when `localId` has no strip entry, and
258
+ * `null` when the filter would withhold the whole line — a strip set built
259
+ * by {@link claimInverses} is a strict subset of the claimed list, so for
260
+ * well-formed input the filter only narrows, but a degenerate file (a
261
+ * stripped member id that also appears as a single-valued ref, e.g.
262
+ * self-aggregation) can null the line. The caller must withhold it, like
263
+ * every other user of the filter: every edge the line declared is already
264
+ * declared by the primary model, and emitting the unfiltered bytes instead
265
+ * would reintroduce the duplicate membership this module exists to remove.
266
+ */
267
+ export function applyRelMemberStrip(entityText, localId, relMemberStrip) {
268
+ const toStrip = relMemberStrip.get(localId);
269
+ if (toStrip === undefined)
270
+ return entityText;
271
+ return filterHiddenRefsFromRelationshipLine(entityText, id => toStrip.has(id));
272
+ }
273
+ /**
274
+ * Write the folds of {@link claimInverses} into the rendered output: each
275
+ * owning rel's partner list gains the members of the later rels folded into
276
+ * it. Runs once, on the final lines (final id space), after every model is
277
+ * rendered, since an owner may be written before the rel that folds into it.
278
+ * Returns a warning per later rel whose objects lost the relationship: one
279
+ * no owner could take (a different rel type, or a partner list bounded to
280
+ * one), and one folded into an owner that did not reach the output as a line
281
+ * with a partner list.
282
+ */
283
+ export function applyInverseFolds(lines, claims) {
284
+ const lost = [...claims.unfolded].map(([rel, count]) => `A later model's relationship (merged id #${rel}) was not written: an earlier model already wrote one for the same merged entity, and it could not take the ${count} other object(s) the later one named, so those objects lost that relationship.`);
285
+ if (claims.folds.size === 0)
286
+ return lost;
287
+ const pending = new Map(claims.folds);
288
+ for (let i = 0; i < lines.length && pending.size > 0; i++) {
289
+ const rel = Number(/^#(\d+)=/.exec(lines[i])?.[1]);
290
+ const fold = pending.get(rel);
291
+ if (fold === undefined)
292
+ continue;
293
+ const list = readStepSlots(lines[i])?.slots[fold.partnerIndex]?.trim();
294
+ if (list === undefined || !list.startsWith('(') || !list.endsWith(')'))
295
+ continue;
296
+ const inner = list.slice(1, -1).trim();
297
+ const added = fold.ids.map(ref => `#${ref}`).join(',');
298
+ const next = replaceStepArgument(lines[i], fold.partnerIndex, `(${inner === '' ? added : `${inner},${added}`})`);
299
+ if (next === null)
300
+ continue;
301
+ lines[i] = next;
302
+ pending.delete(rel);
303
+ }
304
+ return [...lost, ...[...pending].map(([rel, { ids }]) => `Could not add ${ids.length} object(s) to relationship #${rel}, which a later model's duplicate relationship was merged into; those objects lost that relationship.`)];
305
+ }
306
+ //# sourceMappingURL=merged-inverse-claims.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merged-inverse-claims.js","sourceRoot":"","sources":["../src/merged-inverse-claims.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAmB/D,OAAO,EAAE,oCA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EAAE,EAAE,CACtD,iBAAiB,GAAG,CAAC,MAAM,+BAA+B,GAAG,uGAAuG,CAAC,CAAC,CAAC;AAC3K,CAAC"}
@@ -0,0 +1,32 @@
1
+ /** One model as {@link PlannerGuids.plan} sees it, in merge order. */
2
+ export interface PlannerGuidModel {
3
+ /** Rooted entities in emit order: local id → GlobalId (`planModel`'s `localGuids`, `readLocalGuids`). */
4
+ guids: ReadonlyMap<number, string>;
5
+ /** Uppercase STEP type of a local id. */
6
+ typeOf: (localId: number) => string;
7
+ isFirst: boolean;
8
+ compatible: boolean;
9
+ offset: number;
10
+ /** Unit scale the model's entities are recorded with (`ModelMode.effectiveScale`). */
11
+ effectiveScale: number;
12
+ /** Written with its source GlobalId unchanged: false when exported across schemas. */
13
+ keepsGuids: boolean;
14
+ /** Left out before GlobalId reconciliation: the unified IfcProject, a spatially unified container. */
15
+ unifiedEarlier: (localId: number) => boolean;
16
+ /** In the output at all (visibility closure). */
17
+ isIncluded: (localId: number) => boolean;
18
+ }
19
+ /** The emit pass's GlobalId records, replayed conservatively across one merge. */
20
+ export declare class PlannerGuids {
21
+ private readonly isPrimaryUnit;
22
+ private readonly isContainer;
23
+ private readonly records;
24
+ constructor(isPrimaryUnit: (scale: number) => boolean, isContainer: (typeUpper: string) => boolean);
25
+ /**
26
+ * `planModel`'s GlobalId step for one model, then the records its writes
27
+ * leave. Returns local id → final id for the entities the emit pass is sure
28
+ * to unify by GlobalId. Call once per model, in merge order.
29
+ */
30
+ plan(model: PlannerGuidModel): Map<number, number>;
31
+ }
32
+ //# sourceMappingURL=merged-planner-guids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merged-planner-guids.d.ts","sourceRoot":"","sources":["../src/merged-planner-guids.ts"],"names":[],"mappings":"AA2CA,sEAAsE;AACtE,MAAM,WAAW,gBAAgB;IAC/B,yGAAyG;IACzG,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnC,yCAAyC;IACzC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,cAAc,EAAE,MAAM,CAAC;IACvB,sFAAsF;IACtF,UAAU,EAAE,OAAO,CAAC;IACpB,sGAAsG;IACtG,cAAc,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;IAC7C,iDAAiD;IACjD,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;CAC1C;AAED,kFAAkF;AAClF,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAJ9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAiC;gBAGtC,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,EACzC,WAAW,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO;IAG9D;;;;OAIG;IACH,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;CAsBnD"}
@@ -0,0 +1,79 @@
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 GlobalId half of the `dropEmptyContainers` planner's claim pass (#5937).
6
+ *
7
+ * The planner has to know, before anything is written, which aggregation edges
8
+ * the emit pass's one-parent claim pass (#5471, #5725) will withhold. That
9
+ * pass resolves ids through GlobalId reconciliation (`planModel`): a later
10
+ * model's entity that repeats a GlobalId an earlier model WROTE is unified
11
+ * onto it. The planner used to resolve through spatial unification only, so an
12
+ * edge withheld because its child unified by GlobalId still counted, and its
13
+ * container was written empty.
14
+ *
15
+ * {@link PlannerGuids} replays that reconciliation from what the planner can
16
+ * know up front. It must never unify two entities the emit pass keeps apart:
17
+ * then the planner would withhold an edge the emit pass writes, and could drop
18
+ * the parent of a full container (the WR41 invariant). So wherever the emit
19
+ * pass's verdict depends on something the planner cannot see, the GlobalId is
20
+ * marked UNKNOWN and nothing resolves through it afterwards. Missing a
21
+ * unification only keeps a container, which is #3643's behaviour before #5725.
22
+ * UNKNOWN covers:
23
+ * - a model exported across schemas: conversion may replace an entity with an
24
+ * IFCPROXY that carries a fresh GlobalId, so the source one is not recorded;
25
+ * - a relationship: the claim pass itself may withhold it;
26
+ * - an entity whose own GlobalId was already UNKNOWN.
27
+ * A GlobalId one model writes twice is recorded as the emit pass records it:
28
+ * the last copy in index order.
29
+ *
30
+ * Containers are the one thing written or not by the plan being made. A
31
+ * container unifies here only onto a container (and anything else only onto
32
+ * anything else), and only where `canonicalContainers` in
33
+ * `merged-empty-containers.ts` puts both on one node, so a container this pass
34
+ * treats as written but the plan drops takes every copy it was unified with
35
+ * along: the edges to them are withheld by the drop either way.
36
+ */
37
+ import { isRelationshipType } from './merged-guid.js';
38
+ /** The emit pass's GlobalId records, replayed conservatively across one merge. */
39
+ export class PlannerGuids {
40
+ isPrimaryUnit;
41
+ isContainer;
42
+ records = new Map();
43
+ constructor(isPrimaryUnit, isContainer) {
44
+ this.isPrimaryUnit = isPrimaryUnit;
45
+ this.isContainer = isContainer;
46
+ }
47
+ /**
48
+ * `planModel`'s GlobalId step for one model, then the records its writes
49
+ * leave. Returns local id → final id for the entities the emit pass is sure
50
+ * to unify by GlobalId. Call once per model, in merge order.
51
+ */
52
+ plan(model) {
53
+ const unified = new Map();
54
+ const settled = new Set();
55
+ for (const [id, guid] of model.guids) {
56
+ if (model.unifiedEarlier(id) || !this.records.has(guid))
57
+ continue;
58
+ const type = model.typeOf(id);
59
+ // An earlier record exists: the emit pass unifies or re-stamps, and never records this GlobalId again.
60
+ settled.add(id);
61
+ const prior = this.records.get(guid);
62
+ const canUnify = !model.isFirst && model.compatible && prior !== null && this.isPrimaryUnit(prior.scale) && !isRelationshipType(type);
63
+ if (canUnify && prior.container === this.isContainer(type))
64
+ unified.set(id, prior.finalId);
65
+ }
66
+ const written = new Map();
67
+ for (const [id, guid] of model.guids) {
68
+ if (settled.has(id) || model.unifiedEarlier(id) || !model.isIncluded(id))
69
+ continue;
70
+ const type = model.typeOf(id);
71
+ const known = model.keepsGuids && !isRelationshipType(type);
72
+ written.set(guid, known ? { finalId: id + model.offset, scale: model.effectiveScale, container: this.isContainer(type) } : null);
73
+ }
74
+ for (const [guid, record] of written)
75
+ this.records.set(guid, record);
76
+ return unified;
77
+ }
78
+ }
79
+ //# sourceMappingURL=merged-planner-guids.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merged-planner-guids.js","sourceRoot":"","sources":["../src/merged-planner-guids.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAwBtD,kFAAkF;AAClF,MAAM,OAAO,YAAY;IAIJ;IACA;IAJF,OAAO,GAAG,IAAI,GAAG,EAAsB,CAAC;IAEzD,YACmB,aAAyC,EACzC,WAA2C;QAD3C,kBAAa,GAAb,aAAa,CAA4B;QACzC,gBAAW,GAAX,WAAW,CAAgC;IAC3D,CAAC;IAEJ;;;;OAIG;IACH,IAAI,CAAC,KAAuB;QAC1B,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC1C,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;QAClC,KAAK,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YACrC,IAAI,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;gBAAE,SAAS;YAClE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,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;QACD,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,OAAO;YAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACrE,OAAO,OAAO,CAAC;IACjB,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"merged-subcontext.d.ts","sourceRoot":"","sources":["../src/merged-subcontext.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAgFrD,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAQ5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,0BAA0B,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACzD,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GACzB,IAAI,CAYN"}
1
+ {"version":3,"file":"merged-subcontext.d.ts","sourceRoot":"","sources":["../src/merged-subcontext.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiFrD,+EAA+E;AAC/E,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAQ5G;AAED;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,YAAY,EACvB,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,0BAA0B,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EACzD,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChC,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GACzB,IAAI,CAYN"}
@@ -21,6 +21,7 @@ function decodeEntity(dataStore, expressId) {
21
21
  const source = dataStore.source;
22
22
  if (!source)
23
23
  return null;
24
+ // @raw-entity-enumeration-ok decode one source subcontext's STEP byte span during an overlay-free merge
24
25
  const ref = dataStore.entityIndex.byId.get(expressId);
25
26
  if (!ref)
26
27
  return null;
@@ -1 +1 @@
1
- {"version":3,"file":"merged-subcontext.js","sourceRoot":"","sources":["../src/merged-subcontext.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA+B/D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AAEvE;;;;;;GAMG;AACH,MAAM,SAAS,GAAG,IAAI,MAAM,CAAC,sBAAsB,WAAW,8BAA8B,CAAC,CAAC;AAE9F,2FAA2F;AAC3F,MAAM,uBAAuB,GAAG,CAAC,CAAC;AAClC,oFAAoF;AACpF,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAC3B,+FAA+F;AAC/F,MAAM,6BAA6B,GAAG,CAAC,CAAC;AAExC,SAAS,YAAY,CAAC,SAAuB,EAAE,SAAiB;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;IAChC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,MAAM,GAAG,GAAG,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;IACtD,IAAI,CAAC,GAAG;QAAE,OAAO,IAAI,CAAC;IACtB,OAAO,aAAa,CAAC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B,CAAC"}
@@ -3,6 +3,7 @@
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
4
  import { IfcTypeEnum, EntityFlags, IFC_ENTITY_NAMES, exactTypeName } from '@ifc-lite/data';
5
5
  import { getEffectiveEntityIndex } from './effective-index.js';
6
+ import { parquetSpatialRows } from './parquet-spatial-rows.js';
6
7
  import { columnsToParquet } from './columns-to-parquet.js';
7
8
  import { PARQUET_UINT32_COLUMNS } from './parquet-uint32-columns.js';
8
9
  import { writePropertiesOnDemand, writeQuantitiesOnDemand } from './parquet-exporter-ondemand.js';
@@ -60,7 +61,8 @@ export class ParquetExporter {
60
61
  let propertyCount = 0;
61
62
  files.set('Properties.parquet', await this.writeProperties(count => { propertyCount = count; }));
62
63
  files.set('Quantities.parquet', await this.writeQuantities());
63
- const relationshipRows = parquetRelationshipRows(this.store, this.mutationView, this.getEffective());
64
+ const effective = this.getEffective();
65
+ const relationshipRows = parquetRelationshipRows(this.store, this.mutationView, effective);
64
66
  files.set('Relationships.parquet', await this.toParquet(relationshipRows));
65
67
  files.set('Strings.parquet', await this.writeStrings());
66
68
  // Geometry files (if available)
@@ -70,8 +72,8 @@ export class ParquetExporter {
70
72
  files.set('Meshes.parquet', await this.writeMeshes());
71
73
  }
72
74
  // Spatial hierarchy
73
- if (this.store.spatialHierarchy) {
74
- files.set('SpatialHierarchy.parquet', await this.writeSpatialHierarchy());
75
+ if (this.store.spatialHierarchy || effective) {
76
+ files.set('SpatialHierarchy.parquet', await this.writeSpatialHierarchy(relationshipRows, effective));
75
77
  }
76
78
  // Metadata
77
79
  files.set('Metadata.json', this.writeMetadata(new Set(relationshipRows.RelId).size, propertyCount));
@@ -345,13 +347,22 @@ export class ParquetExporter {
345
347
  IndexCount: indexCounts,
346
348
  });
347
349
  }
348
- async writeSpatialHierarchy() {
350
+ async writeSpatialHierarchy(relationships, effective) {
351
+ if (effective) {
352
+ const rows = parquetSpatialRows(relationships, effective);
353
+ return this.toParquet({
354
+ ElementId: rows.map(r => r.ElementId),
355
+ StoreyId: rows.map(r => r.StoreyId),
356
+ BuildingId: rows.map(r => r.BuildingId),
357
+ SiteId: rows.map(r => r.SiteId),
358
+ SpaceId: rows.map(r => r.SpaceId),
359
+ });
360
+ }
349
361
  if (!this.store.spatialHierarchy) {
350
362
  throw new Error('Spatial hierarchy not available');
351
363
  }
352
364
  const rows = [];
353
365
  const { spatialHierarchy } = this.store;
354
- const effective = this.getEffective();
355
366
  // Build lookup maps for fast parent access
356
367
  const storeyToBuilding = new Map();
357
368
  const buildingToSite = new Map();
@@ -376,24 +387,14 @@ export class ParquetExporter {
376
387
  }
377
388
  };
378
389
  traverse(spatialHierarchy.project);
390
+ // @raw-entity-enumeration-ok source-only branch: a supplied mutationView takes the effective relationship-row path above
379
391
  for (const [storeyId, elementIds] of spatialHierarchy.byStorey) {
380
392
  const buildingId = storeyToBuilding.get(storeyId) ?? -1;
381
393
  const siteId = buildingId >= 0 ? (buildingToSite.get(buildingId) ?? -1) : -1;
382
394
  for (const elementId of elementIds) {
383
- // A tombstoned element is not a row in Entities.parquet either
384
- // (see writeEntities) — leaving it here would point
385
- // SpatialHierarchy.parquet at an id no other table has.
386
- //
387
- // Deletion-only, and only for the element itself: a deleted
388
- // STOREY/BUILDING/SITE still surfaces as StoreyId/BuildingId/
389
- // SiteId on a surviving element's row (spatialHierarchy is a
390
- // source-parse snapshot with no overlay-aware re-parenting —
391
- // the same class of problem Ifc5Exporter's re-parenting pass
392
- // solves, #2047 — not addressed here).
393
- if (effective?.isDeleted(elementId))
394
- continue;
395
395
  // Check if element is in a space by iterating bySpace
396
396
  let spaceId = -1;
397
+ // @raw-entity-enumeration-ok source-only branch: live sessions return before this parsed hierarchy walk
397
398
  for (const [sid, spaceElementIds] of spatialHierarchy.bySpace) {
398
399
  if (spaceElementIds.includes(elementId)) {
399
400
  spaceId = sid;
@@ -446,13 +447,14 @@ export class ParquetExporter {
446
447
  async toParquet(columns, floatColumns) {
447
448
  return columnsToParquet(columns, floatColumns, PARQUET_UINT32_COLUMNS);
448
449
  }
450
+ // fflate, not JSZip: JSZip writes "version needed to extract" 1.0 on
451
+ // DEFLATE entries, where the ZIP APPNOTE requires 2.0 (#3612).
449
452
  async createZipArchive(files) {
450
- const JSZip = (await import('jszip')).default;
451
- const zip = new JSZip();
452
- for (const [name, data] of files) {
453
- zip.file(name, data);
454
- }
455
- return zip.generateAsync({ type: 'uint8array', compression: 'DEFLATE' });
453
+ const { zipSync } = await import('fflate');
454
+ // Entry names are file names with an extension, never integer-like
455
+ // keys, so the object keeps the Map's insertion order. zipSync rather
456
+ // than async `zip`, which starts uncapped workers (see bcf writer-archive).
457
+ return zipSync(Object.fromEntries(files), { level: 6 });
456
458
  }
457
459
  }
458
460
  // Helper functions