@ifc-lite/geometry 1.18.5 → 2.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.
- package/README.md +1 -1
- package/dist/geometry-coordinate.d.ts +0 -5
- package/dist/geometry-coordinate.d.ts.map +1 -1
- package/dist/geometry-coordinate.js +8 -19
- package/dist/geometry-coordinate.js.map +1 -1
- package/dist/geometry-parallel.d.ts +4 -26
- package/dist/geometry-parallel.d.ts.map +1 -1
- package/dist/geometry-parallel.js +5 -23
- package/dist/geometry-parallel.js.map +1 -1
- package/dist/geometry.worker.d.ts +0 -1
- package/dist/geometry.worker.d.ts.map +1 -1
- package/dist/geometry.worker.js.map +1 -1
- package/dist/ifc-lite-bridge.d.ts +2 -58
- package/dist/ifc-lite-bridge.d.ts.map +1 -1
- package/dist/ifc-lite-bridge.js +5 -127
- package/dist/ifc-lite-bridge.js.map +1 -1
- package/dist/index.d.ts +17 -46
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +100 -293
- package/dist/index.js.map +1 -1
- package/dist/platform-bridge.d.ts +6 -3
- package/dist/platform-bridge.d.ts.map +1 -1
- package/dist/platform-bridge.js +7 -7
- package/dist/platform-bridge.js.map +1 -1
- package/dist/progressive-loader.d.ts +5 -56
- package/dist/progressive-loader.d.ts.map +1 -1
- package/dist/progressive-loader.js +7 -132
- package/dist/progressive-loader.js.map +1 -1
- package/dist/types.d.ts +8 -29
- package/dist/types.d.ts.map +1 -1
- package/package.json +11 -20
- package/dist/default-materials.d.ts +0 -22
- package/dist/default-materials.d.ts.map +0 -1
- package/dist/default-materials.js +0 -124
- package/dist/default-materials.js.map +0 -1
- package/dist/geometry-controller.worker.d.ts +0 -4
- package/dist/geometry-controller.worker.d.ts.map +0 -1
- package/dist/geometry-controller.worker.js +0 -402
- package/dist/geometry-controller.worker.js.map +0 -1
- package/dist/geometry-deduplicator.d.ts +0 -42
- package/dist/geometry-deduplicator.d.ts.map +0 -1
- package/dist/geometry-deduplicator.js +0 -80
- package/dist/geometry-deduplicator.js.map +0 -1
- package/dist/ifc-lite-mesh-collector.d.ts +0 -111
- package/dist/ifc-lite-mesh-collector.d.ts.map +0 -1
- package/dist/ifc-lite-mesh-collector.js +0 -447
- package/dist/ifc-lite-mesh-collector.js.map +0 -1
- package/dist/lod.d.ts +0 -60
- package/dist/lod.d.ts.map +0 -1
- package/dist/lod.js +0 -113
- package/dist/lod.js.map +0 -1
- package/dist/style-cache.d.ts +0 -36
- package/dist/style-cache.d.ts.map +0 -1
- package/dist/style-cache.js +0 -127
- package/dist/style-cache.js.map +0 -1
- package/dist/wasm-bridge.d.ts +0 -22
- package/dist/wasm-bridge.d.ts.map +0 -1
- package/dist/wasm-bridge.js +0 -120
- package/dist/wasm-bridge.js.map +0 -1
- package/dist/wasm-memory-manager.d.ts +0 -178
- package/dist/wasm-memory-manager.d.ts.map +0 -1
- package/dist/wasm-memory-manager.js +0 -86
- package/dist/wasm-memory-manager.js.map +0 -1
- package/dist/zero-copy-collector.d.ts +0 -158
- package/dist/zero-copy-collector.d.ts.map +0 -1
- package/dist/zero-copy-collector.js +0 -224
- package/dist/zero-copy-collector.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-lite-mesh-collector.d.ts","sourceRoot":"","sources":["../src/ifc-lite-mesh-collector.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAc,iBAAiB,EAAkB,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAI3C,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,QAAQ,GAAG,iBAAiB,GAAG,SAAS,CAAC;CACjD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,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H,aAAa,IAAI,QAAQ,EAAE;IA8E3B;;OAEG;IACH,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAIzC;;;;OAIG;IACI,sBAAsB,CAAC,SAAS,GAAE,MAAW,GAAG,cAAc,CAAC,QAAQ,EAAE,GAAG,yBAAyB,GAAG,uBAAuB,CAAC;IAkMvI;;;;OAIG;IACI,6BAA6B,CAClC,YAAY,EAAE,MAAM,MAAM,GACzB,cAAc,CAAC,QAAQ,EAAE,CAAC;IAmC7B;;;;;OAKG;IACI,iCAAiC,CAAC,SAAS,GAAE,MAAW,GAAG,cAAc,CAAC,iBAAiB,EAAE,CAAC;CAkFtG"}
|
|
@@ -1,447 +0,0 @@
|
|
|
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
|
-
* IFC-Lite Mesh Collector - extracts triangle data from IFC-Lite WASM
|
|
6
|
-
* Replaces mesh-collector.ts - uses native Rust geometry processing (1.9x faster)
|
|
7
|
-
*/
|
|
8
|
-
import { createLogger } from '@ifc-lite/data';
|
|
9
|
-
const log = createLogger('MeshCollector');
|
|
10
|
-
export class IfcLiteMeshCollector {
|
|
11
|
-
ifcApi;
|
|
12
|
-
content;
|
|
13
|
-
_buildingRotation;
|
|
14
|
-
mergeLayers;
|
|
15
|
-
mergeLayersApplied = false;
|
|
16
|
-
constructor(ifcApi, content, options = {}) {
|
|
17
|
-
this.ifcApi = ifcApi;
|
|
18
|
-
this.content = content;
|
|
19
|
-
this.mergeLayers = options.mergeLayers === true;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Forward the cached `mergeLayers` flag to the IfcAPI once per
|
|
23
|
-
* collector instance. The Rust agent's contract is "state on the
|
|
24
|
-
* IfcAPI carries forward to subsequent parseMeshes* calls", so we
|
|
25
|
-
* only need to push the flag once before the first parse call.
|
|
26
|
-
*
|
|
27
|
-
* When the WASM build pre-dates the Rust agent's contract, the
|
|
28
|
-
* method is missing — we tolerate that silently because the bridge
|
|
29
|
-
* already logged a warning on its own `applyMergeLayers` path.
|
|
30
|
-
*/
|
|
31
|
-
ensureMergeLayersApplied() {
|
|
32
|
-
if (this.mergeLayersApplied)
|
|
33
|
-
return;
|
|
34
|
-
this.mergeLayersApplied = true;
|
|
35
|
-
const api = this.ifcApi;
|
|
36
|
-
if (typeof api.setMergeLayers === 'function') {
|
|
37
|
-
api.setMergeLayers(this.mergeLayers);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Convert IFC Z-up coordinates to WebGL Y-up coordinates
|
|
42
|
-
* IFC uses Z-up (Z points up), WebGL uses Y-up (Y points up)
|
|
43
|
-
* Transformation: swap Y and Z, then negate new Z to maintain right-handedness
|
|
44
|
-
*/
|
|
45
|
-
convertZUpToYUp(coords) {
|
|
46
|
-
for (let i = 0; i < coords.length; i += 3) {
|
|
47
|
-
const y = coords[i + 1];
|
|
48
|
-
const z = coords[i + 2];
|
|
49
|
-
// Swap Y and Z: Z-up → Y-up
|
|
50
|
-
coords[i + 1] = z; // New Y = old Z (vertical)
|
|
51
|
-
coords[i + 2] = -y; // New Z = -old Y (depth, negated for right-hand rule)
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Reverse triangle winding order to correct for handedness flip.
|
|
56
|
-
* The Z-up to Y-up conversion includes a reflection (Z negation),
|
|
57
|
-
* which flips the handedness. This reverses winding to compensate,
|
|
58
|
-
* ensuring triangles face the correct direction after transformation.
|
|
59
|
-
*/
|
|
60
|
-
reverseWindingOrder(indices) {
|
|
61
|
-
// Calculate last valid triangle index to avoid out-of-bounds access
|
|
62
|
-
const remainder = indices.length % 3;
|
|
63
|
-
const end = indices.length - remainder;
|
|
64
|
-
// Warn if indices array has trailing non-triangle entries
|
|
65
|
-
if (remainder !== 0) {
|
|
66
|
-
console.warn(`[reverseWindingOrder] Index buffer has ${remainder} trailing entries (not divisible by 3)`);
|
|
67
|
-
}
|
|
68
|
-
for (let i = 0; i < end; i += 3) {
|
|
69
|
-
// Swap second and third vertex of each triangle
|
|
70
|
-
const temp = indices[i + 1];
|
|
71
|
-
indices[i + 1] = indices[i + 2];
|
|
72
|
-
indices[i + 2] = temp;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Collect all meshes from IFC-Lite
|
|
77
|
-
* Much faster than web-ifc (~1.9x speedup)
|
|
78
|
-
*/
|
|
79
|
-
collectMeshes() {
|
|
80
|
-
this.ensureMergeLayersApplied();
|
|
81
|
-
let collection;
|
|
82
|
-
try {
|
|
83
|
-
collection = this.ifcApi.parseMeshes(this.content);
|
|
84
|
-
}
|
|
85
|
-
catch (error) {
|
|
86
|
-
log.error('WASM mesh parsing failed', error, { operation: 'collectMeshes' });
|
|
87
|
-
throw error;
|
|
88
|
-
}
|
|
89
|
-
const meshes = [];
|
|
90
|
-
let failedMeshes = 0;
|
|
91
|
-
// Convert MeshCollection to MeshData[]
|
|
92
|
-
for (let i = 0; i < collection.length; i++) {
|
|
93
|
-
let mesh = null;
|
|
94
|
-
try {
|
|
95
|
-
mesh = collection.get(i);
|
|
96
|
-
if (!mesh) {
|
|
97
|
-
failedMeshes++;
|
|
98
|
-
continue;
|
|
99
|
-
}
|
|
100
|
-
// Get color array [r, g, b, a]
|
|
101
|
-
const colorArray = mesh.color;
|
|
102
|
-
const color = [
|
|
103
|
-
colorArray[0],
|
|
104
|
-
colorArray[1],
|
|
105
|
-
colorArray[2],
|
|
106
|
-
colorArray[3],
|
|
107
|
-
];
|
|
108
|
-
// Z-up→Y-up conversion and winding order reversal are now done
|
|
109
|
-
// in Rust (MeshDataJs::new) for performance.
|
|
110
|
-
meshes.push({
|
|
111
|
-
expressId: mesh.expressId,
|
|
112
|
-
ifcType: mesh.ifcType,
|
|
113
|
-
positions: mesh.positions,
|
|
114
|
-
normals: mesh.normals,
|
|
115
|
-
indices: mesh.indices,
|
|
116
|
-
color,
|
|
117
|
-
});
|
|
118
|
-
// Free the individual mesh to avoid memory leaks
|
|
119
|
-
mesh.free();
|
|
120
|
-
mesh = null; // Mark as freed
|
|
121
|
-
}
|
|
122
|
-
catch (error) {
|
|
123
|
-
failedMeshes++;
|
|
124
|
-
log.caught(`Failed to process mesh ${i}`, error, { operation: 'collectMeshes' });
|
|
125
|
-
// Ensure mesh is freed even on error
|
|
126
|
-
if (mesh) {
|
|
127
|
-
try {
|
|
128
|
-
mesh.free();
|
|
129
|
-
}
|
|
130
|
-
catch {
|
|
131
|
-
// Ignore errors during cleanup
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
// Extract building rotation before freeing collection
|
|
137
|
-
const buildingRotation = collection.buildingRotation ?? undefined;
|
|
138
|
-
// Free the collection
|
|
139
|
-
collection.free();
|
|
140
|
-
if (failedMeshes > 0) {
|
|
141
|
-
log.warn(`Skipped ${failedMeshes} meshes due to errors`, { operation: 'collectMeshes' });
|
|
142
|
-
}
|
|
143
|
-
log.debug(`Collected ${meshes.length} meshes`, { operation: 'collectMeshes' });
|
|
144
|
-
// Store building rotation for later use (will be added to CoordinateInfo)
|
|
145
|
-
this._buildingRotation = buildingRotation;
|
|
146
|
-
return meshes;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Get building rotation extracted from IfcSite placement
|
|
150
|
-
*/
|
|
151
|
-
getBuildingRotation() {
|
|
152
|
-
return this._buildingRotation;
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Collect meshes incrementally, yielding batches for progressive rendering
|
|
156
|
-
* Uses fast-first-frame streaming: simple geometry (walls, slabs) first
|
|
157
|
-
* @param batchSize Number of meshes per batch (default: 25 for faster first frame)
|
|
158
|
-
*/
|
|
159
|
-
async *collectMeshesStreaming(batchSize = 25) {
|
|
160
|
-
this.ensureMergeLayersApplied();
|
|
161
|
-
// Queue to hold batches produced by async callback
|
|
162
|
-
const batchQueue = [];
|
|
163
|
-
let resolveWaiting = null;
|
|
164
|
-
let isComplete = false;
|
|
165
|
-
let processingError = null;
|
|
166
|
-
// Map to store color updates for pending batches
|
|
167
|
-
const colorUpdates = new Map();
|
|
168
|
-
let totalMeshesProcessed = 0;
|
|
169
|
-
let failedMeshCount = 0;
|
|
170
|
-
// Start async processing
|
|
171
|
-
// NOTE: WASM now automatically defers style building for faster first frame
|
|
172
|
-
const processingPromise = this.ifcApi.parseMeshesAsync(this.content, {
|
|
173
|
-
batchSize,
|
|
174
|
-
onRtcOffset: (rtc) => {
|
|
175
|
-
// Emit RTC offset event so consumer can capture it
|
|
176
|
-
batchQueue.push({
|
|
177
|
-
type: 'rtcOffset',
|
|
178
|
-
rtcOffset: { x: rtc.x, y: rtc.y, z: rtc.z },
|
|
179
|
-
hasRtc: rtc.hasRtc,
|
|
180
|
-
});
|
|
181
|
-
// Wake up the generator if it's waiting
|
|
182
|
-
if (resolveWaiting) {
|
|
183
|
-
resolveWaiting();
|
|
184
|
-
resolveWaiting = null;
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
onColorUpdate: (updates) => {
|
|
188
|
-
// Store color updates
|
|
189
|
-
for (const [expressId, color] of updates) {
|
|
190
|
-
colorUpdates.set(expressId, color);
|
|
191
|
-
}
|
|
192
|
-
// Emit color update event
|
|
193
|
-
batchQueue.push({
|
|
194
|
-
type: 'colorUpdate',
|
|
195
|
-
updates: new Map(updates),
|
|
196
|
-
});
|
|
197
|
-
// Wake up the generator if it's waiting
|
|
198
|
-
if (resolveWaiting) {
|
|
199
|
-
resolveWaiting();
|
|
200
|
-
resolveWaiting = null;
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
onBatch: (meshes, _progress) => {
|
|
204
|
-
// Convert WASM meshes to MeshData[]
|
|
205
|
-
const convertedBatch = [];
|
|
206
|
-
for (const mesh of meshes) {
|
|
207
|
-
try {
|
|
208
|
-
// Use updated color if available, otherwise use mesh color
|
|
209
|
-
const expressId = mesh.expressId;
|
|
210
|
-
const color = colorUpdates.get(expressId) ?? [
|
|
211
|
-
mesh.color[0],
|
|
212
|
-
mesh.color[1],
|
|
213
|
-
mesh.color[2],
|
|
214
|
-
mesh.color[3],
|
|
215
|
-
];
|
|
216
|
-
// Capture arrays once — Z-up→Y-up conversion and winding order
|
|
217
|
-
// reversal are now done in Rust (MeshDataJs::new) for performance.
|
|
218
|
-
convertedBatch.push({
|
|
219
|
-
expressId,
|
|
220
|
-
ifcType: mesh.ifcType,
|
|
221
|
-
positions: mesh.positions,
|
|
222
|
-
normals: mesh.normals,
|
|
223
|
-
indices: mesh.indices,
|
|
224
|
-
color,
|
|
225
|
-
});
|
|
226
|
-
// Free the mesh to avoid memory leaks
|
|
227
|
-
mesh.free();
|
|
228
|
-
totalMeshesProcessed++;
|
|
229
|
-
}
|
|
230
|
-
catch (error) {
|
|
231
|
-
failedMeshCount++;
|
|
232
|
-
log.caught(`Failed to process mesh #${mesh.expressId}`, error, {
|
|
233
|
-
operation: 'collectMeshesStreaming',
|
|
234
|
-
entityId: mesh.expressId,
|
|
235
|
-
});
|
|
236
|
-
try {
|
|
237
|
-
mesh.free();
|
|
238
|
-
}
|
|
239
|
-
catch {
|
|
240
|
-
// Ignore free errors
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
// Add batch to queue
|
|
245
|
-
if (convertedBatch.length > 0) {
|
|
246
|
-
batchQueue.push(convertedBatch);
|
|
247
|
-
}
|
|
248
|
-
// Wake up the generator if it's waiting
|
|
249
|
-
if (resolveWaiting) {
|
|
250
|
-
resolveWaiting();
|
|
251
|
-
resolveWaiting = null;
|
|
252
|
-
}
|
|
253
|
-
},
|
|
254
|
-
onComplete: (stats) => {
|
|
255
|
-
isComplete = true;
|
|
256
|
-
// Store building rotation if present
|
|
257
|
-
if (stats.buildingRotation !== undefined) {
|
|
258
|
-
this._buildingRotation = stats.buildingRotation;
|
|
259
|
-
}
|
|
260
|
-
log.debug(`Streaming complete: ${stats.totalMeshes} meshes, ${stats.totalVertices} vertices, ${stats.totalTriangles} triangles`, {
|
|
261
|
-
operation: 'collectMeshesStreaming',
|
|
262
|
-
});
|
|
263
|
-
if (failedMeshCount > 0) {
|
|
264
|
-
log.warn(`Skipped ${failedMeshCount} meshes due to errors`, { operation: 'collectMeshesStreaming' });
|
|
265
|
-
}
|
|
266
|
-
// T1.3 / classifier-fix diagnostics: surface the structured CSG
|
|
267
|
-
// diagnostics object the WASM bindings attach to `stats`. Logged
|
|
268
|
-
// here on the JS side too because `web_sys::console::*` from
|
|
269
|
-
// inside the WASM streaming path can be invisible in some
|
|
270
|
-
// browser/build combos (worker boundary, log-level filtering).
|
|
271
|
-
// A JS console.warn is the most reliable "always shows up" channel.
|
|
272
|
-
const diag = stats.csgDiagnostics;
|
|
273
|
-
if (diag) {
|
|
274
|
-
const totalFailures = diag.totalFailures ?? 0;
|
|
275
|
-
// Only surface a `console.warn` when the kernel actually dropped
|
|
276
|
-
// a cut — successful parses shouldn't add noise to host apps
|
|
277
|
-
// embedding the viewer. The full diagnostics object is still
|
|
278
|
-
// attached to `stats.csgDiagnostics` for callers that want it.
|
|
279
|
-
if (totalFailures > 0) {
|
|
280
|
-
const c = diag.classification ?? {};
|
|
281
|
-
// eslint-disable-next-line no-console
|
|
282
|
-
console.warn(`[IFC-LITE] CSG diagnostics (JS): classifier=${JSON.stringify(c)}, ` +
|
|
283
|
-
`totalFailures=${totalFailures}, ` +
|
|
284
|
-
`productsWithFailures=${diag.productsWithFailures ?? 0}, ` +
|
|
285
|
-
`hostsWithOpenings=${diag.hostsWithOpenings ?? 0}`);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
// Wake up the generator if it's waiting
|
|
289
|
-
if (resolveWaiting) {
|
|
290
|
-
resolveWaiting();
|
|
291
|
-
resolveWaiting = null;
|
|
292
|
-
}
|
|
293
|
-
},
|
|
294
|
-
}).catch((error) => {
|
|
295
|
-
processingError = error instanceof Error ? error : new Error(String(error));
|
|
296
|
-
log.error('WASM streaming parsing failed', processingError, { operation: 'collectMeshesStreaming' });
|
|
297
|
-
isComplete = true;
|
|
298
|
-
if (resolveWaiting) {
|
|
299
|
-
resolveWaiting();
|
|
300
|
-
resolveWaiting = null;
|
|
301
|
-
}
|
|
302
|
-
});
|
|
303
|
-
// Yield batches as they become available
|
|
304
|
-
let yieldedBatchCount = 0;
|
|
305
|
-
while (true) {
|
|
306
|
-
// Yield any queued batches
|
|
307
|
-
while (batchQueue.length > 0) {
|
|
308
|
-
yieldedBatchCount++;
|
|
309
|
-
yield batchQueue.shift();
|
|
310
|
-
}
|
|
311
|
-
// Check for errors
|
|
312
|
-
if (processingError) {
|
|
313
|
-
throw processingError;
|
|
314
|
-
}
|
|
315
|
-
// Check if we're done
|
|
316
|
-
if (isComplete && batchQueue.length === 0) {
|
|
317
|
-
break;
|
|
318
|
-
}
|
|
319
|
-
// Wait for more batches
|
|
320
|
-
await new Promise((resolve) => {
|
|
321
|
-
resolveWaiting = resolve;
|
|
322
|
-
});
|
|
323
|
-
}
|
|
324
|
-
// Warn if WASM returned 0 results for a non-trivially-sized file
|
|
325
|
-
// This typically indicates WASM ran out of memory during parsing
|
|
326
|
-
if (yieldedBatchCount === 0 && this.content.length > 1000) {
|
|
327
|
-
const sizeMB = (this.content.length / (1024 * 1024)).toFixed(1);
|
|
328
|
-
log.warn(`WASM streaming returned 0 batches for ${sizeMB}MB file - ` +
|
|
329
|
-
`this may indicate insufficient memory for large file processing`, { operation: 'collectMeshesStreaming', data: { contentLength: this.content.length } });
|
|
330
|
-
}
|
|
331
|
-
// Ensure processing is complete
|
|
332
|
-
await processingPromise;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Collect meshes with dynamic batch sizing (ramp-up approach)
|
|
336
|
-
* Accumulates meshes from WASM and yields them in dynamically-sized batches
|
|
337
|
-
* @param getBatchSize Function that returns batch size for current batch number
|
|
338
|
-
*/
|
|
339
|
-
async *collectMeshesStreamingDynamic(getBatchSize) {
|
|
340
|
-
let batchNumber = 0;
|
|
341
|
-
let accumulatedMeshes = [];
|
|
342
|
-
let currentBatchSize = getBatchSize();
|
|
343
|
-
// Use larger WASM batches to reduce callback overhead
|
|
344
|
-
// First frame responsiveness comes from WASM's internal simple/complex ordering
|
|
345
|
-
// For huge files (>100MB), use 500 to minimize callbacks (20x fewer than 25)
|
|
346
|
-
const wasmBatchSize = 500; // Larger batches = fewer callbacks = faster
|
|
347
|
-
for await (const item of this.collectMeshesStreaming(wasmBatchSize)) {
|
|
348
|
-
// Skip color update events in dynamic batching
|
|
349
|
-
if (item && typeof item === 'object' && 'type' in item && item.type === 'colorUpdate') {
|
|
350
|
-
continue;
|
|
351
|
-
}
|
|
352
|
-
const wasmBatch = item;
|
|
353
|
-
for (let i = 0; i < wasmBatch.length; i++)
|
|
354
|
-
accumulatedMeshes.push(wasmBatch[i]);
|
|
355
|
-
// Yield when we've accumulated enough for current dynamic batch size
|
|
356
|
-
while (accumulatedMeshes.length >= currentBatchSize) {
|
|
357
|
-
const batchToYield = accumulatedMeshes.splice(0, currentBatchSize);
|
|
358
|
-
yield batchToYield;
|
|
359
|
-
// Update batch size for next batch
|
|
360
|
-
batchNumber++;
|
|
361
|
-
currentBatchSize = getBatchSize();
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
// Yield remaining meshes
|
|
365
|
-
if (accumulatedMeshes.length > 0) {
|
|
366
|
-
yield accumulatedMeshes;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Collect instanced geometry incrementally, yielding batches for progressive rendering
|
|
371
|
-
* Groups identical geometries by hash (before transformation) for GPU instancing
|
|
372
|
-
* Uses fast-first-frame streaming: simple geometry (walls, slabs) first
|
|
373
|
-
* @param batchSize Number of unique geometries per batch (default: 25)
|
|
374
|
-
*/
|
|
375
|
-
async *collectInstancedGeometryStreaming(batchSize = 25) {
|
|
376
|
-
this.ensureMergeLayersApplied();
|
|
377
|
-
// Queue to hold batches produced by async callback
|
|
378
|
-
const batchQueue = [];
|
|
379
|
-
let resolveWaiting = null;
|
|
380
|
-
let isComplete = false;
|
|
381
|
-
let processingError = null;
|
|
382
|
-
// Start async processing
|
|
383
|
-
const processingPromise = this.ifcApi.parseMeshesInstancedAsync(this.content, {
|
|
384
|
-
batchSize,
|
|
385
|
-
onBatch: (geometries, _progress) => {
|
|
386
|
-
// NOTE: Do NOT convert Z-up to Y-up here for instanced geometry!
|
|
387
|
-
// Instance transforms position geometry in world space.
|
|
388
|
-
// If we convert local positions but not transforms, geometry breaks.
|
|
389
|
-
// The viewer handles coordinate system in the camera/shader.
|
|
390
|
-
// Add batch directly to queue without modification
|
|
391
|
-
batchQueue.push(geometries);
|
|
392
|
-
// Wake up the generator if it's waiting
|
|
393
|
-
if (resolveWaiting) {
|
|
394
|
-
resolveWaiting();
|
|
395
|
-
resolveWaiting = null;
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
onComplete: (_stats) => {
|
|
399
|
-
isComplete = true;
|
|
400
|
-
// Wake up the generator if it's waiting
|
|
401
|
-
if (resolveWaiting) {
|
|
402
|
-
resolveWaiting();
|
|
403
|
-
resolveWaiting = null;
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
}).catch((error) => {
|
|
407
|
-
processingError = error instanceof Error ? error : new Error(String(error));
|
|
408
|
-
log.error('WASM instanced streaming parsing failed', processingError, { operation: 'collectInstancedGeometryStreaming' });
|
|
409
|
-
isComplete = true;
|
|
410
|
-
if (resolveWaiting) {
|
|
411
|
-
resolveWaiting();
|
|
412
|
-
resolveWaiting = null;
|
|
413
|
-
}
|
|
414
|
-
});
|
|
415
|
-
// Yield batches as they become available
|
|
416
|
-
let yieldedBatchCount = 0;
|
|
417
|
-
while (true) {
|
|
418
|
-
// Yield any queued batches
|
|
419
|
-
while (batchQueue.length > 0) {
|
|
420
|
-
yieldedBatchCount++;
|
|
421
|
-
yield batchQueue.shift();
|
|
422
|
-
}
|
|
423
|
-
// Check for errors
|
|
424
|
-
if (processingError) {
|
|
425
|
-
throw processingError;
|
|
426
|
-
}
|
|
427
|
-
// Check if we're done
|
|
428
|
-
if (isComplete && batchQueue.length === 0) {
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
// Wait for more batches
|
|
432
|
-
await new Promise((resolve) => {
|
|
433
|
-
resolveWaiting = resolve;
|
|
434
|
-
});
|
|
435
|
-
}
|
|
436
|
-
// Warn if WASM returned 0 results for a non-trivially-sized file
|
|
437
|
-
// This typically indicates WASM ran out of memory during parsing
|
|
438
|
-
if (yieldedBatchCount === 0 && this.content.length > 1000) {
|
|
439
|
-
const sizeMB = (this.content.length / (1024 * 1024)).toFixed(1);
|
|
440
|
-
log.warn(`WASM instanced streaming returned 0 batches for ${sizeMB}MB file - ` +
|
|
441
|
-
`this may indicate insufficient memory for large file processing`, { operation: 'collectInstancedGeometryStreaming', data: { contentLength: this.content.length } });
|
|
442
|
-
}
|
|
443
|
-
// Ensure processing is complete
|
|
444
|
-
await processingPromise;
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
//# sourceMappingURL=ifc-lite-mesh-collector.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ifc-lite-mesh-collector.js","sourceRoot":"","sources":["../src/ifc-lite-mesh-collector.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAI9C,MAAM,GAAG,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AA6D1C,MAAM,OAAO,oBAAoB;IACvB,MAAM,CAAS;IACf,OAAO,CAAS;IAChB,iBAAiB,CAAqB;IACtC,WAAW,CAAU;IACrB,kBAAkB,GAAY,KAAK,CAAC;IAE5C,YAAY,MAAc,EAAE,OAAe,EAAE,UAAuC,EAAE;QACpF,IAAI,CAAC,MAAM,GAAG,MAAM,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AAC;gBACpB,MAAM,UAAU,CAAC,KAAK,EAAG,CAAC;YAC5B,CAAC;YAED,mBAAmB;YACnB,IAAI,eAAe,EAAE,CAAC;gBACpB,MAAM,eAAe,CAAC;YACxB,CAAC;YAED,sBAAsB;YACtB,IAAI,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1C,MAAM;YACR,CAAC;YAED,wBAAwB;YACxB,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBAClC,cAAc,GAAG,OAAO,CAAC;YAC3B,CAAC,CAAC,CAAC;QACL,CAAC;QAED,iEAAiE;QACjE,iEAAiE;QACjE,IAAI,iBAAiB,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,IAAI,EAAE,CAAC;YAC1D,MAAM,MAAM,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;YAChE,GAAG,CAAC,IAAI,CACN,mDAAmD,MAAM,YAAY;gBACrE,iEAAiE,EACjE,EAAE,SAAS,EAAE,mCAAmC,EAAE,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CACjG,CAAC;QACJ,CAAC;QAED,gCAAgC;QAChC,MAAM,iBAAiB,CAAC;IAC1B,CAAC;CACF"}
|
package/dist/lod.d.ts
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Level of Detail (LOD) system for geometry optimization
|
|
3
|
-
* Uses screen-space size culling for performance
|
|
4
|
-
*/
|
|
5
|
-
import type { MeshData } from './types.js';
|
|
6
|
-
import type { Vec3 } from './types.js';
|
|
7
|
-
export interface LODConfig {
|
|
8
|
-
/**
|
|
9
|
-
* Minimum screen-space size (in pixels) to render at full detail
|
|
10
|
-
* Objects smaller than this will be culled
|
|
11
|
-
*/
|
|
12
|
-
minScreenSize?: number;
|
|
13
|
-
/**
|
|
14
|
-
* Distance thresholds for LOD levels (in world units)
|
|
15
|
-
* [near, mid, far] - objects beyond far threshold are culled
|
|
16
|
-
*/
|
|
17
|
-
distanceThresholds?: [number, number, number];
|
|
18
|
-
}
|
|
19
|
-
export interface LODMesh {
|
|
20
|
-
lod0: MeshData;
|
|
21
|
-
lod1?: MeshData;
|
|
22
|
-
lod2?: MeshData;
|
|
23
|
-
bounds: {
|
|
24
|
-
min: Vec3;
|
|
25
|
-
max: Vec3;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export declare class LODGenerator {
|
|
29
|
-
private config;
|
|
30
|
-
constructor(config?: LODConfig);
|
|
31
|
-
/**
|
|
32
|
-
* Calculate screen-space size of a mesh from camera position
|
|
33
|
-
*/
|
|
34
|
-
calculateScreenSize(meshBounds: {
|
|
35
|
-
min: Vec3;
|
|
36
|
-
max: Vec3;
|
|
37
|
-
}, cameraPosition: Vec3, _viewProjMatrix: Float32Array, _viewportWidth: number, viewportHeight: number): number;
|
|
38
|
-
/**
|
|
39
|
-
* Determine if mesh should be rendered based on screen size
|
|
40
|
-
*/
|
|
41
|
-
shouldRender(meshBounds: {
|
|
42
|
-
min: Vec3;
|
|
43
|
-
max: Vec3;
|
|
44
|
-
}, cameraPosition: Vec3, viewProjMatrix: Float32Array, viewportWidth: number, viewportHeight: number): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Get LOD level based on distance (0 = full detail, 1 = medium, 2 = low, -1 = cull)
|
|
47
|
-
*/
|
|
48
|
-
getLODLevel(meshBounds: {
|
|
49
|
-
min: Vec3;
|
|
50
|
-
max: Vec3;
|
|
51
|
-
}, cameraPosition: Vec3): number;
|
|
52
|
-
/**
|
|
53
|
-
* Compute bounds from mesh data
|
|
54
|
-
*/
|
|
55
|
-
static computeBounds(mesh: MeshData): {
|
|
56
|
-
min: Vec3;
|
|
57
|
-
max: Vec3;
|
|
58
|
-
};
|
|
59
|
-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EAAE;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE,EACpC,cAAc,EAAE,IAAI,GACnB,MAAM;IA2BT;;OAEG;IACH,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,QAAQ,GAAG;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,GAAG,EAAE,IAAI,CAAA;KAAE;CAkC/D"}
|
package/dist/lod.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
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 class LODGenerator {
|
|
5
|
-
config;
|
|
6
|
-
constructor(config = {}) {
|
|
7
|
-
this.config = {
|
|
8
|
-
minScreenSize: config.minScreenSize ?? 2.0, // 2 pixels minimum
|
|
9
|
-
distanceThresholds: config.distanceThresholds ?? [50, 200, 1000], // near, mid, far
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Calculate screen-space size of a mesh from camera position
|
|
14
|
-
*/
|
|
15
|
-
calculateScreenSize(meshBounds, cameraPosition, _viewProjMatrix, _viewportWidth, viewportHeight) {
|
|
16
|
-
// Calculate center of bounds
|
|
17
|
-
const center = {
|
|
18
|
-
x: (meshBounds.min.x + meshBounds.max.x) / 2,
|
|
19
|
-
y: (meshBounds.min.y + meshBounds.max.y) / 2,
|
|
20
|
-
z: (meshBounds.min.z + meshBounds.max.z) / 2,
|
|
21
|
-
};
|
|
22
|
-
// Calculate size of bounds
|
|
23
|
-
const size = {
|
|
24
|
-
x: meshBounds.max.x - meshBounds.min.x,
|
|
25
|
-
y: meshBounds.max.y - meshBounds.min.y,
|
|
26
|
-
z: meshBounds.max.z - meshBounds.min.z,
|
|
27
|
-
};
|
|
28
|
-
// Approximate radius (half diagonal)
|
|
29
|
-
const radius = Math.sqrt(size.x ** 2 + size.y ** 2 + size.z ** 2) / 2;
|
|
30
|
-
// Distance from camera to center
|
|
31
|
-
const dx = center.x - cameraPosition.x;
|
|
32
|
-
const dy = center.y - cameraPosition.y;
|
|
33
|
-
const dz = center.z - cameraPosition.z;
|
|
34
|
-
const distance = Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
|
|
35
|
-
if (distance === 0)
|
|
36
|
-
return Infinity;
|
|
37
|
-
// Project radius to screen space
|
|
38
|
-
// Simplified: assume FOV of 45 degrees (tan(22.5) ≈ 0.414)
|
|
39
|
-
const fovFactor = 0.414;
|
|
40
|
-
const screenSize = (radius / distance) * viewportHeight * fovFactor;
|
|
41
|
-
return screenSize;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Determine if mesh should be rendered based on screen size
|
|
45
|
-
*/
|
|
46
|
-
shouldRender(meshBounds, cameraPosition, viewProjMatrix, viewportWidth, viewportHeight) {
|
|
47
|
-
const screenSize = this.calculateScreenSize(meshBounds, cameraPosition, viewProjMatrix, viewportWidth, viewportHeight);
|
|
48
|
-
return screenSize >= this.config.minScreenSize;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Get LOD level based on distance (0 = full detail, 1 = medium, 2 = low, -1 = cull)
|
|
52
|
-
*/
|
|
53
|
-
getLODLevel(meshBounds, cameraPosition) {
|
|
54
|
-
// Calculate center of bounds
|
|
55
|
-
const center = {
|
|
56
|
-
x: (meshBounds.min.x + meshBounds.max.x) / 2,
|
|
57
|
-
y: (meshBounds.min.y + meshBounds.max.y) / 2,
|
|
58
|
-
z: (meshBounds.min.z + meshBounds.max.z) / 2,
|
|
59
|
-
};
|
|
60
|
-
// Distance from camera to center
|
|
61
|
-
const dx = center.x - cameraPosition.x;
|
|
62
|
-
const dy = center.y - cameraPosition.y;
|
|
63
|
-
const dz = center.z - cameraPosition.z;
|
|
64
|
-
const distance = Math.sqrt(dx ** 2 + dy ** 2 + dz ** 2);
|
|
65
|
-
const [near, mid, far] = this.config.distanceThresholds;
|
|
66
|
-
if (distance < near) {
|
|
67
|
-
return 0; // Full detail
|
|
68
|
-
}
|
|
69
|
-
else if (distance < mid) {
|
|
70
|
-
return 1; // Medium detail
|
|
71
|
-
}
|
|
72
|
-
else if (distance < far) {
|
|
73
|
-
return 2; // Low detail
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
return -1; // Cull
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Compute bounds from mesh data
|
|
81
|
-
*/
|
|
82
|
-
static computeBounds(mesh) {
|
|
83
|
-
const positions = mesh.positions;
|
|
84
|
-
if (positions.length === 0) {
|
|
85
|
-
return {
|
|
86
|
-
min: { x: 0, y: 0, z: 0 },
|
|
87
|
-
max: { x: 0, y: 0, z: 0 },
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
let minX = positions[0];
|
|
91
|
-
let minY = positions[1];
|
|
92
|
-
let minZ = positions[2];
|
|
93
|
-
let maxX = positions[0];
|
|
94
|
-
let maxY = positions[1];
|
|
95
|
-
let maxZ = positions[2];
|
|
96
|
-
for (let i = 3; i < positions.length; i += 3) {
|
|
97
|
-
const x = positions[i];
|
|
98
|
-
const y = positions[i + 1];
|
|
99
|
-
const z = positions[i + 2];
|
|
100
|
-
minX = Math.min(minX, x);
|
|
101
|
-
minY = Math.min(minY, y);
|
|
102
|
-
minZ = Math.min(minZ, z);
|
|
103
|
-
maxX = Math.max(maxX, x);
|
|
104
|
-
maxY = Math.max(maxY, y);
|
|
105
|
-
maxZ = Math.max(maxZ, z);
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
min: { x: minX, y: minY, z: minZ },
|
|
109
|
-
max: { x: maxX, y: maxY, z: maxZ },
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
//# sourceMappingURL=lod.js.map
|
package/dist/lod.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lod.js","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