okgeometry-api 1.1.9 → 1.1.11

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.
@@ -1 +1 @@
1
- {"version":3,"file":"wasm-base64.js","sourceRoot":"","sources":["../src/wasm-base64.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG,86lvDAA86lvD,CAAC"}
1
+ {"version":3,"file":"wasm-base64.js","sourceRoot":"","sources":["../src/wasm-base64.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG,0s3wDAA0s3wD,CAAC"}
@@ -1688,7 +1688,7 @@ export function version() {
1688
1688
  function __wbg_get_imports() {
1689
1689
  const import0 = {
1690
1690
  __proto__: null,
1691
- __wbg___okgeometry_boolean_should_cancel_27469066fb6e0c31: function () {
1691
+ __wbg___okgeometry_boolean_should_cancel_172c0bc0a108e762: function () {
1692
1692
  const ret = globalThis.__okgeometry_boolean_should_cancel();
1693
1693
  return ret;
1694
1694
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "okgeometry-api",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "Geometry engine API for AEC applications — NURBS, meshes, booleans, intersections. Powered by Rust/WASM.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -11,17 +11,17 @@
11
11
  "import": "./dist/index.js"
12
12
  }
13
13
  },
14
- "files": [
15
- "dist/",
16
- "src/"
17
- ],
18
- "scripts": {
19
- "build:wasm": "node -e \"require('fs').rmSync('wasm',{recursive:true,force:true})\" && cd .. && wasm-pack build --target web --out-dir okgeometry-api/wasm",
20
- "sync:wasm-bindings": "node scripts/sync-wasm-bindings.mjs",
21
- "inline-wasm": "tsx scripts/inline-wasm.ts",
22
- "build": "npm run build:wasm && npm run sync:wasm-bindings && npm run inline-wasm && tsc",
23
- "check:primitive-parity": "npm run build:wasm && npm run sync:wasm-bindings && tsx scripts/check-primitive-parity.ts",
24
- "bench:boolean-manifold-baseline": "npm run build && tsx scripts/bench-boolean-manifold-baseline.ts",
14
+ "files": [
15
+ "dist/",
16
+ "src/"
17
+ ],
18
+ "scripts": {
19
+ "build:wasm": "node -e \"require('fs').rmSync('wasm',{recursive:true,force:true})\" && cd .. && wasm-pack build --target web --out-dir okgeometry-api/wasm",
20
+ "sync:wasm-bindings": "node scripts/sync-wasm-bindings.mjs",
21
+ "inline-wasm": "tsx scripts/inline-wasm.ts",
22
+ "build": "npm run build:wasm && npm run sync:wasm-bindings && npm run inline-wasm && tsc",
23
+ "check:primitive-parity": "npm run build:wasm && npm run sync:wasm-bindings && tsx scripts/check-primitive-parity.ts",
24
+ "bench:boolean-manifold-baseline": "npm run build && tsx scripts/bench-boolean-manifold-baseline.ts",
25
25
  "bench:boolean-replacement-heavy": "npm run build && tsx scripts/bench-boolean-replacement-heavy.ts",
26
26
  "bench:boolean-deterministic": "npm run build && tsx scripts/bench-boolean-deterministic.ts",
27
27
  "bench:boolean-ab": "npm run build && tsx scripts/bench-boolean-ab.ts",
package/src/Mesh.ts CHANGED
@@ -630,84 +630,12 @@ export class Mesh {
630
630
  return payload;
631
631
  }
632
632
 
633
- private static logSubtractDebugSuccess(
634
- inputA: Mesh,
635
- inputB: Mesh,
636
- result: Mesh,
637
- options?: MeshBooleanOptions,
638
- ): void {
639
- try {
640
- const report = Mesh.createBooleanDebugReport(
641
- inputA,
642
- inputB,
643
- result,
644
- "subtraction",
645
- { maxRayHits: 2, probes: ["posX", "negX", "posY"] },
646
- );
647
- const probeSummary = report.probes.map((probe) => Mesh.summarizeDebugProbe(probe));
648
- console.log("[okgeometry-api] Mesh.subtract debug", {
649
- options: options ?? null,
650
- inputA: report.inputA,
651
- inputB: report.inputB,
652
- result: report.resultSummary,
653
- deltas: {
654
- faceCount: report.resultSummary.faceCount - report.inputA.faceCount,
655
- vertexCount: report.resultSummary.vertexCount - report.inputA.vertexCount,
656
- },
657
- probeSummary,
658
- report,
659
- });
660
- console.log("[okgeometry-api] Mesh.subtract summary", {
661
- inputAFaces: report.inputA.faceCount,
662
- inputBFaces: report.inputB.faceCount,
663
- resultFaces: report.resultSummary.faceCount,
664
- inputAVerts: report.inputA.vertexCount,
665
- inputBVerts: report.inputB.vertexCount,
666
- resultVerts: report.resultSummary.vertexCount,
667
- resultClosed: report.resultSummary.isClosedVolume,
668
- resultTopology: report.resultSummary.topology,
669
- });
670
- console.log("[okgeometry-api] Mesh.subtract probeSummary", probeSummary);
671
- } catch (debugError) {
672
- console.error("[okgeometry-api] Mesh.subtract debug logging failed", debugError);
673
- }
674
- }
675
-
676
- private static logSubtractDebugFailure(
677
- inputA: Mesh,
678
- inputB: Mesh,
679
- options: MeshBooleanOptions | undefined,
680
- error: unknown,
681
- ): void {
682
- try {
683
- const repro = Mesh.createBooleanReproPayload(
684
- inputA,
685
- inputB,
686
- "subtraction",
687
- options,
688
- undefined,
689
- undefined,
690
- error,
691
- );
692
- console.error("[okgeometry-api] Mesh.subtract failed", {
693
- options: options ?? null,
694
- inputA: inputA.debugSummary(),
695
- inputB: inputB.debugSummary(),
696
- error,
697
- });
698
- console.error("[okgeometry-api] Mesh.subtract repro", repro);
699
- console.error("[okgeometry-api] Mesh.subtract repro JSON", JSON.stringify(repro, null, 2));
700
- } catch (debugError) {
701
- console.error("[okgeometry-api] Mesh.subtract failure logging failed", debugError);
702
- }
633
+ private static cloneMesh(mesh: Mesh): Mesh {
634
+ return Mesh.fromBuffer(new Float64Array(mesh._buffer), {
635
+ trustedBooleanInput: mesh._trustedBooleanInput,
636
+ });
703
637
  }
704
638
 
705
- private static cloneMesh(mesh: Mesh): Mesh {
706
- return Mesh.fromBuffer(new Float64Array(mesh._buffer), {
707
- trustedBooleanInput: mesh._trustedBooleanInput,
708
- });
709
- }
710
-
711
639
  private static emptyMesh(): Mesh {
712
640
  return Mesh.fromTrustedBuffer(new Float64Array(0));
713
641
  }
@@ -1634,29 +1562,22 @@ export class Mesh {
1634
1562
  * @param options - Optional safety overrides
1635
1563
  * @returns New mesh with other's volume removed from this
1636
1564
  */
1637
- subtract(other: Mesh, options?: MeshBooleanOptions): Mesh {
1638
- ensureInit();
1639
- const operationToken = Mesh.encodeBooleanOperationToken("subtraction", this, other, options);
1640
- try {
1641
- const result = this.runBoolean(
1642
- other,
1643
- "subtraction",
1644
- () => wasm.mesh_boolean_operation(
1645
- this._vertexCount,
1646
- this._buffer,
1647
- other._vertexCount,
1648
- other._buffer,
1649
- operationToken,
1650
- ),
1651
- options,
1652
- );
1653
- Mesh.logSubtractDebugSuccess(this, other, result, options);
1654
- return result;
1655
- } catch (error) {
1656
- Mesh.logSubtractDebugFailure(this, other, options, error);
1657
- throw error;
1658
- }
1659
- }
1565
+ subtract(other: Mesh, options?: MeshBooleanOptions): Mesh {
1566
+ ensureInit();
1567
+ const operationToken = Mesh.encodeBooleanOperationToken("subtraction", this, other, options);
1568
+ return this.runBoolean(
1569
+ other,
1570
+ "subtraction",
1571
+ () => wasm.mesh_boolean_operation(
1572
+ this._vertexCount,
1573
+ this._buffer,
1574
+ other._vertexCount,
1575
+ other._buffer,
1576
+ operationToken,
1577
+ ),
1578
+ options,
1579
+ );
1580
+ }
1660
1581
 
1661
1582
  /**
1662
1583
  * Compute boolean intersection with another mesh.