brepjs 12.8.2 → 12.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (225) hide show
  1. package/dist/2d/lib/svgPath.d.ts.map +1 -1
  2. package/dist/2d/lib/vectorOperations.d.ts +4 -1
  3. package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
  4. package/dist/2d.cjs +2 -2
  5. package/dist/2d.js +5 -5
  6. package/dist/{Blueprint-DbVaf6k7.js → Blueprint-1HGbugaC.js} +33 -63
  7. package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-CUyXM6CV.cjs} +15 -45
  8. package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-9OnbotKT.cjs} +9 -9
  9. package/dist/{boolean2D-y3E92F0u.js → boolean2D-CR4efa35.js} +11 -11
  10. package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-BBd2oTvv.cjs} +43 -40
  11. package/dist/{booleanFns-BCTjYZAg.js → booleanFns-Br2KdGJq.js} +53 -50
  12. package/dist/brepjs.cjs +379 -284
  13. package/dist/brepjs.js +1437 -1341
  14. package/dist/core/definitionMaps.d.ts +2 -7
  15. package/dist/core/definitionMaps.d.ts.map +1 -1
  16. package/dist/core/dimensionTypes.d.ts +52 -0
  17. package/dist/core/dimensionTypes.d.ts.map +1 -0
  18. package/dist/core/disposal.d.ts +18 -0
  19. package/dist/core/disposal.d.ts.map +1 -1
  20. package/dist/core/errors.d.ts +1 -8
  21. package/dist/core/errors.d.ts.map +1 -1
  22. package/dist/core/kernelErrorTranslation.d.ts +15 -0
  23. package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
  24. package/dist/core/planeOps.d.ts +14 -0
  25. package/dist/core/planeOps.d.ts.map +1 -1
  26. package/dist/core/result.d.ts +4 -0
  27. package/dist/core/result.d.ts.map +1 -1
  28. package/dist/core/shapeTypes.d.ts +14 -146
  29. package/dist/core/shapeTypes.d.ts.map +1 -1
  30. package/dist/core/typeDiscriminants.d.ts +14 -0
  31. package/dist/core/typeDiscriminants.d.ts.map +1 -0
  32. package/dist/core/validityTypes.d.ts +100 -0
  33. package/dist/core/validityTypes.d.ts.map +1 -0
  34. package/dist/core.cjs +52 -11
  35. package/dist/core.d.ts +1 -1
  36. package/dist/core.d.ts.map +1 -1
  37. package/dist/core.js +118 -75
  38. package/dist/{curveFns-mROFhiuG.js → curveFns-1u0oZ0u0.js} +14 -14
  39. package/dist/{curveFns-BZngcnQ1.cjs → curveFns-BwLvO_Ia.cjs} +2 -2
  40. package/dist/{drawFns-Bwakrq7w.js → drawFns-B0na6sbo.js} +16 -16
  41. package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-CzlEePor.cjs} +18 -18
  42. package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-BAKkZG6D.cjs} +2 -2
  43. package/dist/{faceFns-B8GnxjdY.js → faceFns-DGMp47Os.js} +3 -3
  44. package/dist/{helpers-C8NoT0Wu.cjs → helpers-DVdscQxW.cjs} +73 -8
  45. package/dist/{helpers-X0juxnwj.js → helpers-sJjnIXDA.js} +85 -20
  46. package/dist/index.d.ts +10 -11
  47. package/dist/index.d.ts.map +1 -1
  48. package/dist/io.cjs +4 -4
  49. package/dist/io.js +4 -4
  50. package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
  51. package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
  52. package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
  53. package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
  54. package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
  55. package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
  56. package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
  57. package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
  58. package/dist/kernel/brepkit/helpers.d.ts +84 -0
  59. package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
  60. package/dist/kernel/brepkit/internalOps.d.ts +28 -0
  61. package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
  62. package/dist/kernel/brepkit/ioOps.d.ts +43 -0
  63. package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
  64. package/dist/kernel/brepkit/measureOps.d.ts +30 -0
  65. package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
  66. package/dist/kernel/brepkit/meshOps.d.ts +7 -0
  67. package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
  68. package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
  69. package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
  70. package/dist/kernel/brepkit/repairOps.d.ts +14 -0
  71. package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
  72. package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
  73. package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
  74. package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
  75. package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
  76. package/dist/kernel/brepkit/transformOps.d.ts +14 -0
  77. package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
  78. package/dist/kernel/brepkitAdapter.d.ts +1 -1
  79. package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
  80. package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
  81. package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
  82. package/dist/kernel/defaultAdapter.d.ts.map +1 -1
  83. package/dist/kernel/extendedConstructorOps.d.ts +9 -1
  84. package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
  85. package/dist/kernel/index.d.ts +1 -0
  86. package/dist/kernel/index.d.ts.map +1 -1
  87. package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
  88. package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
  89. package/dist/kernel/interfaces/construction-ops.d.ts +76 -0
  90. package/dist/kernel/interfaces/construction-ops.d.ts.map +1 -0
  91. package/dist/kernel/interfaces/core.d.ts +45 -0
  92. package/dist/kernel/interfaces/core.d.ts.map +1 -0
  93. package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
  94. package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
  95. package/dist/kernel/interfaces/geometry-ops.d.ts +77 -0
  96. package/dist/kernel/interfaces/geometry-ops.d.ts.map +1 -0
  97. package/dist/kernel/interfaces/index.d.ts +29 -0
  98. package/dist/kernel/interfaces/index.d.ts.map +1 -0
  99. package/dist/kernel/interfaces/io-ops.d.ts +66 -0
  100. package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
  101. package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
  102. package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
  103. package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
  104. package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
  105. package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
  106. package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
  107. package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
  108. package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
  109. package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
  110. package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
  111. package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
  112. package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
  113. package/dist/kernel/interfaces/transform-ops.d.ts +20 -0
  114. package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
  115. package/dist/kernel/modifierOps.d.ts +2 -2
  116. package/dist/kernel/modifierOps.d.ts.map +1 -1
  117. package/dist/kernel/types.d.ts +2 -446
  118. package/dist/kernel/types.d.ts.map +1 -1
  119. package/dist/{loft-hp3pc1M7.cjs → loft-BNvBZzqe.cjs} +5 -5
  120. package/dist/{loft-Bhw-FMoL.js → loft-D0aCZRaB.js} +7 -7
  121. package/dist/measurement/measureFns.d.ts +2 -2
  122. package/dist/measurement/measureFns.d.ts.map +1 -1
  123. package/dist/{measurement-D8EJ694A.js → measurement-C7o5jE6G.js} +2 -2
  124. package/dist/{measurement-BoNTUBAp.cjs → measurement-DZcaxo1A.cjs} +2 -2
  125. package/dist/measurement.cjs +1 -1
  126. package/dist/measurement.js +1 -1
  127. package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-7dgZgNYK.cjs} +4 -4
  128. package/dist/{meshFns-nQjK38EC.js → meshFns-CtUl9fGY.js} +3 -3
  129. package/dist/operations/compoundOpsFns.d.ts +38 -0
  130. package/dist/operations/compoundOpsFns.d.ts.map +1 -0
  131. package/dist/operations/extrude.d.ts +2 -12
  132. package/dist/operations/extrude.d.ts.map +1 -1
  133. package/dist/operations/extrudeFns.d.ts +2 -93
  134. package/dist/operations/extrudeFns.d.ts.map +1 -1
  135. package/dist/operations/guidedSweepFns.d.ts +3 -22
  136. package/dist/operations/guidedSweepFns.d.ts.map +1 -1
  137. package/dist/operations/loft.d.ts +2 -16
  138. package/dist/operations/loft.d.ts.map +1 -1
  139. package/dist/operations/multiSweepFns.d.ts +3 -29
  140. package/dist/operations/multiSweepFns.d.ts.map +1 -1
  141. package/dist/operations/roofFns.d.ts +2 -2
  142. package/dist/operations/roofFns.d.ts.map +1 -1
  143. package/dist/operations/sweepFns.d.ts +121 -0
  144. package/dist/operations/sweepFns.d.ts.map +1 -0
  145. package/dist/{operations-BfbkK6DU.js → operations-DisJ5F8s.js} +110 -57
  146. package/dist/{operations-CYpmLSC4.cjs → operations-DwZ-RBO1.cjs} +97 -44
  147. package/dist/operations.cjs +2 -2
  148. package/dist/operations.js +14 -14
  149. package/dist/originTrackingFns-NJ1dWoiF.js +137 -0
  150. package/dist/originTrackingFns-dhaCe8Yb.cjs +136 -0
  151. package/dist/query/edgeFinder.d.ts +4 -14
  152. package/dist/query/edgeFinder.d.ts.map +1 -1
  153. package/dist/query/faceFinder.d.ts +4 -14
  154. package/dist/query/faceFinder.d.ts.map +1 -1
  155. package/dist/query/finderCore.d.ts +6 -0
  156. package/dist/query/finderCore.d.ts.map +1 -1
  157. package/dist/query/shapeFinders.d.ts +32 -0
  158. package/dist/query/shapeFinders.d.ts.map +1 -0
  159. package/dist/query/wireFinder.d.ts +4 -9
  160. package/dist/query/wireFinder.d.ts.map +1 -1
  161. package/dist/query.cjs +54 -32
  162. package/dist/query.js +56 -34
  163. package/dist/{result-fAX0OZzI.cjs → result-DJAAj1yb.cjs} +8 -59
  164. package/dist/{result-BaSD1fqR.js → result-DtuwWSUD.js} +38 -89
  165. package/dist/result.cjs +1 -1
  166. package/dist/result.js +22 -22
  167. package/dist/shapeFns-BJbua5kT.js +34 -0
  168. package/dist/shapeFns-w9tWELHX.cjs +33 -0
  169. package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-CAEAyk8j.js} +233 -172
  170. package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-owrg2MNK.cjs} +421 -360
  171. package/dist/sketching/Sketcher.d.ts.map +1 -1
  172. package/dist/sketching.cjs +2 -2
  173. package/dist/sketching.js +2 -2
  174. package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BLQ4I6Ig.cjs} +3 -3
  175. package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-BS-1220W.js} +3 -3
  176. package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dj6AjhOv.js} +7 -7
  177. package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-KU_7OD2q.cjs} +3 -3
  178. package/dist/topology/booleanFns.d.ts.map +1 -1
  179. package/dist/topology/compoundOpsFns.d.ts +3 -35
  180. package/dist/topology/compoundOpsFns.d.ts.map +1 -1
  181. package/dist/topology/index.d.ts +0 -1
  182. package/dist/topology/index.d.ts.map +1 -1
  183. package/dist/topology/metadataPropagation.d.ts +30 -0
  184. package/dist/topology/metadataPropagation.d.ts.map +1 -0
  185. package/dist/topology/modifierFns.d.ts.map +1 -1
  186. package/dist/topology/originTrackingFns.d.ts +23 -0
  187. package/dist/topology/originTrackingFns.d.ts.map +1 -0
  188. package/dist/topology/shapeFns.d.ts +6 -120
  189. package/dist/topology/shapeFns.d.ts.map +1 -1
  190. package/dist/topology/topologyQueryFns.d.ts +67 -0
  191. package/dist/topology/topologyQueryFns.d.ts.map +1 -0
  192. package/dist/topology/transformFns.d.ts +49 -0
  193. package/dist/topology/transformFns.d.ts.map +1 -0
  194. package/dist/topology/wrapperFns.d.ts.map +1 -1
  195. package/dist/{topology-ANwCzGL8.cjs → topology-CyPHYYjV.cjs} +205 -20
  196. package/dist/{topology-C7x98OVn.js → topology-D6LeuhI_.js} +235 -50
  197. package/dist/topology.cjs +18 -17
  198. package/dist/topology.js +92 -91
  199. package/dist/topologyQueryFns-De439iBP.js +119 -0
  200. package/dist/topologyQueryFns-fz5kz5e1.cjs +118 -0
  201. package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
  202. package/dist/utils/precisionRound.d.ts +4 -0
  203. package/dist/utils/precisionRound.d.ts.map +1 -1
  204. package/dist/utils/vec2d.d.ts +5 -0
  205. package/dist/utils/vec2d.d.ts.map +1 -1
  206. package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
  207. package/dist/{vectors-D_IiZx0q.cjs → vectors-C8N_QeEX.cjs} +9 -1
  208. package/dist/{vectors-Bx8wkNui.js → vectors-DTREgnVp.js} +15 -7
  209. package/dist/vectors.cjs +1 -1
  210. package/dist/vectors.js +23 -23
  211. package/package.json +3 -3
  212. package/dist/core/geometryHelpers.d.ts +0 -30
  213. package/dist/core/geometryHelpers.d.ts.map +0 -1
  214. package/dist/core/memory.d.ts +0 -6
  215. package/dist/core/memory.d.ts.map +0 -1
  216. package/dist/core/typeErrors.d.ts +0 -17
  217. package/dist/core/typeErrors.d.ts.map +0 -1
  218. package/dist/cornerFinder-Ckz-mPHE.js +0 -59
  219. package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
  220. package/dist/shapeFns-C2SnNvdH.cjs +0 -468
  221. package/dist/shapeFns-FDuKkrDR.js +0 -469
  222. package/dist/utils/round2.d.ts +0 -3
  223. package/dist/utils/round2.d.ts.map +0 -1
  224. package/dist/utils/round5.d.ts +0 -3
  225. package/dist/utils/round5.d.ts.map +0 -1
