@ifc-lite/geometry 4.2.0 → 5.0.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 (60) hide show
  1. package/dist/byte-streaming-prepass-result.d.ts +20 -0
  2. package/dist/byte-streaming-prepass-result.d.ts.map +1 -0
  3. package/dist/byte-streaming-prepass-result.js +5 -0
  4. package/dist/byte-streaming-prepass-result.js.map +1 -0
  5. package/dist/canonical-mesh-metadata.d.ts +6 -0
  6. package/dist/canonical-mesh-metadata.d.ts.map +1 -0
  7. package/dist/canonical-mesh-metadata.js +19 -0
  8. package/dist/canonical-mesh-metadata.js.map +1 -0
  9. package/dist/geometry-coordinate.d.ts +0 -7
  10. package/dist/geometry-coordinate.d.ts.map +1 -1
  11. package/dist/geometry-coordinate.js +9 -11
  12. package/dist/geometry-coordinate.js.map +1 -1
  13. package/dist/geometry-parallel-options.d.ts +96 -0
  14. package/dist/geometry-parallel-options.d.ts.map +1 -0
  15. package/dist/geometry-parallel-options.js +5 -0
  16. package/dist/geometry-parallel-options.js.map +1 -0
  17. package/dist/geometry-parallel.d.ts +2 -93
  18. package/dist/geometry-parallel.d.ts.map +1 -1
  19. package/dist/geometry-parallel.js +8 -5
  20. package/dist/geometry-parallel.js.map +1 -1
  21. package/dist/geometry.worker.d.ts +6 -0
  22. package/dist/geometry.worker.d.ts.map +1 -1
  23. package/dist/geometry.worker.js +70 -72
  24. package/dist/geometry.worker.js.map +1 -1
  25. package/dist/huge-file-error.d.ts +0 -10
  26. package/dist/huge-file-error.d.ts.map +1 -1
  27. package/dist/huge-file-error.js +3 -0
  28. package/dist/huge-file-error.js.map +1 -1
  29. package/dist/ifc-lite-bridge.d.ts +7 -7
  30. package/dist/ifc-lite-bridge.d.ts.map +1 -1
  31. package/dist/ifc-lite-bridge.js +7 -7
  32. package/dist/ifc-lite-bridge.js.map +1 -1
  33. package/dist/index.d.ts +7 -4
  34. package/dist/index.d.ts.map +1 -1
  35. package/dist/index.js +7 -5
  36. package/dist/index.js.map +1 -1
  37. package/dist/prepass-source-fingerprint.d.ts +8 -0
  38. package/dist/prepass-source-fingerprint.d.ts.map +1 -0
  39. package/dist/prepass-source-fingerprint.js +34 -0
  40. package/dist/prepass-source-fingerprint.js.map +1 -0
  41. package/dist/types.d.ts +12 -0
  42. package/dist/types.d.ts.map +1 -1
  43. package/dist/types.js.map +1 -1
  44. package/dist/wasm-init-retry.d.ts +6 -42
  45. package/dist/wasm-init-retry.d.ts.map +1 -1
  46. package/dist/wasm-init-retry.js +6 -99
  47. package/dist/wasm-init-retry.js.map +1 -1
  48. package/dist/wasm-owned-buffer.d.ts +4 -0
  49. package/dist/wasm-owned-buffer.d.ts.map +1 -0
  50. package/dist/wasm-owned-buffer.js +13 -0
  51. package/dist/wasm-owned-buffer.js.map +1 -0
  52. package/dist/wasm-panic-forward.d.ts +7 -63
  53. package/dist/wasm-panic-forward.d.ts.map +1 -1
  54. package/dist/wasm-panic-forward.js +7 -100
  55. package/dist/wasm-panic-forward.js.map +1 -1
  56. package/dist/worker-prepass-source.d.ts +38 -0
  57. package/dist/worker-prepass-source.d.ts.map +1 -0
  58. package/dist/worker-prepass-source.js +9 -0
  59. package/dist/worker-prepass-source.js.map +1 -0
  60. package/package.json +4 -3
