brepjs 18.69.3 → 18.71.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 (92) 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 +375 -65
  14. package/dist/brepjs.js +372 -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 +2 -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/assemblyFns.d.ts +2 -0
  55. package/dist/operations/jointFns.d.ts +55 -0
  56. package/dist/operations.cjs +2 -2
  57. package/dist/operations.js +2 -2
  58. package/dist/{primitiveFns-DcZDTQ_R.js → primitiveFns-CDbe5gjc.js} +7 -7
  59. package/dist/{primitiveFns-DZmgvzvk.cjs → primitiveFns-CpkG8ZkI.cjs} +7 -7
  60. package/dist/projection.cjs +1 -1
  61. package/dist/projection.js +1 -1
  62. package/dist/query.cjs +2 -2
  63. package/dist/query.js +2 -2
  64. package/dist/{shapeFns-w1YoIn_p.cjs → shapeFns-CDHya-nt.cjs} +2 -2
  65. package/dist/{shapeFns-BnkizFjV.js → shapeFns-DVUNOG2I.js} +2 -2
  66. package/dist/shapeRef.cjs +1 -1
  67. package/dist/shapeRef.js +1 -1
  68. package/dist/{shapeRefFns-B3myHs0D.cjs → shapeRefFns-B1Tygk9V.cjs} +4 -4
  69. package/dist/{shapeRefFns-OVWdFOAC.js → shapeRefFns-CAJUDLTi.js} +4 -4
  70. package/dist/{shapeTypes-yCQ8z5Hc.js → shapeTypes-2cKwu2z4.js} +35 -1
  71. package/dist/{shapeTypes-BIlZar9m.cjs → shapeTypes-DRxArFIc.cjs} +35 -1
  72. package/dist/sketching.cjs +3 -3
  73. package/dist/sketching.js +3 -3
  74. package/dist/{solidBuilders-CPOTKI5i.js → solidBuilders-Bx3UdW91.js} +2 -2
  75. package/dist/{solidBuilders-dNhToZgl.cjs → solidBuilders-ibLq_9EK.cjs} +2 -2
  76. package/dist/{surfaceBuilders-CS1QccDv.js → surfaceBuilders-BtNrSolT.js} +2 -2
  77. package/dist/{surfaceBuilders-CzHPZtd3.cjs → surfaceBuilders-D2PBBoja.cjs} +2 -2
  78. package/dist/text.cjs +2 -2
  79. package/dist/text.js +2 -2
  80. package/dist/{textBlueprints-TG6AH06v.cjs → textBlueprints-COG8m1aE.cjs} +7 -7
  81. package/dist/{textBlueprints-B57ej88L.js → textBlueprints-HfRD4iNF.js} +7 -7
  82. package/dist/{textMetrics-Dag-YREs.cjs → textMetrics-CTSpUXtk.cjs} +1 -1
  83. package/dist/{textMetrics-BxtB3sjj.js → textMetrics-Zp8rzokO.js} +1 -1
  84. package/dist/topology/faceFns.d.ts +9 -0
  85. package/dist/topology/index.d.ts +1 -1
  86. package/dist/topology.cjs +8 -7
  87. package/dist/topology.d.ts +1 -1
  88. package/dist/topology.js +8 -8
  89. package/dist/{topologyQueryFns-BuWZAQ_o.cjs → topologyQueryFns-024l64sD.cjs} +1 -1
  90. package/dist/{topologyQueryFns-Bxdnl5Vt.js → topologyQueryFns-c2RQIcfW.js} +1 -1
  91. package/dist/utils/quaternion.d.ts +15 -0
  92. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
2
2
  import { n as getAtOrThrow } from "./arrayAccess-DrUGPADn.js";
3
- import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers--BMa_zB7.js";
3
+ import { _ as samePoint, p as distance2d, u as angle2d } from "./helpers-CxT3j8jG.js";
4
4
  //#region src/query/cornerFinder.ts
5
5
  var PI_2 = 2 * Math.PI;
