@sarmal/core 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auto-init.cjs +113 -44
- package/dist/auto-init.cjs.map +1 -1
- package/dist/auto-init.js +113 -44
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.cjs +79 -11
- package/dist/curves/artemis2.cjs.map +1 -1
- package/dist/curves/artemis2.d.cts +1 -5
- package/dist/curves/artemis2.d.ts +1 -5
- package/dist/curves/artemis2.js +79 -11
- package/dist/curves/artemis2.js.map +1 -1
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/index.cjs +103 -35
- package/dist/curves/index.cjs.map +1 -1
- package/dist/curves/index.d.cts +1 -1
- package/dist/curves/index.d.ts +1 -1
- package/dist/curves/index.js +103 -35
- package/dist/curves/index.js.map +1 -1
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose52.d.cts +1 -1
- package/dist/curves/rose52.d.ts +1 -1
- package/dist/curves/star.d.cts +1 -1
- package/dist/curves/star.d.ts +1 -1
- package/dist/curves/star4.d.cts +1 -1
- package/dist/curves/star4.d.ts +1 -1
- package/dist/curves/star7.d.cts +1 -1
- package/dist/curves/star7.d.ts +1 -1
- package/dist/index.cjs +114 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +25 -7
- package/dist/index.d.ts +25 -7
- package/dist/index.js +114 -88
- package/dist/index.js.map +1 -1
- package/dist/{types-CknrlCAf.d.cts → types-BZpzgNau.d.cts} +19 -1
- package/dist/{types-CknrlCAf.d.ts → types-BZpzgNau.d.ts} +19 -1
- package/package.json +1 -1
|
@@ -2,6 +2,12 @@ interface Point {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* A control point for drawn curves, represented as a
|
|
7
|
+
* normalized `[x, y]` tuple in `[-1, 1]` space,
|
|
8
|
+
* matching the playground's draw-mode coordinate system.
|
|
9
|
+
*/
|
|
10
|
+
type ControlPoint = [number, number];
|
|
5
11
|
interface CurveDef {
|
|
6
12
|
name: string;
|
|
7
13
|
/**
|
|
@@ -39,6 +45,13 @@ interface CurveDef {
|
|
|
39
45
|
* @returns The point on the skeleton at time `t`
|
|
40
46
|
*/
|
|
41
47
|
skeletonFn?: (t: number) => Point;
|
|
48
|
+
/**
|
|
49
|
+
* How the curve was created:
|
|
50
|
+
* - 'parametric': Defined by a mathematical parametric equation
|
|
51
|
+
* - 'drawn': Defined by control points
|
|
52
|
+
* @default "parametric"
|
|
53
|
+
*/
|
|
54
|
+
kind?: "parametric" | "drawn";
|
|
42
55
|
}
|
|
43
56
|
type JumpOptions = {
|
|
44
57
|
/**
|
|
@@ -212,6 +225,11 @@ interface SarmalInstance extends AnimationControls {
|
|
|
212
225
|
pause(): void;
|
|
213
226
|
/** Stops the animation and cleans up resources */
|
|
214
227
|
destroy(): void;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the skeleton of the curve:
|
|
230
|
+
* The complete traversal over one full period, sampled at points from t=0 to t=period.
|
|
231
|
+
*/
|
|
232
|
+
getSarmalSkeleton(): Array<Point>;
|
|
215
233
|
/**
|
|
216
234
|
* Smoothly transitions from the current curve to `target`.
|
|
217
235
|
* The trail naturally reflects the new curve as new points are added.
|
|
@@ -311,4 +329,4 @@ interface SarmalOptions extends Omit<RendererOptions, "canvas" | "engine"> {
|
|
|
311
329
|
trailLength?: number;
|
|
312
330
|
}
|
|
313
331
|
|
|
314
|
-
export type { BaseRendererOptions as B, CurveDef as C, Engine as E, JumpOptions as J, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T,
|
|
332
|
+
export type { BaseRendererOptions as B, CurveDef as C, Engine as E, JumpOptions as J, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, ControlPoint as a, SarmalOptions as b, RuntimeRenderOptions as c, SeekOptions as d, TrailStyle as e };
|
|
@@ -2,6 +2,12 @@ interface Point {
|
|
|
2
2
|
x: number;
|
|
3
3
|
y: number;
|
|
4
4
|
}
|
|
5
|
+
/**
|
|
6
|
+
* A control point for drawn curves, represented as a
|
|
7
|
+
* normalized `[x, y]` tuple in `[-1, 1]` space,
|
|
8
|
+
* matching the playground's draw-mode coordinate system.
|
|
9
|
+
*/
|
|
10
|
+
type ControlPoint = [number, number];
|
|
5
11
|
interface CurveDef {
|
|
6
12
|
name: string;
|
|
7
13
|
/**
|
|
@@ -39,6 +45,13 @@ interface CurveDef {
|
|
|
39
45
|
* @returns The point on the skeleton at time `t`
|
|
40
46
|
*/
|
|
41
47
|
skeletonFn?: (t: number) => Point;
|
|
48
|
+
/**
|
|
49
|
+
* How the curve was created:
|
|
50
|
+
* - 'parametric': Defined by a mathematical parametric equation
|
|
51
|
+
* - 'drawn': Defined by control points
|
|
52
|
+
* @default "parametric"
|
|
53
|
+
*/
|
|
54
|
+
kind?: "parametric" | "drawn";
|
|
42
55
|
}
|
|
43
56
|
type JumpOptions = {
|
|
44
57
|
/**
|
|
@@ -212,6 +225,11 @@ interface SarmalInstance extends AnimationControls {
|
|
|
212
225
|
pause(): void;
|
|
213
226
|
/** Stops the animation and cleans up resources */
|
|
214
227
|
destroy(): void;
|
|
228
|
+
/**
|
|
229
|
+
* Returns the skeleton of the curve:
|
|
230
|
+
* The complete traversal over one full period, sampled at points from t=0 to t=period.
|
|
231
|
+
*/
|
|
232
|
+
getSarmalSkeleton(): Array<Point>;
|
|
215
233
|
/**
|
|
216
234
|
* Smoothly transitions from the current curve to `target`.
|
|
217
235
|
* The trail naturally reflects the new curve as new points are added.
|
|
@@ -311,4 +329,4 @@ interface SarmalOptions extends Omit<RendererOptions, "canvas" | "engine"> {
|
|
|
311
329
|
trailLength?: number;
|
|
312
330
|
}
|
|
313
331
|
|
|
314
|
-
export type { BaseRendererOptions as B, CurveDef as C, Engine as E, JumpOptions as J, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T,
|
|
332
|
+
export type { BaseRendererOptions as B, CurveDef as C, Engine as E, JumpOptions as J, Point as P, RendererOptions as R, SarmalInstance as S, TrailColor as T, ControlPoint as a, SarmalOptions as b, RuntimeRenderOptions as c, SeekOptions as d, TrailStyle as e };
|