package/dist/topology.js CHANGED
@@ -1,104 +1,105 @@
1
- import { h, d, a, f, e, c, x, y, i, z, A, B, C, v } from "./shapeFns-FDuKkrDR.js";
2
- import { a as a2, b, d as d2, e as e2, f as f2, g, c as c2, j, k, l, m, n, o, p, q, r, s, t, u, v as v2, w, x as x2, y as y2, z as z2, A as A2, B as B2, C as C2, D, E, F, G, H, I, J, K, L, M, N, O, P, Q } from "./topology-C7x98OVn.js";
3
- import { k as k2, j as j2 } from "./booleanFns-BCTjYZAg.js";
4
- import { h as h2, e as e3, b as b2, i as i2, f as f3, j as j3, d as d3, c as c3, a as a3, k as k3, l as l2, g as g2, m as m2, o as o2 } from "./curveFns-mROFhiuG.js";
5
- import { l as l3, c as c4, m as m3, j as j4, d as d4, e as e4, f as f4, q as q2, r as r2, g as g3, k as k4, s as s2, i as i3, n as n2, o as o3, p as p2, t as t2, w as w2, u as u2, h as h3 } from "./faceFns-B8GnxjdY.js";
6
- import { c as c5, b as b3, e as e5, d as d5, f as f5 } from "./meshFns-nQjK38EC.js";
1
+ import { g, b, i } from "./shapeFns-BJbua5kT.js";
2
+ import { d, e, f, g as g2, j, k, c, l, o, p, q, u, v, w, x, y, z, A, B, C, D, E, F, G, H, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y } from "./topology-D6LeuhI_.js";
3
+ import { h, g as g3 } from "./booleanFns-Br2KdGJq.js";
4
+ import { i as i2, h as h2, a, j as j2, c as c2, k as k2, f as f2, d as d2, e as e2, l as l2, g as g4, b as b2, m, o as o2 } from "./curveFns-1u0oZ0u0.js";
5
+ import { l as l3, c as c3, m as m2, j as j3, d as d3, e as e3, f as f3, q as q2, r, g as g5, k as k3, s, i as i3, n, o as o3, p as p2, t, w as w2, u as u2, h as h3 } from "./faceFns-DGMp47Os.js";
6
+ import { c as c4, b as b3, e as e4, d as d4, f as f4 } from "./meshFns-CtUl9fGY.js";
7
+ import { f as f5, d as d5, b as b4, e as e5, c as c5, i as i4, j as j4, k as k4, l as l4, m as m3, v as v2 } from "./topologyQueryFns-De439iBP.js";
7
8
  export {
8
- a2 as addHoles,
9
- b as adjacentFaces,
10
- h2 as approximateCurve,
9
+ d as addHoles,
10
+ e as adjacentFaces,
11
+ i2 as approximateCurve,
11
12
  l3 as asTopo,
12
- d2 as autoHeal,
13
- e2 as bezier,
14
- f2 as box,
15
- g as bsplineApprox,
16
- c4 as cast,
17
- c2 as chamferDistAngleShape,
18
- j as circle,
19
- m3 as classifyPointOnFace,
20
- c5 as clearMeshCache,
21
- k as compound,
22
- l as cone,
13
+ f as autoHeal,
14
+ g2 as bezier,
15
+ j as box,
16
+ k as bsplineApprox,
17
+ c3 as cast,
18
+ c as chamferDistAngleShape,
19
+ l as circle,
20
+ m2 as classifyPointOnFace,
21
+ c4 as clearMeshCache,
22
+ o as compound,
23
+ p as cone,
23
24
  b3 as createMeshCache,
24
- e3 as curveEndPoint,
25
- b2 as curveIsClosed,
26
- i2 as curveIsPeriodic,
27
- f3 as curveLength,
28
- j3 as curvePeriod,
29
- d3 as curvePointAt,
30
- c3 as curveStartPoint,
31
- a3 as curveTangentAt,
32
- k2 as cutAll,
33
- m as cylinder,
34
- j4 as deserializeShape,
35
- d4 as downcast,
36
- n as edgesOfFace,
37
- o as ellipse,
38
- p as ellipseArc,
39
- q as ellipsoid,
40
- e5 as exportIGES,
41
- d5 as exportSTEP,
42
- f5 as exportSTL,
43
- r as face,
44
- e4 as faceCenter,
45
- f4 as faceGeomType,
25
+ h2 as curveEndPoint,
26
+ a as curveIsClosed,
27
+ j2 as curveIsPeriodic,
28
+ c2 as curveLength,
29
+ k2 as curvePeriod,
30
+ f2 as curvePointAt,
31
+ d2 as curveStartPoint,
32
+ e2 as curveTangentAt,
33
+ h as cutAll,
34
+ q as cylinder,
35
+ j3 as deserializeShape,
36
+ d3 as downcast,
37
+ u as edgesOfFace,
38
+ v as ellipse,
39
+ w as ellipseArc,
40
+ x as ellipsoid,
41
+ e4 as exportIGES,
42
+ d4 as exportSTEP,
43
+ f4 as exportSTL,
44
+ y as face,
45
+ e3 as faceCenter,
46
+ f3 as faceGeomType,
46
47
  q2 as faceOrientation,
47
- s as facesOfEdge,
48
- t as filledFace,
49
- r2 as flipFaceOrientation,
50
- k3 as flipOrientation,
51
- j2 as fuseAll,
52
- h as getBounds,
53
- l2 as getCurveType,
54
- d as getEdges,
55
- a as getFaces,
56
- f as getHashCode,
57
- g2 as getOrientation,
58
- g3 as getSurfaceType,
59
- e as getVertices,
60
- c as getWires,
61
- u as healFace,
62
- v2 as healSolid,
63
- w as healWire,
64
- x2 as helix,
65
- k4 as innerWires,
66
- m2 as interpolateCurve,
67
- x as invalidateShapeCache,
68
- s2 as isCompSolid,
69
- y as isEqualShape,
48
+ z as facesOfEdge,
49
+ A as filledFace,
50
+ r as flipFaceOrientation,
51
+ l2 as flipOrientation,
52
+ g3 as fuseAll,
53
+ f5 as getBounds,
54
+ g4 as getCurveType,
55
+ d5 as getEdges,
56
+ b4 as getFaces,
57
+ g as getHashCode,
58
+ b2 as getOrientation,
59
+ g5 as getSurfaceType,
60
+ e5 as getVertices,
61
+ c5 as getWires,
62
+ B as healFace,
63
+ C as healSolid,
64
+ D as healWire,
65
+ E as helix,
66
+ k3 as innerWires,
67
+ m as interpolateCurve,
68
+ i4 as invalidateShapeCache,
69
+ s as isCompSolid,
70
+ b as isEqualShape,
70
71
  i as isSameShape,
71
- z as iterEdges,
72
- A as iterFaces,
72
+ j4 as iterEdges,
73
+ k4 as iterFaces,
73
74
  i3 as iterTopo,
74
- B as iterVertices,
75
- C as iterWires,
76
- y2 as line,
77
- n2 as normalAt,
78
- z2 as offsetFace,
75
+ l4 as iterVertices,
76
+ m3 as iterWires,
77
+ F as line,
78
+ n as normalAt,
79
+ G as offsetFace,
79
80
  o2 as offsetWire2D,
80
81
  o3 as outerWire,
81
82
  p2 as pointOnSurface,
82
- A2 as polygon,
83
- t2 as projectPointOnFace,
84
- B2 as sewShells,
83
+ H as polygon,
84
+ t as projectPointOnFace,
85
+ J as sewShells,
85
86
  w2 as shapeType,
86
- C2 as sharedEdges,
87
- D as solid,
88
- E as sphere,
89
- F as subFace,
90
- G as tangentArc,
91
- H as threePointArc,
92
- I as toBufferGeometryData,
93
- J as toGroupedBufferGeometryData,
94
- K as toLineGeometryData,
95
- L as torus,
87
+ K as sharedEdges,
88
+ L as solid,
89
+ M as sphere,
90
+ N as subFace,
91
+ O as tangentArc,
92
+ P as threePointArc,
93
+ Q as toBufferGeometryData,
94
+ R as toGroupedBufferGeometryData,
95
+ S as toLineGeometryData,
96
+ T as torus,
96
97
  u2 as uvBounds,
97
98
  h3 as uvCoordinates,
98
- M as vertex,
99
- v as vertexPosition,
100
- N as verticesOfEdge,
101
- O as wire,
102
- P as wireLoop,
103
- Q as wiresOfFace
99
+ U as vertex,
100
+ v2 as vertexPosition,
101
+ V as verticesOfEdge,
102
+ W as wire,
103
+ X as wireLoop,
104
+ Y as wiresOfFace
104
105
  };