@@ -0,0 +1,20 @@
1
+ export interface ByteStreamingPrePassResult {
2
+ jobs: Uint32Array;
3
+ totalJobs: number;
4
+ unitScale: number;
5
+ rtcOffset?: Float64Array;
6
+ needsShift: boolean;
7
+ buildingRotation?: number | null;
8
+ voidKeys: Uint32Array;
9
+ voidCounts: Uint32Array;
10
+ voidValues: Uint32Array;
11
+ styleIds: Uint32Array;
12
+ styleColors: Uint8Array;
13
+ /** Prepass-resolved plane-angle→radians scale (additive wire field). */
14
+ planeAngleToRadians?: number;
15
+ /** #407/#913 §2.3 per-element material colour lists (flat encoding). */
16
+ materialElementIds?: Uint32Array;
17
+ materialColorCounts?: Uint32Array;
18
+ materialColors?: Uint8Array;
19
+ }
20
+ //# sourceMappingURL=byte-streaming-prepass-result.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byte-streaming-prepass-result.d.ts","sourceRoot":"","sources":["../src/byte-streaming-prepass-result.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,WAAW,CAAC;IACtB,UAAU,EAAE,WAAW,CAAC;IACxB,UAAU,EAAE,WAAW,CAAC;IACxB,QAAQ,EAAE,WAAW,CAAC;IACtB,WAAW,EAAE,UAAU,CAAC;IACxB,wEAAwE;IACxE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,WAAW,CAAC;IACjC,mBAAmB,CAAC,EAAE,WAAW,CAAC;IAClC,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B"}
@@ -0,0 +1,5 @@
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
+ export {};
5
+ //# sourceMappingURL=byte-streaming-prepass-result.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"byte-streaming-prepass-result.js","sourceRoot":"","sources":["../src/byte-streaming-prepass-result.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
@@ -0,0 +1,6 @@
1
+ import type { MeshData } from './types.js';
2
+ import type { EntityGeometryFingerprint } from './geometry-fingerprints.js';
3
+ /** The worker and collection fallback stamp identical canonical source metadata
4
+ * before any renderer streaming split. Repeated array references survive clone. */
5
+ export declare function attachCanonicalMeshMetadata(mesh: MeshData, fingerprint?: EntityGeometryFingerprint): void;
6
+ //# sourceMappingURL=canonical-mesh-metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-mesh-metadata.d.ts","sourceRoot":"","sources":["../src/canonical-mesh-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE5E;mFACmF;AACnF,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,QAAQ,EACd,WAAW,CAAC,EAAE,yBAAyB,GACtC,IAAI,CAaN"}
@@ -0,0 +1,19 @@
1
+ /** The worker and collection fallback stamp identical canonical source metadata
2
+ * before any renderer streaming split. Repeated array references survive clone. */
3
+ export function attachCanonicalMeshMetadata(mesh, fingerprint) {
4
+ if (mesh.geometryItemId !== undefined) {
5
+ mesh.appearanceSource = {
6
+ kind: 'canonical-item',
7
+ indices: mesh.indices,
8
+ sourceIndices: mesh.indices,
9
+ };
10
+ }
11
+ if (fingerprint) {
12
+ mesh.geometryHash = fingerprint.hash;
13
+ if (fingerprint.aabb)
14
+ mesh.geometryAabb = fingerprint.aabb;
15
+ if (fingerprint.volume !== undefined)
16
+ mesh.geometryVolume = fingerprint.volume;
17
+ }
18
+ }
19
+ //# sourceMappingURL=canonical-mesh-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-mesh-metadata.js","sourceRoot":"","sources":["../src/canonical-mesh-metadata.ts"],"names":[],"mappings":"AAMA;mFACmF;AACnF,MAAM,UAAU,2BAA2B,CACzC,IAAc,EACd,WAAuC;IAEvC,IAAI,IAAI,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;QACtC,IAAI,CAAC,gBAAgB,GAAG;YACtB,IAAI,EAAE,gBAAgB;YACtB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,aAAa,EAAE,IAAI,CAAC,OAAO;SAC5B,CAAC;IACJ,CAAC;IACD,IAAI,WAAW,EAAE,CAAC;QAChB,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC;QACrC,IAAI,WAAW,CAAC,IAAI;YAAE,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3D,IAAI,WAAW,CAAC,MAAM,KAAK,SAAS;YAAE,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC,MAAM,CAAC;IACjF,CAAC;AACH,CAAC"}
@@ -1,10 +1,3 @@
1
- /**
2
- * Coordinate transform utilities and batch-conversion helpers.
3
- *
4
- * Pure functions that convert WASM mesh/instanced-geometry collections
5
- * into plain MeshData arrays, compute streaming batch sizes, and merge
6
- * building rotation into coordinate info.
7
- */
8
1
  import type { MeshData, CoordinateInfo } from './types.js';
