brepjs 18.118.1 → 18.118.3

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.
Files changed (80) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{adjacencyFns-BCBxn5fI.cjs → adjacencyFns-COWMJ1OX.cjs} +2 -2
  4. package/dist/{adjacencyFns-B6LgGNt5.js → adjacencyFns-D026zKM3.js} +2 -2
  5. package/dist/{blueprint-Bf5G2J-D.cjs → blueprint-BWO1xOcp.cjs} +5 -5
  6. package/dist/{blueprint-C08UoSjN.js → blueprint-CWE241F5.js} +5 -5
  7. package/dist/{blueprintFns-D8UfbJ7P.js → blueprintFns-D5_7KAuL.js} +2 -2
  8. package/dist/{blueprintFns-DimPFaTL.cjs → blueprintFns-DXXKh9Ex.cjs} +2 -2
  9. package/dist/{blueprintSketcher-CCKCEADO.cjs → blueprintSketcher-DADskw3h.cjs} +3 -3
  10. package/dist/{blueprintSketcher-BYeTILZK.js → blueprintSketcher-JlCOsNp-.js} +3 -3
  11. package/dist/{boolean2D-CwiND6NG.js → boolean2D-B_JB01Pu.js} +4 -4
  12. package/dist/{boolean2D-BxU1RmyX.cjs → boolean2D-Dz2WQyK7.cjs} +4 -4
  13. package/dist/brepjs.cjs +25 -25
  14. package/dist/brepjs.js +25 -25
  15. package/dist/{cameraFns-zRSasMz9.cjs → cameraFns-BAm-2Clq.cjs} +2 -2
  16. package/dist/{cameraFns-CcPjRKGj.js → cameraFns-CRln-7RT.js} +2 -2
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.js +1 -1
  19. package/dist/{cornerFinder-AsmKTFPN.cjs → cornerFinder-DP74f1wh.cjs} +1 -1
  20. package/dist/{cornerFinder-DXsCe6hW.js → cornerFinder-oxZraULr.js} +1 -1
  21. package/dist/{curveFns-BxnvFB23.cjs → curveFns-CpaxYpa4.cjs} +1 -1
  22. package/dist/{curveFns-DwIe8GZy.js → curveFns-pGQFlJG-.js} +1 -1
  23. package/dist/{drawFns-BZEbW2zC.cjs → drawFns-BosHTxzi.cjs} +12 -12
  24. package/dist/{drawFns-CwyVApwp.js → drawFns-DKyAWSPe.js} +12 -12
  25. package/dist/{faceFns-TRIg5br4.js → faceFns-Bc6sBrBV.js} +2 -2
  26. package/dist/{faceFns-BLSzVAYl.cjs → faceFns-rbWcdpvj.cjs} +2 -2
  27. package/dist/{healingFns-B0LgUrq5.js → healingFns-CCsV3Ug-.js} +5 -5
  28. package/dist/{healingFns-R5ADfh-0.cjs → healingFns-DQquJMYs.cjs} +5 -5
  29. package/dist/{helpers-BnIUjlaU.js → helpers-BuHUd7_4.js} +6 -6
  30. package/dist/{helpers-COiTc4_Y.cjs → helpers-DlLQfATr.cjs} +6 -6
  31. package/dist/{importFns-lTAr_GsL.cjs → importFns-BRaiuN1y.cjs} +2 -2
  32. package/dist/{importFns-DhQLyPlO.js → importFns-Z6N8Addx.js} +2 -2
  33. package/dist/io.cjs +2 -2
  34. package/dist/io.js +2 -2
  35. package/dist/kernel/optionalBackend.d.ts +15 -0
  36. package/dist/kernel/types.d.ts +2 -4
  37. package/dist/{loftFns-DaTo1-RY.cjs → loftFns-BQktV4u4.cjs} +1 -1
  38. package/dist/{loftFns-BJZVDHc8.js → loftFns-CXc9tRv6.js} +1 -1
  39. package/dist/{measureFns-BYTMfzr_.js → measureFns-B_vJqwDc.js} +3 -3
  40. package/dist/{measureFns-BpsPuZB8.cjs → measureFns-I5KcAgSb.cjs} +3 -3
  41. package/dist/measurement.cjs +1 -1
  42. package/dist/measurement.js +1 -1
  43. package/dist/{meshFns-_1joEZ-4.cjs → meshFns-BGmOr5aJ.cjs} +3 -3
  44. package/dist/{meshFns-nqU2Movr.js → meshFns-DVrZtr-f.js} +3 -3
  45. package/dist/operations.cjs +2 -2
  46. package/dist/operations.js +2 -2
  47. package/dist/{primitiveFns-LPYKSZBG.js → primitiveFns-DiOCVk8q.js} +4 -4
  48. package/dist/{primitiveFns-BHnZEs_k.cjs → primitiveFns-ht0yFv6T.cjs} +4 -4
  49. package/dist/projection.cjs +1 -1
  50. package/dist/projection.js +1 -1
  51. package/dist/query.cjs +2 -2
  52. package/dist/query.js +2 -2
  53. package/dist/quick.js +7 -2
  54. package/dist/{refResolveFns-BccjAW94.js → refResolveFns-CEojVVeD.js} +5 -5
  55. package/dist/{refResolveFns-CJJka2Mh.cjs → refResolveFns-Dku4ocdG.cjs} +5 -5
  56. package/dist/{shapeFns-BrTfsWJn.cjs → shapeFns-B1OEuRBI.cjs} +65 -13
  57. package/dist/{shapeFns-DNSBgjUO.js → shapeFns-C2pdUzdd.js} +65 -13
  58. package/dist/shapeRef.cjs +1 -1
  59. package/dist/shapeRef.js +1 -1
  60. package/dist/{shapeTypes-BhYxXYb2.cjs → shapeTypes-BLREi6xB.cjs} +25 -12
  61. package/dist/{shapeTypes-CaEfw1Eg.js → shapeTypes-EI4Uxlsb.js} +25 -12
  62. package/dist/sketching.cjs +3 -3
  63. package/dist/sketching.js +3 -3
  64. package/dist/{solidBuilders-o9zolEOg.cjs → solidBuilders-BOMmoOg7.cjs} +5 -5
  65. package/dist/{solidBuilders-WzTJyb9Y.js → solidBuilders-BsAa59Dz.js} +5 -5
  66. package/dist/{surfaceBuilders-t14F6N55.cjs → surfaceBuilders-C-UhFlpS.cjs} +2 -2
  67. package/dist/{surfaceBuilders-DFwryByV.js → surfaceBuilders-C0pJwtCO.js} +2 -2
  68. package/dist/text.cjs +2 -2
  69. package/dist/text.js +2 -2
  70. package/dist/{textBlueprints-D4kbdi05.js → textBlueprints-DU1Jqvx9.js} +7 -7
  71. package/dist/{textBlueprints-DMDC2cTp.cjs → textBlueprints-bCq3ARXX.cjs} +7 -7
  72. package/dist/{textMetrics-DLvQucTf.js → textMetrics-BltT5ICq.js} +1 -1
  73. package/dist/{textMetrics-D2Ql48ch.cjs → textMetrics-wX3dlabq.cjs} +1 -1
  74. package/dist/{threadFns-D6b6Edd7.cjs → threadFns-BDdzaSTO.cjs} +7 -7
  75. package/dist/{threadFns-EkvfYJTh.js → threadFns-DluMGkMf.js} +7 -7
  76. package/dist/topology.cjs +9 -9
  77. package/dist/topology.js +9 -9
  78. package/dist/{topologyQueryFns-CgapZiGe.cjs → topologyQueryFns-1PqfeHrV.cjs} +1 -1
  79. package/dist/{topologyQueryFns-DCItb0s7.js → topologyQueryFns-BjgBf2t-.js} +1 -1
  80. package/package.json +6 -6
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-CgapZiGe.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
6
- const require_faceFns = require("./faceFns-BLSzVAYl.cjs");
7
- const require_shapeFns = require("./shapeFns-BrTfsWJn.cjs");
8
- const require_curveFns = require("./curveFns-BxnvFB23.cjs");
9
- const require_measureFns = require("./measureFns-BpsPuZB8.cjs");
6
+ const require_faceFns = require("./faceFns-rbWcdpvj.cjs");
7
+ const require_shapeFns = require("./shapeFns-B1OEuRBI.cjs");
8
+ const require_curveFns = require("./curveFns-CpaxYpa4.cjs");
9
+ const require_measureFns = require("./measureFns-I5KcAgSb.cjs");
10
10
  //#region src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,8 +1,8 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
