brepjs 18.69.3 → 18.70.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.
Files changed (89) hide show
  1. package/dist/2d.cjs +6 -6
  2. package/dist/2d.js +6 -6
  3. package/dist/{blueprint-DIQeD9xj.cjs → blueprint-jlSsZ0sZ.cjs} +5 -5
  4. package/dist/{blueprint-Dgl9IkCV.js → blueprint-qVw9ZkE4.js} +5 -5
  5. package/dist/{blueprintFns-BO44cqFY.cjs → blueprintFns-DsuY7gCu.cjs} +2 -2
  6. package/dist/{blueprintFns-sKzHcJ4U.js → blueprintFns-zLwbytjs.js} +2 -2
  7. package/dist/{blueprintSketcher-DbINWerx.js → blueprintSketcher-BRKbVgE2.js} +3 -3
  8. package/dist/{blueprintSketcher-BpOknLmX.cjs → blueprintSketcher-dZZ8e5ey.cjs} +3 -3
  9. package/dist/{boolean2D-DZcOTOSA.cjs → boolean2D-4E1kbwQx.cjs} +4 -4
  10. package/dist/{boolean2D-CreNaKXt.js → boolean2D-CANP43pN.js} +4 -4
  11. package/dist/{booleanFns-DvXg6a2Y.cjs → booleanFns-Bp_wYEwG.cjs} +4 -4
  12. package/dist/{booleanFns-0jDBFjAv.js → booleanFns-DYSaupiG.js} +4 -4
  13. package/dist/brepjs.cjs +239 -65
  14. package/dist/brepjs.js +241 -68
  15. package/dist/{cameraFns-Bwxq0IDz.js → cameraFns-BFRGMXSn.js} +2 -2
  16. package/dist/{cameraFns-CsGSVYgb.cjs → cameraFns-dRK1CnFi.cjs} +2 -2
  17. package/dist/core.cjs +1 -1
  18. package/dist/core.js +1 -1
  19. package/dist/{cornerFinder-ChltJ_ur.cjs → cornerFinder-CQPXY8Aw.cjs} +1 -1
  20. package/dist/{cornerFinder-fMf9-El_.js → cornerFinder-DcHCKoUh.js} +1 -1
  21. package/dist/{curveFns-BhTtS18d.js → curveFns-CXhOkKR4.js} +1 -1
  22. package/dist/{curveFns-CXytEfTr.cjs → curveFns-uPVW6eo-.cjs} +1 -1
  23. package/dist/{drawFns-Bzr38vZx.js → drawFns-ZqWpAG8b.js} +12 -12
  24. package/dist/{drawFns-Bn4vzbUr.cjs → drawFns-eMU4H__w.cjs} +12 -12
  25. package/dist/{extrudeFns-rnUgev_g.js → extrudeFns-CSy2C7WW.js} +1 -1
  26. package/dist/{extrudeFns-C0FsOXev.cjs → extrudeFns-CzQans6p.cjs} +1 -1
  27. package/dist/{faceFns-Dreo5ksY.js → faceFns-BBcrvY7r.js} +11 -3
  28. package/dist/{faceFns-FAZgMVCx.cjs → faceFns-CcLFCtg4.cjs} +16 -2
  29. package/dist/{helpers-D8ycrNeD.cjs → helpers-BmY5kO0w.cjs} +6 -6
  30. package/dist/{helpers--BMa_zB7.js → helpers-CxT3j8jG.js} +6 -6
  31. package/dist/{historyFns-mnmeZ0kB.cjs → historyFns-BEB2Yjld.cjs} +4 -4
  32. package/dist/{historyFns-CR0RejKJ.js → historyFns-ClLT60_V.js} +4 -4
  33. package/dist/{importFns-DRPQExAD.js → importFns-BNDWuBuq.js} +2 -2
  34. package/dist/{importFns-4mi5Ih46.cjs → importFns-DA0Klh7_.cjs} +2 -2
  35. package/dist/index.d.ts +1 -1
  36. package/dist/io.cjs +2 -2
  37. package/dist/io.js +2 -2
  38. package/dist/kernel/brepkit/geometryOps.d.ts +1 -0
  39. package/dist/kernel/interfaces/surfaceOps.d.ts +9 -0
  40. package/dist/kernel/occt/geometryQueryOps.d.ts +9 -0
  41. package/dist/kernel/occtWasm/occtWasmAdapter.cjs +1 -1
  42. package/dist/kernel/occtWasm/occtWasmAdapter.d.ts +4 -0
  43. package/dist/kernel/occtWasm/occtWasmAdapter.js +1 -1
  44. package/dist/kernel/occtWasm/surfaceOps.d.ts +17 -0
  45. package/dist/kernel/solverAdapter.d.ts +8 -7
  46. package/dist/{measureFns-BLEx4ZU3.js → measureFns-DAP8LjBB.js} +3 -3
  47. package/dist/{measureFns-CT0XaSOt.cjs → measureFns-zGABZl6o.cjs} +3 -3
  48. package/dist/measurement.cjs +1 -1
  49. package/dist/measurement.js +1 -1
  50. package/dist/{meshFns-lwgHYQ79.cjs → meshFns-CEGnFm33.cjs} +3 -3
  51. package/dist/{meshFns-B3MjIqk1.js → meshFns-D-nLiHvU.js} +3 -3
  52. package/dist/{occtWasmAdapter-BH7r2nTq.cjs → occtWasmAdapter-Crs07qIe.cjs} +67 -0
  53. package/dist/{occtWasmAdapter-C7FDeTaw.js → occtWasmAdapter-D0MtWZYO.js} +67 -0
  54. package/dist/operations.cjs +2 -2
  55. package/dist/operations.js +2 -2
  56. package/dist/{primitiveFns-DcZDTQ_R.js → primitiveFns-CDbe5gjc.js} +7 -7
  57. package/dist/{primitiveFns-DZmgvzvk.cjs → primitiveFns-CpkG8ZkI.cjs} +7 -7
  58. package/dist/projection.cjs +1 -1
  59. package/dist/projection.js +1 -1
  60. package/dist/query.cjs +2 -2
  61. package/dist/query.js +2 -2
  62. package/dist/{shapeFns-w1YoIn_p.cjs → shapeFns-CDHya-nt.cjs} +2 -2
  63. package/dist/{shapeFns-BnkizFjV.js → shapeFns-DVUNOG2I.js} +2 -2
  64. package/dist/shapeRef.cjs +1 -1
  65. package/dist/shapeRef.js +1 -1
  66. package/dist/{shapeRefFns-B3myHs0D.cjs → shapeRefFns-B1Tygk9V.cjs} +4 -4
  67. package/dist/{shapeRefFns-OVWdFOAC.js → shapeRefFns-CAJUDLTi.js} +4 -4
  68. package/dist/{shapeTypes-yCQ8z5Hc.js → shapeTypes-2cKwu2z4.js} +35 -1
  69. package/dist/{shapeTypes-BIlZar9m.cjs → shapeTypes-DRxArFIc.cjs} +35 -1
  70. package/dist/sketching.cjs +3 -3
  71. package/dist/sketching.js +3 -3
  72. package/dist/{solidBuilders-CPOTKI5i.js → solidBuilders-Bx3UdW91.js} +2 -2
  73. package/dist/{solidBuilders-dNhToZgl.cjs → solidBuilders-ibLq_9EK.cjs} +2 -2
  74. package/dist/{surfaceBuilders-CS1QccDv.js → surfaceBuilders-BtNrSolT.js} +2 -2
  75. package/dist/{surfaceBuilders-CzHPZtd3.cjs → surfaceBuilders-D2PBBoja.cjs} +2 -2
  76. package/dist/text.cjs +2 -2
  77. package/dist/text.js +2 -2
  78. package/dist/{textBlueprints-TG6AH06v.cjs → textBlueprints-COG8m1aE.cjs} +7 -7
  79. package/dist/{textBlueprints-B57ej88L.js → textBlueprints-HfRD4iNF.js} +7 -7
  80. package/dist/{textMetrics-Dag-YREs.cjs → textMetrics-CTSpUXtk.cjs} +1 -1
  81. package/dist/{textMetrics-BxtB3sjj.js → textMetrics-Zp8rzokO.js} +1 -1
  82. package/dist/topology/faceFns.d.ts +9 -0
  83. package/dist/topology/index.d.ts +1 -1
  84. package/dist/topology.cjs +8 -7
  85. package/dist/topology.d.ts +1 -1
  86. package/dist/topology.js +8 -8
  87. package/dist/{topologyQueryFns-BuWZAQ_o.cjs → topologyQueryFns-024l64sD.cjs} +1 -1
  88. package/dist/{topologyQueryFns-Bxdnl5Vt.js → topologyQueryFns-c2RQIcfW.js} +1 -1
  89. package/package.json +1 -1