@@ -0,0 +1,119 @@
1
+ import { g as getKernel, c as castShape, a as getShapeKind } from "./shapeTypes-CAEAyk8j.js";
2
+ import { i as iterTopo, d as downcast } from "./faceFns-DGMp47Os.js";
3
+ import { u as unwrap } from "./result-DtuwWSUD.js";
4
+ const topoCache = /* @__PURE__ */ new WeakMap();
5
+ function getOrCreateCache(shape) {
6
+ let entry = topoCache.get(shape.wrapped);
7
+ if (!entry) {
8
+ entry = {};
9
+ topoCache.set(shape.wrapped, entry);
10
+ }
11
+ return entry;
12
+ }
13
+ function getCacheEntry(shape) {
14
+ return topoCache.get(shape.wrapped);
15
+ }
16
+ function invalidateShapeCache(shape) {
17
+ topoCache.delete(shape.wrapped);
18
+ }
19
+ function getEdges(shape) {
20
+ const cache = getOrCreateCache(shape);
21
+ if (cache.edges) return cache.edges;
22
+ const edges = Array.from(iterTopo(shape.wrapped, "edge")).map(
23
+ (e) => castShape(unwrap(downcast(e)))
24
+ );
25
+ cache.edges = edges;
26
+ return edges;
27
+ }
28
+ function getFaces(shape) {
29
+ const cache = getOrCreateCache(shape);
30
+ if (cache.faces) return cache.faces;
31
+ const faces = Array.from(iterTopo(shape.wrapped, "face")).map(
32
+ (e) => castShape(unwrap(downcast(e)))
33
+ );
34
+ cache.faces = faces;
35
+ return faces;
36
+ }
37
+ function getWires(shape) {
38
+ const cache = getOrCreateCache(shape);
39
+ if (cache.wires) return cache.wires;
40
+ const wires = Array.from(iterTopo(shape.wrapped, "wire")).map(
41
+ (e) => castShape(unwrap(downcast(e)))
42
+ );
43
+ cache.wires = wires;
44
+ return wires;
45
+ }
46
+ function getVertices(shape) {
47
+ const cache = getOrCreateCache(shape);
48
+ if (cache.vertices) return cache.vertices;
49
+ const vertices = Array.from(iterTopo(shape.wrapped, "vertex")).map(
50
+ (e) => castShape(unwrap(downcast(e)))
51
+ );
52
+ cache.vertices = vertices;
53
+ return vertices;
54
+ }
55
+ function* iterEdges(shape) {
56
+ for (const e of iterTopo(shape.wrapped, "edge")) {
57
+ yield castShape(unwrap(downcast(e)));
58
+ }
59
+ }
60
+ function* iterFaces(shape) {
61
+ for (const f of iterTopo(shape.wrapped, "face")) {
62
+ yield castShape(unwrap(downcast(f)));
63
+ }
64
+ }
65
+ function* iterWires(shape) {
66
+ for (const w of iterTopo(shape.wrapped, "wire")) {
67
+ yield castShape(unwrap(downcast(w)));
68
+ }
69
+ }
70
+ function* iterVertices(shape) {
71
+ for (const v of iterTopo(shape.wrapped, "vertex")) {
72
+ yield castShape(unwrap(downcast(v)));
73
+ }
74
+ }
75
+ function getBounds(shape) {
76
+ const cache = getOrCreateCache(shape);
77
+ if (cache.bounds) return cache.bounds;
78
+ const { min, max } = getKernel().boundingBox(shape.wrapped);
79
+ const bounds = {
80
+ xMin: min[0],
81
+ xMax: max[0],
82
+ yMin: min[1],
83
+ yMax: max[1],
84
+ zMin: min[2],
85
+ zMax: max[2]
86
+ };
87
+ cache.bounds = bounds;
88
+ return bounds;
89
+ }
90
+ function describe(shape) {
91
+ return {
92
+ kind: getShapeKind(shape),
93
+ faceCount: getFaces(shape).length,
94
+ edgeCount: getEdges(shape).length,
95
+ wireCount: getWires(shape).length,
96
+ vertexCount: getVertices(shape).length,
97
+ valid: getKernel().isValid(shape.wrapped),
98
+ bounds: getBounds(shape)
99
+ };
100
+ }
101
+ function vertexPosition(vertex) {
102
+ return getKernel().vertexPosition(vertex.wrapped);
103
+ }
104
+ export {
105
+ getOrCreateCache as a,
106
+ getFaces as b,
107
+ getWires as c,
108
+ getEdges as d,
109
+ getVertices as e,
110
+ getBounds as f,
111
+ getCacheEntry as g,
112
+ describe as h,
113
+ invalidateShapeCache as i,
114
+ iterEdges as j,
115
+ iterFaces as k,
116
+ iterVertices as l,
117
+ iterWires as m,
118
+ vertexPosition as v
119
+ };
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ const shapeTypes = require("./shapeTypes-owrg2MNK.cjs");
3
+ const faceFns = require("./faceFns-BAKkZG6D.cjs");
4
+ const result = require("./result-DJAAj1yb.cjs");
5
+ const topoCache = /* @__PURE__ */ new WeakMap();
6
+ function getOrCreateCache(shape) {
7
+ let entry = topoCache.get(shape.wrapped);
8
+ if (!entry) {
9
+ entry = {};
10
+ topoCache.set(shape.wrapped, entry);
11
+ }
12
+ return entry;
13
+ }
14
+ function getCacheEntry(shape) {
15
+ return topoCache.get(shape.wrapped);
16
+ }
17
+ function invalidateShapeCache(shape) {
18
+ topoCache.delete(shape.wrapped);
19
+ }
20
+ function getEdges(shape) {
21
+ const cache = getOrCreateCache(shape);
22
+ if (cache.edges) return cache.edges;
23
+ const edges = Array.from(faceFns.iterTopo(shape.wrapped, "edge")).map(
24
+ (e) => shapeTypes.castShape(result.unwrap(faceFns.downcast(e)))
25
+ );
26
+ cache.edges = edges;
27
+ return edges;
28
+ }
29
+ function getFaces(shape) {
30
+ const cache = getOrCreateCache(shape);
31
+ if (cache.faces) return cache.faces;
32
+ const faces = Array.from(faceFns.iterTopo(shape.wrapped, "face")).map(
33
+ (e) => shapeTypes.castShape(result.unwrap(faceFns.downcast(e)))
34
+ );
35
+ cache.faces = faces;
36
+ return faces;
37
+ }
38
+ function getWires(shape) {
39
+ const cache = getOrCreateCache(shape);
40
+ if (cache.wires) return cache.wires;
41
+ const wires = Array.from(faceFns.iterTopo(shape.wrapped, "wire")).map(
42
+ (e) => shapeTypes.castShape(result.unwrap(faceFns.downcast(e)))
43
+ );
44
+ cache.wires = wires;
45
+ return wires;
46
+ }
47
+ function getVertices(shape) {
48
+ const cache = getOrCreateCache(shape);
49
+ if (cache.vertices) return cache.vertices;
50
+ const vertices = Array.from(faceFns.iterTopo(shape.wrapped, "vertex")).map(
51
+ (e) => shapeTypes.castShape(result.unwrap(faceFns.downcast(e)))
52
+ );
53
+ cache.vertices = vertices;
54
+ return vertices;
55
+ }
56
+ function* iterEdges(shape) {
57
+ for (const e of faceFns.iterTopo(shape.wrapped, "edge")) {
58
+ yield shapeTypes.castShape(result.unwrap(faceFns.downcast(e)));
59
+ }
60
+ }
61
+ function* iterFaces(shape) {
62
+ for (const f of faceFns.iterTopo(shape.wrapped, "face")) {
63
+ yield shapeTypes.castShape(result.unwrap(faceFns.downcast(f)));
64
+ }
65
+ }
66
+ function* iterWires(shape) {
67
+ for (const w of faceFns.iterTopo(shape.wrapped, "wire")) {
68
+ yield shapeTypes.castShape(result.unwrap(faceFns.downcast(w)));
69
+ }
70
+ }
71
+ function* iterVertices(shape) {
72
+ for (const v of faceFns.iterTopo(shape.wrapped, "vertex")) {
73
+ yield shapeTypes.castShape(result.unwrap(faceFns.downcast(v)));
74
+ }
75
+ }
76
+ function getBounds(shape) {
77
+ const cache = getOrCreateCache(shape);
78
+ if (cache.bounds) return cache.bounds;
79
+ const { min, max } = shapeTypes.getKernel().boundingBox(shape.wrapped);
80
+ const bounds = {
81
+ xMin: min[0],
82
+ xMax: max[0],
83
+ yMin: min[1],
84
+ yMax: max[1],
85
+ zMin: min[2],
86
+ zMax: max[2]
87
+ };
88
+ cache.bounds = bounds;
89
+ return bounds;
90
+ }
91
+ function describe(shape) {
92
+ return {
93
+ kind: shapeTypes.getShapeKind(shape),
94
+ faceCount: getFaces(shape).length,
95
+ edgeCount: getEdges(shape).length,
96
+ wireCount: getWires(shape).length,
97
+ vertexCount: getVertices(shape).length,
98
+ valid: shapeTypes.getKernel().isValid(shape.wrapped),
99
+ bounds: getBounds(shape)
100
+ };
101
+ }
102
+ function vertexPosition(vertex) {
103
+ return shapeTypes.getKernel().vertexPosition(vertex.wrapped);
104
+ }
105
+ exports.describe = describe;
106
+ exports.getBounds = getBounds;
107
+ exports.getCacheEntry = getCacheEntry;
108
+ exports.getEdges = getEdges;
109
+ exports.getFaces = getFaces;
110
+ exports.getOrCreateCache = getOrCreateCache;
111
+ exports.getVertices = getVertices;
112
+ exports.getWires = getWires;
113
+ exports.invalidateShapeCache = invalidateShapeCache;
114
+ exports.iterEdges = iterEdges;
115
+ exports.iterFaces = iterFaces;
116
+ exports.iterVertices = iterVertices;
117
+ exports.iterWires = iterWires;
118
+ exports.vertexPosition = vertexPosition;
@@ -19,7 +19,7 @@ function resolveDirection(d) {
19
19
  return d;
20
20
  }
