@ifc-lite/export 4.8.0 → 4.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/affected-set.d.ts +9 -0
- package/dist/affected-set.d.ts.map +1 -0
- package/dist/affected-set.js +72 -0
- package/dist/affected-set.js.map +1 -0
- package/dist/declared-property-type.d.ts +7 -0
- package/dist/declared-property-type.d.ts.map +1 -1
- package/dist/declared-property-type.js +26 -0
- package/dist/declared-property-type.js.map +1 -1
- package/dist/edit-ownership.d.ts +7 -0
- package/dist/edit-ownership.d.ts.map +1 -0
- package/dist/edit-ownership.js +95 -0
- package/dist/edit-ownership.js.map +1 -0
- package/dist/entity-subgraph.d.ts +11 -3
- package/dist/entity-subgraph.d.ts.map +1 -1
- package/dist/entity-subgraph.js +54 -11
- package/dist/entity-subgraph.js.map +1 -1
- package/dist/grid-placement-dependents.d.ts +4 -0
- package/dist/grid-placement-dependents.d.ts.map +1 -0
- package/dist/grid-placement-dependents.js +71 -0
- package/dist/grid-placement-dependents.js.map +1 -0
- package/dist/grid-reference-context.d.ts +6 -0
- package/dist/grid-reference-context.d.ts.map +1 -0
- package/dist/grid-reference-context.js +68 -0
- package/dist/grid-reference-context.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/step-coordinate-options.d.ts +35 -0
- package/dist/step-coordinate-options.d.ts.map +1 -0
- package/dist/step-coordinate-options.js +5 -0
- package/dist/step-coordinate-options.js.map +1 -0
- package/dist/step-export-progress.d.ts +4 -0
- package/dist/step-export-progress.d.ts.map +1 -0
- package/dist/step-export-progress.js +9 -0
- package/dist/step-export-progress.js.map +1 -0
- package/dist/step-export-types.d.ts +7 -7
- package/dist/step-export-types.d.ts.map +1 -1
- package/dist/step-export-types.js.map +1 -1
- package/dist/step-exporter.d.ts +1 -0
- package/dist/step-exporter.d.ts.map +1 -1
- package/dist/step-exporter.js +31 -18
- package/dist/step-exporter.js.map +1 -1
- package/dist/step-map-transform.d.ts +7 -0
- package/dist/step-map-transform.d.ts.map +1 -0
- package/dist/step-map-transform.js +89 -0
- package/dist/step-map-transform.js.map +1 -0
- package/dist/step-map-unit-normalization.d.ts +5 -0
- package/dist/step-map-unit-normalization.d.ts.map +1 -0
- package/dist/step-map-unit-normalization.js +194 -0
- package/dist/step-map-unit-normalization.js.map +1 -0
- package/dist/step-map-unit.d.ts +3 -78
- package/dist/step-map-unit.d.ts.map +1 -1
- package/dist/step-map-unit.js +33 -195
- package/dist/step-map-unit.js.map +1 -1
- package/dist/step-native-set-record.d.ts +6 -0
- package/dist/step-native-set-record.d.ts.map +1 -0
- package/dist/step-native-set-record.js +30 -0
- package/dist/step-native-set-record.js.map +1 -0
- package/dist/step-pass-builder.d.ts.map +1 -1
- package/dist/step-pass-builder.js +2 -0
- package/dist/step-pass-builder.js.map +1 -1
- package/dist/step-property-set-collection.d.ts.map +1 -1
- package/dist/step-property-set-collection.js +24 -8
- package/dist/step-property-set-collection.js.map +1 -1
- package/dist/step-property-set-generators.d.ts +8 -2
- package/dist/step-property-set-generators.d.ts.map +1 -1
- package/dist/step-property-set-generators.js +26 -10
- package/dist/step-property-set-generators.js.map +1 -1
- package/dist/step-property-set-readers.d.ts.map +1 -1
- package/dist/step-property-set-readers.js +15 -0
- package/dist/step-property-set-readers.js.map +1 -1
- package/dist/step-property-sets.d.ts +3 -4
- package/dist/step-property-sets.d.ts.map +1 -1
- package/dist/step-property-sets.js +61 -19
- package/dist/step-property-sets.js.map +1 -1
- package/dist/step-type-owned-quantities.d.ts +34 -0
- package/dist/step-type-owned-quantities.d.ts.map +1 -0
- package/dist/step-type-owned-quantities.js +222 -0
- package/dist/step-type-owned-quantities.js.map +1 -0
- package/dist/step-vertical-datum-normalization.d.ts +17 -0
- package/dist/step-vertical-datum-normalization.d.ts.map +1 -0
- package/dist/step-vertical-datum-normalization.js +52 -0
- package/dist/step-vertical-datum-normalization.js.map +1 -0
- package/package.json +9 -8
|
@@ -0,0 +1,222 @@
|
|
|
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 { extractTypeEntityOwnQuantities, getInheritanceChainAcrossSchemas, getAttributeNamesForSchema, getAttributeTypeForSchema, measureUnit } from '@ifc-lite/parser';
|
|
5
|
+
import { generateGlobalId, getTypeOwnedHasPropertySetIds, findUnitId } from './step-property-set-readers.js';
|
|
6
|
+
import { readStepSlots, replaceStepArgument } from './step-argument-parser.js';
|
|
7
|
+
import { quantityTypeToIfcType, toStepReal } from './step-serialization.js';
|
|
8
|
+
import { generateQuantityAtom } from './step-property-set-generators.js';
|
|
9
|
+
import { nativeSetLine, decodeNativeSetLine } from './step-native-set-record.js';
|
|
10
|
+
/** Use canonical full-base claims; only unchanged relationship-owned siblings can pass through. */
|
|
11
|
+
export function projectTypeQuantityEdits(pass, ctx, entityId, qsetNames, relationships) {
|
|
12
|
+
const mutationView = ctx.mutationView;
|
|
13
|
+
const ownIds = new Set(getTypeOwnedHasPropertySetIds(ctx, entityId, pass.effective));
|
|
14
|
+
const ownBase = extractTypeEntityOwnQuantities(ctx.dataStore, entityId, mutationView).map(set => ({
|
|
15
|
+
name: set.name, globalId: set.globalId, quantities: set.quantities.map(q => ({ name: q.name, type: q.type, value: q.value, unit: q.explicitUnit })),
|
|
16
|
+
}));
|
|
17
|
+
const sourceBase = extractTypeEntityOwnQuantities(ctx.dataStore, entityId);
|
|
18
|
+
const relatedBase = [];
|
|
19
|
+
const nativeEditIds = new Set([...(mutationView.getAttributeOverrideEntityIds?.() ?? []),
|
|
20
|
+
...pass.modifiedAttributes.keys(), ...(mutationView.getTombstones?.() ?? [])]);
|
|
21
|
+
for (const { relId, psetId } of relationships) {
|
|
22
|
+
if (ownIds.has(psetId))
|
|
23
|
+
continue;
|
|
24
|
+
const currentQuantitySet = !pass.effective.isDeleted(psetId) && pass.effective.typeOf(psetId) === 'IFCELEMENTQUANTITY';
|
|
25
|
+
// @raw-entity-enumeration-ok original source type detects a related quantity set retyped/deleted in the effective view, so the unsupported edit cannot bypass refusal
|
|
26
|
+
if (!currentQuantitySet && ctx.dataStore.entityIndex.byId.get(psetId)?.type !== 'IFCELEMENTQUANTITY')
|
|
27
|
+
continue;
|
|
28
|
+
const native = decodeNativeSetLine(nativeSetLine(ctx, psetId, pass.sourceSchema, pass.modifiedAttributes.get(psetId), pass.warnings), psetId);
|
|
29
|
+
const name = native.attributes[2];
|
|
30
|
+
if (typeof name !== 'string' || !qsetNames.has(name))
|
|
31
|
+
continue;
|
|
32
|
+
const activeEdit = mutationView.getQuantityMutation === undefined
|
|
33
|
+
|| mutationView.isQuantitySetDeleted?.(entityId, name)
|
|
34
|
+
|| mutationView.getMutations().some(row => row.entityId === entityId && row.psetName === name
|
|
35
|
+
&& typeof row.propName === 'string' && mutationView.getQuantityMutation(entityId, name, row.propName));
|
|
36
|
+
if (!activeEdit)
|
|
37
|
+
continue;
|
|
38
|
+
const source = typeof native.attributes[0] === 'string'
|
|
39
|
+
? sourceBase.find(set => set.globalId === native.attributes[0]) : undefined;
|
|
40
|
+
const nativeMembers = native.attributes[5];
|
|
41
|
+
if (!source || !source.globalId || source.name !== name
|
|
42
|
+
|| sourceBase.filter(set => set.globalId === source.globalId).length !== 1
|
|
43
|
+
|| ownBase.some(set => set.globalId === source.globalId)
|
|
44
|
+
|| !currentQuantitySet || nativeEditIds.has(relId) || nativeEditIds.has(psetId) || !Array.isArray(nativeMembers)
|
|
45
|
+
|| nativeMembers.some(id => typeof id !== 'number' || pass.effective.isDeleted(id) || nativeEditIds.has(id))) {
|
|
46
|
+
throw new Error('Relationship-attached Type quantity edits are unsupported');
|
|
47
|
+
}
|
|
48
|
+
// @raw-entity-enumeration-ok original unit type complements the effective type when an active edit retypes a source unit away from its schema family; both bases trigger refusal
|
|
49
|
+
if (source.quantities.some(quantity => quantity.explicitUnit !== undefined)
|
|
50
|
+
&& [...nativeEditIds].some(id => [
|
|
51
|
+
pass.effective.typeOf(id), ctx.dataStore.entityIndex.byId.get(id)?.type,
|
|
52
|
+
].some(type => getInheritanceChainAcrossSchemas(type ?? '').some(parent => [
|
|
53
|
+
'IfcNamedUnit', 'IfcDerivedUnit', 'IfcDerivedUnitElement', 'IfcMeasureWithUnit', 'IfcDimensionalExponents',
|
|
54
|
+
].includes(parent))))) {
|
|
55
|
+
throw new Error('Relationship-attached Type quantity edits are unsupported');
|
|
56
|
+
}
|
|
57
|
+
relatedBase.push({ name: source.name, globalId: source.globalId,
|
|
58
|
+
quantities: source.quantities.map(q => ({ name: q.name, type: q.type, value: q.value, unit: q.explicitUnit })) });
|
|
59
|
+
}
|
|
60
|
+
const projected = mutationView.getQuantitiesForEntity(entityId, () => [...ownBase, ...relatedBase], true);
|
|
61
|
+
for (const set of relatedBase) {
|
|
62
|
+
const replacement = projected.find(candidate => candidate.globalId === set.globalId);
|
|
63
|
+
if (!replacement || JSON.stringify(replacement.quantities) !== JSON.stringify(set.quantities)) {
|
|
64
|
+
throw new Error('Relationship-attached Type quantity edits are unsupported');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const relatedGuids = new Set(relatedBase.map(set => set.globalId));
|
|
68
|
+
return { qsets: projected.filter(set => !relatedGuids.has(set.globalId)) };
|
|
69
|
+
}
|
|
70
|
+
/** Associate regenerated instances with their canonical source identity, not merely their name. */
|
|
71
|
+
export function collectTypeQuantitySources(pass, ctx, entityId, qsets, affectedNames, detachments) {
|
|
72
|
+
const ids = getTypeOwnedHasPropertySetIds(ctx, entityId, pass.effective);
|
|
73
|
+
pass.typeOwnedPsetIdsByEntity.set(entityId, ids);
|
|
74
|
+
const raw = new Map();
|
|
75
|
+
const replacements = new Map();
|
|
76
|
+
for (const id of ids) {
|
|
77
|
+
if (pass.effective.typeOf(id) !== 'IFCELEMENTQUANTITY')
|
|
78
|
+
continue;
|
|
79
|
+
const line = nativeSetLine(ctx, id, pass.sourceSchema, pass.modifiedAttributes.get(id), pass.warnings);
|
|
80
|
+
const entity = decodeNativeSetLine(line, id);
|
|
81
|
+
const name = entity.attributes[2];
|
|
82
|
+
if (typeof name !== 'string' || !affectedNames.has(name))
|
|
83
|
+
continue;
|
|
84
|
+
const members = entity.attributes[5];
|
|
85
|
+
if (!Array.isArray(members) || members.some(ref => typeof ref !== 'number')) {
|
|
86
|
+
throw new Error(`Type quantity set #${id} has unreadable native members`);
|
|
87
|
+
}
|
|
88
|
+
const sources = raw.get(name) ?? [];
|
|
89
|
+
sources.push({ setId: id, line, entity, members: members });
|
|
90
|
+
raw.set(name, sources);
|
|
91
|
+
if (ctx.mutationView?.isQuantitySetDeleted?.(entityId, name)) {
|
|
92
|
+
replacements.set(id, null);
|
|
93
|
+
detachments.withholdTypeOwned(id, entityId);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const canonical = extractTypeEntityOwnQuantities(ctx.dataStore, entityId, ctx.mutationView ?? undefined);
|
|
97
|
+
const byGuid = new Map();
|
|
98
|
+
for (const sources of raw.values())
|
|
99
|
+
for (const source of sources) {
|
|
100
|
+
const guid = source.entity.attributes[0];
|
|
101
|
+
if (typeof guid !== 'string' || !guid || byGuid.has(guid))
|
|
102
|
+
throw new Error('Native type quantity definition identity is missing or ambiguous');
|
|
103
|
+
byGuid.set(guid, source);
|
|
104
|
+
}
|
|
105
|
+
const selected = [];
|
|
106
|
+
const activeSets = [];
|
|
107
|
+
const seen = new Set();
|
|
108
|
+
for (const qset of qsets) {
|
|
109
|
+
const source = qset.globalId ? byGuid.get(qset.globalId) : undefined;
|
|
110
|
+
if (qset.globalId && (!source || seen.has(qset.globalId)))
|
|
111
|
+
throw new Error(`Projected type quantity identity ${qset.globalId} is missing or ambiguous among ${[...byGuid.keys()].join(',')}`);
|
|
112
|
+
if (!source && raw.has(qset.name))
|
|
113
|
+
throw new Error('Projected type quantity identity cannot be associated with its native definition');
|
|
114
|
+
if (qset.globalId)
|
|
115
|
+
seen.add(qset.globalId);
|
|
116
|
+
const base = canonical.find(set => set.globalId === qset.globalId);
|
|
117
|
+
const quantities = base?.quantities.map(q => ({ name: q.name, type: q.type, value: q.value, unit: q.explicitUnit })) ?? [];
|
|
118
|
+
if (source && JSON.stringify(quantities) === JSON.stringify(qset.quantities.map(q => ({ name: q.name, type: q.type, value: q.value, unit: q.unit }))))
|
|
119
|
+
continue;
|
|
120
|
+
if (source) {
|
|
121
|
+
replacements.set(source.setId, null);
|
|
122
|
+
detachments.withholdTypeOwned(source.setId, entityId);
|
|
123
|
+
// Removing the last numeric member drops only this instance's ownership;
|
|
124
|
+
// opaque native members still require a retained copied definition.
|
|
125
|
+
const opaque = source.members.some(id => !getInheritanceChainAcrossSchemas(pass.effective.typeOf(id) ?? '').includes('IfcPhysicalSimpleQuantity'));
|
|
126
|
+
if (qset.quantities.length === 0 && !opaque)
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
activeSets.push(qset);
|
|
130
|
+
selected.push(source ? { ...source, quantities, unitSymbols: new Map(base?.quantities.map(q => [q.name, q.explicitUnit]) ?? []), unitTypes: new Map(base?.quantities.map(q => [q.name, q.explicitUnitType]) ?? []) } : undefined);
|
|
131
|
+
}
|
|
132
|
+
pass.typeOwnedQuantityIdsByEntity.set(entityId, replacements);
|
|
133
|
+
pass.addedTypeOwnedQuantityIds.set(entityId, []);
|
|
134
|
+
pass.rewrittenEntityIds.add(entityId);
|
|
135
|
+
return { qsets: activeSets, sourceSets: selected };
|
|
136
|
+
}
|
|
137
|
+
function replaced(line, slot, value) {
|
|
138
|
+
const result = replaceStepArgument(line, slot, value);
|
|
139
|
+
if (result === null)
|
|
140
|
+
throw new Error('Type quantity copy cannot preserve its native STEP slots');
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
/** Copy edited atoms only. Untouched units, Formula and opaque physical quantities retain their IDs. */
|
|
144
|
+
export function generateTypeQuantityCopy(pass, options, ctx, entityId, qset, source) {
|
|
145
|
+
const lines = [];
|
|
146
|
+
const memberIds = [];
|
|
147
|
+
const usedNames = new Set();
|
|
148
|
+
const remaining = new Map(qset.quantities.map(quantity => [quantity.name, quantity]));
|
|
149
|
+
for (const id of source.members) {
|
|
150
|
+
if (!pass.willBeEmitted(id) || pass.withheldRefIds.has(id))
|
|
151
|
+
continue;
|
|
152
|
+
const line = nativeSetLine(ctx, id, pass.sourceSchema, pass.modifiedAttributes.get(id), pass.warnings);
|
|
153
|
+
const entity = decodeNativeSetLine(line, id);
|
|
154
|
+
const name = typeof entity.attributes[0] === 'string' ? entity.attributes[0] : null;
|
|
155
|
+
const first = name !== null && !usedNames.has(name);
|
|
156
|
+
if (name !== null)
|
|
157
|
+
usedNames.add(name);
|
|
158
|
+
const quantity = name === null ? undefined : qset.quantities.find(q => q.name === name);
|
|
159
|
+
const base = name === null ? undefined : source.quantities?.find(q => q.name === name);
|
|
160
|
+
const simple = getInheritanceChainAcrossSchemas(entity.type).includes('IfcPhysicalSimpleQuantity');
|
|
161
|
+
if (simple && first && base && !quantity)
|
|
162
|
+
continue;
|
|
163
|
+
if (name !== null)
|
|
164
|
+
remaining.delete(name);
|
|
165
|
+
const changed = first && quantity && (!base || quantity.type !== base.type || quantity.value !== base.value || quantity.unit !== base.unit);
|
|
166
|
+
if (!changed || !quantity) {
|
|
167
|
+
memberIds.push(id);
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
const mutation = ctx.mutationView?.getQuantityMutation(entityId, qset.name, quantity.name);
|
|
171
|
+
const targetType = quantityTypeToIfcType(quantity.type);
|
|
172
|
+
if (!getInheritanceChainAcrossSchemas(entity.type).includes('IfcPhysicalSimpleQuantity')) {
|
|
173
|
+
throw new Error(`Type quantity #${id} requires an explicit native entity edit`);
|
|
174
|
+
}
|
|
175
|
+
const retainedUnitType = name === null ? undefined : source.unitTypes?.get(name);
|
|
176
|
+
if (!mutation?.unitRemoved && retainedUnitType
|
|
177
|
+
&& (mutation?.unit === undefined || mutation.unit === source.unitSymbols?.get(name ?? ''))) {
|
|
178
|
+
const valueAttribute = getAttributeNamesForSchema(targetType, pass.sourceSchema)[3];
|
|
179
|
+
const valueType = valueAttribute ? getAttributeTypeForSchema(targetType, valueAttribute, pass.sourceSchema) : undefined;
|
|
180
|
+
const expectedUnit = valueType ? measureUnit(valueType) : undefined;
|
|
181
|
+
if (!expectedUnit || expectedUnit.kind !== 'typed' || expectedUnit.unitType !== retainedUnitType) {
|
|
182
|
+
throw new Error(`Type quantity #${id} unit dimension is incompatible with ${targetType}`);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
let copy = replaced(line, 3, toStepReal(quantity.value));
|
|
186
|
+
// Omitted unit intent retains the native reference, including non-length units.
|
|
187
|
+
if (mutation?.unitRemoved)
|
|
188
|
+
copy = replaced(copy, 2, '$');
|
|
189
|
+
else if (mutation?.unit !== undefined) {
|
|
190
|
+
if (name === null || mutation.unit !== source.unitSymbols?.get(name)) {
|
|
191
|
+
const unitId = targetType === 'IFCQUANTITYLENGTH' ? findUnitId(ctx, mutation.unit, pass.effective) : null;
|
|
192
|
+
if (unitId === null)
|
|
193
|
+
throw new Error(`Type quantity #${id} unit edit cannot resolve a native reference`);
|
|
194
|
+
copy = replaced(copy, 2, `#${unitId}`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const newId = ctx.allocateExpressId();
|
|
198
|
+
const slots = readStepSlots(copy);
|
|
199
|
+
if (!slots)
|
|
200
|
+
throw new Error('Type quantity edited copy has invalid native slots');
|
|
201
|
+
copy = `#${newId}=${targetType}(${slots.slots.join(',')});`;
|
|
202
|
+
lines.push(copy);
|
|
203
|
+
memberIds.push(newId);
|
|
204
|
+
}
|
|
205
|
+
for (const quantity of remaining.values()) {
|
|
206
|
+
const atom = generateQuantityAtom(ctx, quantity, pass.effective, true);
|
|
207
|
+
lines.push(atom.line);
|
|
208
|
+
memberIds.push(atom.id);
|
|
209
|
+
}
|
|
210
|
+
if (memberIds.length === 0)
|
|
211
|
+
throw new Error('An empty native type quantity copy cannot be emitted');
|
|
212
|
+
const setId = ctx.allocateExpressId();
|
|
213
|
+
// Every edited copy receives a fresh root GlobalId, matching regenerated
|
|
214
|
+
// occurrence sets; the source GlobalId only associates the edit with its
|
|
215
|
+
// verified native definition (#7378).
|
|
216
|
+
let setLine = replaced(source.line, 0, `'${generateGlobalId(options.guidRandom)}'`);
|
|
217
|
+
setLine = replaced(setLine, 5, `(${memberIds.map(id => `#${id}`).join(',')})`);
|
|
218
|
+
lines.push(setLine.replace(/^\s*#\d+\s*=/, `#${setId}=`));
|
|
219
|
+
// Source-schema records; the caller converts every generated quantity line once.
|
|
220
|
+
return { lines, count: lines.length, setId };
|
|
221
|
+
}
|
|
222
|
+
//# sourceMappingURL=step-type-owned-quantities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-type-owned-quantities.js","sourceRoot":"","sources":["../src/step-type-owned-quantities.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,8BAA8B,EAAE,gCAAgC,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAGxL,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,UAAU,EAA2B,MAAM,gCAAgC,CAAC;AAEtI,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAajF,mGAAmG;AACnG,MAAM,UAAU,wBAAwB,CACtC,IAAgB,EAAE,GAAuB,EAAE,QAAgB,EAAE,SAA8B,EAC3F,aAA2D;IAE3D,MAAM,YAAY,GAAG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AAC,IAAI,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC/E,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC;IAC1D,iFAAiF;IACjF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ExportPass } from './step-export-types.js';
|
|
2
|
+
/** Count an emitted georeferencing edit once in the export's modification ledger. */
|
|
3
|
+
export declare function recordGeoreferencingEdit(pass: ExportPass, id: number): void;
|
|
4
|
+
/**
|
|
5
|
+
* Write a recognized `IfcProjectedCRS.VerticalDatum` that names a sea-level
|
|
6
|
+
* datum (e.g. 'EVRS2007') as EGM2008 height on the *emitted* model (#7356).
|
|
7
|
+
*
|
|
8
|
+
* Cesium ion applies a geoid only for vertical CRS codes it has a model for:
|
|
9
|
+
* live uploads shifted heights by the local EGM2008 separation for
|
|
10
|
+
* 'EPSG:3855', and not at all for 'EVRS2007', 'EPSG:5621' or a compound
|
|
11
|
+
* name, which left a sea-level model one geoid separation (48 m) too low.
|
|
12
|
+
* Only EVRS2007 and EGM2008 names are admitted. Explicit EPSG codes,
|
|
13
|
+
* ellipsoidal names and unrecognized text stay as authored. The authored datum's own offset from EGM2008
|
|
14
|
+
* (typically decimetres) remains; heights themselves are never rewritten.
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalizeVerticalDatumToEgm2008(pass: ExportPass): void;
|
|
17
|
+
//# sourceMappingURL=step-vertical-datum-normalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-vertical-datum-normalization.d.ts","sourceRoot":"","sources":["../src/step-vertical-datum-normalization.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AASzD,qFAAqF;AACrF,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAO3E;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAgBtE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { readStepSlots } from './step-argument-parser.js';
|
|
5
|
+
import { attrIndex, stepSourceSchema } from './subset-entity-reader.js';
|
|
6
|
+
/** EGM2008 height: the global geoid model Cesium ion was observed to apply. */
|
|
7
|
+
const EGM2008_HEIGHT = 'EPSG:3855';
|
|
8
|
+
// Admit recognized vertical datum names, never arbitrary project-zero text or
|
|
9
|
+
// a horizontal datum token embedded in a vertical datum description (#7356).
|
|
10
|
+
const SEA_LEVEL_DATUM = /^(?:EVRS\s*2007|EGM\s*2008)(?:\s+height)?(?:\s*\(WGS\s*(?:84|1984)\))?$/i;
|
|
11
|
+
/** Count an emitted georeferencing edit once in the export's modification ledger. */
|
|
12
|
+
export function recordGeoreferencingEdit(pass, id) {
|
|
13
|
+
// Newly created entities already contribute to newEntityCount; source
|
|
14
|
+
// entities count once even if an earlier session edit changed them too.
|
|
15
|
+
if (!pass.effective.isOverlayCreated(id) && pass.effective.has(id)) {
|
|
16
|
+
pass.modifications.nominate(id, 'georeferencing');
|
|
17
|
+
pass.modifications.recordEmitted(id, 'georeferencing');
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Write a recognized `IfcProjectedCRS.VerticalDatum` that names a sea-level
|
|
22
|
+
* datum (e.g. 'EVRS2007') as EGM2008 height on the *emitted* model (#7356).
|
|
23
|
+
*
|
|
24
|
+
* Cesium ion applies a geoid only for vertical CRS codes it has a model for:
|
|
25
|
+
* live uploads shifted heights by the local EGM2008 separation for
|
|
26
|
+
* 'EPSG:3855', and not at all for 'EVRS2007', 'EPSG:5621' or a compound
|
|
27
|
+
* name, which left a sea-level model one geoid separation (48 m) too low.
|
|
28
|
+
* Only EVRS2007 and EGM2008 names are admitted. Explicit EPSG codes,
|
|
29
|
+
* ellipsoidal names and unrecognized text stay as authored. The authored datum's own offset from EGM2008
|
|
30
|
+
* (typically decimetres) remains; heights themselves are never rewritten.
|
|
31
|
+
*/
|
|
32
|
+
export function normalizeVerticalDatumToEgm2008(pass) {
|
|
33
|
+
const slot = attrIndex('IFCPROJECTEDCRS', 'VerticalDatum', stepSourceSchema(pass.sourceSchema));
|
|
34
|
+
if (slot < 0)
|
|
35
|
+
return;
|
|
36
|
+
for (let index = 0; index < pass.entities.length; index++) {
|
|
37
|
+
const line = pass.entities[index];
|
|
38
|
+
const prefix = /^#([0-9]+)\s*=\s*IFCPROJECTEDCRS\s*\(/i.exec(line);
|
|
39
|
+
if (!prefix)
|
|
40
|
+
continue;
|
|
41
|
+
const record = readStepSlots(line);
|
|
42
|
+
const token = record?.slots[slot]?.trim();
|
|
43
|
+
const text = token && /^'.*'$/s.test(token) ? token.slice(1, -1) : undefined;
|
|
44
|
+
if (!record || !text || !SEA_LEVEL_DATUM.test(text.trim()))
|
|
45
|
+
continue;
|
|
46
|
+
const slots = record.slots.map(value => value.trim());
|
|
47
|
+
slots[slot] = `'${EGM2008_HEIGHT}'`;
|
|
48
|
+
pass.entities[index] = `${record.prefix}${slots.join(',')}${record.suffix}`;
|
|
49
|
+
recordGeoreferencingEdit(pass, Number(prefix[1]));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=step-vertical-datum-normalization.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"step-vertical-datum-normalization.js","sourceRoot":"","sources":["../src/step-vertical-datum-normalization.ts"],"names":[],"mappings":"AAAA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AK,GAAG,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;QAC1C,MAAM,IAAI,GAAG,KAAK,IAAI,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC7E,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAAE,SAAS;QACrE,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACtD,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,cAAc,GAAG,CAAC;QACpC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAC5E,wBAAwB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/export",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.11.0",
|
|
4
4
|
"description": "Export formats for IFC-Lite",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,21 +13,22 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"parquet-wasm": "^0.
|
|
16
|
+
"parquet-wasm": "^0.9.0",
|
|
17
17
|
"apache-arrow": "^21.2.0",
|
|
18
18
|
"fflate": "^0.8.3",
|
|
19
|
-
"@ifc-lite/geometry": "^7.
|
|
19
|
+
"@ifc-lite/geometry": "^7.8.1",
|
|
20
20
|
"@ifc-lite/codegen": "^1.18.1",
|
|
21
|
-
"@ifc-lite/data": "^6.
|
|
21
|
+
"@ifc-lite/data": "^6.2.0",
|
|
22
22
|
"@ifc-lite/encoding": "^2.3.0",
|
|
23
|
-
"@ifc-lite/parser": "^9.
|
|
24
|
-
"@ifc-lite/mutations": "^3.
|
|
25
|
-
"@ifc-lite/ifcx": "^4.
|
|
23
|
+
"@ifc-lite/parser": "^9.5.0",
|
|
24
|
+
"@ifc-lite/mutations": "^3.2.0",
|
|
25
|
+
"@ifc-lite/ifcx": "^4.4.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"jszip": "^3.10.2",
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
|
-
"vitest": "^5.0.
|
|
30
|
+
"vitest": "^5.0.3",
|
|
31
|
+
"@ifc-lite/wasm": "^10.4.0"
|
|
31
32
|
},
|
|
32
33
|
"license": "MPL-2.0",
|
|
33
34
|
"author": "Louis True",
|