package/dist/2d.cjs CHANGED
@@ -1,11 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
- const require_topologyQueryFns = require("./topologyQueryFns-BuWZAQ_o.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-BpOknLmX.cjs");
6
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
7
- const require_boolean2D = require("./boolean2D-DZcOTOSA.cjs");
8
- const require_blueprintFns = require("./blueprintFns-BO44cqFY.cjs");
4
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
5
+ const require_blueprintSketcher = require("./blueprintSketcher-dZZ8e5ey.cjs");
6
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.cjs");
7
+ const require_boolean2D = require("./boolean2D-4E1kbwQx.cjs");
8
+ const require_blueprintFns = require("./blueprintFns-DsuY7gCu.cjs");
9
9
  //#region src/core/curve2dHandle.ts
10
10
  /**
11
11
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
package/dist/2d.js CHANGED
@@ -1,10 +1,10 @@
1
- import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { B as createKernelHandle, Q as getKernel2D, a as createEdge } from "./shapeTypes-2cKwu2z4.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-Bxdnl5Vt.js";
4
- import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-DbINWerx.js";
5
- import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-Dgl9IkCV.js";
6
- import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CreNaKXt.js";
7
- import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-sKzHcJ4U.js";
3
+ import { w as kernelCallRaw } from "./topologyQueryFns-c2RQIcfW.js";
4
+ import { a as Blueprints, i as CompoundBlueprint, r as organiseBlueprints } from "./blueprintSketcher-BRKbVgE2.js";
5
+ import { _ as Curve2D, t as Blueprint, y as BoundingBox2d } from "./blueprint-qVw9ZkE4.js";
6
+ import { a as fuseBlueprints, c as roundedRectangleBlueprint, i as cutBlueprints, n as fuse2D, o as intersectBlueprints, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CANP43pN.js";
7
+ import { S as reverseCurve, _ as curve2dIsOnCurve, a as isInside2D, b as curve2dSplitAt, c as scale2D, d as stretch2D, f as toSVGPathD, g as curve2dFirstPoint, h as curve2dDistanceFrom, i as getOrientation2D, l as sketchOnFace2D, m as curve2dBoundingBox, o as mirror2D, p as translate2D, r as getBounds2D, s as rotate2D, t as createBlueprint, u as sketchOnPlane2D, v as curve2dLastPoint, x as curve2dTangentAt, y as curve2dParameter } from "./blueprintFns-zLwbytjs.js";
8
8
  //#region src/core/curve2dHandle.ts
9
9
  /**
10
10
  * Wrap a raw kernel 2D curve handle with brand + disposal tracking.
@@ -1,14 +1,14 @@
1
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
2
2
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_types = require("./types-KjA8tY4Y.cjs");
6
6
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
7
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
8
- const require_curveFns = require("./curveFns-CXytEfTr.cjs");
7
+ const require_faceFns = require("./faceFns-CcLFCtg4.cjs");
8
+ const require_curveFns = require("./curveFns-uPVW6eo-.cjs");
9
9
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
10
- const require_surfaceBuilders = require("./surfaceBuilders-CzHPZtd3.cjs");
11
- const require_helpers = require("./helpers-D8ycrNeD.cjs");
10
+ const require_surfaceBuilders = require("./surfaceBuilders-D2PBBoja.cjs");
11
+ const require_helpers = require("./helpers-BmY5kO0w.cjs");
12
12
  //#region src/2d/lib/definitions.ts
13
13
  /** Type guard that checks whether a value is a `Point2D`. */
