@ifc-lite/wasm 4.4.1 → 4.5.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/package.json +1 -1
- package/pkg/ifc-lite.d.ts +126 -5
- package/pkg/ifc-lite.js +226 -5
- package/pkg/ifc-lite_bg.wasm +0 -0
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -603,11 +603,13 @@ export class IfcAPI {
|
|
|
603
603
|
* Enable or disable per-entity geometry fingerprinting in
|
|
604
604
|
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
605
605
|
*
|
|
606
|
-
* Pass a positive `tolerance` (metres) to enable —
|
|
607
|
-
*
|
|
608
|
-
*
|
|
609
|
-
*
|
|
610
|
-
* `
|
|
606
|
+
* Pass a positive `tolerance` (metres) to enable — the quantization grid
|
|
607
|
+
* positions snap to (larger tolerates more float noise, smaller catches
|
|
608
|
+
* finer edits; below the `f32` precision floor of model-local coordinates,
|
|
609
|
+
* ~1 mm, mostly hashes noise). Finer than
|
|
610
|
+
* `ifc_lite_geometry::MIN_GEOM_HASH_TOLERANCE` (1e-6 m) is clamped up to it
|
|
611
|
+
* — see that constant's doc for why (an `i128` overflow surface, not a
|
|
612
|
+
* precision win). `null`/`undefined`/non-positive disables. Default: off.
|
|
611
613
|
*/
|
|
612
614
|
setComputeGeometryHashes(tolerance?: number | null): void;
|
|
613
615
|
/**
|
|
@@ -1535,6 +1537,69 @@ export class SymbolicText {
|
|
|
1535
1537
|
readonly y: number;
|
|
1536
1538
|
}
|
|
1537
1539
|
|
|
1540
|
+
/**
|
|
1541
|
+
* One closed solid of a split element.
|
|
1542
|
+
*/
|
|
1543
|
+
export class ZonePieceJs {
|
|
1544
|
+
private constructor();
|
|
1545
|
+
free(): void;
|
|
1546
|
+
[Symbol.dispose](): void;
|
|
1547
|
+
/**
|
|
1548
|
+
* Flat triangle indices into `positions`.
|
|
1549
|
+
*/
|
|
1550
|
+
readonly indices: Uint32Array;
|
|
1551
|
+
/**
|
|
1552
|
+
* Flat `[x, y, z, ...]` in the caller's frame.
|
|
1553
|
+
*/
|
|
1554
|
+
readonly positions: Float64Array;
|
|
1555
|
+
/**
|
|
1556
|
+
* Enclosed volume of this piece, cubic units of the caller's frame.
|
|
1557
|
+
*/
|
|
1558
|
+
readonly volume: number;
|
|
1559
|
+
/**
|
|
1560
|
+
* Index into the zone array that was passed in, or `-1` for the part of
|
|
1561
|
+
* the element inside no zone.
|
|
1562
|
+
*/
|
|
1563
|
+
readonly zoneIndex: number;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/**
|
|
1567
|
+
* The result of splitting one element.
|
|
1568
|
+
*/
|
|
1569
|
+
export class ZoneSplitJs {
|
|
1570
|
+
private constructor();
|
|
1571
|
+
free(): void;
|
|
1572
|
+
[Symbol.dispose](): void;
|
|
1573
|
+
/**
|
|
1574
|
+
* Piece `index`, or `undefined` when out of range. Each call COPIES the
|
|
1575
|
+
* piece out, matching the rest of this API surface.
|
|
1576
|
+
*/
|
|
1577
|
+
piece(index: number): ZonePieceJs | undefined;
|
|
1578
|
+
readonly pieceCount: number;
|
|
1579
|
+
/**
|
|
1580
|
+
* The part of the element inside NO zone could not be built.
|
|
1581
|
+
*
|
|
1582
|
+
* Separate from `sumErrorRel` because the two have opposite fixes: a
|
|
1583
|
+
* raised sum means the zones overlap and want redrawing, while this means
|
|
1584
|
+
* real volume is MISSING from the result. A caller must refuse the split
|
|
1585
|
+
* outright rather than publish the zone pieces alone.
|
|
1586
|
+
*/
|
|
1587
|
+
readonly remainderFailed: boolean;
|
|
1588
|
+
/**
|
|
1589
|
+
* How far the pieces are from summing to the whole, relative.
|
|
1590
|
+
*
|
|
1591
|
+
* The invariant #2508 puts above everything else here. Exposed rather than
|
|
1592
|
+
* enforced: the caller decides what to do with a split that does not add
|
|
1593
|
+
* up (the expected cause is zones that overlap each other), and a number
|
|
1594
|
+
* it can show beats a silent refusal.
|
|
1595
|
+
*/
|
|
1596
|
+
readonly sumErrorRel: number;
|
|
1597
|
+
/**
|
|
1598
|
+
* Enclosed volume of the input element.
|
|
1599
|
+
*/
|
|
1600
|
+
readonly wholeVolume: number;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1538
1603
|
/**
|
|
1539
1604
|
* `a - b`, keeping EVERY disjoint remnant.
|
|
1540
1605
|
*
|
|
@@ -1591,6 +1656,50 @@ export function meshOutline2d(positions: Float32Array, indices: Uint32Array, axi
|
|
|
1591
1656
|
*/
|
|
1592
1657
|
export function resolve2d(a: Contours2D): Contours2D;
|
|
1593
1658
|
|
|
1659
|
+
/**
|
|
1660
|
+
* Split a mesh into one closed solid per zone, plus the remainder.
|
|
1661
|
+
*
|
|
1662
|
+
* `positions` is flat XYZ (f64, caller's frame), `indices` flat triangle
|
|
1663
|
+
* indices. `zones` is flat, SEVEN numbers per zone:
|
|
1664
|
+
* `[cx, cy, cz, sx, sy, sz, rotationY]`, where the sizes are FULL extents
|
|
1665
|
+
* (matching the viewer's `Zone.size`) and the rotation is radians about the
|
|
1666
|
+
* vertical axis. A trailing partial zone is ignored rather than guessed at.
|
|
1667
|
+
*
|
|
1668
|
+
* A zone becomes a PRISM (#2508 item 4) when `footprint_counts[i]` is at
|
|
1669
|
+
* least 3: it then takes that many `[x, z]` pairs from `footprints`, in order,
|
|
1670
|
+
* and uses the 7-tuple only for its vertical extent (`cy +/- sy/2`). The
|
|
1671
|
+
* footprint must be CONVEX; the viewer gates that on import, because a concave
|
|
1672
|
+
* polygon fans into overlapping triangles and would cut wrong rather than
|
|
1673
|
+
* fail. A count of 1 or 2 is not a polygon: it still consumes its pairs, so
|
|
1674
|
+
* later zones stay aligned, and leaves that zone a box. Passing empty arrays
|
|
1675
|
+
* keeps every zone a box.
|
|
1676
|
+
*
|
|
1677
|
+
* The caller must have established that the mesh is a closed orientable solid
|
|
1678
|
+
* first, exactly as it must before quoting a volume at all (#1891/#1993): a
|
|
1679
|
+
* clip of an open shell produces pieces whose volumes are arbitrary rather
|
|
1680
|
+
* than approximate.
|
|
1681
|
+
*
|
|
1682
|
+
* A triangle with an out-of-range index or a non-finite coordinate is DROPPED
|
|
1683
|
+
* rather than reported, matching `kernel::mesh_bridge::mesh_to_tris`, which is
|
|
1684
|
+
* panic-free for the same reason: the alternative is a crash deep in the
|
|
1685
|
+
* predicates. It does mean a malformed caller can open the surface and get
|
|
1686
|
+
* meaningless volumes with a plausible `sumErrorRel`, so the closure proof
|
|
1687
|
+
* above is the caller's responsibility and not a formality.
|
|
1688
|
+
*
|
|
1689
|
+
* ```javascript
|
|
1690
|
+
* const split = splitMeshByZones(positions, indices, new Float64Array([
|
|
1691
|
+
* 0, 0, 0, 10, 10, 10, 0,
|
|
1692
|
+
* ]));
|
|
1693
|
+
* for (let i = 0; i < split.pieceCount; i++) {
|
|
1694
|
+
* const piece = split.piece(i);
|
|
1695
|
+
* // piece.zoneIndex, piece.positions, piece.indices, piece.volume
|
|
1696
|
+
* piece.free();
|
|
1697
|
+
* }
|
|
1698
|
+
* split.free();
|
|
1699
|
+
* ```
|
|
1700
|
+
*/
|
|
1701
|
+
export function splitMeshByZones(positions: Float64Array, indices: Uint32Array, zones: Float64Array, footprints?: Float64Array | null, footprint_counts?: Uint32Array | null): ZoneSplitJs;
|
|
1702
|
+
|
|
1594
1703
|
/**
|
|
1595
1704
|
* `a ∪ b`.
|
|
1596
1705
|
*/
|
|
@@ -1634,6 +1743,8 @@ export interface InitOutput {
|
|
|
1634
1743
|
readonly __wbg_symbolicpolyline_free: (a: number, b: number) => void;
|
|
1635
1744
|
readonly __wbg_symbolicrepresentationcollection_free: (a: number, b: number) => void;
|
|
1636
1745
|
readonly __wbg_symbolictext_free: (a: number, b: number) => void;
|
|
1746
|
+
readonly __wbg_zonepiecejs_free: (a: number, b: number) => void;
|
|
1747
|
+
readonly __wbg_zonesplitjs_free: (a: number, b: number) => void;
|
|
1637
1748
|
readonly clashrunresult_a: (a: number, b: number) => void;
|
|
1638
1749
|
readonly clashrunresult_b: (a: number, b: number) => void;
|
|
1639
1750
|
readonly clashrunresult_bounds: (a: number, b: number) => void;
|
|
@@ -1810,6 +1921,7 @@ export interface InitOutput {
|
|
|
1810
1921
|
readonly spaceplatehandle_snapshot: (a: number, b: number) => void;
|
|
1811
1922
|
readonly spaceplatehandle_splitEdge: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
1812
1923
|
readonly spaceplatehandle_splitFace: (a: number, b: number, c: number, d: number, e: number, f: number) => void;
|
|
1924
|
+
readonly splitMeshByZones: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => number;
|
|
1813
1925
|
readonly symboliccircle_centerX: (a: number) => number;
|
|
1814
1926
|
readonly symboliccircle_centerY: (a: number) => number;
|
|
1815
1927
|
readonly symboliccircle_endAngle: (a: number) => number;
|
|
@@ -1860,6 +1972,14 @@ export interface InitOutput {
|
|
|
1860
1972
|
readonly symbolictext_targetPx: (a: number) => number;
|
|
1861
1973
|
readonly union2d: (a: number, b: number) => number;
|
|
1862
1974
|
readonly version: (a: number) => void;
|
|
1975
|
+
readonly zonepiecejs_indices: (a: number) => number;
|
|
1976
|
+
readonly zonepiecejs_positions: (a: number) => number;
|
|
1977
|
+
readonly zonepiecejs_volume: (a: number) => number;
|
|
1978
|
+
readonly zonepiecejs_zoneIndex: (a: number) => number;
|
|
1979
|
+
readonly zonesplitjs_piece: (a: number, b: number) => number;
|
|
1980
|
+
readonly zonesplitjs_pieceCount: (a: number) => number;
|
|
1981
|
+
readonly zonesplitjs_remainderFailed: (a: number) => number;
|
|
1982
|
+
readonly zonesplitjs_sumErrorRel: (a: number) => number;
|
|
1863
1983
|
readonly init: () => void;
|
|
1864
1984
|
readonly meshoutlinejs_contourCount: (a: number) => number;
|
|
1865
1985
|
readonly symbolicpolyline_pointCount: (a: number) => number;
|
|
@@ -1876,6 +1996,7 @@ export interface InitOutput {
|
|
|
1876
1996
|
readonly symbolictext_worldY: (a: number) => number;
|
|
1877
1997
|
readonly symbolictext_x: (a: number) => number;
|
|
1878
1998
|
readonly symbolictext_y: (a: number) => number;
|
|
1999
|
+
readonly zonesplitjs_wholeVolume: (a: number) => number;
|
|
1879
2000
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
1880
2001
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
1881
2002
|
readonly __wbindgen_export3: (a: number) => void;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -1708,11 +1708,13 @@ export class IfcAPI {
|
|
|
1708
1708
|
* Enable or disable per-entity geometry fingerprinting in
|
|
1709
1709
|
* `processGeometryBatch`, used by the viewer's revision-diff feature.
|
|
1710
1710
|
*
|
|
1711
|
-
* Pass a positive `tolerance` (metres) to enable —
|
|
1712
|
-
*
|
|
1713
|
-
*
|
|
1714
|
-
*
|
|
1715
|
-
* `
|
|
1711
|
+
* Pass a positive `tolerance` (metres) to enable — the quantization grid
|
|
1712
|
+
* positions snap to (larger tolerates more float noise, smaller catches
|
|
1713
|
+
* finer edits; below the `f32` precision floor of model-local coordinates,
|
|
1714
|
+
* ~1 mm, mostly hashes noise). Finer than
|
|
1715
|
+
* `ifc_lite_geometry::MIN_GEOM_HASH_TOLERANCE` (1e-6 m) is clamped up to it
|
|
1716
|
+
* — see that constant's doc for why (an `i128` overflow surface, not a
|
|
1717
|
+
* precision win). `null`/`undefined`/non-positive disables. Default: off.
|
|
1716
1718
|
* @param {number | null} [tolerance]
|
|
1717
1719
|
*/
|
|
1718
1720
|
setComputeGeometryHashes(tolerance) {
|
|
@@ -4268,6 +4270,136 @@ export class SymbolicText {
|
|
|
4268
4270
|
}
|
|
4269
4271
|
if (Symbol.dispose) SymbolicText.prototype[Symbol.dispose] = SymbolicText.prototype.free;
|
|
4270
4272
|
|
|
4273
|
+
/**
|
|
4274
|
+
* One closed solid of a split element.
|
|
4275
|
+
*/
|
|
4276
|
+
export class ZonePieceJs {
|
|
4277
|
+
static __wrap(ptr) {
|
|
4278
|
+
const obj = Object.create(ZonePieceJs.prototype);
|
|
4279
|
+
obj.__wbg_ptr = ptr;
|
|
4280
|
+
ZonePieceJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4281
|
+
return obj;
|
|
4282
|
+
}
|
|
4283
|
+
__destroy_into_raw() {
|
|
4284
|
+
const ptr = this.__wbg_ptr;
|
|
4285
|
+
this.__wbg_ptr = 0;
|
|
4286
|
+
ZonePieceJsFinalization.unregister(this);
|
|
4287
|
+
return ptr;
|
|
4288
|
+
}
|
|
4289
|
+
free() {
|
|
4290
|
+
const ptr = this.__destroy_into_raw();
|
|
4291
|
+
wasm.__wbg_zonepiecejs_free(ptr, 0);
|
|
4292
|
+
}
|
|
4293
|
+
/**
|
|
4294
|
+
* Flat triangle indices into `positions`.
|
|
4295
|
+
* @returns {Uint32Array}
|
|
4296
|
+
*/
|
|
4297
|
+
get indices() {
|
|
4298
|
+
const ret = wasm.zonepiecejs_indices(this.__wbg_ptr);
|
|
4299
|
+
return takeObject(ret);
|
|
4300
|
+
}
|
|
4301
|
+
/**
|
|
4302
|
+
* Flat `[x, y, z, ...]` in the caller's frame.
|
|
4303
|
+
* @returns {Float64Array}
|
|
4304
|
+
*/
|
|
4305
|
+
get positions() {
|
|
4306
|
+
const ret = wasm.zonepiecejs_positions(this.__wbg_ptr);
|
|
4307
|
+
return takeObject(ret);
|
|
4308
|
+
}
|
|
4309
|
+
/**
|
|
4310
|
+
* Enclosed volume of this piece, cubic units of the caller's frame.
|
|
4311
|
+
* @returns {number}
|
|
4312
|
+
*/
|
|
4313
|
+
get volume() {
|
|
4314
|
+
const ret = wasm.zonepiecejs_volume(this.__wbg_ptr);
|
|
4315
|
+
return ret;
|
|
4316
|
+
}
|
|
4317
|
+
/**
|
|
4318
|
+
* Index into the zone array that was passed in, or `-1` for the part of
|
|
4319
|
+
* the element inside no zone.
|
|
4320
|
+
* @returns {number}
|
|
4321
|
+
*/
|
|
4322
|
+
get zoneIndex() {
|
|
4323
|
+
const ret = wasm.zonepiecejs_zoneIndex(this.__wbg_ptr);
|
|
4324
|
+
return ret;
|
|
4325
|
+
}
|
|
4326
|
+
}
|
|
4327
|
+
if (Symbol.dispose) ZonePieceJs.prototype[Symbol.dispose] = ZonePieceJs.prototype.free;
|
|
4328
|
+
|
|
4329
|
+
/**
|
|
4330
|
+
* The result of splitting one element.
|
|
4331
|
+
*/
|
|
4332
|
+
export class ZoneSplitJs {
|
|
4333
|
+
static __wrap(ptr) {
|
|
4334
|
+
const obj = Object.create(ZoneSplitJs.prototype);
|
|
4335
|
+
obj.__wbg_ptr = ptr;
|
|
4336
|
+
ZoneSplitJsFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4337
|
+
return obj;
|
|
4338
|
+
}
|
|
4339
|
+
__destroy_into_raw() {
|
|
4340
|
+
const ptr = this.__wbg_ptr;
|
|
4341
|
+
this.__wbg_ptr = 0;
|
|
4342
|
+
ZoneSplitJsFinalization.unregister(this);
|
|
4343
|
+
return ptr;
|
|
4344
|
+
}
|
|
4345
|
+
free() {
|
|
4346
|
+
const ptr = this.__destroy_into_raw();
|
|
4347
|
+
wasm.__wbg_zonesplitjs_free(ptr, 0);
|
|
4348
|
+
}
|
|
4349
|
+
/**
|
|
4350
|
+
* Piece `index`, or `undefined` when out of range. Each call COPIES the
|
|
4351
|
+
* piece out, matching the rest of this API surface.
|
|
4352
|
+
* @param {number} index
|
|
4353
|
+
* @returns {ZonePieceJs | undefined}
|
|
4354
|
+
*/
|
|
4355
|
+
piece(index) {
|
|
4356
|
+
const ret = wasm.zonesplitjs_piece(this.__wbg_ptr, index);
|
|
4357
|
+
return ret === 0 ? undefined : ZonePieceJs.__wrap(ret);
|
|
4358
|
+
}
|
|
4359
|
+
/**
|
|
4360
|
+
* @returns {number}
|
|
4361
|
+
*/
|
|
4362
|
+
get pieceCount() {
|
|
4363
|
+
const ret = wasm.zonesplitjs_pieceCount(this.__wbg_ptr);
|
|
4364
|
+
return ret >>> 0;
|
|
4365
|
+
}
|
|
4366
|
+
/**
|
|
4367
|
+
* The part of the element inside NO zone could not be built.
|
|
4368
|
+
*
|
|
4369
|
+
* Separate from `sumErrorRel` because the two have opposite fixes: a
|
|
4370
|
+
* raised sum means the zones overlap and want redrawing, while this means
|
|
4371
|
+
* real volume is MISSING from the result. A caller must refuse the split
|
|
4372
|
+
* outright rather than publish the zone pieces alone.
|
|
4373
|
+
* @returns {boolean}
|
|
4374
|
+
*/
|
|
4375
|
+
get remainderFailed() {
|
|
4376
|
+
const ret = wasm.zonesplitjs_remainderFailed(this.__wbg_ptr);
|
|
4377
|
+
return ret !== 0;
|
|
4378
|
+
}
|
|
4379
|
+
/**
|
|
4380
|
+
* How far the pieces are from summing to the whole, relative.
|
|
4381
|
+
*
|
|
4382
|
+
* The invariant #2508 puts above everything else here. Exposed rather than
|
|
4383
|
+
* enforced: the caller decides what to do with a split that does not add
|
|
4384
|
+
* up (the expected cause is zones that overlap each other), and a number
|
|
4385
|
+
* it can show beats a silent refusal.
|
|
4386
|
+
* @returns {number}
|
|
4387
|
+
*/
|
|
4388
|
+
get sumErrorRel() {
|
|
4389
|
+
const ret = wasm.zonesplitjs_sumErrorRel(this.__wbg_ptr);
|
|
4390
|
+
return ret;
|
|
4391
|
+
}
|
|
4392
|
+
/**
|
|
4393
|
+
* Enclosed volume of the input element.
|
|
4394
|
+
* @returns {number}
|
|
4395
|
+
*/
|
|
4396
|
+
get wholeVolume() {
|
|
4397
|
+
const ret = wasm.zonesplitjs_wholeVolume(this.__wbg_ptr);
|
|
4398
|
+
return ret;
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
if (Symbol.dispose) ZoneSplitJs.prototype[Symbol.dispose] = ZoneSplitJs.prototype.free;
|
|
4402
|
+
|
|
4271
4403
|
/**
|
|
4272
4404
|
* `a - b`, keeping EVERY disjoint remnant.
|
|
4273
4405
|
*
|
|
@@ -4364,6 +4496,69 @@ export function resolve2d(a) {
|
|
|
4364
4496
|
return Contours2D.__wrap(ret);
|
|
4365
4497
|
}
|
|
4366
4498
|
|
|
4499
|
+
/**
|
|
4500
|
+
* Split a mesh into one closed solid per zone, plus the remainder.
|
|
4501
|
+
*
|
|
4502
|
+
* `positions` is flat XYZ (f64, caller's frame), `indices` flat triangle
|
|
4503
|
+
* indices. `zones` is flat, SEVEN numbers per zone:
|
|
4504
|
+
* `[cx, cy, cz, sx, sy, sz, rotationY]`, where the sizes are FULL extents
|
|
4505
|
+
* (matching the viewer's `Zone.size`) and the rotation is radians about the
|
|
4506
|
+
* vertical axis. A trailing partial zone is ignored rather than guessed at.
|
|
4507
|
+
*
|
|
4508
|
+
* A zone becomes a PRISM (#2508 item 4) when `footprint_counts[i]` is at
|
|
4509
|
+
* least 3: it then takes that many `[x, z]` pairs from `footprints`, in order,
|
|
4510
|
+
* and uses the 7-tuple only for its vertical extent (`cy +/- sy/2`). The
|
|
4511
|
+
* footprint must be CONVEX; the viewer gates that on import, because a concave
|
|
4512
|
+
* polygon fans into overlapping triangles and would cut wrong rather than
|
|
4513
|
+
* fail. A count of 1 or 2 is not a polygon: it still consumes its pairs, so
|
|
4514
|
+
* later zones stay aligned, and leaves that zone a box. Passing empty arrays
|
|
4515
|
+
* keeps every zone a box.
|
|
4516
|
+
*
|
|
4517
|
+
* The caller must have established that the mesh is a closed orientable solid
|
|
4518
|
+
* first, exactly as it must before quoting a volume at all (#1891/#1993): a
|
|
4519
|
+
* clip of an open shell produces pieces whose volumes are arbitrary rather
|
|
4520
|
+
* than approximate.
|
|
4521
|
+
*
|
|
4522
|
+
* A triangle with an out-of-range index or a non-finite coordinate is DROPPED
|
|
4523
|
+
* rather than reported, matching `kernel::mesh_bridge::mesh_to_tris`, which is
|
|
4524
|
+
* panic-free for the same reason: the alternative is a crash deep in the
|
|
4525
|
+
* predicates. It does mean a malformed caller can open the surface and get
|
|
4526
|
+
* meaningless volumes with a plausible `sumErrorRel`, so the closure proof
|
|
4527
|
+
* above is the caller's responsibility and not a formality.
|
|
4528
|
+
*
|
|
4529
|
+
* ```javascript
|
|
4530
|
+
* const split = splitMeshByZones(positions, indices, new Float64Array([
|
|
4531
|
+
* 0, 0, 0, 10, 10, 10, 0,
|
|
4532
|
+
* ]));
|
|
4533
|
+
* for (let i = 0; i < split.pieceCount; i++) {
|
|
4534
|
+
* const piece = split.piece(i);
|
|
4535
|
+
* // piece.zoneIndex, piece.positions, piece.indices, piece.volume
|
|
4536
|
+
* piece.free();
|
|
4537
|
+
* }
|
|
4538
|
+
* split.free();
|
|
4539
|
+
* ```
|
|
4540
|
+
* @param {Float64Array} positions
|
|
4541
|
+
* @param {Uint32Array} indices
|
|
4542
|
+
* @param {Float64Array} zones
|
|
4543
|
+
* @param {Float64Array | null} [footprints]
|
|
4544
|
+
* @param {Uint32Array | null} [footprint_counts]
|
|
4545
|
+
* @returns {ZoneSplitJs}
|
|
4546
|
+
*/
|
|
4547
|
+
export function splitMeshByZones(positions, indices, zones, footprints, footprint_counts) {
|
|
4548
|
+
const ptr0 = passArrayF64ToWasm0(positions, wasm.__wbindgen_export);
|
|
4549
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4550
|
+
const ptr1 = passArray32ToWasm0(indices, wasm.__wbindgen_export);
|
|
4551
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4552
|
+
const ptr2 = passArrayF64ToWasm0(zones, wasm.__wbindgen_export);
|
|
4553
|
+
const len2 = WASM_VECTOR_LEN;
|
|
4554
|
+
var ptr3 = isLikeNone(footprints) ? 0 : passArrayF64ToWasm0(footprints, wasm.__wbindgen_export);
|
|
4555
|
+
var len3 = WASM_VECTOR_LEN;
|
|
4556
|
+
var ptr4 = isLikeNone(footprint_counts) ? 0 : passArray32ToWasm0(footprint_counts, wasm.__wbindgen_export);
|
|
4557
|
+
var len4 = WASM_VECTOR_LEN;
|
|
4558
|
+
const ret = wasm.splitMeshByZones(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
4559
|
+
return ZoneSplitJs.__wrap(ret);
|
|
4560
|
+
}
|
|
4561
|
+
|
|
4367
4562
|
/**
|
|
4368
4563
|
* `a ∪ b`.
|
|
4369
4564
|
* @param {Contours2D} a
|
|
@@ -4421,6 +4616,10 @@ function __wbg_get_imports() {
|
|
|
4421
4616
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4422
4617
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4423
4618
|
},
|
|
4619
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
4620
|
+
const ret = getObject(arg0) === undefined;
|
|
4621
|
+
return ret;
|
|
4622
|
+
},
|
|
4424
4623
|
__wbg___wbindgen_memory_de265df8aadd6273: function() {
|
|
4425
4624
|
const ret = wasm.memory;
|
|
4426
4625
|
return addHeapObject(ret);
|
|
@@ -4535,6 +4734,22 @@ function __wbg_get_imports() {
|
|
|
4535
4734
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
4536
4735
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
4537
4736
|
},
|
|
4737
|
+
__wbg_static_accessor_GLOBAL_4ef717fb391d88b7: function() {
|
|
4738
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
4739
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4740
|
+
},
|
|
4741
|
+
__wbg_static_accessor_GLOBAL_THIS_8d1badc68b5a74f4: function() {
|
|
4742
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
4743
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4744
|
+
},
|
|
4745
|
+
__wbg_static_accessor_SELF_146583524fe1469b: function() {
|
|
4746
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
4747
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4748
|
+
},
|
|
4749
|
+
__wbg_static_accessor_WINDOW_f2829a2234d7819e: function() {
|
|
4750
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
4751
|
+
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
4752
|
+
},
|
|
4538
4753
|
__wbg_warn_b1370d804fa3e259: function(arg0) {
|
|
4539
4754
|
console.warn(getObject(arg0));
|
|
4540
4755
|
},
|
|
@@ -4624,6 +4839,12 @@ const SymbolicRepresentationCollectionFinalization = (typeof FinalizationRegistr
|
|
|
4624
4839
|
const SymbolicTextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4625
4840
|
? { register: () => {}, unregister: () => {} }
|
|
4626
4841
|
: new FinalizationRegistry(ptr => wasm.__wbg_symbolictext_free(ptr, 1));
|
|
4842
|
+
const ZonePieceJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4843
|
+
? { register: () => {}, unregister: () => {} }
|
|
4844
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zonepiecejs_free(ptr, 1));
|
|
4845
|
+
const ZoneSplitJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4846
|
+
? { register: () => {}, unregister: () => {} }
|
|
4847
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_zonesplitjs_free(ptr, 1));
|
|
4627
4848
|
|
|
4628
4849
|
function addHeapObject(obj) {
|
|
4629
4850
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|