6
6
  function positiveHalfAngle(angle) {
@@ -1,4 +1,4 @@
1
- import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, f as isEdge, t as castShape, y as isWire } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { A as ok, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
3
3
  //#region src/topology/curveFns.ts
4
4
  /**
@@ -1,4 +1,4 @@
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
3
  //#region src/topology/curveFns.ts
4
4
  /**
@@ -1,22 +1,22 @@
1
- import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { R as DisposalScope, Y as _usingCtx, Z as getKernel, a as createEdge, o as createFace, u as createWire } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { n as wasmIndex } from "./vec3-Dpha8d5k.js";
3
3
  import { R as unwrap, h as bug, s as safeIndex } from "./errors-DNWJsfVU.js";
4
- import { s as getEdges } from "./topologyQueryFns-Bxdnl5Vt.js";
4
+ import { s as getEdges } from "./topologyQueryFns-c2RQIcfW.js";
5
5
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
6
6
  import { r as toVec3 } from "./types-D24Y27N0.js";
7
7
  import { d as vecNormalize, g as vecSub, h as vecScale, m as vecRotate, r as vecCross } from "./vecOps-SKPRvPH-.js";
8
8
  import { a as planeToWorld, o as resolvePlane } from "./planeOps-DSjjtrjg.js";
9
- import { _ as downcast, c as normalAt, l as outerWire, n as faceCenter, p as uvBounds, u as pointOnSurface } from "./faceFns-Dreo5ksY.js";
10
- import { c as curveStartPoint, m as offsetWire2D, r as curveIsClosed } from "./curveFns-BhTtS18d.js";
9
+ import { d as pointOnSurface, l as normalAt, m as uvBounds, r as faceCenter, u as outerWire, v as downcast } from "./faceFns-BBcrvY7r.js";
10
+ import { c as curveStartPoint, m as offsetWire2D, r as curveIsClosed } from "./curveFns-CXhOkKR4.js";
11
11
  import { n as getAtOrThrow, r as lastOrThrow, t as firstOrThrow } from "./arrayAccess-DrUGPADn.js";
12
- import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-CS1QccDv.js";
13
- import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-DbINWerx.js";
14
- import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers--BMa_zB7.js";
15
- import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-Dgl9IkCV.js";
16
- import { t as cornerFinder } from "./cornerFinder-fMf9-El_.js";
17
- import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CreNaKXt.js";
18
- import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-B57ej88L.js";
19
- import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-Bwxq0IDz.js";
12
+ import { c as makeBSplineApproximation, d as makeCircle, f as makeEllipse, m as makeHelix, r as makeFace, s as assembleWire } from "./surfaceBuilders-BtNrSolT.js";
13
+ import { a as Blueprints, c as make2dOffset, i as CompoundBlueprint, l as intersectCurves, n as BaseSketcher2d, o as chamferCurves, s as filletCurves, u as Flatbush } from "./blueprintSketcher-BRKbVgE2.js";
14
+ import { _ as samePoint$1, b as subtract2d, c as PRECISION_OFFSET, l as add2d, y as squareDistance2d } from "./helpers-CxT3j8jG.js";
15
+ import { _ as Curve2D, a as edgeToCurve, c as make2dCircle, d as make2dInerpolatedBSplineCurve, f as make2dSegmentCurve, g as approximateAsSvgCompatibleCurve, i as curvesAsEdgesOnPlane, l as make2dEllipse, o as make2dArcFromCenter, t as Blueprint, v as deserializeCurve2D, y as BoundingBox2d } from "./blueprint-qVw9ZkE4.js";
16
+ import { t as cornerFinder } from "./cornerFinder-DcHCKoUh.js";
17
+ import { c as roundedRectangleBlueprint, n as fuse2D, r as intersect2D, s as polysidesBlueprint, t as cut2D } from "./boolean2D-CANP43pN.js";
18
+ import { _ as wrapSketchDataArray, a as Sketch, g as wrapSketchData, i as Sketches, t as textBlueprints } from "./textBlueprints-HfRD4iNF.js";
19
+ import { i as projectEdges, t as cameraFromPlane } from "./cameraFns-BFRGMXSn.js";
20
20
  //#region src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -1,22 +1,22 @@
1
- const require_textBlueprints = require("./textBlueprints-TG6AH06v.cjs");
2
- const require_shapeTypes = require("./shapeTypes-BIlZar9m.cjs");
1
+ const require_textBlueprints = require("./textBlueprints-COG8m1aE.cjs");
2
+ const require_shapeTypes = require("./shapeTypes-DRxArFIc.cjs");
3
3
  const require_vec3 = require("./vec3-CFwOI0ZI.cjs");
4
4
  const require_errors = require("./errors-CXJtc4I7.cjs");
5
- const require_topologyQueryFns = require("./topologyQueryFns-BuWZAQ_o.cjs");
5
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
6
6
  const require_constants = require("./constants-BOVyEYGH.cjs");
7
7
  const require_types = require("./types-KjA8tY4Y.cjs");
8
8
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
9
9
  const require_planeOps = require("./planeOps-BA4HfgQu.cjs");
10
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
11
- const require_curveFns = require("./curveFns-CXytEfTr.cjs");
10
+ const require_faceFns = require("./faceFns-CcLFCtg4.cjs");
11
+ const require_curveFns = require("./curveFns-uPVW6eo-.cjs");
12
12
  const require_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
13
- const require_surfaceBuilders = require("./surfaceBuilders-CzHPZtd3.cjs");
14
- const require_blueprintSketcher = require("./blueprintSketcher-BpOknLmX.cjs");
15
- const require_helpers = require("./helpers-D8ycrNeD.cjs");
16
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
17
- const require_cornerFinder = require("./cornerFinder-ChltJ_ur.cjs");
18
- const require_boolean2D = require("./boolean2D-DZcOTOSA.cjs");
19
- const require_cameraFns = require("./cameraFns-CsGSVYgb.cjs");
13
+ const require_surfaceBuilders = require("./surfaceBuilders-D2PBBoja.cjs");
14
+ const require_blueprintSketcher = require("./blueprintSketcher-dZZ8e5ey.cjs");
15
+ const require_helpers = require("./helpers-BmY5kO0w.cjs");
16
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.cjs");
17
+ const require_cornerFinder = require("./cornerFinder-CQPXY8Aw.cjs");
18
+ const require_boolean2D = require("./boolean2D-4E1kbwQx.cjs");
19
+ const require_cameraFns = require("./cameraFns-dRK1CnFi.cjs");
20
20
  //#region src/2d/lib/stitching.ts
21
21
  /**
22
22
  * Group a flat list of curves into connected chains by matching endpoints.
@@ -1,4 +1,4 @@
1
- import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, c as createSolid, h as isShape3D, t as castShape, y as isWire } from "./shapeTypes-2cKwu2z4.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 { c as vecLength, d as vecNormalize, t as vecAdd } from "./vecOps-SKPRvPH-.js";
4
4
  //#region src/operations/extrudeUtils.ts
@@ -1,4 +1,4 @@
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
3
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
4
4
  //#region src/operations/extrudeUtils.ts
@@ -1,6 +1,6 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { A as ok, R as unwrap, b as err, l as typeCastError } from "./errors-DNWJsfVU.js";
3
- import { a as getCachedSurfaceType } from "./topologyQueryFns-Bxdnl5Vt.js";
3
+ import { a as getCachedSurfaceType } from "./topologyQueryFns-c2RQIcfW.js";
4
4
  import { r as toVec3 } from "./types-D24Y27N0.js";
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -189,6 +189,14 @@ function faceCenter(face) {
189
189
  return getKernel().surfaceCenterOfMass(face.wrapped);
190
190
  }
191
191
  /**
192
+ * Get a face's axis of symmetry — a point on the axis plus a unit direction —
193
+ * for analytic faces that have one (e.g. a cylinder's axis). Returns null when
194
+ * the face has no well-defined axis or the active kernel can't determine it.
195
+ */
196
+ function faceAxis(face) {
197
+ return getKernel().getSurfaceAxis(face.wrapped);
198
+ }
199
+ /**
192
200
  * Classify a 3D point's position relative to a face boundary.
193
201
  * Projects the point onto the face's surface and classifies the UV result.
194
202
  *
@@ -215,4 +223,4 @@ function innerWires(face) {
215
223
  return Array.from(iterTopo(face.wrapped, "wire")).map((w) => castShape(unwrap(downcast(w)))).filter((w) => !getKernel().isSame(w.wrapped, outer.wrapped));
216
224
  }
217
225
  //#endregion
218
- export { downcast as _, flipFaceOrientation as a, iterTopo as b, normalAt as c, projectPointOnFace as d, removeHolesFromFace as f, cast as g, asTopo as h, faceOrientation as i, outerWire as l, uvCoordinates as m, faceCenter as n, getSurfaceType as o, uvBounds as p, faceGeomType as r, innerWires as s, classifyPointOnFace as t, pointOnSurface as u, fromBREP as v, shapeType as x, isCompSolid as y };
226
+ export { shapeType as S, cast as _, faceOrientation as a, isCompSolid as b, innerWires as c, pointOnSurface as d, projectPointOnFace as f, asTopo as g, uvCoordinates as h, faceGeomType as i, normalAt as l, uvBounds as m, faceAxis as n, flipFaceOrientation as o, removeHolesFromFace as p, faceCenter as r, getSurfaceType as s, classifyPointOnFace as t, outerWire as u, downcast as v, iterTopo as x, fromBREP as y };
@@ -1,6 +1,6 @@
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_types = require("./types-KjA8tY4Y.cjs");
5
5
  //#region src/topology/cast.ts
6
6
  var TOPO_ENUM = {
@@ -189,6 +189,14 @@ function faceCenter(face) {
189
189
  return require_shapeTypes.getKernel().surfaceCenterOfMass(face.wrapped);
190
190
  }
191
191
  /**
192
+ * Get a face's axis of symmetry — a point on the axis plus a unit direction —
193
+ * for analytic faces that have one (e.g. a cylinder's axis). Returns null when
194
+ * the face has no well-defined axis or the active kernel can't determine it.
195
+ */
196
+ function faceAxis(face) {
197
+ return require_shapeTypes.getKernel().getSurfaceAxis(face.wrapped);
198
+ }
199
+ /**
192
200
  * Classify a 3D point's position relative to a face boundary.
193
201
  * Projects the point onto the face's surface and classifies the UV result.
194
202
  *
@@ -239,6 +247,12 @@ Object.defineProperty(exports, "downcast", {
239
247
  return downcast;
240
248
  }
241
249
  });
250
+ Object.defineProperty(exports, "faceAxis", {
251
+ enumerable: true,
252
+ get: function() {
253
+ return faceAxis;
254
+ }
255
+ });
242
256
  Object.defineProperty(exports, "faceCenter", {
243
257
  enumerable: true,
244
258
  get: function() {
@@ -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
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
7
- const require_shapeFns = require("./shapeFns-w1YoIn_p.cjs");
8
- const require_curveFns = require("./curveFns-CXytEfTr.cjs");
9
- const require_measureFns = require("./measureFns-CT0XaSOt.cjs");
6
+ const require_faceFns = require("./faceFns-CcLFCtg4.cjs");
7
+ const require_shapeFns = require("./shapeFns-CDHya-nt.cjs");
8
+ const require_curveFns = require("./curveFns-uPVW6eo-.cjs");
9
+ const require_measureFns = require("./measureFns-zGABZl6o.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,12 +1,12 @@
1
- import { Z as getKernel, p as isFace } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, p as isFace } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { A as ok, T as isOk, b as err, h as bug, o as queryError } from "./errors-DNWJsfVU.js";
3
- import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-Bxdnl5Vt.js";
3
+ import { c as getFaces, f as getVertices, p as getWires, s as getEdges } from "./topologyQueryFns-c2RQIcfW.js";
4
4
  import { t as DEG2RAD } from "./constants-ITRzCnCp.js";
5
5
  import { a as vecDot, d as vecNormalize } from "./vecOps-SKPRvPH-.js";
6
- import { c as normalAt, o as getSurfaceType } from "./faceFns-Dreo5ksY.js";
7
- import { a as isSameShape, n as getHashCode } from "./shapeFns-BnkizFjV.js";
8
- import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-BhTtS18d.js";
9
- import { n as measureArea } from "./measureFns-BLEx4ZU3.js";
6
+ import { l as normalAt, s as getSurfaceType } from "./faceFns-BBcrvY7r.js";
7
+ import { a as isSameShape, n as getHashCode } from "./shapeFns-DVUNOG2I.js";
8
+ import { a as curveLength, d as getCurveType, r as curveIsClosed } from "./curveFns-CXhOkKR4.js";
9
+ import { n as measureArea } from "./measureFns-DAP8LjBB.js";
10
10
  //#region src/utils/vec2d.ts
11
11
  /** Precision for curve intersection and parameter operations. */
12
12
  var PRECISION_INTERSECTION = 1e-9;
@@ -1,9 +1,9 @@
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
3
  const require_vecOps = require("./vecOps-CCnJt-yH.cjs");
4
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
5
- const require_shapeFns = require("./shapeFns-w1YoIn_p.cjs");
6
- const require_booleanFns = require("./booleanFns-DvXg6a2Y.cjs");
4
+ const require_faceFns = require("./faceFns-CcLFCtg4.cjs");
5
+ const require_shapeFns = require("./shapeFns-CDHya-nt.cjs");
6
+ const require_booleanFns = require("./booleanFns-Bp_wYEwG.cjs");
7
7
  //#region src/utils/uuid.ts
8
8
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
9
9
  function uuidv() {
@@ -1,9 +1,9 @@
1
- import { B as createKernelHandle, Z as getKernel, t as castShape } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { B as createKernelHandle, Z as getKernel, t as castShape } from "./shapeTypes-2cKwu2z4.js";
2
2
  import { A as ok, b as err, d as validationError, n as computationError, r as ioError } from "./errors-DNWJsfVU.js";
3
3
  import { d as vecNormalize, s as vecIsZero } from "./vecOps-SKPRvPH-.js";
4
- import { v as fromBREP } from "./faceFns-Dreo5ksY.js";
5
- import { s as toBREP } from "./shapeFns-BnkizFjV.js";
6
- import { a as fuseAll } from "./booleanFns-0jDBFjAv.js";
4
+ import { y as fromBREP } from "./faceFns-BBcrvY7r.js";
5
+ import { s as toBREP } from "./shapeFns-DVUNOG2I.js";
6
+ import { a as fuseAll } from "./booleanFns-DYSaupiG.js";
7
7
  //#region src/utils/uuid.ts
8
8
  /** Generate a v4-style UUID string using `crypto.getRandomValues`. */
9
9
  function uuidv() {
@@ -1,8 +1,8 @@
1
- import { Z as getKernel, t as castShape } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel, t as castShape } from "./shapeTypes-2cKwu2z4.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-Dgl9IkCV.js";
5
+ import { f as make2dSegmentCurve, m as make2dThreePointArc, s as make2dBezierCurve, t as Blueprint } from "./blueprint-qVw9ZkE4.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) {
@@ -1,8 +1,8 @@
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_arrayAccess = require("./arrayAccess-e4H9cBfh.cjs");
5
- const require_blueprint = require("./blueprint-DIQeD9xj.cjs");
5
+ const require_blueprint = require("./blueprint-jlSsZ0sZ.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) {
package/dist/index.d.ts CHANGED
@@ -91,7 +91,7 @@ export { facesOfEdge, edgesOfFace, wiresOfFace, verticesOfEdge, adjacentFaces, s
91
91
  export { getCurveType, curveStartPoint, curveEndPoint, curvePointAt, curveTangentAt, curveLength, curveIsClosed, curveIsPeriodic, curvePeriod, getOrientation, flipOrientation, offsetWire2D, interpolateCurve, approximateCurve, type InterpolateCurveOptions, type ApproximateCurveOptions, } from './topology/curveFns.js';
92
92
  export { getNurbsCurveData, getNurbsSurfaceData } from './topology/nurbsFns.js';
93
93
  export type { NurbsCurveData, NurbsSurfaceData } from './kernel/types.js';
94
- export { getSurfaceType, faceGeomType, faceOrientation, flipFaceOrientation, uvBounds, pointOnSurface, uvCoordinates, normalAt, faceCenter, classifyPointOnFace, outerWire, innerWires, removeHolesFromFace, projectPointOnFace, type UVBounds, type PointProjectionResult, } from './topology/faceFns.js';
94
+ export { getSurfaceType, faceGeomType, faceOrientation, flipFaceOrientation, uvBounds, pointOnSurface, uvCoordinates, normalAt, faceCenter, faceAxis, classifyPointOnFace, outerWire, innerWires, removeHolesFromFace, projectPointOnFace, type UVBounds, type PointProjectionResult, } from './topology/faceFns.js';
95
95
  export { exportSTEP, exportSTL, exportIGES, meshMultiLOD, type ShapeMesh, type EdgeMesh, type MeshOptions, type MultiLODMesh, } from './topology/meshFns.js';
96
96
  export { clearMeshCache, createMeshCache, type MeshCacheContext } from './topology/meshCache.js';
97
97
  export { toBufferGeometryData, toLineGeometryData, toGroupedBufferGeometryData, type BufferGeometryData, type LineGeometryData, type GroupedBufferGeometryData, type BufferGeometryGroup, toLODGeometryData, type LODGeometryData, } from './topology/threeHelpers.js';
@@ -121,6 +121,7 @@ export { exportAssemblySTEP, type ShapeOptions, type SupportedUnit, } from './op
121
121
  export { linearPattern, circularPattern } from './operations/patternFns.js';
122
122
  export { createAssemblyNode, addChild, removeChild, updateNode, findNode, walkAssembly, countNodes, collectShapes, type AssemblyNode, type AssemblyNodeOptions, } from './operations/assemblyFns.js';
123
123
  export { addMate, solveAssembly, type MateConstraint, type MateEntity, type AssemblySolveResult, } from './operations/mateFns.js';
124
+ export { revoluteJoint, prismaticJoint, setJointValue, jointTransform, addJoint, type Joint, type JointAxis, type JointType, type JointPose, type JointOptions, } from './operations/jointFns.js';
124
125
  export { createHistory, addStep, undoLast, findStep, getShape as getHistoryShape, stepCount, stepsFrom, registerShape, createRegistry, registerOperation, replayHistory, replayFrom, modifyStep, serializeHistory, deserializeHistory, type OperationStep, type ModelHistory, type SerializedHistory, type OperationFn, type OperationRegistry as HistoryOperationRegistry, } from './operations/historyFns.js';
125
126
  export { measureVolume, measureArea, measureLength, measureDistance, measureDistanceProps, createDistanceQuery, measureVolumeProps, measureSurfaceProps, measureLinearProps, type PhysicalProps, type VolumeProps, type SurfaceProps, type LinearProps, type DistanceProps, measureCurvatureAt, measureCurvatureAtMid, type CurvatureResult, } from './measurement/measureFns.js';
126
127
  export { checkInterference, checkAllInterferences, type InterferenceResult, type InterferencePair, } from './measurement/interferenceFns.js';
package/dist/io.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_meshFns = require("./meshFns-lwgHYQ79.cjs");
3
- const require_importFns = require("./importFns-4mi5Ih46.cjs");
2
+ const require_meshFns = require("./meshFns-CEGnFm33.cjs");
3
+ const require_importFns = require("./importFns-DA0Klh7_.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-B3MjIqk1.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-DRPQExAD.js";
1
+ import { n as exportSTEP, r as exportSTL, t as exportIGES } from "./meshFns-D-nLiHvU.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-BNDWuBuq.js";
3
3
  export { blueprintToDXF, exportDXF, exportGlb, exportGltf, exportIGES, exportOBJ, exportSTEP, exportSTEPConfigured, exportSTL, exportThreeMF, importIGES, importSTEP, importSTL, importSVG, importSVGPathD };
@@ -108,6 +108,7 @@ export declare function makeGeometryOps(bk: BrepkitKernel): {
108
108
  radius: number;
109
109
  isDirect: boolean;
110
110
  } | null;
111
+ getSurfaceAxis: () => null;
111
112
  reverseSurfaceU: (surface: any) => any;
112
113
  classifyPointOnFace: (face: any, u: number, v: number, tolerance: number | undefined) => "in" | "on" | "out";
113
114
  classifyPointRobust: (shape: any, point: [number, number, number], tolerance: number) => string;
@@ -27,6 +27,15 @@ export interface KernelSurfaceOps {
27
27
  radius: number;
28
28
  isDirect: boolean;
29
29
  } | null;
30
+ /**
31
+ * Get a face's analytic axis of symmetry (e.g. a cylinder's axis): a point on
32
+ * the axis plus a unit direction. Returns null if the face has no well-defined
33
+ * axis (non-cylindrical, or the adapter can't determine it).
34
+ */
35
+ getSurfaceAxis(face: KernelShape): {
36
+ origin: [number, number, number];
37
+ direction: [number, number, number];
38
+ } | null;
30
39
  /** Reverse the U direction of a surface. Returns a new surface handle. */
31
40
  reverseSurfaceU(surface: KernelType): KernelType;
32
41
  /** Detect small features (faces below area threshold). Returns face shapes. */
@@ -69,6 +69,11 @@ export declare function getSurfaceCylinderData(oc: KernelInstance, surface: Kern
69
69
  radius: number;
70
70
  isDirect: boolean;
71
71
  } | null;
72
+ /** Get a cylindrical face's axis (point on axis + unit direction). Null otherwise. */
73
+ export declare function getSurfaceAxis(oc: KernelInstance, face: KernelShape): {
74
+ origin: [number, number, number];
75
+ direction: [number, number, number];
76
+ } | null;
72
77
  /** Reverse the U direction of a surface. Returns a new surface handle. */
73
78
  export declare function reverseSurfaceU(_oc: KernelInstance, surface: KernelType): KernelType;
74
79
  /** Co-located factory: returns the geometry-query slice of {@link KernelAdapter} bound to `oc`. */
@@ -109,5 +114,9 @@ export declare function makeGeometryQueryOps(oc: KernelInstance): {
109
114
  radius: number;
110
115
  isDirect: boolean;
111
116
  } | null;
117
+ getSurfaceAxis: (face: any) => {
118
+ origin: [number, number, number];
119
+ direction: [number, number, number];
120
+ } | null;
112
121
  reverseSurfaceU: (surface: any) => any;
113
122
  };
@@ -1,3 +1,3 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_occtWasmAdapter = require("../../occtWasmAdapter-BH7r2nTq.cjs");
2
+ const require_occtWasmAdapter = require("../../occtWasmAdapter-Crs07qIe.cjs");
3
3
  exports.OcctWasmAdapter = require_occtWasmAdapter.OcctWasmAdapter;
@@ -321,6 +321,10 @@ export declare class OcctWasmAdapter implements KernelAdapter {
321
321
  radius: number;
322
322
  isDirect: boolean;
323
323
  } | null;
324
+ getSurfaceAxis(face: KernelShape): {
325
+ origin: [number, number, number];
326
+ direction: [number, number, number];
327
+ } | null;
324
328
  reverseSurfaceU(_surface: KernelType): KernelType;
325
329
  detectSmallFeatures(_shape: KernelShape, _areaThreshold: number, _tolerance: number): KernelShape[];
326
330
  recognizeFeatures(_shape: KernelShape, _tolerance: number): string;
@@ -1,2 +1,2 @@
1
- import { t as OcctWasmAdapter } from "../../occtWasmAdapter-C7FDeTaw.js";
1
+ import { t as OcctWasmAdapter } from "../../occtWasmAdapter-D0MtWZYO.js";
2
2
  export { OcctWasmAdapter };
@@ -11,6 +11,22 @@ export declare function uvBounds(k: OcctKernelWasm, face: KernelShape): {
11
11
  export declare function outerWire(k: OcctKernelWasm, face: KernelShape): KernelShape;
12
12
  export declare function surfaceNormal(k: OcctKernelWasm, face: KernelShape, u: number, v: number): [number, number, number];
13
13
  export declare function pointOnSurface(k: OcctKernelWasm, face: KernelShape, u: number, v: number): [number, number, number];
14
+ type V3 = [number, number, number];
15
+ /**
16
+ * Derive a cylindrical face's axis (point on axis + unit direction) from the
17
+ * primitives occt-wasm exposes — it has no analytic `gp_Cylinder` accessor.
18
+ *
19
+ * Two surface samples at the same height v give radial normals n1,n2 (lying in
20
+ * the plane perpendicular to the axis), so `n1 x n2` is parallel to the axis.
21
+ * The points satisfy `p1 - p2 = ±r(n1 - n2)`, giving the radius
22
+ * `r = |p1-p2| / |n1-n2|`; the axis point is then `p - r·n` with the normal's
23
+ * sign chosen so both samples agree. Exact for full and partial cylinders.
24
+ * Returns null for non-cylinders.
25
+ */
26
+ export declare function getSurfaceAxis(k: OcctKernelWasm, face: KernelShape): {
27
+ origin: V3;
28
+ direction: V3;
29
+ } | null;
14
30
  export declare function uvFromPoint(k: OcctKernelWasm, face: KernelShape, point: [number, number, number]): [number, number] | null;
15
31
  export declare function projectPointOnFace(k: OcctKernelWasm, face: KernelShape, point: [number, number, number]): [number, number, number];
16
32
  export declare function classifyPointOnFace(k: OcctKernelWasm, face: KernelShape, u: number, v: number, _tolerance?: number): 'in' | 'on' | 'out';
@@ -26,3 +42,4 @@ export declare function projectEdges(k: OcctKernelWasm, Module: OcctWasmModule,
26
42
  sharp: KernelShape;
27
43
  };
28
44
  };
45
+ export {};
@@ -34,13 +34,14 @@ export interface SolverResult {
34
34
  /**
35
35
  * Solve assembly constraints analytically.
36
36
  *
37
- * Handles: fixed, coincident (plane-plane), distance (plane-plane). For a
38
- * positioning mate, entityA is the reference and entityB the dependent. Chain
39
- * roots (nodes never positioned by a mate) and explicit `fixed` nodes anchor at
40
- * the origin; constraints then resolve in topological order each places its
41
- * dependent against the reference's solved pose, so multi-body chains compose.
42
- * Returns `converged: false` with unsupported details for concentric, angle,
43
- * non-plane pairs, and any constraint whose reference never resolves.
37
+ * Handles: fixed, coincident/distance (plane-plane), concentric (axis-axis), and
38
+ * angle (plane-plane orientation). For a positioning mate, entityA is the
39
+ * reference and entityB the dependent. Chain roots (nodes never positioned by a
40
+ * mate) and explicit `fixed` nodes anchor at the origin; constraints then resolve
41
+ * in topological order — each places its dependent against the reference's solved
42
+ * pose (rotation included), so multi-body chains compose. Returns
43
+ * `converged: false` with details for entity-type mismatches and any constraint
44
+ * whose reference never resolves.
44
45
  */
45
46
  export declare function solveConstraints(nodes: string[], constraints: SolverConstraint[]): SolverResult;
46
47
  export {};
@@ -1,7 +1,7 @@
1
- import { Z as getKernel } from "./shapeTypes-yCQ8z5Hc.js";
1
+ import { Z as getKernel } 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 { p as uvBounds } from "./faceFns-Dreo5ksY.js";
3
+ import { w as kernelCallRaw } from "./topologyQueryFns-c2RQIcfW.js";
4
+ import { m as uvBounds } from "./faceFns-BBcrvY7r.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-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");
4
- const require_faceFns = require("./faceFns-FAZgMVCx.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
4
+ const require_faceFns = require("./faceFns-CcLFCtg4.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-CT0XaSOt.cjs");
2
+ const require_measureFns = require("./measureFns-zGABZl6o.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-BLEx4ZU3.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-DAP8LjBB.js";
2
2
  export { createDistanceQuery, measureArea, measureDistance, measureDistanceProps, measureLength, measureLinearProps, measureSurfaceProps, measureVolume, measureVolumeProps };
@@ -1,7 +1,7 @@
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");
4
- const require_shapeFns = require("./shapeFns-w1YoIn_p.cjs");
3
+ const require_topologyQueryFns = require("./topologyQueryFns-024l64sD.cjs");
4
+ const require_shapeFns = require("./shapeFns-CDHya-nt.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-yCQ8z5Hc.js";
1
+ import { Z as getKernel, gt as qualityDeflection } from "./shapeTypes-2cKwu2z4.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-Bxdnl5Vt.js";
4
- import { O as getFaceOrigins } from "./shapeFns-BnkizFjV.js";
3
+ import { d as getSolids, n as getBounds } from "./topologyQueryFns-c2RQIcfW.js";
4
+ import { O as getFaceOrigins } from "./shapeFns-DVUNOG2I.js";
5
5
  //#region src/topology/meshCache.ts
6
6
  /**
7
7
  * Build a parameter key for the inner cache map (excludes shape identity).
@@ -1772,6 +1772,70 @@ function pointOnSurface(k, face, u, v) {
1772
1772
  vec.delete();
1773
1773
  }
1774
1774
  }
1775
+ var subV = (a, b) => [
1776
+ a[0] - b[0],
1777
+ a[1] - b[1],
1778
+ a[2] - b[2]
1779
+ ];
1780
+ var lenV = (a) => Math.hypot(a[0], a[1], a[2]);
1781
+ var crossV = (a, b) => [
1782
+ a[1] * b[2] - a[2] * b[1],
1783
+ a[2] * b[0] - a[0] * b[2],
1784
+ a[0] * b[1] - a[1] * b[0]
1785
+ ];
1786
+ /**
1787
+ * Derive a cylindrical face's axis (point on axis + unit direction) from the
1788
+ * primitives occt-wasm exposes — it has no analytic `gp_Cylinder` accessor.
1789
+ *
1790
+ * Two surface samples at the same height v give radial normals n1,n2 (lying in
1791
+ * the plane perpendicular to the axis), so `n1 x n2` is parallel to the axis.
1792
+ * The points satisfy `p1 - p2 = ±r(n1 - n2)`, giving the radius
1793
+ * `r = |p1-p2| / |n1-n2|`; the axis point is then `p - r·n` with the normal's
1794
+ * sign chosen so both samples agree. Exact for full and partial cylinders.
1795
+ * Returns null for non-cylinders.
1796
+ */
1797
+ function getSurfaceAxis(k, face) {
1798
+ if (surfaceType(k, face) !== "cylinder") return null;
1799
+ const b = uvBounds(k, face);
1800
+ const vMid = .5 * (b.vMin + b.vMax);
1801
+ const u1 = b.uMin + .25 * (b.uMax - b.uMin);
1802
+ const u2 = b.uMin + .5 * (b.uMax - b.uMin);
1803
+ const n1 = surfaceNormal(k, face, u1, vMid);
1804
+ const n2 = surfaceNormal(k, face, u2, vMid);
1805
+ const p1 = pointOnSurface(k, face, u1, vMid);
1806
+ const p2 = pointOnSurface(k, face, u2, vMid);
1807
+ const axis = crossV(n1, n2);
1808
+ const axisLen = lenV(axis);
1809
+ const dnLen = lenV(subV(n1, n2));
1810
+ if (axisLen < 1e-9 || dnLen < 1e-9) return null;
1811
+ const direction = [
1812
+ axis[0] / axisLen,
1813
+ axis[1] / axisLen,
1814
+ axis[2] / axisLen
1815
+ ];
1816
+ const r = lenV(subV(p1, p2)) / dnLen;
1817
+ const minus1 = [
1818
+ p1[0] - r * n1[0],
1819
+ p1[1] - r * n1[1],
1820
+ p1[2] - r * n1[2]
1821
+ ];
1822
+ if (lenV(subV(minus1, [
1823
+ p2[0] - r * n2[0],
1824
+ p2[1] - r * n2[1],
1825
+ p2[2] - r * n2[2]
1826
+ ])) < 1e-6) return {
1827
+ origin: minus1,
1828
+ direction
1829
+ };
1830
+ return {
1831
+ origin: [
1832
+ p1[0] + r * n1[0],
1833
+ p1[1] + r * n1[1],
1834
+ p1[2] + r * n1[2]
1835
+ ],
1836
+ direction
1837
+ };
1838
+ }
1775
1839
  function uvFromPoint(k, face, point) {
1776
1840
  const vec = k.uvFromPoint(unwrap(face), point[0], point[1], point[2]);
1777
1841
  try {
@@ -4777,6 +4841,9 @@ var OcctWasmAdapter = class OcctWasmAdapter {
4777
4841
  getSurfaceCylinderData(_surface) {
4778
4842
  notImplemented("getSurfaceCylinderData");
4779
4843
  }
4844
+ getSurfaceAxis(face) {
4845
+ return getSurfaceAxis(this.k, face);
4846
+ }
4780
4847
  reverseSurfaceU(_surface) {
4781
4848
  notImplemented("reverseSurfaceU");
4782
4849
  }