14
14
  function isPoint2D(point) {
@@ -1,14 +1,14 @@
1
- import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { G as unregisterFromCleanup, Q as getKernel2D, U as registerForCleanup, Z as getKernel, a as createEdge, u as createWire } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { A as ok, R as unwrap, b as err, d as validationError, h as bug, n as computationError } from "./errors-DNWJsfVU.js";
4
4
  import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { r as toVec3 } from "./types-D24Y27N0.js";
6
6
  import { r as makePlane } from "./planeOps-DSjjtrjg.js";
7
- import { g as cast, m as uvCoordinates, n as faceCenter, p as uvBounds, r as faceGeomType } from "./faceFns-Dreo5ksY.js";
8
- import { f as getOrientation } from "./curveFns-BhTtS18d.js";
7
+ import { _ as cast, h as uvCoordinates, i as faceGeomType, m as uvBounds, r as faceCenter } from "./faceFns-BBcrvY7r.js";
8
+ import { f as getOrientation } from "./curveFns-CXhOkKR4.js";
9
9
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
10
- import { r as makeFace } from "./surfaceBuilders-CS1QccDv.js";
11
- import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers--BMa_zB7.js";
10
+ import { r as makeFace } from "./surfaceBuilders-BtNrSolT.js";
11
+ import { _ as samePoint, b as subtract2d, l as add2d, o as normalize2d, p as distance2d, t as getSingleFace, v as scalarMultiply2d } from "./helpers-CxT3j8jG.js";
12
12
  //#region src/2d/lib/definitions.ts
13
13
  /** Type guard that checks whether a value is a `Point2D`. */
14
14
  function isPoint2D(point) {
@@ -1,6 +1,6 @@
1
1
  const require_errors = require("./errors-CXJtc4I7.cjs");
2
- const require_blueprintSketcher = require("./blueprintSketcher-BpOknLmX.cjs");
3
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
2
+ const require_blueprintSketcher = require("./blueprintSketcher-dZZ8e5ey.cjs");
3
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.cjs");
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
6
6
  * Return a reversed copy of the curve (non-mutating).
@@ -1,6 +1,6 @@
1
1
  import { A as ok, b as err, d as validationError, t as BrepErrorCode } from "./errors-DNWJsfVU.js";
2
- import { i as CompoundBlueprint } from "./blueprintSketcher-DbINWerx.js";
3
- import { t as Blueprint } from "./blueprint-Dgl9IkCV.js";
2
+ import { i as CompoundBlueprint } from "./blueprintSketcher-BRKbVgE2.js";
3
+ import { t as Blueprint } from "./blueprint-qVw9ZkE4.js";
4
4
  //#region src/2d/lib/curve2dFns.ts
5
5
  /**
6
6
  * Return a reversed copy of the curve (non-mutating).
@@ -1,10 +1,10 @@
1
- import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Q as getKernel2D, Z as getKernel } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { A as ok, R as unwrap, T as isOk, b as err, h as bug, n as computationError, s as safeIndex } from "./errors-DNWJsfVU.js";
4
4
  import { r as RAD2DEG, t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
6
- import { _ as samePoint, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, v as scalarMultiply2d } from "./helpers--BMa_zB7.js";
7
- import { _ as Curve2D, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-Dgl9IkCV.js";
6
+ import { _ as samePoint, b as subtract2d, d as cartesianToPolar, f as crossProduct2d, g as rotate2d, h as polarToCartesian, l as add2d, m as polarAngle2d, o as normalize2d, p as distance2d, v as scalarMultiply2d } from "./helpers-CxT3j8jG.js";
7
+ import { _ as Curve2D, c as make2dCircle, f as make2dSegmentCurve, h as approximateAsBSpline, m as make2dThreePointArc, n as asSVG, o as make2dArcFromCenter, p as make2dTangentArc, r as viewbox, s as make2dBezierCurve, t as Blueprint, u as make2dEllipseArc, x as isPoint2D, y as BoundingBox2d } from "./blueprint-qVw9ZkE4.js";
8
8
  //#region node_modules/flatqueue/index.js
9
9
  /** @template T */
10
10
  var FlatQueue = class {
@@ -1,10 +1,10 @@
1
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
2
2
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
3
3
  const require_errors = require("./errors-CXJtc4I7.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
6
- const require_helpers = require("./helpers-D8ycrNeD.cjs");
7
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
6
+ const require_helpers = require("./helpers-BmY5kO0w.cjs");
7
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.cjs");
8
8
  //#region node_modules/flatqueue/index.js
9
9
  /** @template T */
10
10
  var FlatQueue = class {
@@ -1,10 +1,10 @@
1
1
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
3
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
4
- const require_surfaceBuilders = require("./surfaceBuilders-CzHPZtd3.cjs");
5
- const require_blueprintSketcher = require("./blueprintSketcher-BpOknLmX.cjs");
6
- const require_helpers = require("./helpers-D8ycrNeD.cjs");
7
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
4
+ const require_surfaceBuilders = require("./surfaceBuilders-D2PBBoja.cjs");
5
+ const require_blueprintSketcher = require("./blueprintSketcher-dZZ8e5ey.cjs");
6
+ const require_helpers = require("./helpers-BmY5kO0w.cjs");
7
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.cjs");
8
8
  //#region src/2d/blueprints/cannedBlueprints.ts
9
9
  /**
10
10
  * Create a regular polygon blueprint inscribed in a circle of the given radius.
@@ -1,10 +1,10 @@
1
1
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
2
2
  import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
3
3
  import { r as lastOrThrow } from "./arrayAccess-DrUGPADn.js";
4
- import { v as zip } from "./surfaceBuilders-CS1QccDv.js";
5
- import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-DbINWerx.js";
6
- import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers--BMa_zB7.js";
7
- import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-Dgl9IkCV.js";
4
+ import { v as zip } from "./surfaceBuilders-BtNrSolT.js";
5
+ import { a as Blueprints, i as CompoundBlueprint, l as intersectCurves, r as organiseBlueprints, t as BlueprintSketcher, u as Flatbush } from "./blueprintSketcher-BRKbVgE2.js";
6
+ import { _ as samePoint$1, b as subtract2d, f as crossProduct2d, s as PRECISION_INTERSECTION } from "./helpers-CxT3j8jG.js";
7
+ import { b as removeDuplicatePoints, f as make2dSegmentCurve, t as Blueprint } from "./blueprint-qVw9ZkE4.js";
8
8
  //#region src/2d/blueprints/cannedBlueprints.ts
9
9
  /**
10
10
  * Create a regular polygon blueprint inscribed in a circle of the given radius.
@@ -1,12 +1,12 @@
1
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
1
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
2
2
  const require_errors = require("./errors-CXJtc4I7.cjs");
3
- const require_topologyQueryFns = require("./topologyQueryFns-BuWZAQ_o.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
4
4
  const require_constants = require("./constants-BOVyEYGH.cjs");
5
5
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
6
6
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
7
- const require_shapeFns = require("./shapeFns-w1YoIn_p.cjs");
7
+ const require_shapeFns = require("./shapeFns-CDHya-nt.cjs");
8
8
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
9
- const require_surfaceBuilders = require("./surfaceBuilders-CzHPZtd3.cjs");
9
+ const require_surfaceBuilders = require("./surfaceBuilders-D2PBBoja.cjs");
10
10
  //#region src/topology/booleanFns.ts
11
11
  /**
12
12
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
@@ -1,12 +1,12 @@
1
- import { Z as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, h as isShape3D, t as castShape } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { A as ok, R as unwrap, b as err, d as validationError, i as kernelError, l as typeCastError, t as BrepErrorCode, w as isErr } from "./errors-DNWJsfVU.js";
3
- import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Bxdnl5Vt.js";
3
+ import { f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-c2RQIcfW.js";
4
4
  import { n as HASH_CODE_MAX } from "./constants-ITRzCnCp.js";
5
5
  import { h as vecScale, t as vecAdd } from "./vecOps-SKPRvPH-.js";
6
6
  import { o as resolvePlane } from "./planeOps-DSjjtrjg.js";
7
- import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-BnkizFjV.js";
7
+ import { _ as propagateAllMetadata, g as collectInputFaceHashes, v as propagateMetadataByHash } from "./shapeFns-DVUNOG2I.js";
8
8
  import { n as getAtOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
9
- import { r as makeFace } from "./surfaceBuilders-CS1QccDv.js";
9
+ import { r as makeFace } from "./surfaceBuilders-BtNrSolT.js";
10
10
  //#region src/topology/booleanFns.ts
11
11
  /**
12
12
  * Boolean and compound operations — functional replacements for _3DShape boolean methods.
package/dist/brepjs.cjs CHANGED
@@ -1,36 +1,36 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_textBlueprints = require("./textBlueprints-TG6AH06v.cjs");
3
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
4
- const require_occtWasmAdapter = require("./occtWasmAdapter-BH7r2nTq.cjs");
2
+ const require_textBlueprints = require("./textBlueprints-COG8m1aE.cjs");
3
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
4
+ const require_occtWasmAdapter = require("./occtWasmAdapter-Crs07qIe.cjs");
5
5
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
6
6
  const require_errors = require("./errors-CXJtc4I7.cjs");
7
- const require_topologyQueryFns = require("./topologyQueryFns-BuWZAQ_o.cjs");
7
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
8
8
  const require_constants = require("./constants-BOVyEYGH.cjs");
9
9
  const require_types = require("./types-KjA8tY4Y.cjs");
10
10
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
11
11
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
12
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
13
- const require_shapeFns = require("./shapeFns-w1YoIn_p.cjs");
14
- const require_curveFns = require("./curveFns-CXytEfTr.cjs");
15
- const require_meshFns = require("./meshFns-lwgHYQ79.cjs");
12
+ const require_faceFns = require("./faceFns-CcLFCtg4.cjs");
13
+ const require_shapeFns = require("./shapeFns-CDHya-nt.cjs");
14
+ const require_curveFns = require("./curveFns-uPVW6eo-.cjs");
15
+ const require_meshFns = require("./meshFns-CEGnFm33.cjs");
16
16
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
17
- const require_surfaceBuilders = require("./surfaceBuilders-CzHPZtd3.cjs");
18
- const require_booleanFns = require("./booleanFns-DvXg6a2Y.cjs");
19
- const require_primitiveFns = require("./primitiveFns-DZmgvzvk.cjs");
20
- const require_historyFns = require("./historyFns-mnmeZ0kB.cjs");
21
- const require_blueprintSketcher = require("./blueprintSketcher-BpOknLmX.cjs");
22
- const require_helpers = require("./helpers-D8ycrNeD.cjs");
23
- const require_drawFns = require("./drawFns-Bn4vzbUr.cjs");
24
- const require_solidBuilders = require("./solidBuilders-dNhToZgl.cjs");
25
- const require_measureFns = require("./measureFns-CT0XaSOt.cjs");
26
- const require_cornerFinder = require("./cornerFinder-ChltJ_ur.cjs");
27
- const require_boolean2D = require("./boolean2D-DZcOTOSA.cjs");
28
- const require_blueprintFns = require("./blueprintFns-BO44cqFY.cjs");
29
- const require_importFns = require("./importFns-4mi5Ih46.cjs");
30
- const require_extrudeFns = require("./extrudeFns-C0FsOXev.cjs");
31
- const require_cameraFns = require("./cameraFns-CsGSVYgb.cjs");
32
- const require_textMetrics = require("./textMetrics-Dag-YREs.cjs");
33
- const require_shapeRefFns = require("./shapeRefFns-B3myHs0D.cjs");
17
+ const require_surfaceBuilders = require("./surfaceBuilders-D2PBBoja.cjs");
18
+ const require_booleanFns = require("./booleanFns-Bp_wYEwG.cjs");
19
+ const require_primitiveFns = require("./primitiveFns-CpkG8ZkI.cjs");
20
+ const require_historyFns = require("./historyFns-BEB2Yjld.cjs");
21
+ const require_blueprintSketcher = require("./blueprintSketcher-dZZ8e5ey.cjs");
22
+ const require_helpers = require("./helpers-BmY5kO0w.cjs");
23
+ const require_drawFns = require("./drawFns-eMU4H__w.cjs");
24
+ const require_solidBuilders = require("./solidBuilders-ibLq_9EK.cjs");
25
+ const require_measureFns = require("./measureFns-zGABZl6o.cjs");
26
+ const require_cornerFinder = require("./cornerFinder-CQPXY8Aw.cjs");
27
+ const require_boolean2D = require("./boolean2D-4E1kbwQx.cjs");
28
+ const require_blueprintFns = require("./blueprintFns-DsuY7gCu.cjs");
29
+ const require_importFns = require("./importFns-DA0Klh7_.cjs");
30
+ const require_extrudeFns = require("./extrudeFns-CzQans6p.cjs");
31
+ const require_cameraFns = require("./cameraFns-dRK1CnFi.cjs");
32
+ const require_textMetrics = require("./textMetrics-CTSpUXtk.cjs");
33
+ const require_shapeRefFns = require("./shapeRefFns-B1Tygk9V.cjs");
34
34
  const require_workerHandler = require("./workerHandler-CdlOTwJg.cjs");
35
35
  //#region src/topology/shapeBooleans.ts
36
36
  var BOPAlgo_GlueShift = 1;
@@ -2134,11 +2134,12 @@ function roof(w, options) {
2134
2134
  //#endregion
2135
2135
  //#region src/kernel/solverAdapter.ts
2136
2136
  /**
2137
- * Standard degrees of freedom left unresolved by each unsupported constraint type.
2138
- * coincident: 3 translational (plane normal alignment + contact)
2139
- * concentric: 2 rotational (axis alignment) + 2 translational (axis centering) = 4
2140
- * distance: 1 translational (offset along normal)
2141
- * angle: 1 rotational
2137
+ * Degrees of freedom each constraint leaves unresolved when it can't be applied
2138
+ * (entity-type mismatch or an unreachable reference). All four types now solve
2139
+ * for well-typed inputs; these counts only feed the diagnostic `dof` for the
2140
+ * unsupported cases.
2141
+ * coincident: 3 translational · concentric: 2 rotational + 2 translational = 4
2142
+ * distance: 1 translational · angle: 1 rotational
2142
2143
  */
2143
2144
  var UNSUPPORTED_DOF = {
2144
2145
  coincident: 3,
@@ -2159,51 +2160,207 @@ function add$1(a, b) {
2159
2160
  a[2] + b[2]
2160
2161
  ];
2161
2162
  }
2163
+ function sub(a, b) {
2164
+ return [
2165
+ a[0] - b[0],
2166
+ a[1] - b[1],
2167
+ a[2] - b[2]
2168
+ ];
2169
+ }
2162
2170
  function dot(a, b) {
2163
2171
  return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
2164
2172
  }
2173
+ function cross(a, b) {
2174
+ return [
2175
+ a[1] * b[2] - a[2] * b[1],
2176
+ a[2] * b[0] - a[0] * b[2],
2177
+ a[0] * b[1] - a[1] * b[0]
2178
+ ];
2179
+ }
2180
+ function scale$2(a, s) {
2181
+ return [
2182
+ a[0] * s,
2183
+ a[1] * s,
2184
+ a[2] * s
2185
+ ];
2186
+ }
2187
+ function normalize(a) {
2188
+ const l = Math.hypot(a[0], a[1], a[2]) || 1;
2189
+ return [
2190
+ a[0] / l,
2191
+ a[1] / l,
2192
+ a[2] / l
2193
+ ];
2194
+ }
2195
+ /** A unit vector perpendicular to `v` (for the 180° / parallel degenerate cases). */
2196
+ function anyPerpendicular(v) {
2197
+ return normalize(cross(v, Math.abs(v[0]) < .9 ? [
2198
+ 1,
2199
+ 0,
2200
+ 0
2201
+ ] : [
2202
+ 0,
2203
+ 1,
2204
+ 0
2205
+ ]));
2206
+ }
2207
+ /** Rotate vector `v` by quaternion `q` = [w, x, y, z]. */
2208
+ function qRotate(q, v) {
2209
+ const [w, x, y, z] = q;
2210
+ const tx = 2 * (y * v[2] - z * v[1]);
2211
+ const ty = 2 * (z * v[0] - x * v[2]);
2212
+ const tz = 2 * (x * v[1] - y * v[0]);
2213
+ return [
2214
+ v[0] + w * tx + (y * tz - z * ty),
2215
+ v[1] + w * ty + (z * tx - x * tz),
2216
+ v[2] + w * tz + (x * ty - y * tx)
2217
+ ];
2218
+ }
2219
+ function qFromAxisAngle(axis, angle) {
2220
+ const h = angle / 2;
2221
+ const s = Math.sin(h);
2222
+ const u = normalize(axis);
2223
+ return [
2224
+ Math.cos(h),
2225
+ u[0] * s,
2226
+ u[1] * s,
2227
+ u[2] * s
2228
+ ];
2229
+ }
2230
+ /** Shortest-arc quaternion rotating unit vector `from` onto unit vector `to`. */
2231
+ function qFromTo(from, to) {
2232
+ const a = normalize(from);
2233
+ const b = normalize(to);
2234
+ const d = dot(a, b);
2235
+ if (d >= .999999999) return IDENTITY_ROTATION;
2236
+ if (d <= -.999999999) return qFromAxisAngle(anyPerpendicular(a), Math.PI);
2237
+ const c = cross(a, b);
2238
+ const q = [
2239
+ 1 + d,
2240
+ c[0],
2241
+ c[1],
2242
+ c[2]
2243
+ ];
2244
+ const l = Math.hypot(q[0], q[1], q[2], q[3]) || 1;
2245
+ return [
2246
+ q[0] / l,
2247
+ q[1] / l,
2248
+ q[2] / l,
2249
+ q[3] / l
2250
+ ];
2251
+ }
2252
+ /** Apply a pose (rotate then translate) to an entity's origin and any directions. */
2253
+ function transformEntity(e, pose) {
2254
+ const origin = add$1(qRotate(pose.rotation, e.origin), pose.position);
2255
+ return {
2256
+ type: e.type,
2257
+ origin,
2258
+ ...e.normal ? { normal: qRotate(pose.rotation, e.normal) } : {},
2259
+ ...e.direction ? { direction: qRotate(pose.rotation, e.direction) } : {}
2260
+ };
2261
+ }
2165
2262
  /**
2166
2263
  * Position a dependent plane against an already-placed reference plane.
2167
2264
  *
2168
- * The reference's solved translation is applied to its (local) entity origin
2169
- * before measuring, so a chain composes down already-solved poses instead of
2170
- * reading original geometry. The dependent is at the origin (a node is only
2171
- * solved once, while unplaced), so the returned position is its absolute
2172
- * translation. `extra` is the gap for a distance mate (0 for coincident).
2173
- * Rotation stays identity — coincident/distance produce pure translations;
2174
- * Phase 1 rotational constraints will extend this.
2265
+ * `ref` is the reference entity already in world space. The dependent is at the
2266
+ * origin (a node is only solved once, while unplaced), so the returned position
2267
+ * is its absolute translation along the reference normal. `extra` is the gap for
2268
+ * a distance mate (0 for coincident). Plane mates don't reorient the dependent.
2175
2269
  */
2176
- function solvePlanePair(ref, refPos, dep, extra) {
2270
+ function solvePlanePair(ref, dep, extra) {
2177
2271
  const n = ref.normal ?? [
2178
2272
  0,
2179
2273
  0,
2180
2274
  1
2181
2275
  ];
2182
- const refOrigin = add$1(ref.origin, refPos);
2183
- const offset = dot(n, [
2184
- refOrigin[0] - dep.origin[0],
2185
- refOrigin[1] - dep.origin[1],
2186
- refOrigin[2] - dep.origin[2]
2187
- ]) + extra;
2276
+ return {
2277
+ position: scale$2(n, dot(n, sub(ref.origin, dep.origin)) + extra),
2278
+ rotation: IDENTITY_ROTATION
2279
+ };
2280
+ }
2281
+ /**
2282
+ * Concentric (axis-axis) mate: rotate the dependent so its axis is parallel to
2283
+ * the reference axis, then translate so the two axes are collinear (the
2284
+ * dependent's axis point is placed on the reference axis). `ref` is in world
2285
+ * space; the dependent is at the origin.
2286
+ */
2287
+ function solveConcentric(ref, dep) {
2288
+ const dRef = ref.direction ?? [
2289
+ 0,
2290
+ 0,
2291
+ 1
2292
+ ];
2293
+ const rotation = qFromTo(dep.direction ?? [
2294
+ 0,
2295
+ 0,
2296
+ 1
2297
+ ], dRef);
2298
+ const rotatedOrigin = qRotate(rotation, dep.origin);
2299
+ return {
2300
+ position: sub(ref.origin, rotatedOrigin),
2301
+ rotation
2302
+ };
2303
+ }
2304
+ /**
2305
+ * Angle mate: rotate the dependent so the angle between its (plane) normal and
2306
+ * the reference normal equals `angleRad`. Orientation-only — position is left at
2307
+ * the origin. `ref` is in world space; the dependent is at the origin.
2308
+ */
2309
+ function solveAngle(ref, dep, angleRad) {
2310
+ const nRef = normalize(ref.normal ?? [
2311
+ 0,
2312
+ 0,
2313
+ 1
2314
+ ]);
2315
+ const nDep = normalize(dep.normal ?? [
2316
+ 0,
2317
+ 0,
2318
+ 1
2319
+ ]);
2320
+ const phi = Math.acos(Math.max(-1, Math.min(1, dot(nDep, nRef))));
2321
+ const c = cross(nDep, nRef);
2188
2322
  return {
2189
2323
  position: [
2190
- offset * n[0],
2191
- offset * n[1],
2192
- offset * n[2]
2324
+ 0,
2325
+ 0,
2326
+ 0
2193
2327
  ],
2194
- rotation: IDENTITY_ROTATION
2328
+ rotation: qFromAxisAngle(Math.hypot(c[0], c[1], c[2]) < 1e-9 ? anyPerpendicular(nDep) : c, phi - angleRad)
2195
2329
  };
2196
2330
  }
2331
+ /** Entity types each positioning constraint requires of (entityA, entityB). */
2332
+ var REQUIRED_ENTITIES = {
2333
+ coincident: "plane",
2334
+ distance: "plane",
2335
+ angle: "plane",
2336
+ concentric: "axis"
2337
+ };
2338
+ var POSITIONING_TYPES = new Set([
2339
+ "coincident",
2340
+ "distance",
2341
+ "angle",
2342
+ "concentric"
2343
+ ]);
2344
+ /** Dispatch a positioning mate to its solver. `ref` is already in world space. */
2345
+ function solveMate(c, ref, dep) {
2346
+ switch (c.type) {
2347
+ case "concentric": return solveConcentric(ref, dep);
2348
+ case "angle": return solveAngle(ref, dep, (c.value ?? 0) * Math.PI / 180);
2349
+ case "distance": return solvePlanePair(ref, dep, c.value ?? 0);
2350
+ default: return solvePlanePair(ref, dep, 0);
2351
+ }
2352
+ }
2197
2353
  /**
2198
2354
  * Solve assembly constraints analytically.
2199
2355
  *
2200
- * Handles: fixed, coincident (plane-plane), distance (plane-plane). For a
2201
- * positioning mate, entityA is the reference and entityB the dependent. Chain
2202
- * roots (nodes never positioned by a mate) and explicit `fixed` nodes anchor at
2203
- * the origin; constraints then resolve in topological order each places its
2204
- * dependent against the reference's solved pose, so multi-body chains compose.
2205
- * Returns `converged: false` with unsupported details for concentric, angle,
2206
- * non-plane pairs, and any constraint whose reference never resolves.
2356
+ * Handles: fixed, coincident/distance (plane-plane), concentric (axis-axis), and
2357
+ * angle (plane-plane orientation). For a positioning mate, entityA is the
2358
+ * reference and entityB the dependent. Chain roots (nodes never positioned by a
2359
+ * mate) and explicit `fixed` nodes anchor at the origin; constraints then resolve
2360
+ * in topological order — each places its dependent against the reference's solved
2361
+ * pose (rotation included), so multi-body chains compose. Returns
2362
+ * `converged: false` with details for entity-type mismatches and any constraint
2363
+ * whose reference never resolves.
2207
2364
  */
2208
2365
  function solveConstraints(nodes, constraints) {
2209
2366
  const transforms = /* @__PURE__ */ new Map();
@@ -2216,17 +2373,17 @@ function solveConstraints(nodes, constraints) {
2216
2373
  rotation: IDENTITY_ROTATION
2217
2374
  });
2218
2375
  const unsupported = [];
2219
- const positioning = constraints.filter((c) => (c.type === "coincident" || c.type === "distance") && c.entityA && c.entityB);
2376
+ const positioning = constraints.filter((c) => POSITIONING_TYPES.has(c.type) && c.entityA && c.entityB);
2220
2377
  const dependents = /* @__PURE__ */ new Set();
2221
2378
  for (const c of positioning) if (c.entityB) dependents.add(c.entityB.node);
2222
2379
  const placed = /* @__PURE__ */ new Set();
2223
2380
  for (const node of nodes) if (!dependents.has(node)) placed.add(node);
2224
2381
  for (const c of constraints) if (c.type === "fixed" && c.entityA) placed.add(c.entityA.node);
2225
- for (const c of constraints) if (c.type === "concentric" || c.type === "angle") unsupported.push(c.type);
2226
2382
  const pending = [];
2227
2383
  for (const c of positioning) {
2228
2384
  if (!c.entityA || !c.entityB) continue;
2229
- if (c.entityA.entity.type !== "plane" || c.entityB.entity.type !== "plane") {
2385
+ const required = REQUIRED_ENTITIES[c.type];
2386
+ if (c.entityA.entity.type !== required || c.entityB.entity.type !== required) {
2230
2387
  unsupported.push(`${c.type}(${c.entityA.entity.type}-${c.entityB.entity.type})`);
2231
2388
  continue;
2232
2389
  }
@@ -2252,8 +2409,8 @@ function solveConstraints(nodes, constraints) {
2252
2409
  ],
2253
2410
  rotation: IDENTITY_ROTATION
2254
2411
  };
2255
- const extra = c.type === "distance" ? c.value ?? 0 : 0;
2256
- transforms.set(dep.node, solvePlanePair(ref.entity, refPose.position, dep.entity, extra));
2412
+ const refWorld = transformEntity(ref.entity, refPose);
2413
+ transforms.set(dep.node, solveMate(c, refWorld, dep.entity));
2257
2414
  placed.add(dep.node);
2258
2415
  }
2259
2416
  }
@@ -2270,11 +2427,27 @@ function solveConstraints(nodes, constraints) {
2270
2427
  //#endregion
2271
2428
  //#region src/operations/mateFns.ts
2272
2429
  function extractEntity(mate) {
2273
- if (mate.face) return {
2274
- type: "plane",
2275
- origin: require_faceFns.faceCenter(mate.face),
2276
- normal: require_faceFns.normalAt(mate.face)
2277
- };
2430
+ if (mate.face) {
2431
+ const axis = require_faceFns.faceAxis(mate.face);
2432
+ if (axis) return {
2433
+ type: "axis",
2434
+ origin: axis.origin,
2435
+ direction: axis.direction
2436
+ };
2437
+ return {
2438
+ type: "plane",
2439
+ origin: require_faceFns.faceCenter(mate.face),
2440
+ normal: require_faceFns.normalAt(mate.face)
2441
+ };
2442
+ }
2443
+ if (mate.edge) {
2444
+ if (require_curveFns.getCurveType(mate.edge) === "LINE") return {
2445
+ type: "axis",
2446
+ origin: require_curveFns.curveStartPoint(mate.edge),
2447
+ direction: require_curveFns.curveTangentAt(mate.edge)
2448
+ };
2449
+ return null;
2450
+ }
2278
2451
  if (mate.point) return {
2279
2452
  type: "point",
2280
2453
  origin: mate.point
@@ -6362,6 +6535,7 @@ exports.exportThreeMF = require_importFns.exportThreeMF;
6362
6535
  exports.extrude = extrude;
6363
6536
  exports.extrudeAll = require_extrudeFns.extrudeAll;
6364
6537
  exports.face = require_primitiveFns.face;
6538
+ exports.faceAxis = require_faceFns.faceAxis;
6365
6539
  exports.faceCenter = require_faceFns.faceCenter;
6366
6540
  exports.faceFinder = require_helpers.faceFinder;
6367
6541
  exports.faceGeomType = require_faceFns.faceGeomType;