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.
Files changed (173) hide show
  1. package/dist/characteristic/index.d.mts +88 -0
  2. package/dist/characteristic/index.mjs +2 -0
  3. package/dist/curve/index.d.mts +2 -0
  4. package/dist/curve/index.mjs +2 -0
  5. package/dist/interval/index.d.mts +3 -0
  6. package/dist/interval/index.mjs +3 -0
  7. package/dist/matrix/index.d.mts +2 -0
  8. package/dist/matrix/index.mjs +267 -0
  9. package/dist/matrix/index.mjs.map +1 -0
  10. package/dist/number.d.mts +280 -0
  11. package/dist/number.mjs +140 -0
  12. package/dist/number.mjs.map +1 -0
  13. package/dist/path/index.d.mts +261 -0
  14. package/dist/path/index.mjs +325 -0
  15. package/dist/path/index.mjs.map +1 -0
  16. package/dist/polynomial/index.d.mts +2 -0
  17. package/dist/polynomial/index.mjs +3 -0
  18. package/dist/shared/characteristic-B9nCh_cx.mjs +104 -0
  19. package/dist/shared/characteristic-B9nCh_cx.mjs.map +1 -0
  20. package/dist/shared/chunk-25Hzd3z8.mjs +13 -0
  21. package/dist/shared/cubic-BajUY0JT.d.mts +1100 -0
  22. package/dist/shared/cubic-CpHAx8cC.mjs +479 -0
  23. package/dist/shared/cubic-CpHAx8cC.mjs.map +1 -0
  24. package/dist/shared/interval-05CR6eBf.mjs +421 -0
  25. package/dist/shared/interval-05CR6eBf.mjs.map +1 -0
  26. package/dist/shared/interval-Dy-RMEE3.d.mts +533 -0
  27. package/dist/shared/interval2d-8IBZnUOq.mjs +108 -0
  28. package/dist/shared/interval2d-8IBZnUOq.mjs.map +1 -0
  29. package/dist/shared/interval2d-C2id9u31.d.mts +172 -0
  30. package/dist/shared/matrix4x4-Ck2WROK-.mjs +440 -0
  31. package/dist/shared/matrix4x4-Ck2WROK-.mjs.map +1 -0
  32. package/dist/shared/matrix4x4-Dm_tSiH1.d.mts +1183 -0
  33. package/dist/shared/quadratic-CamozcFc.mjs +330 -0
  34. package/dist/shared/quadratic-CamozcFc.mjs.map +1 -0
  35. package/dist/shared/rationalCubic2d-B6g97ryJ.d.mts +308 -0
  36. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs +295 -0
  37. package/dist/shared/rationalCubic2d-BEgUGSFf.mjs.map +1 -0
  38. package/dist/shared/rationalCubic2d-Bys2Uory.mjs +695 -0
  39. package/dist/shared/rationalCubic2d-Bys2Uory.mjs.map +1 -0
  40. package/dist/shared/rationalCubic2d-DlQfBURs.d.mts +818 -0
  41. package/dist/shared/solution-CrtLfqEq.mjs +306 -0
  42. package/dist/shared/solution-CrtLfqEq.mjs.map +1 -0
  43. package/dist/shared/solution-sNQ-ZVhN.d.mts +251 -0
  44. package/dist/{pipe.d.mts → shared/utils-MCckigYk.d.mts} +44 -26
  45. package/dist/shared/vector2-CL1HDdPr.mjs +187 -0
  46. package/dist/shared/vector2-CL1HDdPr.mjs.map +1 -0
  47. package/dist/shared/vector2-DPUY3_eA.d.mts +470 -0
  48. package/dist/shared/vector2.internal-DU_E808S.mjs +97 -0
  49. package/dist/shared/vector2.internal-DU_E808S.mjs.map +1 -0
  50. package/dist/shared/vector3-D-tv_aKL.mjs +204 -0
  51. package/dist/shared/vector3-D-tv_aKL.mjs.map +1 -0
  52. package/dist/shared/vector3-DqeOZtOB.d.mts +703 -0
  53. package/dist/shared/vector4-5KbjoHVj.mjs +109 -0
  54. package/dist/shared/vector4-5KbjoHVj.mjs.map +1 -0
  55. package/dist/shared/vector4.internal-5XcaX12X.mjs +163 -0
  56. package/dist/shared/vector4.internal-5XcaX12X.mjs.map +1 -0
  57. package/dist/solution/index.d.mts +2 -0
  58. package/dist/solution/index.mjs +2 -0
  59. package/dist/splines/index.d.mts +701 -0
  60. package/dist/splines/index.mjs +734 -0
  61. package/dist/splines/index.mjs.map +1 -0
  62. package/dist/utils.d.mts +2 -205
  63. package/dist/utils.mjs +88 -52
  64. package/dist/utils.mjs.map +1 -1
  65. package/dist/vector/index.d.mts +3 -0
  66. package/dist/vector/index.mjs +4 -0
  67. package/package.json +49 -92
  68. package/dist/curve/cubic2d.d.mts +0 -109
  69. package/dist/curve/cubic2d.d.ts +0 -109
  70. package/dist/curve/cubic2d.mjs +0 -80
  71. package/dist/curve/cubic2d.mjs.map +0 -1
  72. package/dist/curve/linear2d.d.mts +0 -94
  73. package/dist/curve/linear2d.d.ts +0 -94
  74. package/dist/curve/linear2d.mjs +0 -46
  75. package/dist/curve/linear2d.mjs.map +0 -1
  76. package/dist/curve/quadratic2d.d.mts +0 -117
  77. package/dist/curve/quadratic2d.d.ts +0 -117
  78. package/dist/curve/quadratic2d.mjs +0 -82
  79. package/dist/curve/quadratic2d.mjs.map +0 -1
  80. package/dist/interval.d.mts +0 -251
  81. package/dist/interval.d.ts +0 -251
  82. package/dist/interval.mjs +0 -86
  83. package/dist/interval.mjs.map +0 -1
  84. package/dist/matrix/matrix2x2.d.mts +0 -320
  85. package/dist/matrix/matrix2x2.d.ts +0 -320
  86. package/dist/matrix/matrix2x2.mjs +0 -25
  87. package/dist/matrix/matrix2x2.mjs.map +0 -1
  88. package/dist/matrix/matrix3x3.d.mts +0 -370
  89. package/dist/matrix/matrix3x3.d.ts +0 -370
  90. package/dist/matrix/matrix3x3.mjs +0 -28
  91. package/dist/matrix/matrix3x3.mjs.map +0 -1
  92. package/dist/matrix/matrix4x4.d.mts +0 -381
  93. package/dist/matrix/matrix4x4.d.ts +0 -381
  94. package/dist/matrix/matrix4x4.mjs +0 -178
  95. package/dist/matrix/matrix4x4.mjs.map +0 -1
  96. package/dist/path/cubic2d.d.mts +0 -95
  97. package/dist/path/cubic2d.d.ts +0 -95
  98. package/dist/path/cubic2d.mjs +0 -60
  99. package/dist/path/cubic2d.mjs.map +0 -1
  100. package/dist/path/linear2d.d.mts +0 -95
  101. package/dist/path/linear2d.d.ts +0 -95
  102. package/dist/path/linear2d.mjs +0 -53
  103. package/dist/path/linear2d.mjs.map +0 -1
  104. package/dist/path/quadratic2d.d.mts +0 -95
  105. package/dist/path/quadratic2d.d.ts +0 -95
  106. package/dist/path/quadratic2d.mjs +0 -57
  107. package/dist/path/quadratic2d.mjs.map +0 -1
  108. package/dist/pipe.d.ts +0 -58
  109. package/dist/pipe.mjs +0 -92
  110. package/dist/pipe.mjs.map +0 -1
  111. package/dist/polynomial/cubic.d.mts +0 -7
  112. package/dist/polynomial/cubic.d.ts +0 -7
  113. package/dist/polynomial/cubic.mjs +0 -133
  114. package/dist/polynomial/cubic.mjs.map +0 -1
  115. package/dist/polynomial/linear.d.mts +0 -7
  116. package/dist/polynomial/linear.d.ts +0 -7
  117. package/dist/polynomial/linear.mjs +0 -24
  118. package/dist/polynomial/linear.mjs.map +0 -1
  119. package/dist/polynomial/quadratic.d.mts +0 -7
  120. package/dist/polynomial/quadratic.d.ts +0 -7
  121. package/dist/polynomial/quadratic.mjs +0 -27
  122. package/dist/polynomial/quadratic.mjs.map +0 -1
  123. package/dist/shared/curvy.Bf5TIk31.d.mts +0 -22
  124. package/dist/shared/curvy.Bf5TIk31.d.ts +0 -22
  125. package/dist/shared/curvy.BkkW8Tx9.mjs +0 -102
  126. package/dist/shared/curvy.BkkW8Tx9.mjs.map +0 -1
  127. package/dist/shared/curvy.BxdGW9he.mjs +0 -116
  128. package/dist/shared/curvy.BxdGW9he.mjs.map +0 -1
  129. package/dist/shared/curvy.C_sCeg9J.mjs +0 -66
  130. package/dist/shared/curvy.C_sCeg9J.mjs.map +0 -1
  131. package/dist/shared/curvy.Cg8lZVUz.d.ts +0 -688
  132. package/dist/shared/curvy.DCt1gGII.mjs +0 -147
  133. package/dist/shared/curvy.DCt1gGII.mjs.map +0 -1
  134. package/dist/shared/curvy.DJ4xO0al.mjs +0 -63
  135. package/dist/shared/curvy.DJ4xO0al.mjs.map +0 -1
  136. package/dist/shared/curvy.DmVFTi0N.mjs +0 -35
  137. package/dist/shared/curvy.DmVFTi0N.mjs.map +0 -1
  138. package/dist/shared/curvy.FDaj5rlj.d.mts +0 -688
  139. package/dist/shared/curvy.lktriTpx.mjs +0 -101
  140. package/dist/shared/curvy.lktriTpx.mjs.map +0 -1
  141. package/dist/shared/curvy.mLFprrGm.mjs +0 -85
  142. package/dist/shared/curvy.mLFprrGm.mjs.map +0 -1
  143. package/dist/shared/curvy.r6f1j287.mjs +0 -76
  144. package/dist/shared/curvy.r6f1j287.mjs.map +0 -1
  145. package/dist/splines/basis2d.d.mts +0 -130
  146. package/dist/splines/basis2d.d.ts +0 -130
  147. package/dist/splines/basis2d.mjs +0 -90
  148. package/dist/splines/basis2d.mjs.map +0 -1
  149. package/dist/splines/bezier2d.d.mts +0 -182
  150. package/dist/splines/bezier2d.d.ts +0 -182
  151. package/dist/splines/bezier2d.mjs +0 -23
  152. package/dist/splines/bezier2d.mjs.map +0 -1
  153. package/dist/splines/cardinal2d.d.mts +0 -178
  154. package/dist/splines/cardinal2d.d.ts +0 -178
  155. package/dist/splines/cardinal2d.mjs +0 -114
  156. package/dist/splines/cardinal2d.mjs.map +0 -1
  157. package/dist/splines/hermite2d.d.mts +0 -124
  158. package/dist/splines/hermite2d.d.ts +0 -124
  159. package/dist/splines/hermite2d.mjs +0 -63
  160. package/dist/splines/hermite2d.mjs.map +0 -1
  161. package/dist/utils.d.ts +0 -205
  162. package/dist/vector/vector2.d.mts +0 -324
  163. package/dist/vector/vector2.d.ts +0 -324
  164. package/dist/vector/vector2.mjs +0 -30
  165. package/dist/vector/vector2.mjs.map +0 -1
  166. package/dist/vector/vector3.d.mts +0 -417
  167. package/dist/vector/vector3.d.ts +0 -417
  168. package/dist/vector/vector3.mjs +0 -38
  169. package/dist/vector/vector3.mjs.map +0 -1
  170. package/dist/vector/vector4.d.mts +0 -205
  171. package/dist/vector/vector4.d.ts +0 -205
  172. package/dist/vector/vector4.mjs +0 -20
  173. package/dist/vector/vector4.mjs.map +0 -1
