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.
- package/dist/2d/lib/svgPath.d.ts.map +1 -1
- package/dist/2d/lib/vectorOperations.d.ts +4 -1
- package/dist/2d/lib/vectorOperations.d.ts.map +1 -1
- package/dist/2d.cjs +2 -2
- package/dist/2d.js +5 -5
- package/dist/{Blueprint-DbVaf6k7.js → Blueprint-1HGbugaC.js} +33 -63
- package/dist/{Blueprint-CQ28WJhz.cjs → Blueprint-CUyXM6CV.cjs} +15 -45
- package/dist/{boolean2D-0blbVtJ8.cjs → boolean2D-9OnbotKT.cjs} +9 -9
- package/dist/{boolean2D-y3E92F0u.js → boolean2D-CR4efa35.js} +11 -11
- package/dist/{booleanFns-gmsX3Cv2.cjs → booleanFns-BBd2oTvv.cjs} +43 -40
- package/dist/{booleanFns-BCTjYZAg.js → booleanFns-Br2KdGJq.js} +53 -50
- package/dist/brepjs.cjs +379 -284
- package/dist/brepjs.js +1437 -1341
- package/dist/core/definitionMaps.d.ts +2 -7
- package/dist/core/definitionMaps.d.ts.map +1 -1
- package/dist/core/dimensionTypes.d.ts +52 -0
- package/dist/core/dimensionTypes.d.ts.map +1 -0
- package/dist/core/disposal.d.ts +18 -0
- package/dist/core/disposal.d.ts.map +1 -1
- package/dist/core/errors.d.ts +1 -8
- package/dist/core/errors.d.ts.map +1 -1
- package/dist/core/kernelErrorTranslation.d.ts +15 -0
- package/dist/core/kernelErrorTranslation.d.ts.map +1 -0
- package/dist/core/planeOps.d.ts +14 -0
- package/dist/core/planeOps.d.ts.map +1 -1
- package/dist/core/result.d.ts +4 -0
- package/dist/core/result.d.ts.map +1 -1
- package/dist/core/shapeTypes.d.ts +14 -146
- package/dist/core/shapeTypes.d.ts.map +1 -1
- package/dist/core/typeDiscriminants.d.ts +14 -0
- package/dist/core/typeDiscriminants.d.ts.map +1 -0
- package/dist/core/validityTypes.d.ts +100 -0
- package/dist/core/validityTypes.d.ts.map +1 -0
- package/dist/core.cjs +52 -11
- package/dist/core.d.ts +1 -1
- package/dist/core.d.ts.map +1 -1
- package/dist/core.js +118 -75
- package/dist/{curveFns-mROFhiuG.js → curveFns-1u0oZ0u0.js} +14 -14
- package/dist/{curveFns-BZngcnQ1.cjs → curveFns-BwLvO_Ia.cjs} +2 -2
- package/dist/{drawFns-Bwakrq7w.js → drawFns-B0na6sbo.js} +16 -16
- package/dist/{drawFns-CjRc1NfQ.cjs → drawFns-CzlEePor.cjs} +18 -18
- package/dist/{faceFns-DB1Fc5gy.cjs → faceFns-BAKkZG6D.cjs} +2 -2
- package/dist/{faceFns-B8GnxjdY.js → faceFns-DGMp47Os.js} +3 -3
- package/dist/{helpers-C8NoT0Wu.cjs → helpers-DVdscQxW.cjs} +73 -8
- package/dist/{helpers-X0juxnwj.js → helpers-sJjnIXDA.js} +85 -20
- package/dist/index.d.ts +10 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/io.cjs +4 -4
- package/dist/io.js +4 -4
- package/dist/kernel/brepkit/booleanOps.d.ts +23 -0
- package/dist/kernel/brepkit/booleanOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/constructionOps.d.ts +51 -0
- package/dist/kernel/brepkit/constructionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts +31 -0
- package/dist/kernel/brepkit/evolutionOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/geometryOps.d.ts +56 -0
- package/dist/kernel/brepkit/geometryOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/helpers.d.ts +84 -0
- package/dist/kernel/brepkit/helpers.d.ts.map +1 -0
- package/dist/kernel/brepkit/internalOps.d.ts +28 -0
- package/dist/kernel/brepkit/internalOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/ioOps.d.ts +43 -0
- package/dist/kernel/brepkit/ioOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/measureOps.d.ts +30 -0
- package/dist/kernel/brepkit/measureOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/meshOps.d.ts +7 -0
- package/dist/kernel/brepkit/meshOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/modifierOps.d.ts +15 -0
- package/dist/kernel/brepkit/modifierOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/repairOps.d.ts +14 -0
- package/dist/kernel/brepkit/repairOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/sweepOps.d.ts +27 -0
- package/dist/kernel/brepkit/sweepOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/topologyOps.d.ts +16 -0
- package/dist/kernel/brepkit/topologyOps.d.ts.map +1 -0
- package/dist/kernel/brepkit/transformOps.d.ts +14 -0
- package/dist/kernel/brepkit/transformOps.d.ts.map +1 -0
- package/dist/kernel/brepkitAdapter.d.ts +1 -1
- package/dist/kernel/brepkitAdapter.d.ts.map +1 -1
- package/dist/kernel/brepkitWasmTypes.d.ts +8 -0
- package/dist/kernel/brepkitWasmTypes.d.ts.map +1 -1
- package/dist/kernel/defaultAdapter.d.ts.map +1 -1
- package/dist/kernel/extendedConstructorOps.d.ts +9 -1
- package/dist/kernel/extendedConstructorOps.d.ts.map +1 -1
- package/dist/kernel/index.d.ts +1 -0
- package/dist/kernel/index.d.ts.map +1 -1
- package/dist/kernel/interfaces/boolean-ops.d.ts +25 -0
- package/dist/kernel/interfaces/boolean-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/construction-ops.d.ts +76 -0
- package/dist/kernel/interfaces/construction-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/core.d.ts +45 -0
- package/dist/kernel/interfaces/core.d.ts.map +1 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts +19 -0
- package/dist/kernel/interfaces/evolution-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/geometry-ops.d.ts +77 -0
- package/dist/kernel/interfaces/geometry-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/index.d.ts +29 -0
- package/dist/kernel/interfaces/index.d.ts.map +1 -0
- package/dist/kernel/interfaces/io-ops.d.ts +66 -0
- package/dist/kernel/interfaces/io-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/measure-ops.d.ts +35 -0
- package/dist/kernel/interfaces/measure-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts +21 -0
- package/dist/kernel/interfaces/mesh-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts +22 -0
- package/dist/kernel/interfaces/modifier-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/repair-ops.d.ts +36 -0
- package/dist/kernel/interfaces/repair-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts +49 -0
- package/dist/kernel/interfaces/sweep-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/topology-ops.d.ts +30 -0
- package/dist/kernel/interfaces/topology-ops.d.ts.map +1 -0
- package/dist/kernel/interfaces/transform-ops.d.ts +20 -0
- package/dist/kernel/interfaces/transform-ops.d.ts.map +1 -0
- package/dist/kernel/modifierOps.d.ts +2 -2
- package/dist/kernel/modifierOps.d.ts.map +1 -1
- package/dist/kernel/types.d.ts +2 -446
- package/dist/kernel/types.d.ts.map +1 -1
- package/dist/{loft-hp3pc1M7.cjs → loft-BNvBZzqe.cjs} +5 -5
- package/dist/{loft-Bhw-FMoL.js → loft-D0aCZRaB.js} +7 -7
- package/dist/measurement/measureFns.d.ts +2 -2
- package/dist/measurement/measureFns.d.ts.map +1 -1
- package/dist/{measurement-D8EJ694A.js → measurement-C7o5jE6G.js} +2 -2
- package/dist/{measurement-BoNTUBAp.cjs → measurement-DZcaxo1A.cjs} +2 -2
- package/dist/measurement.cjs +1 -1
- package/dist/measurement.js +1 -1
- package/dist/{meshFns-BnV0ZR8w.cjs → meshFns-7dgZgNYK.cjs} +4 -4
- package/dist/{meshFns-nQjK38EC.js → meshFns-CtUl9fGY.js} +3 -3
- package/dist/operations/compoundOpsFns.d.ts +38 -0
- package/dist/operations/compoundOpsFns.d.ts.map +1 -0
- package/dist/operations/extrude.d.ts +2 -12
- package/dist/operations/extrude.d.ts.map +1 -1
- package/dist/operations/extrudeFns.d.ts +2 -93
- package/dist/operations/extrudeFns.d.ts.map +1 -1
- package/dist/operations/guidedSweepFns.d.ts +3 -22
- package/dist/operations/guidedSweepFns.d.ts.map +1 -1
- package/dist/operations/loft.d.ts +2 -16
- package/dist/operations/loft.d.ts.map +1 -1
- package/dist/operations/multiSweepFns.d.ts +3 -29
- package/dist/operations/multiSweepFns.d.ts.map +1 -1
- package/dist/operations/roofFns.d.ts +2 -2
- package/dist/operations/roofFns.d.ts.map +1 -1
- package/dist/operations/sweepFns.d.ts +121 -0
- package/dist/operations/sweepFns.d.ts.map +1 -0
- package/dist/{operations-BfbkK6DU.js → operations-DisJ5F8s.js} +110 -57
- package/dist/{operations-CYpmLSC4.cjs → operations-DwZ-RBO1.cjs} +97 -44
- package/dist/operations.cjs +2 -2
- package/dist/operations.js +14 -14
- package/dist/originTrackingFns-NJ1dWoiF.js +137 -0
- package/dist/originTrackingFns-dhaCe8Yb.cjs +136 -0
- package/dist/query/edgeFinder.d.ts +4 -14
- package/dist/query/edgeFinder.d.ts.map +1 -1
- package/dist/query/faceFinder.d.ts +4 -14
- package/dist/query/faceFinder.d.ts.map +1 -1
- package/dist/query/finderCore.d.ts +6 -0
- package/dist/query/finderCore.d.ts.map +1 -1
- package/dist/query/shapeFinders.d.ts +32 -0
- package/dist/query/shapeFinders.d.ts.map +1 -0
- package/dist/query/wireFinder.d.ts +4 -9
- package/dist/query/wireFinder.d.ts.map +1 -1
- package/dist/query.cjs +54 -32
- package/dist/query.js +56 -34
- package/dist/{result-fAX0OZzI.cjs → result-DJAAj1yb.cjs} +8 -59
- package/dist/{result-BaSD1fqR.js → result-DtuwWSUD.js} +38 -89
- package/dist/result.cjs +1 -1
- package/dist/result.js +22 -22
- package/dist/shapeFns-BJbua5kT.js +34 -0
- package/dist/shapeFns-w9tWELHX.cjs +33 -0
- package/dist/{shapeTypes-CpSaBLDv.js → shapeTypes-CAEAyk8j.js} +233 -172
- package/dist/{shapeTypes-7xEam9Ri.cjs → shapeTypes-owrg2MNK.cjs} +421 -360
- package/dist/sketching/Sketcher.d.ts.map +1 -1
- package/dist/sketching.cjs +2 -2
- package/dist/sketching.js +2 -2
- package/dist/{solidBuilders-994_MQwB.cjs → solidBuilders-BLQ4I6Ig.cjs} +3 -3
- package/dist/{solidBuilders-DmwhTCCd.js → solidBuilders-BS-1220W.js} +3 -3
- package/dist/{surfaceBuilders-nQdJ56fe.js → surfaceBuilders-Dj6AjhOv.js} +7 -7
- package/dist/{surfaceBuilders-5VA34a3_.cjs → surfaceBuilders-KU_7OD2q.cjs} +3 -3
- package/dist/topology/booleanFns.d.ts.map +1 -1
- package/dist/topology/compoundOpsFns.d.ts +3 -35
- package/dist/topology/compoundOpsFns.d.ts.map +1 -1
- package/dist/topology/index.d.ts +0 -1
- package/dist/topology/index.d.ts.map +1 -1
- package/dist/topology/metadataPropagation.d.ts +30 -0
- package/dist/topology/metadataPropagation.d.ts.map +1 -0
- package/dist/topology/modifierFns.d.ts.map +1 -1
- package/dist/topology/originTrackingFns.d.ts +23 -0
- package/dist/topology/originTrackingFns.d.ts.map +1 -0
- package/dist/topology/shapeFns.d.ts +6 -120
- package/dist/topology/shapeFns.d.ts.map +1 -1
- package/dist/topology/topologyQueryFns.d.ts +67 -0
- package/dist/topology/topologyQueryFns.d.ts.map +1 -0
- package/dist/topology/transformFns.d.ts +49 -0
- package/dist/topology/transformFns.d.ts.map +1 -0
- package/dist/topology/wrapperFns.d.ts.map +1 -1
- package/dist/{topology-ANwCzGL8.cjs → topology-CyPHYYjV.cjs} +205 -20
- package/dist/{topology-C7x98OVn.js → topology-D6LeuhI_.js} +235 -50
- package/dist/topology.cjs +18 -17
- package/dist/topology.js +92 -91
- package/dist/topologyQueryFns-De439iBP.js +119 -0
- package/dist/topologyQueryFns-fz5kz5e1.cjs +118 -0
- package/dist/{types-CWDdqcrq.js → types-CcKqsmd0.js} +2 -2
- package/dist/utils/precisionRound.d.ts +4 -0
- package/dist/utils/precisionRound.d.ts.map +1 -1
- package/dist/utils/vec2d.d.ts +5 -0
- package/dist/utils/vec2d.d.ts.map +1 -1
- package/dist/{vecOps-ZDdZWbwT.js → vecOps-LTN--A58.js} +15 -15
- package/dist/{vectors-D_IiZx0q.cjs → vectors-C8N_QeEX.cjs} +9 -1
- package/dist/{vectors-Bx8wkNui.js → vectors-DTREgnVp.js} +15 -7
- package/dist/vectors.cjs +1 -1
- package/dist/vectors.js +23 -23
- package/package.json +3 -3
- package/dist/core/geometryHelpers.d.ts +0 -30
- package/dist/core/geometryHelpers.d.ts.map +0 -1
- package/dist/core/memory.d.ts +0 -6
- package/dist/core/memory.d.ts.map +0 -1
- package/dist/core/typeErrors.d.ts +0 -17
- package/dist/core/typeErrors.d.ts.map +0 -1
- package/dist/cornerFinder-Ckz-mPHE.js +0 -59
- package/dist/cornerFinder-ZmOyOOsh.cjs +0 -58
- package/dist/shapeFns-C2SnNvdH.cjs +0 -468
- package/dist/shapeFns-FDuKkrDR.js +0 -469
- package/dist/utils/round2.d.ts +0 -3
- package/dist/utils/round2.d.ts.map +0 -1
- package/dist/utils/round5.d.ts +0 -3
- package/dist/utils/round5.d.ts.map +0 -1
package/dist/topology.js
CHANGED
|
@@ -1,104 +1,105 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { l as l3, c as
|
|
6
|
-
import { c as
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
d as addHoles,
|
|
10
|
+
e as adjacentFaces,
|
|
11
|
+
i2 as approximateCurve,
|
|
11
12
|
l3 as asTopo,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
72
|
+
j4 as iterEdges,
|
|
73
|
+
k4 as iterFaces,
|
|
73
74
|
i3 as iterTopo,
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
H as polygon,
|
|
84
|
+
t as projectPointOnFace,
|
|
85
|
+
J as sewShells,
|
|
85
86
|
w2 as shapeType,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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;
|
|
@@ -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"}
|
package/dist/utils/vec2d.d.ts
CHANGED
|
@@ -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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
vecAdd as a,
|
|
78
|
+
vecScale as b,
|
|
79
|
+
vecNormalize as c,
|
|
80
80
|
vecDot as d,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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-
|
|
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 {
|
|
2
|
-
import {
|
|
3
|
-
import { e as err,
|
|
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
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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-
|
|
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,
|
|
2
|
-
import { D, R,
|
|
3
|
-
import { c as c2,
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
a3 as createNamedPlane,
|
|
8
|
+
c2 as createPlane,
|
|
9
|
+
b2 as pivotPlane,
|
|
10
10
|
r as resolveDirection,
|
|
11
11
|
r2 as resolvePlane,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
a as toVec2,
|
|
13
|
+
t as toVec3,
|
|
14
14
|
t2 as translatePlane,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
a2 as vecAdd,
|
|
16
|
+
j as vecAngle,
|
|
17
|
+
e as vecCross,
|
|
18
|
+
h as vecDistance,
|
|
19
19
|
d as vecDot,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
};
|