@ifc-lite/wasm 10.3.0 → 10.5.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 +25 -0
- package/package.json +12 -3
- package/pkg/ifc-lite.d.ts +202 -4
- package/pkg/ifc-lite.js +349 -5
- package/pkg/ifc-lite_bg.wasm +0 -0
- package/pkg-retained/ifc-lite.d.ts +3075 -0
- package/retained.d.ts +16 -0
- package/retained.js +33 -0
package/pkg/ifc-lite.js
CHANGED
|
@@ -1235,6 +1235,14 @@ export class IfcAPI {
|
|
|
1235
1235
|
* out-of-range index copied into the BIN chunk. (The viewer always passes
|
|
1236
1236
|
* fully-backed, normal-covered, whole-triangle, in-range arrays, so this only
|
|
1237
1237
|
* fires on a caller bug.)
|
|
1238
|
+
*
|
|
1239
|
+
* `world_matrix` is the frame the meshes were baked in (#7734): 16 finite
|
|
1240
|
+
* numbers, a column-major 4x4 in IFC Z-up metres with `world = M * baked`
|
|
1241
|
+
* (the viewer builds it from `CoordinateInfo`). The GLB root carries it, so
|
|
1242
|
+
* a georeferenced model exports where the from-bytes `exportGlb` puts it
|
|
1243
|
+
* instead of in the render frame. Omit it (`undefined`) for an unshifted
|
|
1244
|
+
* model; a matrix that is not 16 finite numbers throws
|
|
1245
|
+
* `MALFORMED_MESH_INPUT`.
|
|
1238
1246
|
* @param {Float32Array} positions
|
|
1239
1247
|
* @param {Float32Array} normals
|
|
1240
1248
|
* @param {Uint32Array} indices
|
|
@@ -1246,9 +1254,10 @@ export class IfcAPI {
|
|
|
1246
1254
|
* @param {boolean} include_metadata
|
|
1247
1255
|
* @param {boolean | null} [lit]
|
|
1248
1256
|
* @param {boolean | null} [emissive]
|
|
1257
|
+
* @param {Float64Array | null} [world_matrix]
|
|
1249
1258
|
* @returns {Uint8Array}
|
|
1250
1259
|
*/
|
|
1251
|
-
exportGlbFromMeshes(positions, normals, indices, vertex_counts, index_counts, colors, origins, express_ids, include_metadata, lit, emissive) {
|
|
1260
|
+
exportGlbFromMeshes(positions, normals, indices, vertex_counts, index_counts, colors, origins, express_ids, include_metadata, lit, emissive, world_matrix) {
|
|
1252
1261
|
try {
|
|
1253
1262
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1254
1263
|
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_export);
|
|
@@ -1267,7 +1276,9 @@ export class IfcAPI {
|
|
|
1267
1276
|
const len6 = WASM_VECTOR_LEN;
|
|
1268
1277
|
const ptr7 = passArray32ToWasm0(express_ids, wasm.__wbindgen_export);
|
|
1269
1278
|
const len7 = WASM_VECTOR_LEN;
|
|
1270
|
-
|
|
1279
|
+
var ptr8 = isLikeNone(world_matrix) ? 0 : passArrayF64ToWasm0(world_matrix, wasm.__wbindgen_export);
|
|
1280
|
+
var len8 = WASM_VECTOR_LEN;
|
|
1281
|
+
wasm.ifcapi_exportGlbFromMeshes(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, ptr6, len6, ptr7, len7, include_metadata, isLikeNone(lit) ? 0xFFFFFF : lit ? 1 : 0, isLikeNone(emissive) ? 0xFFFFFF : emissive ? 1 : 0, ptr8, len8);
|
|
1271
1282
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1272
1283
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1273
1284
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -1275,9 +1286,9 @@ export class IfcAPI {
|
|
|
1275
1286
|
if (r3) {
|
|
1276
1287
|
throw takeObject(r2);
|
|
1277
1288
|
}
|
|
1278
|
-
var
|
|
1289
|
+
var v10 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1279
1290
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1280
|
-
return
|
|
1291
|
+
return v10;
|
|
1281
1292
|
} finally {
|
|
1282
1293
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1283
1294
|
}
|
|
@@ -1503,6 +1514,48 @@ export class IfcAPI {
|
|
|
1503
1514
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1504
1515
|
}
|
|
1505
1516
|
}
|
|
1517
|
+
/**
|
|
1518
|
+
* Export the terrain products `product_ids` (express ids) of `content` as
|
|
1519
|
+
* one LandXML 1.2 document, one `<Surface>` each.
|
|
1520
|
+
*
|
|
1521
|
+
* Returns JSON `{ xml, crsName, surfaces: [{ productId, globalId, name,
|
|
1522
|
+
* points, faces }] }`. A selection that is not an authored triangulated
|
|
1523
|
+
* terrain, or whose georeferencing is missing or ambiguous, throws an
|
|
1524
|
+
* `Error` whose message starts with `TERRAIN_REFUSED:` and names the
|
|
1525
|
+
* reason.
|
|
1526
|
+
* @param {Uint8Array} content
|
|
1527
|
+
* @param {Uint32Array} product_ids
|
|
1528
|
+
* @param {LandXmlTerrainOptionsJs} options
|
|
1529
|
+
* @returns {string}
|
|
1530
|
+
*/
|
|
1531
|
+
exportLandXmlTerrain(content, product_ids, options) {
|
|
1532
|
+
let deferred4_0;
|
|
1533
|
+
let deferred4_1;
|
|
1534
|
+
try {
|
|
1535
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1536
|
+
const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_export);
|
|
1537
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1538
|
+
const ptr1 = passArray32ToWasm0(product_ids, wasm.__wbindgen_export);
|
|
1539
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1540
|
+
wasm.ifcapi_exportLandXmlTerrain(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
1541
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1542
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1543
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1544
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1545
|
+
var ptr3 = r0;
|
|
1546
|
+
var len3 = r1;
|
|
1547
|
+
if (r3) {
|
|
1548
|
+
ptr3 = 0; len3 = 0;
|
|
1549
|
+
throw takeObject(r2);
|
|
1550
|
+
}
|
|
1551
|
+
deferred4_0 = ptr3;
|
|
1552
|
+
deferred4_1 = len3;
|
|
1553
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1554
|
+
} finally {
|
|
1555
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
1556
|
+
wasm.__wbindgen_export4(deferred4_0, deferred4_1, 1);
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1506
1559
|
/**
|
|
1507
1560
|
* Merge several IFC models into one STEP/IFC UTF-8 byte buffer (`Uint8Array`).
|
|
1508
1561
|
* `concatenated` is every model's
|
|
@@ -1525,6 +1578,11 @@ export class IfcAPI {
|
|
|
1525
1578
|
wasm.ifcapi_exportMerged(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1526
1579
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1527
1580
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1581
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1582
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1583
|
+
if (r3) {
|
|
1584
|
+
throw takeObject(r2);
|
|
1585
|
+
}
|
|
1528
1586
|
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1529
1587
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1530
1588
|
return v4;
|
|
@@ -1549,6 +1607,10 @@ export class IfcAPI {
|
|
|
1549
1607
|
* for GLB in `export_glb`). A non-empty `Uint32Array` is the ordinary allowlist.
|
|
1550
1608
|
* Instanced type-library shapes are skipped regardless of the filter.
|
|
1551
1609
|
*
|
|
1610
|
+
* Fails CLOSED like `exportGlb`: when no mesh is written this throws an
|
|
1611
|
+
* `Error` whose message starts with `NO_RENDER_GEOMETRY`, instead of
|
|
1612
|
+
* returning a header-only OBJ (#7695).
|
|
1613
|
+
*
|
|
1552
1614
|
* ```javascript
|
|
1553
1615
|
* const obj = api.exportObj(ifcContent, true, new Uint32Array(), undefined);
|
|
1554
1616
|
* ```
|
|
@@ -1570,6 +1632,11 @@ export class IfcAPI {
|
|
|
1570
1632
|
wasm.ifcapi_exportObj(retptr, this.__wbg_ptr, ptr0, len0, include_normals, ptr1, len1, ptr2, len2);
|
|
1571
1633
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1572
1634
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1635
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1636
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1637
|
+
if (r3) {
|
|
1638
|
+
throw takeObject(r2);
|
|
1639
|
+
}
|
|
1573
1640
|
var v4 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1574
1641
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1575
1642
|
return v4;
|
|
@@ -1641,6 +1708,10 @@ export class IfcAPI {
|
|
|
1641
1708
|
* Export **OpenUSD** (`.usda` ASCII): a real Z-up USD stage — spatial hierarchy of
|
|
1642
1709
|
* `Xform` prims, `UsdGeomMesh` geometry, `UsdPreviewSurface` materials, IFC
|
|
1643
1710
|
* metadata as custom attributes. Whole-model (geometry-backed).
|
|
1711
|
+
*
|
|
1712
|
+
* Fails CLOSED like `exportGlb`: a model with no render geometry throws an
|
|
1713
|
+
* `Error` whose message starts with `NO_RENDER_GEOMETRY`, instead of
|
|
1714
|
+
* returning a stage with nothing to look at (#7695).
|
|
1644
1715
|
* @param {Uint8Array} content
|
|
1645
1716
|
* @returns {Uint8Array}
|
|
1646
1717
|
*/
|
|
@@ -1652,6 +1723,11 @@ export class IfcAPI {
|
|
|
1652
1723
|
wasm.ifcapi_exportUsd(retptr, this.__wbg_ptr, ptr0, len0);
|
|
1653
1724
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1654
1725
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1726
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
1727
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
1728
|
+
if (r3) {
|
|
1729
|
+
throw takeObject(r2);
|
|
1730
|
+
}
|
|
1655
1731
|
var v2 = getArrayU8FromWasm0(r0, r1).slice();
|
|
1656
1732
|
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
1657
1733
|
return v2;
|
|
@@ -2779,6 +2855,39 @@ export class IfcAPI {
|
|
|
2779
2855
|
const ret = wasm.ifcapi_processGeometryBatchPartitionedFromSource(this.__wbg_ptr, ptr0, len0, unit_scale, rtc_x, rtc_y, rtc_z, needs_shift, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5, !isLikeNone(plane_angle_to_radians), isLikeNone(plane_angle_to_radians) ? 0 : plane_angle_to_radians, ptr6, len6, ptr7, len7, ptr8, len8);
|
|
2780
2856
|
return PartitionedBatch.__wrap(ret);
|
|
2781
2857
|
}
|
|
2858
|
+
/**
|
|
2859
|
+
* Propose IFC walls, slabs, columns and pipes from a scan segmentation
|
|
2860
|
+
* report (#6894). `report_json` is the JSON `segmentScanPoints`
|
|
2861
|
+
* returned; `options_json` is a camelCase `ScanProposalOptions` object
|
|
2862
|
+
* (`{}` for the defaults; `scanToModel` maps the report's frame into the
|
|
2863
|
+
* IFC model frame). Returns the UTF-8 JSON `ScanProposalReport` in the
|
|
2864
|
+
* model frame (Z up, metres). Pure: loads and changes nothing.
|
|
2865
|
+
* @param {string} report_json
|
|
2866
|
+
* @param {string} options_json
|
|
2867
|
+
* @returns {Uint8Array}
|
|
2868
|
+
*/
|
|
2869
|
+
proposeScanElements(report_json, options_json) {
|
|
2870
|
+
try {
|
|
2871
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
2872
|
+
const ptr0 = passStringToWasm0(report_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2873
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2874
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
2875
|
+
const len1 = WASM_VECTOR_LEN;
|
|
2876
|
+
wasm.ifcapi_proposeScanElements(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
2877
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
2878
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
2879
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
2880
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
2881
|
+
if (r3) {
|
|
2882
|
+
throw takeObject(r2);
|
|
2883
|
+
}
|
|
2884
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
2885
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
2886
|
+
return v3;
|
|
2887
|
+
} finally {
|
|
2888
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
2889
|
+
}
|
|
2890
|
+
}
|
|
2782
2891
|
/**
|
|
2783
2892
|
* Fit bounded manual correspondences in source metres -> IFC world Z-up
|
|
2784
2893
|
* metres, reporting held-out errors separately. Does not load or move models.
|
|
@@ -2866,6 +2975,11 @@ export class IfcAPI {
|
|
|
2866
2975
|
* Fast entity scanning using SIMD-accelerated Rust scanner
|
|
2867
2976
|
* Returns array of entity references for data model parsing
|
|
2868
2977
|
* Much faster than TypeScript byte-by-byte scanning (5-10x speedup)
|
|
2978
|
+
*
|
|
2979
|
+
* The returned array also carries two own properties describing what the
|
|
2980
|
+
* scan refused (#7393): `oversizedIdCount` (records skipped because their
|
|
2981
|
+
* express id does not fit u32, #3395) and `malformedRecordCount` (0 or 1:
|
|
2982
|
+
* whether a record was dropped for having no terminating `;`, #3695).
|
|
2869
2983
|
* @param {string} content
|
|
2870
2984
|
* @returns {any}
|
|
2871
2985
|
*/
|
|
@@ -2879,6 +2993,9 @@ export class IfcAPI {
|
|
|
2879
2993
|
* Fast entity scanning from raw bytes (avoids TextDecoder.decode on JS side).
|
|
2880
2994
|
* Accepts Uint8Array directly — saves ~2-5s for 487MB files by skipping
|
|
2881
2995
|
* JS string creation and UTF-16→UTF-8 conversion.
|
|
2996
|
+
*
|
|
2997
|
+
* Carries the same `oversizedIdCount` / `malformedRecordCount` array
|
|
2998
|
+
* properties as `scanEntitiesFast` (#7393).
|
|
2882
2999
|
* @param {Uint8Array} data
|
|
2883
3000
|
* @returns {any}
|
|
2884
3001
|
*/
|
|
@@ -2960,6 +3077,37 @@ export class IfcAPI {
|
|
|
2960
3077
|
const ret = wasm.ifcapi_scanGeometryEntitiesFast(this.__wbg_ptr, ptr0, len0);
|
|
2961
3078
|
return takeObject(ret);
|
|
2962
3079
|
}
|
|
3080
|
+
/**
|
|
3081
|
+
* Detect planes and cylinders (columns, pipes) in a point cloud (#6870). `positions` are xyz f32 metres
|
|
3082
|
+
* (at most 100,000,000 points); `options_json` is a camelCase
|
|
3083
|
+
* `ScanSegmentationOptions` object (`{}` for the defaults). Returns the
|
|
3084
|
+
* UTF-8 JSON `ScanSegmentationReport`. Pure: loads and changes nothing.
|
|
3085
|
+
* @param {Float32Array} positions
|
|
3086
|
+
* @param {string} options_json
|
|
3087
|
+
* @returns {Uint8Array}
|
|
3088
|
+
*/
|
|
3089
|
+
segmentScanPoints(positions, options_json) {
|
|
3090
|
+
try {
|
|
3091
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
3092
|
+
const ptr0 = passArrayF32ToWasm0(positions, wasm.__wbindgen_export);
|
|
3093
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3094
|
+
const ptr1 = passStringToWasm0(options_json, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
3095
|
+
const len1 = WASM_VECTOR_LEN;
|
|
3096
|
+
wasm.ifcapi_segmentScanPoints(retptr, this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
3097
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
3098
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
3099
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
3100
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
3101
|
+
if (r3) {
|
|
3102
|
+
throw takeObject(r2);
|
|
3103
|
+
}
|
|
3104
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
3105
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
3106
|
+
return v3;
|
|
3107
|
+
} finally {
|
|
3108
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
3109
|
+
}
|
|
3110
|
+
}
|
|
2963
3111
|
/**
|
|
2964
3112
|
* Enable or disable per-entity geometry fingerprinting in
|
|
2965
3113
|
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
@@ -4346,6 +4494,107 @@ export class ProfileEntryJs {
|
|
|
4346
4494
|
}
|
|
4347
4495
|
if (Symbol.dispose) ProfileEntryJs.prototype[Symbol.dispose] = ProfileEntryJs.prototype.free;
|
|
4348
4496
|
|
|
4497
|
+
/**
|
|
4498
|
+
* The traced outline. Owns wasm memory: call `free()`.
|
|
4499
|
+
*/
|
|
4500
|
+
export class ScanOutlineJs {
|
|
4501
|
+
static __wrap(ptr) {
|
|
4502
|
+
const obj = Object.create(ScanOutlineJs.prototype);
|
|
4503
|
+
obj.__wbg_ptr = ptr;
|
|
4504
|
+
ScanOutlineJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4505
|
+
return obj;
|
|
4506
|
+
}
|
|
4507
|
+
__destroy_into_raw() {
|
|
4508
|
+
const ptr = this.__wbg_ptr;
|
|
4509
|
+
this.__wbg_ptr = 0;
|
|
4510
|
+
ScanOutlineJsFinalization.unregister(this);
|
|
4511
|
+
return ptr;
|
|
4512
|
+
}
|
|
4513
|
+
free() {
|
|
4514
|
+
const ptr = this.__destroy_into_raw();
|
|
4515
|
+
wasm.__wbg_scanoutlinejs_free(ptr, 0);
|
|
4516
|
+
}
|
|
4517
|
+
/**
|
|
4518
|
+
* Every ring's plane coordinates concatenated, `[u0, v0, u1, v1, …]`.
|
|
4519
|
+
* @returns {Float64Array}
|
|
4520
|
+
*/
|
|
4521
|
+
coords() {
|
|
4522
|
+
const ret = wasm.scanoutlinejs_coords(this.__wbg_ptr);
|
|
4523
|
+
return takeObject(ret);
|
|
4524
|
+
}
|
|
4525
|
+
/**
|
|
4526
|
+
* What the run did: cell size, cap hits, ring counts, repairs.
|
|
4527
|
+
* @returns {ScanOutlineDiagnosticsJs}
|
|
4528
|
+
*/
|
|
4529
|
+
diagnostics() {
|
|
4530
|
+
try {
|
|
4531
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
4532
|
+
wasm.scanoutlinejs_diagnostics(retptr, this.__wbg_ptr);
|
|
4533
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
4534
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
4535
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
4536
|
+
if (r2) {
|
|
4537
|
+
throw takeObject(r1);
|
|
4538
|
+
}
|
|
4539
|
+
return takeObject(r0);
|
|
4540
|
+
} finally {
|
|
4541
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
4542
|
+
}
|
|
4543
|
+
}
|
|
4544
|
+
/**
|
|
4545
|
+
* Total number of rings (outer boundaries and holes).
|
|
4546
|
+
* @returns {number}
|
|
4547
|
+
*/
|
|
4548
|
+
get ringCount() {
|
|
4549
|
+
const ret = wasm.scanoutlinejs_ringCount(this.__wbg_ptr);
|
|
4550
|
+
return ret >>> 0;
|
|
4551
|
+
}
|
|
4552
|
+
/**
|
|
4553
|
+
* Vertex count of each ring, in `coords()` order.
|
|
4554
|
+
* @returns {Uint32Array}
|
|
4555
|
+
*/
|
|
4556
|
+
ringLengths() {
|
|
4557
|
+
const ret = wasm.scanoutlinejs_ringLengths(this.__wbg_ptr);
|
|
4558
|
+
return takeObject(ret);
|
|
4559
|
+
}
|
|
4560
|
+
/**
|
|
4561
|
+
* The ring directly containing each ring (a hole's outer boundary, an
|
|
4562
|
+
* island's hole), or `-1` at top level.
|
|
4563
|
+
* @returns {Int32Array}
|
|
4564
|
+
*/
|
|
4565
|
+
ringParents() {
|
|
4566
|
+
const ret = wasm.scanoutlinejs_ringParents(this.__wbg_ptr);
|
|
4567
|
+
return takeObject(ret);
|
|
4568
|
+
}
|
|
4569
|
+
/**
|
|
4570
|
+
* Number of outer boundaries.
|
|
4571
|
+
* @returns {number}
|
|
4572
|
+
*/
|
|
4573
|
+
get shapeCount() {
|
|
4574
|
+
const ret = wasm.scanoutlinejs_shapeCount(this.__wbg_ptr);
|
|
4575
|
+
return ret >>> 0;
|
|
4576
|
+
}
|
|
4577
|
+
/**
|
|
4578
|
+
* Ring index at which each shape starts; entry `s` is shape `s`'s outer
|
|
4579
|
+
* ring and the rings up to the next entry are its holes.
|
|
4580
|
+
* @returns {Uint32Array}
|
|
4581
|
+
*/
|
|
4582
|
+
shapeOffsets() {
|
|
4583
|
+
const ret = wasm.scanoutlinejs_shapeOffsets(this.__wbg_ptr);
|
|
4584
|
+
return takeObject(ret);
|
|
4585
|
+
}
|
|
4586
|
+
/**
|
|
4587
|
+
* Every ring mapped through the plane frame, `[x0, y0, z0, …]` in
|
|
4588
|
+
* `coords()` order, or `undefined` when no frame was given.
|
|
4589
|
+
* @returns {Float64Array | undefined}
|
|
4590
|
+
*/
|
|
4591
|
+
worldCoords() {
|
|
4592
|
+
const ret = wasm.scanoutlinejs_worldCoords(this.__wbg_ptr);
|
|
4593
|
+
return takeObject(ret);
|
|
4594
|
+
}
|
|
4595
|
+
}
|
|
4596
|
+
if (Symbol.dispose) ScanOutlineJs.prototype[Symbol.dispose] = ScanOutlineJs.prototype.free;
|
|
4597
|
+
|
|
4349
4598
|
/**
|
|
4350
4599
|
* Flat result of `simplifyMeshes`: per surviving element `i`,
|
|
4351
4600
|
* `vertexCounts[i]` vertices and `indexCounts[i]` indices taken in order
|
|
@@ -6115,6 +6364,17 @@ export function resolve2d(a) {
|
|
|
6115
6364
|
return Contours2D.__wrap(ret);
|
|
6116
6365
|
}
|
|
6117
6366
|
|
|
6367
|
+
/**
|
|
6368
|
+
* Install (or, with `undefined`, remove) the callback invoked at most once a
|
|
6369
|
+
* second while geometry work is in progress inside a WASM call. It runs
|
|
6370
|
+
* synchronously inside that call, so it must only do something cheap such as
|
|
6371
|
+
* `postMessage`, and must not call back into this module.
|
|
6372
|
+
* @param {Function | null} [callback]
|
|
6373
|
+
*/
|
|
6374
|
+
export function setGeometryProgressCallback(callback) {
|
|
6375
|
+
wasm.setGeometryProgressCallback(isLikeNone(callback) ? 0 : addHeapObject(callback));
|
|
6376
|
+
}
|
|
6377
|
+
|
|
6118
6378
|
/**
|
|
6119
6379
|
* Split a mesh into one closed solid per zone, plus the remainder.
|
|
6120
6380
|
*
|
|
@@ -6145,6 +6405,14 @@ export function resolve2d(a) {
|
|
|
6145
6405
|
* meaningless volumes with a plausible `sumErrorRel`, so the closure proof
|
|
6146
6406
|
* above is the caller's responsibility and not a formality.
|
|
6147
6407
|
*
|
|
6408
|
+
* Returns `undefined` when a zone parameter is non-finite, or a mesh vertex
|
|
6409
|
+
* or zone corner lies past ±2^128, the exact kernel's coordinate bound
|
|
6410
|
+
* (#7677): such a split is refused rather than answered wrongly.
|
|
6411
|
+
*
|
|
6412
|
+
* Returns `undefined` if an intersection, zone union or remainder exhausts
|
|
6413
|
+
* the exact kernel's work budget. Completed pieces are not returned as a
|
|
6414
|
+
* successful partial split, and a failed empty piece is not treated as disjoint.
|
|
6415
|
+
*
|
|
6148
6416
|
* Returns `undefined` when the mesh encloses no volume (no triangles survive
|
|
6149
6417
|
* the filter above, or the shell is degenerate): there is nothing to split,
|
|
6150
6418
|
* and a result for it would report `pieceCount` 1, `sumErrorRel` 0 and
|
|
@@ -6155,7 +6423,7 @@ export function resolve2d(a) {
|
|
|
6155
6423
|
* const split = splitMeshByZones(positions, indices, new Float64Array([
|
|
6156
6424
|
* 0, 0, 0, 10, 10, 10, 0,
|
|
6157
6425
|
* ]));
|
|
6158
|
-
* if (!split) return; //
|
|
6426
|
+
* if (!split) return; // no usable complete split
|
|
6159
6427
|
* for (let i = 0; i < split.pieceCount; i++) {
|
|
6160
6428
|
* const piece = split.piece(i);
|
|
6161
6429
|
* // piece.zoneIndex, piece.positions, piece.indices, piece.volume
|
|
@@ -6185,6 +6453,34 @@ export function splitMeshByZones(positions, indices, zones, footprints, footprin
|
|
|
6185
6453
|
return ret === 0 ? undefined : ZoneSplitJs.__wrap(ret);
|
|
6186
6454
|
}
|
|
6187
6455
|
|
|
6456
|
+
/**
|
|
6457
|
+
* Trace closed outlines from slab points given in plane coordinates.
|
|
6458
|
+
*
|
|
6459
|
+
* THROWS on invalid options or plane frame (unknown field, non-finite or
|
|
6460
|
+
* out-of-range value). Points that are not finite are skipped and counted.
|
|
6461
|
+
* @param {Float32Array} plane_xy
|
|
6462
|
+
* @param {ScanOutlineOptionsJs | null} [options]
|
|
6463
|
+
* @param {ScanOutlinePlaneFrameJs | null} [plane_frame]
|
|
6464
|
+
* @returns {ScanOutlineJs}
|
|
6465
|
+
*/
|
|
6466
|
+
export function traceScanOutline(plane_xy, options, plane_frame) {
|
|
6467
|
+
try {
|
|
6468
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
6469
|
+
const ptr0 = passArrayF32ToWasm0(plane_xy, wasm.__wbindgen_export);
|
|
6470
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6471
|
+
wasm.traceScanOutline(retptr, ptr0, len0, isLikeNone(options) ? 0 : addHeapObject(options), isLikeNone(plane_frame) ? 0 : addHeapObject(plane_frame));
|
|
6472
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
6473
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
6474
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
6475
|
+
if (r2) {
|
|
6476
|
+
throw takeObject(r1);
|
|
6477
|
+
}
|
|
6478
|
+
return ScanOutlineJs.__wrap(r0);
|
|
6479
|
+
} finally {
|
|
6480
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
6481
|
+
}
|
|
6482
|
+
}
|
|
6483
|
+
|
|
6188
6484
|
/**
|
|
6189
6485
|
* `a ∪ b`.
|
|
6190
6486
|
* @param {Contours2D} a
|
|
@@ -6318,10 +6614,18 @@ function __wbg_get_imports() {
|
|
|
6318
6614
|
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
6319
6615
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
6320
6616
|
},
|
|
6617
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
6618
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
6619
|
+
return addHeapObject(ret);
|
|
6620
|
+
}, arguments); },
|
|
6321
6621
|
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
6322
6622
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
6323
6623
|
return addHeapObject(ret);
|
|
6324
6624
|
}, arguments); },
|
|
6625
|
+
__wbg_entries_015dc610cd81ede0: function(arg0) {
|
|
6626
|
+
const ret = Object.entries(getObject(arg0));
|
|
6627
|
+
return addHeapObject(ret);
|
|
6628
|
+
},
|
|
6325
6629
|
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
6326
6630
|
let deferred0_0;
|
|
6327
6631
|
let deferred0_1;
|
|
@@ -6333,10 +6637,22 @@ function __wbg_get_imports() {
|
|
|
6333
6637
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
6334
6638
|
}
|
|
6335
6639
|
},
|
|
6640
|
+
__wbg_from_13e323c65fc8f464: function(arg0) {
|
|
6641
|
+
const ret = Array.from(getObject(arg0));
|
|
6642
|
+
return addHeapObject(ret);
|
|
6643
|
+
},
|
|
6644
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
6645
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
6646
|
+
return addHeapObject(ret);
|
|
6647
|
+
},
|
|
6336
6648
|
__wbg_get_78f252d074a84d0b: function() { return handleError(function (arg0, arg1) {
|
|
6337
6649
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
6338
6650
|
return addHeapObject(ret);
|
|
6339
6651
|
}, arguments); },
|
|
6652
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
6653
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
6654
|
+
return addHeapObject(ret);
|
|
6655
|
+
},
|
|
6340
6656
|
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
6341
6657
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
6342
6658
|
return addHeapObject(ret);
|
|
@@ -6376,6 +6692,10 @@ function __wbg_get_imports() {
|
|
|
6376
6692
|
const ret = getObject(arg0).length;
|
|
6377
6693
|
return ret;
|
|
6378
6694
|
},
|
|
6695
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
6696
|
+
const ret = getObject(arg0).length;
|
|
6697
|
+
return ret;
|
|
6698
|
+
},
|
|
6379
6699
|
__wbg_new_227d7c05414eb861: function() {
|
|
6380
6700
|
const ret = new Error();
|
|
6381
6701
|
return addHeapObject(ret);
|
|
@@ -6416,6 +6736,10 @@ function __wbg_get_imports() {
|
|
|
6416
6736
|
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
6417
6737
|
return addHeapObject(ret);
|
|
6418
6738
|
},
|
|
6739
|
+
__wbg_new_from_slice_adc482e0820cc439: function(arg0, arg1) {
|
|
6740
|
+
const ret = new Int32Array(getArrayI32FromWasm0(arg0, arg1));
|
|
6741
|
+
return addHeapObject(ret);
|
|
6742
|
+
},
|
|
6419
6743
|
__wbg_new_from_slice_ddf8b82c4d6af38e: function(arg0, arg1) {
|
|
6420
6744
|
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
6421
6745
|
return addHeapObject(ret);
|
|
@@ -6491,6 +6815,9 @@ function __wbg_get_imports() {
|
|
|
6491
6815
|
__wbg_warn_b1370d804fa3e259: function(arg0) {
|
|
6492
6816
|
console.warn(getObject(arg0));
|
|
6493
6817
|
},
|
|
6818
|
+
__wbg_warn_ef97a01ad7900eb3: function(arg0, arg1) {
|
|
6819
|
+
console.warn(getObject(arg0), getObject(arg1));
|
|
6820
|
+
},
|
|
6494
6821
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
6495
6822
|
// Cast intrinsic for `F64 -> Externref`.
|
|
6496
6823
|
const ret = arg0;
|
|
@@ -6565,6 +6892,9 @@ const ProfileCollectionFinalization = (typeof FinalizationRegistry === 'undefine
|
|
|
6565
6892
|
const ProfileEntryJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6566
6893
|
? { register: () => {}, unregister: () => {} }
|
|
6567
6894
|
: new FinalizationRegistry(ptr => wasm.__wbg_profileentryjs_free(ptr, 1));
|
|
6895
|
+
const ScanOutlineJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6896
|
+
? { register: () => {}, unregister: () => {} }
|
|
6897
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_scanoutlinejs_free(ptr, 1));
|
|
6568
6898
|
const SimplifiedMeshesFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6569
6899
|
? { register: () => {}, unregister: () => {} }
|
|
6570
6900
|
: new FinalizationRegistry(ptr => wasm.__wbg_simplifiedmeshes_free(ptr, 1));
|
|
@@ -6695,6 +7025,11 @@ function getArrayF64FromWasm0(ptr, len) {
|
|
|
6695
7025
|
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
6696
7026
|
}
|
|
6697
7027
|
|
|
7028
|
+
function getArrayI32FromWasm0(ptr, len) {
|
|
7029
|
+
ptr = ptr >>> 0;
|
|
7030
|
+
return getInt32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
7031
|
+
}
|
|
7032
|
+
|
|
6698
7033
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
6699
7034
|
ptr = ptr >>> 0;
|
|
6700
7035
|
const mem = getDataViewMemory0();
|
|
@@ -6752,6 +7087,14 @@ function getFloat64ArrayMemory0() {
|
|
|
6752
7087
|
return cachedFloat64ArrayMemory0;
|
|
6753
7088
|
}
|
|
6754
7089
|
|
|
7090
|
+
let cachedInt32ArrayMemory0 = null;
|
|
7091
|
+
function getInt32ArrayMemory0() {
|
|
7092
|
+
if (cachedInt32ArrayMemory0 === null || cachedInt32ArrayMemory0.byteLength === 0) {
|
|
7093
|
+
cachedInt32ArrayMemory0 = new Int32Array(wasm.memory.buffer);
|
|
7094
|
+
}
|
|
7095
|
+
return cachedInt32ArrayMemory0;
|
|
7096
|
+
}
|
|
7097
|
+
|
|
6755
7098
|
function getStringFromWasm0(ptr, len) {
|
|
6756
7099
|
return decodeText(ptr >>> 0, len);
|
|
6757
7100
|
}
|
|
@@ -6912,6 +7255,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
6912
7255
|
cachedDataViewMemory0 = null;
|
|
6913
7256
|
cachedFloat32ArrayMemory0 = null;
|
|
6914
7257
|
cachedFloat64ArrayMemory0 = null;
|
|
7258
|
+
cachedInt32ArrayMemory0 = null;
|
|
6915
7259
|
cachedUint32ArrayMemory0 = null;
|
|
6916
7260
|
cachedUint8ArrayMemory0 = null;
|
|
6917
7261
|
wasm.__wbindgen_start();
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|