9
2
  import type { DynamicBatchConfig } from './index.js';
10
3
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-coordinate.d.ts","sourceRoot":"","sources":["../src/geometry-coordinate.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQrD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,GAAG,kBAAkB,GACvC,MAAM,CAeR;AAID;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,OAAO,gBAAgB,EAAE,cAAc,GAClD,QAAQ,EAAE,CA4HZ;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,cAAc,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GACxB,cAAc,CAIhB"}
1
+ {"version":3,"file":"geometry-coordinate.d.ts","sourceRoot":"","sources":["../src/geometry-coordinate.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAQrD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,MAAM,GAAG,kBAAkB,GACvC,MAAM,CAeR;AAID;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,UAAU,EAAE,OAAO,gBAAgB,EAAE,cAAc,GAClD,QAAQ,EAAE,CAoHZ;AAID;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,cAAc,EAAE,cAAc,EAC9B,gBAAgB,CAAC,EAAE,MAAM,GACxB,cAAc,CAIhB"}
@@ -1,6 +1,14 @@
1
1
  /* This Source Code Form is subject to the terms of the Mozilla Public
2
2
  * License, v. 2.0. If a copy of the MPL was not distributed with this
3
3
  * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+ /**
5
+ * Coordinate transform utilities and batch-conversion helpers.
6
+ *
7
+ * Pure functions that convert WASM mesh/instanced-geometry collections
8
+ * into plain MeshData arrays, compute streaming batch sizes, and merge
9
+ * building rotation into coordinate info.
10
+ */
11
+ import { attachCanonicalMeshMetadata } from './canonical-mesh-metadata.js';
4
12
  import { extractGeometryFingerprints, } from './geometry-fingerprints.js';
5
13
  // ── Batch-size heuristics ──
6
14
  /**
@@ -120,17 +128,7 @@ export function convertMeshCollectionToBatch(collection) {
120
128
  repeatT: mesh.textureRepeatT,
121
129
  };
122
130
  }
123
- // #924 / #1891: attach the per-entity geometry fingerprint — hash and,
124
- // when the pass produced them, the absolute world box and the proved
125
- // enclosed volume (empty Map → no-op unless geometry hashing was
126
- // enabled).
127
- if (fingerprint) {
128
- meshData.geometryHash = fingerprint.hash;
129
- if (fingerprint.aabb)
130
- meshData.geometryAabb = fingerprint.aabb;
131
- if (fingerprint.volume !== undefined)
132
- meshData.geometryVolume = fingerprint.volume;
133
- }
131
+ attachCanonicalMeshMetadata(meshData, fingerprint);
134
132
  batch.push(meshData);
135
133
  }
136
134
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-coordinate.js","sourceRoot":"","sources":["../src/geometry-coordinate.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D,OAAO,EACL,2BAA2B,GAE5B,MAAM,4BAA4B,CAAC;AAEpC,8BAA8B;AAE9B;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CACnC,MAAkB,EAClB,WAAwC;IAExC,IAAI,OAAO,WAAW,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,UAAU,GAAG,WAAW,CAAC,UAAU;QACvC,CAAC,CAAC,WAAW,CAAC,UAAU;QACxB,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IAElC,OAAO,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG;QAC1B,CAAC,CAAC,UAAU,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG;YACvB,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG;gBACxB,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG;oBACxB,CAAC,CAAC,UAAU,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI;wBACzB,CAAC,CAAC,IAAI,CAAC;AACX,CAAC;AAED,gDAAgD;AAEhD;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAC1C,UAAmD;IAEnD,MAAM,KAAK,GAAe,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,yEAAyE;QACzE,2EAA2E;QAC3E,yEAAyE;QACzE,uEAAuE;QACvE,mCAAmC;QACnC,MAAM,oBAAoB,GAAG,2BAA2B,CACtD,UAAkD,CACnD,CAAC;QAEF,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,IAAI,GAAG,UAAU,C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OAAO,gBAAgB,KAAK,SAAS;QACnC,CAAC,CAAC,EAAE,GAAG,cAAc,EAAE,gBAAgB,EAAE;QACzC,CAAC,CAAC,cAAc,CAAC;AACrB,CAAC"}
@@ -0,0 +1,96 @@
1
+ import type { TessellationQuality } from './types.js';
2
+ import type { BatchSizingConfig } from './batch-sizing.js';
3
+ export interface ProcessParallelOptions {
4
+ /** Fresh per-load fingerprint cell shared only with the matching parser. */
5
+ sourceFingerprint?: SharedArrayBuffer;
6
+ /**
7
+ * Fires when the streaming pre-pass finishes building the entity index
8
+ * (after styles), with SAB-backed Uint32Array views over the shared
9
+ * column buffers. The parser worker uses this to skip its own
10
+ * `scanEntitiesFastBytes` call (~10 s on 1 GB files under WASM
11
+ * contention with the geometry workers).
12
+ */
13
+ onEntityIndex?: (ids: Uint32Array, starts: Uint32Array, lengths: Uint32Array, oversizedIdCount?: number, // #3395 refused records
14
+ malformedRecordCount?: number) => void;
15
+ /**
16
+ * Issue #540 — "Merge Multilayer Walls" load-time toggle. When
17
+ * `true`, the geometry workers' IfcAPI receive
18
+ * `setMergeLayers(true)` before the first stream-chunk lands, so
19
+ * Revit-style multilayer-wall part meshes are suppressed at the
20
+ * Rust layer. Default `false` keeps existing behaviour.
21
+ */
22
+ mergeLayers?: boolean;
23
+ /**
24
+ * GPU-instancing partition toggle (default true). Set false for FEDERATED loads:
25
+ * the instanced render path is primary-model only, so a federated model must keep
26
+ * all geometry on the flat path or its opaque repeated occurrences are dropped.
27
+ */
28
+ enableInstancing?: boolean;
29
+ /**
30
+ * Issue #924 — per-entity geometry-hash tolerance in metres. When a
31
+ * positive value is given, each geometry worker's IfcAPI receives
32
+ * `setComputeGeometryHashes(tol)` before the first stream-chunk, so the
33
+ * RTC-invariant `geometryHash` lands on every emitted mesh for the
34
+ * model-diff / compare feature. `undefined`/`null` ⇒ off (zero overhead).
35
+ */
36
+ geometryHashTolerance?: number | null;
37
+ /**
38
+ * Issue #976 — tessellation detail level for curved geometry. When set,
39
+ * each geometry worker's IfcAPI receives `setTessellationQuality(level)`
40
+ * before the first stream-chunk. `undefined`/`null` ⇒ engine default
41
+ * (`'medium'`, output identical to the pre-quality pipeline).
42
+ */
43
+ tessellationQuality?: TessellationQuality | null;
44
+ /**
45
+ * Issue #1286 — tier-independent small-cut skip. When true, each geometry
46
+ * worker's IfcAPI receives `setSkipSmallCuts(true)` before the first
47
+ * stream-chunk, dropping tiny `IfcBooleanResult` detail cuts while keeping the
48
+ * tessellation tier. `undefined`/`false` ⇒ every cut runs (default).
49
+ */
50
+ skipSmallCuts?: boolean;
51
+ /**
52
+ * Explicit URL for the wasm-bindgen `.wasm` binary. When provided,
53
+ * forwarded to the geometry workers' init messages so they call
54
+ * `init(wasmUrl)` instead of relying on wasm-bindgen's default
55
+ * `import.meta.url`-based resolution.
56
+ *
57
+ * Vite + webpack 5 consumers don't need to set this — the bundler
58
+ * rewrites the `new URL('ifc-lite_bg.wasm', import.meta.url)` literal
59
+ * inside the wasm-bindgen glue at build time. This option exists for
60
+ * consumers whose bundler doesn't transform that pattern, or who
61
+ * serve the wasm from a CDN at a different origin (e.g., self-hosted
62
+ * deployments, Tauri custom protocols, embedded usage).
63
+ */
64
+ wasmUrls?: {
65
+ wasm?: string;
66
+ };
67
+ /**
68
+ * Issue #1097 — optional override for the worker's adaptive batch sizing
69
+ * (the watchdog↔throughput knob). Takes precedence over the `globalThis`
70
+ * tuning hook; omitted ⇒ `DEFAULT_BATCH_SIZING`. Forwarded to every worker
71
+ * in its `stream-start` message and validated there.
72
+ */
73
+ batchSizing?: Partial<BatchSizingConfig>;
74
+ /**
75
+ * #1097 load-time visibility filter. `disabledTypes` (uppercase STEP keywords)
76
+ * and `skipTypeGeometry` are forwarded to the prepass so the matching geometry
77
+ * jobs are never produced — cutting decode + CSG + tessellation + upload for
78
+ * hidden types (spaces/annotations/grids/type-library). Takes precedence over
79
+ * the `globalThis.__IFC_LITE_VISIBILITY_FILTER` hook. Toggling a type back on
80
+ * requires a reload.
81
+ */
82
+ visibilityFilter?: {
83
+ disabledTypes?: string[];
84
+ skipTypeGeometry?: boolean;
85
+ };
86
+ /**
87
+ * Explicit geometry-worker count for A/B tuning (the viewer's
88
+ * `?geomWorkers=N` knob). Overrides the cores-tier heuristic but stays
89
+ * clamped to the memory budget — see the worker-count policy. `undefined`
90
+ * ⇒ use the heuristic. Lets a user measure their host's true thermal optimum
91
+ * (which is machine-specific). Geometry output is unaffected by the count
92
+ * (workers process disjoint, deterministic element slices).
93
+ */
94
+ workerCountOverride?: number;
95
+ }
96
+ //# sourceMappingURL=geometry-parallel-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry-parallel-options.d.ts","sourceRoot":"","sources":["../src/geometry-parallel-options.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,CACd,GAAG,EAAE,WAAW,EAChB,MAAM,EAAE,WAAW,EACnB,OAAO,EAAE,WAAW,EAAE,gBAAgB,CAAC,EAAE,MAAM,EAAE,wBAAwB;IACzE,oBAAoB,CAAC,EAAE,MAAM,KAC1B,IAAI,CAAC;IACV;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;;OAMG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACjD;;;;;OAKG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;;;;;;;;;OAYG;IACH,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;IACF;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzC;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE;QAAE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,gBAAgB,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC5E;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
@@ -0,0 +1,5 @@
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
+ export {};
5
+ //# sourceMappingURL=geometry-parallel-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geometry-parallel-options.js","sourceRoot":"","sources":["../src/geometry-parallel-options.ts"],"names":[],"mappings":"AAAA;;+DAE+D"}
@@ -19,10 +19,9 @@
19
19
  * (full pre-pass + worker spawn + first batch) to ~3-5 s (pre-pass
20
20
  * scans first 100 K bytes → meta → first chunk → first batch).