21
21
  export {
22
- toVec3 as a,
22
+ toVec2 as a,
23
23
  resolveDirection as r,
24
- toVec2 as t
24
+ toVec3 as t
25
25
  };
@@ -4,4 +4,8 @@
4
4
  * @param precision - Number of decimal places (may be negative for rounding to tens, hundreds, etc.).
5
5
  */
6
6
  export default function precisionRound(number: number, precision: number): number;
7
+ /** Round a number to 2 decimal places. */
8
+ export declare function round2(v: number): number;
9
+ /** Round a number to 5 decimal places. */
10
+ export declare function round5(v: number): number;
7
11
  //# sourceMappingURL=precisionRound.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"precisionRound.d.ts","sourceRoot":"","sources":["../../src/utils/precisionRound.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAIhF"}
1
+ {"version":3,"file":"precisionRound.d.ts","sourceRoot":"","sources":["../../src/utils/precisionRound.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAIhF;AAED,0CAA0C;AAC1C,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED,0CAA0C;AAC1C,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC"}
@@ -44,6 +44,11 @@ export declare const polarAngle2d: ([x0, y0]: Point2D, [x1, y1]?: Point2D) => nu
44
44
  * ```
45
45
  */
46
46
  export declare const rotate2d: (point: Point2D, angle: number, center?: Point2D) => Point2D;
47
+ /**
48
+ * Normalize a 2D vector to unit length.
49
+ * Returns `[0, 0]` for zero-length vectors (within epsilon).
50
+ */
51
+ export declare function normalize2d([x, y]: Point2D): Point2D;
47
52
  /** Convert polar coordinates (r, theta) to a Cartesian Point2D. */
48
53
  export declare const polarToCartesian: (r: number, theta: number) => Point2D;
49
54
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"vec2d.d.ts","sourceRoot":"","sources":["../../src/utils/vec2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,6DAA6D;AAC7D,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAMvC,iEAAiE;AACjE,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,wDAAwD;AACxD,eAAO,MAAM,eAAe,WAAO,CAAC;AAMpC,qEAAqE;AACrE,eAAO,MAAM,SAAS,GACpB,UAAU,OAAO,EACjB,UAAU,OAAO,EACjB,kBAA2B,KAC1B,OAEF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,KAAK,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAE5D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAEjE,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,QAAQ,MAAM,KAAG,OAEpE,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE1E,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEhF,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAE3E;AAED,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAEzE;AAED,oEAAoE;AACpE,eAAO,MAAM,OAAO,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEvE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE5E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,EAAE,SAAQ,OAAgB,KAAG,OAclF,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,EAAE,OAAO,MAAM,KAAG,OAI3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,KAAG,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC"}
1
+ {"version":3,"file":"vec2d.d.ts","sourceRoot":"","sources":["../../src/utils/vec2d.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,6DAA6D;AAC7D,MAAM,MAAM,OAAO,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAMvC,iEAAiE;AACjE,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAE3C,8EAA8E;AAC9E,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,wDAAwD;AACxD,eAAO,MAAM,eAAe,WAAO,CAAC;AAMpC,qEAAqE;AACrE,eAAO,MAAM,SAAS,GACpB,UAAU,OAAO,EACjB,UAAU,OAAO,EACjB,kBAA2B,KAC1B,OAEF,CAAC;AAEF,yCAAyC;AACzC,eAAO,MAAM,KAAK,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAE5D,CAAC;AAEF,oDAAoD;AACpD,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,UAAU,OAAO,KAAG,OAEjE,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,QAAQ,MAAM,KAAG,OAEpE,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE1E,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,gBAAgB,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEhF,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,cAAc,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAE3E;AAED,iDAAiD;AACjD,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,OAAO,GAAG,MAAM,CAEzE;AAED,oEAAoE;AACpE,eAAO,MAAM,OAAO,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAEvE,CAAC;AAEF,+EAA+E;AAC/E,eAAO,MAAM,YAAY,GAAI,UAAU,OAAO,EAAE,WAAU,OAAgB,KAAG,MAE5E,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,OAAO,MAAM,EAAE,SAAQ,OAAgB,KAAG,OAclF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAGpD;AAED,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,EAAE,OAAO,MAAM,KAAG,OAI3D,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,GAAI,QAAQ,OAAO,KAAG,CAAC,MAAM,EAAE,MAAM,CAIjE,CAAC"}
@@ -74,20 +74,20 @@ export {
74
74
  DEG2RAD as D,
75
75
  HASH_CODE_MAX as H,
76
76
  RAD2DEG as R,
77
- vecAngle as a,
78
- vecCross as b,
79
- vecDistance as c,
77
+ vecAdd as a,
78
+ vecScale as b,
79
+ vecNormalize as c,
80
80
  vecDot as d,
81
- vecEquals as e,
82
- vecIsZero as f,
83
- vecLength as g,
84
- vecLengthSq as h,
85
- vecNegate as i,
86
- vecNormalize as j,
87
- vecProjectToPlane as k,
88
- vecRepr as l,
89
- vecRotate as m,
90
- vecScale as n,
91
- vecSub as o,
92
- vecAdd as v
81
+ vecCross as e,
82
+ vecSub as f,
83
+ vecRotate as g,
84
+ vecDistance as h,
85
+ vecIsZero as i,
86
+ vecAngle as j,
87
+ vecEquals as k,
88
+ vecLengthSq as l,
89
+ vecNegate as m,
90
+ vecProjectToPlane as n,
91
+ vecRepr as o,
92
+ vecLength as v
93
93
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const types = require("./types-CA_xrgDq.cjs");
3
3
  const vecOps = require("./vecOps-CjRL1jau.cjs");
4
- const result = require("./result-fAX0OZzI.cjs");
4
+ const result = require("./result-DJAAj1yb.cjs");
5
5
  function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
6
6
  const zDir = vecOps.vecNormalize(normal);
7
7
  if (vecOps.vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
@@ -58,6 +58,13 @@ function resolvePlane(input, origin) {
58
58
  }
59
59
  return input;
60
60
  }
61
+ function makePlane(plane, origin) {
62
+ if (plane && typeof plane !== "string") {
63
+ return { ...plane };
64
+ } else {
65
+ return resolvePlane(plane ?? "XY", origin);
66
+ }
67
+ }
61
68
  function planeToWorld(plane, local) {
62
69
  const [u, v] = local;
63
70
  return vecOps.vecAdd(vecOps.vecAdd(plane.origin, vecOps.vecScale(plane.xDir, u)), vecOps.vecScale(plane.yDir, v));
@@ -74,6 +81,7 @@ function pivotPlane(plane, angleDeg, axis = [1, 0, 0]) {
74
81
  }
75
82
  exports.createNamedPlane = createNamedPlane;
76
83
  exports.createPlane = createPlane;
84
+ exports.makePlane = makePlane;
77
85
  exports.pivotPlane = pivotPlane;
78
86
  exports.planeToWorld = planeToWorld;
79
87
  exports.resolvePlane = resolvePlane;
@@ -1,6 +1,6 @@
1
- import { a as toVec3 } from "./types-CWDdqcrq.js";
2
- import { j as vecNormalize, f as vecIsZero, b as vecCross, v as vecAdd, n as vecScale, m as vecRotate, D as DEG2RAD } from "./vecOps-ZDdZWbwT.js";
3
- import { e as err, z as validationError, o as ok } from "./result-BaSD1fqR.js";
1
+ import { t as toVec3 } from "./types-CcKqsmd0.js";
2
+ import { c as vecNormalize, i as vecIsZero, e as vecCross, a as vecAdd, b as vecScale, g as vecRotate, D as DEG2RAD } from "./vecOps-LTN--A58.js";
3
+ import { e as err, v as validationError, o as ok } from "./result-DtuwWSUD.js";
4
4
  function createPlane(origin, xDirection = null, normal = [0, 0, 1]) {
5
5
  const zDir = vecNormalize(normal);
6
6
  if (vecIsZero(zDir)) throw new Error("Plane normal must be non-zero");
@@ -57,6 +57,13 @@ function resolvePlane(input, origin) {
57
57
  }
58
58
  return input;
59
59
  }
60
+ function makePlane(plane, origin) {
61
+ if (plane && typeof plane !== "string") {
62
+ return { ...plane };
63
+ } else {
64
+ return resolvePlane(plane ?? "XY", origin);
65
+ }
66
+ }
60
67
  function planeToWorld(plane, local) {
61
68
  const [u, v] = local;
62
69
  return vecAdd(vecAdd(plane.origin, vecScale(plane.xDir, u)), vecScale(plane.yDir, v));
@@ -72,10 +79,11 @@ function pivotPlane(plane, angleDeg, axis = [1, 0, 0]) {
72
79
  return { origin: plane.origin, xDir: newXDir, yDir: newYDir, zDir: newZDir };
73
80
  }
74
81
  export {
75
- createPlane as a,
76
- planeToWorld as b,
77
- createNamedPlane as c,
78
- pivotPlane as p,
82
+ createNamedPlane as a,
83
+ pivotPlane as b,
84
+ createPlane as c,
85
+ makePlane as m,
86
+ planeToWorld as p,
79
87
  resolvePlane as r,
80
88
  translatePlane as t
81
89
  };
package/dist/vectors.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const types = require("./types-CA_xrgDq.cjs");
4
4
  const vecOps = require("./vecOps-CjRL1jau.cjs");
5
- const vectors = require("./vectors-D_IiZx0q.cjs");
5
+ const vectors = require("./vectors-C8N_QeEX.cjs");
6
6
  exports.resolveDirection = types.resolveDirection;
7
7
  exports.toVec2 = types.toVec2;
8
8
  exports.toVec3 = types.toVec3;
package/dist/vectors.js CHANGED
@@ -1,31 +1,31 @@
1
- import { r, t, a } from "./types-CWDdqcrq.js";
2
- import { D, R, v, a as a2, b, c, d, e, f, g, h, i, j, k, l, m, n, o } from "./vecOps-ZDdZWbwT.js";
3
- import { c as c2, a as a3, p, r as r2, t as t2 } from "./vectors-Bx8wkNui.js";
1
+ import { r, a, t } from "./types-CcKqsmd0.js";
2
+ import { D, R, a as a2, j, e, h, d, k, i, v, l, m, c, n, o, g, b, f } from "./vecOps-LTN--A58.js";
3
+ import { a as a3, c as c2, b as b2, r as r2, t as t2 } from "./vectors-DTREgnVp.js";
4
4
  export {
5
5
  D as DEG2RAD,
6
6
  R as RAD2DEG,
7
- c2 as createNamedPlane,
8
- a3 as createPlane,
9
- p as pivotPlane,
7
+ a3 as createNamedPlane,
8
+ c2 as createPlane,
9
+ b2 as pivotPlane,
10
10
  r as resolveDirection,
11
11
  r2 as resolvePlane,
12
- t as toVec2,
13
- a as toVec3,
12
+ a as toVec2,
13
+ t as toVec3,
14
14
  t2 as translatePlane,
15
- v as vecAdd,
16
- a2 as vecAngle,
17
- b as vecCross,
18
- c as vecDistance,
15
+ a2 as vecAdd,
16
+ j as vecAngle,
17
+ e as vecCross,
18
+ h as vecDistance,
19
19
  d as vecDot,
20
- e as vecEquals,
21
- f as vecIsZero,
22
- g as vecLength,
23
- h as vecLengthSq,
24
- i as vecNegate,
25
- j as vecNormalize,
26
- k as vecProjectToPlane,
27
- l as vecRepr,
28
- m as vecRotate,
29
- n as vecScale,
30
- o as vecSub
20
+ k as vecEquals,
21
+ i as vecIsZero,
22
+ v as vecLength,
23
+ l as vecLengthSq,
24
+ m as vecNegate,
25
+ c as vecNormalize,
26
+ n as vecProjectToPlane,
27
+ o as vecRepr,
28
+ g as vecRotate,
29
+ b as vecScale,
30
+ f as vecSub
31
31
  };