@sarmal/core 0.13.0 → 0.14.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 +84 -89
- package/dist/auto-init.cjs.map +1 -1
- package/dist/auto-init.d.cts +2 -1
- package/dist/auto-init.d.ts +2 -1
- package/dist/auto-init.js +83 -88
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.cjs +7 -10
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/artemis2.js +6 -9
- package/dist/curves/astroid.cjs +4 -4
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/astroid.js +3 -3
- package/dist/curves/deltoid.cjs +4 -4
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/deltoid.js +3 -3
- package/dist/curves/epicycloid3.cjs +4 -4
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epicycloid3.js +3 -3
- package/dist/curves/epitrochoid7.cjs +5 -5
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/epitrochoid7.js +4 -4
- package/dist/curves/index.cjs +28 -32
- package/dist/curves/index.d.cts +21 -21
- package/dist/curves/index.d.ts +21 -21
- package/dist/curves/index.js +28 -44
- package/dist/curves/lame.cjs +5 -6
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lame.js +4 -5
- package/dist/curves/lissajous32.cjs +4 -4
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous32.js +3 -3
- package/dist/curves/lissajous43.cjs +4 -4
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/lissajous43.js +3 -3
- package/dist/curves/rose3.cjs +4 -4
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose3.js +3 -3
- package/dist/curves/rose5.cjs +4 -4
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose5.js +3 -3
- package/dist/index.cjs +98 -90
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -58
- package/dist/index.d.ts +23 -58
- package/dist/index.js +98 -107
- package/dist/index.js.map +1 -1
- package/dist/types-BQosOzlf.d.cts +276 -0
- package/dist/types-BQosOzlf.d.ts +276 -0
- package/package.json +1 -1
- package/dist/types-BW0bpL1Z.d.cts +0 -290
- package/dist/types-BW0bpL1Z.d.ts +0 -290
|
@@ -3,16 +3,16 @@ var TWO_PI = Math.PI * 2;
|
|
|
3
3
|
function epicycloid3Fn(t, _time, _params) {
|
|
4
4
|
return {
|
|
5
5
|
x: 4 * Math.cos(t) - Math.cos(4 * t),
|
|
6
|
-
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
6
|
+
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
9
|
var epicycloid3 = {
|
|
10
10
|
name: "Epicycloid (n=3)",
|
|
11
11
|
fn: epicycloid3Fn,
|
|
12
12
|
period: TWO_PI,
|
|
13
|
-
speed: 0.75
|
|
13
|
+
speed: 0.75
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
export { epicycloid3 };
|
|
17
17
|
//# sourceMappingURL=epicycloid3.js.map
|
|
18
|
-
//# sourceMappingURL=epicycloid3.js.map
|
|
18
|
+
//# sourceMappingURL=epicycloid3.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/curves/epitrochoid7.ts
|
|
4
4
|
var TWO_PI = Math.PI * 2;
|
|
@@ -6,14 +6,14 @@ function epitrochoid7Fn(t, _time, _params) {
|
|
|
6
6
|
const d = 1 + 0.55 * Math.sin(t * 0.5);
|
|
7
7
|
return {
|
|
8
8
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
9
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
9
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function epitrochoid7SkeletonFn(t) {
|
|
13
13
|
const d = 1.275;
|
|
14
14
|
return {
|
|
15
15
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
16
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
16
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
var epitrochoid7 = {
|
|
@@ -21,9 +21,9 @@ var epitrochoid7 = {
|
|
|
21
21
|
fn: epitrochoid7Fn,
|
|
22
22
|
period: TWO_PI,
|
|
23
23
|
speed: 1.4,
|
|
24
|
-
skeletonFn: epitrochoid7SkeletonFn
|
|
24
|
+
skeletonFn: epitrochoid7SkeletonFn
|
|
25
25
|
};
|
|
26
26
|
|
|
27
27
|
exports.epitrochoid7 = epitrochoid7;
|
|
28
28
|
//# sourceMappingURL=epitrochoid7.cjs.map
|
|
29
|
-
//# sourceMappingURL=epitrochoid7.cjs.map
|
|
29
|
+
//# sourceMappingURL=epitrochoid7.cjs.map
|
|
@@ -4,14 +4,14 @@ function epitrochoid7Fn(t, _time, _params) {
|
|
|
4
4
|
const d = 1 + 0.55 * Math.sin(t * 0.5);
|
|
5
5
|
return {
|
|
6
6
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
7
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
7
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
function epitrochoid7SkeletonFn(t) {
|
|
11
11
|
const d = 1.275;
|
|
12
12
|
return {
|
|
13
13
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
14
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
14
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
var epitrochoid7 = {
|
|
@@ -19,9 +19,9 @@ var epitrochoid7 = {
|
|
|
19
19
|
fn: epitrochoid7Fn,
|
|
20
20
|
period: TWO_PI,
|
|
21
21
|
speed: 1.4,
|
|
22
|
-
skeletonFn: epitrochoid7SkeletonFn
|
|
22
|
+
skeletonFn: epitrochoid7SkeletonFn
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export { epitrochoid7 };
|
|
26
26
|
//# sourceMappingURL=epitrochoid7.js.map
|
|
27
|
-
//# sourceMappingURL=epitrochoid7.js.map
|
|
27
|
+
//# sourceMappingURL=epitrochoid7.js.map
|
package/dist/curves/index.cjs
CHANGED
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/curves/artemis2.ts
|
|
4
4
|
var TWO_PI = Math.PI * 2;
|
|
5
5
|
function artemis2Fn(t, _time, _params) {
|
|
6
|
-
const a = 0.35,
|
|
7
|
-
|
|
8
|
-
ox = 0.175;
|
|
9
|
-
const s = Math.sin(t),
|
|
10
|
-
c = Math.cos(t);
|
|
6
|
+
const a = 0.35, b = 0.15, ox = 0.175;
|
|
7
|
+
const s = Math.sin(t), c = Math.cos(t);
|
|
11
8
|
const denom = 1 + s * s;
|
|
12
9
|
return {
|
|
13
|
-
x:
|
|
14
|
-
y:
|
|
10
|
+
x: c * (1 + a * c) / denom - ox,
|
|
11
|
+
y: s * c * (1 + b * c) / denom
|
|
15
12
|
};
|
|
16
13
|
}
|
|
17
14
|
var artemis2 = {
|
|
18
15
|
name: "Artemis II",
|
|
19
16
|
fn: artemis2Fn,
|
|
20
17
|
period: TWO_PI,
|
|
21
|
-
speed: 0.7
|
|
18
|
+
speed: 0.7
|
|
22
19
|
};
|
|
23
20
|
|
|
24
21
|
// src/curves/astroid.ts
|
|
@@ -28,14 +25,14 @@ function astroidFn(t, _time, _params) {
|
|
|
28
25
|
const s = Math.sin(t);
|
|
29
26
|
return {
|
|
30
27
|
x: c * c * c,
|
|
31
|
-
y: s * s * s
|
|
28
|
+
y: s * s * s
|
|
32
29
|
};
|
|
33
30
|
}
|
|
34
31
|
var astroid = {
|
|
35
32
|
name: "Astroid",
|
|
36
33
|
fn: astroidFn,
|
|
37
34
|
period: TWO_PI2,
|
|
38
|
-
speed: 1.1
|
|
35
|
+
speed: 1.1
|
|
39
36
|
};
|
|
40
37
|
|
|
41
38
|
// src/curves/deltoid.ts
|
|
@@ -43,14 +40,14 @@ var TWO_PI3 = Math.PI * 2;
|
|
|
43
40
|
function deltoidFn(t, _time, _params) {
|
|
44
41
|
return {
|
|
45
42
|
x: 2 * Math.cos(t) + Math.cos(2 * t),
|
|
46
|
-
y: 2 * Math.sin(t) - Math.sin(2 * t)
|
|
43
|
+
y: 2 * Math.sin(t) - Math.sin(2 * t)
|
|
47
44
|
};
|
|
48
45
|
}
|
|
49
46
|
var deltoid = {
|
|
50
47
|
name: "Deltoid",
|
|
51
48
|
fn: deltoidFn,
|
|
52
49
|
period: TWO_PI3,
|
|
53
|
-
speed: 0.9
|
|
50
|
+
speed: 0.9
|
|
54
51
|
};
|
|
55
52
|
|
|
56
53
|
// src/curves/epicycloid3.ts
|
|
@@ -58,14 +55,14 @@ var TWO_PI4 = Math.PI * 2;
|
|
|
58
55
|
function epicycloid3Fn(t, _time, _params) {
|
|
59
56
|
return {
|
|
60
57
|
x: 4 * Math.cos(t) - Math.cos(4 * t),
|
|
61
|
-
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
58
|
+
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
62
59
|
};
|
|
63
60
|
}
|
|
64
61
|
var epicycloid3 = {
|
|
65
62
|
name: "Epicycloid (n=3)",
|
|
66
63
|
fn: epicycloid3Fn,
|
|
67
64
|
period: TWO_PI4,
|
|
68
|
-
speed: 0.75
|
|
65
|
+
speed: 0.75
|
|
69
66
|
};
|
|
70
67
|
|
|
71
68
|
// src/curves/epitrochoid7.ts
|
|
@@ -74,14 +71,14 @@ function epitrochoid7Fn(t, _time, _params) {
|
|
|
74
71
|
const d = 1 + 0.55 * Math.sin(t * 0.5);
|
|
75
72
|
return {
|
|
76
73
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
77
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
74
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
78
75
|
};
|
|
79
76
|
}
|
|
80
77
|
function epitrochoid7SkeletonFn(t) {
|
|
81
78
|
const d = 1.275;
|
|
82
79
|
return {
|
|
83
80
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
84
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
81
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
84
|
var epitrochoid7 = {
|
|
@@ -89,7 +86,7 @@ var epitrochoid7 = {
|
|
|
89
86
|
fn: epitrochoid7Fn,
|
|
90
87
|
period: TWO_PI5,
|
|
91
88
|
speed: 1.4,
|
|
92
|
-
skeletonFn: epitrochoid7SkeletonFn
|
|
89
|
+
skeletonFn: epitrochoid7SkeletonFn
|
|
93
90
|
};
|
|
94
91
|
|
|
95
92
|
// src/curves/lissajous32.ts
|
|
@@ -98,7 +95,7 @@ function lissajous32Fn(t, time, _params) {
|
|
|
98
95
|
const phi = time * 0.45;
|
|
99
96
|
return {
|
|
100
97
|
x: Math.sin(3 * t + phi),
|
|
101
|
-
y: Math.sin(2 * t)
|
|
98
|
+
y: Math.sin(2 * t)
|
|
102
99
|
};
|
|
103
100
|
}
|
|
104
101
|
var lissajous32 = {
|
|
@@ -106,7 +103,7 @@ var lissajous32 = {
|
|
|
106
103
|
fn: lissajous32Fn,
|
|
107
104
|
period: TWO_PI6,
|
|
108
105
|
speed: 2,
|
|
109
|
-
skeleton: "live"
|
|
106
|
+
skeleton: "live"
|
|
110
107
|
};
|
|
111
108
|
|
|
112
109
|
// src/curves/lissajous43.ts
|
|
@@ -115,7 +112,7 @@ function lissajous43Fn(t, time, _params) {
|
|
|
115
112
|
const phi = time * 0.38;
|
|
116
113
|
return {
|
|
117
114
|
x: Math.sin(4 * t + phi),
|
|
118
|
-
y: Math.sin(3 * t)
|
|
115
|
+
y: Math.sin(3 * t)
|
|
119
116
|
};
|
|
120
117
|
}
|
|
121
118
|
var lissajous43 = {
|
|
@@ -123,18 +120,17 @@ var lissajous43 = {
|
|
|
123
120
|
fn: lissajous43Fn,
|
|
124
121
|
period: TWO_PI7,
|
|
125
122
|
speed: 1.8,
|
|
126
|
-
skeleton: "live"
|
|
123
|
+
skeleton: "live"
|
|
127
124
|
};
|
|
128
125
|
|
|
129
126
|
// src/curves/lame.ts
|
|
130
127
|
var TWO_PI8 = Math.PI * 2;
|
|
131
128
|
function lameFn(t, time, _params) {
|
|
132
129
|
const p = 1.75 + 1.25 * Math.sin(time * 0.48);
|
|
133
|
-
const c = Math.cos(t),
|
|
134
|
-
s = Math.sin(t);
|
|
130
|
+
const c = Math.cos(t), s = Math.sin(t);
|
|
135
131
|
return {
|
|
136
132
|
x: Math.sign(c) * Math.pow(Math.abs(c), p),
|
|
137
|
-
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
133
|
+
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
138
134
|
};
|
|
139
135
|
}
|
|
140
136
|
var lame = {
|
|
@@ -142,7 +138,7 @@ var lame = {
|
|
|
142
138
|
fn: lameFn,
|
|
143
139
|
period: TWO_PI8,
|
|
144
140
|
speed: 1,
|
|
145
|
-
skeleton: "live"
|
|
141
|
+
skeleton: "live"
|
|
146
142
|
};
|
|
147
143
|
|
|
148
144
|
// src/curves/rose3.ts
|
|
@@ -151,14 +147,14 @@ function rose3Fn(t, _time, _params) {
|
|
|
151
147
|
const r = Math.cos(3 * t);
|
|
152
148
|
return {
|
|
153
149
|
x: r * Math.cos(t),
|
|
154
|
-
y: r * Math.sin(t)
|
|
150
|
+
y: r * Math.sin(t)
|
|
155
151
|
};
|
|
156
152
|
}
|
|
157
153
|
var rose3 = {
|
|
158
154
|
name: "Rose (n=3)",
|
|
159
155
|
fn: rose3Fn,
|
|
160
156
|
period: TWO_PI9,
|
|
161
|
-
speed: 1.15
|
|
157
|
+
speed: 1.15
|
|
162
158
|
};
|
|
163
159
|
|
|
164
160
|
// src/curves/rose5.ts
|
|
@@ -167,14 +163,14 @@ function rose5Fn(t, _time, _params) {
|
|
|
167
163
|
const r = Math.cos(5 * t);
|
|
168
164
|
return {
|
|
169
165
|
x: r * Math.cos(t),
|
|
170
|
-
y: r * Math.sin(t)
|
|
166
|
+
y: r * Math.sin(t)
|
|
171
167
|
};
|
|
172
168
|
}
|
|
173
169
|
var rose5 = {
|
|
174
170
|
name: "Rose (n=5)",
|
|
175
171
|
fn: rose5Fn,
|
|
176
172
|
period: TWO_PI10,
|
|
177
|
-
speed: 1
|
|
173
|
+
speed: 1
|
|
178
174
|
};
|
|
179
175
|
|
|
180
176
|
// src/curves/index.ts
|
|
@@ -188,7 +184,7 @@ var curves = {
|
|
|
188
184
|
lissajous32,
|
|
189
185
|
lissajous43,
|
|
190
186
|
epicycloid3,
|
|
191
|
-
lame
|
|
187
|
+
lame
|
|
192
188
|
};
|
|
193
189
|
|
|
194
190
|
exports.artemis2 = artemis2;
|
|
@@ -203,4 +199,4 @@ exports.lissajous43 = lissajous43;
|
|
|
203
199
|
exports.rose3 = rose3;
|
|
204
200
|
exports.rose5 = rose5;
|
|
205
201
|
//# sourceMappingURL=index.cjs.map
|
|
206
|
-
//# sourceMappingURL=index.cjs.map
|
|
202
|
+
//# sourceMappingURL=index.cjs.map
|
package/dist/curves/index.d.cts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { C as CurveDef } from
|
|
2
|
-
export { artemis2 } from
|
|
3
|
-
export { astroid } from
|
|
4
|
-
export { deltoid } from
|
|
5
|
-
export { epicycloid3 } from
|
|
6
|
-
export { epitrochoid7 } from
|
|
7
|
-
export { lissajous32 } from
|
|
8
|
-
export { lissajous43 } from
|
|
9
|
-
export { lame } from
|
|
10
|
-
export { rose3 } from
|
|
11
|
-
export { rose5 } from
|
|
1
|
+
import { C as CurveDef } from '../types-BQosOzlf.cjs';
|
|
2
|
+
export { artemis2 } from './artemis2.cjs';
|
|
3
|
+
export { astroid } from './astroid.cjs';
|
|
4
|
+
export { deltoid } from './deltoid.cjs';
|
|
5
|
+
export { epicycloid3 } from './epicycloid3.cjs';
|
|
6
|
+
export { epitrochoid7 } from './epitrochoid7.cjs';
|
|
7
|
+
export { lissajous32 } from './lissajous32.cjs';
|
|
8
|
+
export { lissajous43 } from './lissajous43.cjs';
|
|
9
|
+
export { lame } from './lame.cjs';
|
|
10
|
+
export { rose3 } from './rose3.cjs';
|
|
11
|
+
export { rose5 } from './rose5.cjs';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Collection of all built-in sarmal curves
|
|
15
15
|
* Import individual curves for better tree-shaking
|
|
16
16
|
*/
|
|
17
17
|
declare const curves: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
readonly artemis2: CurveDef;
|
|
19
|
+
readonly epitrochoid7: CurveDef;
|
|
20
|
+
readonly astroid: CurveDef;
|
|
21
|
+
readonly deltoid: CurveDef;
|
|
22
|
+
readonly rose5: CurveDef;
|
|
23
|
+
readonly rose3: CurveDef;
|
|
24
|
+
readonly lissajous32: CurveDef;
|
|
25
|
+
readonly lissajous43: CurveDef;
|
|
26
|
+
readonly epicycloid3: CurveDef;
|
|
27
|
+
readonly lame: CurveDef;
|
|
28
28
|
};
|
|
29
29
|
type CurveName = keyof typeof curves;
|
|
30
30
|
|
package/dist/curves/index.d.ts
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { C as CurveDef } from
|
|
2
|
-
export { artemis2 } from
|
|
3
|
-
export { astroid } from
|
|
4
|
-
export { deltoid } from
|
|
5
|
-
export { epicycloid3 } from
|
|
6
|
-
export { epitrochoid7 } from
|
|
7
|
-
export { lissajous32 } from
|
|
8
|
-
export { lissajous43 } from
|
|
9
|
-
export { lame } from
|
|
10
|
-
export { rose3 } from
|
|
11
|
-
export { rose5 } from
|
|
1
|
+
import { C as CurveDef } from '../types-BQosOzlf.js';
|
|
2
|
+
export { artemis2 } from './artemis2.js';
|
|
3
|
+
export { astroid } from './astroid.js';
|
|
4
|
+
export { deltoid } from './deltoid.js';
|
|
5
|
+
export { epicycloid3 } from './epicycloid3.js';
|
|
6
|
+
export { epitrochoid7 } from './epitrochoid7.js';
|
|
7
|
+
export { lissajous32 } from './lissajous32.js';
|
|
8
|
+
export { lissajous43 } from './lissajous43.js';
|
|
9
|
+
export { lame } from './lame.js';
|
|
10
|
+
export { rose3 } from './rose3.js';
|
|
11
|
+
export { rose5 } from './rose5.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Collection of all built-in sarmal curves
|
|
15
15
|
* Import individual curves for better tree-shaking
|
|
16
16
|
*/
|
|
17
17
|
declare const curves: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
readonly artemis2: CurveDef;
|
|
19
|
+
readonly epitrochoid7: CurveDef;
|
|
20
|
+
readonly astroid: CurveDef;
|
|
21
|
+
readonly deltoid: CurveDef;
|
|
22
|
+
readonly rose5: CurveDef;
|
|
23
|
+
readonly rose3: CurveDef;
|
|
24
|
+
readonly lissajous32: CurveDef;
|
|
25
|
+
readonly lissajous43: CurveDef;
|
|
26
|
+
readonly epicycloid3: CurveDef;
|
|
27
|
+
readonly lame: CurveDef;
|
|
28
28
|
};
|
|
29
29
|
type CurveName = keyof typeof curves;
|
|
30
30
|
|
package/dist/curves/index.js
CHANGED
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
// src/curves/artemis2.ts
|
|
2
2
|
var TWO_PI = Math.PI * 2;
|
|
3
3
|
function artemis2Fn(t, _time, _params) {
|
|
4
|
-
const a = 0.35,
|
|
5
|
-
|
|
6
|
-
ox = 0.175;
|
|
7
|
-
const s = Math.sin(t),
|
|
8
|
-
c = Math.cos(t);
|
|
4
|
+
const a = 0.35, b = 0.15, ox = 0.175;
|
|
5
|
+
const s = Math.sin(t), c = Math.cos(t);
|
|
9
6
|
const denom = 1 + s * s;
|
|
10
7
|
return {
|
|
11
|
-
x:
|
|
12
|
-
y:
|
|
8
|
+
x: c * (1 + a * c) / denom - ox,
|
|
9
|
+
y: s * c * (1 + b * c) / denom
|
|
13
10
|
};
|
|
14
11
|
}
|
|
15
12
|
var artemis2 = {
|
|
16
13
|
name: "Artemis II",
|
|
17
14
|
fn: artemis2Fn,
|
|
18
15
|
period: TWO_PI,
|
|
19
|
-
speed: 0.7
|
|
16
|
+
speed: 0.7
|
|
20
17
|
};
|
|
21
18
|
|
|
22
19
|
// src/curves/astroid.ts
|
|
@@ -26,14 +23,14 @@ function astroidFn(t, _time, _params) {
|
|
|
26
23
|
const s = Math.sin(t);
|
|
27
24
|
return {
|
|
28
25
|
x: c * c * c,
|
|
29
|
-
y: s * s * s
|
|
26
|
+
y: s * s * s
|
|
30
27
|
};
|
|
31
28
|
}
|
|
32
29
|
var astroid = {
|
|
33
30
|
name: "Astroid",
|
|
34
31
|
fn: astroidFn,
|
|
35
32
|
period: TWO_PI2,
|
|
36
|
-
speed: 1.1
|
|
33
|
+
speed: 1.1
|
|
37
34
|
};
|
|
38
35
|
|
|
39
36
|
// src/curves/deltoid.ts
|
|
@@ -41,14 +38,14 @@ var TWO_PI3 = Math.PI * 2;
|
|
|
41
38
|
function deltoidFn(t, _time, _params) {
|
|
42
39
|
return {
|
|
43
40
|
x: 2 * Math.cos(t) + Math.cos(2 * t),
|
|
44
|
-
y: 2 * Math.sin(t) - Math.sin(2 * t)
|
|
41
|
+
y: 2 * Math.sin(t) - Math.sin(2 * t)
|
|
45
42
|
};
|
|
46
43
|
}
|
|
47
44
|
var deltoid = {
|
|
48
45
|
name: "Deltoid",
|
|
49
46
|
fn: deltoidFn,
|
|
50
47
|
period: TWO_PI3,
|
|
51
|
-
speed: 0.9
|
|
48
|
+
speed: 0.9
|
|
52
49
|
};
|
|
53
50
|
|
|
54
51
|
// src/curves/epicycloid3.ts
|
|
@@ -56,14 +53,14 @@ var TWO_PI4 = Math.PI * 2;
|
|
|
56
53
|
function epicycloid3Fn(t, _time, _params) {
|
|
57
54
|
return {
|
|
58
55
|
x: 4 * Math.cos(t) - Math.cos(4 * t),
|
|
59
|
-
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
56
|
+
y: 4 * Math.sin(t) - Math.sin(4 * t)
|
|
60
57
|
};
|
|
61
58
|
}
|
|
62
59
|
var epicycloid3 = {
|
|
63
60
|
name: "Epicycloid (n=3)",
|
|
64
61
|
fn: epicycloid3Fn,
|
|
65
62
|
period: TWO_PI4,
|
|
66
|
-
speed: 0.75
|
|
63
|
+
speed: 0.75
|
|
67
64
|
};
|
|
68
65
|
|
|
69
66
|
// src/curves/epitrochoid7.ts
|
|
@@ -72,14 +69,14 @@ function epitrochoid7Fn(t, _time, _params) {
|
|
|
72
69
|
const d = 1 + 0.55 * Math.sin(t * 0.5);
|
|
73
70
|
return {
|
|
74
71
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
75
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
72
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
76
73
|
};
|
|
77
74
|
}
|
|
78
75
|
function epitrochoid7SkeletonFn(t) {
|
|
79
76
|
const d = 1.275;
|
|
80
77
|
return {
|
|
81
78
|
x: 7 * Math.cos(t) - d * Math.cos(7 * t),
|
|
82
|
-
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
79
|
+
y: 7 * Math.sin(t) - d * Math.sin(7 * t)
|
|
83
80
|
};
|
|
84
81
|
}
|
|
85
82
|
var epitrochoid7 = {
|
|
@@ -87,7 +84,7 @@ var epitrochoid7 = {
|
|
|
87
84
|
fn: epitrochoid7Fn,
|
|
88
85
|
period: TWO_PI5,
|
|
89
86
|
speed: 1.4,
|
|
90
|
-
skeletonFn: epitrochoid7SkeletonFn
|
|
87
|
+
skeletonFn: epitrochoid7SkeletonFn
|
|
91
88
|
};
|
|
92
89
|
|
|
93
90
|
// src/curves/lissajous32.ts
|
|
@@ -96,7 +93,7 @@ function lissajous32Fn(t, time, _params) {
|
|
|
96
93
|
const phi = time * 0.45;
|
|
97
94
|
return {
|
|
98
95
|
x: Math.sin(3 * t + phi),
|
|
99
|
-
y: Math.sin(2 * t)
|
|
96
|
+
y: Math.sin(2 * t)
|
|
100
97
|
};
|
|
101
98
|
}
|
|
102
99
|
var lissajous32 = {
|
|
@@ -104,7 +101,7 @@ var lissajous32 = {
|
|
|
104
101
|
fn: lissajous32Fn,
|
|
105
102
|
period: TWO_PI6,
|
|
106
103
|
speed: 2,
|
|
107
|
-
skeleton: "live"
|
|
104
|
+
skeleton: "live"
|
|
108
105
|
};
|
|
109
106
|
|
|
110
107
|
// src/curves/lissajous43.ts
|
|
@@ -113,7 +110,7 @@ function lissajous43Fn(t, time, _params) {
|
|
|
113
110
|
const phi = time * 0.38;
|
|
114
111
|
return {
|
|
115
112
|
x: Math.sin(4 * t + phi),
|
|
116
|
-
y: Math.sin(3 * t)
|
|
113
|
+
y: Math.sin(3 * t)
|
|
117
114
|
};
|
|
118
115
|
}
|
|
119
116
|
var lissajous43 = {
|
|
@@ -121,18 +118,17 @@ var lissajous43 = {
|
|
|
121
118
|
fn: lissajous43Fn,
|
|
122
119
|
period: TWO_PI7,
|
|
123
120
|
speed: 1.8,
|
|
124
|
-
skeleton: "live"
|
|
121
|
+
skeleton: "live"
|
|
125
122
|
};
|
|
126
123
|
|
|
127
124
|
// src/curves/lame.ts
|
|
128
125
|
var TWO_PI8 = Math.PI * 2;
|
|
129
126
|
function lameFn(t, time, _params) {
|
|
130
127
|
const p = 1.75 + 1.25 * Math.sin(time * 0.48);
|
|
131
|
-
const c = Math.cos(t),
|
|
132
|
-
s = Math.sin(t);
|
|
128
|
+
const c = Math.cos(t), s = Math.sin(t);
|
|
133
129
|
return {
|
|
134
130
|
x: Math.sign(c) * Math.pow(Math.abs(c), p),
|
|
135
|
-
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
131
|
+
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
136
132
|
};
|
|
137
133
|
}
|
|
138
134
|
var lame = {
|
|
@@ -140,7 +136,7 @@ var lame = {
|
|
|
140
136
|
fn: lameFn,
|
|
141
137
|
period: TWO_PI8,
|
|
142
138
|
speed: 1,
|
|
143
|
-
skeleton: "live"
|
|
139
|
+
skeleton: "live"
|
|
144
140
|
};
|
|
145
141
|
|
|
146
142
|
// src/curves/rose3.ts
|
|
@@ -149,14 +145,14 @@ function rose3Fn(t, _time, _params) {
|
|
|
149
145
|
const r = Math.cos(3 * t);
|
|
150
146
|
return {
|
|
151
147
|
x: r * Math.cos(t),
|
|
152
|
-
y: r * Math.sin(t)
|
|
148
|
+
y: r * Math.sin(t)
|
|
153
149
|
};
|
|
154
150
|
}
|
|
155
151
|
var rose3 = {
|
|
156
152
|
name: "Rose (n=3)",
|
|
157
153
|
fn: rose3Fn,
|
|
158
154
|
period: TWO_PI9,
|
|
159
|
-
speed: 1.15
|
|
155
|
+
speed: 1.15
|
|
160
156
|
};
|
|
161
157
|
|
|
162
158
|
// src/curves/rose5.ts
|
|
@@ -165,14 +161,14 @@ function rose5Fn(t, _time, _params) {
|
|
|
165
161
|
const r = Math.cos(5 * t);
|
|
166
162
|
return {
|
|
167
163
|
x: r * Math.cos(t),
|
|
168
|
-
y: r * Math.sin(t)
|
|
164
|
+
y: r * Math.sin(t)
|
|
169
165
|
};
|
|
170
166
|
}
|
|
171
167
|
var rose5 = {
|
|
172
168
|
name: "Rose (n=5)",
|
|
173
169
|
fn: rose5Fn,
|
|
174
170
|
period: TWO_PI10,
|
|
175
|
-
speed: 1
|
|
171
|
+
speed: 1
|
|
176
172
|
};
|
|
177
173
|
|
|
178
174
|
// src/curves/index.ts
|
|
@@ -186,21 +182,9 @@ var curves = {
|
|
|
186
182
|
lissajous32,
|
|
187
183
|
lissajous43,
|
|
188
184
|
epicycloid3,
|
|
189
|
-
lame
|
|
185
|
+
lame
|
|
190
186
|
};
|
|
191
187
|
|
|
192
|
-
export {
|
|
193
|
-
artemis2,
|
|
194
|
-
astroid,
|
|
195
|
-
curves,
|
|
196
|
-
deltoid,
|
|
197
|
-
epicycloid3,
|
|
198
|
-
epitrochoid7,
|
|
199
|
-
lame,
|
|
200
|
-
lissajous32,
|
|
201
|
-
lissajous43,
|
|
202
|
-
rose3,
|
|
203
|
-
rose5,
|
|
204
|
-
};
|
|
205
|
-
//# sourceMappingURL=index.js.map
|
|
188
|
+
export { artemis2, astroid, curves, deltoid, epicycloid3, epitrochoid7, lame, lissajous32, lissajous43, rose3, rose5 };
|
|
206
189
|
//# sourceMappingURL=index.js.map
|
|
190
|
+
//# sourceMappingURL=index.js.map
|
package/dist/curves/lame.cjs
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
3
|
// src/curves/lame.ts
|
|
4
4
|
var TWO_PI = Math.PI * 2;
|
|
5
5
|
function lameFn(t, time, _params) {
|
|
6
6
|
const p = 1.75 + 1.25 * Math.sin(time * 0.48);
|
|
7
|
-
const c = Math.cos(t),
|
|
8
|
-
s = Math.sin(t);
|
|
7
|
+
const c = Math.cos(t), s = Math.sin(t);
|
|
9
8
|
return {
|
|
10
9
|
x: Math.sign(c) * Math.pow(Math.abs(c), p),
|
|
11
|
-
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
10
|
+
y: Math.sign(s) * Math.pow(Math.abs(s), p)
|
|
12
11
|
};
|
|
13
12
|
}
|
|
14
13
|
var lame = {
|
|
@@ -16,9 +15,9 @@ var lame = {
|
|
|
16
15
|
fn: lameFn,
|
|
17
16
|
period: TWO_PI,
|
|
18
17
|
speed: 1,
|
|
19
|
-
skeleton: "live"
|
|
18
|
+
skeleton: "live"
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
exports.lame = lame;
|
|
23
22
|
//# sourceMappingURL=lame.cjs.map
|
|
24
|
-
//# sourceMappingURL=lame.cjs.map
|
|
23
|
+
//# sourceMappingURL=lame.cjs.map
|
package/dist/curves/lame.d.cts
CHANGED
package/dist/curves/lame.d.ts
CHANGED