@ifc-lite/wasm 1.19.1 → 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 +36 -71
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +13 -772
- package/pkg/ifc-lite.js +128 -1913
- package/pkg/ifc-lite_bg.wasm +0 -0
package/pkg/ifc-lite.js
CHANGED
|
@@ -220,877 +220,53 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
220
220
|
|
|
221
221
|
let WASM_VECTOR_LEN = 0;
|
|
222
222
|
|
|
223
|
-
function
|
|
224
|
-
wasm.
|
|
223
|
+
function __wasm_bindgen_func_elem_1685(arg0, arg1, arg2) {
|
|
224
|
+
wasm.__wasm_bindgen_func_elem_1685(arg0, arg1, addHeapObject(arg2));
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
function
|
|
228
|
-
wasm.
|
|
227
|
+
function __wasm_bindgen_func_elem_1832(arg0, arg1, arg2, arg3) {
|
|
228
|
+
wasm.__wasm_bindgen_func_elem_1832(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
const
|
|
232
|
-
? { register: () => {}, unregister: () => {} }
|
|
233
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
234
|
-
|
|
235
|
-
const
|
|
236
|
-
? { register: () => {}, unregister: () => {} }
|
|
237
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
238
|
-
|
|
239
|
-
const
|
|
240
|
-
? { register: () => {}, unregister: () => {} }
|
|
241
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
242
|
-
|
|
243
|
-
const
|
|
244
|
-
? { register: () => {}, unregister: () => {} }
|
|
245
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
246
|
-
|
|
247
|
-
const
|
|
248
|
-
? { register: () => {}, unregister: () => {} }
|
|
249
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
250
|
-
|
|
251
|
-
const
|
|
252
|
-
? { register: () => {}, unregister: () => {} }
|
|
253
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
254
|
-
|
|
255
|
-
const
|
|
256
|
-
? { register: () => {}, unregister: () => {} }
|
|
257
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
? { register: () => {}, unregister: () => {} }
|
|
261
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
262
|
-
|
|
263
|
-
const
|
|
264
|
-
? { register: () => {}, unregister: () => {} }
|
|
265
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
266
|
-
|
|
267
|
-
const
|
|
268
|
-
? { register: () => {}, unregister: () => {} }
|
|
269
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
270
|
-
|
|
271
|
-
const MeshCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
272
|
-
? { register: () => {}, unregister: () => {} }
|
|
273
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_meshcollection_free(ptr >>> 0, 1));
|
|
274
|
-
|
|
275
|
-
const MeshCollectionWithRtcFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
276
|
-
? { register: () => {}, unregister: () => {} }
|
|
277
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_meshcollectionwithrtc_free(ptr >>> 0, 1));
|
|
278
|
-
|
|
279
|
-
const MeshDataJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
280
|
-
? { register: () => {}, unregister: () => {} }
|
|
281
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_meshdatajs_free(ptr >>> 0, 1));
|
|
282
|
-
|
|
283
|
-
const ProfileCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
284
|
-
? { register: () => {}, unregister: () => {} }
|
|
285
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_profilecollection_free(ptr >>> 0, 1));
|
|
286
|
-
|
|
287
|
-
const ProfileEntryJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
288
|
-
? { register: () => {}, unregister: () => {} }
|
|
289
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_profileentryjs_free(ptr >>> 0, 1));
|
|
290
|
-
|
|
291
|
-
const RtcOffsetJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
292
|
-
? { register: () => {}, unregister: () => {} }
|
|
293
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_rtcoffsetjs_free(ptr >>> 0, 1));
|
|
294
|
-
|
|
295
|
-
const SymbolicCircleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
296
|
-
? { register: () => {}, unregister: () => {} }
|
|
297
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_symboliccircle_free(ptr >>> 0, 1));
|
|
298
|
-
|
|
299
|
-
const SymbolicFillAreaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
300
|
-
? { register: () => {}, unregister: () => {} }
|
|
301
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicfillarea_free(ptr >>> 0, 1));
|
|
302
|
-
|
|
303
|
-
const SymbolicPolylineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
304
|
-
? { register: () => {}, unregister: () => {} }
|
|
305
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicpolyline_free(ptr >>> 0, 1));
|
|
306
|
-
|
|
307
|
-
const SymbolicRepresentationCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
308
|
-
? { register: () => {}, unregister: () => {} }
|
|
309
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicrepresentationcollection_free(ptr >>> 0, 1));
|
|
310
|
-
|
|
311
|
-
const SymbolicTextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
312
|
-
? { register: () => {}, unregister: () => {} }
|
|
313
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_symbolictext_free(ptr >>> 0, 1));
|
|
314
|
-
|
|
315
|
-
const ZeroCopyMeshFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
316
|
-
? { register: () => {}, unregister: () => {} }
|
|
317
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_zerocopymesh_free(ptr >>> 0, 1));
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Georeferencing information exposed to JavaScript
|
|
321
|
-
*/
|
|
322
|
-
export class GeoReferenceJs {
|
|
323
|
-
static __wrap(ptr) {
|
|
324
|
-
ptr = ptr >>> 0;
|
|
325
|
-
const obj = Object.create(GeoReferenceJs.prototype);
|
|
326
|
-
obj.__wbg_ptr = ptr;
|
|
327
|
-
GeoReferenceJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
328
|
-
return obj;
|
|
329
|
-
}
|
|
330
|
-
__destroy_into_raw() {
|
|
331
|
-
const ptr = this.__wbg_ptr;
|
|
332
|
-
this.__wbg_ptr = 0;
|
|
333
|
-
GeoReferenceJsFinalization.unregister(this);
|
|
334
|
-
return ptr;
|
|
335
|
-
}
|
|
336
|
-
free() {
|
|
337
|
-
const ptr = this.__destroy_into_raw();
|
|
338
|
-
wasm.__wbg_georeferencejs_free(ptr, 0);
|
|
339
|
-
}
|
|
340
|
-
/**
|
|
341
|
-
* Transform local coordinates to map coordinates
|
|
342
|
-
* @param {number} x
|
|
343
|
-
* @param {number} y
|
|
344
|
-
* @param {number} z
|
|
345
|
-
* @returns {Float64Array}
|
|
346
|
-
*/
|
|
347
|
-
localToMap(x, y, z) {
|
|
348
|
-
try {
|
|
349
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
350
|
-
wasm.georeferencejs_localToMap(retptr, this.__wbg_ptr, x, y, z);
|
|
351
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
352
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
353
|
-
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
354
|
-
wasm.__wbindgen_export2(r0, r1 * 8, 8);
|
|
355
|
-
return v1;
|
|
356
|
-
} finally {
|
|
357
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
/**
|
|
361
|
-
* Transform map coordinates to local coordinates
|
|
362
|
-
* @param {number} e
|
|
363
|
-
* @param {number} n
|
|
364
|
-
* @param {number} h
|
|
365
|
-
* @returns {Float64Array}
|
|
366
|
-
*/
|
|
367
|
-
mapToLocal(e, n, h) {
|
|
368
|
-
try {
|
|
369
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
370
|
-
wasm.georeferencejs_mapToLocal(retptr, this.__wbg_ptr, e, n, h);
|
|
371
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
372
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
373
|
-
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
374
|
-
wasm.__wbindgen_export2(r0, r1 * 8, 8);
|
|
375
|
-
return v1;
|
|
376
|
-
} finally {
|
|
377
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
378
|
-
}
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* Get CRS name
|
|
382
|
-
* @returns {string | undefined}
|
|
383
|
-
*/
|
|
384
|
-
get crsName() {
|
|
385
|
-
try {
|
|
386
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
387
|
-
wasm.georeferencejs_crsName(retptr, this.__wbg_ptr);
|
|
388
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
389
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
390
|
-
let v1;
|
|
391
|
-
if (r0 !== 0) {
|
|
392
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
393
|
-
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
394
|
-
}
|
|
395
|
-
return v1;
|
|
396
|
-
} finally {
|
|
397
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Get rotation angle in radians
|
|
402
|
-
* @returns {number}
|
|
403
|
-
*/
|
|
404
|
-
get rotation() {
|
|
405
|
-
const ret = wasm.georeferencejs_rotation(this.__wbg_ptr);
|
|
406
|
-
return ret;
|
|
407
|
-
}
|
|
408
|
-
/**
|
|
409
|
-
* Get 4x4 transformation matrix (column-major for WebGL)
|
|
410
|
-
* @returns {Float64Array}
|
|
411
|
-
*/
|
|
412
|
-
toMatrix() {
|
|
413
|
-
try {
|
|
414
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
415
|
-
wasm.georeferencejs_toMatrix(retptr, this.__wbg_ptr);
|
|
416
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
417
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
418
|
-
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
419
|
-
wasm.__wbindgen_export2(r0, r1 * 8, 8);
|
|
420
|
-
return v1;
|
|
421
|
-
} finally {
|
|
422
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Eastings (X offset)
|
|
427
|
-
* @returns {number}
|
|
428
|
-
*/
|
|
429
|
-
get eastings() {
|
|
430
|
-
const ret = wasm.__wbg_get_georeferencejs_eastings(this.__wbg_ptr);
|
|
431
|
-
return ret;
|
|
432
|
-
}
|
|
433
|
-
/**
|
|
434
|
-
* Eastings (X offset)
|
|
435
|
-
* @param {number} arg0
|
|
436
|
-
*/
|
|
437
|
-
set eastings(arg0) {
|
|
438
|
-
wasm.__wbg_set_georeferencejs_eastings(this.__wbg_ptr, arg0);
|
|
439
|
-
}
|
|
440
|
-
/**
|
|
441
|
-
* Northings (Y offset)
|
|
442
|
-
* @returns {number}
|
|
443
|
-
*/
|
|
444
|
-
get northings() {
|
|
445
|
-
const ret = wasm.__wbg_get_georeferencejs_northings(this.__wbg_ptr);
|
|
446
|
-
return ret;
|
|
447
|
-
}
|
|
448
|
-
/**
|
|
449
|
-
* Northings (Y offset)
|
|
450
|
-
* @param {number} arg0
|
|
451
|
-
*/
|
|
452
|
-
set northings(arg0) {
|
|
453
|
-
wasm.__wbg_set_georeferencejs_northings(this.__wbg_ptr, arg0);
|
|
454
|
-
}
|
|
455
|
-
/**
|
|
456
|
-
* Orthogonal height (Z offset)
|
|
457
|
-
* @returns {number}
|
|
458
|
-
*/
|
|
459
|
-
get orthogonal_height() {
|
|
460
|
-
const ret = wasm.__wbg_get_georeferencejs_orthogonal_height(this.__wbg_ptr);
|
|
461
|
-
return ret;
|
|
462
|
-
}
|
|
463
|
-
/**
|
|
464
|
-
* Orthogonal height (Z offset)
|
|
465
|
-
* @param {number} arg0
|
|
466
|
-
*/
|
|
467
|
-
set orthogonal_height(arg0) {
|
|
468
|
-
wasm.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr, arg0);
|
|
469
|
-
}
|
|
470
|
-
/**
|
|
471
|
-
* X-axis abscissa (cos of rotation)
|
|
472
|
-
* @returns {number}
|
|
473
|
-
*/
|
|
474
|
-
get x_axis_abscissa() {
|
|
475
|
-
const ret = wasm.__wbg_get_georeferencejs_x_axis_abscissa(this.__wbg_ptr);
|
|
476
|
-
return ret;
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* X-axis abscissa (cos of rotation)
|
|
480
|
-
* @param {number} arg0
|
|
481
|
-
*/
|
|
482
|
-
set x_axis_abscissa(arg0) {
|
|
483
|
-
wasm.__wbg_set_georeferencejs_x_axis_abscissa(this.__wbg_ptr, arg0);
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* X-axis ordinate (sin of rotation)
|
|
487
|
-
* @returns {number}
|
|
488
|
-
*/
|
|
489
|
-
get x_axis_ordinate() {
|
|
490
|
-
const ret = wasm.__wbg_get_georeferencejs_x_axis_ordinate(this.__wbg_ptr);
|
|
491
|
-
return ret;
|
|
492
|
-
}
|
|
493
|
-
/**
|
|
494
|
-
* X-axis ordinate (sin of rotation)
|
|
495
|
-
* @param {number} arg0
|
|
496
|
-
*/
|
|
497
|
-
set x_axis_ordinate(arg0) {
|
|
498
|
-
wasm.__wbg_set_georeferencejs_x_axis_ordinate(this.__wbg_ptr, arg0);
|
|
499
|
-
}
|
|
500
|
-
/**
|
|
501
|
-
* Scale factor
|
|
502
|
-
* @returns {number}
|
|
503
|
-
*/
|
|
504
|
-
get scale() {
|
|
505
|
-
const ret = wasm.__wbg_get_georeferencejs_scale(this.__wbg_ptr);
|
|
506
|
-
return ret;
|
|
507
|
-
}
|
|
508
|
-
/**
|
|
509
|
-
* Scale factor
|
|
510
|
-
* @param {number} arg0
|
|
511
|
-
*/
|
|
512
|
-
set scale(arg0) {
|
|
513
|
-
wasm.__wbg_set_georeferencejs_scale(this.__wbg_ptr, arg0);
|
|
514
|
-
}
|
|
515
|
-
}
|
|
516
|
-
if (Symbol.dispose) GeoReferenceJs.prototype[Symbol.dispose] = GeoReferenceJs.prototype.free;
|
|
517
|
-
|
|
518
|
-
/**
|
|
519
|
-
* GPU-ready geometry stored in WASM linear memory
|
|
520
|
-
*
|
|
521
|
-
* Data layout:
|
|
522
|
-
* - vertex_data: Interleaved [px, py, pz, nx, ny, nz, ...] (6 floats per vertex)
|
|
523
|
-
* - indices: Triangle indices [i0, i1, i2, ...]
|
|
524
|
-
* - mesh_metadata: Per-mesh metadata for draw calls
|
|
525
|
-
*
|
|
526
|
-
* All coordinates are pre-converted from IFC Z-up to WebGL Y-up
|
|
527
|
-
*/
|
|
528
|
-
export class GpuGeometry {
|
|
529
|
-
static __wrap(ptr) {
|
|
530
|
-
ptr = ptr >>> 0;
|
|
531
|
-
const obj = Object.create(GpuGeometry.prototype);
|
|
532
|
-
obj.__wbg_ptr = ptr;
|
|
533
|
-
GpuGeometryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
534
|
-
return obj;
|
|
535
|
-
}
|
|
536
|
-
__destroy_into_raw() {
|
|
537
|
-
const ptr = this.__wbg_ptr;
|
|
538
|
-
this.__wbg_ptr = 0;
|
|
539
|
-
GpuGeometryFinalization.unregister(this);
|
|
540
|
-
return ptr;
|
|
541
|
-
}
|
|
542
|
-
free() {
|
|
543
|
-
const ptr = this.__destroy_into_raw();
|
|
544
|
-
wasm.__wbg_gpugeometry_free(ptr, 0);
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Get number of meshes in this geometry batch
|
|
548
|
-
* @returns {number}
|
|
549
|
-
*/
|
|
550
|
-
get meshCount() {
|
|
551
|
-
const ret = wasm.gpugeometry_meshCount(this.__wbg_ptr);
|
|
552
|
-
return ret >>> 0;
|
|
553
|
-
}
|
|
554
|
-
/**
|
|
555
|
-
* Get length of indices array (in u32 elements)
|
|
556
|
-
* @returns {number}
|
|
557
|
-
*/
|
|
558
|
-
get indicesLen() {
|
|
559
|
-
const ret = wasm.gpugeometry_indicesLen(this.__wbg_ptr);
|
|
560
|
-
return ret >>> 0;
|
|
561
|
-
}
|
|
562
|
-
/**
|
|
563
|
-
* Get pointer to indices array for zero-copy view
|
|
564
|
-
* @returns {number}
|
|
565
|
-
*/
|
|
566
|
-
get indicesPtr() {
|
|
567
|
-
const ret = wasm.gpugeometry_indicesPtr(this.__wbg_ptr);
|
|
568
|
-
return ret >>> 0;
|
|
569
|
-
}
|
|
570
|
-
/**
|
|
571
|
-
* Get X component of RTC offset
|
|
572
|
-
* @returns {number}
|
|
573
|
-
*/
|
|
574
|
-
get rtcOffsetX() {
|
|
575
|
-
const ret = wasm.gpugeometry_rtcOffsetX(this.__wbg_ptr);
|
|
576
|
-
return ret;
|
|
577
|
-
}
|
|
578
|
-
/**
|
|
579
|
-
* Get Y component of RTC offset
|
|
580
|
-
* @returns {number}
|
|
581
|
-
*/
|
|
582
|
-
get rtcOffsetY() {
|
|
583
|
-
const ret = wasm.gpugeometry_rtcOffsetY(this.__wbg_ptr);
|
|
584
|
-
return ret;
|
|
585
|
-
}
|
|
586
|
-
/**
|
|
587
|
-
* Get Z component of RTC offset
|
|
588
|
-
* @returns {number}
|
|
589
|
-
*/
|
|
590
|
-
get rtcOffsetZ() {
|
|
591
|
-
const ret = wasm.gpugeometry_rtcOffsetZ(this.__wbg_ptr);
|
|
592
|
-
return ret;
|
|
593
|
-
}
|
|
594
|
-
/**
|
|
595
|
-
* Check if RTC offset is active (non-zero)
|
|
596
|
-
* @returns {boolean}
|
|
597
|
-
*/
|
|
598
|
-
get hasRtcOffset() {
|
|
599
|
-
const ret = wasm.gpugeometry_hasRtcOffset(this.__wbg_ptr);
|
|
600
|
-
return ret !== 0;
|
|
601
|
-
}
|
|
602
|
-
/**
|
|
603
|
-
* Set the RTC (Relative To Center) offset applied to coordinates
|
|
604
|
-
* @param {number} x
|
|
605
|
-
* @param {number} y
|
|
606
|
-
* @param {number} z
|
|
607
|
-
*/
|
|
608
|
-
set_rtc_offset(x, y, z) {
|
|
609
|
-
wasm.gpugeometry_set_rtc_offset(this.__wbg_ptr, x, y, z);
|
|
610
|
-
}
|
|
611
|
-
/**
|
|
612
|
-
* Get length of vertex data array (in f32 elements, not bytes)
|
|
613
|
-
* @returns {number}
|
|
614
|
-
*/
|
|
615
|
-
get vertexDataLen() {
|
|
616
|
-
const ret = wasm.gpugeometry_vertexDataLen(this.__wbg_ptr);
|
|
617
|
-
return ret >>> 0;
|
|
618
|
-
}
|
|
619
|
-
/**
|
|
620
|
-
* Get pointer to vertex data for zero-copy view
|
|
621
|
-
*
|
|
622
|
-
* SAFETY: View is only valid until next WASM allocation!
|
|
623
|
-
* Create view, upload to GPU, then discard view immediately.
|
|
624
|
-
* @returns {number}
|
|
625
|
-
*/
|
|
626
|
-
get vertexDataPtr() {
|
|
627
|
-
const ret = wasm.gpugeometry_vertexDataPtr(this.__wbg_ptr);
|
|
628
|
-
return ret >>> 0;
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Get IFC type name by index
|
|
632
|
-
* @param {number} index
|
|
633
|
-
* @returns {string | undefined}
|
|
634
|
-
*/
|
|
635
|
-
getIfcTypeName(index) {
|
|
636
|
-
try {
|
|
637
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
638
|
-
wasm.gpugeometry_getIfcTypeName(retptr, this.__wbg_ptr, index);
|
|
639
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
640
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
641
|
-
let v1;
|
|
642
|
-
if (r0 !== 0) {
|
|
643
|
-
v1 = getStringFromWasm0(r0, r1).slice();
|
|
644
|
-
wasm.__wbindgen_export2(r0, r1 * 1, 1);
|
|
645
|
-
}
|
|
646
|
-
return v1;
|
|
647
|
-
} finally {
|
|
648
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
/**
|
|
652
|
-
* Get metadata for a specific mesh
|
|
653
|
-
* @param {number} index
|
|
654
|
-
* @returns {GpuMeshMetadata | undefined}
|
|
655
|
-
*/
|
|
656
|
-
getMeshMetadata(index) {
|
|
657
|
-
const ret = wasm.gpugeometry_getMeshMetadata(this.__wbg_ptr, index);
|
|
658
|
-
return ret === 0 ? undefined : GpuMeshMetadata.__wrap(ret);
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Get total vertex count
|
|
662
|
-
* @returns {number}
|
|
663
|
-
*/
|
|
664
|
-
get totalVertexCount() {
|
|
665
|
-
const ret = wasm.gpugeometry_totalVertexCount(this.__wbg_ptr);
|
|
666
|
-
return ret >>> 0;
|
|
667
|
-
}
|
|
668
|
-
/**
|
|
669
|
-
* Get byte length of indices (for GPU buffer creation)
|
|
670
|
-
* @returns {number}
|
|
671
|
-
*/
|
|
672
|
-
get indicesByteLength() {
|
|
673
|
-
const ret = wasm.gpugeometry_indicesByteLength(this.__wbg_ptr);
|
|
674
|
-
return ret >>> 0;
|
|
675
|
-
}
|
|
676
|
-
/**
|
|
677
|
-
* Get total triangle count
|
|
678
|
-
* @returns {number}
|
|
679
|
-
*/
|
|
680
|
-
get totalTriangleCount() {
|
|
681
|
-
const ret = wasm.gpugeometry_totalTriangleCount(this.__wbg_ptr);
|
|
682
|
-
return ret >>> 0;
|
|
683
|
-
}
|
|
684
|
-
/**
|
|
685
|
-
* Get byte length of vertex data (for GPU buffer creation)
|
|
686
|
-
* @returns {number}
|
|
687
|
-
*/
|
|
688
|
-
get vertexDataByteLength() {
|
|
689
|
-
const ret = wasm.gpugeometry_vertexDataByteLength(this.__wbg_ptr);
|
|
690
|
-
return ret >>> 0;
|
|
691
|
-
}
|
|
692
|
-
/**
|
|
693
|
-
* Create a new empty GPU geometry container
|
|
694
|
-
*/
|
|
695
|
-
constructor() {
|
|
696
|
-
const ret = wasm.gpugeometry_new();
|
|
697
|
-
this.__wbg_ptr = ret >>> 0;
|
|
698
|
-
GpuGeometryFinalization.register(this, this.__wbg_ptr, this);
|
|
699
|
-
return this;
|
|
700
|
-
}
|
|
701
|
-
/**
|
|
702
|
-
* Check if geometry is empty
|
|
703
|
-
* @returns {boolean}
|
|
704
|
-
*/
|
|
705
|
-
get isEmpty() {
|
|
706
|
-
const ret = wasm.gpugeometry_isEmpty(this.__wbg_ptr);
|
|
707
|
-
return ret !== 0;
|
|
708
|
-
}
|
|
709
|
-
}
|
|
710
|
-
if (Symbol.dispose) GpuGeometry.prototype[Symbol.dispose] = GpuGeometry.prototype.free;
|
|
711
|
-
|
|
712
|
-
/**
|
|
713
|
-
* GPU-ready instanced geometry for efficient rendering of repeated shapes
|
|
714
|
-
*
|
|
715
|
-
* Data layout:
|
|
716
|
-
* - vertex_data: Interleaved [px, py, pz, nx, ny, nz, ...] (shared geometry)
|
|
717
|
-
* - indices: Triangle indices (shared geometry)
|
|
718
|
-
* - instance_data: [transform (16 floats) + color (4 floats)] per instance = 20 floats
|
|
719
|
-
*/
|
|
720
|
-
export class GpuInstancedGeometry {
|
|
721
|
-
static __wrap(ptr) {
|
|
722
|
-
ptr = ptr >>> 0;
|
|
723
|
-
const obj = Object.create(GpuInstancedGeometry.prototype);
|
|
724
|
-
obj.__wbg_ptr = ptr;
|
|
725
|
-
GpuInstancedGeometryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
726
|
-
return obj;
|
|
727
|
-
}
|
|
728
|
-
__destroy_into_raw() {
|
|
729
|
-
const ptr = this.__wbg_ptr;
|
|
730
|
-
this.__wbg_ptr = 0;
|
|
731
|
-
GpuInstancedGeometryFinalization.unregister(this);
|
|
732
|
-
return ptr;
|
|
733
|
-
}
|
|
734
|
-
free() {
|
|
735
|
-
const ptr = this.__destroy_into_raw();
|
|
736
|
-
wasm.__wbg_gpuinstancedgeometry_free(ptr, 0);
|
|
737
|
-
}
|
|
738
|
-
/**
|
|
739
|
-
* @returns {bigint}
|
|
740
|
-
*/
|
|
741
|
-
get geometryId() {
|
|
742
|
-
const ret = wasm.gpuinstancedgeometry_geometryId(this.__wbg_ptr);
|
|
743
|
-
return BigInt.asUintN(64, ret);
|
|
744
|
-
}
|
|
745
|
-
/**
|
|
746
|
-
* @returns {number}
|
|
747
|
-
*/
|
|
748
|
-
get indicesLen() {
|
|
749
|
-
const ret = wasm.gpuinstancedgeometry_indicesLen(this.__wbg_ptr);
|
|
750
|
-
return ret >>> 0;
|
|
751
|
-
}
|
|
752
|
-
/**
|
|
753
|
-
* @returns {number}
|
|
754
|
-
*/
|
|
755
|
-
get indicesPtr() {
|
|
756
|
-
const ret = wasm.gpuinstancedgeometry_indicesPtr(this.__wbg_ptr);
|
|
757
|
-
return ret >>> 0;
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* @returns {number}
|
|
761
|
-
*/
|
|
762
|
-
get vertexCount() {
|
|
763
|
-
const ret = wasm.gpuinstancedgeometry_vertexCount(this.__wbg_ptr);
|
|
764
|
-
return ret >>> 0;
|
|
765
|
-
}
|
|
766
|
-
/**
|
|
767
|
-
* @returns {number}
|
|
768
|
-
*/
|
|
769
|
-
get instanceCount() {
|
|
770
|
-
const ret = wasm.gpuinstancedgeometry_instanceCount(this.__wbg_ptr);
|
|
771
|
-
return ret >>> 0;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* @returns {number}
|
|
775
|
-
*/
|
|
776
|
-
get triangleCount() {
|
|
777
|
-
const ret = wasm.gpuinstancedgeometry_triangleCount(this.__wbg_ptr);
|
|
778
|
-
return ret >>> 0;
|
|
779
|
-
}
|
|
780
|
-
/**
|
|
781
|
-
* @returns {number}
|
|
782
|
-
*/
|
|
783
|
-
get vertexDataLen() {
|
|
784
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataLen(this.__wbg_ptr);
|
|
785
|
-
return ret >>> 0;
|
|
786
|
-
}
|
|
787
|
-
/**
|
|
788
|
-
* @returns {number}
|
|
789
|
-
*/
|
|
790
|
-
get vertexDataPtr() {
|
|
791
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataPtr(this.__wbg_ptr);
|
|
792
|
-
return ret >>> 0;
|
|
793
|
-
}
|
|
794
|
-
/**
|
|
795
|
-
* @returns {number}
|
|
796
|
-
*/
|
|
797
|
-
get instanceDataLen() {
|
|
798
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataLen(this.__wbg_ptr);
|
|
799
|
-
return ret >>> 0;
|
|
800
|
-
}
|
|
801
|
-
/**
|
|
802
|
-
* @returns {number}
|
|
803
|
-
*/
|
|
804
|
-
get instanceDataPtr() {
|
|
805
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataPtr(this.__wbg_ptr);
|
|
806
|
-
return ret >>> 0;
|
|
807
|
-
}
|
|
808
|
-
/**
|
|
809
|
-
* @returns {number}
|
|
810
|
-
*/
|
|
811
|
-
get indicesByteLength() {
|
|
812
|
-
const ret = wasm.gpuinstancedgeometry_indicesByteLength(this.__wbg_ptr);
|
|
813
|
-
return ret >>> 0;
|
|
814
|
-
}
|
|
815
|
-
/**
|
|
816
|
-
* @returns {number}
|
|
817
|
-
*/
|
|
818
|
-
get vertexDataByteLength() {
|
|
819
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataByteLength(this.__wbg_ptr);
|
|
820
|
-
return ret >>> 0;
|
|
821
|
-
}
|
|
822
|
-
/**
|
|
823
|
-
* @returns {number}
|
|
824
|
-
*/
|
|
825
|
-
get instanceExpressIdsPtr() {
|
|
826
|
-
const ret = wasm.gpuinstancedgeometry_instanceExpressIdsPtr(this.__wbg_ptr);
|
|
827
|
-
return ret >>> 0;
|
|
828
|
-
}
|
|
829
|
-
/**
|
|
830
|
-
* @returns {number}
|
|
831
|
-
*/
|
|
832
|
-
get instanceDataByteLength() {
|
|
833
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataByteLength(this.__wbg_ptr);
|
|
834
|
-
return ret >>> 0;
|
|
835
|
-
}
|
|
836
|
-
/**
|
|
837
|
-
* Create new instanced geometry
|
|
838
|
-
* @param {bigint} geometry_id
|
|
839
|
-
*/
|
|
840
|
-
constructor(geometry_id) {
|
|
841
|
-
const ret = wasm.gpuinstancedgeometry_new(geometry_id);
|
|
842
|
-
this.__wbg_ptr = ret >>> 0;
|
|
843
|
-
GpuInstancedGeometryFinalization.register(this, this.__wbg_ptr, this);
|
|
844
|
-
return this;
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
if (Symbol.dispose) GpuInstancedGeometry.prototype[Symbol.dispose] = GpuInstancedGeometry.prototype.free;
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Collection of GPU-ready instanced geometries
|
|
851
|
-
*/
|
|
852
|
-
export class GpuInstancedGeometryCollection {
|
|
853
|
-
static __wrap(ptr) {
|
|
854
|
-
ptr = ptr >>> 0;
|
|
855
|
-
const obj = Object.create(GpuInstancedGeometryCollection.prototype);
|
|
856
|
-
obj.__wbg_ptr = ptr;
|
|
857
|
-
GpuInstancedGeometryCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
858
|
-
return obj;
|
|
859
|
-
}
|
|
860
|
-
__destroy_into_raw() {
|
|
861
|
-
const ptr = this.__wbg_ptr;
|
|
862
|
-
this.__wbg_ptr = 0;
|
|
863
|
-
GpuInstancedGeometryCollectionFinalization.unregister(this);
|
|
864
|
-
return ptr;
|
|
865
|
-
}
|
|
866
|
-
free() {
|
|
867
|
-
const ptr = this.__destroy_into_raw();
|
|
868
|
-
wasm.__wbg_gpuinstancedgeometrycollection_free(ptr, 0);
|
|
869
|
-
}
|
|
870
|
-
/**
|
|
871
|
-
* @param {number} index
|
|
872
|
-
* @returns {GpuInstancedGeometry | undefined}
|
|
873
|
-
*/
|
|
874
|
-
get(index) {
|
|
875
|
-
const ret = wasm.gpuinstancedgeometrycollection_get(this.__wbg_ptr, index);
|
|
876
|
-
return ret === 0 ? undefined : GpuInstancedGeometry.__wrap(ret);
|
|
877
|
-
}
|
|
878
|
-
constructor() {
|
|
879
|
-
const ret = wasm.gpuinstancedgeometrycollection_new();
|
|
880
|
-
this.__wbg_ptr = ret >>> 0;
|
|
881
|
-
GpuInstancedGeometryCollectionFinalization.register(this, this.__wbg_ptr, this);
|
|
882
|
-
return this;
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
* @returns {number}
|
|
886
|
-
*/
|
|
887
|
-
get length() {
|
|
888
|
-
const ret = wasm.gpuinstancedgeometrycollection_length(this.__wbg_ptr);
|
|
889
|
-
return ret >>> 0;
|
|
890
|
-
}
|
|
891
|
-
/**
|
|
892
|
-
* Get geometry by index with pointer access over owned buffers.
|
|
893
|
-
* This avoids exposing references tied to collection lifetime.
|
|
894
|
-
* @param {number} index
|
|
895
|
-
* @returns {GpuInstancedGeometryRef | undefined}
|
|
896
|
-
*/
|
|
897
|
-
getRef(index) {
|
|
898
|
-
const ret = wasm.gpuinstancedgeometrycollection_get(this.__wbg_ptr, index);
|
|
899
|
-
return ret === 0 ? undefined : GpuInstancedGeometryRef.__wrap(ret);
|
|
900
|
-
}
|
|
901
|
-
}
|
|
902
|
-
if (Symbol.dispose) GpuInstancedGeometryCollection.prototype[Symbol.dispose] = GpuInstancedGeometryCollection.prototype.free;
|
|
903
|
-
|
|
904
|
-
/**
|
|
905
|
-
* Pointer-friendly geometry view with owned backing storage.
|
|
906
|
-
* Owning buffers prevents dangling pointers after collection mutation/drop.
|
|
907
|
-
*/
|
|
908
|
-
export class GpuInstancedGeometryRef {
|
|
909
|
-
static __wrap(ptr) {
|
|
910
|
-
ptr = ptr >>> 0;
|
|
911
|
-
const obj = Object.create(GpuInstancedGeometryRef.prototype);
|
|
912
|
-
obj.__wbg_ptr = ptr;
|
|
913
|
-
GpuInstancedGeometryRefFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
914
|
-
return obj;
|
|
915
|
-
}
|
|
916
|
-
__destroy_into_raw() {
|
|
917
|
-
const ptr = this.__wbg_ptr;
|
|
918
|
-
this.__wbg_ptr = 0;
|
|
919
|
-
GpuInstancedGeometryRefFinalization.unregister(this);
|
|
920
|
-
return ptr;
|
|
921
|
-
}
|
|
922
|
-
free() {
|
|
923
|
-
const ptr = this.__destroy_into_raw();
|
|
924
|
-
wasm.__wbg_gpuinstancedgeometryref_free(ptr, 0);
|
|
925
|
-
}
|
|
926
|
-
/**
|
|
927
|
-
* @returns {bigint}
|
|
928
|
-
*/
|
|
929
|
-
get geometryId() {
|
|
930
|
-
const ret = wasm.gpuinstancedgeometry_geometryId(this.__wbg_ptr);
|
|
931
|
-
return BigInt.asUintN(64, ret);
|
|
932
|
-
}
|
|
933
|
-
/**
|
|
934
|
-
* @returns {number}
|
|
935
|
-
*/
|
|
936
|
-
get indicesLen() {
|
|
937
|
-
const ret = wasm.gpuinstancedgeometry_indicesLen(this.__wbg_ptr);
|
|
938
|
-
return ret >>> 0;
|
|
939
|
-
}
|
|
940
|
-
/**
|
|
941
|
-
* @returns {number}
|
|
942
|
-
*/
|
|
943
|
-
get indicesPtr() {
|
|
944
|
-
const ret = wasm.gpuinstancedgeometry_indicesPtr(this.__wbg_ptr);
|
|
945
|
-
return ret >>> 0;
|
|
946
|
-
}
|
|
947
|
-
/**
|
|
948
|
-
* @returns {number}
|
|
949
|
-
*/
|
|
950
|
-
get instanceCount() {
|
|
951
|
-
const ret = wasm.gpuinstancedgeometry_instanceCount(this.__wbg_ptr);
|
|
952
|
-
return ret >>> 0;
|
|
953
|
-
}
|
|
954
|
-
/**
|
|
955
|
-
* @returns {number}
|
|
956
|
-
*/
|
|
957
|
-
get vertexDataLen() {
|
|
958
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataLen(this.__wbg_ptr);
|
|
959
|
-
return ret >>> 0;
|
|
960
|
-
}
|
|
961
|
-
/**
|
|
962
|
-
* @returns {number}
|
|
963
|
-
*/
|
|
964
|
-
get vertexDataPtr() {
|
|
965
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataPtr(this.__wbg_ptr);
|
|
966
|
-
return ret >>> 0;
|
|
967
|
-
}
|
|
968
|
-
/**
|
|
969
|
-
* @returns {number}
|
|
970
|
-
*/
|
|
971
|
-
get instanceDataLen() {
|
|
972
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataLen(this.__wbg_ptr);
|
|
973
|
-
return ret >>> 0;
|
|
974
|
-
}
|
|
975
|
-
/**
|
|
976
|
-
* @returns {number}
|
|
977
|
-
*/
|
|
978
|
-
get instanceDataPtr() {
|
|
979
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataPtr(this.__wbg_ptr);
|
|
980
|
-
return ret >>> 0;
|
|
981
|
-
}
|
|
982
|
-
/**
|
|
983
|
-
* @returns {number}
|
|
984
|
-
*/
|
|
985
|
-
get indicesByteLength() {
|
|
986
|
-
const ret = wasm.gpuinstancedgeometry_indicesByteLength(this.__wbg_ptr);
|
|
987
|
-
return ret >>> 0;
|
|
988
|
-
}
|
|
989
|
-
/**
|
|
990
|
-
* @returns {number}
|
|
991
|
-
*/
|
|
992
|
-
get vertexDataByteLength() {
|
|
993
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataByteLength(this.__wbg_ptr);
|
|
994
|
-
return ret >>> 0;
|
|
995
|
-
}
|
|
996
|
-
/**
|
|
997
|
-
* @returns {number}
|
|
998
|
-
*/
|
|
999
|
-
get instanceExpressIdsPtr() {
|
|
1000
|
-
const ret = wasm.gpuinstancedgeometry_instanceExpressIdsPtr(this.__wbg_ptr);
|
|
1001
|
-
return ret >>> 0;
|
|
1002
|
-
}
|
|
1003
|
-
/**
|
|
1004
|
-
* @returns {number}
|
|
1005
|
-
*/
|
|
1006
|
-
get instanceDataByteLength() {
|
|
1007
|
-
const ret = wasm.gpuinstancedgeometry_instanceDataByteLength(this.__wbg_ptr);
|
|
1008
|
-
return ret >>> 0;
|
|
1009
|
-
}
|
|
1010
|
-
}
|
|
1011
|
-
if (Symbol.dispose) GpuInstancedGeometryRef.prototype[Symbol.dispose] = GpuInstancedGeometryRef.prototype.free;
|
|
1012
|
-
|
|
1013
|
-
/**
|
|
1014
|
-
* Metadata for a single mesh within the GPU geometry buffer
|
|
1015
|
-
*/
|
|
1016
|
-
export class GpuMeshMetadata {
|
|
1017
|
-
static __wrap(ptr) {
|
|
1018
|
-
ptr = ptr >>> 0;
|
|
1019
|
-
const obj = Object.create(GpuMeshMetadata.prototype);
|
|
1020
|
-
obj.__wbg_ptr = ptr;
|
|
1021
|
-
GpuMeshMetadataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1022
|
-
return obj;
|
|
1023
|
-
}
|
|
1024
|
-
__destroy_into_raw() {
|
|
1025
|
-
const ptr = this.__wbg_ptr;
|
|
1026
|
-
this.__wbg_ptr = 0;
|
|
1027
|
-
GpuMeshMetadataFinalization.unregister(this);
|
|
1028
|
-
return ptr;
|
|
1029
|
-
}
|
|
1030
|
-
free() {
|
|
1031
|
-
const ptr = this.__destroy_into_raw();
|
|
1032
|
-
wasm.__wbg_gpumeshmetadata_free(ptr, 0);
|
|
1033
|
-
}
|
|
1034
|
-
/**
|
|
1035
|
-
* @returns {number}
|
|
1036
|
-
*/
|
|
1037
|
-
get expressId() {
|
|
1038
|
-
const ret = wasm.gpumeshmetadata_expressId(this.__wbg_ptr);
|
|
1039
|
-
return ret >>> 0;
|
|
1040
|
-
}
|
|
1041
|
-
/**
|
|
1042
|
-
* @returns {number}
|
|
1043
|
-
*/
|
|
1044
|
-
get indexCount() {
|
|
1045
|
-
const ret = wasm.gpumeshmetadata_indexCount(this.__wbg_ptr);
|
|
1046
|
-
return ret >>> 0;
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* @returns {number}
|
|
1050
|
-
*/
|
|
1051
|
-
get ifcTypeIdx() {
|
|
1052
|
-
const ret = wasm.gpumeshmetadata_ifcTypeIdx(this.__wbg_ptr);
|
|
1053
|
-
return ret;
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* @returns {number}
|
|
1057
|
-
*/
|
|
1058
|
-
get indexOffset() {
|
|
1059
|
-
const ret = wasm.gpumeshmetadata_indexOffset(this.__wbg_ptr);
|
|
1060
|
-
return ret >>> 0;
|
|
1061
|
-
}
|
|
1062
|
-
/**
|
|
1063
|
-
* @returns {number}
|
|
1064
|
-
*/
|
|
1065
|
-
get vertexCount() {
|
|
1066
|
-
const ret = wasm.gpumeshmetadata_vertexCount(this.__wbg_ptr);
|
|
1067
|
-
return ret >>> 0;
|
|
1068
|
-
}
|
|
1069
|
-
/**
|
|
1070
|
-
* @returns {number}
|
|
1071
|
-
*/
|
|
1072
|
-
get vertexOffset() {
|
|
1073
|
-
const ret = wasm.gpumeshmetadata_vertexOffset(this.__wbg_ptr);
|
|
1074
|
-
return ret >>> 0;
|
|
1075
|
-
}
|
|
1076
|
-
/**
|
|
1077
|
-
* @returns {Float32Array}
|
|
1078
|
-
*/
|
|
1079
|
-
get color() {
|
|
1080
|
-
try {
|
|
1081
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1082
|
-
wasm.gpumeshmetadata_color(retptr, this.__wbg_ptr);
|
|
1083
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1084
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1085
|
-
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
1086
|
-
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
1087
|
-
return v1;
|
|
1088
|
-
} finally {
|
|
1089
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
if (Symbol.dispose) GpuMeshMetadata.prototype[Symbol.dispose] = GpuMeshMetadata.prototype.free;
|
|
231
|
+
const IfcAPIFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
232
|
+
? { register: () => {}, unregister: () => {} }
|
|
233
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ifcapi_free(ptr >>> 0, 1));
|
|
234
|
+
|
|
235
|
+
const MeshCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
236
|
+
? { register: () => {}, unregister: () => {} }
|
|
237
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_meshcollection_free(ptr >>> 0, 1));
|
|
238
|
+
|
|
239
|
+
const MeshDataJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
240
|
+
? { register: () => {}, unregister: () => {} }
|
|
241
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_meshdatajs_free(ptr >>> 0, 1));
|
|
242
|
+
|
|
243
|
+
const ProfileCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
244
|
+
? { register: () => {}, unregister: () => {} }
|
|
245
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_profilecollection_free(ptr >>> 0, 1));
|
|
246
|
+
|
|
247
|
+
const ProfileEntryJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
248
|
+
? { register: () => {}, unregister: () => {} }
|
|
249
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_profileentryjs_free(ptr >>> 0, 1));
|
|
250
|
+
|
|
251
|
+
const SymbolicCircleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
252
|
+
? { register: () => {}, unregister: () => {} }
|
|
253
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_symboliccircle_free(ptr >>> 0, 1));
|
|
254
|
+
|
|
255
|
+
const SymbolicFillAreaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
256
|
+
? { register: () => {}, unregister: () => {} }
|
|
257
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicfillarea_free(ptr >>> 0, 1));
|
|
258
|
+
|
|
259
|
+
const SymbolicPolylineFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
260
|
+
? { register: () => {}, unregister: () => {} }
|
|
261
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicpolyline_free(ptr >>> 0, 1));
|
|
262
|
+
|
|
263
|
+
const SymbolicRepresentationCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
264
|
+
? { register: () => {}, unregister: () => {} }
|
|
265
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_symbolicrepresentationcollection_free(ptr >>> 0, 1));
|
|
266
|
+
|
|
267
|
+
const SymbolicTextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
268
|
+
? { register: () => {}, unregister: () => {} }
|
|
269
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_symbolictext_free(ptr >>> 0, 1));
|
|
1094
270
|
|
|
1095
271
|
/**
|
|
1096
272
|
* Main IFC-Lite API
|
|
@@ -1106,74 +282,6 @@ export class IfcAPI {
|
|
|
1106
282
|
const ptr = this.__destroy_into_raw();
|
|
1107
283
|
wasm.__wbg_ifcapi_free(ptr, 0);
|
|
1108
284
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* Parse IFC file and return individual meshes with express IDs and colors
|
|
1111
|
-
* This matches the MeshData[] format expected by the viewer
|
|
1112
|
-
*
|
|
1113
|
-
* Example:
|
|
1114
|
-
* ```javascript
|
|
1115
|
-
* const api = new IfcAPI();
|
|
1116
|
-
* const collection = api.parseMeshes(ifcData);
|
|
1117
|
-
* for (let i = 0; i < collection.length; i++) {
|
|
1118
|
-
* const mesh = collection.get(i);
|
|
1119
|
-
* console.log('Express ID:', mesh.expressId);
|
|
1120
|
-
* console.log('Positions:', mesh.positions);
|
|
1121
|
-
* console.log('Color:', mesh.color);
|
|
1122
|
-
* }
|
|
1123
|
-
* ```
|
|
1124
|
-
* @param {string} content
|
|
1125
|
-
* @returns {MeshCollection}
|
|
1126
|
-
*/
|
|
1127
|
-
parseMeshes(content) {
|
|
1128
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1129
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1130
|
-
const ret = wasm.ifcapi_parseMeshes(this.__wbg_ptr, ptr0, len0);
|
|
1131
|
-
return MeshCollection.__wrap(ret);
|
|
1132
|
-
}
|
|
1133
|
-
/**
|
|
1134
|
-
* Parse IFC file with streaming mesh batches for progressive rendering
|
|
1135
|
-
* Calls the callback with batches of meshes, yielding to browser between batches
|
|
1136
|
-
*
|
|
1137
|
-
* Options:
|
|
1138
|
-
* - `batchSize`: Number of meshes per batch (default: 25)
|
|
1139
|
-
* - `onBatch(meshes, progress)`: Called for each batch of meshes
|
|
1140
|
-
* - `onRtcOffset({x, y, z, hasRtc})`: Called early with RTC offset for camera/world setup
|
|
1141
|
-
* - `onColorUpdate(Map<id, color>)`: Called with style updates after initial render
|
|
1142
|
-
* - `onComplete(stats)`: Called when parsing completes with stats including rtcOffset
|
|
1143
|
-
*
|
|
1144
|
-
* Example:
|
|
1145
|
-
* ```javascript
|
|
1146
|
-
* const api = new IfcAPI();
|
|
1147
|
-
* await api.parseMeshesAsync(ifcData, {
|
|
1148
|
-
* batchSize: 100,
|
|
1149
|
-
* onRtcOffset: (rtc) => {
|
|
1150
|
-
* if (rtc.hasRtc) {
|
|
1151
|
-
* // Model uses large coordinates - adjust camera/world origin
|
|
1152
|
-
* viewer.setWorldOffset(rtc.x, rtc.y, rtc.z);
|
|
1153
|
-
* }
|
|
1154
|
-
* },
|
|
1155
|
-
* onBatch: (meshes, progress) => {
|
|
1156
|
-
* for (const mesh of meshes) {
|
|
1157
|
-
* scene.add(createThreeMesh(mesh));
|
|
1158
|
-
* }
|
|
1159
|
-
* console.log(`Progress: ${progress.percent}%`);
|
|
1160
|
-
* },
|
|
1161
|
-
* onComplete: (stats) => {
|
|
1162
|
-
* console.log(`Done! ${stats.totalMeshes} meshes`);
|
|
1163
|
-
* // stats.rtcOffset also available here: {x, y, z, hasRtc}
|
|
1164
|
-
* }
|
|
1165
|
-
* });
|
|
1166
|
-
* ```
|
|
1167
|
-
* @param {string} content
|
|
1168
|
-
* @param {any} options
|
|
1169
|
-
* @returns {Promise<any>}
|
|
1170
|
-
*/
|
|
1171
|
-
parseMeshesAsync(content, options) {
|
|
1172
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1173
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1174
|
-
const ret = wasm.ifcapi_parseMeshesAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
1175
|
-
return takeObject(ret);
|
|
1176
|
-
}
|
|
1177
285
|
/**
|
|
1178
286
|
* Fast pre-pass: scans for geometry entities ONLY (skips style/void/material resolution).
|
|
1179
287
|
* Returns job list + unit scale + RTC offset in ~1-2s instead of ~6s.
|
|
@@ -1200,108 +308,6 @@ export class IfcAPI {
|
|
|
1200
308
|
const ret = wasm.ifcapi_buildPrePassOnce(this.__wbg_ptr, ptr0, len0);
|
|
1201
309
|
return takeObject(ret);
|
|
1202
310
|
}
|
|
1203
|
-
/**
|
|
1204
|
-
* Parse a subset of IFC geometry entities by index range.
|
|
1205
|
-
*
|
|
1206
|
-
* Performs the full pre-pass (entity index, combined style/void/brep scan)
|
|
1207
|
-
* but only processes geometry entities whose index (in the combined
|
|
1208
|
-
* simple + complex job list) falls within `[start_idx, end_idx)`.
|
|
1209
|
-
*
|
|
1210
|
-
* This enables Web Worker parallelization: each worker processes a
|
|
1211
|
-
* disjoint slice of the entity list while sharing the same pre-pass data.
|
|
1212
|
-
*
|
|
1213
|
-
* Example:
|
|
1214
|
-
* ```javascript
|
|
1215
|
-
* const api = new IfcAPI();
|
|
1216
|
-
* // Worker 1: entities 0..500
|
|
1217
|
-
* const batch1 = api.parseMeshesSubset(content, 0, 500);
|
|
1218
|
-
* // Worker 2: entities 500..1000
|
|
1219
|
-
* const batch2 = api.parseMeshesSubset(content, 500, 1000);
|
|
1220
|
-
* ```
|
|
1221
|
-
* @param {string} content
|
|
1222
|
-
* @param {number} start_idx
|
|
1223
|
-
* @param {number} end_idx
|
|
1224
|
-
* @param {boolean} skip_expensive
|
|
1225
|
-
* @returns {MeshCollection}
|
|
1226
|
-
*/
|
|
1227
|
-
parseMeshesSubset(content, start_idx, end_idx, skip_expensive) {
|
|
1228
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1229
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1230
|
-
const ret = wasm.ifcapi_parseMeshesSubset(this.__wbg_ptr, ptr0, len0, start_idx, end_idx, skip_expensive);
|
|
1231
|
-
return MeshCollection.__wrap(ret);
|
|
1232
|
-
}
|
|
1233
|
-
/**
|
|
1234
|
-
* Parse IFC file and return GPU-ready geometry for zero-copy upload
|
|
1235
|
-
*
|
|
1236
|
-
* This method generates geometry that is:
|
|
1237
|
-
* - Pre-interleaved (position + normal per vertex)
|
|
1238
|
-
* - Coordinate-converted (Z-up to Y-up)
|
|
1239
|
-
* - Ready for direct GPU upload via pointer access
|
|
1240
|
-
*
|
|
1241
|
-
* Example:
|
|
1242
|
-
* ```javascript
|
|
1243
|
-
* const api = new IfcAPI();
|
|
1244
|
-
* const gpuGeom = api.parseToGpuGeometry(ifcData);
|
|
1245
|
-
*
|
|
1246
|
-
* // Get WASM memory for zero-copy views
|
|
1247
|
-
* const memory = api.getMemory();
|
|
1248
|
-
*
|
|
1249
|
-
* // Create views directly into WASM memory (NO COPY!)
|
|
1250
|
-
* const vertexView = new Float32Array(
|
|
1251
|
-
* memory.buffer,
|
|
1252
|
-
* gpuGeom.vertexDataPtr,
|
|
1253
|
-
* gpuGeom.vertexDataLen
|
|
1254
|
-
* );
|
|
1255
|
-
* const indexView = new Uint32Array(
|
|
1256
|
-
* memory.buffer,
|
|
1257
|
-
* gpuGeom.indicesPtr,
|
|
1258
|
-
* gpuGeom.indicesLen
|
|
1259
|
-
* );
|
|
1260
|
-
*
|
|
1261
|
-
* // Upload directly to GPU (single copy: WASM → GPU)
|
|
1262
|
-
* device.queue.writeBuffer(vertexBuffer, 0, vertexView);
|
|
1263
|
-
* device.queue.writeBuffer(indexBuffer, 0, indexView);
|
|
1264
|
-
*
|
|
1265
|
-
* // Free when done
|
|
1266
|
-
* gpuGeom.free();
|
|
1267
|
-
* ```
|
|
1268
|
-
* @param {string} content
|
|
1269
|
-
* @returns {GpuGeometry}
|
|
1270
|
-
*/
|
|
1271
|
-
parseToGpuGeometry(content) {
|
|
1272
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1273
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1274
|
-
const ret = wasm.ifcapi_parseToGpuGeometry(this.__wbg_ptr, ptr0, len0);
|
|
1275
|
-
return GpuGeometry.__wrap(ret);
|
|
1276
|
-
}
|
|
1277
|
-
/**
|
|
1278
|
-
* Parse IFC file and return instanced geometry grouped by geometry hash
|
|
1279
|
-
* This reduces draw calls by grouping identical geometries with different transforms
|
|
1280
|
-
*
|
|
1281
|
-
* Example:
|
|
1282
|
-
* ```javascript
|
|
1283
|
-
* const api = new IfcAPI();
|
|
1284
|
-
* const collection = api.parseMeshesInstanced(ifcData);
|
|
1285
|
-
* for (let i = 0; i < collection.length; i++) {
|
|
1286
|
-
* const geometry = collection.get(i);
|
|
1287
|
-
* console.log('Geometry ID:', geometry.geometryId);
|
|
1288
|
-
* console.log('Instances:', geometry.instanceCount);
|
|
1289
|
-
* for (let j = 0; j < geometry.instanceCount; j++) {
|
|
1290
|
-
* const inst = geometry.getInstance(j);
|
|
1291
|
-
* console.log(' Express ID:', inst.expressId);
|
|
1292
|
-
* console.log(' Transform:', inst.transform);
|
|
1293
|
-
* }
|
|
1294
|
-
* }
|
|
1295
|
-
* ```
|
|
1296
|
-
* @param {string} content
|
|
1297
|
-
* @returns {InstancedMeshCollection}
|
|
1298
|
-
*/
|
|
1299
|
-
parseMeshesInstanced(content) {
|
|
1300
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1301
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1302
|
-
const ret = wasm.ifcapi_parseMeshesInstanced(this.__wbg_ptr, ptr0, len0);
|
|
1303
|
-
return InstancedMeshCollection.__wrap(ret);
|
|
1304
|
-
}
|
|
1305
311
|
/**
|
|
1306
312
|
* Process geometry for a subset of pre-scanned entities.
|
|
1307
313
|
* Takes raw bytes and pre-pass data from buildPrePassOnce.
|
|
@@ -1337,245 +343,53 @@ export class IfcAPI {
|
|
|
1337
343
|
const ret = wasm.ifcapi_processGeometryBatch(this.__wbg_ptr, ptr0, len0, ptr1, len1, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6);
|
|
1338
344
|
return MeshCollection.__wrap(ret);
|
|
1339
345
|
}
|
|
1340
|
-
/**
|
|
1341
|
-
* Phase 1 of Path C — sharded entity-index scan.
|
|
1342
|
-
*
|
|
1343
|
-
* Walks the bytes in `[range_start, range_end)` once and emits
|
|
1344
|
-
* `(express_id, byte_offset, byte_length)` triples for every entity
|
|
1345
|
-
* whose `#N=` opener falls in that range. Byte offsets are GLOBAL
|
|
1346
|
-
* (relative to file start), so multiple shards' outputs concatenate
|
|
1347
|
-
* without rewriting.
|
|
1348
|
-
*
|
|
1349
|
-
* Cross-boundary handling: the scanner rewinds `range_start` to the
|
|
1350
|
-
* byte after the previous `\n` so we don't mis-parse a half entity.
|
|
1351
|
-
* The previous shard owns any entity whose opener is BEFORE its own
|
|
1352
|
-
* range_end (its terminator may extend past it; that's fine — the
|
|
1353
|
-
* scanner walks STEP entities to their terminating `;`, even if that
|
|
1354
|
-
* terminator is past the shard's nominal range_end).
|
|
1355
|
-
*
|
|
1356
|
-
* Returns nothing through the JS callback for performance signals;
|
|
1357
|
-
* emits exactly one `index-shard` event with three Uint32Arrays:
|
|
1358
|
-
* `{ type: "index-shard", ids: Uint32Array, starts: Uint32Array,
|
|
1359
|
-
* lengths: Uint32Array, shardStart: u32, shardEnd: u32 }`
|
|
1360
|
-
*
|
|
1361
|
-
* Used by the JS-side shard coordinator to merge N shards' indices
|
|
1362
|
-
* into a single entity-index without paying the 3 s single-threaded
|
|
1363
|
-
* scan cost. Style and job emission are NOT done here — they remain
|
|
1364
|
-
* the job of the existing `build_pre_pass_streaming` (which can be
|
|
1365
|
-
* called on shard 0 in parallel with the other shards' index-only
|
|
1366
|
-
* scans).
|
|
1367
|
-
* @param {Uint8Array} data
|
|
1368
|
-
* @param {Function} on_event
|
|
1369
|
-
* @param {number} range_start
|
|
1370
|
-
* @param {number} range_end
|
|
1371
|
-
* @returns {any}
|
|
1372
|
-
*/
|
|
1373
|
-
scanEntityIndexShard(data, on_event, range_start, range_end) {
|
|
1374
|
-
try {
|
|
1375
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1376
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
|
|
1377
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1378
|
-
wasm.ifcapi_scanEntityIndexShard(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), range_start, range_end);
|
|
1379
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1380
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1381
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1382
|
-
if (r2) {
|
|
1383
|
-
throw takeObject(r1);
|
|
1384
|
-
}
|
|
1385
|
-
return takeObject(r0);
|
|
1386
|
-
} finally {
|
|
1387
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1388
|
-
heap[stack_pointer++] = undefined;
|
|
1389
|
-
}
|
|
1390
|
-
}
|
|
1391
346
|
/**
|
|
1392
347
|
* Streaming pre-pass: emits geometry jobs in chunks via a JS callback
|
|
1393
348
|
* instead of waiting for the full file scan to complete.
|
|
1394
349
|
*
|
|
1395
|
-
* Single linear walk over the file:
|
|
1396
|
-
* 1. Builds the entity index incrementally from the same scan that
|
|
1397
|
-
* collects geometry jobs (the old `build_pre_pass_fast` did two
|
|
1398
|
-
* full-file scans — one for entities, one for the index — which
|
|
1399
|
-
* doubled wall-clock).
|
|
1400
|
-
* 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
|
|
1401
|
-
* first ~50 geometry jobs have been collected, resolves
|
|
1402
|
-
* `unitScale` + `rtcOffset` and emits a `meta` callback so the
|
|
1403
|
-
* JS host can spin up geometry process workers.
|
|
1404
|
-
* 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
|
|
1405
|
-
* the meta phase already buffered some).
|
|
1406
|
-
* 4. Emits `complete` with the total job count at end of scan.
|
|
1407
|
-
*
|
|
1408
|
-
* On a 986 MB / 14 M-entity file this drops time-to-first-geometry
|
|
1409
|
-
* from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
|
|
1410
|
-
* (first 100 K bytes scanned + meta + first chunk).
|
|
1411
|
-
*
|
|
1412
|
-
* The callback receives a single `JsValue` argument shaped as one of:
|
|
1413
|
-
* `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
|
|
1414
|
-
* `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
|
|
1415
|
-
* `{ type: "complete", totalJobs }`
|
|
1416
|
-
* @param {Uint8Array} data
|
|
1417
|
-
* @param {Function} on_event
|
|
1418
|
-
* @param {number} chunk_size
|
|
1419
|
-
* @returns {any}
|
|
1420
|
-
*/
|
|
1421
|
-
buildPrePassStreaming(data, on_event, chunk_size) {
|
|
1422
|
-
try {
|
|
1423
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1424
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
|
|
1425
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1426
|
-
wasm.ifcapi_buildPrePassStreaming(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), chunk_size);
|
|
1427
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1428
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1429
|
-
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1430
|
-
if (r2) {
|
|
1431
|
-
throw takeObject(r1);
|
|
1432
|
-
}
|
|
1433
|
-
return takeObject(r0);
|
|
1434
|
-
} finally {
|
|
1435
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1436
|
-
heap[stack_pointer++] = undefined;
|
|
1437
|
-
}
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* Parse IFC file with streaming GPU-ready geometry batches
|
|
1441
|
-
*
|
|
1442
|
-
* Yields batches of GPU-ready geometry for progressive rendering with zero-copy upload.
|
|
1443
|
-
* Uses fast-first-frame streaming: simple geometry (walls, slabs) first.
|
|
1444
|
-
*
|
|
1445
|
-
* Example:
|
|
1446
|
-
* ```javascript
|
|
1447
|
-
* const api = new IfcAPI();
|
|
1448
|
-
* const memory = api.getMemory();
|
|
1449
|
-
*
|
|
1450
|
-
* await api.parseToGpuGeometryAsync(ifcData, {
|
|
1451
|
-
* batchSize: 25,
|
|
1452
|
-
* onBatch: (gpuGeom, progress) => {
|
|
1453
|
-
* // Create zero-copy views
|
|
1454
|
-
* const vertexView = new Float32Array(
|
|
1455
|
-
* memory.buffer,
|
|
1456
|
-
* gpuGeom.vertexDataPtr,
|
|
1457
|
-
* gpuGeom.vertexDataLen
|
|
1458
|
-
* );
|
|
1459
|
-
*
|
|
1460
|
-
* // Upload to GPU
|
|
1461
|
-
* device.queue.writeBuffer(vertexBuffer, 0, vertexView);
|
|
1462
|
-
*
|
|
1463
|
-
* // IMPORTANT: Free immediately after upload!
|
|
1464
|
-
* gpuGeom.free();
|
|
1465
|
-
* },
|
|
1466
|
-
* onComplete: (stats) => {
|
|
1467
|
-
* console.log(`Done! ${stats.totalMeshes} meshes`);
|
|
1468
|
-
* }
|
|
1469
|
-
* });
|
|
1470
|
-
* ```
|
|
1471
|
-
* @param {string} content
|
|
1472
|
-
* @param {any} options
|
|
1473
|
-
* @returns {Promise<any>}
|
|
1474
|
-
*/
|
|
1475
|
-
parseToGpuGeometryAsync(content, options) {
|
|
1476
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1477
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1478
|
-
const ret = wasm.ifcapi_parseToGpuGeometryAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
1479
|
-
return takeObject(ret);
|
|
1480
|
-
}
|
|
1481
|
-
/**
|
|
1482
|
-
* Parse IFC file with streaming instanced geometry batches for progressive rendering
|
|
1483
|
-
* Groups identical geometries and yields batches of InstancedGeometry
|
|
1484
|
-
* Uses fast-first-frame streaming: simple geometry (walls, slabs) first
|
|
1485
|
-
*
|
|
1486
|
-
* Example:
|
|
1487
|
-
* ```javascript
|
|
1488
|
-
* const api = new IfcAPI();
|
|
1489
|
-
* await api.parseMeshesInstancedAsync(ifcData, {
|
|
1490
|
-
* batchSize: 25, // Number of unique geometries per batch
|
|
1491
|
-
* onBatch: (geometries, progress) => {
|
|
1492
|
-
* for (const geom of geometries) {
|
|
1493
|
-
* renderer.addInstancedGeometry(geom);
|
|
1494
|
-
* }
|
|
1495
|
-
* },
|
|
1496
|
-
* onComplete: (stats) => {
|
|
1497
|
-
* console.log(`Done! ${stats.totalGeometries} unique geometries, ${stats.totalInstances} instances`);
|
|
1498
|
-
* }
|
|
1499
|
-
* });
|
|
1500
|
-
* ```
|
|
1501
|
-
* @param {string} content
|
|
1502
|
-
* @param {any} options
|
|
1503
|
-
* @returns {Promise<any>}
|
|
1504
|
-
*/
|
|
1505
|
-
parseMeshesInstancedAsync(content, options) {
|
|
1506
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1507
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1508
|
-
const ret = wasm.ifcapi_parseMeshesInstancedAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
1509
|
-
return takeObject(ret);
|
|
1510
|
-
}
|
|
1511
|
-
/**
|
|
1512
|
-
* Parse IFC file to GPU-ready instanced geometry for zero-copy upload
|
|
1513
|
-
*
|
|
1514
|
-
* Groups identical geometries by hash for efficient GPU instancing.
|
|
1515
|
-
* Returns a collection of instanced geometries with pointer access.
|
|
1516
|
-
* @param {string} content
|
|
1517
|
-
* @returns {GpuInstancedGeometryCollection}
|
|
1518
|
-
*/
|
|
1519
|
-
parseToGpuInstancedGeometry(content) {
|
|
1520
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1521
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1522
|
-
const ret = wasm.ifcapi_parseToGpuInstancedGeometry(this.__wbg_ptr, ptr0, len0);
|
|
1523
|
-
return GpuInstancedGeometryCollection.__wrap(ret);
|
|
1524
|
-
}
|
|
1525
|
-
/**
|
|
1526
|
-
* Process instanced geometry for a subset of pre-scanned entities.
|
|
1527
|
-
* Takes raw bytes and pre-pass data from buildPrePassOnce.
|
|
1528
|
-
* @param {Uint8Array} data
|
|
1529
|
-
* @param {Uint32Array} jobs_flat
|
|
1530
|
-
* @param {number} unit_scale
|
|
1531
|
-
* @param {number} rtc_x
|
|
1532
|
-
* @param {number} rtc_y
|
|
1533
|
-
* @param {number} rtc_z
|
|
1534
|
-
* @param {boolean} needs_shift
|
|
1535
|
-
* @param {Uint32Array} style_ids
|
|
1536
|
-
* @param {Uint8Array} style_colors
|
|
1537
|
-
* @returns {InstancedMeshCollection}
|
|
1538
|
-
*/
|
|
1539
|
-
processInstancedGeometryBatch(data, jobs_flat, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, style_ids, style_colors) {
|
|
1540
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
|
|
1541
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1542
|
-
const ptr1 = passArray32ToWasm0(jobs_flat, wasm.__wbindgen_export3);
|
|
1543
|
-
const len1 = WASM_VECTOR_LEN;
|
|
1544
|
-
const ptr2 = passArray32ToWasm0(style_ids, wasm.__wbindgen_export3);
|
|
1545
|
-
const len2 = WASM_VECTOR_LEN;
|
|
1546
|
-
const ptr3 = passArray8ToWasm0(style_colors, wasm.__wbindgen_export3);
|
|
1547
|
-
const len3 = WASM_VECTOR_LEN;
|
|
1548
|
-
const ret = wasm.ifcapi_processInstancedGeometryBatch(this.__wbg_ptr, ptr0, len0, ptr1, len1, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr2, len2, ptr3, len3);
|
|
1549
|
-
return InstancedMeshCollection.__wrap(ret);
|
|
1550
|
-
}
|
|
1551
|
-
/**
|
|
1552
|
-
* Parse IFC file with zero-copy mesh data
|
|
1553
|
-
* Maximum performance - returns mesh with direct memory access
|
|
1554
|
-
*
|
|
1555
|
-
* Example:
|
|
1556
|
-
* ```javascript
|
|
1557
|
-
* const api = new IfcAPI();
|
|
1558
|
-
* const mesh = await api.parseZeroCopy(ifcData);
|
|
350
|
+
* Single linear walk over the file:
|
|
351
|
+
* 1. Builds the entity index incrementally from the same scan that
|
|
352
|
+
* collects geometry jobs (the old `build_pre_pass_fast` did two
|
|
353
|
+
* full-file scans — one for entities, one for the index — which
|
|
354
|
+
* doubled wall-clock).
|
|
355
|
+
* 2. As soon as `IFCPROJECT` has been seen, the unit scale and the
|
|
356
|
+
* first ~50 geometry jobs have been collected, resolves
|
|
357
|
+
* `unitScale` + `rtcOffset` and emits a `meta` callback so the
|
|
358
|
+
* JS host can spin up geometry process workers.
|
|
359
|
+
* 3. Emits `jobs` callbacks every `chunk_size` jobs (or fewer if
|
|
360
|
+
* the meta phase already buffered some).
|
|
361
|
+
* 4. Emits `complete` with the total job count at end of scan.
|
|
1559
362
|
*
|
|
1560
|
-
*
|
|
1561
|
-
*
|
|
1562
|
-
*
|
|
1563
|
-
* memory.buffer,
|
|
1564
|
-
* mesh.positions_ptr,
|
|
1565
|
-
* mesh.positions_len
|
|
1566
|
-
* );
|
|
363
|
+
* On a 986 MB / 14 M-entity file this drops time-to-first-geometry
|
|
364
|
+
* from ~17 s (full pre-pass + worker spawn + first batch) to ~3 s
|
|
365
|
+
* (first 100 K bytes scanned + meta + first chunk).
|
|
1567
366
|
*
|
|
1568
|
-
*
|
|
1569
|
-
*
|
|
1570
|
-
*
|
|
1571
|
-
*
|
|
1572
|
-
* @
|
|
367
|
+
* The callback receives a single `JsValue` argument shaped as one of:
|
|
368
|
+
* `{ type: "meta", unitScale, rtcOffset: [x,y,z], needsShift, buildingRotation? }`
|
|
369
|
+
* `{ type: "jobs", jobs: Uint32Array }` // [id, start, end] triples
|
|
370
|
+
* `{ type: "complete", totalJobs }`
|
|
371
|
+
* @param {Uint8Array} data
|
|
372
|
+
* @param {Function} on_event
|
|
373
|
+
* @param {number} chunk_size
|
|
374
|
+
* @returns {any}
|
|
1573
375
|
*/
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
376
|
+
buildPrePassStreaming(data, on_event, chunk_size) {
|
|
377
|
+
try {
|
|
378
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
379
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export3);
|
|
380
|
+
const len0 = WASM_VECTOR_LEN;
|
|
381
|
+
wasm.ifcapi_buildPrePassStreaming(retptr, this.__wbg_ptr, ptr0, len0, addBorrowedObject(on_event), chunk_size);
|
|
382
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
383
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
384
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
385
|
+
if (r2) {
|
|
386
|
+
throw takeObject(r1);
|
|
387
|
+
}
|
|
388
|
+
return takeObject(r0);
|
|
389
|
+
} finally {
|
|
390
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
391
|
+
heap[stack_pointer++] = undefined;
|
|
392
|
+
}
|
|
1579
393
|
}
|
|
1580
394
|
/**
|
|
1581
395
|
* Extract raw profile polygons from all building elements with `IfcExtrudedAreaSolid`
|
|
@@ -1608,52 +422,6 @@ export class IfcAPI {
|
|
|
1608
422
|
const ret = wasm.ifcapi_extractProfiles(this.__wbg_ptr, ptr0, len0, model_index);
|
|
1609
423
|
return ProfileCollection.__wrap(ret);
|
|
1610
424
|
}
|
|
1611
|
-
/**
|
|
1612
|
-
* Debug: Test processing entity #953 (FacetedBrep wall)
|
|
1613
|
-
* @param {string} content
|
|
1614
|
-
* @returns {string}
|
|
1615
|
-
*/
|
|
1616
|
-
debugProcessEntity953(content) {
|
|
1617
|
-
let deferred2_0;
|
|
1618
|
-
let deferred2_1;
|
|
1619
|
-
try {
|
|
1620
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1621
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1622
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1623
|
-
wasm.ifcapi_debugProcessEntity953(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1624
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1625
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1626
|
-
deferred2_0 = r0;
|
|
1627
|
-
deferred2_1 = r1;
|
|
1628
|
-
return getStringFromWasm0(r0, r1);
|
|
1629
|
-
} finally {
|
|
1630
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1631
|
-
wasm.__wbindgen_export2(deferred2_0, deferred2_1, 1);
|
|
1632
|
-
}
|
|
1633
|
-
}
|
|
1634
|
-
/**
|
|
1635
|
-
* Debug: Test processing a single wall
|
|
1636
|
-
* @param {string} content
|
|
1637
|
-
* @returns {string}
|
|
1638
|
-
*/
|
|
1639
|
-
debugProcessFirstWall(content) {
|
|
1640
|
-
let deferred2_0;
|
|
1641
|
-
let deferred2_1;
|
|
1642
|
-
try {
|
|
1643
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1644
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1645
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1646
|
-
wasm.ifcapi_debugProcessFirstWall(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1647
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1648
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1649
|
-
deferred2_0 = r0;
|
|
1650
|
-
deferred2_1 = r1;
|
|
1651
|
-
return getStringFromWasm0(r0, r1);
|
|
1652
|
-
} finally {
|
|
1653
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1654
|
-
wasm.__wbindgen_export2(deferred2_0, deferred2_1, 1);
|
|
1655
|
-
}
|
|
1656
|
-
}
|
|
1657
425
|
/**
|
|
1658
426
|
* Get WASM memory for zero-copy access
|
|
1659
427
|
* @returns {any}
|
|
@@ -1699,17 +467,15 @@ export class IfcAPI {
|
|
|
1699
467
|
/**
|
|
1700
468
|
* Toggle the "render multilayer walls as a single solid" mode (issue #540).
|
|
1701
469
|
*
|
|
1702
|
-
* When `enabled` is `true`, every subsequent `
|
|
1703
|
-
* suppress geometry emission for `IfcBuildingElementPart` entities
|
|
1704
|
-
* `IfcRelAggregates` parent wall is sliceable (has an
|
|
470
|
+
* When `enabled` is `true`, every subsequent `processGeometryBatch` call
|
|
471
|
+
* will suppress geometry emission for `IfcBuildingElementPart` entities
|
|
472
|
+
* whose `IfcRelAggregates` parent wall is sliceable (has an
|
|
1705
473
|
* `IfcMaterialLayerSetUsage`) AND has its own `Representation`. The
|
|
1706
474
|
* parent wall keeps its per-layer sub-mesh colouring, so the visual
|
|
1707
475
|
* result is the same as the layered render but with one mesh per wall
|
|
1708
476
|
* instead of one per layer part — much cheaper for both CPU and GPU.
|
|
1709
477
|
*
|
|
1710
|
-
* Default is `false`. Pass `true` before calling `
|
|
1711
|
-
* `parseMeshesSubset`, `parseMeshesAsync`, `parseMeshesInstanced`, or
|
|
1712
|
-
* `parseMeshesInstancedAsync`.
|
|
478
|
+
* Default is `false`. Pass `true` before calling `processGeometryBatch`.
|
|
1713
479
|
* @param {boolean} enabled
|
|
1714
480
|
*/
|
|
1715
481
|
setMergeLayers(enabled) {
|
|
@@ -1765,53 +531,6 @@ export class IfcAPI {
|
|
|
1765
531
|
const ret = wasm.ifcapi_is_ready(this.__wbg_ptr);
|
|
1766
532
|
return ret !== 0;
|
|
1767
533
|
}
|
|
1768
|
-
/**
|
|
1769
|
-
* Extract georeferencing information from IFC content
|
|
1770
|
-
* Returns null if no georeferencing is present
|
|
1771
|
-
*
|
|
1772
|
-
* Example:
|
|
1773
|
-
* ```javascript
|
|
1774
|
-
* const api = new IfcAPI();
|
|
1775
|
-
* const georef = api.getGeoReference(ifcData);
|
|
1776
|
-
* if (georef) {
|
|
1777
|
-
* console.log('CRS:', georef.crsName);
|
|
1778
|
-
* const [e, n, h] = georef.localToMap(10, 20, 5);
|
|
1779
|
-
* }
|
|
1780
|
-
* ```
|
|
1781
|
-
* @param {string} content
|
|
1782
|
-
* @returns {GeoReferenceJs | undefined}
|
|
1783
|
-
*/
|
|
1784
|
-
getGeoReference(content) {
|
|
1785
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1786
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1787
|
-
const ret = wasm.ifcapi_getGeoReference(this.__wbg_ptr, ptr0, len0);
|
|
1788
|
-
return ret === 0 ? undefined : GeoReferenceJs.__wrap(ret);
|
|
1789
|
-
}
|
|
1790
|
-
/**
|
|
1791
|
-
* Parse IFC file and return mesh with RTC offset for large coordinates
|
|
1792
|
-
* This handles georeferenced models by shifting to centroid
|
|
1793
|
-
*
|
|
1794
|
-
* Example:
|
|
1795
|
-
* ```javascript
|
|
1796
|
-
* const api = new IfcAPI();
|
|
1797
|
-
* const result = api.parseMeshesWithRtc(ifcData);
|
|
1798
|
-
* const rtcOffset = result.rtcOffset;
|
|
1799
|
-
* const meshes = result.meshes;
|
|
1800
|
-
*
|
|
1801
|
-
* // Convert local coords back to world:
|
|
1802
|
-
* if (rtcOffset.isSignificant()) {
|
|
1803
|
-
* const [wx, wy, wz] = rtcOffset.toWorld(localX, localY, localZ);
|
|
1804
|
-
* }
|
|
1805
|
-
* ```
|
|
1806
|
-
* @param {string} content
|
|
1807
|
-
* @returns {MeshCollectionWithRtc}
|
|
1808
|
-
*/
|
|
1809
|
-
parseMeshesWithRtc(content) {
|
|
1810
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1811
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1812
|
-
const ret = wasm.ifcapi_parseMeshesWithRtc(this.__wbg_ptr, ptr0, len0);
|
|
1813
|
-
return MeshCollectionWithRtc.__wrap(ret);
|
|
1814
|
-
}
|
|
1815
534
|
/**
|
|
1816
535
|
* Parse IFC file with streaming events
|
|
1817
536
|
* Calls the callback function for each parse event
|
|
@@ -1889,219 +608,46 @@ export class IfcAPI {
|
|
|
1889
608
|
* Parse IFC file (traditional - waits for completion)
|
|
1890
609
|
*
|
|
1891
610
|
* Example:
|
|
1892
|
-
* ```javascript
|
|
1893
|
-
* const api = new IfcAPI();
|
|
1894
|
-
* const result = await api.parse(ifcData);
|
|
1895
|
-
* console.log('Entities:', result.entityCount);
|
|
1896
|
-
* ```
|
|
1897
|
-
* @param {string} content
|
|
1898
|
-
* @returns {Promise<any>}
|
|
1899
|
-
*/
|
|
1900
|
-
parse(content) {
|
|
1901
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1902
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1903
|
-
const ret = wasm.ifcapi_parse(this.__wbg_ptr, ptr0, len0);
|
|
1904
|
-
return takeObject(ret);
|
|
1905
|
-
}
|
|
1906
|
-
/**
|
|
1907
|
-
* Parse IFC file and extract symbolic representations (Plan, Annotation, FootPrint)
|
|
1908
|
-
* These are 2D curves used for architectural drawings instead of sectioning 3D geometry
|
|
1909
|
-
*
|
|
1910
|
-
* Example:
|
|
1911
|
-
* ```javascript
|
|
1912
|
-
* const api = new IfcAPI();
|
|
1913
|
-
* const symbols = api.parseSymbolicRepresentations(ifcData);
|
|
1914
|
-
* console.log('Found', symbols.totalCount, 'symbolic items');
|
|
1915
|
-
* for (let i = 0; i < symbols.polylineCount; i++) {
|
|
1916
|
-
* const polyline = symbols.getPolyline(i);
|
|
1917
|
-
* console.log('Polyline for', polyline.ifcType, ':', polyline.points);
|
|
1918
|
-
* }
|
|
1919
|
-
* ```
|
|
1920
|
-
* @param {string} content
|
|
1921
|
-
* @returns {SymbolicRepresentationCollection}
|
|
1922
|
-
*/
|
|
1923
|
-
parseSymbolicRepresentations(content) {
|
|
1924
|
-
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
1925
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1926
|
-
const ret = wasm.ifcapi_parseSymbolicRepresentations(this.__wbg_ptr, ptr0, len0);
|
|
1927
|
-
return SymbolicRepresentationCollection.__wrap(ret);
|
|
1928
|
-
}
|
|
1929
|
-
}
|
|
1930
|
-
if (Symbol.dispose) IfcAPI.prototype[Symbol.dispose] = IfcAPI.prototype.free;
|
|
1931
|
-
|
|
1932
|
-
/**
|
|
1933
|
-
* Instance data for instanced rendering
|
|
1934
|
-
*/
|
|
1935
|
-
export class InstanceData {
|
|
1936
|
-
static __wrap(ptr) {
|
|
1937
|
-
ptr = ptr >>> 0;
|
|
1938
|
-
const obj = Object.create(InstanceData.prototype);
|
|
1939
|
-
obj.__wbg_ptr = ptr;
|
|
1940
|
-
InstanceDataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1941
|
-
return obj;
|
|
1942
|
-
}
|
|
1943
|
-
__destroy_into_raw() {
|
|
1944
|
-
const ptr = this.__wbg_ptr;
|
|
1945
|
-
this.__wbg_ptr = 0;
|
|
1946
|
-
InstanceDataFinalization.unregister(this);
|
|
1947
|
-
return ptr;
|
|
1948
|
-
}
|
|
1949
|
-
free() {
|
|
1950
|
-
const ptr = this.__destroy_into_raw();
|
|
1951
|
-
wasm.__wbg_instancedata_free(ptr, 0);
|
|
1952
|
-
}
|
|
1953
|
-
/**
|
|
1954
|
-
* @returns {number}
|
|
1955
|
-
*/
|
|
1956
|
-
get expressId() {
|
|
1957
|
-
const ret = wasm.instancedata_expressId(this.__wbg_ptr);
|
|
1958
|
-
return ret >>> 0;
|
|
1959
|
-
}
|
|
1960
|
-
/**
|
|
1961
|
-
* @returns {Float32Array}
|
|
1962
|
-
*/
|
|
1963
|
-
get color() {
|
|
1964
|
-
try {
|
|
1965
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1966
|
-
wasm.instancedata_color(retptr, this.__wbg_ptr);
|
|
1967
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1968
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1969
|
-
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
1970
|
-
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
1971
|
-
return v1;
|
|
1972
|
-
} finally {
|
|
1973
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
/**
|
|
1977
|
-
* @returns {Float32Array}
|
|
1978
|
-
*/
|
|
1979
|
-
get transform() {
|
|
1980
|
-
const ret = wasm.instancedata_transform(this.__wbg_ptr);
|
|
1981
|
-
return takeObject(ret);
|
|
1982
|
-
}
|
|
1983
|
-
}
|
|
1984
|
-
if (Symbol.dispose) InstanceData.prototype[Symbol.dispose] = InstanceData.prototype.free;
|
|
1985
|
-
|
|
1986
|
-
/**
|
|
1987
|
-
* Instanced geometry - one geometry definition with multiple instances
|
|
1988
|
-
*/
|
|
1989
|
-
export class InstancedGeometry {
|
|
1990
|
-
static __wrap(ptr) {
|
|
1991
|
-
ptr = ptr >>> 0;
|
|
1992
|
-
const obj = Object.create(InstancedGeometry.prototype);
|
|
1993
|
-
obj.__wbg_ptr = ptr;
|
|
1994
|
-
InstancedGeometryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1995
|
-
return obj;
|
|
1996
|
-
}
|
|
1997
|
-
__destroy_into_raw() {
|
|
1998
|
-
const ptr = this.__wbg_ptr;
|
|
1999
|
-
this.__wbg_ptr = 0;
|
|
2000
|
-
InstancedGeometryFinalization.unregister(this);
|
|
2001
|
-
return ptr;
|
|
2002
|
-
}
|
|
2003
|
-
free() {
|
|
2004
|
-
const ptr = this.__destroy_into_raw();
|
|
2005
|
-
wasm.__wbg_instancedgeometry_free(ptr, 0);
|
|
2006
|
-
}
|
|
2007
|
-
/**
|
|
2008
|
-
* @returns {bigint}
|
|
2009
|
-
*/
|
|
2010
|
-
get geometryId() {
|
|
2011
|
-
const ret = wasm.gpuinstancedgeometry_geometryId(this.__wbg_ptr);
|
|
2012
|
-
return BigInt.asUintN(64, ret);
|
|
2013
|
-
}
|
|
2014
|
-
/**
|
|
2015
|
-
* @param {number} index
|
|
2016
|
-
* @returns {InstanceData | undefined}
|
|
2017
|
-
*/
|
|
2018
|
-
get_instance(index) {
|
|
2019
|
-
const ret = wasm.instancedgeometry_get_instance(this.__wbg_ptr, index);
|
|
2020
|
-
return ret === 0 ? undefined : InstanceData.__wrap(ret);
|
|
2021
|
-
}
|
|
2022
|
-
/**
|
|
2023
|
-
* @returns {number}
|
|
2024
|
-
*/
|
|
2025
|
-
get instance_count() {
|
|
2026
|
-
const ret = wasm.instancedgeometry_instance_count(this.__wbg_ptr);
|
|
2027
|
-
return ret >>> 0;
|
|
2028
|
-
}
|
|
2029
|
-
/**
|
|
2030
|
-
* @returns {Uint32Array}
|
|
2031
|
-
*/
|
|
2032
|
-
get indices() {
|
|
2033
|
-
const ret = wasm.instancedgeometry_indices(this.__wbg_ptr);
|
|
2034
|
-
return takeObject(ret);
|
|
2035
|
-
}
|
|
2036
|
-
/**
|
|
2037
|
-
* @returns {Float32Array}
|
|
2038
|
-
*/
|
|
2039
|
-
get normals() {
|
|
2040
|
-
const ret = wasm.instancedgeometry_normals(this.__wbg_ptr);
|
|
2041
|
-
return takeObject(ret);
|
|
2042
|
-
}
|
|
2043
|
-
/**
|
|
2044
|
-
* @returns {Float32Array}
|
|
2045
|
-
*/
|
|
2046
|
-
get positions() {
|
|
2047
|
-
const ret = wasm.instancedgeometry_positions(this.__wbg_ptr);
|
|
2048
|
-
return takeObject(ret);
|
|
2049
|
-
}
|
|
2050
|
-
}
|
|
2051
|
-
if (Symbol.dispose) InstancedGeometry.prototype[Symbol.dispose] = InstancedGeometry.prototype.free;
|
|
2052
|
-
|
|
2053
|
-
/**
|
|
2054
|
-
* Collection of instanced geometries
|
|
2055
|
-
*/
|
|
2056
|
-
export class InstancedMeshCollection {
|
|
2057
|
-
static __wrap(ptr) {
|
|
2058
|
-
ptr = ptr >>> 0;
|
|
2059
|
-
const obj = Object.create(InstancedMeshCollection.prototype);
|
|
2060
|
-
obj.__wbg_ptr = ptr;
|
|
2061
|
-
InstancedMeshCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2062
|
-
return obj;
|
|
2063
|
-
}
|
|
2064
|
-
__destroy_into_raw() {
|
|
2065
|
-
const ptr = this.__wbg_ptr;
|
|
2066
|
-
this.__wbg_ptr = 0;
|
|
2067
|
-
InstancedMeshCollectionFinalization.unregister(this);
|
|
2068
|
-
return ptr;
|
|
2069
|
-
}
|
|
2070
|
-
free() {
|
|
2071
|
-
const ptr = this.__destroy_into_raw();
|
|
2072
|
-
wasm.__wbg_instancedmeshcollection_free(ptr, 0);
|
|
2073
|
-
}
|
|
2074
|
-
/**
|
|
2075
|
-
* @returns {number}
|
|
2076
|
-
*/
|
|
2077
|
-
get totalInstances() {
|
|
2078
|
-
const ret = wasm.instancedmeshcollection_totalInstances(this.__wbg_ptr);
|
|
2079
|
-
return ret >>> 0;
|
|
2080
|
-
}
|
|
2081
|
-
/**
|
|
2082
|
-
* @returns {number}
|
|
2083
|
-
*/
|
|
2084
|
-
get totalGeometries() {
|
|
2085
|
-
const ret = wasm.gpuinstancedgeometrycollection_length(this.__wbg_ptr);
|
|
2086
|
-
return ret >>> 0;
|
|
2087
|
-
}
|
|
2088
|
-
/**
|
|
2089
|
-
* @param {number} index
|
|
2090
|
-
* @returns {InstancedGeometry | undefined}
|
|
611
|
+
* ```javascript
|
|
612
|
+
* const api = new IfcAPI();
|
|
613
|
+
* const result = await api.parse(ifcData);
|
|
614
|
+
* console.log('Entities:', result.entityCount);
|
|
615
|
+
* ```
|
|
616
|
+
* @param {string} content
|
|
617
|
+
* @returns {Promise<any>}
|
|
2091
618
|
*/
|
|
2092
|
-
|
|
2093
|
-
const
|
|
2094
|
-
|
|
619
|
+
parse(content) {
|
|
620
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
621
|
+
const len0 = WASM_VECTOR_LEN;
|
|
622
|
+
const ret = wasm.ifcapi_parse(this.__wbg_ptr, ptr0, len0);
|
|
623
|
+
return takeObject(ret);
|
|
2095
624
|
}
|
|
2096
625
|
/**
|
|
2097
|
-
*
|
|
626
|
+
* Parse IFC file and extract symbolic representations (Plan,
|
|
627
|
+
* Annotation, FootPrint, Axis). These are 2D curves used for
|
|
628
|
+
* architectural drawings instead of sectioning 3D geometry.
|
|
629
|
+
*
|
|
630
|
+
* Example:
|
|
631
|
+
* ```javascript
|
|
632
|
+
* const api = new IfcAPI();
|
|
633
|
+
* const symbols = api.parseSymbolicRepresentations(ifcData);
|
|
634
|
+
* console.log('Found', symbols.totalCount, 'symbolic items');
|
|
635
|
+
* for (let i = 0; i < symbols.polylineCount; i++) {
|
|
636
|
+
* const polyline = symbols.getPolyline(i);
|
|
637
|
+
* console.log('Polyline for', polyline.ifcType, ':', polyline.points);
|
|
638
|
+
* }
|
|
639
|
+
* ```
|
|
640
|
+
* @param {string} content
|
|
641
|
+
* @returns {SymbolicRepresentationCollection}
|
|
2098
642
|
*/
|
|
2099
|
-
|
|
2100
|
-
const
|
|
2101
|
-
|
|
643
|
+
parseSymbolicRepresentations(content) {
|
|
644
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
645
|
+
const len0 = WASM_VECTOR_LEN;
|
|
646
|
+
const ret = wasm.ifcapi_parseSymbolicRepresentations(this.__wbg_ptr, ptr0, len0);
|
|
647
|
+
return SymbolicRepresentationCollection.__wrap(ret);
|
|
2102
648
|
}
|
|
2103
649
|
}
|
|
2104
|
-
if (Symbol.dispose)
|
|
650
|
+
if (Symbol.dispose) IfcAPI.prototype[Symbol.dispose] = IfcAPI.prototype.free;
|
|
2105
651
|
|
|
2106
652
|
/**
|
|
2107
653
|
* Collection of mesh data for returning multiple meshes
|
|
@@ -2130,7 +676,7 @@ export class MeshCollection {
|
|
|
2130
676
|
* @returns {number}
|
|
2131
677
|
*/
|
|
2132
678
|
get rtcOffsetX() {
|
|
2133
|
-
const ret = wasm.
|
|
679
|
+
const ret = wasm.meshcollection_rtcOffsetX(this.__wbg_ptr);
|
|
2134
680
|
return ret;
|
|
2135
681
|
}
|
|
2136
682
|
/**
|
|
@@ -2230,63 +776,6 @@ export class MeshCollection {
|
|
|
2230
776
|
}
|
|
2231
777
|
if (Symbol.dispose) MeshCollection.prototype[Symbol.dispose] = MeshCollection.prototype.free;
|
|
2232
778
|
|
|
2233
|
-
/**
|
|
2234
|
-
* Mesh collection with RTC offset for large coordinates
|
|
2235
|
-
*/
|
|
2236
|
-
export class MeshCollectionWithRtc {
|
|
2237
|
-
static __wrap(ptr) {
|
|
2238
|
-
ptr = ptr >>> 0;
|
|
2239
|
-
const obj = Object.create(MeshCollectionWithRtc.prototype);
|
|
2240
|
-
obj.__wbg_ptr = ptr;
|
|
2241
|
-
MeshCollectionWithRtcFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2242
|
-
return obj;
|
|
2243
|
-
}
|
|
2244
|
-
__destroy_into_raw() {
|
|
2245
|
-
const ptr = this.__wbg_ptr;
|
|
2246
|
-
this.__wbg_ptr = 0;
|
|
2247
|
-
MeshCollectionWithRtcFinalization.unregister(this);
|
|
2248
|
-
return ptr;
|
|
2249
|
-
}
|
|
2250
|
-
free() {
|
|
2251
|
-
const ptr = this.__destroy_into_raw();
|
|
2252
|
-
wasm.__wbg_meshcollectionwithrtc_free(ptr, 0);
|
|
2253
|
-
}
|
|
2254
|
-
/**
|
|
2255
|
-
* Get the RTC offset
|
|
2256
|
-
* @returns {RtcOffsetJs}
|
|
2257
|
-
*/
|
|
2258
|
-
get rtcOffset() {
|
|
2259
|
-
const ret = wasm.meshcollectionwithrtc_rtcOffset(this.__wbg_ptr);
|
|
2260
|
-
return RtcOffsetJs.__wrap(ret);
|
|
2261
|
-
}
|
|
2262
|
-
/**
|
|
2263
|
-
* Get mesh at index
|
|
2264
|
-
* @param {number} index
|
|
2265
|
-
* @returns {MeshDataJs | undefined}
|
|
2266
|
-
*/
|
|
2267
|
-
get(index) {
|
|
2268
|
-
const ret = wasm.meshcollectionwithrtc_get(this.__wbg_ptr, index);
|
|
2269
|
-
return ret === 0 ? undefined : MeshDataJs.__wrap(ret);
|
|
2270
|
-
}
|
|
2271
|
-
/**
|
|
2272
|
-
* Get number of meshes
|
|
2273
|
-
* @returns {number}
|
|
2274
|
-
*/
|
|
2275
|
-
get length() {
|
|
2276
|
-
const ret = wasm.meshcollection_length(this.__wbg_ptr);
|
|
2277
|
-
return ret >>> 0;
|
|
2278
|
-
}
|
|
2279
|
-
/**
|
|
2280
|
-
* Get the mesh collection
|
|
2281
|
-
* @returns {MeshCollection}
|
|
2282
|
-
*/
|
|
2283
|
-
get meshes() {
|
|
2284
|
-
const ret = wasm.meshcollectionwithrtc_meshes(this.__wbg_ptr);
|
|
2285
|
-
return MeshCollection.__wrap(ret);
|
|
2286
|
-
}
|
|
2287
|
-
}
|
|
2288
|
-
if (Symbol.dispose) MeshCollectionWithRtc.prototype[Symbol.dispose] = MeshCollectionWithRtc.prototype.free;
|
|
2289
|
-
|
|
2290
779
|
/**
|
|
2291
780
|
* Individual mesh data with express ID and color (matches MeshData interface)
|
|
2292
781
|
*/
|
|
@@ -2571,103 +1060,6 @@ export class ProfileEntryJs {
|
|
|
2571
1060
|
}
|
|
2572
1061
|
if (Symbol.dispose) ProfileEntryJs.prototype[Symbol.dispose] = ProfileEntryJs.prototype.free;
|
|
2573
1062
|
|
|
2574
|
-
/**
|
|
2575
|
-
* RTC offset information exposed to JavaScript
|
|
2576
|
-
*/
|
|
2577
|
-
export class RtcOffsetJs {
|
|
2578
|
-
static __wrap(ptr) {
|
|
2579
|
-
ptr = ptr >>> 0;
|
|
2580
|
-
const obj = Object.create(RtcOffsetJs.prototype);
|
|
2581
|
-
obj.__wbg_ptr = ptr;
|
|
2582
|
-
RtcOffsetJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
2583
|
-
return obj;
|
|
2584
|
-
}
|
|
2585
|
-
__destroy_into_raw() {
|
|
2586
|
-
const ptr = this.__wbg_ptr;
|
|
2587
|
-
this.__wbg_ptr = 0;
|
|
2588
|
-
RtcOffsetJsFinalization.unregister(this);
|
|
2589
|
-
return ptr;
|
|
2590
|
-
}
|
|
2591
|
-
free() {
|
|
2592
|
-
const ptr = this.__destroy_into_raw();
|
|
2593
|
-
wasm.__wbg_rtcoffsetjs_free(ptr, 0);
|
|
2594
|
-
}
|
|
2595
|
-
/**
|
|
2596
|
-
* Check if offset is significant (>10km)
|
|
2597
|
-
* @returns {boolean}
|
|
2598
|
-
*/
|
|
2599
|
-
isSignificant() {
|
|
2600
|
-
const ret = wasm.rtcoffsetjs_isSignificant(this.__wbg_ptr);
|
|
2601
|
-
return ret !== 0;
|
|
2602
|
-
}
|
|
2603
|
-
/**
|
|
2604
|
-
* Convert local coordinates to world coordinates
|
|
2605
|
-
* @param {number} x
|
|
2606
|
-
* @param {number} y
|
|
2607
|
-
* @param {number} z
|
|
2608
|
-
* @returns {Float64Array}
|
|
2609
|
-
*/
|
|
2610
|
-
toWorld(x, y, z) {
|
|
2611
|
-
try {
|
|
2612
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2613
|
-
wasm.rtcoffsetjs_toWorld(retptr, this.__wbg_ptr, x, y, z);
|
|
2614
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2615
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2616
|
-
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
2617
|
-
wasm.__wbindgen_export2(r0, r1 * 8, 8);
|
|
2618
|
-
return v1;
|
|
2619
|
-
} finally {
|
|
2620
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2621
|
-
}
|
|
2622
|
-
}
|
|
2623
|
-
/**
|
|
2624
|
-
* X offset (subtracted from positions)
|
|
2625
|
-
* @returns {number}
|
|
2626
|
-
*/
|
|
2627
|
-
get x() {
|
|
2628
|
-
const ret = wasm.__wbg_get_georeferencejs_eastings(this.__wbg_ptr);
|
|
2629
|
-
return ret;
|
|
2630
|
-
}
|
|
2631
|
-
/**
|
|
2632
|
-
* X offset (subtracted from positions)
|
|
2633
|
-
* @param {number} arg0
|
|
2634
|
-
*/
|
|
2635
|
-
set x(arg0) {
|
|
2636
|
-
wasm.__wbg_set_georeferencejs_eastings(this.__wbg_ptr, arg0);
|
|
2637
|
-
}
|
|
2638
|
-
/**
|
|
2639
|
-
* Y offset
|
|
2640
|
-
* @returns {number}
|
|
2641
|
-
*/
|
|
2642
|
-
get y() {
|
|
2643
|
-
const ret = wasm.__wbg_get_georeferencejs_northings(this.__wbg_ptr);
|
|
2644
|
-
return ret;
|
|
2645
|
-
}
|
|
2646
|
-
/**
|
|
2647
|
-
* Y offset
|
|
2648
|
-
* @param {number} arg0
|
|
2649
|
-
*/
|
|
2650
|
-
set y(arg0) {
|
|
2651
|
-
wasm.__wbg_set_georeferencejs_northings(this.__wbg_ptr, arg0);
|
|
2652
|
-
}
|
|
2653
|
-
/**
|
|
2654
|
-
* Z offset
|
|
2655
|
-
* @returns {number}
|
|
2656
|
-
*/
|
|
2657
|
-
get z() {
|
|
2658
|
-
const ret = wasm.__wbg_get_georeferencejs_orthogonal_height(this.__wbg_ptr);
|
|
2659
|
-
return ret;
|
|
2660
|
-
}
|
|
2661
|
-
/**
|
|
2662
|
-
* Z offset
|
|
2663
|
-
* @param {number} arg0
|
|
2664
|
-
*/
|
|
2665
|
-
set z(arg0) {
|
|
2666
|
-
wasm.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr, arg0);
|
|
2667
|
-
}
|
|
2668
|
-
}
|
|
2669
|
-
if (Symbol.dispose) RtcOffsetJs.prototype[Symbol.dispose] = RtcOffsetJs.prototype.free;
|
|
2670
|
-
|
|
2671
1063
|
/**
|
|
2672
1064
|
* A 2D circle/arc for symbolic representations
|
|
2673
1065
|
*/
|
|
@@ -2693,7 +1085,7 @@ export class SymbolicCircle {
|
|
|
2693
1085
|
* @returns {number}
|
|
2694
1086
|
*/
|
|
2695
1087
|
get expressId() {
|
|
2696
|
-
const ret = wasm.
|
|
1088
|
+
const ret = wasm.symboliccircle_expressId(this.__wbg_ptr);
|
|
2697
1089
|
return ret >>> 0;
|
|
2698
1090
|
}
|
|
2699
1091
|
/**
|
|
@@ -2832,7 +1224,7 @@ export class SymbolicFillArea {
|
|
|
2832
1224
|
* @returns {number}
|
|
2833
1225
|
*/
|
|
2834
1226
|
get holeCount() {
|
|
2835
|
-
const ret = wasm.
|
|
1227
|
+
const ret = wasm.symbolicfillarea_holeCount(this.__wbg_ptr);
|
|
2836
1228
|
return ret >>> 0;
|
|
2837
1229
|
}
|
|
2838
1230
|
/**
|
|
@@ -3392,146 +1784,6 @@ export class SymbolicText {
|
|
|
3392
1784
|
}
|
|
3393
1785
|
if (Symbol.dispose) SymbolicText.prototype[Symbol.dispose] = SymbolicText.prototype.free;
|
|
3394
1786
|
|
|
3395
|
-
/**
|
|
3396
|
-
* Zero-copy mesh that exposes pointers to WASM memory
|
|
3397
|
-
*/
|
|
3398
|
-
export class ZeroCopyMesh {
|
|
3399
|
-
static __wrap(ptr) {
|
|
3400
|
-
ptr = ptr >>> 0;
|
|
3401
|
-
const obj = Object.create(ZeroCopyMesh.prototype);
|
|
3402
|
-
obj.__wbg_ptr = ptr;
|
|
3403
|
-
ZeroCopyMeshFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
3404
|
-
return obj;
|
|
3405
|
-
}
|
|
3406
|
-
__destroy_into_raw() {
|
|
3407
|
-
const ptr = this.__wbg_ptr;
|
|
3408
|
-
this.__wbg_ptr = 0;
|
|
3409
|
-
ZeroCopyMeshFinalization.unregister(this);
|
|
3410
|
-
return ptr;
|
|
3411
|
-
}
|
|
3412
|
-
free() {
|
|
3413
|
-
const ptr = this.__destroy_into_raw();
|
|
3414
|
-
wasm.__wbg_zerocopymesh_free(ptr, 0);
|
|
3415
|
-
}
|
|
3416
|
-
/**
|
|
3417
|
-
* Get bounding box maximum point
|
|
3418
|
-
* @returns {Float32Array}
|
|
3419
|
-
*/
|
|
3420
|
-
bounds_max() {
|
|
3421
|
-
try {
|
|
3422
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3423
|
-
wasm.zerocopymesh_bounds_max(retptr, this.__wbg_ptr);
|
|
3424
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3425
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3426
|
-
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
3427
|
-
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
3428
|
-
return v1;
|
|
3429
|
-
} finally {
|
|
3430
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3431
|
-
}
|
|
3432
|
-
}
|
|
3433
|
-
/**
|
|
3434
|
-
* Get bounding box minimum point
|
|
3435
|
-
* @returns {Float32Array}
|
|
3436
|
-
*/
|
|
3437
|
-
bounds_min() {
|
|
3438
|
-
try {
|
|
3439
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3440
|
-
wasm.zerocopymesh_bounds_min(retptr, this.__wbg_ptr);
|
|
3441
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3442
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3443
|
-
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
3444
|
-
wasm.__wbindgen_export2(r0, r1 * 4, 4);
|
|
3445
|
-
return v1;
|
|
3446
|
-
} finally {
|
|
3447
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3448
|
-
}
|
|
3449
|
-
}
|
|
3450
|
-
/**
|
|
3451
|
-
* Get length of indices array
|
|
3452
|
-
* @returns {number}
|
|
3453
|
-
*/
|
|
3454
|
-
get indices_len() {
|
|
3455
|
-
const ret = wasm.gpuinstancedgeometry_indicesLen(this.__wbg_ptr);
|
|
3456
|
-
return ret >>> 0;
|
|
3457
|
-
}
|
|
3458
|
-
/**
|
|
3459
|
-
* Get pointer to indices array
|
|
3460
|
-
* @returns {number}
|
|
3461
|
-
*/
|
|
3462
|
-
get indices_ptr() {
|
|
3463
|
-
const ret = wasm.gpuinstancedgeometry_indicesPtr(this.__wbg_ptr);
|
|
3464
|
-
return ret >>> 0;
|
|
3465
|
-
}
|
|
3466
|
-
/**
|
|
3467
|
-
* Get length of normals array
|
|
3468
|
-
* @returns {number}
|
|
3469
|
-
*/
|
|
3470
|
-
get normals_len() {
|
|
3471
|
-
const ret = wasm.zerocopymesh_normals_len(this.__wbg_ptr);
|
|
3472
|
-
return ret >>> 0;
|
|
3473
|
-
}
|
|
3474
|
-
/**
|
|
3475
|
-
* Get pointer to normals array
|
|
3476
|
-
* @returns {number}
|
|
3477
|
-
*/
|
|
3478
|
-
get normals_ptr() {
|
|
3479
|
-
const ret = wasm.gpuinstancedgeometry_vertexDataPtr(this.__wbg_ptr);
|
|
3480
|
-
return ret >>> 0;
|
|
3481
|
-
}
|
|
3482
|
-
/**
|
|
3483
|
-
* Get vertex count
|
|
3484
|
-
* @returns {number}
|
|
3485
|
-
*/
|
|
3486
|
-
get vertex_count() {
|
|
3487
|
-
const ret = wasm.zerocopymesh_vertex_count(this.__wbg_ptr);
|
|
3488
|
-
return ret >>> 0;
|
|
3489
|
-
}
|
|
3490
|
-
/**
|
|
3491
|
-
* Get length of positions array (in f32 elements, not bytes)
|
|
3492
|
-
* @returns {number}
|
|
3493
|
-
*/
|
|
3494
|
-
get positions_len() {
|
|
3495
|
-
const ret = wasm.zerocopymesh_positions_len(this.__wbg_ptr);
|
|
3496
|
-
return ret >>> 0;
|
|
3497
|
-
}
|
|
3498
|
-
/**
|
|
3499
|
-
* Get pointer to positions array
|
|
3500
|
-
* JavaScript can create Float32Array view: new Float32Array(memory.buffer, ptr, length)
|
|
3501
|
-
* @returns {number}
|
|
3502
|
-
*/
|
|
3503
|
-
get positions_ptr() {
|
|
3504
|
-
const ret = wasm.zerocopymesh_positions_ptr(this.__wbg_ptr);
|
|
3505
|
-
return ret >>> 0;
|
|
3506
|
-
}
|
|
3507
|
-
/**
|
|
3508
|
-
* Get triangle count
|
|
3509
|
-
* @returns {number}
|
|
3510
|
-
*/
|
|
3511
|
-
get triangle_count() {
|
|
3512
|
-
const ret = wasm.gpuinstancedgeometry_triangleCount(this.__wbg_ptr);
|
|
3513
|
-
return ret >>> 0;
|
|
3514
|
-
}
|
|
3515
|
-
/**
|
|
3516
|
-
* Create a new zero-copy mesh from a Mesh
|
|
3517
|
-
*/
|
|
3518
|
-
constructor() {
|
|
3519
|
-
const ret = wasm.zerocopymesh_new();
|
|
3520
|
-
this.__wbg_ptr = ret >>> 0;
|
|
3521
|
-
ZeroCopyMeshFinalization.register(this, this.__wbg_ptr, this);
|
|
3522
|
-
return this;
|
|
3523
|
-
}
|
|
3524
|
-
/**
|
|
3525
|
-
* Check if mesh is empty
|
|
3526
|
-
* @returns {boolean}
|
|
3527
|
-
*/
|
|
3528
|
-
get is_empty() {
|
|
3529
|
-
const ret = wasm.zerocopymesh_is_empty(this.__wbg_ptr);
|
|
3530
|
-
return ret !== 0;
|
|
3531
|
-
}
|
|
3532
|
-
}
|
|
3533
|
-
if (Symbol.dispose) ZeroCopyMesh.prototype[Symbol.dispose] = ZeroCopyMesh.prototype.free;
|
|
3534
|
-
|
|
3535
1787
|
/**
|
|
3536
1788
|
* Get WASM memory to allow JavaScript to create TypedArray views
|
|
3537
1789
|
* @returns {any}
|
|
@@ -3633,12 +1885,6 @@ function __wbg_get_imports() {
|
|
|
3633
1885
|
const ret = wasm.memory;
|
|
3634
1886
|
return addHeapObject(ret);
|
|
3635
1887
|
};
|
|
3636
|
-
imports.wbg.__wbg___wbindgen_number_get_9619185a74197f95 = function(arg0, arg1) {
|
|
3637
|
-
const obj = getObject(arg1);
|
|
3638
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
3639
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
3640
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
3641
|
-
};
|
|
3642
1888
|
imports.wbg.__wbg___wbindgen_throw_dd24417ed36fc46e = function(arg0, arg1) {
|
|
3643
1889
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
3644
1890
|
};
|
|
@@ -3653,13 +1899,6 @@ function __wbg_get_imports() {
|
|
|
3653
1899
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
3654
1900
|
return addHeapObject(ret);
|
|
3655
1901
|
}, arguments) };
|
|
3656
|
-
imports.wbg.__wbg_call_c8baa5c5e72d274e = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
3657
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2), getObject(arg3));
|
|
3658
|
-
return addHeapObject(ret);
|
|
3659
|
-
}, arguments) };
|
|
3660
|
-
imports.wbg.__wbg_debug_9d0c87ddda3dc485 = function(arg0) {
|
|
3661
|
-
console.debug(getObject(arg0));
|
|
3662
|
-
};
|
|
3663
1902
|
imports.wbg.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
|
|
3664
1903
|
let deferred0_0;
|
|
3665
1904
|
let deferred0_1;
|
|
@@ -3671,29 +1910,9 @@ function __wbg_get_imports() {
|
|
|
3671
1910
|
wasm.__wbindgen_export2(deferred0_0, deferred0_1, 1);
|
|
3672
1911
|
}
|
|
3673
1912
|
};
|
|
3674
|
-
imports.wbg.__wbg_get_af9dab7e9603ea93 = function() { return handleError(function (arg0, arg1) {
|
|
3675
|
-
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
3676
|
-
return addHeapObject(ret);
|
|
3677
|
-
}, arguments) };
|
|
3678
|
-
imports.wbg.__wbg_gpugeometry_new = function(arg0) {
|
|
3679
|
-
const ret = GpuGeometry.__wrap(arg0);
|
|
3680
|
-
return addHeapObject(ret);
|
|
3681
|
-
};
|
|
3682
1913
|
imports.wbg.__wbg_info_ce6bcc489c22f6f0 = function(arg0) {
|
|
3683
1914
|
console.info(getObject(arg0));
|
|
3684
1915
|
};
|
|
3685
|
-
imports.wbg.__wbg_instancedgeometry_new = function(arg0) {
|
|
3686
|
-
const ret = InstancedGeometry.__wrap(arg0);
|
|
3687
|
-
return addHeapObject(ret);
|
|
3688
|
-
};
|
|
3689
|
-
imports.wbg.__wbg_length_d45040a40c570362 = function(arg0) {
|
|
3690
|
-
const ret = getObject(arg0).length;
|
|
3691
|
-
return ret;
|
|
3692
|
-
};
|
|
3693
|
-
imports.wbg.__wbg_meshdatajs_new = function(arg0) {
|
|
3694
|
-
const ret = MeshDataJs.__wrap(arg0);
|
|
3695
|
-
return addHeapObject(ret);
|
|
3696
|
-
};
|
|
3697
1916
|
imports.wbg.__wbg_new_1ba21ce319a06297 = function() {
|
|
3698
1917
|
const ret = new Object();
|
|
3699
1918
|
return addHeapObject(ret);
|
|
@@ -3713,7 +1932,7 @@ function __wbg_get_imports() {
|
|
|
3713
1932
|
const a = state0.a;
|
|
3714
1933
|
state0.a = 0;
|
|
3715
1934
|
try {
|
|
3716
|
-
return
|
|
1935
|
+
return __wasm_bindgen_func_elem_1832(a, state0.b, arg0, arg1);
|
|
3717
1936
|
} finally {
|
|
3718
1937
|
state0.a = a;
|
|
3719
1938
|
}
|
|
@@ -3748,10 +1967,6 @@ function __wbg_get_imports() {
|
|
|
3748
1967
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
3749
1968
|
return addHeapObject(ret);
|
|
3750
1969
|
};
|
|
3751
|
-
imports.wbg.__wbg_push_7d9be8f38fc13975 = function(arg0, arg1) {
|
|
3752
|
-
const ret = getObject(arg0).push(getObject(arg1));
|
|
3753
|
-
return ret;
|
|
3754
|
-
};
|
|
3755
1970
|
imports.wbg.__wbg_queueMicrotask_9b549dfce8865860 = function(arg0) {
|
|
3756
1971
|
const ret = getObject(arg0).queueMicrotask;
|
|
3757
1972
|
return addHeapObject(ret);
|
|
@@ -3822,9 +2037,9 @@ function __wbg_get_imports() {
|
|
|
3822
2037
|
const ret = BigInt.asUintN(64, arg0);
|
|
3823
2038
|
return addHeapObject(ret);
|
|
3824
2039
|
};
|
|
3825
|
-
imports.wbg.
|
|
3826
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
3827
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2040
|
+
imports.wbg.__wbindgen_cast_89b0435615caf0ab = function(arg0, arg1) {
|
|
2041
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 211, function: Function { arguments: [Externref], shim_idx: 212, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2042
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1684, __wasm_bindgen_func_elem_1685);
|
|
3828
2043
|
return addHeapObject(ret);
|
|
3829
2044
|
};
|
|
3830
2045
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|