@ifc-lite/wasm 1.1.7 → 1.2.1
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/LICENSE +373 -0
- package/README.md +196 -87
- package/package.json +2 -2
- package/pkg/ifc-lite.d.ts +309 -25
- package/pkg/ifc-lite.js +837 -103
- package/pkg/ifc-lite_bg.wasm +0 -0
package/pkg/ifc-lite.js
CHANGED
|
@@ -263,22 +263,42 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
263
263
|
|
|
264
264
|
let WASM_VECTOR_LEN = 0;
|
|
265
265
|
|
|
266
|
-
function
|
|
267
|
-
wasm.
|
|
266
|
+
function __wasm_bindgen_func_elem_393(arg0, arg1) {
|
|
267
|
+
wasm.__wasm_bindgen_func_elem_393(arg0, arg1);
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
function
|
|
271
|
-
wasm.
|
|
270
|
+
function __wasm_bindgen_func_elem_725(arg0, arg1, arg2) {
|
|
271
|
+
wasm.__wasm_bindgen_func_elem_725(arg0, arg1, addHeapObject(arg2));
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
-
function
|
|
275
|
-
wasm.
|
|
274
|
+
function __wasm_bindgen_func_elem_756(arg0, arg1, arg2, arg3) {
|
|
275
|
+
wasm.__wasm_bindgen_func_elem_756(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
276
276
|
}
|
|
277
277
|
|
|
278
278
|
const GeoReferenceJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
279
279
|
? { register: () => {}, unregister: () => {} }
|
|
280
280
|
: new FinalizationRegistry(ptr => wasm.__wbg_georeferencejs_free(ptr >>> 0, 1));
|
|
281
281
|
|
|
282
|
+
const GpuGeometryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
283
|
+
? { register: () => {}, unregister: () => {} }
|
|
284
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gpugeometry_free(ptr >>> 0, 1));
|
|
285
|
+
|
|
286
|
+
const GpuInstancedGeometryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
287
|
+
? { register: () => {}, unregister: () => {} }
|
|
288
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gpuinstancedgeometry_free(ptr >>> 0, 1));
|
|
289
|
+
|
|
290
|
+
const GpuInstancedGeometryCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
291
|
+
? { register: () => {}, unregister: () => {} }
|
|
292
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gpuinstancedgeometrycollection_free(ptr >>> 0, 1));
|
|
293
|
+
|
|
294
|
+
const GpuInstancedGeometryRefFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
295
|
+
? { register: () => {}, unregister: () => {} }
|
|
296
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gpuinstancedgeometryref_free(ptr >>> 0, 1));
|
|
297
|
+
|
|
298
|
+
const GpuMeshMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
299
|
+
? { register: () => {}, unregister: () => {} }
|
|
300
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gpumeshmetadata_free(ptr >>> 0, 1));
|
|
301
|
+
|
|
282
302
|
const IfcAPIFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
283
303
|
? { register: () => {}, unregister: () => {} }
|
|
284
304
|
: new FinalizationRegistry(ptr => wasm.__wbg_ifcapi_free(ptr >>> 0, 1));
|
|
@@ -336,6 +356,96 @@ export class GeoReferenceJs {
|
|
|
336
356
|
const ptr = this.__destroy_into_raw();
|
|
337
357
|
wasm.__wbg_georeferencejs_free(ptr, 0);
|
|
338
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* Eastings (X offset)
|
|
361
|
+
* @returns {number}
|
|
362
|
+
*/
|
|
363
|
+
get eastings() {
|
|
364
|
+
const ret = wasm.__wbg_get_georeferencejs_eastings(this.__wbg_ptr);
|
|
365
|
+
return ret;
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Eastings (X offset)
|
|
369
|
+
* @param {number} arg0
|
|
370
|
+
*/
|
|
371
|
+
set eastings(arg0) {
|
|
372
|
+
wasm.__wbg_set_georeferencejs_eastings(this.__wbg_ptr, arg0);
|
|
373
|
+
}
|
|
374
|
+
/**
|
|
375
|
+
* Northings (Y offset)
|
|
376
|
+
* @returns {number}
|
|
377
|
+
*/
|
|
378
|
+
get northings() {
|
|
379
|
+
const ret = wasm.__wbg_get_georeferencejs_northings(this.__wbg_ptr);
|
|
380
|
+
return ret;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Northings (Y offset)
|
|
384
|
+
* @param {number} arg0
|
|
385
|
+
*/
|
|
386
|
+
set northings(arg0) {
|
|
387
|
+
wasm.__wbg_set_georeferencejs_northings(this.__wbg_ptr, arg0);
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Orthogonal height (Z offset)
|
|
391
|
+
* @returns {number}
|
|
392
|
+
*/
|
|
393
|
+
get orthogonal_height() {
|
|
394
|
+
const ret = wasm.__wbg_get_georeferencejs_orthogonal_height(this.__wbg_ptr);
|
|
395
|
+
return ret;
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Orthogonal height (Z offset)
|
|
399
|
+
* @param {number} arg0
|
|
400
|
+
*/
|
|
401
|
+
set orthogonal_height(arg0) {
|
|
402
|
+
wasm.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr, arg0);
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* X-axis abscissa (cos of rotation)
|
|
406
|
+
* @returns {number}
|
|
407
|
+
*/
|
|
408
|
+
get x_axis_abscissa() {
|
|
409
|
+
const ret = wasm.__wbg_get_georeferencejs_x_axis_abscissa(this.__wbg_ptr);
|
|
410
|
+
return ret;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* X-axis abscissa (cos of rotation)
|
|
414
|
+
* @param {number} arg0
|
|
415
|
+
*/
|
|
416
|
+
set x_axis_abscissa(arg0) {
|
|
417
|
+
wasm.__wbg_set_georeferencejs_x_axis_abscissa(this.__wbg_ptr, arg0);
|
|
418
|
+
}
|
|
419
|
+
/**
|
|
420
|
+
* X-axis ordinate (sin of rotation)
|
|
421
|
+
* @returns {number}
|
|
422
|
+
*/
|
|
423
|
+
get x_axis_ordinate() {
|
|
424
|
+
const ret = wasm.__wbg_get_georeferencejs_x_axis_ordinate(this.__wbg_ptr);
|
|
425
|
+
return ret;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* X-axis ordinate (sin of rotation)
|
|
429
|
+
* @param {number} arg0
|
|
430
|
+
*/
|
|
431
|
+
set x_axis_ordinate(arg0) {
|
|
432
|
+
wasm.__wbg_set_georeferencejs_x_axis_ordinate(this.__wbg_ptr, arg0);
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Scale factor
|
|
436
|
+
* @returns {number}
|
|
437
|
+
*/
|
|
438
|
+
get scale() {
|
|
439
|
+
const ret = wasm.__wbg_get_georeferencejs_scale(this.__wbg_ptr);
|
|
440
|
+
return ret;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Scale factor
|
|
444
|
+
* @param {number} arg0
|
|
445
|
+
*/
|
|
446
|
+
set scale(arg0) {
|
|
447
|
+
wasm.__wbg_set_georeferencejs_scale(this.__wbg_ptr, arg0);
|
|
448
|
+
}
|
|
339
449
|
/**
|
|
340
450
|
* Transform local coordinates to map coordinates
|
|
341
451
|
* @param {number} x
|
|
@@ -421,98 +531,544 @@ export class GeoReferenceJs {
|
|
|
421
531
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
422
532
|
}
|
|
423
533
|
}
|
|
534
|
+
}
|
|
535
|
+
if (Symbol.dispose) GeoReferenceJs.prototype[Symbol.dispose] = GeoReferenceJs.prototype.free;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* GPU-ready geometry stored in WASM linear memory
|
|
539
|
+
*
|
|
540
|
+
* Data layout:
|
|
541
|
+
* - vertex_data: Interleaved [px, py, pz, nx, ny, nz, ...] (6 floats per vertex)
|
|
542
|
+
* - indices: Triangle indices [i0, i1, i2, ...]
|
|
543
|
+
* - mesh_metadata: Per-mesh metadata for draw calls
|
|
544
|
+
*
|
|
545
|
+
* All coordinates are pre-converted from IFC Z-up to WebGL Y-up
|
|
546
|
+
*/
|
|
547
|
+
export class GpuGeometry {
|
|
548
|
+
static __wrap(ptr) {
|
|
549
|
+
ptr = ptr >>> 0;
|
|
550
|
+
const obj = Object.create(GpuGeometry.prototype);
|
|
551
|
+
obj.__wbg_ptr = ptr;
|
|
552
|
+
GpuGeometryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
553
|
+
return obj;
|
|
554
|
+
}
|
|
555
|
+
__destroy_into_raw() {
|
|
556
|
+
const ptr = this.__wbg_ptr;
|
|
557
|
+
this.__wbg_ptr = 0;
|
|
558
|
+
GpuGeometryFinalization.unregister(this);
|
|
559
|
+
return ptr;
|
|
560
|
+
}
|
|
561
|
+
free() {
|
|
562
|
+
const ptr = this.__destroy_into_raw();
|
|
563
|
+
wasm.__wbg_gpugeometry_free(ptr, 0);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Get number of meshes in this geometry batch
|
|
567
|
+
* @returns {number}
|
|
568
|
+
*/
|
|
569
|
+
get meshCount() {
|
|
570
|
+
const ret = wasm.gpugeometry_meshCount(this.__wbg_ptr);
|
|
571
|
+
return ret >>> 0;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Get length of indices array (in u32 elements)
|
|
575
|
+
* @returns {number}
|
|
576
|
+
*/
|
|
577
|
+
get indicesLen() {
|
|
578
|
+
const ret = wasm.gpugeometry_indicesLen(this.__wbg_ptr);
|
|
579
|
+
return ret >>> 0;
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Get pointer to indices array for zero-copy view
|
|
583
|
+
* @returns {number}
|
|
584
|
+
*/
|
|
585
|
+
get indicesPtr() {
|
|
586
|
+
const ret = wasm.gpugeometry_indicesPtr(this.__wbg_ptr);
|
|
587
|
+
return ret >>> 0;
|
|
588
|
+
}
|
|
589
|
+
/**
|
|
590
|
+
* Get length of vertex data array (in f32 elements, not bytes)
|
|
591
|
+
* @returns {number}
|
|
592
|
+
*/
|
|
593
|
+
get vertexDataLen() {
|
|
594
|
+
const ret = wasm.gpugeometry_vertexDataLen(this.__wbg_ptr);
|
|
595
|
+
return ret >>> 0;
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Get pointer to vertex data for zero-copy view
|
|
599
|
+
*
|
|
600
|
+
* SAFETY: View is only valid until next WASM allocation!
|
|
601
|
+
* Create view, upload to GPU, then discard view immediately.
|
|
602
|
+
* @returns {number}
|
|
603
|
+
*/
|
|
604
|
+
get vertexDataPtr() {
|
|
605
|
+
const ret = wasm.gpugeometry_vertexDataPtr(this.__wbg_ptr);
|
|
606
|
+
return ret >>> 0;
|
|
607
|
+
}
|
|
608
|
+
/**
|
|
609
|
+
* Get IFC type name by index
|
|
610
|
+
* @param {number} index
|
|
611
|
+
* @returns {string | undefined}
|
|
612
|
+
*/
|
|
613
|
+
getIfcTypeName(index) {
|
|
614
|
+
try {
|
|
615
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
616
|
+
wasm.gpugeometry_getIfcTypeName(retptr, this.__wbg_ptr, index);
|
|
617
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
618
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
619
|
+
let v1;
|
|
620
|
+
if (r0 !== 0) {
|
|
621
|
+
v1 = getStringFromWasm0(r0, r1).slice();
|
|
622
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
623
|
+
}
|
|
624
|
+
return v1;
|
|
625
|
+
} finally {
|
|
626
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
/**
|
|
630
|
+
* Get metadata for a specific mesh
|
|
631
|
+
* @param {number} index
|
|
632
|
+
* @returns {GpuMeshMetadata | undefined}
|
|
633
|
+
*/
|
|
634
|
+
getMeshMetadata(index) {
|
|
635
|
+
const ret = wasm.gpugeometry_getMeshMetadata(this.__wbg_ptr, index);
|
|
636
|
+
return ret === 0 ? undefined : GpuMeshMetadata.__wrap(ret);
|
|
637
|
+
}
|
|
638
|
+
/**
|
|
639
|
+
* Get total vertex count
|
|
640
|
+
* @returns {number}
|
|
641
|
+
*/
|
|
642
|
+
get totalVertexCount() {
|
|
643
|
+
const ret = wasm.gpugeometry_totalVertexCount(this.__wbg_ptr);
|
|
644
|
+
return ret >>> 0;
|
|
645
|
+
}
|
|
646
|
+
/**
|
|
647
|
+
* Get byte length of indices (for GPU buffer creation)
|
|
648
|
+
* @returns {number}
|
|
649
|
+
*/
|
|
650
|
+
get indicesByteLength() {
|
|
651
|
+
const ret = wasm.gpugeometry_indicesByteLength(this.__wbg_ptr);
|
|
652
|
+
return ret >>> 0;
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Get total triangle count
|
|
656
|
+
* @returns {number}
|
|
657
|
+
*/
|
|
658
|
+
get totalTriangleCount() {
|
|
659
|
+
const ret = wasm.gpugeometry_totalTriangleCount(this.__wbg_ptr);
|
|
660
|
+
return ret >>> 0;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Get byte length of vertex data (for GPU buffer creation)
|
|
664
|
+
* @returns {number}
|
|
665
|
+
*/
|
|
666
|
+
get vertexDataByteLength() {
|
|
667
|
+
const ret = wasm.gpugeometry_vertexDataByteLength(this.__wbg_ptr);
|
|
668
|
+
return ret >>> 0;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* Create a new empty GPU geometry container
|
|
672
|
+
*/
|
|
673
|
+
constructor() {
|
|
674
|
+
const ret = wasm.gpugeometry_new();
|
|
675
|
+
this.__wbg_ptr = ret >>> 0;
|
|
676
|
+
GpuGeometryFinalization.register(this, this.__wbg_ptr, this);
|
|
677
|
+
return this;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* Check if geometry is empty
|
|
681
|
+
* @returns {boolean}
|
|
682
|
+
*/
|
|
683
|
+
get isEmpty() {
|
|
684
|
+
const ret = wasm.gpugeometry_isEmpty(this.__wbg_ptr);
|
|
685
|
+
return ret !== 0;
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (Symbol.dispose) GpuGeometry.prototype[Symbol.dispose] = GpuGeometry.prototype.free;
|
|
689
|
+
|
|
690
|
+
/**
|
|
691
|
+
* GPU-ready instanced geometry for efficient rendering of repeated shapes
|
|
692
|
+
*
|
|
693
|
+
* Data layout:
|
|
694
|
+
* - vertex_data: Interleaved [px, py, pz, nx, ny, nz, ...] (shared geometry)
|
|
695
|
+
* - indices: Triangle indices (shared geometry)
|
|
696
|
+
* - instance_data: [transform (16 floats) + color (4 floats)] per instance = 20 floats
|
|
697
|
+
*/
|
|
698
|
+
export class GpuInstancedGeometry {
|
|
699
|
+
static __wrap(ptr) {
|
|
700
|
+
ptr = ptr >>> 0;
|
|
701
|
+
const obj = Object.create(GpuInstancedGeometry.prototype);
|
|
702
|
+
obj.__wbg_ptr = ptr;
|
|
703
|
+
GpuInstancedGeometryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
704
|
+
return obj;
|
|
705
|
+
}
|
|
706
|
+
__destroy_into_raw() {
|
|
707
|
+
const ptr = this.__wbg_ptr;
|
|
708
|
+
this.__wbg_ptr = 0;
|
|
709
|
+
GpuInstancedGeometryFinalization.unregister(this);
|
|
710
|
+
return ptr;
|
|
711
|
+
}
|
|
712
|
+
free() {
|
|
713
|
+
const ptr = this.__destroy_into_raw();
|
|
714
|
+
wasm.__wbg_gpuinstancedgeometry_free(ptr, 0);
|
|
715
|
+
}
|
|
716
|
+
/**
|
|
717
|
+
* @returns {bigint}
|
|
718
|
+
*/
|
|
719
|
+
get geometryId() {
|
|
720
|
+
const ret = wasm.gpuinstancedgeometry_geometryId(this.__wbg_ptr);
|
|
721
|
+
return BigInt.asUintN(64, ret);
|
|
722
|
+
}
|
|
723
|
+
/**
|
|
724
|
+
* @returns {number}
|
|
725
|
+
*/
|
|
726
|
+
get indicesLen() {
|
|
727
|
+
const ret = wasm.gpuinstancedgeometry_indicesLen(this.__wbg_ptr);
|
|
728
|
+
return ret >>> 0;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* @returns {number}
|
|
732
|
+
*/
|
|
733
|
+
get indicesPtr() {
|
|
734
|
+
const ret = wasm.gpuinstancedgeometry_indicesPtr(this.__wbg_ptr);
|
|
735
|
+
return ret >>> 0;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* @returns {number}
|
|
739
|
+
*/
|
|
740
|
+
get vertexCount() {
|
|
741
|
+
const ret = wasm.gpuinstancedgeometry_vertexCount(this.__wbg_ptr);
|
|
742
|
+
return ret >>> 0;
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* @returns {number}
|
|
746
|
+
*/
|
|
747
|
+
get instanceCount() {
|
|
748
|
+
const ret = wasm.gpuinstancedgeometry_instanceCount(this.__wbg_ptr);
|
|
749
|
+
return ret >>> 0;
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* @returns {number}
|
|
753
|
+
*/
|
|
754
|
+
get triangleCount() {
|
|
755
|
+
const ret = wasm.gpuinstancedgeometry_triangleCount(this.__wbg_ptr);
|
|
756
|
+
return ret >>> 0;
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* @returns {number}
|
|
760
|
+
*/
|
|
761
|
+
get vertexDataLen() {
|
|
762
|
+
const ret = wasm.gpuinstancedgeometry_vertexDataLen(this.__wbg_ptr);
|
|
763
|
+
return ret >>> 0;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* @returns {number}
|
|
767
|
+
*/
|
|
768
|
+
get vertexDataPtr() {
|
|
769
|
+
const ret = wasm.gpugeometry_indicesPtr(this.__wbg_ptr);
|
|
770
|
+
return ret >>> 0;
|
|
771
|
+
}
|
|
772
|
+
/**
|
|
773
|
+
* @returns {number}
|
|
774
|
+
*/
|
|
775
|
+
get instanceDataLen() {
|
|
776
|
+
const ret = wasm.gpuinstancedgeometry_instanceDataLen(this.__wbg_ptr);
|
|
777
|
+
return ret >>> 0;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* @returns {number}
|
|
781
|
+
*/
|
|
782
|
+
get instanceDataPtr() {
|
|
783
|
+
const ret = wasm.gpuinstancedgeometry_instanceDataPtr(this.__wbg_ptr);
|
|
784
|
+
return ret >>> 0;
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* @returns {number}
|
|
788
|
+
*/
|
|
789
|
+
get indicesByteLength() {
|
|
790
|
+
const ret = wasm.gpuinstancedgeometry_indicesByteLength(this.__wbg_ptr);
|
|
791
|
+
return ret >>> 0;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* @returns {number}
|
|
795
|
+
*/
|
|
796
|
+
get vertexDataByteLength() {
|
|
797
|
+
const ret = wasm.gpuinstancedgeometry_vertexDataByteLength(this.__wbg_ptr);
|
|
798
|
+
return ret >>> 0;
|
|
799
|
+
}
|
|
800
|
+
/**
|
|
801
|
+
* @returns {number}
|
|
802
|
+
*/
|
|
803
|
+
get instanceExpressIdsPtr() {
|
|
804
|
+
const ret = wasm.gpuinstancedgeometry_instanceExpressIdsPtr(this.__wbg_ptr);
|
|
805
|
+
return ret >>> 0;
|
|
806
|
+
}
|
|
807
|
+
/**
|
|
808
|
+
* @returns {number}
|
|
809
|
+
*/
|
|
810
|
+
get instanceDataByteLength() {
|
|
811
|
+
const ret = wasm.gpuinstancedgeometry_instanceDataByteLength(this.__wbg_ptr);
|
|
812
|
+
return ret >>> 0;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Create new instanced geometry
|
|
816
|
+
* @param {bigint} geometry_id
|
|
817
|
+
*/
|
|
818
|
+
constructor(geometry_id) {
|
|
819
|
+
const ret = wasm.gpuinstancedgeometry_new(geometry_id);
|
|
820
|
+
this.__wbg_ptr = ret >>> 0;
|
|
821
|
+
GpuInstancedGeometryFinalization.register(this, this.__wbg_ptr, this);
|
|
822
|
+
return this;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
if (Symbol.dispose) GpuInstancedGeometry.prototype[Symbol.dispose] = GpuInstancedGeometry.prototype.free;
|
|
826
|
+
|
|
827
|
+
/**
|
|
828
|
+
* Collection of GPU-ready instanced geometries
|
|
829
|
+
*/
|
|
830
|
+
export class GpuInstancedGeometryCollection {
|
|
831
|
+
static __wrap(ptr) {
|
|
832
|
+
ptr = ptr >>> 0;
|
|
833
|
+
const obj = Object.create(GpuInstancedGeometryCollection.prototype);
|
|
834
|
+
obj.__wbg_ptr = ptr;
|
|
835
|
+
GpuInstancedGeometryCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
836
|
+
return obj;
|
|
837
|
+
}
|
|
838
|
+
__destroy_into_raw() {
|
|
839
|
+
const ptr = this.__wbg_ptr;
|
|
840
|
+
this.__wbg_ptr = 0;
|
|
841
|
+
GpuInstancedGeometryCollectionFinalization.unregister(this);
|
|
842
|
+
return ptr;
|
|
843
|
+
}
|
|
844
|
+
free() {
|
|
845
|
+
const ptr = this.__destroy_into_raw();
|
|
846
|
+
wasm.__wbg_gpuinstancedgeometrycollection_free(ptr, 0);
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* @param {number} index
|
|
850
|
+
* @returns {GpuInstancedGeometry | undefined}
|
|
851
|
+
*/
|
|
852
|
+
get(index) {
|
|
853
|
+
const ret = wasm.gpuinstancedgeometrycollection_get(this.__wbg_ptr, index);
|
|
854
|
+
return ret === 0 ? undefined : GpuInstancedGeometry.__wrap(ret);
|
|
855
|
+
}
|
|
856
|
+
constructor() {
|
|
857
|
+
const ret = wasm.gpuinstancedgeometrycollection_new();
|
|
858
|
+
this.__wbg_ptr = ret >>> 0;
|
|
859
|
+
GpuInstancedGeometryCollectionFinalization.register(this, this.__wbg_ptr, this);
|
|
860
|
+
return this;
|
|
861
|
+
}
|
|
862
|
+
/**
|
|
863
|
+
* @returns {number}
|
|
864
|
+
*/
|
|
865
|
+
get length() {
|
|
866
|
+
const ret = wasm.gpuinstancedgeometrycollection_length(this.__wbg_ptr);
|
|
867
|
+
return ret >>> 0;
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Get geometry by index with zero-copy access
|
|
871
|
+
* Returns a reference that provides pointer access
|
|
872
|
+
* @param {number} index
|
|
873
|
+
* @returns {GpuInstancedGeometryRef | undefined}
|
|
874
|
+
*/
|
|
875
|
+
getRef(index) {
|
|
876
|
+
const ret = wasm.gpuinstancedgeometrycollection_getRef(this.__wbg_ptr, index);
|
|
877
|
+
return ret === 0 ? undefined : GpuInstancedGeometryRef.__wrap(ret);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
if (Symbol.dispose) GpuInstancedGeometryCollection.prototype[Symbol.dispose] = GpuInstancedGeometryCollection.prototype.free;
|
|
881
|
+
|
|
882
|
+
/**
|
|
883
|
+
* Reference to geometry in collection for zero-copy access
|
|
884
|
+
* This avoids cloning when accessing geometry data
|
|
885
|
+
*/
|
|
886
|
+
export class GpuInstancedGeometryRef {
|
|
887
|
+
static __wrap(ptr) {
|
|
888
|
+
ptr = ptr >>> 0;
|
|
889
|
+
const obj = Object.create(GpuInstancedGeometryRef.prototype);
|
|
890
|
+
obj.__wbg_ptr = ptr;
|
|
891
|
+
GpuInstancedGeometryRefFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
892
|
+
return obj;
|
|
893
|
+
}
|
|
894
|
+
__destroy_into_raw() {
|
|
895
|
+
const ptr = this.__wbg_ptr;
|
|
896
|
+
this.__wbg_ptr = 0;
|
|
897
|
+
GpuInstancedGeometryRefFinalization.unregister(this);
|
|
898
|
+
return ptr;
|
|
899
|
+
}
|
|
900
|
+
free() {
|
|
901
|
+
const ptr = this.__destroy_into_raw();
|
|
902
|
+
wasm.__wbg_gpuinstancedgeometryref_free(ptr, 0);
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* @returns {bigint}
|
|
906
|
+
*/
|
|
907
|
+
get geometryId() {
|
|
908
|
+
const ret = wasm.gpuinstancedgeometryref_geometryId(this.__wbg_ptr);
|
|
909
|
+
return BigInt.asUintN(64, ret);
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* @returns {number}
|
|
913
|
+
*/
|
|
914
|
+
get indicesLen() {
|
|
915
|
+
const ret = wasm.gpuinstancedgeometryref_indicesLen(this.__wbg_ptr);
|
|
916
|
+
return ret >>> 0;
|
|
917
|
+
}
|
|
918
|
+
/**
|
|
919
|
+
* @returns {number}
|
|
920
|
+
*/
|
|
921
|
+
get indicesPtr() {
|
|
922
|
+
const ret = wasm.gpuinstancedgeometryref_indicesPtr(this.__wbg_ptr);
|
|
923
|
+
return ret >>> 0;
|
|
924
|
+
}
|
|
925
|
+
/**
|
|
926
|
+
* @returns {number}
|
|
927
|
+
*/
|
|
928
|
+
get instanceCount() {
|
|
929
|
+
const ret = wasm.gpuinstancedgeometryref_instanceCount(this.__wbg_ptr);
|
|
930
|
+
return ret >>> 0;
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* @returns {number}
|
|
934
|
+
*/
|
|
935
|
+
get vertexDataLen() {
|
|
936
|
+
const ret = wasm.gpuinstancedgeometryref_vertexDataLen(this.__wbg_ptr);
|
|
937
|
+
return ret >>> 0;
|
|
938
|
+
}
|
|
939
|
+
/**
|
|
940
|
+
* @returns {number}
|
|
941
|
+
*/
|
|
942
|
+
get vertexDataPtr() {
|
|
943
|
+
const ret = wasm.gpuinstancedgeometryref_vertexDataPtr(this.__wbg_ptr);
|
|
944
|
+
return ret >>> 0;
|
|
945
|
+
}
|
|
424
946
|
/**
|
|
425
|
-
* Eastings (X offset)
|
|
426
947
|
* @returns {number}
|
|
427
948
|
*/
|
|
428
|
-
get
|
|
429
|
-
const ret = wasm.
|
|
430
|
-
return ret;
|
|
949
|
+
get instanceDataLen() {
|
|
950
|
+
const ret = wasm.gpuinstancedgeometryref_instanceDataLen(this.__wbg_ptr);
|
|
951
|
+
return ret >>> 0;
|
|
431
952
|
}
|
|
432
953
|
/**
|
|
433
|
-
*
|
|
434
|
-
* @param {number} arg0
|
|
954
|
+
* @returns {number}
|
|
435
955
|
*/
|
|
436
|
-
|
|
437
|
-
wasm.
|
|
956
|
+
get instanceDataPtr() {
|
|
957
|
+
const ret = wasm.gpuinstancedgeometryref_instanceDataPtr(this.__wbg_ptr);
|
|
958
|
+
return ret >>> 0;
|
|
438
959
|
}
|
|
439
960
|
/**
|
|
440
|
-
* Northings (Y offset)
|
|
441
961
|
* @returns {number}
|
|
442
962
|
*/
|
|
443
|
-
get
|
|
444
|
-
const ret = wasm.
|
|
445
|
-
return ret;
|
|
963
|
+
get indicesByteLength() {
|
|
964
|
+
const ret = wasm.gpuinstancedgeometryref_indicesByteLength(this.__wbg_ptr);
|
|
965
|
+
return ret >>> 0;
|
|
446
966
|
}
|
|
447
967
|
/**
|
|
448
|
-
*
|
|
449
|
-
* @param {number} arg0
|
|
968
|
+
* @returns {number}
|
|
450
969
|
*/
|
|
451
|
-
|
|
452
|
-
wasm.
|
|
970
|
+
get vertexDataByteLength() {
|
|
971
|
+
const ret = wasm.gpuinstancedgeometryref_vertexDataByteLength(this.__wbg_ptr);
|
|
972
|
+
return ret >>> 0;
|
|
453
973
|
}
|
|
454
974
|
/**
|
|
455
|
-
* Orthogonal height (Z offset)
|
|
456
975
|
* @returns {number}
|
|
457
976
|
*/
|
|
458
|
-
get
|
|
459
|
-
const ret = wasm.
|
|
460
|
-
return ret;
|
|
977
|
+
get instanceExpressIdsPtr() {
|
|
978
|
+
const ret = wasm.gpuinstancedgeometryref_instanceExpressIdsPtr(this.__wbg_ptr);
|
|
979
|
+
return ret >>> 0;
|
|
461
980
|
}
|
|
462
981
|
/**
|
|
463
|
-
*
|
|
464
|
-
* @param {number} arg0
|
|
982
|
+
* @returns {number}
|
|
465
983
|
*/
|
|
466
|
-
|
|
467
|
-
wasm.
|
|
984
|
+
get instanceDataByteLength() {
|
|
985
|
+
const ret = wasm.gpuinstancedgeometryref_instanceDataByteLength(this.__wbg_ptr);
|
|
986
|
+
return ret >>> 0;
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
if (Symbol.dispose) GpuInstancedGeometryRef.prototype[Symbol.dispose] = GpuInstancedGeometryRef.prototype.free;
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Metadata for a single mesh within the GPU geometry buffer
|
|
993
|
+
*/
|
|
994
|
+
export class GpuMeshMetadata {
|
|
995
|
+
static __wrap(ptr) {
|
|
996
|
+
ptr = ptr >>> 0;
|
|
997
|
+
const obj = Object.create(GpuMeshMetadata.prototype);
|
|
998
|
+
obj.__wbg_ptr = ptr;
|
|
999
|
+
GpuMeshMetadataFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
1000
|
+
return obj;
|
|
1001
|
+
}
|
|
1002
|
+
__destroy_into_raw() {
|
|
1003
|
+
const ptr = this.__wbg_ptr;
|
|
1004
|
+
this.__wbg_ptr = 0;
|
|
1005
|
+
GpuMeshMetadataFinalization.unregister(this);
|
|
1006
|
+
return ptr;
|
|
1007
|
+
}
|
|
1008
|
+
free() {
|
|
1009
|
+
const ptr = this.__destroy_into_raw();
|
|
1010
|
+
wasm.__wbg_gpumeshmetadata_free(ptr, 0);
|
|
468
1011
|
}
|
|
469
1012
|
/**
|
|
470
|
-
* X-axis abscissa (cos of rotation)
|
|
471
1013
|
* @returns {number}
|
|
472
1014
|
*/
|
|
473
|
-
get
|
|
474
|
-
const ret = wasm.
|
|
475
|
-
return ret;
|
|
1015
|
+
get expressId() {
|
|
1016
|
+
const ret = wasm.gpumeshmetadata_expressId(this.__wbg_ptr);
|
|
1017
|
+
return ret >>> 0;
|
|
476
1018
|
}
|
|
477
1019
|
/**
|
|
478
|
-
*
|
|
479
|
-
* @param {number} arg0
|
|
1020
|
+
* @returns {number}
|
|
480
1021
|
*/
|
|
481
|
-
|
|
482
|
-
wasm.
|
|
1022
|
+
get indexCount() {
|
|
1023
|
+
const ret = wasm.gpumeshmetadata_indexCount(this.__wbg_ptr);
|
|
1024
|
+
return ret >>> 0;
|
|
483
1025
|
}
|
|
484
1026
|
/**
|
|
485
|
-
* X-axis ordinate (sin of rotation)
|
|
486
1027
|
* @returns {number}
|
|
487
1028
|
*/
|
|
488
|
-
get
|
|
489
|
-
const ret = wasm.
|
|
1029
|
+
get ifcTypeIdx() {
|
|
1030
|
+
const ret = wasm.gpumeshmetadata_ifcTypeIdx(this.__wbg_ptr);
|
|
490
1031
|
return ret;
|
|
491
1032
|
}
|
|
492
1033
|
/**
|
|
493
|
-
*
|
|
494
|
-
* @param {number} arg0
|
|
1034
|
+
* @returns {number}
|
|
495
1035
|
*/
|
|
496
|
-
|
|
497
|
-
wasm.
|
|
1036
|
+
get indexOffset() {
|
|
1037
|
+
const ret = wasm.gpumeshmetadata_indexOffset(this.__wbg_ptr);
|
|
1038
|
+
return ret >>> 0;
|
|
498
1039
|
}
|
|
499
1040
|
/**
|
|
500
|
-
* Scale factor
|
|
501
1041
|
* @returns {number}
|
|
502
1042
|
*/
|
|
503
|
-
get
|
|
504
|
-
const ret = wasm.
|
|
505
|
-
return ret;
|
|
1043
|
+
get vertexCount() {
|
|
1044
|
+
const ret = wasm.gpumeshmetadata_vertexCount(this.__wbg_ptr);
|
|
1045
|
+
return ret >>> 0;
|
|
506
1046
|
}
|
|
507
1047
|
/**
|
|
508
|
-
*
|
|
509
|
-
* @param {number} arg0
|
|
1048
|
+
* @returns {number}
|
|
510
1049
|
*/
|
|
511
|
-
|
|
512
|
-
wasm.
|
|
1050
|
+
get vertexOffset() {
|
|
1051
|
+
const ret = wasm.gpumeshmetadata_vertexOffset(this.__wbg_ptr);
|
|
1052
|
+
return ret >>> 0;
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* @returns {Float32Array}
|
|
1056
|
+
*/
|
|
1057
|
+
get color() {
|
|
1058
|
+
try {
|
|
1059
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1060
|
+
wasm.gpumeshmetadata_color(retptr, this.__wbg_ptr);
|
|
1061
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1062
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1063
|
+
var v1 = getArrayF32FromWasm0(r0, r1).slice();
|
|
1064
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
1065
|
+
return v1;
|
|
1066
|
+
} finally {
|
|
1067
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1068
|
+
}
|
|
513
1069
|
}
|
|
514
1070
|
}
|
|
515
|
-
if (Symbol.dispose)
|
|
1071
|
+
if (Symbol.dispose) GpuMeshMetadata.prototype[Symbol.dispose] = GpuMeshMetadata.prototype.free;
|
|
516
1072
|
|
|
517
1073
|
/**
|
|
518
1074
|
* Main IFC-Lite API
|
|
@@ -663,6 +1219,19 @@ export class IfcAPI {
|
|
|
663
1219
|
const ret = wasm.ifcapi_parseMeshesAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
664
1220
|
return takeObject(ret);
|
|
665
1221
|
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Fast entity scanning using SIMD-accelerated Rust scanner
|
|
1224
|
+
* Returns array of entity references for data model parsing
|
|
1225
|
+
* Much faster than TypeScript byte-by-byte scanning (5-10x speedup)
|
|
1226
|
+
* @param {string} content
|
|
1227
|
+
* @returns {any}
|
|
1228
|
+
*/
|
|
1229
|
+
scanEntitiesFast(content) {
|
|
1230
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1232
|
+
const ret = wasm.ifcapi_scanEntitiesFast(this.__wbg_ptr, ptr0, len0);
|
|
1233
|
+
return takeObject(ret);
|
|
1234
|
+
}
|
|
666
1235
|
/**
|
|
667
1236
|
* Parse IFC file and return mesh with RTC offset for large coordinates
|
|
668
1237
|
* This handles georeferenced models by shifting to centroid
|
|
@@ -688,6 +1257,50 @@ export class IfcAPI {
|
|
|
688
1257
|
const ret = wasm.ifcapi_parseMeshesWithRtc(this.__wbg_ptr, ptr0, len0);
|
|
689
1258
|
return MeshCollectionWithRtc.__wrap(ret);
|
|
690
1259
|
}
|
|
1260
|
+
/**
|
|
1261
|
+
* Parse IFC file and return GPU-ready geometry for zero-copy upload
|
|
1262
|
+
*
|
|
1263
|
+
* This method generates geometry that is:
|
|
1264
|
+
* - Pre-interleaved (position + normal per vertex)
|
|
1265
|
+
* - Coordinate-converted (Z-up to Y-up)
|
|
1266
|
+
* - Ready for direct GPU upload via pointer access
|
|
1267
|
+
*
|
|
1268
|
+
* Example:
|
|
1269
|
+
* ```javascript
|
|
1270
|
+
* const api = new IfcAPI();
|
|
1271
|
+
* const gpuGeom = api.parseToGpuGeometry(ifcData);
|
|
1272
|
+
*
|
|
1273
|
+
* // Get WASM memory for zero-copy views
|
|
1274
|
+
* const memory = api.getMemory();
|
|
1275
|
+
*
|
|
1276
|
+
* // Create views directly into WASM memory (NO COPY!)
|
|
1277
|
+
* const vertexView = new Float32Array(
|
|
1278
|
+
* memory.buffer,
|
|
1279
|
+
* gpuGeom.vertexDataPtr,
|
|
1280
|
+
* gpuGeom.vertexDataLen
|
|
1281
|
+
* );
|
|
1282
|
+
* const indexView = new Uint32Array(
|
|
1283
|
+
* memory.buffer,
|
|
1284
|
+
* gpuGeom.indicesPtr,
|
|
1285
|
+
* gpuGeom.indicesLen
|
|
1286
|
+
* );
|
|
1287
|
+
*
|
|
1288
|
+
* // Upload directly to GPU (single copy: WASM → GPU)
|
|
1289
|
+
* device.queue.writeBuffer(vertexBuffer, 0, vertexView);
|
|
1290
|
+
* device.queue.writeBuffer(indexBuffer, 0, indexView);
|
|
1291
|
+
*
|
|
1292
|
+
* // Free when done
|
|
1293
|
+
* gpuGeom.free();
|
|
1294
|
+
* ```
|
|
1295
|
+
* @param {string} content
|
|
1296
|
+
* @returns {GpuGeometry}
|
|
1297
|
+
*/
|
|
1298
|
+
parseToGpuGeometry(content) {
|
|
1299
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1300
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1301
|
+
const ret = wasm.ifcapi_parseToGpuGeometry(this.__wbg_ptr, ptr0, len0);
|
|
1302
|
+
return GpuGeometry.__wrap(ret);
|
|
1303
|
+
}
|
|
691
1304
|
/**
|
|
692
1305
|
* Parse IFC file and return instanced geometry grouped by geometry hash
|
|
693
1306
|
* This reduces draw calls by grouping identical geometries with different transforms
|
|
@@ -762,6 +1375,62 @@ export class IfcAPI {
|
|
|
762
1375
|
wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);
|
|
763
1376
|
}
|
|
764
1377
|
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Parse IFC file with streaming GPU-ready geometry batches
|
|
1380
|
+
*
|
|
1381
|
+
* Yields batches of GPU-ready geometry for progressive rendering with zero-copy upload.
|
|
1382
|
+
* Uses fast-first-frame streaming: simple geometry (walls, slabs) first.
|
|
1383
|
+
*
|
|
1384
|
+
* Example:
|
|
1385
|
+
* ```javascript
|
|
1386
|
+
* const api = new IfcAPI();
|
|
1387
|
+
* const memory = api.getMemory();
|
|
1388
|
+
*
|
|
1389
|
+
* await api.parseToGpuGeometryAsync(ifcData, {
|
|
1390
|
+
* batchSize: 25,
|
|
1391
|
+
* onBatch: (gpuGeom, progress) => {
|
|
1392
|
+
* // Create zero-copy views
|
|
1393
|
+
* const vertexView = new Float32Array(
|
|
1394
|
+
* memory.buffer,
|
|
1395
|
+
* gpuGeom.vertexDataPtr,
|
|
1396
|
+
* gpuGeom.vertexDataLen
|
|
1397
|
+
* );
|
|
1398
|
+
*
|
|
1399
|
+
* // Upload to GPU
|
|
1400
|
+
* device.queue.writeBuffer(vertexBuffer, 0, vertexView);
|
|
1401
|
+
*
|
|
1402
|
+
* // IMPORTANT: Free immediately after upload!
|
|
1403
|
+
* gpuGeom.free();
|
|
1404
|
+
* },
|
|
1405
|
+
* onComplete: (stats) => {
|
|
1406
|
+
* console.log(`Done! ${stats.totalMeshes} meshes`);
|
|
1407
|
+
* }
|
|
1408
|
+
* });
|
|
1409
|
+
* ```
|
|
1410
|
+
* @param {string} content
|
|
1411
|
+
* @param {any} options
|
|
1412
|
+
* @returns {Promise<any>}
|
|
1413
|
+
*/
|
|
1414
|
+
parseToGpuGeometryAsync(content, options) {
|
|
1415
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1416
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1417
|
+
const ret = wasm.ifcapi_parseToGpuGeometryAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
1418
|
+
return takeObject(ret);
|
|
1419
|
+
}
|
|
1420
|
+
/**
|
|
1421
|
+
* Fast geometry-only entity scanning
|
|
1422
|
+
* Scans only entities that have geometry, skipping 99% of non-geometry entities
|
|
1423
|
+
* Returns array of geometry entity references for parallel processing
|
|
1424
|
+
* Much faster than scanning all entities (3x speedup for large files)
|
|
1425
|
+
* @param {string} content
|
|
1426
|
+
* @returns {any}
|
|
1427
|
+
*/
|
|
1428
|
+
scanGeometryEntitiesFast(content) {
|
|
1429
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1430
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1431
|
+
const ret = wasm.ifcapi_scanGeometryEntitiesFast(this.__wbg_ptr, ptr0, len0);
|
|
1432
|
+
return takeObject(ret);
|
|
1433
|
+
}
|
|
765
1434
|
/**
|
|
766
1435
|
* Parse IFC file with streaming instanced geometry batches for progressive rendering
|
|
767
1436
|
* Groups identical geometries and yields batches of InstancedGeometry
|
|
@@ -792,6 +1461,20 @@ export class IfcAPI {
|
|
|
792
1461
|
const ret = wasm.ifcapi_parseMeshesInstancedAsync(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
793
1462
|
return takeObject(ret);
|
|
794
1463
|
}
|
|
1464
|
+
/**
|
|
1465
|
+
* Parse IFC file to GPU-ready instanced geometry for zero-copy upload
|
|
1466
|
+
*
|
|
1467
|
+
* Groups identical geometries by hash for efficient GPU instancing.
|
|
1468
|
+
* Returns a collection of instanced geometries with pointer access.
|
|
1469
|
+
* @param {string} content
|
|
1470
|
+
* @returns {GpuInstancedGeometryCollection}
|
|
1471
|
+
*/
|
|
1472
|
+
parseToGpuInstancedGeometry(content) {
|
|
1473
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1474
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1475
|
+
const ret = wasm.ifcapi_parseToGpuInstancedGeometry(this.__wbg_ptr, ptr0, len0);
|
|
1476
|
+
return GpuInstancedGeometryCollection.__wrap(ret);
|
|
1477
|
+
}
|
|
795
1478
|
/**
|
|
796
1479
|
* Create and initialize the IFC API
|
|
797
1480
|
*/
|
|
@@ -929,7 +1612,7 @@ export class InstancedGeometry {
|
|
|
929
1612
|
* @returns {bigint}
|
|
930
1613
|
*/
|
|
931
1614
|
get geometryId() {
|
|
932
|
-
const ret = wasm.
|
|
1615
|
+
const ret = wasm.gpuinstancedgeometry_geometryId(this.__wbg_ptr);
|
|
933
1616
|
return BigInt.asUintN(64, ret);
|
|
934
1617
|
}
|
|
935
1618
|
/**
|
|
@@ -1003,7 +1686,7 @@ export class InstancedMeshCollection {
|
|
|
1003
1686
|
* @returns {number}
|
|
1004
1687
|
*/
|
|
1005
1688
|
get totalGeometries() {
|
|
1006
|
-
const ret = wasm.
|
|
1689
|
+
const ret = wasm.gpuinstancedgeometrycollection_length(this.__wbg_ptr);
|
|
1007
1690
|
return ret >>> 0;
|
|
1008
1691
|
}
|
|
1009
1692
|
/**
|
|
@@ -1018,7 +1701,7 @@ export class InstancedMeshCollection {
|
|
|
1018
1701
|
* @returns {number}
|
|
1019
1702
|
*/
|
|
1020
1703
|
get length() {
|
|
1021
|
-
const ret = wasm.
|
|
1704
|
+
const ret = wasm.gpuinstancedgeometrycollection_length(this.__wbg_ptr);
|
|
1022
1705
|
return ret >>> 0;
|
|
1023
1706
|
}
|
|
1024
1707
|
}
|
|
@@ -1075,7 +1758,7 @@ export class MeshCollection {
|
|
|
1075
1758
|
* @returns {number}
|
|
1076
1759
|
*/
|
|
1077
1760
|
get length() {
|
|
1078
|
-
const ret = wasm.
|
|
1761
|
+
const ret = wasm.meshcollection_length(this.__wbg_ptr);
|
|
1079
1762
|
return ret >>> 0;
|
|
1080
1763
|
}
|
|
1081
1764
|
}
|
|
@@ -1172,7 +1855,7 @@ export class MeshDataJs {
|
|
|
1172
1855
|
* @returns {number}
|
|
1173
1856
|
*/
|
|
1174
1857
|
get vertexCount() {
|
|
1175
|
-
const ret = wasm.
|
|
1858
|
+
const ret = wasm.gpugeometry_totalTriangleCount(this.__wbg_ptr);
|
|
1176
1859
|
return ret >>> 0;
|
|
1177
1860
|
}
|
|
1178
1861
|
/**
|
|
@@ -1216,6 +1899,26 @@ export class MeshDataJs {
|
|
|
1216
1899
|
const ret = wasm.meshdatajs_normals(this.__wbg_ptr);
|
|
1217
1900
|
return takeObject(ret);
|
|
1218
1901
|
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Get IFC type name (e.g., "IfcWall", "IfcSpace")
|
|
1904
|
+
* @returns {string}
|
|
1905
|
+
*/
|
|
1906
|
+
get ifcType() {
|
|
1907
|
+
let deferred1_0;
|
|
1908
|
+
let deferred1_1;
|
|
1909
|
+
try {
|
|
1910
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1911
|
+
wasm.meshdatajs_ifcType(retptr, this.__wbg_ptr);
|
|
1912
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1913
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1914
|
+
deferred1_0 = r0;
|
|
1915
|
+
deferred1_1 = r1;
|
|
1916
|
+
return getStringFromWasm0(r0, r1);
|
|
1917
|
+
} finally {
|
|
1918
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1919
|
+
wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);
|
|
1920
|
+
}
|
|
1921
|
+
}
|
|
1219
1922
|
/**
|
|
1220
1923
|
* Get positions as Float32Array (copy to JS)
|
|
1221
1924
|
* @returns {Float32Array}
|
|
@@ -1248,34 +1951,6 @@ export class RtcOffsetJs {
|
|
|
1248
1951
|
const ptr = this.__destroy_into_raw();
|
|
1249
1952
|
wasm.__wbg_rtcoffsetjs_free(ptr, 0);
|
|
1250
1953
|
}
|
|
1251
|
-
/**
|
|
1252
|
-
* Check if offset is significant (>10km)
|
|
1253
|
-
* @returns {boolean}
|
|
1254
|
-
*/
|
|
1255
|
-
isSignificant() {
|
|
1256
|
-
const ret = wasm.rtcoffsetjs_isSignificant(this.__wbg_ptr);
|
|
1257
|
-
return ret !== 0;
|
|
1258
|
-
}
|
|
1259
|
-
/**
|
|
1260
|
-
* Convert local coordinates to world coordinates
|
|
1261
|
-
* @param {number} x
|
|
1262
|
-
* @param {number} y
|
|
1263
|
-
* @param {number} z
|
|
1264
|
-
* @returns {Float64Array}
|
|
1265
|
-
*/
|
|
1266
|
-
toWorld(x, y, z) {
|
|
1267
|
-
try {
|
|
1268
|
-
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1269
|
-
wasm.rtcoffsetjs_toWorld(retptr, this.__wbg_ptr, x, y, z);
|
|
1270
|
-
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1271
|
-
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1272
|
-
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
1273
|
-
wasm.__wbindgen_export4(r0, r1 * 8, 8);
|
|
1274
|
-
return v1;
|
|
1275
|
-
} finally {
|
|
1276
|
-
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1277
|
-
}
|
|
1278
|
-
}
|
|
1279
1954
|
/**
|
|
1280
1955
|
* X offset (subtracted from positions)
|
|
1281
1956
|
* @returns {number}
|
|
@@ -1321,6 +1996,34 @@ export class RtcOffsetJs {
|
|
|
1321
1996
|
set z(arg0) {
|
|
1322
1997
|
wasm.__wbg_set_georeferencejs_orthogonal_height(this.__wbg_ptr, arg0);
|
|
1323
1998
|
}
|
|
1999
|
+
/**
|
|
2000
|
+
* Check if offset is significant (>10km)
|
|
2001
|
+
* @returns {boolean}
|
|
2002
|
+
*/
|
|
2003
|
+
isSignificant() {
|
|
2004
|
+
const ret = wasm.rtcoffsetjs_isSignificant(this.__wbg_ptr);
|
|
2005
|
+
return ret !== 0;
|
|
2006
|
+
}
|
|
2007
|
+
/**
|
|
2008
|
+
* Convert local coordinates to world coordinates
|
|
2009
|
+
* @param {number} x
|
|
2010
|
+
* @param {number} y
|
|
2011
|
+
* @param {number} z
|
|
2012
|
+
* @returns {Float64Array}
|
|
2013
|
+
*/
|
|
2014
|
+
toWorld(x, y, z) {
|
|
2015
|
+
try {
|
|
2016
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2017
|
+
wasm.rtcoffsetjs_toWorld(retptr, this.__wbg_ptr, x, y, z);
|
|
2018
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2019
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2020
|
+
var v1 = getArrayF64FromWasm0(r0, r1).slice();
|
|
2021
|
+
wasm.__wbindgen_export4(r0, r1 * 8, 8);
|
|
2022
|
+
return v1;
|
|
2023
|
+
} finally {
|
|
2024
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2025
|
+
}
|
|
2026
|
+
}
|
|
1324
2027
|
}
|
|
1325
2028
|
if (Symbol.dispose) RtcOffsetJs.prototype[Symbol.dispose] = RtcOffsetJs.prototype.free;
|
|
1326
2029
|
|
|
@@ -1384,7 +2087,7 @@ export class ZeroCopyMesh {
|
|
|
1384
2087
|
* @returns {number}
|
|
1385
2088
|
*/
|
|
1386
2089
|
get indices_len() {
|
|
1387
|
-
const ret = wasm.
|
|
2090
|
+
const ret = wasm.gpuinstancedgeometry_indicesLen(this.__wbg_ptr);
|
|
1388
2091
|
return ret >>> 0;
|
|
1389
2092
|
}
|
|
1390
2093
|
/**
|
|
@@ -1392,7 +2095,7 @@ export class ZeroCopyMesh {
|
|
|
1392
2095
|
* @returns {number}
|
|
1393
2096
|
*/
|
|
1394
2097
|
get indices_ptr() {
|
|
1395
|
-
const ret = wasm.
|
|
2098
|
+
const ret = wasm.gpuinstancedgeometry_indicesPtr(this.__wbg_ptr);
|
|
1396
2099
|
return ret >>> 0;
|
|
1397
2100
|
}
|
|
1398
2101
|
/**
|
|
@@ -1400,7 +2103,7 @@ export class ZeroCopyMesh {
|
|
|
1400
2103
|
* @returns {number}
|
|
1401
2104
|
*/
|
|
1402
2105
|
get normals_len() {
|
|
1403
|
-
const ret = wasm.
|
|
2106
|
+
const ret = wasm.gpugeometry_indicesLen(this.__wbg_ptr);
|
|
1404
2107
|
return ret >>> 0;
|
|
1405
2108
|
}
|
|
1406
2109
|
/**
|
|
@@ -1408,7 +2111,7 @@ export class ZeroCopyMesh {
|
|
|
1408
2111
|
* @returns {number}
|
|
1409
2112
|
*/
|
|
1410
2113
|
get normals_ptr() {
|
|
1411
|
-
const ret = wasm.
|
|
2114
|
+
const ret = wasm.gpugeometry_indicesPtr(this.__wbg_ptr);
|
|
1412
2115
|
return ret >>> 0;
|
|
1413
2116
|
}
|
|
1414
2117
|
/**
|
|
@@ -1416,7 +2119,7 @@ export class ZeroCopyMesh {
|
|
|
1416
2119
|
* @returns {number}
|
|
1417
2120
|
*/
|
|
1418
2121
|
get vertex_count() {
|
|
1419
|
-
const ret = wasm.
|
|
2122
|
+
const ret = wasm.zerocopymesh_vertex_count(this.__wbg_ptr);
|
|
1420
2123
|
return ret >>> 0;
|
|
1421
2124
|
}
|
|
1422
2125
|
/**
|
|
@@ -1424,7 +2127,7 @@ export class ZeroCopyMesh {
|
|
|
1424
2127
|
* @returns {number}
|
|
1425
2128
|
*/
|
|
1426
2129
|
get positions_len() {
|
|
1427
|
-
const ret = wasm.
|
|
2130
|
+
const ret = wasm.gpugeometry_vertexDataLen(this.__wbg_ptr);
|
|
1428
2131
|
return ret >>> 0;
|
|
1429
2132
|
}
|
|
1430
2133
|
/**
|
|
@@ -1433,7 +2136,7 @@ export class ZeroCopyMesh {
|
|
|
1433
2136
|
* @returns {number}
|
|
1434
2137
|
*/
|
|
1435
2138
|
get positions_ptr() {
|
|
1436
|
-
const ret = wasm.
|
|
2139
|
+
const ret = wasm.gpugeometry_vertexDataPtr(this.__wbg_ptr);
|
|
1437
2140
|
return ret >>> 0;
|
|
1438
2141
|
}
|
|
1439
2142
|
/**
|
|
@@ -1441,7 +2144,7 @@ export class ZeroCopyMesh {
|
|
|
1441
2144
|
* @returns {number}
|
|
1442
2145
|
*/
|
|
1443
2146
|
get triangle_count() {
|
|
1444
|
-
const ret = wasm.
|
|
2147
|
+
const ret = wasm.gpuinstancedgeometry_triangleCount(this.__wbg_ptr);
|
|
1445
2148
|
return ret >>> 0;
|
|
1446
2149
|
}
|
|
1447
2150
|
/**
|
|
@@ -1458,7 +2161,7 @@ export class ZeroCopyMesh {
|
|
|
1458
2161
|
* @returns {boolean}
|
|
1459
2162
|
*/
|
|
1460
2163
|
get is_empty() {
|
|
1461
|
-
const ret = wasm.
|
|
2164
|
+
const ret = wasm.gpugeometry_isEmpty(this.__wbg_ptr);
|
|
1462
2165
|
return ret !== 0;
|
|
1463
2166
|
}
|
|
1464
2167
|
}
|
|
@@ -1549,6 +2252,10 @@ async function __wbg_load(module, imports) {
|
|
|
1549
2252
|
function __wbg_get_imports() {
|
|
1550
2253
|
const imports = {};
|
|
1551
2254
|
imports.wbg = {};
|
|
2255
|
+
imports.wbg.__wbg_Error_52673b7de5a0ca89 = function(arg0, arg1) {
|
|
2256
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
2257
|
+
return addHeapObject(ret);
|
|
2258
|
+
};
|
|
1552
2259
|
imports.wbg.__wbg___wbindgen_debug_string_adfb662ae34724b6 = function(arg0, arg1) {
|
|
1553
2260
|
const ret = debugString(getObject(arg1));
|
|
1554
2261
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1611,6 +2318,10 @@ function __wbg_get_imports() {
|
|
|
1611
2318
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
1612
2319
|
return addHeapObject(ret);
|
|
1613
2320
|
}, arguments) };
|
|
2321
|
+
imports.wbg.__wbg_gpugeometry_new = function(arg0) {
|
|
2322
|
+
const ret = GpuGeometry.__wrap(arg0);
|
|
2323
|
+
return addHeapObject(ret);
|
|
2324
|
+
};
|
|
1614
2325
|
imports.wbg.__wbg_instancedgeometry_new = function(arg0) {
|
|
1615
2326
|
const ret = InstancedGeometry.__wrap(arg0);
|
|
1616
2327
|
return addHeapObject(ret);
|
|
@@ -1635,6 +2346,10 @@ function __wbg_get_imports() {
|
|
|
1635
2346
|
const ret = new Error();
|
|
1636
2347
|
return addHeapObject(ret);
|
|
1637
2348
|
};
|
|
2349
|
+
imports.wbg.__wbg_new_b546ae120718850e = function() {
|
|
2350
|
+
const ret = new Map();
|
|
2351
|
+
return addHeapObject(ret);
|
|
2352
|
+
};
|
|
1638
2353
|
imports.wbg.__wbg_new_ff12d2b041fb48f1 = function(arg0, arg1) {
|
|
1639
2354
|
try {
|
|
1640
2355
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -1642,7 +2357,7 @@ function __wbg_get_imports() {
|
|
|
1642
2357
|
const a = state0.a;
|
|
1643
2358
|
state0.a = 0;
|
|
1644
2359
|
try {
|
|
1645
|
-
return
|
|
2360
|
+
return __wasm_bindgen_func_elem_756(a, state0.b, arg0, arg1);
|
|
1646
2361
|
} finally {
|
|
1647
2362
|
state0.a = a;
|
|
1648
2363
|
}
|
|
@@ -1684,10 +2399,24 @@ function __wbg_get_imports() {
|
|
|
1684
2399
|
const ret = setTimeout(getObject(arg0), arg1);
|
|
1685
2400
|
return addHeapObject(ret);
|
|
1686
2401
|
}, arguments) };
|
|
2402
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
2403
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
2404
|
+
};
|
|
1687
2405
|
imports.wbg.__wbg_set_781438a03c0c3c81 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
1688
2406
|
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
1689
2407
|
return ret;
|
|
1690
2408
|
}, arguments) };
|
|
2409
|
+
imports.wbg.__wbg_set_7df433eea03a5c14 = function(arg0, arg1, arg2) {
|
|
2410
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
2411
|
+
};
|
|
2412
|
+
imports.wbg.__wbg_set_efaaf145b9377369 = function(arg0, arg1, arg2) {
|
|
2413
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
2414
|
+
return addHeapObject(ret);
|
|
2415
|
+
};
|
|
2416
|
+
imports.wbg.__wbg_size_aeb57b993c620133 = function(arg0) {
|
|
2417
|
+
const ret = getObject(arg0).size;
|
|
2418
|
+
return ret;
|
|
2419
|
+
};
|
|
1691
2420
|
imports.wbg.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
|
|
1692
2421
|
const ret = getObject(arg1).stack;
|
|
1693
2422
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -1720,14 +2449,14 @@ function __wbg_get_imports() {
|
|
|
1720
2449
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
1721
2450
|
return addHeapObject(ret);
|
|
1722
2451
|
};
|
|
1723
|
-
imports.wbg.
|
|
1724
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
1725
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2452
|
+
imports.wbg.__wbindgen_cast_2ead27b74a7138e7 = function(arg0, arg1) {
|
|
2453
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 48, function: Function { arguments: [], shim_idx: 49, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2454
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_389, __wasm_bindgen_func_elem_393);
|
|
1726
2455
|
return addHeapObject(ret);
|
|
1727
2456
|
};
|
|
1728
|
-
imports.wbg.
|
|
1729
|
-
// Cast intrinsic for `
|
|
1730
|
-
const ret =
|
|
2457
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
2458
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
2459
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
1731
2460
|
return addHeapObject(ret);
|
|
1732
2461
|
};
|
|
1733
2462
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
@@ -1735,6 +2464,11 @@ function __wbg_get_imports() {
|
|
|
1735
2464
|
const ret = arg0;
|
|
1736
2465
|
return addHeapObject(ret);
|
|
1737
2466
|
};
|
|
2467
|
+
imports.wbg.__wbindgen_cast_f2cc0f2a96e2ef5b = function(arg0, arg1) {
|
|
2468
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 115, function: Function { arguments: [Externref], shim_idx: 116, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2469
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_720, __wasm_bindgen_func_elem_725);
|
|
2470
|
+
return addHeapObject(ret);
|
|
2471
|
+
};
|
|
1738
2472
|
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
1739
2473
|
const ret = getObject(arg0);
|
|
1740
2474
|
return addHeapObject(ret);
|