5
- const require_blueprint = require("./blueprint-Bf5G2J-D.cjs");
5
+ const require_blueprint = require("./blueprint-BWO1xOcp.cjs");
6
6
  //#region src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
@@ -1,8 +1,8 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { n as wasmIndex, t as vec3At$1 } from "./vec3-Dpha8d5k.js";
3
3
  import { A as ok, b as err, r as ioError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
4
4
  import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
5
- import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-C08UoSjN.js";
5
+ import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-CWE241F5.js";
6
6
  //#region src/io/objExportFns.ts
7
7
  /** Read a vec3 from a typed array at the given vertex index. */
8
8
  function vec3At(arr, i) {
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-_1joEZ-4.cjs");
3
- const require_importFns = require("./importFns-lTAr_GsL.cjs");
2
+ const require_meshFns = require("./meshFns-BGmOr5aJ.cjs");
3
+ const require_importFns = require("./importFns-BRaiuN1y.cjs");
4
4
  exports.blueprintToDXF = require_importFns.blueprintToDXF;
5
5
  exports.exportDXF = require_importFns.exportDXF;
6
6
  exports.exportGlb = require_importFns.exportGlb;
package/dist/io.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-nqU2Movr.js";
2
- import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-DhQLyPlO.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-DVrZtr-f.js";
2
+ import { a as importSVG, c as blueprintToDXF, d as exportGltf, f as exportOBJ, i as exportSTEPConfigured, l as exportDXF, n as importSTEP, o as importSVGPathD, r as importSTL, s as exportThreeMF, t as importIGES, u as exportGlb } from "./importFns-Z6N8Addx.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Dynamically import an optional kernel backend (`occt-wasm`,
3
+ * `brepjs-opencascade`, `brepkit-wasm`) at runtime.
4
+ *
5
+ * The specifier is passed through a parameter so the `import()` argument is a
6
+ * variable, never a string literal. A computed dynamic import is unanalyzable
7
+ * to every bundler (esbuild dep pre-bundling, Rollup, Vite import-analysis), so
8
+ * an uninstalled optional peer is always left as a runtime import instead of
9
+ * hard-failing a build. A string literal guarded only by a `@vite-ignore`
10
+ * comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
11
+ * the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
12
+ * Vite's "cannot be analyzed" dev warning and its placement no longer affects
13
+ * correctness.
14
+ */
15
+ export declare function importOptionalBackend(specifier: string): Promise<unknown>;
@@ -49,10 +49,8 @@ export interface MeshOptions {
49
49
  /** Linear deflection tolerance for tessellation. */
50
50
  tolerance: number;
51
51
  /**
52
- * Angular deflection tolerance for tessellation.
53
- *
54
- * **Cross-kernel note**: brepkit only supports linear deflection; this
55
- * parameter is ignored (a one-time warning is emitted). OCCT honours both.
52
+ * Angular deflection tolerance for tessellation. Honoured by both the OCCT
53
+ * and brepkit kernels; a non-positive value falls back to the kernel default.
56
54
  */
57
55
  angularTolerance: number;
58
56
  skipNormals?: boolean;
@@ -1,4 +1,4 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  const require_types = require("./types-KjA8tY4Y.cjs");
4
4
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
@@ -1,4 +1,4 @@
1
- import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { A as ok, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
3
3
  import { r as toVec3 } from "./types-D24Y27N0.js";
4
4
  import { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
@@ -1,7 +1,7 @@
1
- import { Z as getKernel } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
- import { w as kernelCallRaw } from "./topologyQueryFns-DCItb0s7.js";
4
- import { m as uvBounds } from "./faceFns-TRIg5br4.js";
3
+ import { w as kernelCallRaw } from "./topologyQueryFns-BjgBf2t-.js";
4
+ import { m as uvBounds } from "./faceFns-Bc6sBrBV.js";
5
5
  //#region src/measurement/measureCache.ts
6
6
  var cache = /* @__PURE__ */ new WeakMap();
7
7
  function getCachedMeasurement(shape, key) {
@@ -1,7 +1,7 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-CgapZiGe.cjs");
4
- const require_faceFns = require("./faceFns-BLSzVAYl.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
4
+ const require_faceFns = require("./faceFns-rbWcdpvj.cjs");
5
5
  //#region src/measurement/measureCache.ts
6
6
  var cache = /* @__PURE__ */ new WeakMap();
7
7
  function getCachedMeasurement(shape, key) {
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_measureFns = require("./measureFns-BpsPuZB8.cjs");
2
+ const require_measureFns = require("./measureFns-I5KcAgSb.cjs");
3
3
  exports.createDistanceQuery = require_measureFns.createDistanceQuery;
4
4
  exports.measureArea = require_measureFns.measureArea;
5
5
  exports.measureDistance = require_measureFns.measureDistance;
@@ -1,2 +1,2 @@
1
- import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-BYTMfzr_.js";
1
+ import { a as measureDistance, c as measureLinearProps, d as measureVolumeProps, l as measureSurfaceProps, n as measureArea, o as measureDistanceProps, s as measureLength, t as createDistanceQuery, u as measureVolume } from "./measureFns-B_vJqwDc.js";
2
2
  export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
@@ -1,7 +1,7 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-CgapZiGe.cjs");
4
- const require_shapeFns = require("./shapeFns-BrTfsWJn.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
4
+ const require_shapeFns = require("./shapeFns-B1OEuRBI.cjs");
5
5
  //#region src/topology/meshCache.ts
6
6
  /**
7
7
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -1,7 +1,7 @@
1
- import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { A as ok, b as err, r as ioError } from "./errors-DNWJsfVU.js";
3
- import { d as getSolids, n as getBounds } from "./topologyQueryFns-DCItb0s7.js";
4
- import { j as getFaceOrigins } from "./shapeFns-DNSBgjUO.js";
3
+ import { d as getSolids, n as getBounds } from "./topologyQueryFns-BjgBf2t-.js";
4
+ import { j as getFaceOrigins } from "./shapeFns-C2pdUzdd.js";
5
5
  //#region src/topology/meshCache.ts
6
6
  /**
7
7
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_threadFns = require("./threadFns-D6b6Edd7.cjs");
3
- const require_loftFns = require("./loftFns-DaTo1-RY.cjs");
2
+ const require_threadFns = require("./threadFns-BDdzaSTO.cjs");
3
+ const require_loftFns = require("./loftFns-BQktV4u4.cjs");
4
4
  exports.addChild = require_threadFns.addChild;
5
5
  exports.addJoint = require_threadFns.addJoint;
6
6
  exports.addStep = require_threadFns.addStep;
@@ -1,3 +1,3 @@
1
- import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-EkvfYJTh.js";
2
- import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-BJZVDHc8.js";
1
+ import { A as setJointValue, B as createAssemblyNode, C as cylindricalJoint, D as planarJoint, E as mechanismDOF, G as circularPattern, H as removeChild, J as exportAssemblySTEP, K as gridPattern, L as addChild, M as sphericalJoint, O as prismaticJoint, R as collectShapes, S as addJoint, T as jointTransform, U as updateNode, V as findNode, W as walkAssembly, Y as createAssembly, _ as exportURDF, b as inverseKinematics, c as modifyStep, d as replayFrom, f as replayHistory, g as undoLast, h as stepsFrom, i as createRegistry, j as setJointValues, k as revoluteJoint, l as registerOperation, m as stepCount, n as addStep, o as findStep, q as linearPattern, r as createHistory, s as getShape, t as thread, u as registerShape, v as importURDF, w as forwardKinematics, x as jointTrajectory, y as jointsFromDH, z as countNodes } from "./threadFns-DluMGkMf.js";
2
+ import { d as twistExtrude, l as supportExtrude, o as complexExtrude, u as sweep } from "./loftFns-CXc9tRv6.js";
3
3
  export { addChild, addJoint, addStep, circularPattern, collectShapes, complexExtrude, countNodes, createAssembly, createAssemblyNode, createHistory, createRegistry, cylindricalJoint, exportAssemblySTEP, exportURDF, findNode, findStep, forwardKinematics, getShape as getHistoryShape, gridPattern, importURDF, inverseKinematics, jointTrajectory, jointTransform, jointsFromDH, linearPattern, mechanismDOF, modifyStep, planarJoint, prismaticJoint, registerOperation, registerShape, removeChild, replayFrom, replayHistory, revoluteJoint, setJointValue, setJointValues, sphericalJoint, stepCount, stepsFrom, supportExtrude, sweep, thread, twistExtrude, undoLast, updateNode, walkAssembly };
@@ -1,9 +1,9 @@
1
- import { Z as getKernel, c as createSolid, x as isClosedWire } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel, c as createSolid, x as isClosedWire } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { A as ok, b as err, d as validationError, v as andThen } from "./errors-DNWJsfVU.js";
3
3
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
4
- import { g as translate } from "./shapeFns-DNSBgjUO.js";
5
- import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-DFwryByV.js";
6
- import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-WzTJyb9Y.js";
4
+ import { g as translate } from "./shapeFns-C2pdUzdd.js";
5
+ import { _ as makeThreePointArc, a as makeNonPlanarFace, c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, g as makeTangentArc, h as makeLine, i as makeNewFaceWithinFace, m as makeHelix, o as makePolygon, p as makeEllipseArc, r as makeFace, s as assembleWire, t as addHolesInFace, u as makeBezierCurve } from "./surfaceBuilders-C0pJwtCO.js";
6
+ import { a as makeOffset, c as makeTorus, i as makeEllipsoid, l as makeVertex, n as makeCone, o as makeSolid, r as makeCylinder, s as makeSphere, t as makeCompound, u as weldShellsAndFaces } from "./solidBuilders-BsAa59Dz.js";
7
7
  //#region src/topology/primitiveFns.ts
8
8
  /**
9
9
  * Create a box with the given dimensions.
@@ -1,9 +1,9 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  const require_constants = require("./constants-BOVyEYGH.cjs");
4
- const require_shapeFns = require("./shapeFns-BrTfsWJn.cjs");
5
- const require_surfaceBuilders = require("./surfaceBuilders-t14F6N55.cjs");
6
- const require_solidBuilders = require("./solidBuilders-o9zolEOg.cjs");
4
+ const require_shapeFns = require("./shapeFns-B1OEuRBI.cjs");
5
+ const require_surfaceBuilders = require("./surfaceBuilders-C-UhFlpS.cjs");
6
+ const require_solidBuilders = require("./solidBuilders-BOMmoOg7.cjs");
7
7
  //#region src/topology/primitiveFns.ts
8
8
  /**
9
9
  * Create a box with the given dimensions.
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_cameraFns = require("./cameraFns-zRSasMz9.cjs");
2
+ const require_cameraFns = require("./cameraFns-BAm-2Clq.cjs");
3
3
  exports.PROJECTION_PLANES = require_cameraFns.PROJECTION_PLANES;
4
4
  exports.cameraFromPlane = require_cameraFns.cameraFromPlane;
5
5
  exports.cameraLookAt = require_cameraFns.cameraLookAt;
@@ -1,2 +1,2 @@
1
- import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CcPjRKGj.js";
1
+ import { a as makeProjectedEdges, i as projectEdges, n as cameraLookAt, o as PROJECTION_PLANES, r as createCamera, s as isProjectionPlane, t as cameraFromPlane } from "./cameraFns-CRln-7RT.js";
2
2
  export { PROJECTION_PLANES, cameraFromPlane, cameraLookAt, createCamera, isProjectionPlane, makeProjectedEdges, projectEdges };
package/dist/query.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_helpers = require("./helpers-COiTc4_Y.cjs");
3
- const require_cornerFinder = require("./cornerFinder-AsmKTFPN.cjs");
2
+ const require_helpers = require("./helpers-DlLQfATr.cjs");
3
+ const require_cornerFinder = require("./cornerFinder-DP74f1wh.cjs");
4
4
  exports.cornerFinder = require_cornerFinder.cornerFinder;
5
5
  exports.edgeFinder = require_helpers.edgeFinder;
6
6
  exports.faceFinder = require_helpers.faceFinder;
package/dist/query.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-BnIUjlaU.js";
2
- import { t as cornerFinder } from "./cornerFinder-DXsCe6hW.js";
1
+ import { n as edgeFinder, r as faceFinder, t as getSingleFace } from "./helpers-BuHUd7_4.js";
2
+ import { t as cornerFinder } from "./cornerFinder-oxZraULr.js";
3
3
  export { cornerFinder, edgeFinder, faceFinder, getSingleFace };
package/dist/quick.js CHANGED
@@ -1,12 +1,17 @@
1
1
  import { initFromOC, registerKernel, OcctWasmAdapter } from './brepjs.js';
2
2
  // occt-wasm first (the default kernel); fall back to brepjs-opencascade.
3
3
  // Dynamic imports so an install with only one of the two packages still loads.
4
+ // The specifier is passed through a variable so the import() argument is never a
5
+ // string literal: a computed dynamic import is unanalyzable to every bundler, so
6
+ // an uninstalled optional peer is left as a runtime import instead of breaking a
7
+ // consumer's Vite dep pre-bundling (#1726).
8
+ const importBackend = (specifier) => import(/* @vite-ignore */ specifier);
4
9
  try {
5
- const { OcctKernel } = await import('occt-wasm');
10
+ const { OcctKernel } = await importBackend('occt-wasm');
6
11
  const kernel = await OcctKernel.init();
7
12
  registerKernel('occt-wasm', OcctWasmAdapter.fromKernel(kernel));
8
13
  } catch {
9
- const { default: opencascade } = await import('brepjs-opencascade');
14
+ const { default: opencascade } = await importBackend('brepjs-opencascade');
10
15
  const oc = await opencascade();
11
16
  initFromOC(oc);
12
17
  }
@@ -1,8 +1,8 @@
1
- import { S as vertexPosition, c as getFaces } from "./topologyQueryFns-DCItb0s7.js";
2
- import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-TRIg5br4.js";
3
- import { n as getHashCode } from "./shapeFns-DNSBgjUO.js";
4
- import { n as measureArea, s as measureLength } from "./measureFns-BYTMfzr_.js";
5
- import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-B6LgGNt5.js";
1
+ import { S as vertexPosition, c as getFaces } from "./topologyQueryFns-BjgBf2t-.js";
2
+ import { i as faceGeomType, l as normalAt, r as faceCenter } from "./faceFns-Bc6sBrBV.js";
3
+ import { n as getHashCode } from "./shapeFns-C2pdUzdd.js";
4
+ import { n as measureArea, s as measureLength } from "./measureFns-B_vJqwDc.js";
5
+ import { a as sharedEdges, i as facesOfVertex, o as verticesOfEdge, r as facesOfEdge, s as verticesOfFace, t as adjacentFaces } from "./adjacencyFns-D026zKM3.js";
6
6
  //#region src/topology/shapeRef/scoring.ts
7
7
  /**
8
8
  * Default face scorer combining surface type, normal alignment, centroid proximity,
@@ -1,8 +1,8 @@
1
- const require_topologyQueryFns = require("./topologyQueryFns-CgapZiGe.cjs");
2
- const require_faceFns = require("./faceFns-BLSzVAYl.cjs");
3
- const require_shapeFns = require("./shapeFns-BrTfsWJn.cjs");
4
- const require_measureFns = require("./measureFns-BpsPuZB8.cjs");
5
- const require_adjacencyFns = require("./adjacencyFns-BCBxn5fI.cjs");
1
+ const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
2
+ const require_faceFns = require("./faceFns-rbWcdpvj.cjs");
3
+ const require_shapeFns = require("./shapeFns-B1OEuRBI.cjs");
4
+ const require_measureFns = require("./measureFns-I5KcAgSb.cjs");
5
+ const require_adjacencyFns = require("./adjacencyFns-COWMJ1OX.cjs");
6
6
  //#region src/topology/shapeRef/scoring.ts
7
7
  /**
8
8
  * Default face scorer combining surface type, normal alignment, centroid proximity,
@@ -1,6 +1,6 @@
1
- const require_shapeTypes = require("./shapeTypes-BhYxXYb2.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-BLREi6xB.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-CgapZiGe.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-1PqfeHrV.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  //#region src/topology/metadata/originTrackingFns.ts
6
6
  /**
@@ -51,13 +51,44 @@ function propagateOriginsFromEvolution(evolution, inputs, result) {
51
51
  cache.faceOrigins = resultMap;
52
52
  }
53
53
  }
54
+ /** Max 3D centroid separation (mm²) for a "near" match — the general case. */
55
+ var MAX_MATCH_DIST_SQ = 100;
56
+ /** Min |outNormal·inNormal| for two faces to count as sharing a plane's orientation. */
57
+ var COPLANAR_NORMAL_MIN = .985;
58
+ /**
59
+ * Max squared perpendicular offset (mm²) from an input face's plane for the
60
+ * output face to count as *coplanar* with it — i.e. a piece the boolean sliced
61
+ * off that same planar surface. 0.1mm² tolerates kernel/mesh float noise while
62
+ * still separating floors that sit even a fraction of a mm apart in depth.
63
+ */
64
+ var COPLANAR_OFFSET_SQ = .1;
54
65
  /**
55
66
  * Find the best origin match for a result face by comparing normals and centroids
56
67
  * against input face signatures. Returns `undefined` if no good match exists.
68
+ *
69
+ * Two passes, near strictly preferred:
70
+ * 1. Near match — same-facing normal (signed dot ≥ 0.707) and centroids within
71
+ * {@link MAX_MATCH_DIST_SQ}. The general case for regenerated seam faces
72
+ * (feature tops, flush walls). Unchanged legacy behavior. If any near match
73
+ * exists it wins outright — the coplanar pass never runs — so a distant
74
+ * coplanar candidate can't outscore a valid near one.
75
+ * 2. Coplanar match (only when no near match, and only between PLANAR faces) —
76
+ * the output face lies on an input face's plane (parallel *or* antiparallel
77
+ * normal, tiny perpendicular offset) regardless of how far its centroid
78
+ * drifted in-plane. Two cases pass 1 misses:
79
+ * • A boolean that splits a large planar face — a wide cutout floor sliced
80
+ * by an overlapping deeper cutout — leaves pieces >10mm from the parent
81
+ * centroid (past pass 1's cutoff).
82
+ * • A cut flips the cavity face's normal versus the tool face it came from,
83
+ * so the floor is antiparallel to its origin's input face.
84
+ * Both left the surface tagless → body color in multi-color consumers
85
+ * (gridfinity GH #2443). The planar gate keeps a curved output face from
86
+ * inheriting an origin off an unrelated face that merely shares a sampled
87
+ * tangent plane; among coplanar candidates the nearest in-plane wins.
57
88
  */
58
- function findBestOriginMatch(outNormal, outCentroid, inputSigs) {
59
- let bestScore = -Infinity;
60
- let bestOrigin;
89
+ function findBestOriginMatch(outNormal, outCentroid, outPlanar, inputSigs) {
90
+ let bestNearScore = -Infinity;
91
+ let bestNear;
61
92
  for (const inp of inputSigs) {
62
93
  const dot = outNormal[0] * inp.normal[0] + outNormal[1] * inp.normal[1] + outNormal[2] * inp.normal[2];
63
94
  if (dot < .707) continue;
@@ -65,14 +96,33 @@ function findBestOriginMatch(outNormal, outCentroid, inputSigs) {
65
96
  const dy = outCentroid[1] - inp.centroid[1];
66
97
  const dz = outCentroid[2] - inp.centroid[2];
67
98
  const distSq = dx * dx + dy * dy + dz * dz;
68
- if (distSq > 100) continue;
69
- const score = dot - distSq / 100;
70
- if (score > bestScore) {
71
- bestScore = score;
72
- bestOrigin = inp.origin;
99
+ if (distSq > MAX_MATCH_DIST_SQ) continue;
100
+ const score = dot - distSq / MAX_MATCH_DIST_SQ;
101
+ if (score > bestNearScore) {
102
+ bestNearScore = score;
103
+ bestNear = inp.origin;
104
+ }
105
+ }
106
+ if (bestNear !== void 0) return bestNear;
107
+ if (!outPlanar) return void 0;
108
+ let bestInPlaneSq = Infinity;
109
+ let bestCoplanar;
110
+ for (const inp of inputSigs) {
111
+ if (!inp.planar) continue;
112
+ const dot = outNormal[0] * inp.normal[0] + outNormal[1] * inp.normal[1] + outNormal[2] * inp.normal[2];
113
+ if (Math.abs(dot) < COPLANAR_NORMAL_MIN) continue;
114
+ const dx = outCentroid[0] - inp.centroid[0];
115
+ const dy = outCentroid[1] - inp.centroid[1];
116
+ const dz = outCentroid[2] - inp.centroid[2];
117
+ const perp = dx * inp.normal[0] + dy * inp.normal[1] + dz * inp.normal[2];
118
+ if (perp * perp > COPLANAR_OFFSET_SQ) continue;
119
+ const inPlaneSq = Math.max(0, dx * dx + dy * dy + dz * dz - perp * perp);
120
+ if (inPlaneSq < bestInPlaneSq) {
121
+ bestInPlaneSq = inPlaneSq;
122
+ bestCoplanar = inp.origin;
73
123
  }
74
124
  }
75
- return bestOrigin;
125
+ return bestCoplanar;
76
126
  }
77
127
  /**
78
128
  * Fallback origin propagation when no kernel op object is available
@@ -126,10 +176,12 @@ function propagateOriginsByHash(inputs, result) {
126
176
  const bounds = kernel.uvBounds(f.wrapped);
127
177
  const normal = kernel.surfaceNormal(f.wrapped, .5 * (bounds.uMin + bounds.uMax), .5 * (bounds.vMin + bounds.vMax));
128
178
  const centroid = kernel.surfaceCenterOfMass(f.wrapped);
179
+ const planar = kernel.surfaceType(f.wrapped) === "plane";
129
180
  inputSigs.push({
130
181
  origin,
131
182
  normal,
132
- centroid
183
+ centroid,
184
+ planar
133
185
  });
134
186
  } catch {}
135
187
  }
@@ -138,7 +190,7 @@ function propagateOriginsByHash(inputs, result) {
138
190
  const hash = kernel.hashCode(f.wrapped, require_constants.HASH_CODE_MAX);
139
191
  try {
140
192
  const outBounds = kernel.uvBounds(f.wrapped);
141
- const bestOrigin = findBestOriginMatch(kernel.surfaceNormal(f.wrapped, .5 * (outBounds.uMin + outBounds.uMax), .5 * (outBounds.vMin + outBounds.vMax)), kernel.surfaceCenterOfMass(f.wrapped), inputSigs);
193
+ const bestOrigin = findBestOriginMatch(kernel.surfaceNormal(f.wrapped, .5 * (outBounds.uMin + outBounds.uMax), .5 * (outBounds.vMin + outBounds.vMax)), kernel.surfaceCenterOfMass(f.wrapped), kernel.surfaceType(f.wrapped) === "plane", inputSigs);
142
194
  if (bestOrigin !== void 0) resultMap.set(hash, bestOrigin);
143
195
  } catch {}
144
196
  }
@@ -1,6 +1,6 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-CaEfw1Eg.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-EI4Uxlsb.js";
2
2
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
3
- import { C as kernelCall, c as getFaces, l as getOrCreateCache, r as getCacheEntry, w as kernelCallRaw } from "./topologyQueryFns-DCItb0s7.js";
3
+ import { C as kernelCall, c as getFaces, l as getOrCreateCache, r as getCacheEntry, w as kernelCallRaw } from "./topologyQueryFns-BjgBf2t-.js";
4
4
  import { n as HASH_CODE_MAX, t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  //#region src/topology/metadata/originTrackingFns.ts
6
6
  /**
@@ -51,13 +51,44 @@ function propagateOriginsFromEvolution(evolution, inputs, result) {
51
51
  cache.faceOrigins = resultMap;
52
52
  }
53
53
  }
54
+ /** Max 3D centroid separation (mm²) for a "near" match — the general case. */
55
+ var MAX_MATCH_DIST_SQ = 100;
56
+ /** Min |outNormal·inNormal| for two faces to count as sharing a plane's orientation. */
57
+ var COPLANAR_NORMAL_MIN = .985;
58
+ /**
59
+ * Max squared perpendicular offset (mm²) from an input face's plane for the
60
+ * output face to count as *coplanar* with it — i.e. a piece the boolean sliced
61
+ * off that same planar surface. 0.1mm² tolerates kernel/mesh float noise while
62
+ * still separating floors that sit even a fraction of a mm apart in depth.
63
+ */
64
+ var COPLANAR_OFFSET_SQ = .1;
54
65
  /**
55
66
  * Find the best origin match for a result face by comparing normals and centroids
56
67
  * against input face signatures. Returns `undefined` if no good match exists.
68
+ *
69
+ * Two passes, near strictly preferred:
70
+ * 1. Near match — same-facing normal (signed dot ≥ 0.707) and centroids within
71
+ * {@link MAX_MATCH_DIST_SQ}. The general case for regenerated seam faces
72
+ * (feature tops, flush walls). Unchanged legacy behavior. If any near match
73
+ * exists it wins outright — the coplanar pass never runs — so a distant
74
+ * coplanar candidate can't outscore a valid near one.
75
+ * 2. Coplanar match (only when no near match, and only between PLANAR faces) —
76
+ * the output face lies on an input face's plane (parallel *or* antiparallel
77
+ * normal, tiny perpendicular offset) regardless of how far its centroid
78
+ * drifted in-plane. Two cases pass 1 misses:
79
+ * • A boolean that splits a large planar face — a wide cutout floor sliced
80
+ * by an overlapping deeper cutout — leaves pieces >10mm from the parent
81
+ * centroid (past pass 1's cutoff).
82
+ * • A cut flips the cavity face's normal versus the tool face it came from,
83
+ * so the floor is antiparallel to its origin's input face.
84
+ * Both left the surface tagless → body color in multi-color consumers
85
+ * (gridfinity GH #2443). The planar gate keeps a curved output face from
86
+ * inheriting an origin off an unrelated face that merely shares a sampled
87
+ * tangent plane; among coplanar candidates the nearest in-plane wins.
57
88
  */
58
- function findBestOriginMatch(outNormal, outCentroid, inputSigs) {
59
- let bestScore = -Infinity;
60
- let bestOrigin;
89
+ function findBestOriginMatch(outNormal, outCentroid, outPlanar, inputSigs) {
90
+ let bestNearScore = -Infinity;
91
+ let bestNear;
61
92
  for (const inp of inputSigs) {
62
93
  const dot = outNormal[0] * inp.normal[0] + outNormal[1] * inp.normal[1] + outNormal[2] * inp.normal[2];
63
94
  if (dot < .707) continue;
@@ -65,14 +96,33 @@ function findBestOriginMatch(outNormal, outCentroid, inputSigs) {
65
96
  const dy = outCentroid[1] - inp.centroid[1];
66
97
  const dz = outCentroid[2] - inp.centroid[2];
67
98
  const distSq = dx * dx + dy * dy + dz * dz;
68
- if (distSq > 100) continue;
69
- const score = dot - distSq / 100;
70
- if (score > bestScore) {
71
- bestScore = score;
72
- bestOrigin = inp.origin;
99
+ if (distSq > MAX_MATCH_DIST_SQ) continue;
100
+ const score = dot - distSq / MAX_MATCH_DIST_SQ;
101
+ if (score > bestNearScore) {
102
+ bestNearScore = score;
103
+ bestNear = inp.origin;
104
+ }
105
+ }
106
+ if (bestNear !== void 0) return bestNear;
107
+ if (!outPlanar) return void 0;
108
+ let bestInPlaneSq = Infinity;
109
+ let bestCoplanar;
110
+ for (const inp of inputSigs) {
111
+ if (!inp.planar) continue;
112
+ const dot = outNormal[0] * inp.normal[0] + outNormal[1] * inp.normal[1] + outNormal[2] * inp.normal[2];
113
+ if (Math.abs(dot) < COPLANAR_NORMAL_MIN) continue;
114
+ const dx = outCentroid[0] - inp.centroid[0];
115
+ const dy = outCentroid[1] - inp.centroid[1];
116
+ const dz = outCentroid[2] - inp.centroid[2];
117
+ const perp = dx * inp.normal[0] + dy * inp.normal[1] + dz * inp.normal[2];
118
+ if (perp * perp > COPLANAR_OFFSET_SQ) continue;
119
+ const inPlaneSq = Math.max(0, dx * dx + dy * dy + dz * dz - perp * perp);
120
+ if (inPlaneSq < bestInPlaneSq) {
121
+ bestInPlaneSq = inPlaneSq;
122
+ bestCoplanar = inp.origin;
73
123
  }
74
124
  }
75
- return bestOrigin;
125
+ return bestCoplanar;
76
126
  }
77
127
  /**
78
128
  * Fallback origin propagation when no kernel op object is available
@@ -126,10 +176,12 @@ function propagateOriginsByHash(inputs, result) {
126
176
  const bounds = kernel.uvBounds(f.wrapped);
127
177
  const normal = kernel.surfaceNormal(f.wrapped, .5 * (bounds.uMin + bounds.uMax), .5 * (bounds.vMin + bounds.vMax));
128
178
  const centroid = kernel.surfaceCenterOfMass(f.wrapped);
179
+ const planar = kernel.surfaceType(f.wrapped) === "plane";
129
180
  inputSigs.push({
130
181
  origin,
131
182
  normal,
132
- centroid
183
+ centroid,
184
+ planar
133
185
  });
134
186
  } catch {}
135
187
  }
@@ -138,7 +190,7 @@ function propagateOriginsByHash(inputs, result) {
138
190
  const hash = kernel.hashCode(f.wrapped, HASH_CODE_MAX);
139
191
  try {
140
192
  const outBounds = kernel.uvBounds(f.wrapped);
141
- const bestOrigin = findBestOriginMatch(kernel.surfaceNormal(f.wrapped, .5 * (outBounds.uMin + outBounds.uMax), .5 * (outBounds.vMin + outBounds.vMax)), kernel.surfaceCenterOfMass(f.wrapped), inputSigs);
193
+ const bestOrigin = findBestOriginMatch(kernel.surfaceNormal(f.wrapped, .5 * (outBounds.uMin + outBounds.uMax), .5 * (outBounds.vMin + outBounds.vMax)), kernel.surfaceCenterOfMass(f.wrapped), kernel.surfaceType(f.wrapped) === "plane", inputSigs);
142
194
  if (bestOrigin !== void 0) resultMap.set(hash, bestOrigin);
143
195
  } catch {}
144
196
  }
package/dist/shapeRef.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_refResolveFns = require("./refResolveFns-CJJka2Mh.cjs");
2
+ const require_refResolveFns = require("./refResolveFns-Dku4ocdG.cjs");
3
3
  exports.assignRoles = require_refResolveFns.assignRoles;
4
4
  exports.captureHint = require_refResolveFns.captureHint;
5
5
  exports.createDerivedFaceRef = require_refResolveFns.createDerivedFaceRef;
package/dist/shapeRef.js CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-BccjAW94.js";
1
+ import { _ as createRef, a as isVertexRef, b as defaultScorer, c as resolveRefParams, d as createVertexRef, f as resolveVertexRef, g as captureHint, h as assignRoles, i as isLineageRef, l as createDerivedFaceRef, m as resolveEdgeRef, n as isEdgeRef, o as resolveLineageRef, p as createEdgeRef, r as isFaceRef, s as resolveRefIn, t as isDerivedFaceRef, u as resolveDerivedFaceRef, v as resolveRef, y as updateRoles } from "./refResolveFns-CEojVVeD.js";
2
2
  export { assignRoles, captureHint, createDerivedFaceRef, createEdgeRef, createRef, createVertexRef, defaultScorer, isDerivedFaceRef, isEdgeRef, isFaceRef, isLineageRef, isVertexRef, resolveDerivedFaceRef, resolveEdgeRef, resolveLineageRef, resolveRef, resolveRefIn, resolveRefParams, resolveVertexRef, updateRoles };
@@ -15298,6 +15298,28 @@ var ManifoldAdapter = class {
15298
15298
  }
15299
15299
  };
15300
15300
  //#endregion
15301
+ //#region src/kernel/optionalBackend.ts
15302
+ /**
15303
+ * Dynamically import an optional kernel backend (`occt-wasm`,
15304
+ * `brepjs-opencascade`, `brepkit-wasm`) at runtime.
15305
+ *
15306
+ * The specifier is passed through a parameter so the `import()` argument is a
15307
+ * variable, never a string literal. A computed dynamic import is unanalyzable
15308
+ * to every bundler (esbuild dep pre-bundling, Rollup, Vite import-analysis), so
15309
+ * an uninstalled optional peer is always left as a runtime import instead of
15310
+ * hard-failing a build. A string literal guarded only by a `@vite-ignore`
15311
+ * comment regresses the moment a consumer's Vite pre-bundles brepjs and reflows
15312
+ * the comment off the specifier (#1726); the `@vite-ignore` here only suppresses
15313
+ * Vite's "cannot be analyzed" dev warning and its placement no longer affects
15314
+ * correctness.
15315
+ */
15316
+ function importOptionalBackend(specifier) {
15317
+ return import(
15318
+ /* @vite-ignore */
15319
+ specifier
15320
+ );
15321
+ }
15322
+ //#endregion
15301
15323
  //#region src/kernel/types.ts
15302
15324
  /** Check if the kernel supports hidden-line-removal projection. */
15303
15325
  function supportsProjection(kernel) {
@@ -15480,26 +15502,17 @@ function prewarm() {
15480
15502
  async function init() {
15481
15503
  if (_defaultKernelId) return _defaultKernelId;
15482
15504
  try {
15483
- const { OcctKernel } = await import(
15484
- /* @vite-ignore */
15485
- "occt-wasm"
15486
- );
15505
+ const { OcctKernel } = await importOptionalBackend("occt-wasm");
15487
15506
  const kernel = await OcctKernel.init();
15488
15507
  registerKernel("occt-wasm", require_occtWasmAdapter.OcctWasmAdapter.fromKernel(kernel));
15489
15508
  return "occt-wasm";
15490
15509
  } catch {}
15491
15510
  try {
15492
- initFromOC(await (await import(
15493
- /* @vite-ignore */
15494
- "brepjs-opencascade"
15495
- )).default());
15511
+ initFromOC(await (await importOptionalBackend("brepjs-opencascade")).default());
15496
15512
  return "occt";
15497
15513
  } catch {}
15498
15514
  try {
15499
- const bk = await import(
15500
- /* @vite-ignore */
15501
- "brepkit-wasm"
15502
- );
15515
+ const bk = await importOptionalBackend("brepkit-wasm");
15503
15516
  if (typeof bk.default === "function") await bk.default();
15504
15517
  registerKernel("brepkit", new BrepkitAdapter(new bk.BrepKernel()));
15505
15518
  return "brepkit";