@ifc-lite/wasm 2.1.6 → 2.3.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/package.json +1 -1
- package/pkg/ifc-lite.d.ts +137 -3
- package/pkg/ifc-lite.js +293 -10
- package/pkg/ifc-lite_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -35,6 +35,50 @@ export class ClashSession {
|
|
|
35
35
|
runRule(group_a: Uint32Array, group_b: Uint32Array, mode: number, tolerance: number, clearance: number, report_touch: boolean): ClashRunResult;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
+
export class GridAxisCollection {
|
|
39
|
+
private constructor();
|
|
40
|
+
free(): void;
|
|
41
|
+
[Symbol.dispose](): void;
|
|
42
|
+
/**
|
|
43
|
+
* Get the axis at `index`. Returns `undefined` for out-of-bounds index.
|
|
44
|
+
*/
|
|
45
|
+
getAxis(index: number): GridAxisJs | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Number of grid axes.
|
|
48
|
+
*/
|
|
49
|
+
readonly length: number;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the collection is empty.
|
|
52
|
+
*/
|
|
53
|
+
readonly isEmpty: boolean;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export class GridAxisJs {
|
|
57
|
+
private constructor();
|
|
58
|
+
free(): void;
|
|
59
|
+
[Symbol.dispose](): void;
|
|
60
|
+
/**
|
|
61
|
+
* End endpoint `[x, y, z]` in renderer Y-up world space (metres).
|
|
62
|
+
*/
|
|
63
|
+
readonly end: Float32Array;
|
|
64
|
+
/**
|
|
65
|
+
* Axis tag (e.g. `"A"`, `"1"`); empty string when unauthored.
|
|
66
|
+
*/
|
|
67
|
+
readonly tag: string;
|
|
68
|
+
/**
|
|
69
|
+
* Start endpoint `[x, y, z]` in renderer Y-up world space (metres).
|
|
70
|
+
*/
|
|
71
|
+
readonly start: Float32Array;
|
|
72
|
+
/**
|
|
73
|
+
* Express ID of the `IfcGridAxis`.
|
|
74
|
+
*/
|
|
75
|
+
readonly axisId: number;
|
|
76
|
+
/**
|
|
77
|
+
* Express ID of the owning `IfcGrid`.
|
|
78
|
+
*/
|
|
79
|
+
readonly gridId: number;
|
|
80
|
+
}
|
|
81
|
+
|
|
38
82
|
export class IfcAPI {
|
|
39
83
|
free(): void;
|
|
40
84
|
[Symbol.dispose](): void;
|
|
@@ -82,6 +126,22 @@ export class IfcAPI {
|
|
|
82
126
|
* `{ type: "complete", totalJobs }`
|
|
83
127
|
*/
|
|
84
128
|
buildPrePassStreaming(data: Uint8Array, on_event: Function, chunk_size: number): any;
|
|
129
|
+
/**
|
|
130
|
+
* Parse the file and return structured per-axis data (tag + endpoints) in
|
|
131
|
+
* the renderer's Y-up world space (RTC-subtracted, metres). Use this when
|
|
132
|
+
* you also need the axis tags (to render grid bubbles / labels).
|
|
133
|
+
*/
|
|
134
|
+
parseGridAxes(content: string): GridAxisCollection;
|
|
135
|
+
/**
|
|
136
|
+
* Parse the file and return every `IfcGridAxis` as a flat `Float32Array`
|
|
137
|
+
* of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` (one segment per
|
|
138
|
+
* axis) in the renderer's Y-up world space (RTC-subtracted, metres). Feed
|
|
139
|
+
* straight to a line pipeline (e.g. `uploadAnnotationLines3D`).
|
|
140
|
+
*
|
|
141
|
+
* Returns an empty array when the file has no grids, so the caller can
|
|
142
|
+
* clear the overlay cheaply.
|
|
143
|
+
*/
|
|
144
|
+
parseGridLines(content: string): Float32Array;
|
|
85
145
|
/**
|
|
86
146
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
87
147
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -168,6 +228,17 @@ export class IfcAPI {
|
|
|
168
228
|
* fail fast.
|
|
169
229
|
*/
|
|
170
230
|
clearPrePassCache(): void;
|
|
231
|
+
/**
|
|
232
|
+
* Enable or disable per-entity geometry fingerprinting in
|
|
233
|
+
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
234
|
+
*
|
|
235
|
+
* Pass a positive `tolerance` (metres) to enable — it is the quantization
|
|
236
|
+
* grid the hash snaps positions to (larger = more tolerant of float noise,
|
|
237
|
+
* smaller = catches finer edits; the `f32` precision floor of model-local
|
|
238
|
+
* coordinates means values below ~1 mm mostly hash noise). Pass `null`/
|
|
239
|
+
* `undefined` (or a non-positive value) to disable. Default: disabled.
|
|
240
|
+
*/
|
|
241
|
+
setComputeGeometryHashes(tolerance?: number | null): void;
|
|
171
242
|
/**
|
|
172
243
|
* Create and initialize the IFC API
|
|
173
244
|
*/
|
|
@@ -290,6 +361,23 @@ export class MeshCollection {
|
|
|
290
361
|
* Returns None if no rotation was detected
|
|
291
362
|
*/
|
|
292
363
|
readonly buildingRotation: number | undefined;
|
|
364
|
+
/**
|
|
365
|
+
* Express ids for the per-entity geometry fingerprints, parallel to
|
|
366
|
+
* [`Self::geometry_hash_values`]. Empty unless geometry hashing was
|
|
367
|
+
* enabled via `IfcAPI.setComputeGeometryHashes`.
|
|
368
|
+
*/
|
|
369
|
+
readonly geometryHashIds: Uint32Array;
|
|
370
|
+
/**
|
|
371
|
+
* Number of per-entity geometry fingerprints recorded.
|
|
372
|
+
*/
|
|
373
|
+
readonly geometryHashCount: number;
|
|
374
|
+
/**
|
|
375
|
+
* Per-entity geometry fingerprints as a `BigUint64Array`, parallel to
|
|
376
|
+
* [`Self::geometry_hash_ids`]. `u64` is exposed (not hex strings) so JS
|
|
377
|
+
* can compare with `===` and key maps without allocation. Empty unless
|
|
378
|
+
* geometry hashing was enabled.
|
|
379
|
+
*/
|
|
380
|
+
readonly geometryHashValues: BigUint64Array;
|
|
293
381
|
/**
|
|
294
382
|
* Get number of meshes
|
|
295
383
|
*/
|
|
@@ -304,6 +392,14 @@ export class MeshDataJs {
|
|
|
304
392
|
* Get express ID
|
|
305
393
|
*/
|
|
306
394
|
readonly expressId: number;
|
|
395
|
+
/**
|
|
396
|
+
* True when this mesh carries a surface texture (#961).
|
|
397
|
+
*/
|
|
398
|
+
readonly hasTexture: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* Decoded RGBA8 texture bytes (`width*height*4`). Empty when untextured.
|
|
401
|
+
*/
|
|
402
|
+
readonly textureRgba: Uint8Array;
|
|
307
403
|
/**
|
|
308
404
|
* Get vertex count
|
|
309
405
|
*/
|
|
@@ -314,10 +410,25 @@ export class MeshDataJs {
|
|
|
314
410
|
* `undefined` when absent (most files).
|
|
315
411
|
*/
|
|
316
412
|
readonly shadingColor: Float32Array | undefined;
|
|
413
|
+
readonly textureWidth: number;
|
|
414
|
+
readonly textureHeight: number;
|
|
317
415
|
/**
|
|
318
416
|
* Get triangle count
|
|
319
417
|
*/
|
|
320
418
|
readonly triangleCount: number;
|
|
419
|
+
/**
|
|
420
|
+
* Sampler wrap for the S axis (`IfcSurfaceTexture.RepeatS`): true = repeat.
|
|
421
|
+
*/
|
|
422
|
+
readonly textureRepeatS: boolean;
|
|
423
|
+
/**
|
|
424
|
+
* Sampler wrap for the T axis (`IfcSurfaceTexture.RepeatT`): true = repeat.
|
|
425
|
+
*/
|
|
426
|
+
readonly textureRepeatT: boolean;
|
|
427
|
+
/**
|
|
428
|
+
* Per-vertex texture coordinates as Float32Array (u, v pairs). Empty when
|
|
429
|
+
* the mesh is untextured.
|
|
430
|
+
*/
|
|
431
|
+
readonly uvs: Float32Array;
|
|
321
432
|
/**
|
|
322
433
|
* Get color as [r, g, b, a] array
|
|
323
434
|
*/
|
|
@@ -589,6 +700,8 @@ export interface InitOutput {
|
|
|
589
700
|
readonly memory: WebAssembly.Memory;
|
|
590
701
|
readonly __wbg_clashrunresult_free: (a: number, b: number) => void;
|
|
591
702
|
readonly __wbg_clashsession_free: (a: number, b: number) => void;
|
|
703
|
+
readonly __wbg_gridaxiscollection_free: (a: number, b: number) => void;
|
|
704
|
+
readonly __wbg_gridaxisjs_free: (a: number, b: number) => void;
|
|
592
705
|
readonly __wbg_ifcapi_free: (a: number, b: number) => void;
|
|
593
706
|
readonly __wbg_meshcollection_free: (a: number, b: number) => void;
|
|
594
707
|
readonly __wbg_meshdatajs_free: (a: number, b: number) => void;
|
|
@@ -608,6 +721,14 @@ export interface InitOutput {
|
|
|
608
721
|
readonly clashsession_ingest: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number) => void;
|
|
609
722
|
readonly clashsession_new: () => number;
|
|
610
723
|
readonly clashsession_runRule: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
724
|
+
readonly gridaxiscollection_getAxis: (a: number, b: number) => number;
|
|
725
|
+
readonly gridaxiscollection_isEmpty: (a: number) => number;
|
|
726
|
+
readonly gridaxiscollection_length: (a: number) => number;
|
|
727
|
+
readonly gridaxisjs_axisId: (a: number) => number;
|
|
728
|
+
readonly gridaxisjs_end: (a: number) => number;
|
|
729
|
+
readonly gridaxisjs_gridId: (a: number) => number;
|
|
730
|
+
readonly gridaxisjs_start: (a: number) => number;
|
|
731
|
+
readonly gridaxisjs_tag: (a: number, b: number) => void;
|
|
611
732
|
readonly ifcapi_buildPrePassFast: (a: number, b: number, c: number) => number;
|
|
612
733
|
readonly ifcapi_buildPrePassOnce: (a: number, b: number, c: number) => number;
|
|
613
734
|
readonly ifcapi_buildPrePassStreaming: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
@@ -618,6 +739,8 @@ export interface InitOutput {
|
|
|
618
739
|
readonly ifcapi_new: () => number;
|
|
619
740
|
readonly ifcapi_parse: (a: number, b: number, c: number) => number;
|
|
620
741
|
readonly ifcapi_parseAlignmentLines: (a: number, b: number, c: number) => number;
|
|
742
|
+
readonly ifcapi_parseGridAxes: (a: number, b: number, c: number) => number;
|
|
743
|
+
readonly ifcapi_parseGridLines: (a: number, b: number, c: number) => number;
|
|
621
744
|
readonly ifcapi_parseStreaming: (a: number, b: number, c: number, d: number) => number;
|
|
622
745
|
readonly ifcapi_parseSymbolicRepresentations: (a: number, b: number, c: number) => number;
|
|
623
746
|
readonly ifcapi_processGeometryBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number) => number;
|
|
@@ -625,10 +748,14 @@ export interface InitOutput {
|
|
|
625
748
|
readonly ifcapi_scanEntitiesFastBytes: (a: number, b: number, c: number) => number;
|
|
626
749
|
readonly ifcapi_scanGeometryEntitiesFast: (a: number, b: number, c: number) => number;
|
|
627
750
|
readonly ifcapi_scanRelevantEntitiesFastBytes: (a: number, b: number, c: number) => number;
|
|
751
|
+
readonly ifcapi_setComputeGeometryHashes: (a: number, b: number, c: number) => void;
|
|
628
752
|
readonly ifcapi_setEntityIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
|
|
629
753
|
readonly ifcapi_setMergeLayers: (a: number, b: number) => void;
|
|
630
754
|
readonly ifcapi_version: (a: number, b: number) => void;
|
|
631
755
|
readonly meshcollection_buildingRotation: (a: number, b: number) => void;
|
|
756
|
+
readonly meshcollection_geometryHashCount: (a: number) => number;
|
|
757
|
+
readonly meshcollection_geometryHashIds: (a: number) => number;
|
|
758
|
+
readonly meshcollection_geometryHashValues: (a: number) => number;
|
|
632
759
|
readonly meshcollection_get: (a: number, b: number) => number;
|
|
633
760
|
readonly meshcollection_hasRtcOffset: (a: number) => number;
|
|
634
761
|
readonly meshcollection_length: (a: number) => number;
|
|
@@ -640,12 +767,19 @@ export interface InitOutput {
|
|
|
640
767
|
readonly meshcollection_totalVertices: (a: number) => number;
|
|
641
768
|
readonly meshdatajs_color: (a: number, b: number) => void;
|
|
642
769
|
readonly meshdatajs_expressId: (a: number) => number;
|
|
770
|
+
readonly meshdatajs_hasTexture: (a: number) => number;
|
|
643
771
|
readonly meshdatajs_ifcType: (a: number, b: number) => void;
|
|
644
772
|
readonly meshdatajs_indices: (a: number) => number;
|
|
645
773
|
readonly meshdatajs_normals: (a: number) => number;
|
|
646
774
|
readonly meshdatajs_positions: (a: number) => number;
|
|
647
775
|
readonly meshdatajs_shadingColor: (a: number, b: number) => void;
|
|
776
|
+
readonly meshdatajs_textureHeight: (a: number) => number;
|
|
777
|
+
readonly meshdatajs_textureRepeatS: (a: number) => number;
|
|
778
|
+
readonly meshdatajs_textureRepeatT: (a: number) => number;
|
|
779
|
+
readonly meshdatajs_textureRgba: (a: number) => number;
|
|
780
|
+
readonly meshdatajs_textureWidth: (a: number) => number;
|
|
648
781
|
readonly meshdatajs_triangleCount: (a: number) => number;
|
|
782
|
+
readonly meshdatajs_uvs: (a: number) => number;
|
|
649
783
|
readonly meshdatajs_vertexCount: (a: number) => number;
|
|
650
784
|
readonly profilecollection_get: (a: number, b: number) => number;
|
|
651
785
|
readonly profilecollection_length: (a: number) => number;
|
|
@@ -722,9 +856,9 @@ export interface InitOutput {
|
|
|
722
856
|
readonly symbolictext_worldY: (a: number) => number;
|
|
723
857
|
readonly symbolictext_x: (a: number) => number;
|
|
724
858
|
readonly symbolictext_y: (a: number) => number;
|
|
725
|
-
readonly
|
|
726
|
-
readonly
|
|
727
|
-
readonly
|
|
859
|
+
readonly __wasm_bindgen_func_elem_666: (a: number, b: number, c: number) => void;
|
|
860
|
+
readonly __wasm_bindgen_func_elem_665: (a: number, b: number) => void;
|
|
861
|
+
readonly __wasm_bindgen_func_elem_700: (a: number, b: number, c: number, d: number) => void;
|
|
728
862
|
readonly __wbindgen_export: (a: number) => void;
|
|
729
863
|
readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
|
|
730
864
|
readonly __wbindgen_export3: (a: number, b: number) => number;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -40,11 +40,24 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
40
40
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
function getArrayU64FromWasm0(ptr, len) {
|
|
44
|
+
ptr = ptr >>> 0;
|
|
45
|
+
return getBigUint64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
function getArrayU8FromWasm0(ptr, len) {
|
|
44
49
|
ptr = ptr >>> 0;
|
|
45
50
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
46
51
|
}
|
|
47
52
|
|
|
53
|
+
let cachedBigUint64ArrayMemory0 = null;
|
|
54
|
+
function getBigUint64ArrayMemory0() {
|
|
55
|
+
if (cachedBigUint64ArrayMemory0 === null || cachedBigUint64ArrayMemory0.byteLength === 0) {
|
|
56
|
+
cachedBigUint64ArrayMemory0 = new BigUint64Array(wasm.memory.buffer);
|
|
57
|
+
}
|
|
58
|
+
return cachedBigUint64ArrayMemory0;
|
|
59
|
+
}
|
|
60
|
+
|
|
48
61
|
let cachedDataViewMemory0 = null;
|
|
49
62
|
function getDataViewMemory0() {
|
|
50
63
|
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
@@ -232,12 +245,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
232
245
|
|
|
233
246
|
let WASM_VECTOR_LEN = 0;
|
|
234
247
|
|
|
235
|
-
function
|
|
236
|
-
wasm.
|
|
248
|
+
function __wasm_bindgen_func_elem_666(arg0, arg1, arg2) {
|
|
249
|
+
wasm.__wasm_bindgen_func_elem_666(arg0, arg1, addHeapObject(arg2));
|
|
237
250
|
}
|
|
238
251
|
|
|
239
|
-
function
|
|
240
|
-
wasm.
|
|
252
|
+
function __wasm_bindgen_func_elem_700(arg0, arg1, arg2, arg3) {
|
|
253
|
+
wasm.__wasm_bindgen_func_elem_700(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
241
254
|
}
|
|
242
255
|
|
|
243
256
|
const ClashRunResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -248,6 +261,14 @@ const ClashSessionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
248
261
|
? { register: () => {}, unregister: () => {} }
|
|
249
262
|
: new FinalizationRegistry(ptr => wasm.__wbg_clashsession_free(ptr >>> 0, 1));
|
|
250
263
|
|
|
264
|
+
const GridAxisCollectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
265
|
+
? { register: () => {}, unregister: () => {} }
|
|
266
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gridaxiscollection_free(ptr >>> 0, 1));
|
|
267
|
+
|
|
268
|
+
const GridAxisJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
269
|
+
? { register: () => {}, unregister: () => {} }
|
|
270
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_gridaxisjs_free(ptr >>> 0, 1));
|
|
271
|
+
|
|
251
272
|
const IfcAPIFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
252
273
|
? { register: () => {}, unregister: () => {} }
|
|
253
274
|
: new FinalizationRegistry(ptr => wasm.__wbg_ifcapi_free(ptr >>> 0, 1));
|
|
@@ -479,6 +500,131 @@ export class ClashSession {
|
|
|
479
500
|
}
|
|
480
501
|
if (Symbol.dispose) ClashSession.prototype[Symbol.dispose] = ClashSession.prototype.free;
|
|
481
502
|
|
|
503
|
+
/**
|
|
504
|
+
* A collection of resolved grid axes.
|
|
505
|
+
*/
|
|
506
|
+
export class GridAxisCollection {
|
|
507
|
+
static __wrap(ptr) {
|
|
508
|
+
ptr = ptr >>> 0;
|
|
509
|
+
const obj = Object.create(GridAxisCollection.prototype);
|
|
510
|
+
obj.__wbg_ptr = ptr;
|
|
511
|
+
GridAxisCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
512
|
+
return obj;
|
|
513
|
+
}
|
|
514
|
+
__destroy_into_raw() {
|
|
515
|
+
const ptr = this.__wbg_ptr;
|
|
516
|
+
this.__wbg_ptr = 0;
|
|
517
|
+
GridAxisCollectionFinalization.unregister(this);
|
|
518
|
+
return ptr;
|
|
519
|
+
}
|
|
520
|
+
free() {
|
|
521
|
+
const ptr = this.__destroy_into_raw();
|
|
522
|
+
wasm.__wbg_gridaxiscollection_free(ptr, 0);
|
|
523
|
+
}
|
|
524
|
+
/**
|
|
525
|
+
* Number of grid axes.
|
|
526
|
+
* @returns {number}
|
|
527
|
+
*/
|
|
528
|
+
get length() {
|
|
529
|
+
const ret = wasm.gridaxiscollection_length(this.__wbg_ptr);
|
|
530
|
+
return ret >>> 0;
|
|
531
|
+
}
|
|
532
|
+
/**
|
|
533
|
+
* Get the axis at `index`. Returns `undefined` for out-of-bounds index.
|
|
534
|
+
* @param {number} index
|
|
535
|
+
* @returns {GridAxisJs | undefined}
|
|
536
|
+
*/
|
|
537
|
+
getAxis(index) {
|
|
538
|
+
const ret = wasm.gridaxiscollection_getAxis(this.__wbg_ptr, index);
|
|
539
|
+
return ret === 0 ? undefined : GridAxisJs.__wrap(ret);
|
|
540
|
+
}
|
|
541
|
+
/**
|
|
542
|
+
* Whether the collection is empty.
|
|
543
|
+
* @returns {boolean}
|
|
544
|
+
*/
|
|
545
|
+
get isEmpty() {
|
|
546
|
+
const ret = wasm.gridaxiscollection_isEmpty(this.__wbg_ptr);
|
|
547
|
+
return ret !== 0;
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
if (Symbol.dispose) GridAxisCollection.prototype[Symbol.dispose] = GridAxisCollection.prototype.free;
|
|
551
|
+
|
|
552
|
+
/**
|
|
553
|
+
* One grid axis: tag + endpoints in renderer Y-up world space (metres).
|
|
554
|
+
*/
|
|
555
|
+
export class GridAxisJs {
|
|
556
|
+
static __wrap(ptr) {
|
|
557
|
+
ptr = ptr >>> 0;
|
|
558
|
+
const obj = Object.create(GridAxisJs.prototype);
|
|
559
|
+
obj.__wbg_ptr = ptr;
|
|
560
|
+
GridAxisJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
561
|
+
return obj;
|
|
562
|
+
}
|
|
563
|
+
__destroy_into_raw() {
|
|
564
|
+
const ptr = this.__wbg_ptr;
|
|
565
|
+
this.__wbg_ptr = 0;
|
|
566
|
+
GridAxisJsFinalization.unregister(this);
|
|
567
|
+
return ptr;
|
|
568
|
+
}
|
|
569
|
+
free() {
|
|
570
|
+
const ptr = this.__destroy_into_raw();
|
|
571
|
+
wasm.__wbg_gridaxisjs_free(ptr, 0);
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* End endpoint `[x, y, z]` in renderer Y-up world space (metres).
|
|
575
|
+
* @returns {Float32Array}
|
|
576
|
+
*/
|
|
577
|
+
get end() {
|
|
578
|
+
const ret = wasm.gridaxisjs_end(this.__wbg_ptr);
|
|
579
|
+
return takeObject(ret);
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Axis tag (e.g. `"A"`, `"1"`); empty string when unauthored.
|
|
583
|
+
* @returns {string}
|
|
584
|
+
*/
|
|
585
|
+
get tag() {
|
|
586
|
+
let deferred1_0;
|
|
587
|
+
let deferred1_1;
|
|
588
|
+
try {
|
|
589
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
590
|
+
wasm.gridaxisjs_tag(retptr, this.__wbg_ptr);
|
|
591
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
592
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
593
|
+
deferred1_0 = r0;
|
|
594
|
+
deferred1_1 = r1;
|
|
595
|
+
return getStringFromWasm0(r0, r1);
|
|
596
|
+
} finally {
|
|
597
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
598
|
+
wasm.__wbindgen_export2(deferred1_0, deferred1_1, 1);
|
|
599
|
+
}
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Start endpoint `[x, y, z]` in renderer Y-up world space (metres).
|
|
603
|
+
* @returns {Float32Array}
|
|
604
|
+
*/
|
|
605
|
+
get start() {
|
|
606
|
+
const ret = wasm.gridaxisjs_start(this.__wbg_ptr);
|
|
607
|
+
return takeObject(ret);
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Express ID of the `IfcGridAxis`.
|
|
611
|
+
* @returns {number}
|
|
612
|
+
*/
|
|
613
|
+
get axisId() {
|
|
614
|
+
const ret = wasm.gridaxisjs_axisId(this.__wbg_ptr);
|
|
615
|
+
return ret >>> 0;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Express ID of the owning `IfcGrid`.
|
|
619
|
+
* @returns {number}
|
|
620
|
+
*/
|
|
621
|
+
get gridId() {
|
|
622
|
+
const ret = wasm.gridaxisjs_gridId(this.__wbg_ptr);
|
|
623
|
+
return ret >>> 0;
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
if (Symbol.dispose) GridAxisJs.prototype[Symbol.dispose] = GridAxisJs.prototype.free;
|
|
627
|
+
|
|
482
628
|
/**
|
|
483
629
|
* Main IFC-Lite API
|
|
484
630
|
*/
|
|
@@ -602,6 +748,36 @@ export class IfcAPI {
|
|
|
602
748
|
heap[stack_pointer++] = undefined;
|
|
603
749
|
}
|
|
604
750
|
}
|
|
751
|
+
/**
|
|
752
|
+
* Parse the file and return structured per-axis data (tag + endpoints) in
|
|
753
|
+
* the renderer's Y-up world space (RTC-subtracted, metres). Use this when
|
|
754
|
+
* you also need the axis tags (to render grid bubbles / labels).
|
|
755
|
+
* @param {string} content
|
|
756
|
+
* @returns {GridAxisCollection}
|
|
757
|
+
*/
|
|
758
|
+
parseGridAxes(content) {
|
|
759
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
760
|
+
const len0 = WASM_VECTOR_LEN;
|
|
761
|
+
const ret = wasm.ifcapi_parseGridAxes(this.__wbg_ptr, ptr0, len0);
|
|
762
|
+
return GridAxisCollection.__wrap(ret);
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Parse the file and return every `IfcGridAxis` as a flat `Float32Array`
|
|
766
|
+
* of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` (one segment per
|
|
767
|
+
* axis) in the renderer's Y-up world space (RTC-subtracted, metres). Feed
|
|
768
|
+
* straight to a line pipeline (e.g. `uploadAnnotationLines3D`).
|
|
769
|
+
*
|
|
770
|
+
* Returns an empty array when the file has no grids, so the caller can
|
|
771
|
+
* clear the overlay cheaply.
|
|
772
|
+
* @param {string} content
|
|
773
|
+
* @returns {Float32Array}
|
|
774
|
+
*/
|
|
775
|
+
parseGridLines(content) {
|
|
776
|
+
const ptr0 = passStringToWasm0(content, wasm.__wbindgen_export3, wasm.__wbindgen_export4);
|
|
777
|
+
const len0 = WASM_VECTOR_LEN;
|
|
778
|
+
const ret = wasm.ifcapi_parseGridLines(this.__wbg_ptr, ptr0, len0);
|
|
779
|
+
return takeObject(ret);
|
|
780
|
+
}
|
|
605
781
|
/**
|
|
606
782
|
* Parse the file and return every `IfcAlignment` directrix as a flat
|
|
607
783
|
* `Float32Array` of 3D line-list vertices `[x0,y0,z0, x1,y1,z1, …]` in
|
|
@@ -723,6 +899,20 @@ export class IfcAPI {
|
|
|
723
899
|
clearPrePassCache() {
|
|
724
900
|
wasm.ifcapi_clearPrePassCache(this.__wbg_ptr);
|
|
725
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* Enable or disable per-entity geometry fingerprinting in
|
|
904
|
+
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
905
|
+
*
|
|
906
|
+
* Pass a positive `tolerance` (metres) to enable — it is the quantization
|
|
907
|
+
* grid the hash snaps positions to (larger = more tolerant of float noise,
|
|
908
|
+
* smaller = catches finer edits; the `f32` precision floor of model-local
|
|
909
|
+
* coordinates means values below ~1 mm mostly hash noise). Pass `null`/
|
|
910
|
+
* `undefined` (or a non-positive value) to disable. Default: disabled.
|
|
911
|
+
* @param {number | null} [tolerance]
|
|
912
|
+
*/
|
|
913
|
+
setComputeGeometryHashes(tolerance) {
|
|
914
|
+
wasm.ifcapi_setComputeGeometryHashes(this.__wbg_ptr, !isLikeNone(tolerance), isLikeNone(tolerance) ? 0 : tolerance);
|
|
915
|
+
}
|
|
726
916
|
/**
|
|
727
917
|
* Create and initialize the IFC API
|
|
728
918
|
*/
|
|
@@ -985,6 +1175,35 @@ export class MeshCollection {
|
|
|
985
1175
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
986
1176
|
}
|
|
987
1177
|
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Express ids for the per-entity geometry fingerprints, parallel to
|
|
1180
|
+
* [`Self::geometry_hash_values`]. Empty unless geometry hashing was
|
|
1181
|
+
* enabled via `IfcAPI.setComputeGeometryHashes`.
|
|
1182
|
+
* @returns {Uint32Array}
|
|
1183
|
+
*/
|
|
1184
|
+
get geometryHashIds() {
|
|
1185
|
+
const ret = wasm.meshcollection_geometryHashIds(this.__wbg_ptr);
|
|
1186
|
+
return takeObject(ret);
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Number of per-entity geometry fingerprints recorded.
|
|
1190
|
+
* @returns {number}
|
|
1191
|
+
*/
|
|
1192
|
+
get geometryHashCount() {
|
|
1193
|
+
const ret = wasm.meshcollection_geometryHashCount(this.__wbg_ptr);
|
|
1194
|
+
return ret >>> 0;
|
|
1195
|
+
}
|
|
1196
|
+
/**
|
|
1197
|
+
* Per-entity geometry fingerprints as a `BigUint64Array`, parallel to
|
|
1198
|
+
* [`Self::geometry_hash_ids`]. `u64` is exposed (not hex strings) so JS
|
|
1199
|
+
* can compare with `===` and key maps without allocation. Empty unless
|
|
1200
|
+
* geometry hashing was enabled.
|
|
1201
|
+
* @returns {BigUint64Array}
|
|
1202
|
+
*/
|
|
1203
|
+
get geometryHashValues() {
|
|
1204
|
+
const ret = wasm.meshcollection_geometryHashValues(this.__wbg_ptr);
|
|
1205
|
+
return takeObject(ret);
|
|
1206
|
+
}
|
|
988
1207
|
/**
|
|
989
1208
|
* Get mesh at index
|
|
990
1209
|
* @param {number} index
|
|
@@ -1034,6 +1253,22 @@ export class MeshDataJs {
|
|
|
1034
1253
|
const ret = wasm.meshdatajs_expressId(this.__wbg_ptr);
|
|
1035
1254
|
return ret >>> 0;
|
|
1036
1255
|
}
|
|
1256
|
+
/**
|
|
1257
|
+
* True when this mesh carries a surface texture (#961).
|
|
1258
|
+
* @returns {boolean}
|
|
1259
|
+
*/
|
|
1260
|
+
get hasTexture() {
|
|
1261
|
+
const ret = wasm.meshdatajs_hasTexture(this.__wbg_ptr);
|
|
1262
|
+
return ret !== 0;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* Decoded RGBA8 texture bytes (`width*height*4`). Empty when untextured.
|
|
1266
|
+
* @returns {Uint8Array}
|
|
1267
|
+
*/
|
|
1268
|
+
get textureRgba() {
|
|
1269
|
+
const ret = wasm.meshdatajs_textureRgba(this.__wbg_ptr);
|
|
1270
|
+
return takeObject(ret);
|
|
1271
|
+
}
|
|
1037
1272
|
/**
|
|
1038
1273
|
* Get vertex count
|
|
1039
1274
|
* @returns {number}
|
|
@@ -1064,6 +1299,20 @@ export class MeshDataJs {
|
|
|
1064
1299
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1065
1300
|
}
|
|
1066
1301
|
}
|
|
1302
|
+
/**
|
|
1303
|
+
* @returns {number}
|
|
1304
|
+
*/
|
|
1305
|
+
get textureWidth() {
|
|
1306
|
+
const ret = wasm.meshdatajs_textureWidth(this.__wbg_ptr);
|
|
1307
|
+
return ret >>> 0;
|
|
1308
|
+
}
|
|
1309
|
+
/**
|
|
1310
|
+
* @returns {number}
|
|
1311
|
+
*/
|
|
1312
|
+
get textureHeight() {
|
|
1313
|
+
const ret = wasm.meshdatajs_textureHeight(this.__wbg_ptr);
|
|
1314
|
+
return ret >>> 0;
|
|
1315
|
+
}
|
|
1067
1316
|
/**
|
|
1068
1317
|
* Get triangle count
|
|
1069
1318
|
* @returns {number}
|
|
@@ -1072,6 +1321,31 @@ export class MeshDataJs {
|
|
|
1072
1321
|
const ret = wasm.meshdatajs_triangleCount(this.__wbg_ptr);
|
|
1073
1322
|
return ret >>> 0;
|
|
1074
1323
|
}
|
|
1324
|
+
/**
|
|
1325
|
+
* Sampler wrap for the S axis (`IfcSurfaceTexture.RepeatS`): true = repeat.
|
|
1326
|
+
* @returns {boolean}
|
|
1327
|
+
*/
|
|
1328
|
+
get textureRepeatS() {
|
|
1329
|
+
const ret = wasm.meshdatajs_textureRepeatS(this.__wbg_ptr);
|
|
1330
|
+
return ret !== 0;
|
|
1331
|
+
}
|
|
1332
|
+
/**
|
|
1333
|
+
* Sampler wrap for the T axis (`IfcSurfaceTexture.RepeatT`): true = repeat.
|
|
1334
|
+
* @returns {boolean}
|
|
1335
|
+
*/
|
|
1336
|
+
get textureRepeatT() {
|
|
1337
|
+
const ret = wasm.meshdatajs_textureRepeatT(this.__wbg_ptr);
|
|
1338
|
+
return ret !== 0;
|
|
1339
|
+
}
|
|
1340
|
+
/**
|
|
1341
|
+
* Per-vertex texture coordinates as Float32Array (u, v pairs). Empty when
|
|
1342
|
+
* the mesh is untextured.
|
|
1343
|
+
* @returns {Float32Array}
|
|
1344
|
+
*/
|
|
1345
|
+
get uvs() {
|
|
1346
|
+
const ret = wasm.meshdatajs_uvs(this.__wbg_ptr);
|
|
1347
|
+
return takeObject(ret);
|
|
1348
|
+
}
|
|
1075
1349
|
/**
|
|
1076
1350
|
* Get color as [r, g, b, a] array
|
|
1077
1351
|
* @returns {Float32Array}
|
|
@@ -2161,7 +2435,7 @@ function __wbg_get_imports() {
|
|
|
2161
2435
|
const a = state0.a;
|
|
2162
2436
|
state0.a = 0;
|
|
2163
2437
|
try {
|
|
2164
|
-
return
|
|
2438
|
+
return __wasm_bindgen_func_elem_700(a, state0.b, arg0, arg1);
|
|
2165
2439
|
} finally {
|
|
2166
2440
|
state0.a = a;
|
|
2167
2441
|
}
|
|
@@ -2176,10 +2450,18 @@ function __wbg_get_imports() {
|
|
|
2176
2450
|
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
2177
2451
|
return addHeapObject(ret);
|
|
2178
2452
|
};
|
|
2453
|
+
imports.wbg.__wbg_new_from_slice_883d10a76ca46292 = function(arg0, arg1) {
|
|
2454
|
+
const ret = new BigUint64Array(getArrayU64FromWasm0(arg0, arg1));
|
|
2455
|
+
return addHeapObject(ret);
|
|
2456
|
+
};
|
|
2179
2457
|
imports.wbg.__wbg_new_from_slice_db0691b69e9d3891 = function(arg0, arg1) {
|
|
2180
2458
|
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
2181
2459
|
return addHeapObject(ret);
|
|
2182
2460
|
};
|
|
2461
|
+
imports.wbg.__wbg_new_from_slice_f9c22b9153b26992 = function(arg0, arg1) {
|
|
2462
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
2463
|
+
return addHeapObject(ret);
|
|
2464
|
+
};
|
|
2183
2465
|
imports.wbg.__wbg_new_no_args_cb138f77cf6151ee = function(arg0, arg1) {
|
|
2184
2466
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
2185
2467
|
return addHeapObject(ret);
|
|
@@ -2256,16 +2538,16 @@ function __wbg_get_imports() {
|
|
|
2256
2538
|
imports.wbg.__wbg_warn_6e567d0d926ff881 = function(arg0) {
|
|
2257
2539
|
console.warn(getObject(arg0));
|
|
2258
2540
|
};
|
|
2541
|
+
imports.wbg.__wbindgen_cast_0093e2d96a856a3b = function(arg0, arg1) {
|
|
2542
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 61, function: Function { arguments: [Externref], shim_idx: 62, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2543
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_665, __wasm_bindgen_func_elem_666);
|
|
2544
|
+
return addHeapObject(ret);
|
|
2545
|
+
};
|
|
2259
2546
|
imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
|
|
2260
2547
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2261
2548
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2262
2549
|
return addHeapObject(ret);
|
|
2263
2550
|
};
|
|
2264
|
-
imports.wbg.__wbindgen_cast_257c51b8abf9285e = function(arg0, arg1) {
|
|
2265
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 57, function: Function { arguments: [Externref], shim_idx: 58, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2266
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_609, __wasm_bindgen_func_elem_610);
|
|
2267
|
-
return addHeapObject(ret);
|
|
2268
|
-
};
|
|
2269
2551
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
2270
2552
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2271
2553
|
const ret = BigInt.asUintN(64, arg0);
|
|
@@ -2290,6 +2572,7 @@ function __wbg_get_imports() {
|
|
|
2290
2572
|
function __wbg_finalize_init(instance, module) {
|
|
2291
2573
|
wasm = instance.exports;
|
|
2292
2574
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
2575
|
+
cachedBigUint64ArrayMemory0 = null;
|
|
2293
2576
|
cachedDataViewMemory0 = null;
|
|
2294
2577
|
cachedFloat32ArrayMemory0 = null;
|
|
2295
2578
|
cachedFloat64ArrayMemory0 = null;
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|