curvy 1.0.9 → 2.0.0-alpha.2
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/characteristic/index.d.mts +88 -0
- package/dist/characteristic/index.mjs +2 -0
- package/dist/curve/index.d.mts +2 -0
- package/dist/curve/index.mjs +2 -0
- package/dist/interval/index.d.mts +3 -0
- package/dist/interval/index.mjs +3 -0
- package/dist/matrix/index.d.mts +2 -0
- package/dist/matrix/index.mjs +267 -0
- package/dist/matrix/index.mjs.map +1 -0
- package/dist/number.d.mts +280 -0
- package/dist/number.mjs +140 -0
- package/dist/number.mjs.map +1 -0
- package/dist/path/index.d.mts +261 -0
- package/dist/path/index.mjs +325 -0
- package/dist/path/index.mjs.map +1 -0
- package/dist/polynomial/index.d.mts +2 -0
- package/dist/polynomial/index.mjs +3 -0
- package/dist/shared/characteristic-B9nCh_cx.mjs +104 -0
- package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
- package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
- package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
- package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
- package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
- package/dist/shared/interval-05CR6eBf.mjs +421 -0
- package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
- package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
- package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
- package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
- package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
- package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
- package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
- package/dist/shared/quadratic-CamozcFc.mjs +330 -0
- package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
- package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
- package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
- package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
- package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
- package/dist/shared/solution-CrtLfqEq.mjs +306 -0
- package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
- package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
- package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
- package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
- package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
- package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
- package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
- package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
- package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
- package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
- package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
- package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
- package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
- package/dist/solution/index.d.mts +2 -0
- package/dist/solution/index.mjs +2 -0
- package/dist/splines/index.d.mts +701 -0
- package/dist/splines/index.mjs +734 -0
- package/dist/splines/index.mjs.map +1 -0
- package/dist/utils.d.mts +2 -205
- package/dist/utils.mjs +88 -52
- package/dist/utils.mjs.map +1 -1
- package/dist/vector/index.d.mts +3 -0
- package/dist/vector/index.mjs +4 -0
- package/package.json +49 -92
- package/dist/curve/cubic2d.d.mts +0 -109
- package/dist/curve/cubic2d.d.ts +0 -109
- package/dist/curve/cubic2d.mjs +0 -80
- package/dist/curve/cubic2d.mjs.map +0 -1
- package/dist/curve/linear2d.d.mts +0 -94
- package/dist/curve/linear2d.d.ts +0 -94
- package/dist/curve/linear2d.mjs +0 -46
- package/dist/curve/linear2d.mjs.map +0 -1
- package/dist/curve/quadratic2d.d.mts +0 -117
- package/dist/curve/quadratic2d.d.ts +0 -117
- package/dist/curve/quadratic2d.mjs +0 -82
- package/dist/curve/quadratic2d.mjs.map +0 -1
- package/dist/interval.d.mts +0 -251
- package/dist/interval.d.ts +0 -251
- package/dist/interval.mjs +0 -86
- package/dist/interval.mjs.map +0 -1
- package/dist/matrix/matrix2x2.d.mts +0 -320
- package/dist/matrix/matrix2x2.d.ts +0 -320
- package/dist/matrix/matrix2x2.mjs +0 -25
- package/dist/matrix/matrix2x2.mjs.map +0 -1
- package/dist/matrix/matrix3x3.d.mts +0 -370
- package/dist/matrix/matrix3x3.d.ts +0 -370
- package/dist/matrix/matrix3x3.mjs +0 -28
- package/dist/matrix/matrix3x3.mjs.map +0 -1
- package/dist/matrix/matrix4x4.d.mts +0 -381
- package/dist/matrix/matrix4x4.d.ts +0 -381
- package/dist/matrix/matrix4x4.mjs +0 -178
- package/dist/matrix/matrix4x4.mjs.map +0 -1
- package/dist/path/cubic2d.d.mts +0 -95
- package/dist/path/cubic2d.d.ts +0 -95
- package/dist/path/cubic2d.mjs +0 -60
- package/dist/path/cubic2d.mjs.map +0 -1
- package/dist/path/linear2d.d.mts +0 -95
- package/dist/path/linear2d.d.ts +0 -95
- package/dist/path/linear2d.mjs +0 -53
- package/dist/path/linear2d.mjs.map +0 -1
- package/dist/path/quadratic2d.d.mts +0 -95
- package/dist/path/quadratic2d.d.ts +0 -95
- package/dist/path/quadratic2d.mjs +0 -57
- package/dist/path/quadratic2d.mjs.map +0 -1
- package/dist/pipe.d.ts +0 -58
- package/dist/pipe.mjs +0 -92
- package/dist/pipe.mjs.map +0 -1
- package/dist/polynomial/cubic.d.mts +0 -7
- package/dist/polynomial/cubic.d.ts +0 -7
- package/dist/polynomial/cubic.mjs +0 -133
- package/dist/polynomial/cubic.mjs.map +0 -1
- package/dist/polynomial/linear.d.mts +0 -7
- package/dist/polynomial/linear.d.ts +0 -7
- package/dist/polynomial/linear.mjs +0 -24
- package/dist/polynomial/linear.mjs.map +0 -1
- package/dist/polynomial/quadratic.d.mts +0 -7
- package/dist/polynomial/quadratic.d.ts +0 -7
- package/dist/polynomial/quadratic.mjs +0 -27
- package/dist/polynomial/quadratic.mjs.map +0 -1
- package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
- package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
- package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
- package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
- package/dist/shared/curvy.BxdGW9he.mjs +0 -116
- package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
- package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
- package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
- package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
- package/dist/shared/curvy.DCt1gGII.mjs +0 -147
- package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
- package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
- package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
- package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
- package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
- package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
- package/dist/shared/curvy.lktriTpx.mjs +0 -101
- package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
- package/dist/shared/curvy.mLFprrGm.mjs +0 -85
- package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
- package/dist/shared/curvy.r6f1j287.mjs +0 -76
- package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
- package/dist/splines/basis2d.d.mts +0 -130
- package/dist/splines/basis2d.d.ts +0 -130
- package/dist/splines/basis2d.mjs +0 -90
- package/dist/splines/basis2d.mjs.map +0 -1
- package/dist/splines/bezier2d.d.mts +0 -182
- package/dist/splines/bezier2d.d.ts +0 -182
- package/dist/splines/bezier2d.mjs +0 -23
- package/dist/splines/bezier2d.mjs.map +0 -1
- package/dist/splines/cardinal2d.d.mts +0 -178
- package/dist/splines/cardinal2d.d.ts +0 -178
- package/dist/splines/cardinal2d.mjs +0 -114
- package/dist/splines/cardinal2d.mjs.map +0 -1
- package/dist/splines/hermite2d.d.mts +0 -124
- package/dist/splines/hermite2d.d.ts +0 -124
- package/dist/splines/hermite2d.mjs +0 -63
- package/dist/splines/hermite2d.mjs.map +0 -1
- package/dist/utils.d.ts +0 -205
- package/dist/vector/vector2.d.mts +0 -324
- package/dist/vector/vector2.d.ts +0 -324
- package/dist/vector/vector2.mjs +0 -30
- package/dist/vector/vector2.mjs.map +0 -1
- package/dist/vector/vector3.d.mts +0 -417
- package/dist/vector/vector3.d.ts +0 -417
- package/dist/vector/vector3.mjs +0 -38
- package/dist/vector/vector3.mjs.map +0 -1
- package/dist/vector/vector4.d.mts +0 -205
- package/dist/vector/vector4.d.ts +0 -205
- package/dist/vector/vector4.mjs +0 -20
- package/dist/vector/vector4.mjs.map +0 -1
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
import { t as Vector2 } from "./vector2-DPUY3_eA.mjs";
|
|
2
|
+
import { t as Pipeable } from "./utils-MCckigYk.mjs";
|
|
3
|
+
import { n as Closed } from "./interval-Dy-RMEE3.mjs";
|
|
4
|
+
import { t as Interval2d } from "./interval2d-C2id9u31.mjs";
|
|
5
|
+
import { r as CubicCurve2d, t as RationalCubicCurve2d } from "./rationalCubic2d-DlQfBURs.mjs";
|
|
6
|
+
|
|
7
|
+
//#region src/path/traits.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Trait brands for paths.
|
|
10
|
+
*
|
|
11
|
+
* Brands are phantom types — they exist only at the type level and carry no
|
|
12
|
+
* runtime data. Refiners (`isContinuous`) and assertions (`asContinuous`) on
|
|
13
|
+
* each path module attach these brands to the path's `Trait` parameter at the
|
|
14
|
+
* type level.
|
|
15
|
+
*
|
|
16
|
+
* @since 2.0.0
|
|
17
|
+
*/
|
|
18
|
+
declare const ContinuousId: unique symbol;
|
|
19
|
+
/**
|
|
20
|
+
* Brand for paths whose adjacent curves connect at their join points (G⁰
|
|
21
|
+
* continuity). Calling `toPathData` on a `Continuous` path skips the
|
|
22
|
+
* per-segment discontinuity check and emits a single `M` followed by drawing
|
|
23
|
+
* commands.
|
|
24
|
+
*
|
|
25
|
+
* @since 2.0.0
|
|
26
|
+
*/
|
|
27
|
+
type Continuous = {
|
|
28
|
+
readonly [ContinuousId]: 'continuous';
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Phantom property key used by path interfaces to hold their `Trait` type
|
|
32
|
+
* parameter. The runtime object never has a value at this key.
|
|
33
|
+
*
|
|
34
|
+
* @since 2.0.0
|
|
35
|
+
*/
|
|
36
|
+
declare const PathTraits: unique symbol;
|
|
37
|
+
type PathTraits = typeof PathTraits;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/path/cubic2d.internal.d.ts
|
|
40
|
+
declare const CubicPath2dTypeId: unique symbol;
|
|
41
|
+
type CubicPath2dTypeId = typeof CubicPath2dTypeId;
|
|
42
|
+
declare namespace cubic2d_d_exports {
|
|
43
|
+
export { Continuous, CubicPath2d, append$1 as append, asContinuous, boundingBox, fromArray$1 as fromArray, isContinuous, isCubicPath2d, length, make$1 as make, solve$1 as solve, solveByDistance, toPathData };
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* A cubic path in 2D space.
|
|
47
|
+
*
|
|
48
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
49
|
+
*
|
|
50
|
+
* The `Trait` type parameter accumulates trait brands as the path is refined
|
|
51
|
+
* via `isContinuous` / `asContinuous`.
|
|
52
|
+
*
|
|
53
|
+
* @since 1.0.0
|
|
54
|
+
*/
|
|
55
|
+
interface CubicPath2d<out Trait = unknown> extends Pipeable, Iterable<CubicCurve2d> {
|
|
56
|
+
readonly [CubicPath2dTypeId]: CubicPath2dTypeId;
|
|
57
|
+
readonly [PathTraits]: Trait;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Creates a new `CubicPath2d` instance from a sequence of curves.
|
|
61
|
+
*
|
|
62
|
+
* @param curves - The curves to create the path from.
|
|
63
|
+
* @returns A new `CubicPath2d` instance.
|
|
64
|
+
* @since 2.0.0
|
|
65
|
+
*/
|
|
66
|
+
declare const make$1: (...curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new `CubicPath2d` instance from an array of curves.
|
|
69
|
+
*
|
|
70
|
+
* @param curves - The curves to create the path from.
|
|
71
|
+
* @returns A new `CubicPath2d` instance.
|
|
72
|
+
* @since 2.0.0
|
|
73
|
+
*/
|
|
74
|
+
declare const fromArray$1: (curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d;
|
|
75
|
+
/**
|
|
76
|
+
* Checks if a value is a `CubicPath2d`.
|
|
77
|
+
*
|
|
78
|
+
* @param p - The value to check.
|
|
79
|
+
* @returns `true` if the value is a `CubicPath2d`, `false` otherwise.
|
|
80
|
+
* @since 1.0.0
|
|
81
|
+
*/
|
|
82
|
+
declare const isCubicPath2d: (p: unknown) => p is CubicPath2d;
|
|
83
|
+
declare const append$1: {
|
|
84
|
+
/**
|
|
85
|
+
* Appends a cubic curve to a cubic path.
|
|
86
|
+
*
|
|
87
|
+
* @param c - The cubic curve to append.
|
|
88
|
+
* @returns A function that takes a cubic path and returns a new cubic path.
|
|
89
|
+
* @since 1.0.0
|
|
90
|
+
*/
|
|
91
|
+
(c: CubicCurve2d): (p: CubicPath2d) => CubicPath2d;
|
|
92
|
+
/**
|
|
93
|
+
* Appends a cubic curve to a cubic path.
|
|
94
|
+
*
|
|
95
|
+
* @param p - The cubic path to append to.
|
|
96
|
+
* @param c - The cubic curve to append.
|
|
97
|
+
* @returns A new cubic path.
|
|
98
|
+
* @since 1.0.0
|
|
99
|
+
*/
|
|
100
|
+
(p: CubicPath2d, c: CubicCurve2d): CubicPath2d;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Calculates the length of a cubic path.
|
|
104
|
+
*
|
|
105
|
+
* @param p - The cubic path to calculate the length of.
|
|
106
|
+
* @returns The length of the cubic path.
|
|
107
|
+
* @since 1.0.0
|
|
108
|
+
*/
|
|
109
|
+
declare const length: (p: CubicPath2d) => number;
|
|
110
|
+
declare const solve$1: {
|
|
111
|
+
/**
|
|
112
|
+
* Solves a cubic path for a given parameter.
|
|
113
|
+
*
|
|
114
|
+
* @param u - The parameter to solve for.
|
|
115
|
+
* @returns A function that takes a cubic path and returns the solved vector.
|
|
116
|
+
* @since 1.0.0
|
|
117
|
+
*/
|
|
118
|
+
(u: number): (p: CubicPath2d) => Vector2;
|
|
119
|
+
/**
|
|
120
|
+
* Solves a cubic path for a given parameter.
|
|
121
|
+
*
|
|
122
|
+
* @param p - The cubic path to solve.
|
|
123
|
+
* @param u - The parameter to solve for.
|
|
124
|
+
* @returns The solved vector.
|
|
125
|
+
* @since 1.0.0
|
|
126
|
+
*/
|
|
127
|
+
(p: CubicPath2d, u: number): Vector2;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Serializes a cubic path as an SVG path data string (the value of a `<path>`
|
|
131
|
+
* element's `d` attribute), using `M` and `C` commands. Discontinuities between
|
|
132
|
+
* curves emit a fresh `M` command.
|
|
133
|
+
*
|
|
134
|
+
* @param p - The cubic path to serialize.
|
|
135
|
+
* @returns The SVG path data string.
|
|
136
|
+
* @since 2.0.0
|
|
137
|
+
*/
|
|
138
|
+
declare const toPathData: (p: CubicPath2d) => string;
|
|
139
|
+
/**
|
|
140
|
+
* Type-narrowing predicate: refines `CubicPath2d<T>` to
|
|
141
|
+
* `CubicPath2d<T & Continuous>` when adjacent curves connect.
|
|
142
|
+
*
|
|
143
|
+
* @since 2.0.0
|
|
144
|
+
*/
|
|
145
|
+
declare const isContinuous: <T>(p: CubicPath2d<T>) => p is CubicPath2d<T & Continuous>;
|
|
146
|
+
/**
|
|
147
|
+
* Asserts that the cubic path is continuous, throwing on failure.
|
|
148
|
+
*
|
|
149
|
+
* @since 2.0.0
|
|
150
|
+
*/
|
|
151
|
+
declare const asContinuous: <T>(p: CubicPath2d<T>) => CubicPath2d<T & Continuous>;
|
|
152
|
+
declare const solveByDistance: {
|
|
153
|
+
/**
|
|
154
|
+
* Solves a cubic path by normalized arc length. Unlike {@link solve}, which
|
|
155
|
+
* is parameterized by curve `u`, this samples points at constant speed along
|
|
156
|
+
* the path — `s = 0.5` returns the point exactly halfway along the curve by
|
|
157
|
+
* arc length, regardless of how the underlying parameterization stretches.
|
|
158
|
+
*
|
|
159
|
+
* Cumulative segment lengths are cached by path identity so repeated calls
|
|
160
|
+
* with the same path are fast.
|
|
161
|
+
*
|
|
162
|
+
* @param p - The cubic path to sample.
|
|
163
|
+
* @param s - Normalized arc length in `[0, 1]`. Values outside the range are
|
|
164
|
+
* clamped to path endpoints.
|
|
165
|
+
* @returns The point on the path at the given normalized arc length.
|
|
166
|
+
* @since 1.1.0
|
|
167
|
+
*/
|
|
168
|
+
(p: CubicPath2d, s: number): Vector2;
|
|
169
|
+
/**
|
|
170
|
+
* Solves a cubic path by normalized arc length.
|
|
171
|
+
*
|
|
172
|
+
* @param s - Normalized arc length in `[0, 1]`.
|
|
173
|
+
* @returns A function that takes a cubic path and returns the point at that
|
|
174
|
+
* arc length.
|
|
175
|
+
* @since 1.1.0
|
|
176
|
+
*/
|
|
177
|
+
(s: number): (p: CubicPath2d) => Vector2;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* Computes the axis-aligned bounding box of the path — the smallest closed
|
|
181
|
+
* `Box2d` enclosing every segment.
|
|
182
|
+
*
|
|
183
|
+
* @param p - The cubic path.
|
|
184
|
+
* @returns A closed `Box2d` enclosing the path.
|
|
185
|
+
* @since 2.1.0
|
|
186
|
+
*/
|
|
187
|
+
declare const boundingBox: (p: CubicPath2d) => Interval2d<Closed, Closed>;
|
|
188
|
+
//#endregion
|
|
189
|
+
//#region src/path/rationalCubic2d.internal.d.ts
|
|
190
|
+
declare const RationalCubicPath2dTypeId: unique symbol;
|
|
191
|
+
type RationalCubicPath2dTypeId = typeof RationalCubicPath2dTypeId;
|
|
192
|
+
declare namespace rationalCubic2d_d_exports {
|
|
193
|
+
export { RationalCubicPath2d, append, approximateAsCubicPath, fromArray, isRationalCubicPath2d, make, solve };
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* A rational cubic path in 2D space.
|
|
197
|
+
*
|
|
198
|
+
* Holds a non-empty sequence of `RationalCubicCurve2d` segments; iteration
|
|
199
|
+
* yields the segments in order. The path parameter `u ∈ [0, 1]` is mapped
|
|
200
|
+
* uniformly across segments — `u = 0` is the start of the first segment,
|
|
201
|
+
* `u = 1` is the end of the last segment, and intermediate values pick a
|
|
202
|
+
* segment by index and a local parameter within it.
|
|
203
|
+
*
|
|
204
|
+
* Counterpart to `CubicPath2d` for curves whose evaluation includes the
|
|
205
|
+
* homogeneous-to-plane projection.
|
|
206
|
+
*
|
|
207
|
+
* All fields are readonly and immutable, and all operations create new instances.
|
|
208
|
+
*
|
|
209
|
+
* @since 2.1.0
|
|
210
|
+
*/
|
|
211
|
+
interface RationalCubicPath2d extends Pipeable, Iterable<RationalCubicCurve2d> {
|
|
212
|
+
readonly [RationalCubicPath2dTypeId]: RationalCubicPath2dTypeId;
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Checks if a value is a `RationalCubicPath2d`.
|
|
216
|
+
*
|
|
217
|
+
* @param p - The value to check.
|
|
218
|
+
* @returns `true` if the value is a `RationalCubicPath2d`, `false` otherwise.
|
|
219
|
+
* @since 2.1.0
|
|
220
|
+
*/
|
|
221
|
+
declare const isRationalCubicPath2d: (p: unknown) => p is RationalCubicPath2d;
|
|
222
|
+
/**
|
|
223
|
+
* Creates a new `RationalCubicPath2d` from a sequence of curves.
|
|
224
|
+
*
|
|
225
|
+
* @param curves - The curves to create the path from.
|
|
226
|
+
* @returns A new `RationalCubicPath2d` instance.
|
|
227
|
+
* @since 2.1.0
|
|
228
|
+
*/
|
|
229
|
+
declare const make: (...curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d;
|
|
230
|
+
/**
|
|
231
|
+
* Creates a new `RationalCubicPath2d` from an array of curves.
|
|
232
|
+
*
|
|
233
|
+
* @param curves - The curves to create the path from.
|
|
234
|
+
* @returns A new `RationalCubicPath2d` instance.
|
|
235
|
+
* @since 2.1.0
|
|
236
|
+
*/
|
|
237
|
+
declare const fromArray: (curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d;
|
|
238
|
+
declare const append: {
|
|
239
|
+
/**
|
|
240
|
+
* Appends a curve to a `RationalCubicPath2d`.
|
|
241
|
+
*
|
|
242
|
+
* @param c - The curve to append.
|
|
243
|
+
* @returns A function that takes a path and returns a new path with the appended curve.
|
|
244
|
+
* @since 2.1.0
|
|
245
|
+
*/
|
|
246
|
+
(c: RationalCubicCurve2d): (p: RationalCubicPath2d) => RationalCubicPath2d;
|
|
247
|
+
/**
|
|
248
|
+
* Appends a curve to a `RationalCubicPath2d`.
|
|
249
|
+
*
|
|
250
|
+
* @param p - The path to append to.
|
|
251
|
+
* @param c - The curve to append.
|
|
252
|
+
* @returns A new path with the appended curve.
|
|
253
|
+
* @since 2.1.0
|
|
254
|
+
*/
|
|
255
|
+
(p: RationalCubicPath2d, c: RationalCubicCurve2d): RationalCubicPath2d;
|
|
256
|
+
};
|
|
257
|
+
declare const solve: {
|
|
258
|
+
/**
|
|
259
|
+
* Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.
|
|
260
|
+
*
|
|
261
|
+
* Picks the segment containing `u` (uniform mapping across segments) and
|
|
262
|
+
* delegates to `RationalCubicCurve2d.solve` on that segment with the local
|
|
263
|
+
* parameter.
|
|
264
|
+
*
|
|
265
|
+
* @param p - The path to evaluate.
|
|
266
|
+
* @param u - The path parameter in `[0, 1]`.
|
|
267
|
+
* @returns The point on the path at parameter `u`.
|
|
268
|
+
* @since 2.1.0
|
|
269
|
+
*/
|
|
270
|
+
(p: RationalCubicPath2d, u: number): Vector2;
|
|
271
|
+
/**
|
|
272
|
+
* Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.
|
|
273
|
+
*
|
|
274
|
+
* @param u - The path parameter in `[0, 1]`.
|
|
275
|
+
* @returns A function that takes a path and returns the point at `u`.
|
|
276
|
+
* @since 2.1.0
|
|
277
|
+
*/
|
|
278
|
+
(u: number): (p: RationalCubicPath2d) => Vector2;
|
|
279
|
+
};
|
|
280
|
+
declare const approximateAsCubicPath: {
|
|
281
|
+
/**
|
|
282
|
+
* Approximates the rational cubic path as a `CubicPath2d` via per-segment
|
|
283
|
+
* recursive subdivision. Each input segment is split until its midpoint
|
|
284
|
+
* deviates from a polynomial-cubic candidate by at most `tolerance`; the
|
|
285
|
+
* surviving candidates are concatenated into a new path.
|
|
286
|
+
*
|
|
287
|
+
* Lossy in general — only exact when every input segment has uniform
|
|
288
|
+
* weights, in which case segment count is preserved. Tighter tolerance
|
|
289
|
+
* produces more segments.
|
|
290
|
+
*
|
|
291
|
+
* @param p - The rational cubic path to approximate.
|
|
292
|
+
* @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.
|
|
293
|
+
* @returns A new `CubicPath2d` approximating the input.
|
|
294
|
+
* @since 2.1.0
|
|
295
|
+
*/
|
|
296
|
+
(p: RationalCubicPath2d, tolerance: number): CubicPath2d;
|
|
297
|
+
/**
|
|
298
|
+
* Approximates the rational cubic path as a `CubicPath2d`.
|
|
299
|
+
*
|
|
300
|
+
* @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.
|
|
301
|
+
* @returns A function that takes a rational path and returns its approximation.
|
|
302
|
+
* @since 2.1.0
|
|
303
|
+
*/
|
|
304
|
+
(tolerance: number): (p: RationalCubicPath2d) => CubicPath2d;
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
307
|
+
export { Continuous as a, cubic2d_d_exports as i, rationalCubic2d_d_exports as n, PathTraits as o, CubicPath2d as r, RationalCubicPath2d as t };
|
|
308
|
+
//# sourceMappingURL=rationalCubic2d-B6g97ryJ.d.mts.map
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { t as __exportAll } from "./chunk-25Hzd3z8.mjs";
|
|
2
|
+
import { Pipeable, dual, invariant } from "../utils.mjs";
|
|
3
|
+
import { epsEquals } from "../number.mjs";
|
|
4
|
+
import { r as magnitude } from "./vector2-CL1HDdPr.mjs";
|
|
5
|
+
import { c as make$4, p as unit } from "./interval-05CR6eBf.mjs";
|
|
6
|
+
import { r as union } from "./interval2d-8IBZnUOq.mjs";
|
|
7
|
+
import { a as boundingBox$2, c as length$2, i as solve$6, l as solve$4, m as solve$5, t as approximateAsCubicCurves, u as derivative } from "./rationalCubic2d-Bys2Uory.mjs";
|
|
8
|
+
//#region src/path/cubic2d.internal.ts
|
|
9
|
+
const CubicPath2dTypeId = Symbol("curvy/path/cubic2d");
|
|
10
|
+
var CubicPath2dImpl = class extends Pipeable {
|
|
11
|
+
[CubicPath2dTypeId] = CubicPath2dTypeId;
|
|
12
|
+
curves;
|
|
13
|
+
constructor(curves) {
|
|
14
|
+
invariant(curves.length > 0, "cubic path requires at least one curve");
|
|
15
|
+
super();
|
|
16
|
+
this.curves = curves;
|
|
17
|
+
}
|
|
18
|
+
[Symbol.iterator]() {
|
|
19
|
+
return this.curves[Symbol.iterator]();
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
const isCubicPath2d$1 = (p) => typeof p === "object" && p !== null && CubicPath2dTypeId in p;
|
|
23
|
+
const make$3 = (...curves) => new CubicPath2dImpl(curves);
|
|
24
|
+
const fromArray$3 = (curves) => new CubicPath2dImpl(curves);
|
|
25
|
+
const append$3 = dual(2, (p, c) => fromArray$3([...p, c]));
|
|
26
|
+
const length$1 = (p) => {
|
|
27
|
+
let total = 0;
|
|
28
|
+
for (const curve of p) total += length$2(curve, unit);
|
|
29
|
+
return total;
|
|
30
|
+
};
|
|
31
|
+
const solve$3 = dual(2, (p, u) => {
|
|
32
|
+
const curves = p instanceof CubicPath2dImpl ? p.curves : [...p];
|
|
33
|
+
if (u === 1) return solve$4(curves.at(-1), 1);
|
|
34
|
+
const t = u * curves.length;
|
|
35
|
+
const i = Math.floor(t);
|
|
36
|
+
const curve = curves[i];
|
|
37
|
+
return solve$4(curve, t - i);
|
|
38
|
+
});
|
|
39
|
+
const cumulativeLengthCache = /* @__PURE__ */ new WeakMap();
|
|
40
|
+
const getCumulativeLengths = (p) => {
|
|
41
|
+
let cached = cumulativeLengthCache.get(p);
|
|
42
|
+
if (cached === void 0) {
|
|
43
|
+
const lengths = [];
|
|
44
|
+
let total = 0;
|
|
45
|
+
for (const curve of p) {
|
|
46
|
+
total += length$2(curve, unit);
|
|
47
|
+
lengths.push(total);
|
|
48
|
+
}
|
|
49
|
+
cached = lengths;
|
|
50
|
+
cumulativeLengthCache.set(p, cached);
|
|
51
|
+
}
|
|
52
|
+
return cached;
|
|
53
|
+
};
|
|
54
|
+
const solveCurveByDistance = (curve, target, segmentLength) => {
|
|
55
|
+
if (target <= 0) return 0;
|
|
56
|
+
if (target >= segmentLength) return 1;
|
|
57
|
+
const derivative$1 = derivative(curve);
|
|
58
|
+
let t = target / segmentLength;
|
|
59
|
+
let lo = 0;
|
|
60
|
+
let hi = 1;
|
|
61
|
+
for (let iter = 0; iter < 16; iter++) {
|
|
62
|
+
const error = length$2(curve, make$4(0, t)) - target;
|
|
63
|
+
if (Math.abs(error) < 1e-10) return t;
|
|
64
|
+
if (error > 0) hi = t;
|
|
65
|
+
else lo = t;
|
|
66
|
+
const speed = magnitude(solve$5(derivative$1, t));
|
|
67
|
+
if (speed === 0) {
|
|
68
|
+
t = (lo + hi) / 2;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
const next = t - error / speed;
|
|
72
|
+
t = next > lo && next < hi ? next : (lo + hi) / 2;
|
|
73
|
+
}
|
|
74
|
+
return t;
|
|
75
|
+
};
|
|
76
|
+
const toPathData$1 = (p) => {
|
|
77
|
+
let result = "";
|
|
78
|
+
let prevEndX = NaN;
|
|
79
|
+
let prevEndY = NaN;
|
|
80
|
+
for (const curve of p) {
|
|
81
|
+
const c0x = curve.x.c0;
|
|
82
|
+
const c0y = curve.y.c0;
|
|
83
|
+
const c1x = curve.x.c1;
|
|
84
|
+
const c1y = curve.y.c1;
|
|
85
|
+
const c2x = curve.x.c2;
|
|
86
|
+
const c2y = curve.y.c2;
|
|
87
|
+
const c3x = curve.x.c3;
|
|
88
|
+
const c3y = curve.y.c3;
|
|
89
|
+
const startX = c0x;
|
|
90
|
+
const startY = c0y;
|
|
91
|
+
const ctrl1X = c0x + c1x / 3;
|
|
92
|
+
const ctrl1Y = c0y + c1y / 3;
|
|
93
|
+
const ctrl2X = c0x + 2 * c1x / 3 + c2x / 3;
|
|
94
|
+
const ctrl2Y = c0y + 2 * c1y / 3 + c2y / 3;
|
|
95
|
+
const endX = c0x + c1x + c2x + c3x;
|
|
96
|
+
const endY = c0y + c1y + c2y + c3y;
|
|
97
|
+
if (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY)) result += ` M ${startX},${startY}`;
|
|
98
|
+
result += ` C ${ctrl1X},${ctrl1Y} ${ctrl2X},${ctrl2Y} ${endX},${endY}`;
|
|
99
|
+
prevEndX = endX;
|
|
100
|
+
prevEndY = endY;
|
|
101
|
+
}
|
|
102
|
+
return result.slice(1);
|
|
103
|
+
};
|
|
104
|
+
const isContinuous$1 = (p) => {
|
|
105
|
+
let prevEndX = NaN;
|
|
106
|
+
let prevEndY = NaN;
|
|
107
|
+
let first = true;
|
|
108
|
+
for (const curve of p) {
|
|
109
|
+
const startX = curve.x.c0;
|
|
110
|
+
const startY = curve.y.c0;
|
|
111
|
+
if (!first && (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY))) return false;
|
|
112
|
+
prevEndX = curve.x.c0 + curve.x.c1 + curve.x.c2 + curve.x.c3;
|
|
113
|
+
prevEndY = curve.y.c0 + curve.y.c1 + curve.y.c2 + curve.y.c3;
|
|
114
|
+
first = false;
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
const asContinuous$1 = (p) => {
|
|
119
|
+
invariant(isContinuous$1(p), "cubic path is not continuous");
|
|
120
|
+
return p;
|
|
121
|
+
};
|
|
122
|
+
const solveByDistance$1 = dual(2, (p, s) => {
|
|
123
|
+
if (s <= 0) return solve$3(p, 0);
|
|
124
|
+
if (s >= 1) return solve$3(p, 1);
|
|
125
|
+
const lengths = getCumulativeLengths(p);
|
|
126
|
+
const target = s * lengths[lengths.length - 1];
|
|
127
|
+
let k = 0;
|
|
128
|
+
while (k < lengths.length - 1 && lengths[k] < target) k++;
|
|
129
|
+
const segmentStart = k === 0 ? 0 : lengths[k - 1];
|
|
130
|
+
const segmentLength = lengths[k] - segmentStart;
|
|
131
|
+
const segmentTarget = target - segmentStart;
|
|
132
|
+
const curve = (p instanceof CubicPath2dImpl ? p.curves : [...p])[k];
|
|
133
|
+
return solve$4(curve, solveCurveByDistance(curve, segmentTarget, segmentLength));
|
|
134
|
+
});
|
|
135
|
+
const boundingBox$1 = (p) => {
|
|
136
|
+
const iter = p[Symbol.iterator]();
|
|
137
|
+
let acc = boundingBox$2(iter.next().value);
|
|
138
|
+
for (let next = iter.next(); !next.done; next = iter.next()) acc = union(acc, boundingBox$2(next.value));
|
|
139
|
+
return acc;
|
|
140
|
+
};
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region src/path/cubic2d.ts
|
|
143
|
+
var cubic2d_exports = /* @__PURE__ */ __exportAll({
|
|
144
|
+
append: () => append$2,
|
|
145
|
+
asContinuous: () => asContinuous,
|
|
146
|
+
boundingBox: () => boundingBox,
|
|
147
|
+
fromArray: () => fromArray$2,
|
|
148
|
+
isContinuous: () => isContinuous,
|
|
149
|
+
isCubicPath2d: () => isCubicPath2d,
|
|
150
|
+
length: () => length,
|
|
151
|
+
make: () => make$2,
|
|
152
|
+
solve: () => solve$2,
|
|
153
|
+
solveByDistance: () => solveByDistance,
|
|
154
|
+
toPathData: () => toPathData
|
|
155
|
+
});
|
|
156
|
+
/**
|
|
157
|
+
* Creates a new `CubicPath2d` instance from a sequence of curves.
|
|
158
|
+
*
|
|
159
|
+
* @param curves - The curves to create the path from.
|
|
160
|
+
* @returns A new `CubicPath2d` instance.
|
|
161
|
+
* @since 2.0.0
|
|
162
|
+
*/
|
|
163
|
+
const make$2 = make$3;
|
|
164
|
+
/**
|
|
165
|
+
* Creates a new `CubicPath2d` instance from an array of curves.
|
|
166
|
+
*
|
|
167
|
+
* @param curves - The curves to create the path from.
|
|
168
|
+
* @returns A new `CubicPath2d` instance.
|
|
169
|
+
* @since 2.0.0
|
|
170
|
+
*/
|
|
171
|
+
const fromArray$2 = fromArray$3;
|
|
172
|
+
/**
|
|
173
|
+
* Checks if a value is a `CubicPath2d`.
|
|
174
|
+
*
|
|
175
|
+
* @param p - The value to check.
|
|
176
|
+
* @returns `true` if the value is a `CubicPath2d`, `false` otherwise.
|
|
177
|
+
* @since 1.0.0
|
|
178
|
+
*/
|
|
179
|
+
const isCubicPath2d = isCubicPath2d$1;
|
|
180
|
+
const append$2 = append$3;
|
|
181
|
+
/**
|
|
182
|
+
* Calculates the length of a cubic path.
|
|
183
|
+
*
|
|
184
|
+
* @param p - The cubic path to calculate the length of.
|
|
185
|
+
* @returns The length of the cubic path.
|
|
186
|
+
* @since 1.0.0
|
|
187
|
+
*/
|
|
188
|
+
const length = length$1;
|
|
189
|
+
const solve$2 = solve$3;
|
|
190
|
+
/**
|
|
191
|
+
* Serializes a cubic path as an SVG path data string (the value of a `<path>`
|
|
192
|
+
* element's `d` attribute), using `M` and `C` commands. Discontinuities between
|
|
193
|
+
* curves emit a fresh `M` command.
|
|
194
|
+
*
|
|
195
|
+
* @param p - The cubic path to serialize.
|
|
196
|
+
* @returns The SVG path data string.
|
|
197
|
+
* @since 2.0.0
|
|
198
|
+
*/
|
|
199
|
+
const toPathData = toPathData$1;
|
|
200
|
+
/**
|
|
201
|
+
* Type-narrowing predicate: refines `CubicPath2d<T>` to
|
|
202
|
+
* `CubicPath2d<T & Continuous>` when adjacent curves connect.
|
|
203
|
+
*
|
|
204
|
+
* @since 2.0.0
|
|
205
|
+
*/
|
|
206
|
+
const isContinuous = isContinuous$1;
|
|
207
|
+
/**
|
|
208
|
+
* Asserts that the cubic path is continuous, throwing on failure.
|
|
209
|
+
*
|
|
210
|
+
* @since 2.0.0
|
|
211
|
+
*/
|
|
212
|
+
const asContinuous = asContinuous$1;
|
|
213
|
+
const solveByDistance = solveByDistance$1;
|
|
214
|
+
/**
|
|
215
|
+
* Computes the axis-aligned bounding box of the path — the smallest closed
|
|
216
|
+
* `Box2d` enclosing every segment.
|
|
217
|
+
*
|
|
218
|
+
* @param p - The cubic path.
|
|
219
|
+
* @returns A closed `Box2d` enclosing the path.
|
|
220
|
+
* @since 2.1.0
|
|
221
|
+
*/
|
|
222
|
+
const boundingBox = boundingBox$1;
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/path/rationalCubic2d.internal.ts
|
|
225
|
+
const RationalCubicPath2dTypeId = Symbol("curvy/path/rationalCubic2d");
|
|
226
|
+
var RationalCubicPath2dImpl = class extends Pipeable {
|
|
227
|
+
[RationalCubicPath2dTypeId] = RationalCubicPath2dTypeId;
|
|
228
|
+
curves;
|
|
229
|
+
constructor(curves) {
|
|
230
|
+
invariant(curves.length > 0, "rational cubic path requires at least one curve");
|
|
231
|
+
super();
|
|
232
|
+
this.curves = curves;
|
|
233
|
+
}
|
|
234
|
+
[Symbol.iterator]() {
|
|
235
|
+
return this.curves[Symbol.iterator]();
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
const isRationalCubicPath2d$1 = (p) => typeof p === "object" && p !== null && RationalCubicPath2dTypeId in p;
|
|
239
|
+
const make$1 = (...curves) => new RationalCubicPath2dImpl(curves);
|
|
240
|
+
const fromArray$1 = (curves) => new RationalCubicPath2dImpl(curves);
|
|
241
|
+
const append$1 = dual(2, (p, c) => fromArray$1([...p, c]));
|
|
242
|
+
const solve$1 = dual(2, (p, u) => {
|
|
243
|
+
const curves = p instanceof RationalCubicPath2dImpl ? p.curves : [...p];
|
|
244
|
+
if (u === 1) return solve$6(curves.at(-1), 1);
|
|
245
|
+
const t = u * curves.length;
|
|
246
|
+
const i = Math.floor(t);
|
|
247
|
+
const curve = curves[i];
|
|
248
|
+
return solve$6(curve, t - i);
|
|
249
|
+
});
|
|
250
|
+
const approximateAsCubicPath$1 = dual(2, (p, tolerance) => {
|
|
251
|
+
const curves = [];
|
|
252
|
+
for (const segment of p) for (const approx of approximateAsCubicCurves(segment, tolerance)) curves.push(approx);
|
|
253
|
+
return fromArray$2(curves);
|
|
254
|
+
});
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/path/rationalCubic2d.ts
|
|
257
|
+
var rationalCubic2d_exports = /* @__PURE__ */ __exportAll({
|
|
258
|
+
append: () => append,
|
|
259
|
+
approximateAsCubicPath: () => approximateAsCubicPath,
|
|
260
|
+
fromArray: () => fromArray,
|
|
261
|
+
isRationalCubicPath2d: () => isRationalCubicPath2d,
|
|
262
|
+
make: () => make,
|
|
263
|
+
solve: () => solve
|
|
264
|
+
});
|
|
265
|
+
/**
|
|
266
|
+
* Checks if a value is a `RationalCubicPath2d`.
|
|
267
|
+
*
|
|
268
|
+
* @param p - The value to check.
|
|
269
|
+
* @returns `true` if the value is a `RationalCubicPath2d`, `false` otherwise.
|
|
270
|
+
* @since 2.1.0
|
|
271
|
+
*/
|
|
272
|
+
const isRationalCubicPath2d = isRationalCubicPath2d$1;
|
|
273
|
+
/**
|
|
274
|
+
* Creates a new `RationalCubicPath2d` from a sequence of curves.
|
|
275
|
+
*
|
|
276
|
+
* @param curves - The curves to create the path from.
|
|
277
|
+
* @returns A new `RationalCubicPath2d` instance.
|
|
278
|
+
* @since 2.1.0
|
|
279
|
+
*/
|
|
280
|
+
const make = make$1;
|
|
281
|
+
/**
|
|
282
|
+
* Creates a new `RationalCubicPath2d` from an array of curves.
|
|
283
|
+
*
|
|
284
|
+
* @param curves - The curves to create the path from.
|
|
285
|
+
* @returns A new `RationalCubicPath2d` instance.
|
|
286
|
+
* @since 2.1.0
|
|
287
|
+
*/
|
|
288
|
+
const fromArray = fromArray$1;
|
|
289
|
+
const append = append$1;
|
|
290
|
+
const solve = solve$1;
|
|
291
|
+
const approximateAsCubicPath = approximateAsCubicPath$1;
|
|
292
|
+
//#endregion
|
|
293
|
+
export { make$2 as i, rationalCubic2d_exports as n, cubic2d_exports as r, fromArray as t };
|
|
294
|
+
|
|
295
|
+
//# sourceMappingURL=rationalCubic2d-BEgUGSFf.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rationalCubic2d-BEgUGSFf.mjs","names":["isCubicPath2d","make","fromArray","append","length","CubicCurve2d.length","Interval.unit","solve","CubicCurve2d.solve","derivative","cubicCurveInternal.derivative","Interval.make","Vector2.magnitude","QuadraticCurve2d.solve","toPathData","isContinuous","asContinuous","solveByDistance","boundingBox","CubicCurve2d.boundingBox","Interval2d.union","make","internal.make","fromArray","internal.fromArray","internal.isCubicPath2d","append","internal.append","internal.length","solve","internal.solve","internal.toPathData","internal.isContinuous","internal.asContinuous","internal.solveByDistance","internal.boundingBox","isRationalCubicPath2d","make","fromArray","append","solve","RationalCubicCurve2d.solve","approximateAsCubicPath","RationalCubicCurve2d.approximateAsCubicCurves","CubicPath2d.fromArray","internal.isRationalCubicPath2d","internal.make","internal.fromArray","internal.append","internal.solve","internal.approximateAsCubicPath"],"sources":["../../src/path/cubic2d.internal.ts","../../src/path/cubic2d.ts","../../src/path/rationalCubic2d.internal.ts","../../src/path/rationalCubic2d.ts"],"sourcesContent":["import * as Interval2d from '../interval/interval2d'\nimport * as CubicCurve2d from '../curve/cubic2d'\nimport * as cubicCurveInternal from '../curve/cubic2d.internal'\nimport * as QuadraticCurve2d from '../curve/quadratic2d'\nimport * as Interval from '../interval/interval'\nimport { dual, Pipeable } from '../utils'\nimport { invariant } from '../utils'\nimport { epsEquals } from '../number'\nimport * as Vector2 from '../vector/vector2'\nimport type { CubicPath2d } from './cubic2d'\nimport { PathTraits, type Continuous } from './traits'\n\nexport const CubicPath2dTypeId: unique symbol = Symbol('curvy/path/cubic2d')\nexport type CubicPath2dTypeId = typeof CubicPath2dTypeId\n\nexport class CubicPath2dImpl extends Pipeable implements CubicPath2d<unknown> {\n readonly [CubicPath2dTypeId]: CubicPath2dTypeId = CubicPath2dTypeId\n declare readonly [PathTraits]: unknown\n\n readonly curves: ReadonlyArray<CubicCurve2d.CubicCurve2d>\n\n constructor(curves: ReadonlyArray<CubicCurve2d.CubicCurve2d>) {\n invariant(curves.length > 0, 'cubic path requires at least one curve')\n super()\n this.curves = curves\n }\n\n [Symbol.iterator](): Iterator<CubicCurve2d.CubicCurve2d> {\n return this.curves[Symbol.iterator]()\n }\n}\n\nexport const isCubicPath2d = (p: unknown): p is CubicPath2d =>\n typeof p === 'object' && p !== null && CubicPath2dTypeId in p\n\nexport const make = (...curves: ReadonlyArray<CubicCurve2d.CubicCurve2d>): CubicPath2d =>\n new CubicPath2dImpl(curves)\n\nexport const fromArray = (curves: ReadonlyArray<CubicCurve2d.CubicCurve2d>): CubicPath2d =>\n new CubicPath2dImpl(curves)\n\nexport const append = dual<\n (c: CubicCurve2d.CubicCurve2d) => (p: CubicPath2d) => CubicPath2d,\n (p: CubicPath2d, c: CubicCurve2d.CubicCurve2d) => CubicPath2d\n>(2, (p: CubicPath2d, c: CubicCurve2d.CubicCurve2d) => fromArray([...p, c]))\n\nexport const length = (p: CubicPath2d) => {\n let total = 0\n for (const curve of p) {\n total += CubicCurve2d.length(curve, Interval.unit)\n }\n\n return total\n}\n\nexport const solve = dual<\n (u: number) => (p: CubicPath2d) => Vector2.Vector2,\n (p: CubicPath2d, u: number) => Vector2.Vector2\n>(2, (p: CubicPath2d, u: number) => {\n const curves = p instanceof CubicPath2dImpl ? p.curves : [...p]\n\n if (u === 1) {\n const last = curves.at(-1) as CubicCurve2d.CubicCurve2d\n return CubicCurve2d.solve(last, 1)\n }\n\n const t = u * curves.length\n const i = Math.floor(t)\n const curve = curves[i] as CubicCurve2d.CubicCurve2d\n return CubicCurve2d.solve(curve, t - i)\n})\n\n// Cumulative segment lengths cache. lengths[k] = total length through segment k.\n// Cached by path identity since paths are immutable.\nconst cumulativeLengthCache = new WeakMap<CubicPath2d, ReadonlyArray<number>>()\n\nconst getCumulativeLengths = (p: CubicPath2d): ReadonlyArray<number> => {\n let cached = cumulativeLengthCache.get(p)\n if (cached === undefined) {\n const lengths: Array<number> = []\n let total = 0\n for (const curve of p) {\n total += CubicCurve2d.length(curve, Interval.unit)\n lengths.push(total)\n }\n cached = lengths\n cumulativeLengthCache.set(p, cached)\n }\n return cached\n}\n\n// Newton's method to find the local parameter t ∈ [0, 1] within `curve` such\n// that the arc length from 0 to t equals `target`. Each iteration costs one\n// GL32 quadrature plus one velocity eval; converges in 3–5 iterations for\n// well-behaved curves. Falls back to bisection on cusps where speed → 0.\nconst solveCurveByDistance = (\n curve: CubicCurve2d.CubicCurve2d,\n target: number,\n segmentLength: number,\n): number => {\n if (target <= 0) {\n return 0\n }\n if (target >= segmentLength) {\n return 1\n }\n\n const derivative = cubicCurveInternal.derivative(curve)\n\n let t = target / segmentLength\n let lo = 0\n let hi = 1\n\n for (let iter = 0; iter < 16; iter++) {\n const currentLength = CubicCurve2d.length(curve, Interval.make(0, t))\n const error = currentLength - target\n\n if (Math.abs(error) < 1e-10) {\n return t\n }\n\n if (error > 0) {\n hi = t\n } else {\n lo = t\n }\n\n const speed = Vector2.magnitude(QuadraticCurve2d.solve(derivative, t))\n if (speed === 0) {\n // cusp — bisect instead\n t = (lo + hi) / 2\n continue\n }\n\n const next = t - error / speed\n // bracket-clamp Newton step; if it leaves the bracket, fall back to bisection\n t = next > lo && next < hi ? next : (lo + hi) / 2\n }\n\n return t\n}\n\n// Cubic Bernstein basis: P(t) = (1-t)³·p0 + 3(1-t)²t·p1 + 3(1-t)t²·p2 + t³·p3\n// expanded gives c0 = p0, c1 = -3p0 + 3p1, c2 = 3p0 - 6p1 + 3p2, c3 = -p0 + 3p1 - 3p2 + p3,\n// so: p0 = c0, p1 = c0 + c1/3, p2 = c0 + 2c1/3 + c2/3, p3 = c0 + c1 + c2 + c3.\nexport const toPathData = (p: CubicPath2d): string => {\n let result = ''\n let prevEndX = Number.NaN\n let prevEndY = Number.NaN\n\n for (const curve of p) {\n const c0x = curve.x.c0\n const c0y = curve.y.c0\n const c1x = curve.x.c1\n const c1y = curve.y.c1\n const c2x = curve.x.c2\n const c2y = curve.y.c2\n const c3x = curve.x.c3\n const c3y = curve.y.c3\n\n const startX = c0x\n const startY = c0y\n const ctrl1X = c0x + c1x / 3\n const ctrl1Y = c0y + c1y / 3\n const ctrl2X = c0x + (2 * c1x) / 3 + c2x / 3\n const ctrl2Y = c0y + (2 * c1y) / 3 + c2y / 3\n const endX = c0x + c1x + c2x + c3x\n const endY = c0y + c1y + c2y + c3y\n\n if (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY)) {\n result += ` M ${startX},${startY}`\n }\n result += ` C ${ctrl1X},${ctrl1Y} ${ctrl2X},${ctrl2Y} ${endX},${endY}`\n\n prevEndX = endX\n prevEndY = endY\n }\n\n return result.slice(1)\n}\n\nexport const isContinuous = <T>(p: CubicPath2d<T>): p is CubicPath2d<T & Continuous> => {\n let prevEndX = Number.NaN\n let prevEndY = Number.NaN\n let first = true\n\n for (const curve of p) {\n const startX = curve.x.c0\n const startY = curve.y.c0\n if (!first && (!epsEquals(startX, prevEndX) || !epsEquals(startY, prevEndY))) {\n return false\n }\n prevEndX = curve.x.c0 + curve.x.c1 + curve.x.c2 + curve.x.c3\n prevEndY = curve.y.c0 + curve.y.c1 + curve.y.c2 + curve.y.c3\n first = false\n }\n return true\n}\n\nexport const asContinuous = <T>(p: CubicPath2d<T>): CubicPath2d<T & Continuous> => {\n invariant(isContinuous(p), 'cubic path is not continuous')\n return p\n}\n\nexport const solveByDistance = dual<\n (s: number) => (p: CubicPath2d) => Vector2.Vector2,\n (p: CubicPath2d, s: number) => Vector2.Vector2\n>(2, (p: CubicPath2d, s: number) => {\n if (s <= 0) {\n return solve(p, 0)\n }\n if (s >= 1) {\n return solve(p, 1)\n }\n\n const lengths = getCumulativeLengths(p)\n const total = lengths[lengths.length - 1] as number\n const target = s * total\n\n // find segment k such that lengths[k-1] ≤ target ≤ lengths[k]\n let k = 0\n while (k < lengths.length - 1 && (lengths[k] as number) < target) {\n k++\n }\n\n const segmentStart = k === 0 ? 0 : (lengths[k - 1] as number)\n const segmentEnd = lengths[k] as number\n const segmentLength = segmentEnd - segmentStart\n const segmentTarget = target - segmentStart\n\n const curves = p instanceof CubicPath2dImpl ? p.curves : [...p]\n const curve = curves[k] as CubicCurve2d.CubicCurve2d\n const localT = solveCurveByDistance(curve, segmentTarget, segmentLength)\n\n return CubicCurve2d.solve(curve, localT)\n})\n\nexport const boundingBox = (\n p: CubicPath2d,\n): Interval2d.Interval2d<Interval.Closed, Interval.Closed> => {\n const iter = p[Symbol.iterator]()\n const first = iter.next()\n let acc = CubicCurve2d.boundingBox(first.value as CubicCurve2d.CubicCurve2d)\n for (let next = iter.next(); !next.done; next = iter.next()) {\n acc = Interval2d.union(acc, CubicCurve2d.boundingBox(next.value))\n }\n return acc\n}\n","import type { Interval2d } from '../interval/interval2d'\nimport type { CubicCurve2d } from '../curve/cubic2d'\nimport type { Closed } from '../interval/interval'\nimport type { Pipeable } from '../utils'\nimport type { Vector2 } from '../vector/vector2'\nimport type { CubicPath2dTypeId } from './cubic2d.internal'\nimport * as internal from './cubic2d.internal'\nimport type { Continuous, PathTraits } from './traits'\n\nexport type { Continuous } from './traits'\n\n/**\n * A cubic path in 2D space.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * The `Trait` type parameter accumulates trait brands as the path is refined\n * via `isContinuous` / `asContinuous`.\n *\n * @since 1.0.0\n */\nexport interface CubicPath2d<out Trait = unknown> extends Pipeable, Iterable<CubicCurve2d> {\n readonly [CubicPath2dTypeId]: CubicPath2dTypeId\n readonly [PathTraits]: Trait\n}\n\n/**\n * Creates a new `CubicPath2d` instance from a sequence of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `CubicPath2d` instance.\n * @since 2.0.0\n */\nexport const make: (...curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d = internal.make\n\n/**\n * Creates a new `CubicPath2d` instance from an array of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `CubicPath2d` instance.\n * @since 2.0.0\n */\nexport const fromArray: (curves: ReadonlyArray<CubicCurve2d>) => CubicPath2d = internal.fromArray\n\n/**\n * Checks if a value is a `CubicPath2d`.\n *\n * @param p - The value to check.\n * @returns `true` if the value is a `CubicPath2d`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isCubicPath2d: (p: unknown) => p is CubicPath2d = internal.isCubicPath2d\n\nexport const append: {\n /**\n * Appends a cubic curve to a cubic path.\n *\n * @param c - The cubic curve to append.\n * @returns A function that takes a cubic path and returns a new cubic path.\n * @since 1.0.0\n */\n (c: CubicCurve2d): (p: CubicPath2d) => CubicPath2d\n /**\n * Appends a cubic curve to a cubic path.\n *\n * @param p - The cubic path to append to.\n * @param c - The cubic curve to append.\n * @returns A new cubic path.\n * @since 1.0.0\n */\n (p: CubicPath2d, c: CubicCurve2d): CubicPath2d\n} = internal.append\n\n/**\n * Calculates the length of a cubic path.\n *\n * @param p - The cubic path to calculate the length of.\n * @returns The length of the cubic path.\n * @since 1.0.0\n */\nexport const length: (p: CubicPath2d) => number = internal.length\n\nexport const solve: {\n /**\n * Solves a cubic path for a given parameter.\n *\n * @param u - The parameter to solve for.\n * @returns A function that takes a cubic path and returns the solved vector.\n * @since 1.0.0\n */\n (u: number): (p: CubicPath2d) => Vector2\n /**\n * Solves a cubic path for a given parameter.\n *\n * @param p - The cubic path to solve.\n * @param u - The parameter to solve for.\n * @returns The solved vector.\n * @since 1.0.0\n */\n (p: CubicPath2d, u: number): Vector2\n} = internal.solve\n\n/**\n * Serializes a cubic path as an SVG path data string (the value of a `<path>`\n * element's `d` attribute), using `M` and `C` commands. Discontinuities between\n * curves emit a fresh `M` command.\n *\n * @param p - The cubic path to serialize.\n * @returns The SVG path data string.\n * @since 2.0.0\n */\nexport const toPathData: (p: CubicPath2d) => string = internal.toPathData\n\n/**\n * Type-narrowing predicate: refines `CubicPath2d<T>` to\n * `CubicPath2d<T & Continuous>` when adjacent curves connect.\n *\n * @since 2.0.0\n */\nexport const isContinuous: <T>(p: CubicPath2d<T>) => p is CubicPath2d<T & Continuous> =\n internal.isContinuous\n\n/**\n * Asserts that the cubic path is continuous, throwing on failure.\n *\n * @since 2.0.0\n */\nexport const asContinuous: <T>(p: CubicPath2d<T>) => CubicPath2d<T & Continuous> =\n internal.asContinuous\n\nexport const solveByDistance: {\n /**\n * Solves a cubic path by normalized arc length. Unlike {@link solve}, which\n * is parameterized by curve `u`, this samples points at constant speed along\n * the path — `s = 0.5` returns the point exactly halfway along the curve by\n * arc length, regardless of how the underlying parameterization stretches.\n *\n * Cumulative segment lengths are cached by path identity so repeated calls\n * with the same path are fast.\n *\n * @param p - The cubic path to sample.\n * @param s - Normalized arc length in `[0, 1]`. Values outside the range are\n * clamped to path endpoints.\n * @returns The point on the path at the given normalized arc length.\n * @since 1.1.0\n */\n (p: CubicPath2d, s: number): Vector2\n /**\n * Solves a cubic path by normalized arc length.\n *\n * @param s - Normalized arc length in `[0, 1]`.\n * @returns A function that takes a cubic path and returns the point at that\n * arc length.\n * @since 1.1.0\n */\n (s: number): (p: CubicPath2d) => Vector2\n} = internal.solveByDistance\n\n/**\n * Computes the axis-aligned bounding box of the path — the smallest closed\n * `Box2d` enclosing every segment.\n *\n * @param p - The cubic path.\n * @returns A closed `Box2d` enclosing the path.\n * @since 2.1.0\n */\nexport const boundingBox: (p: CubicPath2d) => Interval2d<Closed, Closed> = internal.boundingBox\n","import type * as CubicCurve2d from '../curve/cubic2d'\nimport * as RationalCubicCurve2d from '../curve/rationalCubic2d'\nimport { dual, Pipeable } from '../utils'\nimport { invariant } from '../utils'\nimport type * as Vector2 from '../vector/vector2'\nimport * as CubicPath2d from './cubic2d'\nimport type { RationalCubicPath2d } from './rationalCubic2d'\n\nexport const RationalCubicPath2dTypeId: unique symbol = Symbol('curvy/path/rationalCubic2d')\nexport type RationalCubicPath2dTypeId = typeof RationalCubicPath2dTypeId\n\nexport class RationalCubicPath2dImpl extends Pipeable implements RationalCubicPath2d {\n readonly [RationalCubicPath2dTypeId]: RationalCubicPath2dTypeId = RationalCubicPath2dTypeId\n\n readonly curves: ReadonlyArray<RationalCubicCurve2d.RationalCubicCurve2d>\n\n constructor(curves: ReadonlyArray<RationalCubicCurve2d.RationalCubicCurve2d>) {\n invariant(curves.length > 0, 'rational cubic path requires at least one curve')\n super()\n this.curves = curves\n }\n\n [Symbol.iterator](): Iterator<RationalCubicCurve2d.RationalCubicCurve2d> {\n return this.curves[Symbol.iterator]()\n }\n}\n\nexport const isRationalCubicPath2d = (p: unknown): p is RationalCubicPath2d =>\n typeof p === 'object' && p !== null && RationalCubicPath2dTypeId in p\n\nexport const make = (\n ...curves: ReadonlyArray<RationalCubicCurve2d.RationalCubicCurve2d>\n): RationalCubicPath2d => new RationalCubicPath2dImpl(curves)\n\nexport const fromArray = (\n curves: ReadonlyArray<RationalCubicCurve2d.RationalCubicCurve2d>,\n): RationalCubicPath2d => new RationalCubicPath2dImpl(curves)\n\nexport const append = dual<\n (c: RationalCubicCurve2d.RationalCubicCurve2d) => (p: RationalCubicPath2d) => RationalCubicPath2d,\n (p: RationalCubicPath2d, c: RationalCubicCurve2d.RationalCubicCurve2d) => RationalCubicPath2d\n>(2, (p, c) => fromArray([...p, c]))\n\nexport const solve = dual<\n (u: number) => (p: RationalCubicPath2d) => Vector2.Vector2,\n (p: RationalCubicPath2d, u: number) => Vector2.Vector2\n>(2, (p: RationalCubicPath2d, u: number) => {\n const curves = p instanceof RationalCubicPath2dImpl ? p.curves : [...p]\n\n if (u === 1) {\n const last = curves.at(-1) as RationalCubicCurve2d.RationalCubicCurve2d\n return RationalCubicCurve2d.solve(last, 1)\n }\n\n const t = u * curves.length\n const i = Math.floor(t)\n const curve = curves[i] as RationalCubicCurve2d.RationalCubicCurve2d\n return RationalCubicCurve2d.solve(curve, t - i)\n})\n\n// Path-level approximation: per-segment approximation is delegated to the\n// curve module; we just concat the results. Segment count grows from N\n// (input) to roughly N × k where k depends on weight magnitude and tolerance —\n// uniform-weight segments stay 1:1.\nexport const approximateAsCubicPath = dual<\n (tolerance: number) => (p: RationalCubicPath2d) => CubicPath2d.CubicPath2d,\n (p: RationalCubicPath2d, tolerance: number) => CubicPath2d.CubicPath2d\n>(2, (p: RationalCubicPath2d, tolerance: number) => {\n const curves: Array<CubicCurve2d.CubicCurve2d> = []\n for (const segment of p) {\n for (const approx of RationalCubicCurve2d.approximateAsCubicCurves(segment, tolerance)) {\n curves.push(approx)\n }\n }\n return CubicPath2d.fromArray(curves)\n})\n","import type { RationalCubicCurve2d } from '../curve/rationalCubic2d'\nimport type { Pipeable } from '../utils'\nimport type { Vector2 } from '../vector/vector2'\nimport type { CubicPath2d } from './cubic2d'\nimport type { RationalCubicPath2dTypeId } from './rationalCubic2d.internal'\nimport * as internal from './rationalCubic2d.internal'\n\n/**\n * A rational cubic path in 2D space.\n *\n * Holds a non-empty sequence of `RationalCubicCurve2d` segments; iteration\n * yields the segments in order. The path parameter `u ∈ [0, 1]` is mapped\n * uniformly across segments — `u = 0` is the start of the first segment,\n * `u = 1` is the end of the last segment, and intermediate values pick a\n * segment by index and a local parameter within it.\n *\n * Counterpart to `CubicPath2d` for curves whose evaluation includes the\n * homogeneous-to-plane projection.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 2.1.0\n */\nexport interface RationalCubicPath2d extends Pipeable, Iterable<RationalCubicCurve2d> {\n readonly [RationalCubicPath2dTypeId]: RationalCubicPath2dTypeId\n}\n\n/**\n * Checks if a value is a `RationalCubicPath2d`.\n *\n * @param p - The value to check.\n * @returns `true` if the value is a `RationalCubicPath2d`, `false` otherwise.\n * @since 2.1.0\n */\nexport const isRationalCubicPath2d: (p: unknown) => p is RationalCubicPath2d =\n internal.isRationalCubicPath2d\n\n/**\n * Creates a new `RationalCubicPath2d` from a sequence of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `RationalCubicPath2d` instance.\n * @since 2.1.0\n */\nexport const make: (...curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d =\n internal.make\n\n/**\n * Creates a new `RationalCubicPath2d` from an array of curves.\n *\n * @param curves - The curves to create the path from.\n * @returns A new `RationalCubicPath2d` instance.\n * @since 2.1.0\n */\nexport const fromArray: (curves: ReadonlyArray<RationalCubicCurve2d>) => RationalCubicPath2d =\n internal.fromArray\n\nexport const append: {\n /**\n * Appends a curve to a `RationalCubicPath2d`.\n *\n * @param c - The curve to append.\n * @returns A function that takes a path and returns a new path with the appended curve.\n * @since 2.1.0\n */\n (c: RationalCubicCurve2d): (p: RationalCubicPath2d) => RationalCubicPath2d\n /**\n * Appends a curve to a `RationalCubicPath2d`.\n *\n * @param p - The path to append to.\n * @param c - The curve to append.\n * @returns A new path with the appended curve.\n * @since 2.1.0\n */\n (p: RationalCubicPath2d, c: RationalCubicCurve2d): RationalCubicPath2d\n} = internal.append\n\nexport const solve: {\n /**\n * Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.\n *\n * Picks the segment containing `u` (uniform mapping across segments) and\n * delegates to `RationalCubicCurve2d.solve` on that segment with the local\n * parameter.\n *\n * @param p - The path to evaluate.\n * @param u - The path parameter in `[0, 1]`.\n * @returns The point on the path at parameter `u`.\n * @since 2.1.0\n */\n (p: RationalCubicPath2d, u: number): Vector2\n /**\n * Evaluates the rational cubic path at parameter `u ∈ [0, 1]`.\n *\n * @param u - The path parameter in `[0, 1]`.\n * @returns A function that takes a path and returns the point at `u`.\n * @since 2.1.0\n */\n (u: number): (p: RationalCubicPath2d) => Vector2\n} = internal.solve\n\nexport const approximateAsCubicPath: {\n /**\n * Approximates the rational cubic path as a `CubicPath2d` via per-segment\n * recursive subdivision. Each input segment is split until its midpoint\n * deviates from a polynomial-cubic candidate by at most `tolerance`; the\n * surviving candidates are concatenated into a new path.\n *\n * Lossy in general — only exact when every input segment has uniform\n * weights, in which case segment count is preserved. Tighter tolerance\n * produces more segments.\n *\n * @param p - The rational cubic path to approximate.\n * @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.\n * @returns A new `CubicPath2d` approximating the input.\n * @since 2.1.0\n */\n (p: RationalCubicPath2d, tolerance: number): CubicPath2d\n /**\n * Approximates the rational cubic path as a `CubicPath2d`.\n *\n * @param tolerance - Maximum allowed midpoint deviation per segment; must be positive.\n * @returns A function that takes a rational path and returns its approximation.\n * @since 2.1.0\n */\n (tolerance: number): (p: RationalCubicPath2d) => CubicPath2d\n} = internal.approximateAsCubicPath\n"],"mappings":";;;;;;;;AAYA,MAAa,oBAAmC,OAAO,qBAAqB;AAG5E,IAAa,kBAAb,cAAqC,SAAyC;CAC5E,CAAU,qBAAwC;CAGlD;CAEA,YAAY,QAAkD;EAC5D,UAAU,OAAO,SAAS,GAAG,yCAAyC;EACtE,OAAO;EACP,KAAK,SAAS;;CAGhB,CAAC,OAAO,YAAiD;EACvD,OAAO,KAAK,OAAO,OAAO,WAAW;;;AAIzC,MAAaA,mBAAiB,MAC5B,OAAO,MAAM,YAAY,MAAM,QAAQ,qBAAqB;AAE9D,MAAaC,UAAQ,GAAG,WACtB,IAAI,gBAAgB,OAAO;AAE7B,MAAaC,eAAa,WACxB,IAAI,gBAAgB,OAAO;AAE7B,MAAaC,WAAS,KAGpB,IAAI,GAAgB,MAAiCD,YAAU,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC;AAE5E,MAAaE,YAAU,MAAmB;CACxC,IAAI,QAAQ;CACZ,KAAK,MAAM,SAAS,GAClB,S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