@ifc-lite/export 4.9.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.
Files changed (74) hide show
  1. package/dist/affected-set.d.ts +9 -0
  2. package/dist/affected-set.d.ts.map +1 -0
  3. package/dist/affected-set.js +72 -0
  4. package/dist/affected-set.js.map +1 -0
  5. package/dist/declared-property-type.d.ts +7 -0
  6. package/dist/declared-property-type.d.ts.map +1 -1
  7. package/dist/declared-property-type.js +26 -0
  8. package/dist/declared-property-type.js.map +1 -1
  9. package/dist/edit-ownership.d.ts +7 -0
  10. package/dist/edit-ownership.d.ts.map +1 -0
  11. package/dist/edit-ownership.js +95 -0
  12. package/dist/edit-ownership.js.map +1 -0
  13. package/dist/entity-subgraph.d.ts +11 -3
  14. package/dist/entity-subgraph.d.ts.map +1 -1
  15. package/dist/entity-subgraph.js +54 -11
  16. package/dist/entity-subgraph.js.map +1 -1
  17. package/dist/grid-placement-dependents.d.ts +4 -0
  18. package/dist/grid-placement-dependents.d.ts.map +1 -0
  19. package/dist/grid-placement-dependents.js +71 -0
  20. package/dist/grid-placement-dependents.js.map +1 -0
  21. package/dist/grid-reference-context.d.ts +6 -0
  22. package/dist/grid-reference-context.d.ts.map +1 -0
  23. package/dist/grid-reference-context.js +68 -0
  24. package/dist/grid-reference-context.js.map +1 -0
  25. package/dist/index.d.ts +4 -1
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +7 -3
  28. package/dist/index.js.map +1 -1
  29. package/dist/step-coordinate-options.d.ts +8 -0
  30. package/dist/step-coordinate-options.d.ts.map +1 -1
  31. package/dist/step-export-types.d.ts +4 -0
  32. package/dist/step-export-types.d.ts.map +1 -1
  33. package/dist/step-export-types.js.map +1 -1
  34. package/dist/step-exporter.d.ts.map +1 -1
  35. package/dist/step-exporter.js +7 -7
  36. package/dist/step-exporter.js.map +1 -1
  37. package/dist/step-map-unit-normalization.d.ts +3 -5
  38. package/dist/step-map-unit-normalization.d.ts.map +1 -1
  39. package/dist/step-map-unit-normalization.js +12 -8
  40. package/dist/step-map-unit-normalization.js.map +1 -1
  41. package/dist/step-map-unit.d.ts +3 -78
  42. package/dist/step-map-unit.d.ts.map +1 -1
  43. package/dist/step-map-unit.js +33 -195
  44. package/dist/step-map-unit.js.map +1 -1
  45. package/dist/step-native-set-record.d.ts +6 -0
  46. package/dist/step-native-set-record.d.ts.map +1 -0
  47. package/dist/step-native-set-record.js +30 -0
  48. package/dist/step-native-set-record.js.map +1 -0
  49. package/dist/step-pass-builder.d.ts.map +1 -1
  50. package/dist/step-pass-builder.js +2 -0
  51. package/dist/step-pass-builder.js.map +1 -1
  52. package/dist/step-property-set-collection.d.ts.map +1 -1
  53. package/dist/step-property-set-collection.js +24 -8
  54. package/dist/step-property-set-collection.js.map +1 -1
  55. package/dist/step-property-set-generators.d.ts +8 -2
  56. package/dist/step-property-set-generators.d.ts.map +1 -1
  57. package/dist/step-property-set-generators.js +26 -10
  58. package/dist/step-property-set-generators.js.map +1 -1
  59. package/dist/step-property-set-readers.d.ts.map +1 -1
  60. package/dist/step-property-set-readers.js +15 -0
  61. package/dist/step-property-set-readers.js.map +1 -1
  62. package/dist/step-property-sets.d.ts +3 -4
  63. package/dist/step-property-sets.d.ts.map +1 -1
  64. package/dist/step-property-sets.js +61 -19
  65. package/dist/step-property-sets.js.map +1 -1
  66. package/dist/step-type-owned-quantities.d.ts +34 -0
  67. package/dist/step-type-owned-quantities.d.ts.map +1 -0
  68. package/dist/step-type-owned-quantities.js +222 -0
  69. package/dist/step-type-owned-quantities.js.map +1 -0
  70. package/dist/step-vertical-datum-normalization.d.ts +17 -0
  71. package/dist/step-vertical-datum-normalization.d.ts.map +1 -0
  72. package/dist/step-vertical-datum-normalization.js +52 -0
  73. package/dist/step-vertical-datum-normalization.js.map +1 -0
  74. package/package.json +9 -9
@@ -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;;+DAE+D;AAE/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAGxE,+EAA+E;AAC/E,MAAM,cAAc,GAAG,WAAW,CAAC;AAEnC,8EAA8E;AAC9E,6EAA6E;AAC7E,MAAM,eAAe,GAAG,0EAA0E,CAAC;AAEnG,qFAAqF;AACrF,MAAM,UAAU,wBAAwB,CAAC,IAAgB,EAAE,EAAU;IACnE,sEAAsE;IACtE,wEAAwE;IACxE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;QACnE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;QAClD,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;IACzD,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AAC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AAM,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.9.0",
3
+ "version": "4.11.0",
4
4
  "description": "Export formats for IFC-Lite",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,22 +13,22 @@
13
13
  }
14
14
  },
15
15
  "dependencies": {
16
- "parquet-wasm": "^0.8.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.7.0",
19
+ "@ifc-lite/geometry": "^7.8.1",
20
20
  "@ifc-lite/codegen": "^1.18.1",
21
- "@ifc-lite/data": "^6.1.0",
21
+ "@ifc-lite/data": "^6.2.0",
22
22
  "@ifc-lite/encoding": "^2.3.0",
23
- "@ifc-lite/parser": "^9.2.0",
24
- "@ifc-lite/mutations": "^3.1.0",
25
- "@ifc-lite/ifcx": "^4.3.0"
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.2",
31
- "@ifc-lite/wasm": "^10.3.0"
30
+ "vitest": "^5.0.3",
31
+ "@ifc-lite/wasm": "^10.4.0"
32
32
  },
33
33
  "license": "MPL-2.0",
34
34
  "author": "Louis True",