21
21
  */
22
+ import type { ProcessParallelOptions } from './geometry-parallel-options.js';
22
23
  import type { CoordinateHandler } from './coordinate-handler.js';
23
- import type { TessellationQuality } from './types.js';
24
24
  import type { StreamingGeometryEvent } from './index.js';
25
- import type { BatchSizingConfig } from './batch-sizing.js';
26
25
  /**
27
26
  * Prepass class-byte layout, mirroring the `PREPASS_CLASS_*` definitions in
28
27
  * `rust/processing/src/shard_classes.rs` (the source of truth — these are
@@ -70,97 +69,7 @@ export declare function planAffinityRouting(affinity: Uint32Array, totalJobs: nu
70
69
  buckets: number[][];
71
70
  nextWorker: number;
72
71
  };
73
- export interface ProcessParallelOptions {
74
- /**
75
- * Fires when the streaming pre-pass finishes building the entity index
76
- * (after styles), with SAB-backed Uint32Array views over the shared
77
- * column buffers. The parser worker uses this to skip its own
78
- * `scanEntitiesFastBytes` call (~10 s on 1 GB files under WASM
79
- * contention with the geometry workers).
80
- */
81
- onEntityIndex?: (ids: Uint32Array, starts: Uint32Array, lengths: Uint32Array, oversizedIdCount?: number, // #3395 refused records
82
- malformedRecordCount?: number) => void;
83
- /**
84
- * Issue #540 — "Merge Multilayer Walls" load-time toggle. When
85
- * `true`, the geometry workers' IfcAPI receive
86
- * `setMergeLayers(true)` before the first stream-chunk lands, so
87
- * Revit-style multilayer-wall part meshes are suppressed at the
88
- * Rust layer. Default `false` keeps existing behaviour.
89
- */
90
- mergeLayers?: boolean;
91
- /**
92
- * GPU-instancing partition toggle (default true). Set false for FEDERATED loads:
93
- * the instanced render path is primary-model only, so a federated model must keep
94
- * all geometry on the flat path or its opaque repeated occurrences are dropped.
95
- */
96
- enableInstancing?: boolean;
97
- /**
98
- * Issue #924 — per-entity geometry-hash tolerance in metres. When a
99
- * positive value is given, each geometry worker's IfcAPI receives
100
- * `setComputeGeometryHashes(tol)` before the first stream-chunk, so the
101
- * RTC-invariant `geometryHash` lands on every emitted mesh for the
102
- * model-diff / compare feature. `undefined`/`null` ⇒ off (zero overhead).
103
- */
104
- geometryHashTolerance?: number | null;
105
- /**
106
- * Issue #976 — tessellation detail level for curved geometry. When set,
107
- * each geometry worker's IfcAPI receives `setTessellationQuality(level)`
108
- * before the first stream-chunk. `undefined`/`null` ⇒ engine default
109
- * (`'medium'`, output identical to the pre-quality pipeline).
110
- */
111
- tessellationQuality?: TessellationQuality | null;
112
- /**
113
- * Issue #1286 — tier-independent small-cut skip. When true, each geometry
114
- * worker's IfcAPI receives `setSkipSmallCuts(true)` before the first
115
- * stream-chunk, dropping tiny `IfcBooleanResult` detail cuts while keeping the
116
- * tessellation tier. `undefined`/`false` ⇒ every cut runs (default).
117
- */
118
- skipSmallCuts?: boolean;
119
- /**
120
- * Explicit URL for the wasm-bindgen `.wasm` binary. When provided,
121
- * forwarded to the geometry workers' init messages so they call
122
- * `init(wasmUrl)` instead of relying on wasm-bindgen's default
123
- * `import.meta.url`-based resolution.
124
- *
125
- * Vite + webpack 5 consumers don't need to set this — the bundler
126
- * rewrites the `new URL('ifc-lite_bg.wasm', import.meta.url)` literal
127
- * inside the wasm-bindgen glue at build time. This option exists for
128
- * consumers whose bundler doesn't transform that pattern, or who
129
- * serve the wasm from a CDN at a different origin (e.g., self-hosted
130
- * deployments, Tauri custom protocols, embedded usage).
131
- */
132
- wasmUrls?: {
133
- wasm?: string;
134
- };
135
- /**
136
- * Issue #1097 — optional override for the worker's adaptive batch sizing
137
- * (the watchdog↔throughput knob). Takes precedence over the `globalThis`
138
- * tuning hook; omitted ⇒ `DEFAULT_BATCH_SIZING`. Forwarded to every worker
139
- * in its `stream-start` message and validated there.
140
- */
141
- batchSizing?: Partial<BatchSizingConfig>;
142
- /**
143
- * #1097 load-time visibility filter. `disabledTypes` (uppercase STEP keywords)
144
- * and `skipTypeGeometry` are forwarded to the prepass so the matching geometry
145
- * jobs are never produced — cutting decode + CSG + tessellation + upload for
146
- * hidden types (spaces/annotations/grids/type-library). Takes precedence over
147
- * the `globalThis.__IFC_LITE_VISIBILITY_FILTER` hook. Toggling a type back on
148
- * requires a reload.
149
- */
150
- visibilityFilter?: {
151
- disabledTypes?: string[];
152
- skipTypeGeometry?: boolean;
153
- };
154
- /**
155
- * Explicit geometry-worker count for A/B tuning (the viewer's
156
- * `?geomWorkers=N` knob). Overrides the cores-tier heuristic but stays
157
- * clamped to the memory budget — see {@link computeWorkerCount}. `undefined`
158
- * ⇒ use the heuristic. Lets a user measure their host's true thermal optimum
159
- * (which is machine-specific). Geometry output is unaffected by the count
160
- * (workers process disjoint, deterministic element slices).
161
- */
162
- workerCountOverride?: number;
163
- }
72
+ export type { ProcessParallelOptions } from './geometry-parallel-options.js';
164
73
  export declare function processParallel(buffer: Uint8Array, coordinator: CoordinateHandler, sharedRtcOffset?: {
165
74
  x: number;
166
75
  y: number;
@@ -1 +1 @@
1
- {"version":3,"file":"geometry-parallel.d.ts","sourceRoot":"","sources":["../src/geometry-parallel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,MAAM,EAAE,UAAU,EAClB,WAAW,EAAE,iBAAiB,EAC9B,eAAe,CAAC,EAAE;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE;AACrD,gFAAgF;AAChF,WAAW,CAAC,EAAE,iBAAiB,EAC/B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,cAAc,CAAC,sBAAsB,CAAC,CAszCxC"}
@@ -159,9 +159,11 @@ function terminateWorkerQuietly(worker, label) {
159
159
  console.warn(`[stream] ${label} terminate failed:`, err);
160
160
  }
161
161
  }
162
+ let nextSourceSessionId = 0;
162
163
  export async function* processParallel(buffer, coordinator, sharedRtcOffset,
163
164
  /** Optional pre-allocated SAB the caller already shares with another worker. */
164
165
  existingSab, options) {
166
+ const sourceSessionId = `geometry-source-${++nextSourceSessionId}`;
165
167
  coordinator.reset();
166
168
  yield { type: 'start', totalEstimate: buffer.length / 1000 };
167
169
  yield { type: 'model-open', modelID: 0 };
@@ -608,7 +610,7 @@ existingSab, options) {
608
610
  const batchSizing = options?.batchSizing ?? readBatchSizingOverride();
609
611
  for (const worker of workers) {
610
612
  worker.postMessage({
611
- type: 'stream-start',
613
+ type: 'stream-start', sourceSessionId,
612
614
  sharedBuffer,
613
615
  unitScale: prepassMeta.unitScale,
614
616
  planeAngleToRadians: prepassMeta.planeAngleToRadians,
@@ -877,7 +879,7 @@ existingSab, options) {
877
879
  const from = Math.floor((i * styledCount) / sliceCount) * 3;
878
880
  const to = i + 1 === sliceCount ? styledCount * 3 : Math.floor(((i + 1) * styledCount) / sliceCount) * 3;
879
881
  const slice = styledSpans.slice(from, to);
880
- workers[i % workers.length].postMessage({ type: 'resolve-styles-shard', sharedBuffer, sliceIndex: i, spans: slice }, [slice.buffer]);
882
+ workers[i % workers.length].postMessage({ type: 'resolve-styles-shard', sourceSessionId, sharedBuffer, sliceIndex: i, spans: slice }, [slice.buffer]);
881
883
  }
882
884
  // Start the sharded pre-pass with the stitched index columns + classes
883
885
  // (stage 2: the pre-pass discovers jobs/spans from the class column and
@@ -948,7 +950,7 @@ existingSab, options) {
948
950
  finalizeDispatched = true;
949
951
  const m = mergedStylesForFinalize;
950
952
  workers[0].postMessage({
951
- type: 'finalize-styles',
953
+ type: 'finalize-styles', sourceSessionId,
952
954
  sharedBuffer,
953
955
  orphanIds: m.orphanIds,
954
956
  orphanColors: m.orphanColors,
@@ -978,7 +980,7 @@ existingSab, options) {
978
980
  const rangeStart = Math.floor((i * len) / n);
979
981
  const rangeEnd = i + 1 === n ? len : Math.floor(((i + 1) * len) / n);
980
982
  workers[i].postMessage({
981
- type: 'scan-shard',
983
+ type: 'scan-shard', sourceSessionId,
982
984
  sharedBuffer,
983
985
  shardIndex: i,
984
986
  rangeStart,
@@ -993,7 +995,6 @@ existingSab, options) {
993
995
  // is suspended at a `yield` or the `resolveWaiting` await. The viewer's
994
996
  // `watchedGeometryStream` relies on this `finally` to tear down workers
995
997
  // on break / abort / watchdog (see boundedIteratorReturn). The existing
996
- // branch-local `terminate()` calls remain — `terminate()` is idempotent.
997
998
  try {
998
999
  // Forward the consumer-supplied wasm URL to the pre-pass worker so it
999
1000
  // doesn't fall back to wasm-bindgen's `import.meta.url` default. The
@@ -1305,6 +1306,7 @@ existingSab, options) {
1305
1306
  }
1306
1307
  prepassWorker.postMessage({
1307
1308
  type: 'prepass-streaming-sharded',
1309
+ sourceFingerprint: options?.sourceFingerprint,
1308
1310
  sharedBuffer,
1309
1311
  chunkSize: 50_000,
1310
1312
  ...(visibilityFilter?.disabledTypes ? { disabledTypes: visibilityFilter.disabledTypes } : {}),
@@ -1318,6 +1320,7 @@ existingSab, options) {
1318
1320
  else {
1319
1321
  prepassWorker.postMessage({
1320
1322
  type: 'prepass-streaming',
1323
+ sourceFingerprint: options?.sourceFingerprint,
1321
1324
  sharedBuffer,
1322
1325
  chunkSize: 50_000,
1323
1326
  ...(visibilityFilter?.disabledTypes ? { disabledTypes: visibilityFilter.disabledTypes } : {}),