@ifc-lite/geometry 7.2.0 → 7.4.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/coordinate-handler.js +4 -4
- package/dist/coordinate-handler.js.map +1 -1
- package/dist/coordinate-types.d.ts +8 -1
- package/dist/coordinate-types.d.ts.map +1 -1
- package/dist/geometry-parallel-options.d.ts +29 -0
- package/dist/geometry-parallel-options.d.ts.map +1 -1
- package/dist/geometry-parallel.d.ts.map +1 -1
- package/dist/geometry-parallel.js +228 -87
- package/dist/geometry-parallel.js.map +1 -1
- package/dist/geometry-worker-init.d.ts +9 -0
- package/dist/geometry-worker-init.d.ts.map +1 -0
- package/dist/geometry-worker-init.js +64 -0
- package/dist/geometry-worker-init.js.map +1 -0
- package/dist/geometry.worker.d.ts +16 -0
- package/dist/geometry.worker.d.ts.map +1 -1
- package/dist/geometry.worker.js +15 -8
- package/dist/geometry.worker.js.map +1 -1
- package/dist/hung-job-recovery.d.ts +145 -0
- package/dist/hung-job-recovery.d.ts.map +1 -0
- package/dist/hung-job-recovery.js +289 -0
- package/dist/hung-job-recovery.js.map +1 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/rtc-rebase.d.ts +101 -0
- package/dist/rtc-rebase.d.ts.map +1 -0
- package/dist/rtc-rebase.js +135 -0
- package/dist/rtc-rebase.js.map +1 -0
- package/dist/stall-phase.d.ts +111 -0
- package/dist/stall-phase.d.ts.map +1 -0
- package/dist/stall-phase.js +164 -0
- package/dist/stall-phase.js.map +1 -0
- package/dist/types.d.ts +6 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/world-frame.d.ts +44 -5
- package/dist/world-frame.d.ts.map +1 -1
- package/dist/world-frame.js +70 -6
- package/dist/world-frame.js.map +1 -1
- package/package.json +9 -4
|
@@ -0,0 +1,164 @@
|
|
|
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
|
+
* Tracks which pre-worker gate(s) `geometry-parallel.ts` is still waiting on:
|
|
6
|
+
* the streaming pre-pass itself, the SPIKE sharded entity-index scan
|
|
7
|
+
* (`scan-shard` / `shardResultsRemaining`), and the two chunk-dispatch gates
|
|
8
|
+
* (`styles` and `entity-index` — see `dispatchJobsChunk`). A new sibling
|
|
9
|
+
* module (not `geometry-parallel.ts`, which is size-allowlisted and must not
|
|
10
|
+
* grow) so the gate state has one place a consumer can read it from.
|
|
11
|
+
*
|
|
12
|
+
* Precedence when more than one gate is open at once: the EARLIEST phase in
|
|
13
|
+
* the pipeline wins, because it is the one actually responsible for every
|
|
14
|
+
* later phase staying open too (a stuck shard scan means neither the prepass
|
|
15
|
+
* nor either dispatch gate can ever resolve).
|
|
16
|
+
*/
|
|
17
|
+
export class GateTracker {
|
|
18
|
+
shardScanOpen = false;
|
|
19
|
+
prepassOpen = true;
|
|
20
|
+
stylesOpen = true;
|
|
21
|
+
entityIndexOpen = true;
|
|
22
|
+
/** The SPIKE sharded scan dispatched shard-scan to the workers. */
|
|
23
|
+
markShardScanStarted() {
|
|
24
|
+
this.shardScanOpen = true;
|
|
25
|
+
}
|
|
26
|
+
/** Every shard result is in (stitched or fell back to the serial pre-pass). */
|
|
27
|
+
markShardScanDone() {
|
|
28
|
+
this.shardScanOpen = false;
|
|
29
|
+
}
|
|
30
|
+
/** The pre-pass worker's `complete` event arrived. */
|
|
31
|
+
markPrepassDone() {
|
|
32
|
+
this.prepassOpen = false;
|
|
33
|
+
}
|
|
34
|
+
/** The `styles` event (serial or the sharded finalize's synthesized one)
|
|
35
|
+
* reached `dispatchJobsChunk`'s gate. */
|
|
36
|
+
markStylesReceived() {
|
|
37
|
+
this.stylesOpen = false;
|
|
38
|
+
}
|
|
39
|
+
/** The entity index (prepass or sharded-early) reached the same gate. */
|
|
40
|
+
markEntityIndexReceived() {
|
|
41
|
+
this.entityIndexOpen = false;
|
|
42
|
+
}
|
|
43
|
+
/** Which phase a consumer's watchdog should attribute a stall to right now. */
|
|
44
|
+
getStallPhase() {
|
|
45
|
+
if (this.shardScanOpen)
|
|
46
|
+
return 'shard-scan';
|
|
47
|
+
if (this.prepassOpen)
|
|
48
|
+
return 'prepass';
|
|
49
|
+
if (this.stylesOpen)
|
|
50
|
+
return 'styles-gate';
|
|
51
|
+
if (this.entityIndexOpen)
|
|
52
|
+
return 'entity-index-gate';
|
|
53
|
+
return 'workers';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A `getStallPhase` reader that returns a fixed `phase` and closes over
|
|
58
|
+
* NOTHING else (#4979 review). `processParallel`'s `finally` re-seats the
|
|
59
|
+
* caller-owned `stallPhaseHandle` to one of these on teardown: the LIVE
|
|
60
|
+
* reader it installed at the start (`() => gateTracker.getStallPhase()`)
|
|
61
|
+
* closes over `gateTracker`, which — through the rest of that generator's
|
|
62
|
+
* scope — keeps the per-load `sharedBuffer` reachable for as long as the
|
|
63
|
+
* caller holds the handle, even after every worker is gone. A snapshot taken
|
|
64
|
+
* at teardown is exactly as useful for a watchdog that reads it afterwards
|
|
65
|
+
* (the phase cannot change once nothing is left running) without the retention.
|
|
66
|
+
*/
|
|
67
|
+
export function frozenStallPhase(phase) {
|
|
68
|
+
return () => phase;
|
|
69
|
+
}
|
|
70
|
+
// Bound for a pre-worker phase that waits on a single worker's reply (a shard
|
|
71
|
+
// scan, one style slice, styles finalize). Mirrors the desktop first-batch
|
|
72
|
+
// floor/ramp in watchdog.ts (15_000 + MB*30) rather than the browser one
|
|
73
|
+
// (30_000 + MB*60): several of these bounds can be outstanding in the same
|
|
74
|
+
// load, so each gets the smaller half.
|
|
75
|
+
const PRE_WORKER_PHASE_FLOOR_MS = 15_000;
|
|
76
|
+
const PRE_WORKER_PHASE_PER_MB_MS = 30;
|
|
77
|
+
/** Bound (ms) for one pre-worker single-reply phase, scaled by file size. */
|
|
78
|
+
export function preWorkerPhaseBoundMs(fileSizeMB) {
|
|
79
|
+
return Math.max(PRE_WORKER_PHASE_FLOOR_MS, Math.round(PRE_WORKER_PHASE_FLOOR_MS + Math.max(0, fileSizeMB) * PRE_WORKER_PHASE_PER_MB_MS));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Registry for the pre-worker phase-bound timers (#4979 review). A plain
|
|
83
|
+
* `setTimeout` that is never cancelled keeps its own closure — and whatever
|
|
84
|
+
* it closes over, including the per-load `sharedBuffer` — alive for the FULL
|
|
85
|
+
* bound even after the load completes, fails, or is superseded; on a large
|
|
86
|
+
* file that is real memory held for up to 15s + 30ms/MB for no reason. `arm`
|
|
87
|
+
* tracks the handle and self-removes it once it actually fires; `clearAll` is
|
|
88
|
+
* for the generator's own teardown (`finally`, which also runs on `.return()`
|
|
89
|
+
* / abort), which normally fires first.
|
|
90
|
+
*/
|
|
91
|
+
export class PhaseBoundTimers {
|
|
92
|
+
handles = new Set();
|
|
93
|
+
/**
|
|
94
|
+
* Arm a bounded wait for a pre-worker phase that depends on a single
|
|
95
|
+
* worker's reply — shard scan, a style slice, styles finalize (#4902).
|
|
96
|
+
* Fires `onTimeout` once, only if `isSettled()` is still false when the
|
|
97
|
+
* bound elapses, so a genuine reply arriving right at the boundary (which
|
|
98
|
+
* flips the call site's own settled flag before this checks it) always
|
|
99
|
+
* wins.
|
|
100
|
+
*/
|
|
101
|
+
arm(fileSizeMB, isSettled, onTimeout) {
|
|
102
|
+
const handle = setTimeout(() => {
|
|
103
|
+
this.handles.delete(handle);
|
|
104
|
+
if (!isSettled())
|
|
105
|
+
onTimeout();
|
|
106
|
+
}, preWorkerPhaseBoundMs(fileSizeMB));
|
|
107
|
+
this.handles.add(handle);
|
|
108
|
+
}
|
|
109
|
+
/** Cancel every timer still pending — the load exited before its bound. */
|
|
110
|
+
clearAll() {
|
|
111
|
+
for (const handle of this.handles)
|
|
112
|
+
clearTimeout(handle);
|
|
113
|
+
this.handles.clear();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The synthetic prepass-stream `styles` event an older engine binary that
|
|
118
|
+
* never resolves any styles already produces byte-identically (default
|
|
119
|
+
* per-type colours, no voids). Reused as the #4902 finalize-timeout
|
|
120
|
+
* fallback: worker[0]'s `styles-final` reply feeds the exact same path
|
|
121
|
+
* (see `geometry-parallel.ts`'s `msg.type === 'styles-final'` handler), so a
|
|
122
|
+
* degraded stream degrades to a shape the pool already handles rather than a
|
|
123
|
+
* new one.
|
|
124
|
+
*/
|
|
125
|
+
export function emptyStylesPrepassEvent() {
|
|
126
|
+
return {
|
|
127
|
+
type: 'prepass-stream',
|
|
128
|
+
event: {
|
|
129
|
+
type: 'styles',
|
|
130
|
+
styleIds: new Uint32Array(0), styleColors: new Uint8Array(0),
|
|
131
|
+
voidKeys: new Uint32Array(0), voidCounts: new Uint32Array(0), voidValues: new Uint32Array(0),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* A `GeometryDiagnostics` fragment carrying exactly one typed pre-worker-phase
|
|
137
|
+
* failure (#4902), for `mergeGeometryDiagnostics`. Every counter besides
|
|
138
|
+
* `failuresByReason` is zero, so merging this in never fabricates CSG
|
|
139
|
+
* activity that did not happen. `schemaVersion: 0` — this is a host-
|
|
140
|
+
* synthesized fragment, not a producer-versioned wasm payload, and
|
|
141
|
+
* `mergeGeometryDiagnostics` takes the max, so it never lowers a real one.
|
|
142
|
+
*/
|
|
143
|
+
export function preWorkerPhaseFailureDiagnostics(reason) {
|
|
144
|
+
return {
|
|
145
|
+
schemaVersion: 0,
|
|
146
|
+
totalCsgFailures: 0,
|
|
147
|
+
productsWithFailures: 0,
|
|
148
|
+
hostsWithOpenings: 0,
|
|
149
|
+
classification: { rectangular: 0, diagonal: 0, nonRectangular: 0, total: 0 },
|
|
150
|
+
failuresByReason: [{ reason, count: 1 }],
|
|
151
|
+
silentNoOps: 0,
|
|
152
|
+
rectFast: {
|
|
153
|
+
fired: 0,
|
|
154
|
+
openingsCut: 0,
|
|
155
|
+
deferHostNotBox: 0,
|
|
156
|
+
deferNotThrough: 0,
|
|
157
|
+
deferOffFace: 0,
|
|
158
|
+
deferNearEdge: 0,
|
|
159
|
+
deferNoOpenings: 0,
|
|
160
|
+
},
|
|
161
|
+
worstHosts: [],
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=stall-phase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stall-phase.js","sourceRoot":"","sources":["../src/stall-phase.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA4B/D;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,WAAW;IACd,aAAa,GAAG,KAAK,CAAC;IACtB,WAAW,GAAG,IAAI,CAAC;IACnB,UAAU,GAAG,IAAI,CAAC;IAClB,eAAe,GAAG,IAAI,CAAC;IAE/B,mEAAmE;IACnE,oBAAoB;QAClB,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;IAC5B,CAAC;IAED,+EAA+E;IAC/E,iBAAiB;QACf,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED,sDAAsD;IACtD,eAAe;QACb,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;IAC3B,CAAC;IAED;8CAC0C;IAC1C,kBAAkB;QAChB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC1B,CAAC;IAED,yEAAyE;IACzE,uBAAuB;QACrB,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;IAC/B,CAAC;IAED,+EAA+E;IAC/E,aAAa;QACX,IAAI,IAAI,CAAC,aAAa;YAAE,OAAO,YAAY,CAAC;QAC5C,IAAI,IAAI,CAAC,WAAW;YAAE,OAAO,SAAS,CAAC;QACvC,IAAI,IAA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AAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,UAAU,CAAC,CAAC,CAAC;YAC5D,QAAQ,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC;SAC7F;KACF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,gCAAgC,CAAC,MAAc;IAC7D,OAAO;QACL,aAAa,EAAE,CAAC;QAChB,gBAAgB,EAAE,CAAC;QACnB,oBAAoB,EAAE,CAAC;QACvB,iBAAiB,EAAE,CAAC;QACpB,cAAc,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;QAC5E,gBAAgB,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QACxC,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE;YACR,KAAK,EAAE,CAAC;YACR,WAAW,EAAE,CAAC;YACd,eAAe,EAAE,CAAC;YAClB,eAAe,EAAE,CAAC;YAClB,YAAY,EAAE,CAAC;YACf,aAAa,EAAE,CAAC;YAChB,eAAe,EAAE,CAAC;SACnB;QACD,UAAU,EAAE,EAAE;KACf,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -174,9 +174,12 @@ export interface MeshData {
|
|
|
174
174
|
max: [number, number, number];
|
|
175
175
|
};
|
|
176
176
|
/** The resolved `IfcLocalPlacement` chain applied to this mesh (issue
|
|
177
|
-
* #1474): row-major 4x4, 16 numbers, WebGL Y-up
|
|
178
|
-
*
|
|
179
|
-
*
|
|
177
|
+
* #1474): row-major 4x4, 16 numbers, WebGL Y-up axis convention — but its
|
|
178
|
+
* translation is the placement's PRE-RTC absolute origin, not the frame
|
|
179
|
+
* `positions` render in (`mesh_world.rs` assigns this before subtracting
|
|
180
|
+
* the model's RTC offset). Do NOT shift it when RTC changes. Absent when
|
|
181
|
+
* not captured. All of one entity's `MeshData` pieces share the same
|
|
182
|
+
* value (one placement per element). */
|
|
180
183
|
localToWorld?: number[];
|
|
181
184
|
}
|
|
182
185
|
/**
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,WAAW,eAAe;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,YAAY,CAAC;IACtB;;;iFAG6E;IAC7E,OAAO,EAAE,WAAW,CAAC;IACrB;;qFAEiF;IACjF,gBAAgB,CAAC,EAAE;QACjB,IAAI,EAAE,gBAAgB,CAAC;QACvB,wDAAwD;QACxD,OAAO,EAAE,WAAW,CAAC;QACrB,qEAAqE;QACrE,aAAa,EAAE,WAAW,CAAC;QAC3B,mFAAmF;QACnF,aAAa,CAAC,EAAE,WAAW,CAAC;KAC7B,CAAC;IACF;;q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AC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,KAAK,EAAE;QACL,SAAS,EAAE,YAAY,CAAC;QACxB,iEAAiE;QACjE,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,yDAAyD;QACzD,eAAe,CAAC,EAAE,UAAU,CAAC;QAC7B,2CAA2C;QAC3C,WAAW,CAAC,EAAE,WAAW,CAAC;QAC1B,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE;YAAE,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;YAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;SAAE,CAAC;KACxE,CAAC;CACH;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,QAAQ,EAAE,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,cAAc,CAAC;IAC/B;;;;;;;OAOG;IACH,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtD;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD;AASD,cAAc,qBAAqB,CAAC;AACpC,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA2W/D,8EAA8E;AAC9E,gCAAgC;AAChC,2EAA2E;AAC3E,8EAA8E;AAE9E,kFAAkF;AAClF,6EAA6E;AAC7E,cAAc,qBAAqB,CAAC"}
|
package/dist/world-frame.d.ts
CHANGED
|
@@ -42,8 +42,10 @@ export declare function totalYupOffset(info?: RenderFrameInfo | null): Vec3;
|
|
|
42
42
|
export declare function renderFrameWorldOffset(info?: RenderFrameInfo | null): Vec3;
|
|
43
43
|
/** A loaded model as far as the federation frame rule is concerned. */
|
|
44
44
|
export interface FrameCandidate {
|
|
45
|
-
/** Load order; the earliest-loaded model owns the shared frame. */
|
|
45
|
+
/** Load order; the earliest-loaded anchored model owns the shared frame. */
|
|
46
46
|
loadedAt: number;
|
|
47
|
+
/** A model still loading, or failed, has not been converged onto, so it cannot define the frame. */
|
|
48
|
+
loadState?: string;
|
|
47
49
|
geometryResult?: {
|
|
48
50
|
coordinateInfo?: CoordinateInfo | null;
|
|
49
51
|
} | null;
|
|
@@ -51,12 +53,49 @@ export interface FrameCandidate {
|
|
|
51
53
|
/**
|
|
52
54
|
* The `CoordinateInfo` whose frame a set of loaded models is drawn in.
|
|
53
55
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
*
|
|
56
|
+
* The rule is the anchor rule (#4897): the earliest-loaded model that HAS a
|
|
57
|
+
* `wasmRtcOffset` defines the frame; only when no model has one does the
|
|
58
|
+
* earliest-loaded model with any `coordinateInfo` answer (every model is then
|
|
59
|
+
* raw). The federation loader converges every other meshed model onto that
|
|
60
|
+
* same anchor after each load (`rtc-rebase.ts`, via the viewer's
|
|
61
|
+
* `federationRtcRebase.ts`), so in either load order this returns the frame the
|
|
62
|
+
* geometry is actually in. The earlier "earliest model with any
|
|
63
|
+
* `coordinateInfo`" rule reported a near-origin model's raw frame whenever it
|
|
64
|
+
* was loaded first, including for a raw point cloud, which never joins the
|
|
65
|
+
* RTC frame.
|
|
66
|
+
*
|
|
67
|
+
* Models whose `loadState` is `pending`, `streaming-geometry` or `error` are
|
|
68
|
+
* only considered when no settled model has a frame. The same set the
|
|
69
|
+
* convergence treats as settled: until such a load settles the other models
|
|
70
|
+
* have not been converged onto its anchor, so the settled frame stays the
|
|
71
|
+
* reported one.
|
|
72
|
+
*
|
|
73
|
+
* `fallback` covers a single model loaded without a federation entry. Null
|
|
74
|
+
* when nothing has geometry. The one case where the geometry does NOT all
|
|
75
|
+
* match is a GPU-instanced model the loader could not move; the viewer
|
|
76
|
+
* reports that to the user instead of leaving it silent.
|
|
58
77
|
*/
|
|
59
78
|
export declare function federationFrameInfo(models: Iterable<FrameCandidate>, fallback?: {
|
|
60
79
|
coordinateInfo?: CoordinateInfo | null;
|
|
61
80
|
} | null): CoordinateInfo | null;
|
|
81
|
+
/**
|
|
82
|
+
* The real `wasmRtcOffset` a single model carries, or `null` if it has none
|
|
83
|
+
* (still meshed raw). The single-candidate counterpart to
|
|
84
|
+
* {@link chooseSharedRtcOffset}: callers that need one specific model's own
|
|
85
|
+
* anchor — e.g. to decide whether it just introduced the federation's
|
|
86
|
+
* first real anchor — read it through here rather than destructuring
|
|
87
|
+
* `geometryResult.coordinateInfo.wasmRtcOffset` themselves.
|
|
88
|
+
*/
|
|
89
|
+
export declare function realRtcAnchorOf(candidate?: FrameCandidate | null): Readonly<Vec3> | null;
|
|
90
|
+
/**
|
|
91
|
+
* The `sharedRtcOffset` a newly-loading model should be given: the earliest
|
|
92
|
+
* already-loaded model's `wasmRtcOffset`, or `undefined` when no
|
|
93
|
+
* already-loaded model has one yet (including when there is no earlier
|
|
94
|
+
* model at all) — the loading model is then free to detect its own.
|
|
95
|
+
*
|
|
96
|
+
* The same rule picks the anchor every already-loaded model is converged onto
|
|
97
|
+
* after a load (`rtc-rebase.ts`), so a model loaded before the first anchored
|
|
98
|
+
* one is moved onto it rather than left in the raw frame it was meshed in.
|
|
99
|
+
*/
|
|
100
|
+
export declare function chooseSharedRtcOffset(existingModels: Iterable<FrameCandidate>): Vec3 | undefined;
|
|
62
101
|
//# sourceMappingURL=world-frame.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world-frame.d.ts","sourceRoot":"","sources":["../src/world-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAIlE,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACvC,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAE3D;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAE3D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAQlE;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,CAAC,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAG1E;AAED,uEAAuE;AACvE,MAAM,WAAW,cAAc;IAC7B,
|
|
1
|
+
{"version":3,"file":"world-frame.d.ts","sourceRoot":"","sources":["../src/world-frame.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAIlE,gFAAgF;AAChF,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IACpC,aAAa,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,IAAI,CA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ame a set of loaded models is drawn in.
|
|
41
41
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
42
|
+
* The rule is the anchor rule (#4897): the earliest-loaded model that HAS a
|
|
43
|
+
* `wasmRtcOffset` defines the frame; only when no model has one does the
|
|
44
|
+
* earliest-loaded model with any `coordinateInfo` answer (every model is then
|
|
45
|
+
* raw). The federation loader converges every other meshed model onto that
|
|
46
|
+
* same anchor after each load (`rtc-rebase.ts`, via the viewer's
|
|
47
|
+
* `federationRtcRebase.ts`), so in either load order this returns the frame the
|
|
48
|
+
* geometry is actually in. The earlier "earliest model with any
|
|
49
|
+
* `coordinateInfo`" rule reported a near-origin model's raw frame whenever it
|
|
50
|
+
* was loaded first, including for a raw point cloud, which never joins the
|
|
51
|
+
* RTC frame.
|
|
52
|
+
*
|
|
53
|
+
* Models whose `loadState` is `pending`, `streaming-geometry` or `error` are
|
|
54
|
+
* only considered when no settled model has a frame. The same set the
|
|
55
|
+
* convergence treats as settled: until such a load settles the other models
|
|
56
|
+
* have not been converged onto its anchor, so the settled frame stays the
|
|
57
|
+
* reported one.
|
|
58
|
+
*
|
|
59
|
+
* `fallback` covers a single model loaded without a federation entry. Null
|
|
60
|
+
* when nothing has geometry. The one case where the geometry does NOT all
|
|
61
|
+
* match is a GPU-instanced model the loader could not move; the viewer
|
|
62
|
+
* reports that to the user instead of leaving it silent.
|
|
46
63
|
*/
|
|
47
64
|
export function federationFrameInfo(models, fallback) {
|
|
65
|
+
const all = [...models];
|
|
66
|
+
const settled = all.filter((model) => model.loadState !== 'pending' && model.loadState !== 'streaming-geometry' && model.loadState !== 'error');
|
|
67
|
+
return frameOf(settled) ?? frameOf(all) ?? fallback?.coordinateInfo ?? null;
|
|
68
|
+
}
|
|
69
|
+
/** The anchor rule over one candidate set: earliest anchored, else earliest with a frame. */
|
|
70
|
+
function frameOf(models) {
|
|
48
71
|
let earliest = Infinity;
|
|
72
|
+
let earliestAnchored = Infinity;
|
|
49
73
|
let info = null;
|
|
74
|
+
let anchoredInfo = null;
|
|
50
75
|
for (const model of models) {
|
|
51
76
|
const candidate = model.geometryResult?.coordinateInfo;
|
|
52
|
-
if (candidate
|
|
77
|
+
if (!candidate)
|
|
78
|
+
continue;
|
|
79
|
+
if (model.loadedAt < earliest) {
|
|
53
80
|
earliest = model.loadedAt;
|
|
54
81
|
info = candidate;
|
|
55
82
|
}
|
|
83
|
+
if (candidate.wasmRtcOffset != null && model.loadedAt < earliestAnchored) {
|
|
84
|
+
earliestAnchored = model.loadedAt;
|
|
85
|
+
anchoredInfo = candidate;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return anchoredInfo ?? info;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The real `wasmRtcOffset` a single model carries, or `null` if it has none
|
|
92
|
+
* (still meshed raw). The single-candidate counterpart to
|
|
93
|
+
* {@link chooseSharedRtcOffset}: callers that need one specific model's own
|
|
94
|
+
* anchor — e.g. to decide whether it just introduced the federation's
|
|
95
|
+
* first real anchor — read it through here rather than destructuring
|
|
96
|
+
* `geometryResult.coordinateInfo.wasmRtcOffset` themselves.
|
|
97
|
+
*/
|
|
98
|
+
export function realRtcAnchorOf(candidate) {
|
|
99
|
+
return candidate?.geometryResult?.coordinateInfo?.wasmRtcOffset ?? null;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* The `sharedRtcOffset` a newly-loading model should be given: the earliest
|
|
103
|
+
* already-loaded model's `wasmRtcOffset`, or `undefined` when no
|
|
104
|
+
* already-loaded model has one yet (including when there is no earlier
|
|
105
|
+
* model at all) — the loading model is then free to detect its own.
|
|
106
|
+
*
|
|
107
|
+
* The same rule picks the anchor every already-loaded model is converged onto
|
|
108
|
+
* after a load (`rtc-rebase.ts`), so a model loaded before the first anchored
|
|
109
|
+
* one is moved onto it rather than left in the raw frame it was meshed in.
|
|
110
|
+
*/
|
|
111
|
+
export function chooseSharedRtcOffset(existingModels) {
|
|
112
|
+
let earliestOffsetAt = Infinity;
|
|
113
|
+
let earliestOffset = null;
|
|
114
|
+
for (const model of existingModels) {
|
|
115
|
+
const offset = model.geometryResult?.coordinateInfo?.wasmRtcOffset;
|
|
116
|
+
if (offset != null && model.loadedAt < earliestOffsetAt) {
|
|
117
|
+
earliestOffsetAt = model.loadedAt;
|
|
118
|
+
earliestOffset = offset;
|
|
119
|
+
}
|
|
56
120
|
}
|
|
57
|
-
return
|
|
121
|
+
return earliestOffset ? { ...earliestOffset } : undefined;
|
|
58
122
|
}
|
|
59
123
|
//# sourceMappingURL=world-frame.js.map
|
package/dist/world-frame.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"world-frame.js","sourceRoot":"","sources":["../src/world-frame.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAsB/D,MAAM,IAAI,GAAS,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC;AAQxC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAqB;IACnD,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,eAAe,CAAC,KAAqB;IACnD,OAAO,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC;AACpD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,IAA6B;IAC1D,MAAM,KAAK,GAAG,IAAI,EAAE,WAAW,IAAI,IAAI,CAAC;IACxC,MAAM,MAAM,GAAG,eAAe,CAAC,IAAI,EAAE,aAAa,IAAI,IAAI,CAAC,CAAC;IAC5D,OAAO;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,SAAS,CAAC;AAC5D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/geometry",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.4.0",
|
|
4
4
|
"description": "Geometry processing bridge for IFC-Lite - exact-arithmetic CSG, streamed across workers",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -20,12 +20,17 @@
|
|
|
20
20
|
"types": "./dist/world-frame.d.ts",
|
|
21
21
|
"import": "./dist/world-frame.js",
|
|
22
22
|
"default": "./dist/world-frame.js"
|
|
23
|
+
},
|
|
24
|
+
"./rtc-rebase": {
|
|
25
|
+
"types": "./dist/rtc-rebase.d.ts",
|
|
26
|
+
"import": "./dist/rtc-rebase.js",
|
|
27
|
+
"default": "./dist/rtc-rebase.js"
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
"dependencies": {
|
|
26
|
-
"@ifc-lite/
|
|
27
|
-
"@ifc-lite/
|
|
28
|
-
"@ifc-lite/wasm
|
|
31
|
+
"@ifc-lite/wasm-lifecycle": "^0.2.0",
|
|
32
|
+
"@ifc-lite/data": "^5.0.0",
|
|
33
|
+
"@ifc-lite/wasm": "^9.2.0"
|
|
29
34
|
},
|
|
30
35
|
"optionalDependencies": {
|
|
31
36
|
"@tauri-apps/api": "^2.11.1"
|