@@ -1,90 +0,0 @@
1
- import { make as make$2 } from '../matrix/matrix4x4.mjs';
2
- import { fromCurves } from '../path/cubic2d.mjs';
3
- import { dual, Pipeable } from '../pipe.mjs';
4
- import { roundDown, invariant } from '../utils.mjs';
5
- import { f as fromSpline, t as toCurves } from '../shared/curvy.DCt1gGII.mjs';
6
- import '../shared/curvy.BkkW8Tx9.mjs';
7
- import '../shared/curvy.DJ4xO0al.mjs';
8
- import '../shared/curvy.C_sCeg9J.mjs';
9
- import '../shared/curvy.lktriTpx.mjs';
10
- import '../shared/curvy.mLFprrGm.mjs';
11
- import '../curve/cubic2d.mjs';
12
- import '../interval.mjs';
13
- import '../shared/curvy.DmVFTi0N.mjs';
14
- import '../polynomial/cubic.mjs';
15
- import '../shared/curvy.BxdGW9he.mjs';
16
- import '../vector/vector2.mjs';
17
- import '../shared/curvy.r6f1j287.mjs';
18
- import '../polynomial/quadratic.mjs';
19
- import '../curve/linear2d.mjs';
20
- import '../polynomial/linear.mjs';
21
- import '../curve/quadratic2d.mjs';
22
- import '../vector/vector4.mjs';
23
-
24
- var _a;
25
- const characteristic$1 = make$2(
26
- 1 / 6,
27
- 4 / 6,
28
- roundDown(1 / 6),
29
- 0,
30
- -0.5,
31
- 0,
32
- 0.5,
33
- 0,
34
- 0.5,
35
- -1,
36
- 0.5,
37
- 0,
38
- -1 / 6,
39
- 0.5,
40
- -0.5,
41
- 1 / 6
42
- );
43
- const Basis2dTypeId = Symbol("curvy/splines/basis2d");
44
- class Basis2dImpl extends Pipeable {
45
- constructor(points) {
46
- invariant(points.length >= 4, "basis splines requires 4 or more points");
47
- super();
48
- this[_a] = Basis2dTypeId;
49
- this.points = points;
50
- }
51
- [(_a = Basis2dTypeId, Symbol.iterator)]() {
52
- return this.points[Symbol.iterator]();
53
- }
54
- }
55
- const isBasis2d$1 = (p) => typeof p === "object" && p !== null && Basis2dTypeId in p;
56
- const make$1 = (p0, p1, p2, p3) => new Basis2dImpl([p0, p1, p2, p3]);
57
- const fromArray$1 = (points) => new Basis2dImpl(points);
58
- const append$1 = dual(
59
- (args) => isBasis2d$1(args[0]),
60
- (p, ...points) => new Basis2dImpl([...p, ...points])
61
- );
62
- const prepend$1 = dual(
63
- (args) => isBasis2d$1(args[0]),
64
- (p, ...points) => new Basis2dImpl([...points, ...p])
65
- );
66
- const withTriplicatedEndpoints$1 = (p) => {
67
- const points = p instanceof Basis2dImpl ? p.points : [...p];
68
- return new Basis2dImpl([
69
- points[0],
70
- points[0],
71
- ...points,
72
- points[points.length - 1],
73
- points[points.length - 1]
74
- ]);
75
- };
76
- const toPath$1 = (p) => fromCurves(...toCurves(p, characteristic$1, 1));
77
- const toBezier$1 = (p) => fromSpline(p, characteristic$1, 1);
78
-
79
- const characteristic = characteristic$1;
80
- const isBasis2d = isBasis2d$1;
81
- const make = make$1;
82
- const fromArray = fromArray$1;
83
- const append = append$1;
84
- const prepend = prepend$1;
85
- const withTriplicatedEndpoints = withTriplicatedEndpoints$1;
86
- const toPath = toPath$1;
87
- const toBezier = toBezier$1;
88
-
89
- export { append, characteristic, fromArray, isBasis2d, make, prepend, toBezier, toPath, withTriplicatedEndpoints };
90
- //# sourceMappingURL=basis2d.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"basis2d.mjs","sources":["../../src/splines/basis2d.internal.ts","../../src/splines/basis2d.ts"],"sourcesContent":["import * as Matrix4x4 from '../matrix/matrix4x4'\nimport * as CubicPath2d from '../path/cubic2d'\nimport { Pipeable } from '../pipe'\nimport { dual } from '../pipe'\nimport { invariant, roundDown } from '../utils'\nimport type * as Vector2 from '../vector/vector2'\nimport type { Basis2d } from './basis2d'\nimport * as Bezier2d from './bezier2d'\nimport { toCurves } from './util'\n\nexport const characteristic = Matrix4x4.make(\n 1 / 6,\n 4 / 6,\n roundDown(1 / 6),\n 0,\n -0.5,\n 0,\n 0.5,\n 0,\n 0.5,\n -1,\n 0.5,\n 0,\n -1 / 6,\n 0.5,\n -0.5,\n 1 / 6,\n)\n\nexport const Basis2dTypeId = Symbol('curvy/splines/basis2d')\nexport type Basis2dTypeId = typeof Basis2dTypeId\n\nclass Basis2dImpl extends Pipeable implements Basis2d {\n readonly [Basis2dTypeId]: Basis2dTypeId = Basis2dTypeId\n\n readonly points: ReadonlyArray<Vector2.Vector2>\n\n constructor(points: ReadonlyArray<Vector2.Vector2>) {\n invariant(points.length >= 4, 'basis splines requires 4 or more points')\n super()\n this.points = points\n }\n\n [Symbol.iterator]() {\n return this.points[Symbol.iterator]()\n }\n}\n\nexport const isBasis2d = (p: unknown): p is Basis2d =>\n typeof p === 'object' && p !== null && Basis2dTypeId in p\n\nexport const make = (\n p0: Vector2.Vector2,\n p1: Vector2.Vector2,\n p2: Vector2.Vector2,\n p3: Vector2.Vector2,\n) => new Basis2dImpl([p0, p1, p2, p3])\n\nexport const fromArray = (points: ReadonlyArray<Vector2.Vector2>) => new Basis2dImpl(points)\n\nexport const append = dual<\n (...points: ReadonlyArray<Vector2.Vector2>) => (p: Basis2d) => Basis2d,\n (p: Basis2d, ...points: ReadonlyArray<Vector2.Vector2>) => Basis2d\n>(\n (args) => isBasis2d(args[0]),\n (p: Basis2d, ...points: ReadonlyArray<Vector2.Vector2>) => new Basis2dImpl([...p, ...points]),\n)\n\nexport const prepend = dual<\n (...points: ReadonlyArray<Vector2.Vector2>) => (p: Basis2d) => Basis2d,\n (p: Basis2d, ...points: ReadonlyArray<Vector2.Vector2>) => Basis2d\n>(\n (args) => isBasis2d(args[0]),\n (p: Basis2d, ...points: ReadonlyArray<Vector2.Vector2>) => new Basis2dImpl([...points, ...p]),\n)\n\nexport const withTriplicatedEndpoints = (p: Basis2d) => {\n const points = p instanceof Basis2dImpl ? p.points : [...p]\n return new Basis2dImpl([\n points[0] as Vector2.Vector2,\n points[0] as Vector2.Vector2,\n ...points,\n points[points.length - 1] as Vector2.Vector2,\n points[points.length - 1] as Vector2.Vector2,\n ])\n}\n\nexport const toPath = (p: Basis2d) => CubicPath2d.fromCurves(...toCurves(p, characteristic, 1))\n\nexport const toBezier = (p: Basis2d) => Bezier2d.fromSpline(p, characteristic, 1)\n","import type { Matrix4x4 } from '../matrix/matrix4x4'\nimport type { CubicPath2d } from '../path/cubic2d'\nimport type { Pipeable } from '../pipe'\nimport type { Vector2 } from '../vector/vector2'\nimport type { Basis2dTypeId } from './basis2d.internal'\nimport * as internal from './basis2d.internal'\nimport type { Bezier2d } from './bezier2d'\n\n/**\n * Characteristic matrix of a Basis Spline.\n *\n * The characteristic matrix is a 4x4 matrix that defines the shape of the spline.\n *\n * @since 1.0.0\n */\nexport const characteristic: Matrix4x4 = internal.characteristic\n\n/**\n * A Basis Spline in 2D space.\n *\n * All fields are readonly and immutable, and all operations create new instances.\n *\n * @since 1.0.0\n */\nexport interface Basis2d extends Pipeable {\n readonly [Basis2dTypeId]: Basis2dTypeId\n [Symbol.iterator](): Iterator<Vector2>\n}\n\n/**\n * Checks if a value is a `Basis2d`.\n *\n * @param p - The value to check.\n * @returns `true` if the value is a `Basis2d`, `false` otherwise.\n * @since 1.0.0\n */\nexport const isBasis2d: (p: unknown) => p is Basis2d = internal.isBasis2d\n\n/**\n * Creates a new `Basis2d` instance.\n *\n * @param p0 - The first control point.\n * @param p1 - The second control point.\n * @param p2 - The third control point.\n * @param p3 - The fourth control point.\n * @returns A new `Basis2d` instance.\n * @since 1.0.0\n */\nexport const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Basis2d = internal.make\n\n/**\n * Creates a new `Basis2d` instance from an array of control points.\n *\n * @param points - The control points.\n * @returns A new `Basis2d` instance.\n * @since 1.0.0\n */\nexport const fromArray: (points: ReadonlyArray<Vector2>) => Basis2d = internal.fromArray\n\nexport const append: {\n /**\n * Appends control points to a `Basis2d`.\n *\n * @param points - The control points to append.\n * @returns A function that takes a `Basis2d` and returns a new `Basis2d` instance with the appended control points.\n * @since 1.0.0\n */\n (...points: ReadonlyArray<Vector2>): (p: Basis2d) => Basis2d\n /**\n * Appends control points to a `Basis2d`.\n *\n * @param p - The `Basis2d` to append the control points to.\n * @param points - The control points to append.\n * @returns A new `Basis2d` instance with the appended control points.\n * @since 1.0.0\n */\n (p: Basis2d, ...points: ReadonlyArray<Vector2>): Basis2d\n} = internal.append\n\nexport const prepend: {\n /**\n * Prepends control points to a `Basis2d`.\n *\n * @param points - The control points to prepend.\n * @returns A function that takes a `Basis2d` and returns a new `Basis2d` instance with the prepended control points.\n * @since 1.0.0\n */\n (...points: ReadonlyArray<Vector2>): (p: Basis2d) => Basis2d\n /**\n * Prepends control points to a `Basis2d`.\n *\n * @param p - The `Basis2d` to prepend the control points to.\n * @param points - The control points to prepend.\n * @returns A new `Basis2d` instance with the prepended control points.\n * @since 1.0.0\n */\n (p: Basis2d, ...points: ReadonlyArray<Vector2>): Basis2d\n} = internal.prepend\n\n/**\n * Triplicates the endpoints of a `Basis2d`.\n *\n * This is useful for creating a closed loop spline.\n *\n * @param p - The `Basis2d` to triplicate the endpoints of.\n * @returns A new `Basis2d` instance with the triplicated endpoints.\n * @since 1.0.0\n */\nexport const withTriplicatedEndpoints: (p: Basis2d) => Basis2d = internal.withTriplicatedEndpoints\n\n/**\n * Creates a new `Path2d` from a `Basis2d`.\n *\n * @param p - The `Basis2d` to convert to a `Path2d`.\n * @returns A new `Path2d` instance.\n * @since 1.0.0\n */\nexport const toPath: (p: Basis2d) => CubicPath2d = internal.toPath\n\n/**\n * Converts a `Basis2d` to a `Bezier2d`.\n *\n * @param p - The `Basis2d` to convert.\n * @returns A new `Bezier2d` instance.\n * @since 1.0.0\n */\nexport const toBezier: (p: Basis2d) => Bezier2d = internal.toBezier\n"],"names":["characteristic","Matrix4x4.make","isBasis2d","make","fromArray","append","prepend","withTriplicatedEndpoints","toPath","CubicPath2d.fromCurves","toBezier","Bezier2d.fromSpline","internal.characteristic","internal.isBasis2d","internal.make","internal.fromArray","internal.append","internal.prepend","internal.withTriplicatedEndpoints","internal.toPath","internal.toBezier"],"mappings":"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"}
@@ -1,182 +0,0 @@
1
- import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
2
- import { CubicPath2d } from '../path/cubic2d.mjs';
3
- import { Pipeable } from '../pipe.mjs';
4
- import { Vector2 } from '../vector/vector2.mjs';
5
- import '../shared/curvy.Bf5TIk31.mjs';
6
- import '../vector/vector4.mjs';
7
- import '../matrix/matrix3x3.mjs';
8
- import '../vector/vector3.mjs';
9
- import '../matrix/matrix2x2.mjs';
10
- import '../curve/cubic2d.mjs';
11
- import '../interval.mjs';
12
- import '../shared/curvy.FDaj5rlj.mjs';
13
-
14
- declare const Bezier2dTypeId: unique symbol;
15
- type Bezier2dTypeId = typeof Bezier2dTypeId;
16
-
17
- /**
18
- * A Bézier curve in 2D space.
19
- *
20
- * All fields are readonly and immutable, and all operations create new instances.
21
- *
22
- * @since 1.0.0
23
- */
24
- interface Bezier2d extends Pipeable {
25
- readonly [Bezier2dTypeId]: Bezier2dTypeId;
26
- [Symbol.iterator](): IterableIterator<Vector2>;
27
- }
28
- /**
29
- * Characteristic matrix of a Bézier curve.
30
- *
31
- * The characteristic matrix is a 4x4 matrix that defines the shape of the Bézier curve.
32
- *
33
- * @since 1.0.0
34
- */
35
- declare const characteristic: Matrix4x4;
36
- /**
37
- * Creates a new `Bezier2d` instance.
38
- *
39
- * @param p0 - The first control point.
40
- * @param p1 - The second control point.
41
- * @param p2 - The third control point.
42
- * @param p3 - The fourth control point.
43
- * @returns A new `Bezier2d` instance.
44
- * @since 1.0.0
45
- */
46
- declare const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Bezier2d;
47
- /**
48
- * Creates a new `Bezier2d` instance from an array of control points.
49
- *
50
- * @param points - The control points.
51
- * @returns A new `Bezier2d` instance.
52
- * @since 1.0.0
53
- */
54
- declare const fromArray: (points: ReadonlyArray<Vector2>) => Bezier2d;
55
- /**
56
- * Creates a new `Bezier2d` instance from an iterable of control points and the characteristic matrix associated with the control points.
57
- *
58
- * @param points - The control points.
59
- * @param matrix - The characteristic matrix.
60
- * @param stride - The stride of the control points.
61
- * @returns A new `Bezier2d` instance.
62
- * @since 1.0.0
63
- */
64
- declare const fromSpline: (points: Iterable<Vector2>, matrix: Matrix4x4, stride: 1 | 2 | 3) => Bezier2d;
65
- /**
66
- * Checks if a value is a `Bezier2d`.
67
- *
68
- * @param p - The value to check.
69
- * @returns `true` if the value is a `Bezier2d`, `false` otherwise.
70
- * @since 1.0.0
71
- */
72
- declare const isCubicBezier2d: (p: unknown) => p is Bezier2d;
73
- declare const append: {
74
- /**
75
- * Appends control points to a `Bezier2d`.
76
- *
77
- * @param p1 - The second control point (first tangent).
78
- * @param p2 - The third control point (second tangent).
79
- * @param p3 - The fourth control point (end point).
80
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
81
- */
82
- (p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
83
- /**
84
- * Appends control points to a `Bezier2d`.
85
- *
86
- * @param p - The `Bezier2d` to append the control points to.
87
- * @param p1 - The second control point (first tangent).
88
- * @param p2 - The third control point (second tangent).
89
- * @param p3 - The fourth control point (end point).
90
- * @returns A new `Bezier2d` instance with the appended control points.
91
- */
92
- (p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
93
- };
94
- declare const appendTangentAligned: {
95
- /**
96
- * Appends control points to a `Bezier2d` with aligned tangents.
97
- *
98
- * @param ratio - The ratio of the tangents.
99
- * @param p2 - The third control point (second tangent).
100
- * @param p3 - The fourth control point (end point).
101
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
102
- */
103
- (ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
104
- /**
105
- * Appends control points to a `Bezier2d` with aligned tangents.
106
- *
107
- * @param p - The `Bezier2d` to append the control points to.
108
- * @param ratio - The ratio of the tangents.
109
- * @param p2 - The third control point (second tangent).
110
- * @param p3 - The fourth control point (end point).
111
- * @returns A new `Bezier2d` instance with the appended control points.
112
- */
113
- (p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
114
- };
115
- declare const appendCurvatureMirrored: {
116
- /**
117
- * Appends control points to a `Bezier2d` with mirrored curvature.
118
- *
119
- * @param a - The first curvature parameter.
120
- * @param b - The second curvature parameter.
121
- * @param p6 - The sixth control point (end point).
122
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
123
- */
124
- (a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
125
- /**
126
- * Appends control points to a `Bezier2d` with mirrored curvature.
127
- *
128
- * @param p - The `Bezier2d` to append the control points to.
129
- * @param a - The first curvature parameter.
130
- * @param b - The second curvature parameter.
131
- * @param p6 - The sixth control point (end point).
132
- * @returns A new `Bezier2d` instance with the appended control points.
133
- */
134
- (p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
135
- };
136
- declare const appendVelocityAligned: {
137
- /**
138
- * Appends control points to a `Bezier2d` with aligned velocity.
139
- *
140
- * @param p2 - The second control point (first tangent).
141
- * @param p3 - The third control point (second tangent).
142
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
143
- */
144
- (p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
145
- /**
146
- * Appends control points to a `Bezier2d` with aligned velocity.
147
- *
148
- * @param p - The `Bezier2d` to append the control points to.
149
- * @param p2 - The second control point (first tangent).
150
- * @param p3 - The third control point (second tangent).
151
- * @returns A new `Bezier2d` instance with the appended control points.
152
- */
153
- (p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
154
- };
155
- declare const appendAccelerationAligned: {
156
- /**
157
- * Appends control points to a `Bezier2d` with aligned acceleration.
158
- *
159
- * @param p3 - The third control point (second tangent).
160
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
161
- */
162
- (p3: Vector2): (p: Bezier2d) => Bezier2d;
163
- /**
164
- * Appends control points to a `Bezier2d` with aligned acceleration.
165
- *
166
- * @param p - The `Bezier2d` to append the control points to.
167
- * @param p3 - The third control point (second tangent).
168
- * @returns A new `Bezier2d` instance with the appended control points.
169
- */
170
- (p: Bezier2d, p3: Vector2): Bezier2d;
171
- };
172
- /**
173
- * Converts a `Bezier2d` to a `CubicPath2d`.
174
- *
175
- * @param p - The `Bezier2d` to convert.
176
- * @returns A new `CubicPath2d` instance representing the same curve as the `Bezier2d`.
177
- * @since 1.0.0
178
- */
179
- declare const toPath: (p: Bezier2d) => CubicPath2d;
180
-
181
- export { append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
182
- export type { Bezier2d };
@@ -1,182 +0,0 @@
1
- import { Matrix4x4 } from '../matrix/matrix4x4.js';
2
- import { CubicPath2d } from '../path/cubic2d.js';
3
- import { Pipeable } from '../pipe.js';
4
- import { Vector2 } from '../vector/vector2.js';
5
- import '../shared/curvy.Bf5TIk31.js';
6
- import '../vector/vector4.js';
7
- import '../matrix/matrix3x3.js';
8
- import '../vector/vector3.js';
9
- import '../matrix/matrix2x2.js';
10
- import '../curve/cubic2d.js';
11
- import '../interval.js';
12
- import '../shared/curvy.Cg8lZVUz.js';
13
-
14
- declare const Bezier2dTypeId: unique symbol;
15
- type Bezier2dTypeId = typeof Bezier2dTypeId;
16
-
17
- /**
18
- * A Bézier curve in 2D space.
19
- *
20
- * All fields are readonly and immutable, and all operations create new instances.
21
- *
22
- * @since 1.0.0
23
- */
24
- interface Bezier2d extends Pipeable {
25
- readonly [Bezier2dTypeId]: Bezier2dTypeId;
26
- [Symbol.iterator](): IterableIterator<Vector2>;
27
- }
28
- /**
29
- * Characteristic matrix of a Bézier curve.
30
- *
31
- * The characteristic matrix is a 4x4 matrix that defines the shape of the Bézier curve.
32
- *
33
- * @since 1.0.0
34
- */
35
- declare const characteristic: Matrix4x4;
36
- /**
37
- * Creates a new `Bezier2d` instance.
38
- *
39
- * @param p0 - The first control point.
40
- * @param p1 - The second control point.
41
- * @param p2 - The third control point.
42
- * @param p3 - The fourth control point.
43
- * @returns A new `Bezier2d` instance.
44
- * @since 1.0.0
45
- */
46
- declare const make: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2) => Bezier2d;
47
- /**
48
- * Creates a new `Bezier2d` instance from an array of control points.
49
- *
50
- * @param points - The control points.
51
- * @returns A new `Bezier2d` instance.
52
- * @since 1.0.0
53
- */
54
- declare const fromArray: (points: ReadonlyArray<Vector2>) => Bezier2d;
55
- /**
56
- * Creates a new `Bezier2d` instance from an iterable of control points and the characteristic matrix associated with the control points.
57
- *
58
- * @param points - The control points.
59
- * @param matrix - The characteristic matrix.
60
- * @param stride - The stride of the control points.
61
- * @returns A new `Bezier2d` instance.
62
- * @since 1.0.0
63
- */
64
- declare const fromSpline: (points: Iterable<Vector2>, matrix: Matrix4x4, stride: 1 | 2 | 3) => Bezier2d;
65
- /**
66
- * Checks if a value is a `Bezier2d`.
67
- *
68
- * @param p - The value to check.
69
- * @returns `true` if the value is a `Bezier2d`, `false` otherwise.
70
- * @since 1.0.0
71
- */
72
- declare const isCubicBezier2d: (p: unknown) => p is Bezier2d;
73
- declare const append: {
74
- /**
75
- * Appends control points to a `Bezier2d`.
76
- *
77
- * @param p1 - The second control point (first tangent).
78
- * @param p2 - The third control point (second tangent).
79
- * @param p3 - The fourth control point (end point).
80
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
81
- */
82
- (p1: Vector2, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
83
- /**
84
- * Appends control points to a `Bezier2d`.
85
- *
86
- * @param p - The `Bezier2d` to append the control points to.
87
- * @param p1 - The second control point (first tangent).
88
- * @param p2 - The third control point (second tangent).
89
- * @param p3 - The fourth control point (end point).
90
- * @returns A new `Bezier2d` instance with the appended control points.
91
- */
92
- (p: Bezier2d, p1: Vector2, p2: Vector2, p3: Vector2): Bezier2d;
93
- };
94
- declare const appendTangentAligned: {
95
- /**
96
- * Appends control points to a `Bezier2d` with aligned tangents.
97
- *
98
- * @param ratio - The ratio of the tangents.
99
- * @param p2 - The third control point (second tangent).
100
- * @param p3 - The fourth control point (end point).
101
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
102
- */
103
- (ratio: number, p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
104
- /**
105
- * Appends control points to a `Bezier2d` with aligned tangents.
106
- *
107
- * @param p - The `Bezier2d` to append the control points to.
108
- * @param ratio - The ratio of the tangents.
109
- * @param p2 - The third control point (second tangent).
110
- * @param p3 - The fourth control point (end point).
111
- * @returns A new `Bezier2d` instance with the appended control points.
112
- */
113
- (p: Bezier2d, ratio: number, p2: Vector2, p3: Vector2): Bezier2d;
114
- };
115
- declare const appendCurvatureMirrored: {
116
- /**
117
- * Appends control points to a `Bezier2d` with mirrored curvature.
118
- *
119
- * @param a - The first curvature parameter.
120
- * @param b - The second curvature parameter.
121
- * @param p6 - The sixth control point (end point).
122
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
123
- */
124
- (a: number, b: number, p6: Vector2): (p: Bezier2d) => Bezier2d;
125
- /**
126
- * Appends control points to a `Bezier2d` with mirrored curvature.
127
- *
128
- * @param p - The `Bezier2d` to append the control points to.
129
- * @param a - The first curvature parameter.
130
- * @param b - The second curvature parameter.
131
- * @param p6 - The sixth control point (end point).
132
- * @returns A new `Bezier2d` instance with the appended control points.
133
- */
134
- (p: Bezier2d, a: number, b: number, p6: Vector2): Bezier2d;
135
- };
136
- declare const appendVelocityAligned: {
137
- /**
138
- * Appends control points to a `Bezier2d` with aligned velocity.
139
- *
140
- * @param p2 - The second control point (first tangent).
141
- * @param p3 - The third control point (second tangent).
142
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
143
- */
144
- (p2: Vector2, p3: Vector2): (p: Bezier2d) => Bezier2d;
145
- /**
146
- * Appends control points to a `Bezier2d` with aligned velocity.
147
- *
148
- * @param p - The `Bezier2d` to append the control points to.
149
- * @param p2 - The second control point (first tangent).
150
- * @param p3 - The third control point (second tangent).
151
- * @returns A new `Bezier2d` instance with the appended control points.
152
- */
153
- (p: Bezier2d, p2: Vector2, p3: Vector2): Bezier2d;
154
- };
155
- declare const appendAccelerationAligned: {
156
- /**
157
- * Appends control points to a `Bezier2d` with aligned acceleration.
158
- *
159
- * @param p3 - The third control point (second tangent).
160
- * @returns A function that takes a `Bezier2d` and returns a new `Bezier2d` instance with the appended control points.
161
- */
162
- (p3: Vector2): (p: Bezier2d) => Bezier2d;
163
- /**
164
- * Appends control points to a `Bezier2d` with aligned acceleration.
165
- *
166
- * @param p - The `Bezier2d` to append the control points to.
167
- * @param p3 - The third control point (second tangent).
168
- * @returns A new `Bezier2d` instance with the appended control points.
169
- */
170
- (p: Bezier2d, p3: Vector2): Bezier2d;
171
- };
172
- /**
173
- * Converts a `Bezier2d` to a `CubicPath2d`.
174
- *
175
- * @param p - The `Bezier2d` to convert.
176
- * @returns A new `CubicPath2d` instance representing the same curve as the `Bezier2d`.
177
- * @since 1.0.0
178
- */
179
- declare const toPath: (p: Bezier2d) => CubicPath2d;
180
-
181
- export { append, appendAccelerationAligned, appendCurvatureMirrored, appendTangentAligned, appendVelocityAligned, characteristic, fromArray, fromSpline, isCubicBezier2d, make, toPath };
182
- export type { Bezier2d };
@@ -1,23 +0,0 @@
1
- export { b as append, h as appendAccelerationAligned, e as appendCurvatureMirrored, d as appendTangentAligned, g as appendVelocityAligned, c as characteristic, a as fromArray, f as fromSpline, i as isCubicBezier2d, m as make, j as toPath } from '../shared/curvy.DCt1gGII.mjs';
2
- import '../matrix/matrix4x4.mjs';
3
- import '../shared/curvy.BkkW8Tx9.mjs';
4
- import '../utils.mjs';
5
- import '../pipe.mjs';
6
- import '../shared/curvy.DJ4xO0al.mjs';
7
- import '../shared/curvy.C_sCeg9J.mjs';
8
- import '../shared/curvy.lktriTpx.mjs';
9
- import '../shared/curvy.mLFprrGm.mjs';
10
- import '../path/cubic2d.mjs';
11
- import '../curve/cubic2d.mjs';
12
- import '../interval.mjs';
13
- import '../shared/curvy.DmVFTi0N.mjs';
14
- import '../polynomial/cubic.mjs';
15
- import '../shared/curvy.BxdGW9he.mjs';
16
- import '../vector/vector2.mjs';
17
- import '../shared/curvy.r6f1j287.mjs';
18
- import '../polynomial/quadratic.mjs';
19
- import '../curve/linear2d.mjs';
20
- import '../polynomial/linear.mjs';
21
- import '../curve/quadratic2d.mjs';
22
- import '../vector/vector4.mjs';
23
- //# sourceMappingURL=bezier2d.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bezier2d.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -1,178 +0,0 @@
1
- import { Matrix4x4 } from '../matrix/matrix4x4.mjs';
2
- import { CubicPath2d } from '../path/cubic2d.mjs';
3
- import { Pipeable } from '../pipe.mjs';
4
- import { Vector2 } from '../vector/vector2.mjs';
5
- import { Bezier2d } from './bezier2d.mjs';
6
- import '../shared/curvy.Bf5TIk31.mjs';
7
- import '../vector/vector4.mjs';
8
- import '../matrix/matrix3x3.mjs';
9
- import '../vector/vector3.mjs';
10
- import '../matrix/matrix2x2.mjs';
11
- import '../curve/cubic2d.mjs';
12
- import '../interval.mjs';
13
- import '../shared/curvy.FDaj5rlj.mjs';
14
-
15
- declare const Cardinal2dTypeId: unique symbol;
16
- type Cardinal2dTypeId = typeof Cardinal2dTypeId;
17
-
18
- /**
19
- * A Cardinal spline in 2D space.
20
- *
21
- * All fields are readonly and immutable, and all operations create new instances.
22
- *
23
- * @since 1.0.0
24
- */
25
- interface Cardinal2d extends Pipeable {
26
- readonly [Cardinal2dTypeId]: Cardinal2dTypeId;
27
- [Symbol.iterator](): IterableIterator<Vector2>;
28
- }
29
- /**
30
- * The characteristic matrix of a Cardinal spline.
31
- *
32
- * The characteristic matrix is a 4x4 matrix that defines the shape of the spline.
33
- *
34
- * @param scale - The tension of the spline.
35
- * @returns The characteristic matrix.
36
- * @since 1.0.0
37
- */
38
- declare const characteristic: (scale: number) => Matrix4x4;
39
- /**
40
- * The characteristic matrix of a Catmull-Rom spline.
41
- *
42
- * The characteristic matrix is a 4x4 matrix that defines the shape of the spline.
43
- *
44
- * @since 1.0.0
45
- */
46
- declare const catRomCharacteristic: Matrix4x4;
47
- /**
48
- * Checks if a value is a `Cardinal2d`.
49
- *
50
- * @param p - The value to check.
51
- * @returns `true` if the value is a `Cardinal2d`, `false` otherwise.
52
- * @since 1.0.0
53
- */
54
- declare const isCardinal2d: (p: unknown) => p is Cardinal2d;
55
- /**
56
- * Creates a new `Cardinal2d` instance.
57
- *
58
- * @param p0 - The first control point.
59
- * @param p1 - The second control point.
60
- * @param points - The remaining control points.
61
- * @returns A new `Cardinal2d` instance.
62
- * @since 1.0.0
63
- */
64
- declare const make: (p0: Vector2, p1: Vector2, ...points: ReadonlyArray<Vector2>) => Cardinal2d;
65
- /**
66
- * Creates a new `Cardinal2d` instance from an array of control points.
67
- *
68
- * @param points - The control points.
69
- * @returns A new `Cardinal2d` instance.
70
- * @since 1.0.0
71
- */
72
- declare const fromArray: (points: ReadonlyArray<Vector2>) => Cardinal2d;
73
- declare const append: {
74
- /**
75
- * Appends control points to a `Cardinal2d`.
76
- *
77
- * @param points - The control points to append.
78
- * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the appended control points.
79
- * @since 1.0.0
80
- */
81
- (...points: ReadonlyArray<Vector2>): (c: Cardinal2d) => Cardinal2d;
82
- /**
83
- * Appends control points to a `Cardinal2d`.
84
- *
85
- * @param c - The `Cardinal2d` to append the control points to.
86
- * @param points - The control points to append.
87
- * @returns A new `Cardinal2d` instance with the appended control points.
88
- * @since 1.0.0
89
- */
90
- (c: Cardinal2d, ...points: ReadonlyArray<Vector2>): Cardinal2d;
91
- };
92
- declare const prepend: {
93
- /**
94
- * Prepends control points to a `Cardinal2d`.
95
- *
96
- * @param points - The control points to prepend.
97
- * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the prepended control points.
98
- * @since 1.0.0
99
- */
100
- (...points: ReadonlyArray<Vector2>): (c: Cardinal2d) => Cardinal2d;
101
- /**
102
- * Prepends control points to a `Cardinal2d`.
103
- *
104
- * @param c - The `Cardinal2d` to prepend the control points to.
105
- * @param points - The control points to prepend.
106
- * @returns A new `Cardinal2d` instance with the prepended control points.
107
- * @since 1.0.0
108
- */
109
- (c: Cardinal2d, ...points: ReadonlyArray<Vector2>): Cardinal2d;
110
- };
111
- /**
112
- * Doubles the endpoints of a `Cardinal2d` spline.
113
- *
114
- * @param c - The `Cardinal2d` to duplicate the endpoints of.
115
- * @returns A new `Cardinal2d` instance with the duplicated endpoints.
116
- * @since 1.0.0
117
- */
118
- declare const withDuplicatedEndpoints: (c: Cardinal2d) => Cardinal2d;
119
- declare const withReflectedEndpoints: {
120
- /**
121
- * Reflects the endpoints of a `Cardinal2d` spline.
122
- *
123
- * @param scale - The scale factor for the reflection.
124
- * @returns A function that takes a `Cardinal2d` and returns a new `Cardinal2d` instance with the reflected endpoints.
125
- * @since 1.0.0
126
- */
127
- (scale: number): (c: Cardinal2d) => Cardinal2d;
128
- /**
129
- * Reflects the endpoints of a `Cardinal2d` spline.
130
- *
131
- * @param c - The `Cardinal2d` to reflect the endpoints of.
132
- * @param scale - The scale factor for the reflection.
133
- * @returns A new `Cardinal2d` instance with the reflected endpoints.
134
- * @since 1.0.0
135
- */
136
- (c: Cardinal2d, scale?: number): Cardinal2d;
137
- };
138
- declare const toPath: {
139
- /**
140
- * Converts a `Cardinal2d` to a `CubicPath2d`.
141
- *
142
- * @param scale - The scale factor for the conversion.
143
- * @returns A Function that takes a `Cardinal2d` and returns a new `CubicPath2d` instance.
144
- * @since 1.0.0
145
- */
146
- (scale: number): (c: Cardinal2d) => CubicPath2d;
147
- /**
148
- * Converts a `Cardinal2d` to a `CubicPath2d`.
149
- *
150
- * @param c - The `Cardinal2d` to convert.
151
- * @param scale - The scale factor for the conversion.
152
- * @returns A new `CubicPath2d` instance representing the same curve as the `Cardinal2d`.
153
- * @since 1.0.0
154
- */
155
- (c: Cardinal2d, scale?: number): CubicPath2d;
156
- };
157
- declare const toBezier: {
158
- /**
159
- * Converts a `Cardinal2d` to a `Bezier2d`.
160
- *
161
- * @param p - The `Cardinal2d` to convert.
162
- * @returns A new `Bezier2d` instance representing the same curve as the `Cardinal2d`.
163
- * @since 1.0.0
164
- */
165
- (p: Cardinal2d): Bezier2d;
166
- /**
167
- * Converts a `Cardinal2d` to a `Bezier2d`.
168
- *
169
- * @param p - The `Cardinal2d` to convert.
170
- * @param scale - The scale factor for the conversion.
171
- * @returns A new `Bezier2d` instance representing the same curve as the `Cardinal2d`.
172
- * @since 1.0.0
173
- */
174
- (p: Cardinal2d, scale: number): Bezier2d;
175
- };
176
-
177
- export { append, catRomCharacteristic, characteristic, fromArray, isCardinal2d, make, prepend, toBezier, toPath, withDuplicatedEndpoints, withReflectedEndpoints };
178
- export type { Cardinal2d };