@bug-on/m3-expressive 1.0.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +110 -0
  2. package/README.md +110 -0
  3. package/dist/assets/fonts/GoogleSansFlex-VariableFont.woff2 +0 -0
  4. package/dist/assets/fonts/MaterialSymbolsOutlined-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  5. package/dist/assets/fonts/MaterialSymbolsRounded-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  6. package/dist/assets/fonts/MaterialSymbolsSharp-VariableFont_FILL,GRAD,opsz,wght.ttf +0 -0
  7. package/dist/assets/loading-indicator.svg +19 -0
  8. package/dist/assets/material-symbols-cdn.css +65 -0
  9. package/dist/assets/material-symbols-self-hosted.css +94 -0
  10. package/dist/buttons.d.mts +180 -0
  11. package/dist/buttons.d.ts +180 -0
  12. package/dist/buttons.js +4282 -0
  13. package/dist/buttons.js.map +1 -0
  14. package/dist/buttons.mjs +4227 -0
  15. package/dist/buttons.mjs.map +1 -0
  16. package/dist/core.d.mts +422 -0
  17. package/dist/core.d.ts +422 -0
  18. package/dist/core.js +2581 -0
  19. package/dist/core.js.map +1 -0
  20. package/dist/core.mjs +2547 -0
  21. package/dist/core.mjs.map +1 -0
  22. package/dist/feedback.d.mts +600 -0
  23. package/dist/feedback.d.ts +600 -0
  24. package/dist/feedback.js +2357 -0
  25. package/dist/feedback.js.map +1 -0
  26. package/dist/feedback.mjs +2321 -0
  27. package/dist/feedback.mjs.map +1 -0
  28. package/dist/forms.d.mts +40 -0
  29. package/dist/forms.d.ts +40 -0
  30. package/dist/forms.js +4263 -0
  31. package/dist/forms.js.map +1 -0
  32. package/dist/forms.mjs +4228 -0
  33. package/dist/forms.mjs.map +1 -0
  34. package/dist/icon-button-D-gs0gfj.d.mts +136 -0
  35. package/dist/icon-button-D-gs0gfj.d.ts +136 -0
  36. package/dist/index.css +309 -0
  37. package/dist/index.css.d.ts +2 -0
  38. package/dist/index.d.mts +24 -0
  39. package/dist/index.d.ts +24 -0
  40. package/dist/index.js +23972 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/index.mjs +23668 -0
  43. package/dist/index.mjs.map +1 -0
  44. package/dist/layout.d.mts +610 -0
  45. package/dist/layout.d.ts +610 -0
  46. package/dist/layout.js +5091 -0
  47. package/dist/layout.js.map +1 -0
  48. package/dist/layout.mjs +5042 -0
  49. package/dist/layout.mjs.map +1 -0
  50. package/dist/material-symbols-cdn.css +65 -0
  51. package/dist/material-symbols-cdn.css.d.ts +2 -0
  52. package/dist/material-symbols-self-hosted.css +94 -0
  53. package/dist/material-symbols-self-hosted.css.d.ts +2 -0
  54. package/dist/md3-DFhj-NZj.d.mts +17 -0
  55. package/dist/md3-DFhj-NZj.d.ts +17 -0
  56. package/dist/navigation.d.mts +2766 -0
  57. package/dist/navigation.d.ts +2766 -0
  58. package/dist/navigation.js +6684 -0
  59. package/dist/navigation.js.map +1 -0
  60. package/dist/navigation.mjs +6573 -0
  61. package/dist/navigation.mjs.map +1 -0
  62. package/dist/overlays.d.mts +161 -0
  63. package/dist/overlays.d.ts +161 -0
  64. package/dist/overlays.js +3298 -0
  65. package/dist/overlays.js.map +1 -0
  66. package/dist/overlays.mjs +3244 -0
  67. package/dist/overlays.mjs.map +1 -0
  68. package/dist/pickers.d.mts +1074 -0
  69. package/dist/pickers.d.ts +1074 -0
  70. package/dist/pickers.js +4240 -0
  71. package/dist/pickers.js.map +1 -0
  72. package/dist/pickers.mjs +4200 -0
  73. package/dist/pickers.mjs.map +1 -0
  74. package/dist/plugin.d.mts +1 -0
  75. package/dist/plugin.d.ts +1 -0
  76. package/dist/plugin.js +13 -0
  77. package/dist/plugin.js.map +1 -0
  78. package/dist/plugin.mjs +3 -0
  79. package/dist/plugin.mjs.map +1 -0
  80. package/dist/scroll-area-CVS6HyLl.d.mts +33 -0
  81. package/dist/scroll-area-CVS6HyLl.d.ts +33 -0
  82. package/dist/shapes.d.mts +1119 -0
  83. package/dist/shapes.d.ts +1119 -0
  84. package/dist/shapes.js +2941 -0
  85. package/dist/shapes.js.map +1 -0
  86. package/dist/shapes.mjs +2889 -0
  87. package/dist/shapes.mjs.map +1 -0
  88. package/dist/side-sheet-modal-BY6VCC8p.d.mts +553 -0
  89. package/dist/side-sheet-modal-CglP6KYA.d.ts +553 -0
  90. package/dist/split-button-trailing-uncheckable-C5CLCIKP.d.ts +731 -0
  91. package/dist/split-button-trailing-uncheckable-MXj_kyNt.d.mts +731 -0
  92. package/dist/text-field-eAIpz9z1.d.mts +1038 -0
  93. package/dist/text-field-eAIpz9z1.d.ts +1038 -0
  94. package/dist/typography-339RV6v7.d.mts +486 -0
  95. package/dist/typography-339RV6v7.d.ts +486 -0
  96. package/dist/typography.css +22 -0
  97. package/dist/typography.css.d.ts +2 -0
  98. package/package.json +207 -0
package/dist/shapes.js ADDED
@@ -0,0 +1,2941 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var react = require('react');
5
+ var jsxRuntime = require('react/jsx-runtime');
6
+
7
+ var __defProp = Object.defineProperty;
8
+ var __defProps = Object.defineProperties;
9
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
10
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
12
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
13
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
14
+ var __spreadValues = (a, b) => {
15
+ for (var prop in b || (b = {}))
16
+ if (__hasOwnProp.call(b, prop))
17
+ __defNormalProp(a, prop, b[prop]);
18
+ if (__getOwnPropSymbols)
19
+ for (var prop of __getOwnPropSymbols(b)) {
20
+ if (__propIsEnum.call(b, prop))
21
+ __defNormalProp(a, prop, b[prop]);
22
+ }
23
+ return a;
24
+ };
25
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
26
+
27
+ // src/shapes/core/features.ts
28
+ function cornerFeature(cubics, convex2) {
29
+ return { type: "corner", cubics, convex: convex2 };
30
+ }
31
+ function edgeFeature(cubics) {
32
+ return { type: "edge", cubics };
33
+ }
34
+ function transformFeature(feature, fn) {
35
+ const cubics = feature.cubics.map((c) => c.transformed(fn));
36
+ if (feature.type === "corner") {
37
+ return cornerFeature(cubics, feature.convex);
38
+ }
39
+ return edgeFeature(cubics);
40
+ }
41
+
42
+ // src/shapes/math/corner-rounding.ts
43
+ function cornerRounding(radius = 0, smoothing = 0) {
44
+ return { radius, smoothing };
45
+ }
46
+ var UNROUNDED = Object.freeze({
47
+ radius: 0,
48
+ smoothing: 0
49
+ });
50
+
51
+ // src/shapes/utils/utils.ts
52
+ var DISTANCE_EPSILON = 1e-4;
53
+ var ANGLE_EPSILON = 1e-4;
54
+ var FLOAT_PI = Math.PI;
55
+ function distance(dx, dy) {
56
+ return Math.sqrt(dx * dx + dy * dy);
57
+ }
58
+ function distanceSquared(dx, dy) {
59
+ return dx * dx + dy * dy;
60
+ }
61
+ function radialToCartesian(radius, angle) {
62
+ return [radius * Math.cos(angle), radius * Math.sin(angle)];
63
+ }
64
+ function positiveModulo(value, divisor) {
65
+ return (value % divisor + divisor) % divisor;
66
+ }
67
+ function interpolate(start, stop, fraction) {
68
+ return start + (stop - start) * fraction;
69
+ }
70
+ function square(value) {
71
+ return value * value;
72
+ }
73
+ function directionVector(dx, dy) {
74
+ const d = distance(dx, dy);
75
+ if (d < DISTANCE_EPSILON) return [0, 0];
76
+ return [dx / d, dy / d];
77
+ }
78
+ function convex(prevX, prevY, currX, currY, nextX, nextY) {
79
+ const v1x = currX - prevX;
80
+ const v1y = currY - prevY;
81
+ const v2x = nextX - currX;
82
+ const v2y = nextY - currY;
83
+ return v1x * v2y - v1y * v2x > 0;
84
+ }
85
+
86
+ // src/shapes/math/point.ts
87
+ function point(x, y) {
88
+ return { x, y };
89
+ }
90
+ function getDistance(p) {
91
+ return distance(p.x, p.y);
92
+ }
93
+ function getDistanceSquared(p) {
94
+ return p.x * p.x + p.y * p.y;
95
+ }
96
+ function dotProduct(a, b) {
97
+ return a.x * b.x + a.y * b.y;
98
+ }
99
+ function rotate90(p) {
100
+ return { x: -p.y, y: p.x };
101
+ }
102
+ function getDirection(p) {
103
+ const d = getDistance(p);
104
+ if (d < DISTANCE_EPSILON)
105
+ throw new Error("Can't get direction of zero-length vector");
106
+ return { x: p.x / d, y: p.y / d };
107
+ }
108
+ function clockwise(p0, p1, p2) {
109
+ const v1x = p1.x - p0.x;
110
+ const v1y = p1.y - p0.y;
111
+ const v2x = p2.x - p1.x;
112
+ const v2y = p2.y - p1.y;
113
+ return v1x * v2y - v1y * v2x > 0;
114
+ }
115
+ function addPoints(a, b) {
116
+ return { x: a.x + b.x, y: a.y + b.y };
117
+ }
118
+ function subtractPoints(a, b) {
119
+ return { x: a.x - b.x, y: a.y - b.y };
120
+ }
121
+ function scalePoint(p, scalar) {
122
+ return { x: p.x * scalar, y: p.y * scalar };
123
+ }
124
+ function dividePoint(p, scalar) {
125
+ return { x: p.x / scalar, y: p.y / scalar };
126
+ }
127
+ function lerpPoint(start, stop, fraction) {
128
+ return {
129
+ x: interpolate(start.x, stop.x, fraction),
130
+ y: interpolate(start.y, stop.y, fraction)
131
+ };
132
+ }
133
+ function transformPoint(p, fn) {
134
+ const [tx, ty] = fn(p.x, p.y);
135
+ return { x: tx, y: ty };
136
+ }
137
+
138
+ // src/shapes/math/cubic.ts
139
+ var Cubic = class _Cubic {
140
+ constructor(points) {
141
+ if (points.length !== 8)
142
+ throw new Error("Cubic points array must have exactly 8 elements");
143
+ this.points = points;
144
+ }
145
+ /** First anchor point X */
146
+ get anchor0X() {
147
+ return this.points[0];
148
+ }
149
+ /** First anchor point Y */
150
+ get anchor0Y() {
151
+ return this.points[1];
152
+ }
153
+ /** First control point X */
154
+ get control0X() {
155
+ return this.points[2];
156
+ }
157
+ /** First control point Y */
158
+ get control0Y() {
159
+ return this.points[3];
160
+ }
161
+ /** Second control point X */
162
+ get control1X() {
163
+ return this.points[4];
164
+ }
165
+ /** Second control point Y */
166
+ get control1Y() {
167
+ return this.points[5];
168
+ }
169
+ /** Second anchor point X */
170
+ get anchor1X() {
171
+ return this.points[6];
172
+ }
173
+ /** Second anchor point Y */
174
+ get anchor1Y() {
175
+ return this.points[7];
176
+ }
177
+ /**
178
+ * Returns a point on the curve at parameter t (0=start, 1=end).
179
+ * Uses the standard cubic Bézier formula.
180
+ * @param t - Parameter in [0, 1]
181
+ */
182
+ pointOnCurve(t) {
183
+ const u = 1 - t;
184
+ return point(
185
+ this.anchor0X * (u * u * u) + this.control0X * (3 * t * u * u) + this.control1X * (3 * t * t * u) + this.anchor1X * (t * t * t),
186
+ this.anchor0Y * (u * u * u) + this.control0Y * (3 * t * u * u) + this.control1Y * (3 * t * t * u) + this.anchor1Y * (t * t * t)
187
+ );
188
+ }
189
+ /**
190
+ * Returns true if this curve has (near) zero length.
191
+ */
192
+ zeroLength() {
193
+ return Math.abs(this.anchor0X - this.anchor1X) < DISTANCE_EPSILON && Math.abs(this.anchor0Y - this.anchor1Y) < DISTANCE_EPSILON;
194
+ }
195
+ /**
196
+ * Splits this cubic at parameter t, returning two cubics.
197
+ * Uses De Casteljau's algorithm.
198
+ * @param t - Split parameter in [0, 1]
199
+ * @returns [left, right] pair
200
+ */
201
+ split(t) {
202
+ const u = 1 - t;
203
+ const mid = this.pointOnCurve(t);
204
+ const left = new _Cubic([
205
+ this.anchor0X,
206
+ this.anchor0Y,
207
+ this.anchor0X * u + this.control0X * t,
208
+ this.anchor0Y * u + this.control0Y * t,
209
+ this.anchor0X * (u * u) + this.control0X * (2 * u * t) + this.control1X * (t * t),
210
+ this.anchor0Y * (u * u) + this.control0Y * (2 * u * t) + this.control1Y * (t * t),
211
+ mid.x,
212
+ mid.y
213
+ ]);
214
+ const right = new _Cubic([
215
+ mid.x,
216
+ mid.y,
217
+ this.control0X * (u * u) + this.control1X * (2 * u * t) + this.anchor1X * (t * t),
218
+ this.control0Y * (u * u) + this.control1Y * (2 * u * t) + this.anchor1Y * (t * t),
219
+ this.control1X * u + this.anchor1X * t,
220
+ this.control1Y * u + this.anchor1Y * t,
221
+ this.anchor1X,
222
+ this.anchor1Y
223
+ ]);
224
+ return [left, right];
225
+ }
226
+ /**
227
+ * Returns a reversed copy of this cubic (anchor0 ↔ anchor1, controls swapped).
228
+ */
229
+ reverse() {
230
+ return new _Cubic([
231
+ this.anchor1X,
232
+ this.anchor1Y,
233
+ this.control1X,
234
+ this.control1Y,
235
+ this.control0X,
236
+ this.control0Y,
237
+ this.anchor0X,
238
+ this.anchor0Y
239
+ ]);
240
+ }
241
+ /**
242
+ * Calculates the axis-aligned bounding box.
243
+ * @param approximate - If true, uses control point hull (faster). Default: false.
244
+ * @returns [minX, minY, maxX, maxY]
245
+ */
246
+ calculateBounds(approximate = false) {
247
+ if (this.zeroLength()) {
248
+ return [this.anchor0X, this.anchor0Y, this.anchor0X, this.anchor0Y];
249
+ }
250
+ let minX = Math.min(this.anchor0X, this.anchor1X);
251
+ let minY = Math.min(this.anchor0Y, this.anchor1Y);
252
+ let maxX = Math.max(this.anchor0X, this.anchor1X);
253
+ let maxY = Math.max(this.anchor0Y, this.anchor1Y);
254
+ if (approximate) {
255
+ minX = Math.min(minX, this.control0X, this.control1X);
256
+ minY = Math.min(minY, this.control0Y, this.control1Y);
257
+ maxX = Math.max(maxX, this.control0X, this.control1X);
258
+ maxY = Math.max(maxY, this.control0Y, this.control1Y);
259
+ return [minX, minY, maxX, maxY];
260
+ }
261
+ const xa = -this.anchor0X + 3 * this.control0X - 3 * this.control1X + this.anchor1X;
262
+ const xb = 2 * this.anchor0X - 4 * this.control0X + 2 * this.control1X;
263
+ const xc = -this.anchor0X + this.control0X;
264
+ const expandX = (t) => {
265
+ if (t >= 0 && t <= 1) {
266
+ const v = this.pointOnCurve(t).x;
267
+ if (v < minX) minX = v;
268
+ if (v > maxX) maxX = v;
269
+ }
270
+ };
271
+ if (Math.abs(xa) < DISTANCE_EPSILON) {
272
+ if (xb !== 0) expandX(2 * xc / (-2 * xb));
273
+ } else {
274
+ const xs = xb * xb - 4 * xa * xc;
275
+ if (xs >= 0) {
276
+ expandX((-xb + Math.sqrt(xs)) / (2 * xa));
277
+ expandX((-xb - Math.sqrt(xs)) / (2 * xa));
278
+ }
279
+ }
280
+ const ya = -this.anchor0Y + 3 * this.control0Y - 3 * this.control1Y + this.anchor1Y;
281
+ const yb = 2 * this.anchor0Y - 4 * this.control0Y + 2 * this.control1Y;
282
+ const yc = -this.anchor0Y + this.control0Y;
283
+ const expandY = (t) => {
284
+ if (t >= 0 && t <= 1) {
285
+ const v = this.pointOnCurve(t).y;
286
+ if (v < minY) minY = v;
287
+ if (v > maxY) maxY = v;
288
+ }
289
+ };
290
+ if (Math.abs(ya) < DISTANCE_EPSILON) {
291
+ if (yb !== 0) expandY(2 * yc / (-2 * yb));
292
+ } else {
293
+ const ys = yb * yb - 4 * ya * yc;
294
+ if (ys >= 0) {
295
+ expandY((-yb + Math.sqrt(ys)) / (2 * ya));
296
+ expandY((-yb - Math.sqrt(ys)) / (2 * ya));
297
+ }
298
+ }
299
+ return [minX, minY, maxX, maxY];
300
+ }
301
+ /**
302
+ * Interpolates between this cubic and another at fraction t.
303
+ * @param other - Target cubic
304
+ * @param t - Fraction [0, 1]
305
+ */
306
+ interpolateTo(other, t) {
307
+ return new _Cubic(
308
+ this.points.map((v, i) => interpolate(v, other.points[i], t))
309
+ );
310
+ }
311
+ /**
312
+ * Applies a PointTransformer to all anchor and control points.
313
+ * @param fn - The transform function
314
+ */
315
+ transformed(fn) {
316
+ const p = this.points.slice();
317
+ for (let i = 0; i < 8; i += 2) {
318
+ const [tx, ty] = fn(p[i], p[i + 1]);
319
+ p[i] = tx;
320
+ p[i + 1] = ty;
321
+ }
322
+ return new _Cubic(p);
323
+ }
324
+ toString() {
325
+ return `Cubic(a0=(${this.anchor0X},${this.anchor0Y}) c0=(${this.control0X},${this.control0Y}) c1=(${this.control1X},${this.control1Y}) a1=(${this.anchor1X},${this.anchor1Y}))`;
326
+ }
327
+ // ─── Static factories ─────────────────────────────────────────────────────
328
+ /**
329
+ * Creates a cubic representing a straight line.
330
+ * Control points lie at 1/3 and 2/3 of the line.
331
+ * @param x0 - Start anchor X
332
+ * @param y0 - Start anchor Y
333
+ * @param x1 - End anchor X
334
+ * @param y1 - End anchor Y
335
+ */
336
+ static straightLine(x0, y0, x1, y1) {
337
+ return new _Cubic([
338
+ x0,
339
+ y0,
340
+ interpolate(x0, x1, 1 / 3),
341
+ interpolate(y0, y1, 1 / 3),
342
+ interpolate(x0, x1, 2 / 3),
343
+ interpolate(y0, y1, 2 / 3),
344
+ x1,
345
+ y1
346
+ ]);
347
+ }
348
+ /**
349
+ * Creates a cubic approximating a circular arc.
350
+ * p0 and p1 must be equidistant from the center.
351
+ * For arcs > 180°, use multiple cubics.
352
+ *
353
+ * @param centerX - Arc center X
354
+ * @param centerY - Arc center Y
355
+ * @param x0 - Start point X (on circle)
356
+ * @param y0 - Start point Y (on circle)
357
+ * @param x1 - End point X (on circle)
358
+ * @param y1 - End point Y (on circle)
359
+ */
360
+ static circularArc(centerX, centerY, x0, y0, x1, y1) {
361
+ const p0dx = x0 - centerX;
362
+ const p0dy = y0 - centerY;
363
+ const p1dx = x1 - centerX;
364
+ const p1dy = y1 - centerY;
365
+ const d0 = Math.sqrt(p0dx * p0dx + p0dy * p0dy);
366
+ const d1 = Math.sqrt(p1dx * p1dx + p1dy * p1dy);
367
+ if (d0 < DISTANCE_EPSILON || d1 < DISTANCE_EPSILON) {
368
+ return _Cubic.straightLine(x0, y0, x1, y1);
369
+ }
370
+ const nx0 = p0dx / d0, ny0 = p0dy / d0;
371
+ const nx1 = p1dx / d1, ny1 = p1dy / d1;
372
+ const rx0 = -ny0, ry0 = nx0;
373
+ const rx1 = -ny1, ry1 = nx1;
374
+ const cosa = nx0 * nx1 + ny0 * ny1;
375
+ if (cosa > 0.999) return _Cubic.straightLine(x0, y0, x1, y1);
376
+ const clockwise2 = rx0 * p1dx + ry0 * p1dy >= 0;
377
+ const k = d0 * (4 / 3) * (Math.sqrt(2 * (1 - cosa)) - Math.sqrt(1 - square(cosa))) / (1 - cosa) * (clockwise2 ? 1 : -1);
378
+ return new _Cubic([
379
+ x0,
380
+ y0,
381
+ x0 + rx0 * k,
382
+ y0 + ry0 * k,
383
+ x1 - rx1 * k,
384
+ y1 - ry1 * k,
385
+ x1,
386
+ y1
387
+ ]);
388
+ }
389
+ /**
390
+ * Creates a zero-length cubic at the given point.
391
+ * @param x - X coordinate
392
+ * @param y - Y coordinate
393
+ */
394
+ static empty(x, y) {
395
+ return new _Cubic([x, y, x, y, x, y, x, y]);
396
+ }
397
+ };
398
+ var MutableCubic = class extends Cubic {
399
+ constructor() {
400
+ super([0, 0, 0, 0, 0, 0, 0, 0]);
401
+ }
402
+ /**
403
+ * Mutably interpolates between c1 and c2 at the given progress.
404
+ * @param c1 - Start cubic
405
+ * @param c2 - End cubic
406
+ * @param progress - Interpolation factor [0, 1]
407
+ */
408
+ interpolate(c1, c2, progress) {
409
+ for (let i = 0; i < 8; i++) {
410
+ this.points[i] = interpolate(
411
+ c1.points[i],
412
+ c2.points[i],
413
+ progress
414
+ );
415
+ }
416
+ }
417
+ /**
418
+ * Mutably applies a PointTransformer to all points.
419
+ * @param fn - The transform function
420
+ */
421
+ transform(fn) {
422
+ const p = this.points;
423
+ for (let i = 0; i < 8; i += 2) {
424
+ const [tx, ty] = fn(p[i], p[i + 1]);
425
+ p[i] = tx;
426
+ p[i + 1] = ty;
427
+ }
428
+ }
429
+ };
430
+
431
+ // src/shapes/core/rounded-polygon.ts
432
+ var RoundedCorner = class {
433
+ constructor(p0, p1, p2, rounding = UNROUNDED) {
434
+ this.p0 = p0;
435
+ this.p1 = p1;
436
+ this.p2 = p2;
437
+ this.rounding = rounding;
438
+ this.center = point(0, 0);
439
+ const v01x = p0.x - p1.x, v01y = p0.y - p1.y;
440
+ const v21x = p2.x - p1.x, v21y = p2.y - p1.y;
441
+ const d01 = distance(v01x, v01y);
442
+ const d21 = distance(v21x, v21y);
443
+ if (d01 > 0 && d21 > 0) {
444
+ this.d1 = point(v01x / d01, v01y / d01);
445
+ this.d2 = point(v21x / d21, v21y / d21);
446
+ this.cornerRadius = rounding.radius;
447
+ this.smoothing = rounding.smoothing;
448
+ const cosA = this.d1.x * this.d2.x + this.d1.y * this.d2.y;
449
+ this.sinAngle = Math.sqrt(Math.max(0, 1 - square(cosA)));
450
+ this.expectedRoundCut = this.sinAngle > 1e-3 ? this.cornerRadius * (cosA + 1) / this.sinAngle : 0;
451
+ } else {
452
+ this.d1 = point(0, 0);
453
+ this.d2 = point(0, 0);
454
+ this.cornerRadius = 0;
455
+ this.smoothing = 0;
456
+ this.sinAngle = 0;
457
+ this.expectedRoundCut = 0;
458
+ }
459
+ }
460
+ get expectedCut() {
461
+ return (1 + this.smoothing) * this.expectedRoundCut;
462
+ }
463
+ getCubics(allowedCut0, allowedCut1 = allowedCut0) {
464
+ const allowedCut = Math.min(allowedCut0, allowedCut1);
465
+ if (this.expectedRoundCut < DISTANCE_EPSILON || allowedCut < DISTANCE_EPSILON || this.cornerRadius < DISTANCE_EPSILON) {
466
+ this.center = this.p1;
467
+ return [Cubic.straightLine(this.p1.x, this.p1.y, this.p1.x, this.p1.y)];
468
+ }
469
+ const actualRoundCut = Math.min(allowedCut, this.expectedRoundCut);
470
+ const actualSmoothing0 = this.calcSmoothingValue(allowedCut0);
471
+ const actualSmoothing1 = this.calcSmoothingValue(allowedCut1);
472
+ const actualR = this.cornerRadius * actualRoundCut / this.expectedRoundCut;
473
+ const centerDist = Math.sqrt(square(actualR) + square(actualRoundCut));
474
+ const midDirX = (this.d1.x + this.d2.x) / 2;
475
+ const midDirY = (this.d1.y + this.d2.y) / 2;
476
+ const midDist = distance(midDirX, midDirY);
477
+ this.center = point(
478
+ this.p1.x + midDirX / midDist * centerDist,
479
+ this.p1.y + midDirY / midDist * centerDist
480
+ );
481
+ const ci0 = point(
482
+ this.p1.x + this.d1.x * actualRoundCut,
483
+ this.p1.y + this.d1.y * actualRoundCut
484
+ );
485
+ const ci2 = point(
486
+ this.p1.x + this.d2.x * actualRoundCut,
487
+ this.p1.y + this.d2.y * actualRoundCut
488
+ );
489
+ const flanking0 = this.computeFlankingCurve(
490
+ actualRoundCut,
491
+ actualSmoothing0,
492
+ this.p1,
493
+ this.p0,
494
+ ci0,
495
+ ci2,
496
+ this.center,
497
+ actualR
498
+ );
499
+ const flanking2 = this.computeFlankingCurve(
500
+ actualRoundCut,
501
+ actualSmoothing1,
502
+ this.p1,
503
+ this.p2,
504
+ ci2,
505
+ ci0,
506
+ this.center,
507
+ actualR
508
+ ).reverse();
509
+ return [
510
+ flanking0,
511
+ Cubic.circularArc(
512
+ this.center.x,
513
+ this.center.y,
514
+ flanking0.anchor1X,
515
+ flanking0.anchor1Y,
516
+ flanking2.anchor0X,
517
+ flanking2.anchor0Y
518
+ ),
519
+ flanking2
520
+ ];
521
+ }
522
+ calcSmoothingValue(allowedCut) {
523
+ if (allowedCut > this.expectedCut) return this.smoothing;
524
+ if (allowedCut > this.expectedRoundCut) {
525
+ return this.smoothing * (allowedCut - this.expectedRoundCut) / (this.expectedCut - this.expectedRoundCut);
526
+ }
527
+ return 0;
528
+ }
529
+ computeFlankingCurve(actualRoundCut, actualSmoothing, corner, sideStart, circleIntersect, otherIntersect, circleCenter, actualR) {
530
+ var _a;
531
+ const sdx = sideStart.x - corner.x, sdy = sideStart.y - corner.y;
532
+ const sd = distance(sdx, sdy);
533
+ const sideDir = point(sdx / sd, sdy / sd);
534
+ const curveStart = point(
535
+ corner.x + sideDir.x * actualRoundCut * (1 + actualSmoothing),
536
+ corner.y + sideDir.y * actualRoundCut * (1 + actualSmoothing)
537
+ );
538
+ const px = interpolate(
539
+ circleIntersect.x,
540
+ (circleIntersect.x + otherIntersect.x) / 2,
541
+ actualSmoothing
542
+ );
543
+ const py = interpolate(
544
+ circleIntersect.y,
545
+ (circleIntersect.y + otherIntersect.y) / 2,
546
+ actualSmoothing
547
+ );
548
+ const ptoCx = px - circleCenter.x, ptoCy = py - circleCenter.y;
549
+ const ptoCd = distance(ptoCx, ptoCy);
550
+ const curveEnd = point(
551
+ circleCenter.x + ptoCx / ptoCd * actualR,
552
+ circleCenter.y + ptoCy / ptoCd * actualR
553
+ );
554
+ const tangentX = -(curveEnd.y - circleCenter.y);
555
+ const tangentY = curveEnd.x - circleCenter.x;
556
+ const anchorEnd = (_a = lineIntersection(
557
+ sideStart,
558
+ sideDir,
559
+ curveEnd,
560
+ point(tangentX, tangentY)
561
+ )) != null ? _a : circleIntersect;
562
+ const anchorStart = point(
563
+ (curveStart.x + anchorEnd.x * 2) / 3,
564
+ (curveStart.y + anchorEnd.y * 2) / 3
565
+ );
566
+ return new Cubic([
567
+ curveStart.x,
568
+ curveStart.y,
569
+ anchorStart.x,
570
+ anchorStart.y,
571
+ anchorEnd.x,
572
+ anchorEnd.y,
573
+ curveEnd.x,
574
+ curveEnd.y
575
+ ]);
576
+ }
577
+ };
578
+ function lineIntersection(p0, d0, p1, d1) {
579
+ const rd1x = -d1.y, rd1y = d1.x;
580
+ const den = d0.x * rd1x + d0.y * rd1y;
581
+ if (Math.abs(den) < DISTANCE_EPSILON) return null;
582
+ const num = (p1.x - p0.x) * rd1x + (p1.y - p0.y) * rd1y;
583
+ if (Math.abs(den) < DISTANCE_EPSILON * Math.abs(num)) return null;
584
+ const k = num / den;
585
+ return point(p0.x + d0.x * k, p0.y + d0.y * k);
586
+ }
587
+ function calculateCenter(vertices) {
588
+ let cx = 0, cy = 0;
589
+ for (let i = 0; i < vertices.length; i += 2) {
590
+ cx += vertices[i];
591
+ cy += vertices[i + 1];
592
+ }
593
+ const n = vertices.length / 2;
594
+ return point(cx / n, cy / n);
595
+ }
596
+ function verticesFromNumVerts(numVertices, radius, cx, cy) {
597
+ const result = [];
598
+ for (let i = 0; i < numVertices; i++) {
599
+ const angle = FLOAT_PI / numVertices * 2 * i;
600
+ const [rx, ry] = radialToCartesian(radius, angle);
601
+ result.push(cx + rx, cy + ry);
602
+ }
603
+ return result;
604
+ }
605
+ var RoundedPolygon = class _RoundedPolygon {
606
+ /** @internal Use static factory methods instead */
607
+ constructor(features, center) {
608
+ this.features = features;
609
+ this.center = center;
610
+ this.cubics = buildCubicsList(features);
611
+ validateContiguity(this.cubics);
612
+ }
613
+ get centerX() {
614
+ return this.center.x;
615
+ }
616
+ get centerY() {
617
+ return this.center.y;
618
+ }
619
+ // ─── Static factories ────────────────────────────────────────────────
620
+ /**
621
+ * Creates a polygon from a vertex count (regular polygon).
622
+ * @param numVertices - Number of vertices (≥ 3)
623
+ * @param radius - Circumradius (default: 1)
624
+ * @param centerX - Center X (default: 0)
625
+ * @param centerY - Center Y (default: 0)
626
+ * @param rounding - Corner rounding for all vertices
627
+ * @param perVertexRounding - Per-vertex rounding overrides
628
+ */
629
+ static fromNumVertices(numVertices, radius = 1, centerX = 0, centerY = 0, rounding = UNROUNDED, perVertexRounding) {
630
+ if (numVertices < 3)
631
+ throw new Error("Polygon must have at least 3 vertices");
632
+ const vertices = verticesFromNumVerts(
633
+ numVertices,
634
+ radius,
635
+ centerX,
636
+ centerY
637
+ );
638
+ return _RoundedPolygon.fromVertices(
639
+ vertices,
640
+ rounding,
641
+ perVertexRounding,
642
+ centerX,
643
+ centerY
644
+ );
645
+ }
646
+ /**
647
+ * Creates a polygon from a flat vertex array [x0, y0, x1, y1, ...].
648
+ * @param vertices - Flat array of x,y pairs (length must be even and ≥ 6)
649
+ * @param rounding - Corner rounding for all vertices
650
+ * @param perVertexRounding - Per-vertex rounding overrides
651
+ * @param centerX - Center X (auto-calculated if not provided)
652
+ * @param centerY - Center Y (auto-calculated if not provided)
653
+ */
654
+ static fromVertices(vertices, rounding = UNROUNDED, perVertexRounding, centerX, centerY) {
655
+ if (vertices.length < 6)
656
+ throw new Error("Polygon must have at least 3 vertices");
657
+ if (vertices.length % 2 !== 0)
658
+ throw new Error("Vertices array must have even length");
659
+ if (perVertexRounding && perVertexRounding.length * 2 !== vertices.length) {
660
+ throw new Error("perVertexRounding must match vertex count");
661
+ }
662
+ const n = vertices.length / 2;
663
+ const roundedCorners = [];
664
+ for (let i = 0; i < n; i++) {
665
+ const vtxRounding = perVertexRounding ? perVertexRounding[i] : rounding;
666
+ const prevIdx = (i + n - 1) % n * 2;
667
+ const nextIdx = (i + 1) % n * 2;
668
+ roundedCorners.push(
669
+ new RoundedCorner(
670
+ point(vertices[prevIdx], vertices[prevIdx + 1]),
671
+ point(vertices[i * 2], vertices[i * 2 + 1]),
672
+ point(vertices[nextIdx], vertices[nextIdx + 1]),
673
+ vtxRounding
674
+ )
675
+ );
676
+ }
677
+ const cutAdjusts = [];
678
+ for (let ix = 0; ix < n; ix++) {
679
+ const expectedRoundCut = roundedCorners[ix].expectedRoundCut + roundedCorners[(ix + 1) % n].expectedRoundCut;
680
+ const expectedCut = roundedCorners[ix].expectedCut + roundedCorners[(ix + 1) % n].expectedCut;
681
+ const vx = vertices[ix * 2], vy = vertices[ix * 2 + 1];
682
+ const nx = vertices[(ix + 1) % n * 2], ny = vertices[(ix + 1) % n * 2 + 1];
683
+ const sideSize = distance(vx - nx, vy - ny);
684
+ if (expectedRoundCut > sideSize) {
685
+ cutAdjusts.push([sideSize / expectedRoundCut, 0]);
686
+ } else if (expectedCut > sideSize) {
687
+ cutAdjusts.push([
688
+ 1,
689
+ (sideSize - expectedRoundCut) / (expectedCut - expectedRoundCut)
690
+ ]);
691
+ } else {
692
+ cutAdjusts.push([1, 1]);
693
+ }
694
+ }
695
+ const corners = [];
696
+ for (let i = 0; i < n; i++) {
697
+ const allowedCuts = [];
698
+ for (const delta of [0, 1]) {
699
+ const [roundCutRatio, cutRatio] = cutAdjusts[(i + n - 1 + delta) % n];
700
+ allowedCuts.push(
701
+ roundedCorners[i].expectedRoundCut * roundCutRatio + (roundedCorners[i].expectedCut - roundedCorners[i].expectedRoundCut) * cutRatio
702
+ );
703
+ }
704
+ corners.push(roundedCorners[i].getCubics(allowedCuts[0], allowedCuts[1]));
705
+ }
706
+ const tempFeatures = [];
707
+ for (let i = 0; i < n; i++) {
708
+ const prevIdx = (i + n - 1) % n;
709
+ const nextIdx = (i + 1) % n;
710
+ const currV = point(vertices[i * 2], vertices[i * 2 + 1]);
711
+ const prevV = point(vertices[prevIdx * 2], vertices[prevIdx * 2 + 1]);
712
+ const nextV = point(vertices[nextIdx * 2], vertices[nextIdx * 2 + 1]);
713
+ const isConvex = convex(
714
+ prevV.x,
715
+ prevV.y,
716
+ currV.x,
717
+ currV.y,
718
+ nextV.x,
719
+ nextV.y
720
+ );
721
+ tempFeatures.push(cornerFeature(corners[i], isConvex));
722
+ const lastCornerA1 = corners[i][corners[i].length - 1];
723
+ const nextCornerA0 = corners[(i + 1) % n][0];
724
+ tempFeatures.push(
725
+ edgeFeature([
726
+ Cubic.straightLine(
727
+ lastCornerA1.anchor1X,
728
+ lastCornerA1.anchor1Y,
729
+ nextCornerA0.anchor0X,
730
+ nextCornerA0.anchor0Y
731
+ )
732
+ ])
733
+ );
734
+ }
735
+ const cx = centerX != null ? centerX : calculateCenter(vertices).x;
736
+ const cy = centerY != null ? centerY : calculateCenter(vertices).y;
737
+ return new _RoundedPolygon(tempFeatures, point(cx, cy));
738
+ }
739
+ /**
740
+ * Creates a polygon from a pre-built Feature list.
741
+ * @param features - Feature list (≥ 2 features)
742
+ * @param centerX - Center X (auto-calculated if NaN)
743
+ * @param centerY - Center Y (auto-calculated if NaN)
744
+ */
745
+ static fromFeatures(features, centerX = Number.NaN, centerY = Number.NaN) {
746
+ if (features.length < 2)
747
+ throw new Error("Polygon must have at least 2 features");
748
+ const allVertices = [];
749
+ for (const f of features) {
750
+ for (const c of f.cubics) {
751
+ allVertices.push(c.anchor0X, c.anchor0Y);
752
+ }
753
+ }
754
+ const cx = Number.isNaN(centerX) ? calculateCenter(allVertices).x : centerX;
755
+ const cy = Number.isNaN(centerY) ? calculateCenter(allVertices).y : centerY;
756
+ return new _RoundedPolygon(features, point(cx, cy));
757
+ }
758
+ // ─── Instance methods ────────────────────────────────────────────────
759
+ /**
760
+ * Returns a new RoundedPolygon with all points transformed.
761
+ * @param fn - Transform function: (x, y) => [x', y']
762
+ */
763
+ transformed(fn) {
764
+ const [cx, cy] = fn(this.center.x, this.center.y);
765
+ return new _RoundedPolygon(
766
+ this.features.map((f) => transformFeature(f, fn)),
767
+ point(cx, cy)
768
+ );
769
+ }
770
+ /**
771
+ * Returns a normalized copy: scaled and centered to fit in [0,1] × [0,1].
772
+ * Maintains aspect ratio by using the larger dimension.
773
+ */
774
+ normalized() {
775
+ const [minX, minY, maxX, maxY] = this.calculateBounds(false);
776
+ const width = maxX - minX;
777
+ const height = maxY - minY;
778
+ const side = Math.max(width, height);
779
+ const offsetX = (side - width) / 2 - minX;
780
+ const offsetY = (side - height) / 2 - minY;
781
+ return this.transformed((x, y) => [
782
+ (x + offsetX) / side,
783
+ (y + offsetY) / side
784
+ ]);
785
+ }
786
+ /**
787
+ * Calculates the axis-aligned bounding box.
788
+ * @param approximate - If true, uses control point hull (faster). Default: true.
789
+ * @returns [minX, minY, maxX, maxY]
790
+ */
791
+ calculateBounds(approximate = true) {
792
+ let minX = Number.MAX_VALUE, minY = Number.MAX_VALUE;
793
+ let maxX = -Number.MAX_VALUE, maxY = -Number.MAX_VALUE;
794
+ for (const c of this.cubics) {
795
+ const [cx0, cy0, cx1, cy1] = c.calculateBounds(approximate);
796
+ if (cx0 < minX) minX = cx0;
797
+ if (cy0 < minY) minY = cy0;
798
+ if (cx1 > maxX) maxX = cx1;
799
+ if (cy1 > maxY) maxY = cy1;
800
+ }
801
+ return [minX, minY, maxX, maxY];
802
+ }
803
+ /**
804
+ * Calculates the maximum bounding square (useful for shapes that rotate).
805
+ * @returns [minX, minY, maxX, maxY] of the max-bounds square
806
+ */
807
+ calculateMaxBounds() {
808
+ let maxDistSq = 0;
809
+ for (const c of this.cubics) {
810
+ const ad = distanceSquared(
811
+ c.anchor0X - this.centerX,
812
+ c.anchor0Y - this.centerY
813
+ );
814
+ const mid = c.pointOnCurve(0.5);
815
+ const md = distanceSquared(mid.x - this.centerX, mid.y - this.centerY);
816
+ const m = Math.max(ad, md);
817
+ if (m > maxDistSq) maxDistSq = m;
818
+ }
819
+ const d = Math.sqrt(maxDistSq);
820
+ return [
821
+ this.centerX - d,
822
+ this.centerY - d,
823
+ this.centerX + d,
824
+ this.centerY + d
825
+ ];
826
+ }
827
+ };
828
+ function buildCubicsList(features) {
829
+ const result = [];
830
+ let firstCubic = null;
831
+ let lastCubic = null;
832
+ let firstFeatureSplitStart = null;
833
+ let firstFeatureSplitEnd = null;
834
+ if (features.length > 0 && features[0].cubics.length === 3) {
835
+ const center = features[0].cubics[1];
836
+ const [start, end] = center.split(0.5);
837
+ firstFeatureSplitStart = [features[0].cubics[0], start];
838
+ firstFeatureSplitEnd = [end, features[0].cubics[2]];
839
+ }
840
+ for (let i = 0; i <= features.length; i++) {
841
+ let featureCubics;
842
+ if (i === 0 && firstFeatureSplitEnd) {
843
+ featureCubics = firstFeatureSplitEnd;
844
+ } else if (i === features.length) {
845
+ if (firstFeatureSplitStart) featureCubics = firstFeatureSplitStart;
846
+ else break;
847
+ } else {
848
+ featureCubics = features[i].cubics;
849
+ }
850
+ for (const cubic of featureCubics) {
851
+ if (!cubic.zeroLength()) {
852
+ if (lastCubic) result.push(lastCubic);
853
+ lastCubic = cubic;
854
+ if (!firstCubic) firstCubic = cubic;
855
+ } else if (lastCubic) {
856
+ const p = lastCubic.points.slice();
857
+ p[6] = cubic.anchor1X;
858
+ p[7] = cubic.anchor1Y;
859
+ lastCubic = new Cubic(p);
860
+ }
861
+ }
862
+ }
863
+ if (lastCubic && firstCubic) {
864
+ result.push(
865
+ new Cubic([
866
+ lastCubic.anchor0X,
867
+ lastCubic.anchor0Y,
868
+ lastCubic.control0X,
869
+ lastCubic.control0Y,
870
+ lastCubic.control1X,
871
+ lastCubic.control1Y,
872
+ firstCubic.anchor0X,
873
+ firstCubic.anchor0Y
874
+ ])
875
+ );
876
+ } else {
877
+ result.push(Cubic.empty(0, 0));
878
+ }
879
+ return result;
880
+ }
881
+ function validateContiguity(cubics) {
882
+ let prev = cubics[cubics.length - 1];
883
+ for (const cubic of cubics) {
884
+ if (Math.abs(cubic.anchor0X - prev.anchor1X) > DISTANCE_EPSILON || Math.abs(cubic.anchor0Y - prev.anchor1Y) > DISTANCE_EPSILON) {
885
+ throw new Error(
886
+ `RoundedPolygon must be contiguous: gap between (${cubic.anchor0X},${cubic.anchor0Y}) and (${prev.anchor1X},${prev.anchor1Y})`
887
+ );
888
+ }
889
+ prev = cubic;
890
+ }
891
+ }
892
+
893
+ // src/shapes/catalog/md3-expressive-shapes.ts
894
+ function createShape(pts) {
895
+ const cubics = pts.map((p) => new Cubic(p));
896
+ return RoundedPolygon.fromFeatures(
897
+ cubics.map((c) => cornerFeature([c], false))
898
+ );
899
+ }
900
+ var archShape = createShape([
901
+ [1, 0.83461, 1, 0.8547, 1, 0.86477, 0.99898, 0.87322],
902
+ [0.99898, 0.87322, 0.99115, 0.93918, 0.93918, 0.99115, 0.87322, 0.99898],
903
+ [0.87322, 0.99898, 0.86477, 1, 0.8547, 1, 0.83461, 1],
904
+ [0.83461, 1, 0.61154, 1, 0.38847, 1, 0.1654, 1],
905
+ [0.1654, 1, 0.14529, 1, 0.13524, 1, 0.12679, 0.99898],
906
+ [0.12679, 0.99898, 0.06084, 0.99115, 884e-5, 0.93918, 1e-3, 0.87322],
907
+ [1e-3, 0.87322, 0, 0.86477, 0, 0.8547, 0, 0.83461],
908
+ [0, 0.83461, 0, 0.72307, 0, 0.61154, 0, 0.5],
909
+ [0, 0.5, 0, 0.22385, 0.22386, 0, 0.5, 0],
910
+ [0.5, 0, 0.77615, 0, 1, 0.22385, 1, 0.5],
911
+ [1, 0.5, 1, 0.61154, 1, 0.72307, 1, 0.83461]
912
+ ]);
913
+ var arrowShape = createShape([
914
+ [0.8594, 0.44684, 0.81504, 0.37855, 0.77068, 0.31016, 0.72632, 0.24187],
915
+ [0.72632, 0.24187, 0.69754, 0.19753, 0.66825, 0.1526, 0.62934, 0.11738],
916
+ [0.62934, 0.11738, 0.59043, 0.08209, 0.54003, 0.05716, 0.48834, 0.06041],
917
+ [0.48834, 0.06041, 0.44296, 0.06333, 0.4009, 0.08773, 0.36769, 0.11959],
918
+ [0.36769, 0.11959, 0.33449, 0.15146, 0.30869, 0.1907, 0.28332, 0.22956],
919
+ [0.28332, 0.22956, 0.21469, 0.33456, 0.14598, 0.43956, 0.07736, 0.54462],
920
+ [0.07736, 0.54462, 0.04474, 0.5945, 0.01128, 0.64655, 226e-5, 0.70598],
921
+ [226e-5, 0.70598, -864e-5, 0.77779, 0.02074, 0.85092, 0.07284, 0.89867],
922
+ [0.07284, 0.89867, 0.12733, 0.94861, 0.21563, 0.94456, 0.28196, 0.93089],
923
+ [0.28196, 0.93089, 0.35467, 0.91586, 0.42576, 0.8876, 0.49992, 0.88769],
924
+ [0.49992, 0.88769, 0.56344, 0.88769, 0.62483, 0.90858, 0.68664, 0.92377],
925
+ [0.68664, 0.92377, 0.74837, 0.93886, 0.8147, 0.94817, 0.8743, 0.9257],
926
+ [0.8743, 0.9257, 0.94829, 0.89788, 1.00142, 0.81877, 0.99997, 0.73757],
927
+ [0.99997, 0.73757, 0.99861, 0.66348, 0.95714, 0.59731, 0.91721, 0.53567],
928
+ [0.91721, 0.53567, 0.89797, 0.50608, 0.87873, 0.47643, 0.85948, 0.44684],
929
+ [0.85948, 0.44684, 0.85946, 0.44684, 0.85943, 0.44684, 0.8594, 0.44684]
930
+ ]);
931
+ var boomShape = createShape([
932
+ [0.49006, 0.03176, 0.49241, 0.01294, 0.49359, 354e-5, 0.49537, 185e-5],
933
+ [0.49537, 185e-5, 0.49796, -62e-5, 0.50203, -62e-5, 0.50462, 185e-5],
934
+ [0.50462, 185e-5, 0.50641, 354e-5, 0.50759, 0.01294, 0.50994, 0.03176],
935
+ [0.50994, 0.03176, 0.51992, 0.11153, 0.5299, 0.1913, 0.53987, 0.27107],
936
+ [0.53987, 0.27107, 0.54082, 0.27866, 0.5413, 0.28244, 0.54266, 0.28403],
937
+ [0.54266, 0.28403, 0.54464, 0.28628, 0.54787, 0.287, 0.5506, 0.28572],
938
+ [0.5506, 0.28572, 0.55248, 0.28485, 0.55445, 0.28157, 0.55839, 0.275],
939
+ [0.55839, 0.275, 0.59978, 0.20621, 0.64116, 0.13742, 0.68254, 0.06863],
940
+ [0.68254, 0.06863, 0.69231, 0.05241, 0.69719, 0.04429, 0.6995, 0.04348],
941
+ [0.6995, 0.04348, 0.70287, 0.04232, 0.70657, 0.04398, 0.70795, 0.04729],
942
+ [0.70795, 0.04729, 0.70891, 0.04954, 0.70617, 0.05863, 0.70071, 0.07679],
943
+ [0.70071, 0.07679, 0.67756, 0.15373, 0.6544, 0.23068, 0.63124, 0.30763],
944
+ [0.63124, 0.30763, 0.62904, 0.31497, 0.62794, 0.31863, 0.62855, 0.3206],
945
+ [0.62855, 0.3206, 0.62942, 0.32348, 0.6321, 0.32544, 0.63512, 0.32541],
946
+ [0.63512, 0.32541, 0.63719, 0.32538, 0.64031, 0.32319, 0.64656, 0.31882],
947
+ [0.64656, 0.31882, 0.7122, 0.2729, 0.77783, 0.22698, 0.84347, 0.18107],
948
+ [0.84347, 0.18107, 0.85895, 0.17022, 0.86669, 0.16482, 0.86913, 0.16501],
949
+ [0.86913, 0.16501, 0.87269, 0.16533, 0.87539, 0.16834, 0.87532, 0.17191],
950
+ [0.87532, 0.17191, 0.87528, 0.17438, 0.86911, 0.18157, 0.85678, 0.19591],
951
+ [0.85678, 0.19591, 0.80449, 0.25674, 0.75221, 0.31758, 0.69992, 0.37841],
952
+ [0.69992, 0.37841, 0.69494, 0.38419, 0.69246, 0.3871, 0.69221, 0.38916],
953
+ [0.69221, 0.38916, 0.69185, 0.39216, 0.6935, 0.39503, 0.69627, 0.39622],
954
+ [0.69627, 0.39622, 0.69817, 0.39706, 0.70191, 0.39631, 0.70939, 0.39488],
955
+ [0.70939, 0.39488, 0.78793, 0.37977, 0.86646, 0.36467, 0.945, 0.34957],
956
+ [0.945, 0.34957, 0.96353, 0.346, 0.9728, 0.34422, 0.97494, 0.34541],
957
+ [0.97494, 0.34541, 0.97806, 0.34713, 0.97931, 0.351, 0.9778, 0.35425],
958
+ [0.9778, 0.35425, 0.97676, 0.35647, 0.96822, 0.3605, 0.95115, 0.36856],
959
+ [0.95115, 0.36856, 0.87878, 0.40276, 0.80641, 0.43696, 0.73403, 0.47116],
960
+ [0.73403, 0.47116, 0.72714, 0.47441, 0.7237, 0.47603, 0.72263, 0.47781],
961
+ [0.72263, 0.47781, 0.72109, 0.48041, 0.72144, 0.48372, 0.72348, 0.48594],
962
+ [0.72348, 0.48594, 0.72489, 0.48747, 0.7286, 0.48834, 0.73601, 0.49006],
963
+ [0.73601, 0.49006, 0.81387, 0.50839, 0.89173, 0.52671, 0.96959, 0.54503],
964
+ [0.96959, 0.54503, 0.98796, 0.54934, 0.99715, 0.5515, 0.99862, 0.55347],
965
+ [0.99862, 0.55347, 1.00077, 0.55631, 1.00035, 0.56037, 0.99766, 0.56272],
966
+ [0.99766, 0.56272, 0.9958, 0.56431, 0.98638, 0.56453, 0.96751, 0.56491],
967
+ [0.96751, 0.56491, 0.88757, 0.56654, 0.80762, 0.56818, 0.72767, 0.56981],
968
+ [0.72767, 0.56981, 0.72006, 0.56997, 0.71626, 0.57006, 0.71456, 0.57125],
969
+ [0.71456, 0.57125, 0.7121, 0.573, 0.71108, 0.57617, 0.71206, 0.57903],
970
+ [0.71206, 0.57903, 0.71272, 0.581, 0.71576, 0.58331, 0.72182, 0.58794],
971
+ [0.72182, 0.58794, 0.78555, 0.6365, 0.84927, 0.68506, 0.91299, 0.73362],
972
+ [0.91299, 0.73362, 0.92802, 0.74509, 0.93554, 0.75084, 0.93609, 0.75322],
973
+ [0.93609, 0.75322, 0.93691, 0.7567, 0.93489, 0.76022, 0.93147, 0.76128],
974
+ [0.93147, 0.76128, 0.92912, 0.762, 0.92043, 0.75831, 0.90304, 0.75097],
975
+ [0.90304, 0.75097, 0.82934, 0.71977, 0.75565, 0.68857, 0.68195, 0.65737],
976
+ [0.68195, 0.65737, 0.67493, 0.6544, 0.67142, 0.6529, 0.66939, 0.65331],
977
+ [0.66939, 0.65331, 0.66644, 0.65391, 0.66423, 0.65637, 0.66396, 0.65937],
978
+ [0.66396, 0.65937, 0.66378, 0.66144, 0.66561, 0.66481, 0.66928, 0.6715],
979
+ [0.66928, 0.6715, 0.70784, 0.74193, 0.74641, 0.81237, 0.78497, 0.88281],
980
+ [0.78497, 0.88281, 0.79407, 0.8994, 0.79862, 0.90771, 0.79815, 0.91015],
981
+ [0.79815, 0.91015, 0.79748, 0.91366, 0.79421, 0.91604, 0.79067, 0.91562],
982
+ [0.79067, 0.91562, 0.78824, 0.91531, 0.78179, 0.9084, 0.76888, 0.89456],
983
+ [0.76888, 0.89456, 0.71418, 0.83591, 0.65947, 0.77727, 0.60477, 0.71862],
984
+ [0.60477, 0.71862, 0.59956, 0.71306, 0.59695, 0.71025, 0.59494, 0.70981],
985
+ [0.59494, 0.70981, 0.592, 0.70912, 0.58897, 0.71048, 0.58752, 0.71312],
986
+ [0.58752, 0.71312, 0.58651, 0.71493, 0.58683, 0.71875, 0.58747, 0.72637],
987
+ [0.58747, 0.72637, 0.59421, 0.80649, 0.60094, 0.8866, 0.60768, 0.96671],
988
+ [0.60768, 0.96671, 0.60927, 0.98562, 0.61006, 0.99506, 0.60866, 0.99709],
989
+ [0.60866, 0.99709, 0.60663, 1.00002, 0.60267, 1.00087, 0.59962, 0.99902],
990
+ [0.59962, 0.99902, 0.59752, 0.99774, 0.59442, 0.98877, 0.58823, 0.97087],
991
+ [0.58823, 0.97087, 0.56197, 0.89493, 0.53572, 0.819, 0.50946, 0.74306],
992
+ [0.50946, 0.74306, 0.50696, 0.73581, 0.50571, 0.73222, 0.50406, 0.73097],
993
+ [0.50406, 0.73097, 0.50165, 0.72916, 0.49834, 0.72916, 0.49594, 0.73097],
994
+ [0.49594, 0.73097, 0.49428, 0.73222, 0.49303, 0.73581, 0.49053, 0.74306],
995
+ [0.49053, 0.74306, 0.46428, 0.819, 0.43803, 0.89493, 0.41177, 0.97087],
996
+ [0.41177, 0.97087, 0.40558, 0.98877, 0.40248, 0.99774, 0.40038, 0.99902],
997
+ [0.40038, 0.99902, 0.39733, 1.00087, 0.39338, 1.00002, 0.39134, 0.99709],
998
+ [0.39134, 0.99709, 0.38994, 0.99506, 0.39073, 0.98562, 0.39232, 0.96671],
999
+ [0.39232, 0.96671, 0.39906, 0.8866, 0.40579, 0.80649, 0.41253, 0.72637],
1000
+ [0.41253, 0.72637, 0.41317, 0.71875, 0.41349, 0.71493, 0.41248, 0.71312],
1001
+ [0.41248, 0.71312, 0.41104, 0.71048, 0.408, 0.70912, 0.40507, 0.70981],
1002
+ [0.40507, 0.70981, 0.40305, 0.71025, 0.40044, 0.71306, 0.39523, 0.71862],
1003
+ [0.39523, 0.71862, 0.34053, 0.77727, 0.28582, 0.83591, 0.23112, 0.89456],
1004
+ [0.23112, 0.89456, 0.21821, 0.9084, 0.21176, 0.91531, 0.20933, 0.91562],
1005
+ [0.20933, 0.91562, 0.20578, 0.91604, 0.20252, 0.91366, 0.20184, 0.91015],
1006
+ [0.20184, 0.91015, 0.20138, 0.90771, 0.20593, 0.8994, 0.21503, 0.88281],
1007
+ [0.21503, 0.88281, 0.25359, 0.81237, 0.29215, 0.74193, 0.33072, 0.6715],
1008
+ [0.33072, 0.6715, 0.33439, 0.66481, 0.33622, 0.66144, 0.33604, 0.65937],
1009
+ [0.33604, 0.65937, 0.33577, 0.65637, 0.33356, 0.65391, 0.3306, 0.65331],
1010
+ [0.3306, 0.65331, 0.32857, 0.6529, 0.32506, 0.6544, 0.31805, 0.65737],
1011
+ [0.31805, 0.65737, 0.24435, 0.68857, 0.17065, 0.71977, 0.09695, 0.75097],
1012
+ [0.09695, 0.75097, 0.07957, 0.75831, 0.07087, 0.762, 0.06853, 0.76128],
1013
+ [0.06853, 0.76128, 0.06511, 0.76022, 0.06309, 0.7567, 0.06391, 0.75322],
1014
+ [0.06391, 0.75322, 0.06446, 0.75084, 0.07198, 0.74509, 0.08701, 0.73362],
1015
+ [0.08701, 0.73362, 0.15073, 0.68506, 0.21445, 0.6365, 0.27817, 0.58794],
1016
+ [0.27817, 0.58794, 0.28424, 0.58331, 0.28727, 0.581, 0.28794, 0.57903],
1017
+ [0.28794, 0.57903, 0.28892, 0.57617, 0.2879, 0.573, 0.28543, 0.57125],
1018
+ [0.28543, 0.57125, 0.28374, 0.57006, 0.27993, 0.56997, 0.27232, 0.56981],
1019
+ [0.27232, 0.56981, 0.19238, 0.56818, 0.11243, 0.56654, 0.03248, 0.56491],
1020
+ [0.03248, 0.56491, 0.01362, 0.56453, 419e-5, 0.56431, 234e-5, 0.56272],
1021
+ [234e-5, 0.56272, -35e-5, 0.56036, -77e-5, 0.55633, 138e-5, 0.55347],
1022
+ [138e-5, 0.55347, 285e-5, 0.5515, 0.01204, 0.54934, 0.03041, 0.54503],
1023
+ [0.03041, 0.54503, 0.10827, 0.52671, 0.18613, 0.50839, 0.26399, 0.49006],
1024
+ [0.26399, 0.49006, 0.2714, 0.48834, 0.27511, 0.48747, 0.27652, 0.48594],
1025
+ [0.27652, 0.48594, 0.27856, 0.48372, 0.27891, 0.48041, 0.27736, 0.47781],
1026
+ [0.27736, 0.47781, 0.2763, 0.47603, 0.27286, 0.47441, 0.26597, 0.47116],
1027
+ [0.26597, 0.47116, 0.19359, 0.43696, 0.12122, 0.40276, 0.04885, 0.36856],
1028
+ [0.04885, 0.36856, 0.03177, 0.3605, 0.02324, 0.35647, 0.0222, 0.35425],
1029
+ [0.0222, 0.35425, 0.02068, 0.35101, 0.02193, 0.34715, 0.02506, 0.34541],
1030
+ [0.02506, 0.34541, 0.0272, 0.34422, 0.03647, 0.346, 0.055, 0.34957],
1031
+ [0.055, 0.34957, 0.13353, 0.36467, 0.21207, 0.37977, 0.29061, 0.39488],
1032
+ [0.29061, 0.39488, 0.29809, 0.39631, 0.30183, 0.39706, 0.30373, 0.39622],
1033
+ [0.30373, 0.39622, 0.3065, 0.39502, 0.30815, 0.39215, 0.30779, 0.38916],
1034
+ [0.30779, 0.38916, 0.30755, 0.3871, 0.30506, 0.38419, 0.30008, 0.37841],
1035
+ [0.30008, 0.37841, 0.24779, 0.31758, 0.19551, 0.25674, 0.14322, 0.19591],
1036
+ [0.14322, 0.19591, 0.13089, 0.18157, 0.12472, 0.17438, 0.12468, 0.17191],
1037
+ [0.12468, 0.17191, 0.12461, 0.16834, 0.12731, 0.16533, 0.13086, 0.16501],
1038
+ [0.13086, 0.16501, 0.1333, 0.16482, 0.14104, 0.17022, 0.15653, 0.18107],
1039
+ [0.15653, 0.18107, 0.22217, 0.22698, 0.2878, 0.2729, 0.35344, 0.31882],
1040
+ [0.35344, 0.31882, 0.35969, 0.32319, 0.36281, 0.32538, 0.36488, 0.32541],
1041
+ [0.36488, 0.32541, 0.3679, 0.32544, 0.37058, 0.32348, 0.37145, 0.3206],
1042
+ [0.37145, 0.3206, 0.37206, 0.31863, 0.37096, 0.31497, 0.36875, 0.30763],
1043
+ [0.36875, 0.30763, 0.3456, 0.23068, 0.32244, 0.15373, 0.29929, 0.07679],
1044
+ [0.29929, 0.07679, 0.29382, 0.05863, 0.29109, 0.04954, 0.29205, 0.04729],
1045
+ [0.29205, 0.04729, 0.29342, 0.04399, 0.29711, 0.04232, 0.3005, 0.04348],
1046
+ [0.3005, 0.04348, 0.30281, 0.04429, 0.30769, 0.05241, 0.31745, 0.06863],
1047
+ [0.31745, 0.06863, 0.35884, 0.13742, 0.40022, 0.20621, 0.44161, 0.275],
1048
+ [0.44161, 0.275, 0.44555, 0.28157, 0.44752, 0.28485, 0.4494, 0.28572],
1049
+ [0.4494, 0.28572, 0.45212, 0.287, 0.45536, 0.28628, 0.45734, 0.28403],
1050
+ [0.45734, 0.28403, 0.4587, 0.28244, 0.45917, 0.27866, 0.46012, 0.27107],
1051
+ [0.46012, 0.27107, 0.4701, 0.1913, 0.48008, 0.11153, 0.49006, 0.03176]
1052
+ ]);
1053
+ var bunShape = createShape([
1054
+ [0.01546, 0.25425, 0.01545, 0.18682, 0.04224, 0.12214, 0.08992, 0.07446],
1055
+ [0.08992, 0.07446, 0.1376, 0.02678, 0.20228, -1e-5, 0.26971, 0],
1056
+ [0.26971, 0, 0.42313, 0, 0.57654, 0, 0.72996, 0],
1057
+ [0.72996, 0, 0.85665, -17e-5, 0.96413, 0.09297, 0.98198, 0.2184],
1058
+ [0.98198, 0.2184, 0.99983, 0.34383, 0.92261, 0.46325, 0.8009, 0.49844],
1059
+ [0.8009, 0.49844, 0.8002, 0.49863, 0.79972, 0.49927, 0.79974, 0.5],
1060
+ [0.79974, 0.5, 0.79974, 0.50072, 0.80021, 0.50134, 0.8009, 0.50156],
1061
+ [0.8009, 0.50156, 0.92232, 0.537, 0.99924, 0.65629, 0.98142, 0.78152],
1062
+ [0.98142, 0.78152, 0.96359, 0.90675, 0.85645, 0.99984, 0.72996, 1],
1063
+ [0.72996, 1, 0.57654, 1, 0.42313, 1, 0.26971, 1],
1064
+ [0.26971, 1, 0.20228, 1.00001, 0.1376, 0.97322, 0.08992, 0.92554],
1065
+ [0.08992, 0.92554, 0.04224, 0.87786, 0.01545, 0.81318, 0.01546, 0.74575],
1066
+ [0.01546, 0.74575, 0.01548, 0.63344, 0.08915, 0.53444, 0.19671, 0.50216],
1067
+ [0.19671, 0.50216, 0.19766, 0.50187, 0.19832, 0.501, 0.19832, 0.5],
1068
+ [0.19832, 0.5, 0.19832, 0.49901, 0.19766, 0.49813, 0.19671, 0.49784],
1069
+ [0.19671, 0.49784, 0.08915, 0.46556, 0.01548, 0.36656, 0.01546, 0.25425]
1070
+ ]);
1071
+ var burstShape = createShape([
1072
+ [0.49184, 797e-5, 0.49416, 384e-5, 0.49528, 181e-5, 0.49669, 94e-5],
1073
+ [0.49669, 94e-5, 0.49872, -31e-5, 0.50128, -31e-5, 0.50331, 94e-5],
1074
+ [0.50331, 94e-5, 0.50472, 181e-5, 0.50584, 384e-5, 0.50816, 797e-5],
1075
+ [0.50816, 797e-5, 0.53447, 0.055, 0.56078, 0.10203, 0.58709, 0.14906],
1076
+ [0.58709, 0.14906, 0.5885, 0.15159, 0.58922, 0.15287, 0.59019, 0.15362],
1077
+ [0.59019, 0.15362, 0.59156, 0.15475, 0.59334, 0.15522, 0.59509, 0.15494],
1078
+ [0.59509, 0.15494, 0.59631, 0.15475, 0.59756, 0.15403, 0.60003, 0.15253],
1079
+ [0.60003, 0.15253, 0.64634, 0.12496, 0.69266, 0.09739, 0.73897, 0.06981],
1080
+ [0.73897, 0.06981, 0.743, 0.06741, 0.74503, 0.06619, 0.74666, 0.06616],
1081
+ [0.74666, 0.06616, 0.74906, 0.06606, 0.75125, 0.06734, 0.75241, 0.06944],
1082
+ [0.75241, 0.06944, 0.75319, 0.07091, 0.75316, 0.07325, 0.75309, 0.07797],
1083
+ [0.75309, 0.07797, 0.75236, 0.13185, 0.75164, 0.18574, 0.75091, 0.23962],
1084
+ [0.75091, 0.23962, 0.75084, 0.24253, 0.75084, 0.24397, 0.75128, 0.24512],
1085
+ [0.75128, 0.24512, 0.75191, 0.24678, 0.75322, 0.24809, 0.75488, 0.24872],
1086
+ [0.75488, 0.24872, 0.75603, 0.24916, 0.75747, 0.24916, 0.76038, 0.24909],
1087
+ [0.76038, 0.24909, 0.81426, 0.24836, 0.86815, 0.24764, 0.92203, 0.24691],
1088
+ [0.92203, 0.24691, 0.92675, 0.24684, 0.92909, 0.24681, 0.93056, 0.24759],
1089
+ [0.93056, 0.24759, 0.93266, 0.24875, 0.93394, 0.25094, 0.93384, 0.25334],
1090
+ [0.93384, 0.25334, 0.93381, 0.25497, 0.93259, 0.257, 0.93019, 0.26103],
1091
+ [0.93019, 0.26103, 0.90261, 0.30734, 0.87504, 0.35366, 0.84747, 0.39997],
1092
+ [0.84747, 0.39997, 0.84597, 0.40244, 0.84525, 0.40369, 0.84506, 0.40491],
1093
+ [0.84506, 0.40491, 0.84478, 0.40666, 0.84525, 0.40844, 0.84638, 0.40981],
1094
+ [0.84638, 0.40981, 0.84713, 0.41078, 0.84841, 0.4115, 0.85094, 0.41291],
1095
+ [0.85094, 0.41291, 0.89797, 0.43922, 0.945, 0.46553, 0.99203, 0.49184],
1096
+ [0.99203, 0.49184, 0.99616, 0.49416, 0.99819, 0.49528, 0.99906, 0.49669],
1097
+ [0.99906, 0.49669, 1.00031, 0.49872, 1.00031, 0.50128, 0.99906, 0.50331],
1098
+ [0.99906, 0.50331, 0.99819, 0.50472, 0.99616, 0.50584, 0.99203, 0.50816],
1099
+ [0.99203, 0.50816, 0.945, 0.53447, 0.89797, 0.56078, 0.85094, 0.58709],
1100
+ [0.85094, 0.58709, 0.84841, 0.5885, 0.84713, 0.58922, 0.84638, 0.59019],
1101
+ [0.84638, 0.59019, 0.84525, 0.59156, 0.84478, 0.59334, 0.84506, 0.59509],
1102
+ [0.84506, 0.59509, 0.84525, 0.59631, 0.84597, 0.59756, 0.84747, 0.60003],
1103
+ [0.84747, 0.60003, 0.87504, 0.64634, 0.90261, 0.69266, 0.93019, 0.73897],
1104
+ [0.93019, 0.73897, 0.93259, 0.743, 0.93381, 0.74503, 0.93384, 0.74666],
1105
+ [0.93384, 0.74666, 0.93394, 0.74906, 0.93266, 0.75125, 0.93056, 0.75241],
1106
+ [0.93056, 0.75241, 0.92909, 0.75319, 0.92675, 0.75316, 0.92203, 0.75309],
1107
+ [0.92203, 0.75309, 0.86815, 0.75236, 0.81426, 0.75164, 0.76038, 0.75091],
1108
+ [0.76038, 0.75091, 0.75747, 0.75084, 0.75603, 0.75084, 0.75488, 0.75128],
1109
+ [0.75488, 0.75128, 0.75322, 0.75191, 0.75191, 0.75322, 0.75128, 0.75488],
1110
+ [0.75128, 0.75488, 0.75084, 0.75603, 0.75084, 0.75747, 0.75091, 0.76038],
1111
+ [0.75091, 0.76038, 0.75164, 0.81426, 0.75236, 0.86815, 0.75309, 0.92203],
1112
+ [0.75309, 0.92203, 0.75316, 0.92675, 0.75319, 0.92909, 0.75241, 0.93056],
1113
+ [0.75241, 0.93056, 0.75125, 0.93266, 0.74906, 0.93394, 0.74666, 0.93384],
1114
+ [0.74666, 0.93384, 0.74503, 0.93381, 0.743, 0.93259, 0.73897, 0.93019],
1115
+ [0.73897, 0.93019, 0.69266, 0.90261, 0.64634, 0.87504, 0.60003, 0.84747],
1116
+ [0.60003, 0.84747, 0.59756, 0.84597, 0.59631, 0.84525, 0.59509, 0.84506],
1117
+ [0.59509, 0.84506, 0.59334, 0.84478, 0.59156, 0.84525, 0.59019, 0.84638],
1118
+ [0.59019, 0.84638, 0.58922, 0.84713, 0.5885, 0.84841, 0.58709, 0.85094],
1119
+ [0.58709, 0.85094, 0.56078, 0.89797, 0.53447, 0.945, 0.50816, 0.99203],
1120
+ [0.50816, 0.99203, 0.50584, 0.99616, 0.50472, 0.99819, 0.50331, 0.99906],
1121
+ [0.50331, 0.99906, 0.50128, 1.00031, 0.49872, 1.00031, 0.49669, 0.99906],
1122
+ [0.49669, 0.99906, 0.49528, 0.99819, 0.49416, 0.99616, 0.49184, 0.99203],
1123
+ [0.49184, 0.99203, 0.46553, 0.945, 0.43922, 0.89797, 0.41291, 0.85094],
1124
+ [0.41291, 0.85094, 0.4115, 0.84841, 0.41078, 0.84713, 0.40981, 0.84638],
1125
+ [0.40981, 0.84638, 0.40844, 0.84525, 0.40666, 0.84478, 0.40491, 0.84506],
1126
+ [0.40491, 0.84506, 0.40369, 0.84525, 0.40244, 0.84597, 0.39997, 0.84747],
1127
+ [0.39997, 0.84747, 0.35366, 0.87504, 0.30734, 0.90261, 0.26103, 0.93019],
1128
+ [0.26103, 0.93019, 0.257, 0.93259, 0.25497, 0.93381, 0.25334, 0.93384],
1129
+ [0.25334, 0.93384, 0.25094, 0.93394, 0.24875, 0.93266, 0.24759, 0.93056],
1130
+ [0.24759, 0.93056, 0.24681, 0.92909, 0.24684, 0.92675, 0.24691, 0.92203],
1131
+ [0.24691, 0.92203, 0.24764, 0.86815, 0.24836, 0.81426, 0.24909, 0.76038],
1132
+ [0.24909, 0.76038, 0.24916, 0.75747, 0.24916, 0.75603, 0.24872, 0.75488],
1133
+ [0.24872, 0.75488, 0.24809, 0.75322, 0.24678, 0.75191, 0.24513, 0.75128],
1134
+ [0.24513, 0.75128, 0.24397, 0.75084, 0.24253, 0.75084, 0.23963, 0.75091],
1135
+ [0.23963, 0.75091, 0.18574, 0.75164, 0.13185, 0.75236, 0.07797, 0.75309],
1136
+ [0.07797, 0.75309, 0.07325, 0.75316, 0.07091, 0.75319, 0.06944, 0.75241],
1137
+ [0.06944, 0.75241, 0.06734, 0.75127, 0.06607, 0.74904, 0.06616, 0.74666],
1138
+ [0.06616, 0.74666, 0.06619, 0.74503, 0.06741, 0.743, 0.06981, 0.73897],
1139
+ [0.06981, 0.73897, 0.09739, 0.69266, 0.12496, 0.64634, 0.15253, 0.60003],
1140
+ [0.15253, 0.60003, 0.15403, 0.59756, 0.15475, 0.59631, 0.15494, 0.59509],
1141
+ [0.15494, 0.59509, 0.15522, 0.59334, 0.15475, 0.59156, 0.15363, 0.59019],
1142
+ [0.15363, 0.59019, 0.15288, 0.58922, 0.15159, 0.5885, 0.14906, 0.58709],
1143
+ [0.14906, 0.58709, 0.10203, 0.56078, 0.055, 0.53447, 797e-5, 0.50816],
1144
+ [797e-5, 0.50816, 384e-5, 0.50584, 181e-5, 0.50472, 94e-5, 0.50331],
1145
+ [94e-5, 0.50331, -31e-5, 0.50128, -31e-5, 0.49872, 94e-5, 0.49669],
1146
+ [94e-5, 0.49669, 181e-5, 0.49528, 384e-5, 0.49416, 797e-5, 0.49184],
1147
+ [797e-5, 0.49184, 0.055, 0.46553, 0.10203, 0.43922, 0.14906, 0.41291],
1148
+ [0.14906, 0.41291, 0.15159, 0.4115, 0.15287, 0.41078, 0.15362, 0.40981],
1149
+ [0.15362, 0.40981, 0.15475, 0.40844, 0.15522, 0.40666, 0.15494, 0.40491],
1150
+ [0.15494, 0.40491, 0.15475, 0.40369, 0.15403, 0.40244, 0.15253, 0.39997],
1151
+ [0.15253, 0.39997, 0.12496, 0.35366, 0.09739, 0.30734, 0.06981, 0.26103],
1152
+ [0.06981, 0.26103, 0.06741, 0.257, 0.06619, 0.25497, 0.06616, 0.25334],
1153
+ [0.06616, 0.25334, 0.06606, 0.25094, 0.06734, 0.24875, 0.06944, 0.24759],
1154
+ [0.06944, 0.24759, 0.07091, 0.24681, 0.07325, 0.24684, 0.07797, 0.24691],
1155
+ [0.07797, 0.24691, 0.13185, 0.24764, 0.18574, 0.24836, 0.23963, 0.24909],
1156
+ [0.23963, 0.24909, 0.24253, 0.24916, 0.24397, 0.24916, 0.24513, 0.24872],
1157
+ [0.24513, 0.24872, 0.24678, 0.24809, 0.24809, 0.24678, 0.24872, 0.24512],
1158
+ [0.24872, 0.24512, 0.24916, 0.24397, 0.24916, 0.24253, 0.24909, 0.23962],
1159
+ [0.24909, 0.23962, 0.24836, 0.18574, 0.24764, 0.13185, 0.24691, 0.07797],
1160
+ [0.24691, 0.07797, 0.24684, 0.07325, 0.24681, 0.07091, 0.24759, 0.06944],
1161
+ [0.24759, 0.06944, 0.24875, 0.06734, 0.25094, 0.06606, 0.25334, 0.06616],
1162
+ [0.25334, 0.06616, 0.25497, 0.06619, 0.257, 0.06741, 0.26103, 0.06981],
1163
+ [0.26103, 0.06981, 0.30734, 0.09739, 0.35366, 0.12496, 0.39997, 0.15253],
1164
+ [0.39997, 0.15253, 0.40244, 0.15403, 0.40369, 0.15475, 0.40491, 0.15494],
1165
+ [0.40491, 0.15494, 0.40666, 0.15522, 0.40844, 0.15475, 0.40981, 0.15362],
1166
+ [0.40981, 0.15362, 0.41078, 0.15287, 0.4115, 0.15159, 0.41291, 0.14906],
1167
+ [0.41291, 0.14906, 0.43922, 0.10203, 0.46553, 0.055, 0.49184, 797e-5]
1168
+ ]);
1169
+ var circleShape = createShape([
1170
+ [1, 0.5, 1, 0.77614, 0.77614, 1, 0.5, 1],
1171
+ [0.5, 1, 0.22386, 1, 0, 0.77614, 0, 0.5],
1172
+ [0, 0.5, 0, 0.22386, 0.22386, 0, 0.5, 0],
1173
+ [0.5, 0, 0.77614, 0, 1, 0.22386, 1, 0.5]
1174
+ ]);
1175
+ var clamshellShape = createShape([
1176
+ [0.95752, 0.36588, 0.97848, 0.4081, 0.98896, 0.42921, 0.99426, 0.45126],
1177
+ [0.99426, 0.45126, 1.00191, 0.4833, 1.00191, 0.5167, 0.99426, 0.54874],
1178
+ [0.99426, 0.54874, 0.98896, 0.57079, 0.97848, 0.5919, 0.95752, 0.63412],
1179
+ [0.95752, 0.63412, 0.93623, 0.677, 0.91494, 0.71987, 0.89365, 0.76275],
1180
+ [0.89365, 0.76275, 0.87268, 0.80497, 0.8622, 0.82608, 0.84842, 0.84244],
1181
+ [0.84842, 0.84244, 0.8285, 0.86609, 0.80339, 0.88295, 0.77581, 0.89118],
1182
+ [0.77581, 0.89118, 0.75673, 0.89688, 0.73577, 0.89688, 0.69384, 0.89688],
1183
+ [0.69384, 0.89688, 0.56461, 0.89688, 0.43539, 0.89688, 0.30616, 0.89688],
1184
+ [0.30616, 0.89688, 0.26423, 0.89688, 0.24327, 0.89688, 0.22419, 0.89118],
1185
+ [0.22419, 0.89118, 0.19661, 0.88295, 0.1715, 0.86609, 0.15158, 0.84244],
1186
+ [0.15158, 0.84244, 0.1378, 0.82608, 0.12732, 0.80497, 0.10635, 0.76275],
1187
+ [0.10635, 0.76275, 0.08506, 0.71987, 0.06377, 0.677, 0.04248, 0.63412],
1188
+ [0.04248, 0.63412, 0.02152, 0.5919, 0.01104, 0.57079, 574e-5, 0.54874],
1189
+ [574e-5, 0.54874, -191e-5, 0.5167, -191e-5, 0.4833, 574e-5, 0.45126],
1190
+ [574e-5, 0.45126, 0.01104, 0.42921, 0.02152, 0.4081, 0.04248, 0.36588],
1191
+ [0.04248, 0.36588, 0.06377, 0.323, 0.08506, 0.28013, 0.10635, 0.23725],
1192
+ [0.10635, 0.23725, 0.12732, 0.19503, 0.1378, 0.17392, 0.15158, 0.15756],
1193
+ [0.15158, 0.15756, 0.1715, 0.13391, 0.19661, 0.11705, 0.22419, 0.10882],
1194
+ [0.22419, 0.10882, 0.24327, 0.10312, 0.26423, 0.10312, 0.30616, 0.10312],
1195
+ [0.30616, 0.10312, 0.43539, 0.10312, 0.56461, 0.10312, 0.69384, 0.10312],
1196
+ [0.69384, 0.10312, 0.73577, 0.10312, 0.75673, 0.10312, 0.77581, 0.10882],
1197
+ [0.77581, 0.10882, 0.80339, 0.11705, 0.8285, 0.13391, 0.84842, 0.15756],
1198
+ [0.84842, 0.15756, 0.8622, 0.17392, 0.87268, 0.19503, 0.89365, 0.23725],
1199
+ [0.89365, 0.23725, 0.91494, 0.28013, 0.93623, 0.323, 0.95752, 0.36588]
1200
+ ]);
1201
+ var diamondShape = createShape([
1202
+ [0.67951, 0.864, 0.62689, 0.93286, 0.60059, 0.96728, 0.57021, 0.98296],
1203
+ [0.57021, 0.98296, 0.52616, 1.00568, 0.47384, 1.00568, 0.42979, 0.98296],
1204
+ [0.42979, 0.98296, 0.39941, 0.96728, 0.37311, 0.93286, 0.32049, 0.864],
1205
+ [0.32049, 0.864, 0.26225, 0.78778, 0.20401, 0.71156, 0.14577, 0.63534],
1206
+ [0.14577, 0.63534, 0.11377, 0.59346, 0.09777, 0.57252, 0.08984, 0.5501],
1207
+ [0.08984, 0.5501, 0.07838, 0.51768, 0.07838, 0.48232, 0.08984, 0.4499],
1208
+ [0.08984, 0.4499, 0.09777, 0.42748, 0.11377, 0.40654, 0.14577, 0.36466],
1209
+ [0.14577, 0.36466, 0.20401, 0.28844, 0.26225, 0.21222, 0.32049, 0.136],
1210
+ [0.32049, 0.136, 0.37311, 0.06714, 0.39941, 0.03271, 0.42979, 0.01704],
1211
+ [0.42979, 0.01704, 0.47384, -568e-5, 0.52616, -568e-5, 0.57021, 0.01704],
1212
+ [0.57021, 0.01704, 0.60059, 0.03272, 0.62689, 0.06714, 0.67951, 0.136],
1213
+ [0.67951, 0.136, 0.73775, 0.21222, 0.79599, 0.28844, 0.85423, 0.36466],
1214
+ [0.85423, 0.36466, 0.88623, 0.40654, 0.90223, 0.42748, 0.91016, 0.4499],
1215
+ [0.91016, 0.4499, 0.92162, 0.48232, 0.92162, 0.51768, 0.91016, 0.5501],
1216
+ [0.91016, 0.5501, 0.90223, 0.57252, 0.88623, 0.59346, 0.85423, 0.63534],
1217
+ [0.85423, 0.63534, 0.79599, 0.71156, 0.73775, 0.78778, 0.67951, 0.864]
1218
+ ]);
1219
+ var fanShape = createShape([
1220
+ [0, 0.15789, 0, 0.15232, 0, 0.14954, 7e-5, 0.14718],
1221
+ [7e-5, 0.14718, 256e-5, 0.06699, 0.06699, 256e-5, 0.14718, 8e-5],
1222
+ [0.14718, 8e-5, 0.14954, 0, 0.15232, 0, 0.1579, 0],
1223
+ [0.1579, 0, 0.18761, 0, 0.20246, 0, 0.21503, 39e-5],
1224
+ [0.21503, 39e-5, 0.64271, 0.01366, 0.98632, 0.35728, 0.99961, 0.78497],
1225
+ [0.99961, 0.78497, 1, 0.79753, 1, 0.81239, 1, 0.8421],
1226
+ [1, 0.8421, 1, 0.84767, 1, 0.85046, 0.99993, 0.85282],
1227
+ [0.99993, 0.85282, 0.99743, 0.93301, 0.933, 0.99744, 0.85282, 0.99993],
1228
+ [0.85282, 0.99993, 0.85046, 1, 0.84768, 1, 0.84211, 1],
1229
+ [0.84211, 1, 0.63634, 1, 0.43057, 1, 0.2248, 1],
1230
+ [0.2248, 1, 0.15688, 1, 0.12292, 1, 0.09598, 0.98933],
1231
+ [0.09598, 0.98933, 0.05698, 0.97389, 0.02611, 0.94301, 0.01067, 0.90402],
1232
+ [0.01067, 0.90402, 0, 0.87708, 0, 0.84312, 0, 0.7752],
1233
+ [0, 0.7752, 0, 0.56943, 0, 0.36366, 0, 0.15789]
1234
+ ]);
1235
+ var flowerShape = createShape([
1236
+ [0.85353, 0.14645, 0.81641, 0.10934, 0.73184, 0.12769, 0.62984, 0.1865],
1237
+ [0.62984, 0.1865, 0.59928, 0.07277, 0.55247, 0, 0.5, 0],
1238
+ [0.5, 0, 0.4475, 0, 0.40069, 0.07276, 0.37016, 0.18649],
1239
+ [0.37016, 0.18649, 0.26813, 0.12768, 0.18359, 0.10934, 0.14647, 0.14644],
1240
+ [0.14647, 0.14644, 0.10938, 0.18355, 0.12772, 0.26811, 0.18653, 0.37014],
1241
+ [0.18653, 0.37014, 0.07278, 0.40069, 0, 0.44751, 0, 0.5],
1242
+ [0, 0.5, 0, 0.55248, 0.07275, 0.59929, 0.1865, 0.62984],
1243
+ [0.1865, 0.62984, 0.12766, 0.73188, 0.10931, 0.81644, 0.14641, 0.85355],
1244
+ [0.14641, 0.85355, 0.18353, 0.89067, 0.26809, 0.87231, 0.37012, 0.81347],
1245
+ [0.37012, 0.81347, 0.40069, 0.92722, 0.4475, 1, 0.5, 1],
1246
+ [0.5, 1, 0.55247, 1, 0.59928, 0.92722, 0.62984, 0.81346],
1247
+ [0.62984, 0.81346, 0.73191, 0.8723, 0.81647, 0.89066, 0.85359, 0.85355],
1248
+ [0.85359, 0.85355, 0.89069, 0.81644, 0.87234, 0.73188, 0.8135, 0.62984],
1249
+ [0.8135, 0.62984, 0.92725, 0.59929, 1, 0.55248, 1, 0.5],
1250
+ [1, 0.5, 1, 0.44751, 0.92722, 0.40069, 0.81344, 0.37014],
1251
+ [0.81344, 0.37014, 0.87228, 0.26811, 0.89063, 0.18356, 0.85353, 0.14645]
1252
+ ]);
1253
+ var gemShape = createShape([
1254
+ [0.31244, 0.08536, 0.37064, 0.04306, 0.39978, 0.02191, 0.4308, 0.0114],
1255
+ [0.4308, 0.0114, 0.47568, -38e-4, 0.52432, -38e-4, 0.5692, 0.0114],
1256
+ [0.5692, 0.0114, 0.60022, 0.02191, 0.62936, 0.04306, 0.68756, 0.08536],
1257
+ [0.68756, 0.08536, 0.73121, 0.11706, 0.77485, 0.14876, 0.81849, 0.18046],
1258
+ [0.81849, 0.18046, 0.85308, 0.20558, 0.87038, 0.21814, 0.88446, 0.23321],
1259
+ [0.88446, 0.23321, 0.90483, 0.25499, 0.92046, 0.28077, 0.93035, 0.30891],
1260
+ [0.93035, 0.30891, 0.93721, 0.32838, 0.94032, 0.34951, 0.9466, 0.39178],
1261
+ [0.9466, 0.39178, 0.95468, 0.44627, 0.96276, 0.50076, 0.97083, 0.55524],
1262
+ [0.97083, 0.55524, 0.98183, 0.6294, 0.98734, 0.66648, 0.9818, 0.69989],
1263
+ [0.9818, 0.69989, 0.97375, 0.74823, 0.9495, 0.79239, 0.91301, 0.8251],
1264
+ [0.91301, 0.8251, 0.88779, 0.84771, 0.85353, 0.86296, 0.78503, 0.89347],
1265
+ [0.78503, 0.89347, 0.73331, 0.91651, 0.68159, 0.93954, 0.62987, 0.96258],
1266
+ [0.62987, 0.96258, 0.58853, 0.98099, 0.56785, 0.99019, 0.54663, 0.9949],
1267
+ [0.54663, 0.9949, 0.51592, 1.0017, 0.48408, 1.0017, 0.45337, 0.9949],
1268
+ [0.45337, 0.9949, 0.43215, 0.99019, 0.41147, 0.98099, 0.37013, 0.96258],
1269
+ [0.37013, 0.96258, 0.31841, 0.93954, 0.26669, 0.91651, 0.21497, 0.89347],
1270
+ [0.21497, 0.89347, 0.14647, 0.86296, 0.11221, 0.84771, 0.08699, 0.8251],
1271
+ [0.08699, 0.8251, 0.0505, 0.79239, 0.02625, 0.74823, 0.0182, 0.69989],
1272
+ [0.0182, 0.69989, 0.01266, 0.66648, 0.01817, 0.6294, 0.02917, 0.55524],
1273
+ [0.02917, 0.55524, 0.03724, 0.50076, 0.04532, 0.44627, 0.0534, 0.39178],
1274
+ [0.0534, 0.39178, 0.05968, 0.34951, 0.06279, 0.32838, 0.06965, 0.30891],
1275
+ [0.06965, 0.30891, 0.07954, 0.28077, 0.09517, 0.25499, 0.11554, 0.23321],
1276
+ [0.11554, 0.23321, 0.12962, 0.21814, 0.14692, 0.20558, 0.18151, 0.18046],
1277
+ [0.18151, 0.18046, 0.22515, 0.14876, 0.26879, 0.11706, 0.31244, 0.08536]
1278
+ ]);
1279
+ var ghostishShape = createShape([
1280
+ [0, 0.47619, 0, 0.2132, 0.22386, 0, 0.5, 0],
1281
+ [0.5, 0, 0.77614, 0, 1, 0.2132, 1, 0.47619],
1282
+ [1, 0.47619, 1, 0.5873, 1, 0.69841, 1, 0.80952],
1283
+ [1, 0.80952, 1, 0.91472, 0.91046, 1, 0.8, 1],
1284
+ [0.8, 1, 0.76726, 1, 0.73636, 0.99251, 0.70908, 0.97923],
1285
+ [0.70908, 0.97923, 0.69518, 0.97246, 0.68131, 0.96504, 0.66738, 0.95759],
1286
+ [0.66738, 0.95759, 0.61838, 0.93137, 0.56864, 0.90476, 0.51423, 0.90476],
1287
+ [0.51423, 0.90476, 0.50474, 0.90476, 0.49526, 0.90476, 0.48577, 0.90476],
1288
+ [0.48577, 0.90476, 0.43136, 0.90476, 0.38163, 0.93137, 0.33262, 0.95759],
1289
+ [0.33262, 0.95759, 0.31869, 0.96504, 0.30482, 0.97246, 0.29092, 0.97923],
1290
+ [0.29092, 0.97923, 0.26364, 0.99251, 0.23274, 1, 0.2, 1],
1291
+ [0.2, 1, 0.08954, 1, 0, 0.91472, 0, 0.80952],
1292
+ [0, 0.80952, 0, 0.69841, 0, 0.5873, 0, 0.47619]
1293
+ ]);
1294
+ var heartShape = createShape([
1295
+ [0.78469, 0.05353, 0.717, 0.05353, 0.6566, 0.08531, 0.61713, 0.135],
1296
+ [0.61713, 0.135, 0.57809, 0.17803, 0.53904, 0.22106, 0.5, 0.26409],
1297
+ [0.5, 0.26409, 0.5, 0.26396, 0.5, 0.26382, 0.5, 0.26369],
1298
+ [0.5, 0.26369, 0.46096, 0.22065, 0.42191, 0.1776, 0.38287, 0.13456],
1299
+ [0.38287, 0.13456, 0.3434, 0.08491, 0.283, 0.05312, 0.21531, 0.05312],
1300
+ [0.21531, 0.05312, 0.0964, 0.05312, 0, 0.15116, 0, 0.27206],
1301
+ [0, 0.27206, 0, 0.37831, 0.08867, 0.45772, 0.15287, 0.534],
1302
+ [0.15287, 0.534, 0.21684, 0.61003, 0.2808, 0.686, 0.34476, 0.762],
1303
+ [0.34476, 0.762, 0.39262, 0.81887, 0.44049, 0.87575, 0.48835, 0.93263],
1304
+ [0.48835, 0.93263, 0.49224, 0.93722, 0.49611, 0.94184, 0.5, 0.94647],
1305
+ [0.5, 0.94647, 0.5, 0.9466, 0.5, 0.94674, 0.5, 0.94688],
1306
+ [0.5, 0.94688, 0.50389, 0.94225, 0.50776, 0.93766, 0.51165, 0.93303],
1307
+ [0.51165, 0.93303, 0.55951, 0.87616, 0.60737, 0.81931, 0.65524, 0.76244],
1308
+ [0.65524, 0.76244, 0.7192, 0.68644, 0.78317, 0.61044, 0.84713, 0.53444],
1309
+ [0.84713, 0.53444, 0.91133, 0.45816, 1, 0.37875, 1, 0.27247],
1310
+ [1, 0.27247, 1, 0.15156, 0.9036, 0.05353, 0.78469, 0.05353]
1311
+ ]);
1312
+ var clover4LeafShape = createShape([
1313
+ [0.07095, 0.5, 0.02669, 0.44709, 0, 0.37882, 0, 0.30426],
1314
+ [0, 0.30426, 0, 0.13622, 0.13551, 0, 0.3027, 0],
1315
+ [0.3027, 0, 0.37834, 0, 0.44753, 0.02791, 0.50057, 0.07402],
1316
+ [0.50057, 0.07402, 0.55351, 0.02791, 0.62253, 0, 0.69801, 0],
1317
+ [0.69801, 0, 0.8648, 0, 1, 0.13622, 1, 0.30426],
1318
+ [1, 0.30426, 1, 0.37882, 0.97338, 0.44709, 0.92922, 0.5],
1319
+ [0.92922, 0.5, 0.97338, 0.55291, 1, 0.62118, 1, 0.69574],
1320
+ [1, 0.69574, 1, 0.86378, 0.8648, 1, 0.69801, 1],
1321
+ [0.69801, 1, 0.62253, 1, 0.55351, 0.97209, 0.50057, 0.92598],
1322
+ [0.50057, 0.92598, 0.44753, 0.97209, 0.37834, 1, 0.3027, 1],
1323
+ [0.3027, 1, 0.13551, 1, 0, 0.86378, 0, 0.69574],
1324
+ [0, 0.69574, 0, 0.62118, 0.02669, 0.55291, 0.07095, 0.5]
1325
+ ]);
1326
+ var clover8LeafShape = createShape([
1327
+ [0.96431, 0.5, 1.0451, 0.6505, 0.98406, 0.78678, 0.82834, 0.82831],
1328
+ [0.82834, 0.82831, 0.78678, 0.98406, 0.6505, 1.04506, 0.5, 0.96431],
1329
+ [0.5, 0.96431, 0.34947, 1.0451, 0.21319, 0.98406, 0.17166, 0.82834],
1330
+ [0.17166, 0.82834, 0.01594, 0.78678, -0.0451, 0.6505, 0.03569, 0.5],
1331
+ [0.03569, 0.5, -0.0451, 0.34947, 0.01594, 0.21319, 0.17166, 0.17166],
1332
+ [0.17166, 0.17166, 0.21319, 0.01594, 0.34947, -0.0451, 0.5, 0.03569],
1333
+ [0.5, 0.03569, 0.6505, -0.0451, 0.78678, 0.01594, 0.82831, 0.17166],
1334
+ [0.82831, 0.17166, 0.98406, 0.21319, 1.04506, 0.34947, 0.96431, 0.5]
1335
+ ]);
1336
+ var ovalShape = createShape([
1337
+ [0.77103, 0.77103, 0.53902, 1.00303, 0.22959, 1.06979, 0.07991, 0.9201],
1338
+ [0.07991, 0.9201, -0.06978, 0.7704, -304e-5, 0.46097, 0.22897, 0.22897],
1339
+ [0.22897, 0.22897, 0.46098, -303e-5, 0.77041, -0.06979, 0.92009, 0.0799],
1340
+ [0.92009, 0.0799, 1.06978, 0.2296, 1.00304, 0.53903, 0.77103, 0.77103]
1341
+ ]);
1342
+ var pentagonShape = createShape([
1343
+ [0.3426, 0.07617, 0.39138, 0.03842, 0.41575, 0.01954, 0.44181, 0.01017],
1344
+ [0.44181, 0.01017, 0.47942, -336e-5, 0.52058, -336e-5, 0.55819, 0.01017],
1345
+ [0.55819, 0.01017, 0.58425, 0.01954, 0.60862, 0.03842, 0.6574, 0.07617],
1346
+ [0.6574, 0.07617, 0.69296, 0.1037, 0.72853, 0.13123, 0.76409, 0.15876],
1347
+ [0.76409, 0.15876, 0.79963, 0.18455, 0.83517, 0.21034, 0.87071, 0.23613],
1348
+ [0.87071, 0.23613, 0.9213, 0.27285, 0.94662, 0.29123, 0.96352, 0.31429],
1349
+ [0.96352, 0.31429, 0.98796, 0.34769, 1.00083, 0.38872, 0.99996, 0.43069],
1350
+ [0.99996, 0.43069, 0.99933, 0.45972, 0.9893, 0.49006, 0.96918, 0.55072],
1351
+ [0.96918, 0.55072, 0.95522, 0.59283, 0.94126, 0.63495, 0.9273, 0.67706],
1352
+ [0.9273, 0.67706, 0.91443, 0.72021, 0.90155, 0.76335, 0.88868, 0.8065],
1353
+ [0.88868, 0.8065, 0.87052, 0.86724, 0.86146, 0.89762, 0.84562, 0.92124],
1354
+ [0.84562, 0.92124, 0.82268, 0.95543, 0.78934, 0.98055, 0.75099, 0.99259],
1355
+ [0.75099, 0.99259, 0.7245, 1.00093, 0.69393, 1.00043, 0.63281, 0.99946],
1356
+ [0.63281, 0.99946, 0.58854, 0.99876, 0.54427, 0.99806, 0.5, 0.99737],
1357
+ [0.5, 0.99737, 0.45573, 0.99806, 0.41146, 0.99876, 0.36719, 0.99946],
1358
+ [0.36719, 0.99946, 0.30607, 1.00043, 0.2755, 1.00093, 0.24901, 0.99259],
1359
+ [0.24901, 0.99259, 0.21066, 0.98055, 0.17732, 0.95543, 0.15438, 0.92124],
1360
+ [0.15438, 0.92124, 0.13854, 0.89762, 0.12948, 0.86724, 0.11132, 0.8065],
1361
+ [0.11132, 0.8065, 0.09845, 0.76335, 0.08557, 0.72021, 0.0727, 0.67706],
1362
+ [0.0727, 0.67706, 0.05874, 0.63495, 0.04478, 0.59283, 0.03082, 0.55072],
1363
+ [0.03082, 0.55072, 0.0107, 0.49006, 67e-5, 0.45972, 4e-5, 0.43069],
1364
+ [4e-5, 0.43069, -83e-5, 0.38872, 0.01204, 0.34769, 0.03648, 0.31429],
1365
+ [0.03648, 0.31429, 0.05338, 0.29123, 0.0787, 0.27285, 0.12929, 0.23613],
1366
+ [0.12929, 0.23613, 0.16483, 0.21034, 0.20037, 0.18455, 0.23591, 0.15876],
1367
+ [0.23591, 0.15876, 0.27147, 0.13123, 0.30704, 0.1037, 0.3426, 0.07617]
1368
+ ]);
1369
+ var pillShape = createShape([
1370
+ [0.2662, 0.1259, 0.43407, -0.04197, 0.70623, -0.04197, 0.8741, 0.1259],
1371
+ [0.8741, 0.1259, 1.04197, 0.29377, 1.04197, 0.56593, 0.8741, 0.7338],
1372
+ [0.8741, 0.7338, 0.82733, 0.78057, 0.78057, 0.82733, 0.7338, 0.8741],
1373
+ [0.7338, 0.8741, 0.56593, 1.04197, 0.29377, 1.04197, 0.1259, 0.8741],
1374
+ [0.1259, 0.8741, -0.04197, 0.70623, -0.04197, 0.43407, 0.1259, 0.2662],
1375
+ [0.1259, 0.2662, 0.17267, 0.21943, 0.21943, 0.17267, 0.2662, 0.1259]
1376
+ ]);
1377
+ var pixelCircleShape = createShape([
1378
+ [0.70372, 0, 0.56791, 0, 0.43209, 0, 0.29628, 0],
1379
+ [0.29628, 0, 0.29628, 0.0216, 0.29628, 0.04321, 0.29628, 0.06481],
1380
+ [0.29628, 0.06481, 0.24999, 0.06481, 0.2037, 0.06481, 0.15741, 0.06481],
1381
+ [0.15741, 0.06481, 0.15741, 0.09259, 0.15741, 0.12037, 0.15741, 0.14816],
1382
+ [0.15741, 0.14816, 0.12963, 0.14816, 0.10185, 0.14816, 0.07408, 0.14816],
1383
+ [0.07408, 0.14816, 0.07408, 0.19753, 0.07408, 0.24691, 0.07408, 0.29628],
1384
+ [0.07408, 0.29628, 0.04938, 0.29628, 0.02469, 0.29628, 0, 0.29628],
1385
+ [0, 0.29628, 0, 0.43209, 0, 0.56791, 0, 0.70372],
1386
+ [0, 0.70372, 0.02469, 0.70372, 0.04938, 0.70372, 0.07408, 0.70372],
1387
+ [0.07408, 0.70372, 0.07408, 0.75309, 0.07408, 0.80247, 0.07408, 0.85184],
1388
+ [0.07408, 0.85184, 0.10185, 0.85184, 0.12963, 0.85184, 0.15741, 0.85184],
1389
+ [0.15741, 0.85184, 0.15741, 0.87962, 0.15741, 0.90741, 0.15741, 0.93519],
1390
+ [0.15741, 0.93519, 0.2037, 0.93519, 0.24999, 0.93519, 0.29628, 0.93519],
1391
+ [0.29628, 0.93519, 0.29628, 0.95679, 0.29628, 0.9784, 0.29628, 1],
1392
+ [0.29628, 1, 0.43209, 1, 0.56791, 1, 0.70372, 1],
1393
+ [0.70372, 1, 0.70372, 0.9784, 0.70372, 0.95679, 0.70372, 0.93519],
1394
+ [0.70372, 0.93519, 0.75001, 0.93519, 0.7963, 0.93519, 0.84259, 0.93519],
1395
+ [0.84259, 0.93519, 0.84259, 0.90741, 0.84259, 0.87962, 0.84259, 0.85184],
1396
+ [0.84259, 0.85184, 0.87037, 0.85184, 0.89816, 0.85184, 0.92594, 0.85184],
1397
+ [0.92594, 0.85184, 0.92594, 0.80247, 0.92594, 0.75309, 0.92594, 0.70372],
1398
+ [0.92594, 0.70372, 0.95062, 0.70372, 0.97531, 0.70372, 1, 0.70372],
1399
+ [1, 0.70372, 1, 0.56791, 1, 0.43209, 1, 0.29628],
1400
+ [1, 0.29628, 0.97531, 0.29628, 0.95062, 0.29628, 0.92594, 0.29628],
1401
+ [0.92594, 0.29628, 0.92594, 0.24691, 0.92594, 0.19753, 0.92594, 0.14816],
1402
+ [0.92594, 0.14816, 0.89816, 0.14816, 0.87037, 0.14816, 0.84259, 0.14816],
1403
+ [0.84259, 0.14816, 0.84259, 0.12038, 0.84259, 0.09259, 0.84259, 0.06481],
1404
+ [0.84259, 0.06481, 0.7963, 0.06481, 0.75001, 0.06481, 0.70372, 0.06481],
1405
+ [0.70372, 0.06481, 0.70372, 0.04321, 0.70372, 0.0216, 0.70372, 0]
1406
+ ]);
1407
+ var pixelTriangleShape = createShape([
1408
+ [0.28637, 0, 0.22842, 0, 0.17046, 0, 0.1125, 0],
1409
+ [0.1125, 0, 0.1125, 0.33333, 0.1125, 0.66667, 0.1125, 1],
1410
+ [0.1125, 1, 0.17046, 1, 0.22842, 1, 0.28637, 1],
1411
+ [0.28637, 1, 0.28637, 0.97101, 0.28637, 0.94203, 0.28637, 0.91304],
1412
+ [0.28637, 0.91304, 0.33108, 0.91304, 0.37579, 0.91304, 0.4205, 0.91304],
1413
+ [0.4205, 0.91304, 0.4205, 0.88551, 0.4205, 0.85797, 0.4205, 0.83043],
1414
+ [0.4205, 0.83043, 0.46688, 0.83043, 0.51325, 0.83043, 0.55963, 0.83043],
1415
+ [0.55963, 0.83043, 0.55963, 0.79855, 0.55963, 0.76667, 0.55963, 0.73478],
1416
+ [0.55963, 0.73478, 0.59771, 0.73478, 0.63579, 0.73478, 0.67388, 0.73478],
1417
+ [0.67388, 0.73478, 0.67388, 0.70869, 0.67388, 0.68261, 0.67388, 0.65652],
1418
+ [0.67388, 0.65652, 0.71197, 0.65652, 0.75006, 0.65652, 0.78816, 0.65652],
1419
+ [0.78816, 0.65652, 0.78816, 0.62464, 0.78816, 0.59275, 0.78816, 0.56087],
1420
+ [0.78816, 0.56087, 0.82127, 0.56087, 0.85439, 0.56087, 0.8875, 0.56087],
1421
+ [0.8875, 0.56087, 0.8875, 0.52029, 0.8875, 0.47971, 0.8875, 0.43913],
1422
+ [0.8875, 0.43913, 0.85439, 0.43913, 0.82127, 0.43913, 0.78816, 0.43913],
1423
+ [0.78816, 0.43913, 0.78816, 0.40725, 0.78816, 0.37536, 0.78816, 0.34347],
1424
+ [0.78816, 0.34347, 0.75006, 0.34347, 0.71197, 0.34347, 0.67388, 0.34347],
1425
+ [0.67388, 0.34347, 0.67388, 0.31739, 0.67388, 0.2913, 0.67388, 0.26522],
1426
+ [0.67388, 0.26522, 0.63579, 0.26522, 0.59771, 0.26522, 0.55963, 0.26522],
1427
+ [0.55963, 0.26522, 0.55963, 0.23333, 0.55963, 0.20145, 0.55963, 0.16957],
1428
+ [0.55963, 0.16957, 0.51325, 0.16957, 0.46688, 0.16957, 0.4205, 0.16957],
1429
+ [0.4205, 0.16957, 0.4205, 0.14203, 0.4205, 0.11449, 0.4205, 0.08696],
1430
+ [0.4205, 0.08696, 0.37579, 0.08696, 0.33108, 0.08696, 0.28637, 0.08696],
1431
+ [0.28637, 0.08696, 0.28637, 0.05797, 0.28637, 0.02899, 0.28637, 0]
1432
+ ]);
1433
+ var puffyDiamondShape = createShape([
1434
+ [0.77937, 0.78048, 0.81712, 0.7427, 0.8299, 0.6894, 0.81768, 0.64111],
1435
+ [0.81768, 0.64111, 0.86599, 0.65339, 0.91937, 0.64063, 0.95718, 0.60282],
1436
+ [0.95718, 0.60282, 1.01427, 0.54574, 1.01427, 0.45319, 0.95718, 0.39611],
1437
+ [0.95718, 0.39611, 0.91959, 0.35852, 0.86662, 0.34569, 0.81856, 0.3576],
1438
+ [0.81856, 0.3576, 0.82928, 0.31027, 0.81621, 0.25865, 0.77937, 0.2218],
1439
+ [0.77937, 0.2218, 0.7415, 0.18394, 0.68803, 0.17119, 0.63969, 0.18355],
1440
+ [0.63969, 0.18355, 0.6525, 0.13492, 0.63984, 0.08095, 0.60169, 0.04282],
1441
+ [0.60169, 0.04282, 0.54462, -0.01426, 0.45206, -0.01426, 0.395, 0.04282],
1442
+ [0.395, 0.04282, 0.3571, 0.08073, 0.34435, 0.13427, 0.35678, 0.18269],
1443
+ [0.35678, 0.18269, 0.30938, 0.17184, 0.2576, 0.18487, 0.22069, 0.2218],
1444
+ [0.22069, 0.2218, 0.18385, 0.25865, 0.17079, 0.31028, 0.1815, 0.35761],
1445
+ [0.1815, 0.35761, 0.13341, 0.34568, 0.08041, 0.35851, 0.04282, 0.39611],
1446
+ [0.04282, 0.39611, -0.01427, 0.45319, -0.01427, 0.54574, 0.04282, 0.60282],
1447
+ [0.04282, 0.60282, 0.08063, 0.64064, 0.13404, 0.6534, 0.18235, 0.6411],
1448
+ [0.18235, 0.6411, 0.17013, 0.68939, 0.18291, 0.7427, 0.22069, 0.78048],
1449
+ [0.22069, 0.78048, 0.25744, 0.81725, 0.30894, 0.83033, 0.35619, 0.81973],
1450
+ [0.35619, 0.81973, 0.34478, 0.8675, 0.35772, 0.9199, 0.395, 0.95718],
1451
+ [0.395, 0.95718, 0.45206, 1.01426, 0.54462, 1.01426, 0.60169, 0.95718],
1452
+ [0.60169, 0.95718, 0.63919, 0.91968, 0.65206, 0.86688, 0.64028, 0.81888],
1453
+ [0.64028, 0.81888, 0.6885, 0.83098, 0.74165, 0.81817, 0.77937, 0.78048]
1454
+ ]);
1455
+ var puffyShape = createShape([
1456
+ [0.99994, 0.49408, 0.99912, 0.42679, 0.94916, 0.37292, 0.88825, 0.37382],
1457
+ [0.88825, 0.37382, 0.88491, 0.37382, 0.88159, 0.3741, 0.87831, 0.37449],
1458
+ [0.87831, 0.37449, 0.88087, 0.37218, 0.88337, 0.36982, 0.88575, 0.36722],
1459
+ [0.88575, 0.36722, 0.92937, 0.32028, 0.93028, 0.24307, 0.88784, 0.19483],
1460
+ [0.88784, 0.19483, 0.88534, 0.19201, 0.88287, 0.18919, 0.88031, 0.18648],
1461
+ [0.88031, 0.18648, 0.83669, 0.13954, 0.76694, 0.14055, 0.72444, 0.1888],
1462
+ [0.72444, 0.1888, 0.72209, 0.19144, 0.71997, 0.19421, 0.71787, 0.19703],
1463
+ [0.71787, 0.19703, 0.71822, 0.19342, 0.71844, 0.18975, 0.7185, 0.18603],
1464
+ [0.7185, 0.18603, 0.71934, 0.11874, 0.67066, 0.06346, 0.60981, 0.0625],
1465
+ [0.60981, 0.0625, 0.60682, 0.0625, 0.60383, 0.0625, 0.60084, 0.0625],
1466
+ [0.60084, 0.0625, 0.55575, 0.0625, 0.51706, 0.09248, 0.5, 0.13537],
1467
+ [0.5, 0.13537, 0.48294, 0.09248, 0.44422, 0.0625, 0.39916, 0.0625],
1468
+ [0.39916, 0.0625, 0.39617, 0.0625, 0.39318, 0.0625, 0.39019, 0.0625],
1469
+ [0.39019, 0.0625, 0.32934, 0.0634, 0.28066, 0.11869, 0.28147, 0.18603],
1470
+ [0.28147, 0.18603, 0.28147, 0.18975, 0.28172, 0.19342, 0.28206, 0.19703],
1471
+ [0.28206, 0.19703, 0.28, 0.19418, 0.27781, 0.19144, 0.2755, 0.1888],
1472
+ [0.2755, 0.1888, 0.23306, 0.14055, 0.16325, 0.13954, 0.11962, 0.18648],
1473
+ [0.11962, 0.18648, 0.11709, 0.18925, 0.11453, 0.19201, 0.11209, 0.19483],
1474
+ [0.11209, 0.19483, 0.06966, 0.24307, 0.07056, 0.32022, 0.11419, 0.36722],
1475
+ [0.11419, 0.36722, 0.11659, 0.36982, 0.11906, 0.37218, 0.12162, 0.37449],
1476
+ [0.12162, 0.37449, 0.11833, 0.37409, 0.11501, 0.37387, 0.11169, 0.37382],
1477
+ [0.11169, 0.37382, 0.05084, 0.37292, 87e-5, 0.42679, 0, 0.49408],
1478
+ [0, 0.49408, 0, 0.49803, 0, 0.50197, 0, 0.50592],
1479
+ [0, 0.50592, 81e-5, 0.57321, 0.05081, 0.62708, 0.11169, 0.62618],
1480
+ [0.11169, 0.62618, 0.11506, 0.62618, 0.11837, 0.6259, 0.12162, 0.62551],
1481
+ [0.12162, 0.62551, 0.11906, 0.62782, 0.11659, 0.63018, 0.11419, 0.63278],
1482
+ [0.11419, 0.63278, 0.07056, 0.67972, 0.06966, 0.75693, 0.11209, 0.80518],
1483
+ [0.11209, 0.80518, 0.11459, 0.80799, 0.11709, 0.81081, 0.11962, 0.81352],
1484
+ [0.11962, 0.81352, 0.16325, 0.86046, 0.233, 0.85945, 0.2755, 0.8112],
1485
+ [0.2755, 0.8112, 0.27784, 0.80856, 0.28, 0.80579, 0.28206, 0.80297],
1486
+ [0.28206, 0.80298, 0.28171, 0.80663, 0.28151, 0.8103, 0.28147, 0.81397],
1487
+ [0.28147, 0.81397, 0.28066, 0.88126, 0.32931, 0.9366, 0.39019, 0.9375],
1488
+ [0.39019, 0.9375, 0.39318, 0.9375, 0.39617, 0.9375, 0.39916, 0.9375],
1489
+ [0.39916, 0.9375, 0.44425, 0.9375, 0.48294, 0.90752, 0.5, 0.86463],
1490
+ [0.5, 0.86463, 0.51706, 0.90752, 0.55578, 0.9375, 0.60084, 0.9375],
1491
+ [0.60084, 0.9375, 0.60383, 0.9375, 0.60682, 0.9375, 0.60981, 0.9375],
1492
+ [0.60981, 0.9375, 0.67066, 0.9366, 0.71934, 0.88131, 0.71853, 0.81397],
1493
+ [0.71853, 0.81397, 0.71853, 0.81025, 0.71828, 0.80658, 0.71794, 0.80297],
1494
+ [0.71794, 0.80297, 0.72, 0.80579, 0.72216, 0.80856, 0.7245, 0.8112],
1495
+ [0.7245, 0.8112, 0.76694, 0.85945, 0.83675, 0.86046, 0.88037, 0.81352],
1496
+ [0.88037, 0.81352, 0.88291, 0.81075, 0.88547, 0.80799, 0.88791, 0.80518],
1497
+ [0.88791, 0.80518, 0.93034, 0.75693, 0.92944, 0.67978, 0.88581, 0.63278],
1498
+ [0.88581, 0.63278, 0.88341, 0.63018, 0.88094, 0.62782, 0.87838, 0.62551],
1499
+ [0.87838, 0.62551, 0.88167, 0.62591, 0.88499, 0.62613, 0.88831, 0.62618],
1500
+ [0.88831, 0.62618, 0.94916, 0.62708, 0.99919, 0.57327, 1, 0.50592],
1501
+ [1, 0.50592, 1, 0.50197, 1, 0.49803, 1, 0.49408],
1502
+ [1, 0.49408, 0.99998, 0.49408, 0.99996, 0.49408, 0.99994, 0.49408]
1503
+ ]);
1504
+ var semiCircleShape = createShape([
1505
+ [1, 0.70913, 1, 0.76622, 0.95372, 0.8125, 0.89663, 0.8125],
1506
+ [0.89663, 0.8125, 0.63221, 0.8125, 0.36779, 0.8125, 0.10337, 0.8125],
1507
+ [0.10337, 0.8125, 0.04628, 0.8125, 0, 0.76622, 0, 0.70913],
1508
+ [0, 0.70913, 0, 0.70192, 0, 0.69471, 0, 0.6875],
1509
+ [0, 0.6875, 0, 0.41134, 0.22386, 0.1875, 0.5, 0.1875],
1510
+ [0.5, 0.1875, 0.77614, 0.1875, 1, 0.41134, 1, 0.6875],
1511
+ [1, 0.6875, 1, 0.69471, 1, 0.70192, 1, 0.70913]
1512
+ ]);
1513
+ var cookie12SidedShape = createShape([
1514
+ [0.42719, 0.03077, 0.42887, 0.02912, 0.42972, 0.02827, 0.43044, 0.02759],
1515
+ [0.43044, 0.02759, 0.46953, -92e-4, 0.53047, -92e-4, 0.56956, 0.02759],
1516
+ [0.56956, 0.02759, 0.57028, 0.02827, 0.57113, 0.02912, 0.57281, 0.03077],
1517
+ [0.57281, 0.03077, 0.57384, 0.03174, 0.57434, 0.03224, 0.57481, 0.03271],
1518
+ [0.57481, 0.03271, 0.59982, 0.05657, 0.63526, 0.06606, 0.66885, 0.0579],
1519
+ [0.66885, 0.0579, 0.6695, 0.05774, 0.67019, 0.05756, 0.67157, 0.05721],
1520
+ [0.67157, 0.05721, 0.67385, 0.05662, 0.675, 0.05634, 0.67597, 0.05609],
1521
+ [0.67597, 0.05609, 0.72819, 0.04377, 0.781, 0.07424, 0.79644, 0.12565],
1522
+ [0.79644, 0.12565, 0.79672, 0.12662, 0.79704, 0.12774, 0.79769, 0.13003],
1523
+ [0.79769, 0.13003, 0.79807, 0.1314, 0.79825, 0.13209, 0.79844, 0.13274],
1524
+ [0.79844, 0.13274, 0.80817, 0.1659, 0.8341, 0.19183, 0.86726, 0.20156],
1525
+ [0.86726, 0.20156, 0.86791, 0.20175, 0.8686, 0.20193, 0.86997, 0.20231],
1526
+ [0.86997, 0.20231, 0.87226, 0.20296, 0.87338, 0.20328, 0.87435, 0.20356],
1527
+ [0.87435, 0.20356, 0.92576, 0.219, 0.95623, 0.27181, 0.94391, 0.32403],
1528
+ [0.94391, 0.32403, 0.94366, 0.325, 0.94338, 0.32615, 0.94279, 0.32843],
1529
+ [0.94279, 0.32843, 0.94244, 0.32981, 0.94226, 0.3305, 0.9421, 0.33115],
1530
+ [0.9421, 0.33115, 0.93394, 0.36474, 0.94343, 0.40018, 0.96729, 0.42519],
1531
+ [0.96729, 0.42519, 0.96776, 0.42566, 0.96826, 0.42616, 0.96923, 0.42719],
1532
+ [0.96923, 0.42719, 0.97088, 0.42887, 0.97173, 0.42972, 0.97241, 0.43044],
1533
+ [0.97241, 0.43044, 1.0092, 0.46953, 1.0092, 0.53047, 0.97241, 0.56956],
1534
+ [0.97241, 0.56956, 0.97173, 0.57028, 0.97088, 0.57113, 0.96923, 0.57281],
1535
+ [0.96923, 0.57281, 0.96826, 0.57384, 0.96776, 0.57434, 0.96729, 0.57481],
1536
+ [0.96729, 0.57481, 0.94343, 0.59982, 0.93394, 0.63526, 0.9421, 0.66885],
1537
+ [0.9421, 0.66885, 0.94226, 0.6695, 0.94244, 0.67019, 0.94279, 0.67157],
1538
+ [0.94279, 0.67157, 0.94338, 0.67385, 0.94366, 0.675, 0.94391, 0.67597],
1539
+ [0.94391, 0.67597, 0.95623, 0.72819, 0.92576, 0.781, 0.87435, 0.79644],
1540
+ [0.87435, 0.79644, 0.87338, 0.79672, 0.87226, 0.79704, 0.86997, 0.79769],
1541
+ [0.86997, 0.79769, 0.8686, 0.79807, 0.86791, 0.79825, 0.86726, 0.79844],
1542
+ [0.86726, 0.79844, 0.8341, 0.80817, 0.80817, 0.8341, 0.79844, 0.86726],
1543
+ [0.79844, 0.86726, 0.79825, 0.86791, 0.79807, 0.8686, 0.79769, 0.86997],
1544
+ [0.79769, 0.86997, 0.79704, 0.87226, 0.79672, 0.87338, 0.79644, 0.87435],
1545
+ [0.79644, 0.87435, 0.781, 0.92576, 0.72819, 0.95623, 0.67597, 0.94391],
1546
+ [0.67597, 0.94391, 0.675, 0.94366, 0.67385, 0.94338, 0.67157, 0.94279],
1547
+ [0.67157, 0.94279, 0.67019, 0.94244, 0.6695, 0.94226, 0.66885, 0.9421],
1548
+ [0.66885, 0.9421, 0.63526, 0.93394, 0.59982, 0.94343, 0.57481, 0.96729],
1549
+ [0.57481, 0.96729, 0.57434, 0.96776, 0.57384, 0.96826, 0.57281, 0.96923],
1550
+ [0.57281, 0.96923, 0.57113, 0.97088, 0.57028, 0.97173, 0.56956, 0.97241],
1551
+ [0.56956, 0.97241, 0.53047, 1.0092, 0.46953, 1.0092, 0.43044, 0.97241],
1552
+ [0.43044, 0.97241, 0.42972, 0.97173, 0.42887, 0.97088, 0.42719, 0.96923],
1553
+ [0.42719, 0.96923, 0.42616, 0.96826, 0.42566, 0.96776, 0.42519, 0.96729],
1554
+ [0.42519, 0.96729, 0.40018, 0.94343, 0.36474, 0.93394, 0.33115, 0.9421],
1555
+ [0.33115, 0.9421, 0.3305, 0.94226, 0.32981, 0.94244, 0.32843, 0.94279],
1556
+ [0.32843, 0.94279, 0.32615, 0.94338, 0.325, 0.94366, 0.32403, 0.94391],
1557
+ [0.32403, 0.94391, 0.27181, 0.95623, 0.219, 0.92576, 0.20356, 0.87435],
1558
+ [0.20356, 0.87435, 0.20328, 0.87338, 0.20296, 0.87226, 0.20231, 0.86997],
1559
+ [0.20231, 0.86997, 0.20193, 0.8686, 0.20175, 0.86791, 0.20156, 0.86726],
1560
+ [0.20156, 0.86726, 0.19183, 0.8341, 0.1659, 0.80817, 0.13274, 0.79844],
1561
+ [0.13274, 0.79844, 0.13209, 0.79825, 0.1314, 0.79807, 0.13003, 0.79769],
1562
+ [0.13003, 0.79769, 0.12774, 0.79704, 0.12662, 0.79672, 0.12565, 0.79644],
1563
+ [0.12565, 0.79644, 0.07424, 0.781, 0.04377, 0.72819, 0.05609, 0.67597],
1564
+ [0.05609, 0.67597, 0.05634, 0.675, 0.05662, 0.67385, 0.05721, 0.67157],
1565
+ [0.05721, 0.67157, 0.05756, 0.67019, 0.05774, 0.6695, 0.0579, 0.66885],
1566
+ [0.0579, 0.66885, 0.06606, 0.63526, 0.05657, 0.59982, 0.03271, 0.57481],
1567
+ [0.03271, 0.57481, 0.03224, 0.57434, 0.03174, 0.57384, 0.03077, 0.57281],
1568
+ [0.03077, 0.57281, 0.02912, 0.57113, 0.02827, 0.57028, 0.02759, 0.56956],
1569
+ [0.02759, 0.56956, -92e-4, 0.53047, -92e-4, 0.46953, 0.02759, 0.43044],
1570
+ [0.02759, 0.43044, 0.02827, 0.42972, 0.02912, 0.42887, 0.03077, 0.42719],
1571
+ [0.03077, 0.42719, 0.03174, 0.42616, 0.03224, 0.42566, 0.03271, 0.42519],
1572
+ [0.03271, 0.42519, 0.05657, 0.40018, 0.06606, 0.36474, 0.0579, 0.33115],
1573
+ [0.0579, 0.33115, 0.05774, 0.3305, 0.05756, 0.32981, 0.05721, 0.32843],
1574
+ [0.05721, 0.32843, 0.05662, 0.32615, 0.05634, 0.325, 0.05609, 0.32403],
1575
+ [0.05609, 0.32403, 0.04377, 0.27181, 0.07424, 0.219, 0.12565, 0.20356],
1576
+ [0.12565, 0.20356, 0.12662, 0.20328, 0.12774, 0.20296, 0.13003, 0.20231],
1577
+ [0.13003, 0.20231, 0.1314, 0.20193, 0.13209, 0.20175, 0.13274, 0.20156],
1578
+ [0.13274, 0.20156, 0.1659, 0.19183, 0.19183, 0.1659, 0.20156, 0.13274],
1579
+ [0.20156, 0.13274, 0.20175, 0.13209, 0.20193, 0.1314, 0.20231, 0.13003],
1580
+ [0.20231, 0.13003, 0.20296, 0.12774, 0.20328, 0.12662, 0.20356, 0.12565],
1581
+ [0.20356, 0.12565, 0.219, 0.07424, 0.27181, 0.04377, 0.32403, 0.05609],
1582
+ [0.32403, 0.05609, 0.325, 0.05634, 0.32615, 0.05662, 0.32843, 0.05721],
1583
+ [0.32843, 0.05721, 0.32981, 0.05756, 0.3305, 0.05774, 0.33115, 0.0579],
1584
+ [0.33115, 0.0579, 0.36474, 0.06606, 0.40018, 0.05657, 0.42519, 0.03271],
1585
+ [0.42519, 0.03271, 0.42566, 0.03224, 0.42616, 0.03174, 0.42719, 0.03077]
1586
+ ]);
1587
+ var cookie4SidedShape = createShape([
1588
+ [0.63833, 0.02217, 0.85312, -0.07111, 1.07112, 0.14689, 0.97783, 0.36168],
1589
+ [0.97783, 0.36168, 0.97269, 0.37351, 0.96755, 0.38534, 0.9624, 0.39718],
1590
+ [0.9624, 0.39718, 0.93394, 0.46277, 0.93394, 0.53723, 0.9624, 0.60282],
1591
+ [0.9624, 0.60282, 0.96755, 0.61466, 0.97269, 0.62649, 0.97783, 0.63832],
1592
+ [0.97783, 0.63832, 1.07112, 0.85311, 0.85312, 1.07111, 0.63833, 0.97783],
1593
+ [0.63833, 0.97783, 0.6265, 0.97268, 0.61466, 0.96754, 0.60283, 0.9624],
1594
+ [0.60283, 0.9624, 0.53724, 0.93393, 0.46278, 0.93393, 0.39718, 0.9624],
1595
+ [0.39718, 0.9624, 0.38535, 0.96754, 0.37352, 0.97268, 0.36168, 0.97783],
1596
+ [0.36168, 0.97783, 0.14689, 1.07111, -0.07112, 0.85311, 0.02217, 0.63832],
1597
+ [0.02217, 0.63832, 0.02731, 0.62649, 0.03245, 0.61466, 0.03759, 0.60282],
1598
+ [0.03759, 0.60282, 0.06608, 0.53723, 0.06608, 0.46277, 0.03759, 0.39718],
1599
+ [0.03759, 0.39718, 0.03245, 0.38534, 0.02731, 0.37351, 0.02217, 0.36168],
1600
+ [0.02217, 0.36168, -0.07112, 0.14689, 0.14689, -0.07111, 0.36168, 0.02217],
1601
+ [0.36168, 0.02217, 0.37352, 0.02732, 0.38535, 0.03246, 0.39718, 0.0376],
1602
+ [0.39718, 0.0376, 0.46278, 0.06607, 0.53724, 0.06607, 0.60283, 0.0376],
1603
+ [0.60283, 0.0376, 0.61466, 0.03246, 0.6265, 0.02732, 0.63833, 0.02217]
1604
+ ]);
1605
+ var cookie6SidedShape = createShape([
1606
+ [0.32337, 0.07142, 0.42176, -0.02381, 0.57824, -0.02381, 0.67663, 0.07142],
1607
+ [0.67663, 0.07142, 0.70677, 0.10055, 0.74365, 0.12178, 0.78399, 0.13319],
1608
+ [0.78399, 0.13319, 0.91589, 0.17053, 0.99413, 0.30566, 0.96061, 0.4382],
1609
+ [0.96061, 0.4382, 0.95036, 0.47876, 0.95036, 0.52124, 0.96061, 0.5618],
1610
+ [0.96061, 0.5618, 0.99413, 0.69434, 0.91589, 0.82947, 0.78399, 0.86681],
1611
+ [0.78399, 0.86681, 0.74365, 0.87822, 0.70677, 0.89945, 0.67663, 0.92858],
1612
+ [0.67663, 0.92858, 0.57824, 1.02381, 0.42176, 1.02381, 0.32337, 0.92858],
1613
+ [0.32337, 0.92858, 0.29323, 0.89945, 0.25635, 0.87822, 0.21601, 0.86681],
1614
+ [0.21601, 0.86681, 0.08411, 0.82947, 587e-5, 0.69434, 0.03939, 0.5618],
1615
+ [0.03939, 0.5618, 0.04964, 0.52124, 0.04964, 0.47876, 0.03939, 0.4382],
1616
+ [0.03939, 0.4382, 587e-5, 0.30566, 0.08411, 0.17053, 0.21601, 0.13319],
1617
+ [0.21601, 0.13319, 0.25635, 0.12178, 0.29323, 0.10055, 0.32337, 0.07142]
1618
+ ]);
1619
+ var cookie7SidedShape = createShape([
1620
+ [0.35209, 0.06806, 0.36326, 0.05824, 0.36884, 0.05334, 0.37397, 0.04937],
1621
+ [0.37397, 0.04937, 0.4482, -813e-5, 0.5518, -813e-5, 0.62603, 0.04937],
1622
+ [0.62603, 0.04937, 0.63116, 0.05334, 0.63674, 0.05824, 0.64791, 0.06806],
1623
+ [0.64791, 0.06806, 0.65164, 0.07137, 0.65351, 0.07299, 0.65539, 0.07459],
1624
+ [0.65539, 0.07459, 0.68167, 0.09662, 0.71303, 0.11176, 0.74663, 0.11862],
1625
+ [0.74663, 0.11862, 0.74903, 0.11912, 0.75147, 0.11956, 0.75637, 0.12043],
1626
+ [0.75637, 0.12043, 0.771, 0.12306, 0.77831, 0.12434, 0.78461, 0.1259],
1627
+ [0.78461, 0.1259, 0.87573, 0.14821, 0.94032, 0.2294, 0.94176, 0.3234],
1628
+ [0.94176, 0.3234, 0.94186, 0.3299, 0.94151, 0.33734, 0.9408, 0.35221],
1629
+ [0.9408, 0.35221, 0.94057, 0.35721, 0.94045, 0.35968, 0.94039, 0.36215],
1630
+ [0.94039, 0.36215, 0.93958, 0.39649, 0.94732, 0.43049, 0.96293, 0.46109],
1631
+ [0.96293, 0.46109, 0.96404, 0.46328, 0.96523, 0.46546, 0.96759, 0.46987],
1632
+ [0.96759, 0.46987, 0.97467, 0.48296, 0.97821, 0.4895, 0.98093, 0.4954],
1633
+ [0.98093, 0.4954, 1.02032, 0.58071, 0.99727, 0.68196, 0.92484, 0.74168],
1634
+ [0.92484, 0.74168, 0.91984, 0.74584, 0.91381, 0.75018, 0.90177, 0.7589],
1635
+ [0.90177, 0.7589, 0.89774, 0.76184, 0.89572, 0.76328, 0.89377, 0.76478],
1636
+ [0.89377, 0.76478, 0.86646, 0.78557, 0.84476, 0.81284, 0.83064, 0.84412],
1637
+ [0.83064, 0.84412, 0.82963, 0.84637, 0.82865, 0.84865, 0.82671, 0.85325],
1638
+ [0.82671, 0.85325, 0.82091, 0.86696, 0.818, 0.87381, 0.8151, 0.87962],
1639
+ [0.8151, 0.87962, 0.7731, 0.96368, 0.67977, 1.00875, 0.58801, 0.98925],
1640
+ [0.58801, 0.98925, 0.58166, 0.98787, 0.57451, 0.98587, 0.56019, 0.98187],
1641
+ [0.56019, 0.98187, 0.5554, 0.98056, 0.55301, 0.97987, 0.55063, 0.97928],
1642
+ [0.55063, 0.97928, 0.51741, 0.97084, 0.48259, 0.97084, 0.44937, 0.97928],
1643
+ [0.44937, 0.97928, 0.44699, 0.97987, 0.4446, 0.98056, 0.43981, 0.98187],
1644
+ [0.43981, 0.98187, 0.42549, 0.98587, 0.41834, 0.98787, 0.41199, 0.98925],
1645
+ [0.41199, 0.98925, 0.32023, 1.00875, 0.2269, 0.96368, 0.1849, 0.87962],
1646
+ [0.1849, 0.87962, 0.18199, 0.87381, 0.17909, 0.86696, 0.17329, 0.85325],
1647
+ [0.17329, 0.85325, 0.17135, 0.84865, 0.17037, 0.84637, 0.16936, 0.84412],
1648
+ [0.16936, 0.84412, 0.15523, 0.81284, 0.13353, 0.78557, 0.10623, 0.76478],
1649
+ [0.10623, 0.76478, 0.10428, 0.76328, 0.10226, 0.76184, 0.09823, 0.7589],
1650
+ [0.09823, 0.7589, 0.08619, 0.75018, 0.08017, 0.74584, 0.07516, 0.74168],
1651
+ [0.07516, 0.74168, 273e-5, 0.68196, -0.02032, 0.58071, 0.01907, 0.4954],
1652
+ [0.01907, 0.4954, 0.02179, 0.4895, 0.02533, 0.48296, 0.03241, 0.46987],
1653
+ [0.03241, 0.46987, 0.03477, 0.46546, 0.03596, 0.46328, 0.03707, 0.46109],
1654
+ [0.03707, 0.46109, 0.05268, 0.43049, 0.06042, 0.39649, 0.05961, 0.36215],
1655
+ [0.05961, 0.36215, 0.05955, 0.35968, 0.05943, 0.35721, 0.0592, 0.35221],
1656
+ [0.0592, 0.35221, 0.05849, 0.33734, 0.05813, 0.3299, 0.05824, 0.3234],
1657
+ [0.05824, 0.3234, 0.05968, 0.2294, 0.12427, 0.14821, 0.21539, 0.1259],
1658
+ [0.21539, 0.1259, 0.22169, 0.12434, 0.229, 0.12306, 0.24363, 0.12043],
1659
+ [0.24363, 0.12043, 0.24853, 0.11956, 0.25097, 0.11912, 0.25337, 0.11862],
1660
+ [0.25337, 0.11862, 0.28697, 0.11176, 0.31833, 0.09662, 0.34461, 0.07459],
1661
+ [0.34461, 0.07459, 0.34649, 0.07299, 0.34836, 0.07137, 0.35209, 0.06806]
1662
+ ]);
1663
+ var cookie9SidedShape = createShape([
1664
+ [0.39144, 0.04182, 0.39684, 0.03735, 0.39953, 0.03513, 0.402, 0.03326],
1665
+ [0.402, 0.03326, 0.45981, -0.01109, 0.54019, -0.01109, 0.598, 0.03326],
1666
+ [0.598, 0.03326, 0.60047, 0.03513, 0.60316, 0.03735, 0.60856, 0.04182],
1667
+ [0.60856, 0.04182, 0.61097, 0.04379, 0.61216, 0.04479, 0.61334, 0.04576],
1668
+ [0.61334, 0.04576, 0.64056, 0.06743, 0.67404, 0.07974, 0.70881, 0.08085],
1669
+ [0.70881, 0.08085, 0.71031, 0.08088, 0.71187, 0.08091, 0.71497, 0.08094],
1670
+ [0.71497, 0.08094, 0.72194, 0.08104, 0.72544, 0.08107, 0.7285, 0.08123],
1671
+ [0.7285, 0.08123, 0.80112, 0.08494, 0.86243, 0.13694, 0.87865, 0.20854],
1672
+ [0.87865, 0.20854, 0.87934, 0.21157, 0.88, 0.21504, 0.88131, 0.22194],
1673
+ [0.88131, 0.22194, 0.88187, 0.22504, 0.88215, 0.22657, 0.88247, 0.22807],
1674
+ [0.88247, 0.22807, 0.88956, 0.26244, 0.90737, 0.29357, 0.93325, 0.31694],
1675
+ [0.93325, 0.31694, 0.9344, 0.31797, 0.93556, 0.319, 0.93793, 0.32104],
1676
+ [0.93793, 0.32104, 0.94321, 0.32563, 0.94584, 0.32794, 0.94809, 0.33007],
1677
+ [0.94809, 0.33007, 1.00137, 0.38004, 1.01528, 0.45972, 0.98215, 0.5251],
1678
+ [0.98215, 0.5251, 0.98075, 0.52788, 0.97903, 0.53094, 0.97562, 0.53707],
1679
+ [0.97562, 0.53707, 0.97409, 0.53982, 0.97334, 0.54119, 0.97262, 0.54253],
1680
+ [0.97262, 0.54253, 0.9562, 0.57351, 0.95003, 0.60889, 0.955, 0.6436],
1681
+ [0.955, 0.6436, 0.95521, 0.64513, 0.95546, 0.64666, 0.95596, 0.64975],
1682
+ [0.95596, 0.64975, 0.95709, 0.65672, 0.95765, 0.66019, 0.95803, 0.66328],
1683
+ [0.95803, 0.66328, 0.96703, 0.73616, 0.927, 0.80622, 0.86003, 0.83478],
1684
+ [0.86003, 0.83478, 0.85718, 0.836, 0.8539, 0.83725, 0.8474, 0.83975],
1685
+ [0.8474, 0.83975, 0.8445, 0.84084, 0.84303, 0.84141, 0.84162, 0.84197],
1686
+ [0.84162, 0.84197, 0.80937, 0.855, 0.78212, 0.87812, 0.76381, 0.90794],
1687
+ [0.76381, 0.90794, 0.76303, 0.90925, 0.76225, 0.91059, 0.76065, 0.91328],
1688
+ [0.76065, 0.91328, 0.75709, 0.91934, 0.75531, 0.92237, 0.75362, 0.925],
1689
+ [0.75362, 0.925, 0.71415, 0.98665, 0.63894, 1.01434, 0.56944, 0.99272],
1690
+ [0.56944, 0.99272, 0.5665, 0.99181, 0.56319, 0.99065, 0.55662, 0.98831],
1691
+ [0.55662, 0.98831, 0.55369, 0.98728, 0.55222, 0.98675, 0.55078, 0.98628],
1692
+ [0.55078, 0.98628, 0.51782, 0.97531, 0.48218, 0.97531, 0.44922, 0.98628],
1693
+ [0.44922, 0.98628, 0.44778, 0.98675, 0.44631, 0.98728, 0.44338, 0.98831],
1694
+ [0.44338, 0.98831, 0.43681, 0.99065, 0.4335, 0.99181, 0.43056, 0.99272],
1695
+ [0.43056, 0.99272, 0.36106, 1.01434, 0.28585, 0.98665, 0.24638, 0.925],
1696
+ [0.24638, 0.925, 0.24469, 0.92237, 0.24291, 0.91934, 0.23935, 0.91328],
1697
+ [0.23935, 0.91328, 0.23775, 0.91059, 0.23697, 0.90925, 0.23619, 0.90794],
1698
+ [0.23619, 0.90794, 0.21788, 0.87812, 0.19063, 0.855, 0.15838, 0.84197],
1699
+ [0.15838, 0.84197, 0.15697, 0.84141, 0.1555, 0.84084, 0.1526, 0.83975],
1700
+ [0.1526, 0.83975, 0.1461, 0.83725, 0.14282, 0.836, 0.13997, 0.83478],
1701
+ [0.13997, 0.83478, 0.073, 0.80622, 0.03297, 0.73616, 0.04197, 0.66328],
1702
+ [0.04197, 0.66328, 0.04235, 0.66019, 0.04291, 0.65672, 0.04404, 0.64975],
1703
+ [0.04404, 0.64975, 0.04454, 0.64666, 0.04479, 0.64513, 0.045, 0.6436],
1704
+ [0.045, 0.6436, 0.04997, 0.60889, 0.0438, 0.57351, 0.02738, 0.54253],
1705
+ [0.02738, 0.54253, 0.02666, 0.54119, 0.02591, 0.53982, 0.02438, 0.53707],
1706
+ [0.02438, 0.53707, 0.02097, 0.53094, 0.01925, 0.52788, 0.01785, 0.5251],
1707
+ [0.01785, 0.5251, -0.01528, 0.45972, -137e-5, 0.38004, 0.05191, 0.33007],
1708
+ [0.05191, 0.33007, 0.05416, 0.32794, 0.05679, 0.32563, 0.06207, 0.32104],
1709
+ [0.06207, 0.32104, 0.06444, 0.319, 0.0656, 0.31797, 0.06675, 0.31694],
1710
+ [0.06675, 0.31694, 0.0927, 0.29347, 0.11049, 0.26234, 0.11753, 0.22807],
1711
+ [0.11753, 0.22807, 0.11785, 0.22657, 0.11813, 0.22504, 0.11869, 0.22194],
1712
+ [0.11869, 0.22194, 0.12, 0.21504, 0.12066, 0.21157, 0.12135, 0.20854],
1713
+ [0.12135, 0.20854, 0.13757, 0.13694, 0.19888, 0.08494, 0.2715, 0.08123],
1714
+ [0.2715, 0.08123, 0.27456, 0.08107, 0.27806, 0.08104, 0.28503, 0.08094],
1715
+ [0.28503, 0.08094, 0.28813, 0.08091, 0.28969, 0.08088, 0.29119, 0.08085],
1716
+ [0.29119, 0.08085, 0.32596, 0.07974, 0.35944, 0.06743, 0.38666, 0.04576],
1717
+ [0.38666, 0.04576, 0.38784, 0.04479, 0.38903, 0.04379, 0.39144, 0.04182]
1718
+ ]);
1719
+ var slantedShape = createShape([
1720
+ [0.04911, 0.28294, 0.05715, 0.20613, 0.06118, 0.16772, 0.07595, 0.13743],
1721
+ [0.07595, 0.13743, 0.09732, 0.09358, 0.13462, 0.05972, 0.18009, 0.04288],
1722
+ [0.18009, 0.04288, 0.21151, 0.03125, 0.24979, 0.03125, 0.32635, 0.03125],
1723
+ [0.32635, 0.03125, 0.45521, 0.03125, 0.58407, 0.03125, 0.71293, 0.03125],
1724
+ [0.71293, 0.03125, 0.80551, 0.03125, 0.85181, 0.03125, 0.88715, 0.04642],
1725
+ [0.88715, 0.04642, 0.93832, 0.06838, 0.97725, 0.11203, 0.99352, 0.16569],
1726
+ [0.99352, 0.16569, 1.00476, 0.20272, 0.9999, 0.24916, 0.99017, 0.34206],
1727
+ [0.99017, 0.34206, 0.97708, 0.46706, 0.96398, 0.59206, 0.95089, 0.71706],
1728
+ [0.95089, 0.71706, 0.94285, 0.79387, 0.93883, 0.83228, 0.92405, 0.86256],
1729
+ [0.92405, 0.86256, 0.90268, 0.90641, 0.86538, 0.94028, 0.81991, 0.95712],
1730
+ [0.81991, 0.95712, 0.78849, 0.96875, 0.75021, 0.96875, 0.67365, 0.96875],
1731
+ [0.67365, 0.96875, 0.54479, 0.96875, 0.41593, 0.96875, 0.28707, 0.96875],
1732
+ [0.28707, 0.96875, 0.19449, 0.96875, 0.14819, 0.96875, 0.11285, 0.95359],
1733
+ [0.11285, 0.95359, 0.06169, 0.93162, 0.02275, 0.88797, 648e-5, 0.83431],
1734
+ [648e-5, 0.83431, -476e-5, 0.79728, 1e-4, 0.75084, 983e-5, 0.65794],
1735
+ [983e-5, 0.65794, 0.02292, 0.53294, 0.03602, 0.40794, 0.04911, 0.28294]
1736
+ ]);
1737
+ var softBoomShape = createShape([
1738
+ [0.54668, 0.26546, 0.61712, -0.08849, 0.38296, -0.08849, 0.45337, 0.26546],
1739
+ [0.45337, 0.26546, 0.38296, -0.08849, 0.16664, 11e-4, 0.36715, 0.30118],
1740
+ [0.36715, 0.30118, 0.16664, 11e-4, 11e-4, 0.16665, 0.30118, 0.36715],
1741
+ [0.30118, 0.36715, 11e-4, 0.16665, -0.08849, 0.38296, 0.26546, 0.45334],
1742
+ [0.26546, 0.45334, -0.08849, 0.38293, -0.08849, 0.61706, 0.26546, 0.54665],
1743
+ [0.26546, 0.54665, -0.08849, 0.61706, 114e-5, 0.83334, 0.30118, 0.63284],
1744
+ [0.30118, 0.63284, 114e-5, 0.83334, 0.16668, 0.9989, 0.36715, 0.69881],
1745
+ [0.36715, 0.69881, 0.16664, 0.99884, 0.38296, 1.08843, 0.45334, 0.73452],
1746
+ [0.45334, 0.73452, 0.38293, 1.08849, 0.61706, 1.08849, 0.54665, 0.73452],
1747
+ [0.54665, 0.73452, 0.61706, 1.08849, 0.83334, 0.99884, 0.63284, 0.69881],
1748
+ [0.63284, 0.69881, 0.83334, 0.99884, 0.9989, 0.83331, 0.69881, 0.63284],
1749
+ [0.69881, 0.63284, 0.99884, 0.83334, 1.08843, 0.61702, 0.73452, 0.54665],
1750
+ [0.73452, 0.54665, 1.08849, 0.61706, 1.08849, 0.38293, 0.73452, 0.45334],
1751
+ [0.73452, 0.45334, 1.08849, 0.38293, 0.99884, 0.16665, 0.69881, 0.36715],
1752
+ [0.69881, 0.36715, 0.99884, 0.16665, 0.83331, 11e-4, 0.63284, 0.30118],
1753
+ [0.63284, 0.30118, 0.83334, 114e-5, 0.61702, -0.08845, 0.54665, 0.26546],
1754
+ [0.54665, 0.26546, 0.54666, 0.26546, 0.54667, 0.26546, 0.54668, 0.26546]
1755
+ ]);
1756
+ var softBurstShape = createShape([
1757
+ [0.45359, 0.0247, 0.47494, -823e-5, 0.52506, -823e-5, 0.54641, 0.0247],
1758
+ [0.54641, 0.0247, 0.56348, 0.05101, 0.58055, 0.07733, 0.59763, 0.10364],
1759
+ [0.59763, 0.10364, 0.61166, 0.12529, 0.64, 0.1341, 0.66466, 0.12447],
1760
+ [0.66466, 0.12447, 0.69464, 0.11278, 0.72462, 0.10108, 0.7546, 0.08939],
1761
+ [0.7546, 0.08939, 0.79213, 0.07475, 0.83266, 0.10291, 0.82972, 0.14156],
1762
+ [0.82972, 0.14156, 0.82736, 0.17245, 0.82499, 0.20334, 0.82263, 0.23422],
1763
+ [0.82263, 0.23422, 0.82066, 0.25963, 0.83816, 0.28266, 0.86403, 0.28875],
1764
+ [0.86403, 0.28875, 0.89548, 0.29614, 0.92693, 0.30352, 0.95838, 0.31091],
1765
+ [0.95838, 0.31091, 0.99772, 0.32016, 1.01322, 0.36572, 0.98707, 0.39535],
1766
+ [0.98707, 0.39535, 0.96617, 0.41899, 0.94527, 0.44264, 0.92438, 0.46629],
1767
+ [0.92438, 0.46629, 0.90719, 0.48575, 0.90719, 0.51425, 0.92438, 0.53372],
1768
+ [0.92438, 0.53372, 0.94527, 0.55737, 0.96617, 0.58102, 0.98707, 0.60466],
1769
+ [0.98707, 0.60466, 1.01322, 0.63429, 0.99772, 0.67985, 0.95838, 0.6891],
1770
+ [0.95838, 0.6891, 0.92693, 0.69648, 0.89548, 0.70387, 0.86403, 0.71126],
1771
+ [0.86403, 0.71126, 0.83816, 0.71735, 0.82066, 0.74038, 0.82263, 0.76579],
1772
+ [0.82263, 0.76579, 0.82499, 0.79667, 0.82736, 0.82756, 0.82972, 0.85844],
1773
+ [0.82972, 0.85844, 0.83266, 0.8971, 0.79213, 0.92526, 0.7546, 0.91063],
1774
+ [0.7546, 0.91063, 0.72462, 0.89893, 0.69464, 0.88724, 0.66466, 0.87554],
1775
+ [0.66466, 0.87554, 0.64, 0.86591, 0.61166, 0.87473, 0.59763, 0.89638],
1776
+ [0.59763, 0.89638, 0.58055, 0.92269, 0.56348, 0.94901, 0.54641, 0.97532],
1777
+ [0.54641, 0.97532, 0.52506, 1.00823, 0.47494, 1.00823, 0.45359, 0.97532],
1778
+ [0.45359, 0.97532, 0.43652, 0.94901, 0.41945, 0.92269, 0.40237, 0.89638],
1779
+ [0.40237, 0.89638, 0.38834, 0.87473, 0.36, 0.86591, 0.33534, 0.87554],
1780
+ [0.33534, 0.87554, 0.30536, 0.88724, 0.27538, 0.89893, 0.2454, 0.91063],
1781
+ [0.2454, 0.91063, 0.20787, 0.92526, 0.16734, 0.8971, 0.17028, 0.85844],
1782
+ [0.17028, 0.85844, 0.17264, 0.82756, 0.17501, 0.79667, 0.17737, 0.76579],
1783
+ [0.17737, 0.76579, 0.17934, 0.74038, 0.16184, 0.71735, 0.13597, 0.71126],
1784
+ [0.13597, 0.71126, 0.10452, 0.70387, 0.07307, 0.69648, 0.04162, 0.6891],
1785
+ [0.04162, 0.6891, 228e-5, 0.67985, -0.01322, 0.63429, 0.01293, 0.60466],
1786
+ [0.01293, 0.60466, 0.03383, 0.58102, 0.05473, 0.55737, 0.07562, 0.53372],
1787
+ [0.07562, 0.53372, 0.09281, 0.51425, 0.09281, 0.48575, 0.07562, 0.46629],
1788
+ [0.07562, 0.46629, 0.05473, 0.44264, 0.03383, 0.41899, 0.01293, 0.39535],
1789
+ [0.01293, 0.39535, -0.01322, 0.36572, 228e-5, 0.32016, 0.04162, 0.31091],
1790
+ [0.04162, 0.31091, 0.07307, 0.30352, 0.10452, 0.29614, 0.13597, 0.28875],
1791
+ [0.13597, 0.28875, 0.16184, 0.28266, 0.17934, 0.25963, 0.17737, 0.23422],
1792
+ [0.17737, 0.23422, 0.17501, 0.20334, 0.17264, 0.17245, 0.17028, 0.14156],
1793
+ [0.17028, 0.14156, 0.16734, 0.10291, 0.20787, 0.07475, 0.2454, 0.08939],
1794
+ [0.2454, 0.08939, 0.27538, 0.10108, 0.30536, 0.11278, 0.33534, 0.12447],
1795
+ [0.33534, 0.12447, 0.36, 0.1341, 0.38834, 0.12529, 0.40237, 0.10364],
1796
+ [0.40237, 0.10364, 0.41945, 0.07733, 0.43652, 0.05101, 0.45359, 0.0247]
1797
+ ]);
1798
+ var squareShape = createShape([
1799
+ [1, 0.5375, 1, 0.67725, 1, 0.74712, 0.97806, 0.80253],
1800
+ [0.97806, 0.80253, 0.94628, 0.88278, 0.88278, 0.94628, 0.80253, 0.97806],
1801
+ [0.80253, 0.97806, 0.74713, 1, 0.67725, 1, 0.5375, 1],
1802
+ [0.5375, 1, 0.5125, 1, 0.4875, 1, 0.4625, 1],
1803
+ [0.4625, 1, 0.32275, 1, 0.25288, 1, 0.19747, 0.97806],
1804
+ [0.19747, 0.97806, 0.11722, 0.94628, 0.05372, 0.88278, 0.02194, 0.80253],
1805
+ [0.02194, 0.80253, 0, 0.74713, 0, 0.67725, 0, 0.5375],
1806
+ [0, 0.5375, 0, 0.5125, 0, 0.4875, 0, 0.4625],
1807
+ [0, 0.4625, 0, 0.32275, 0, 0.25288, 0.02194, 0.19747],
1808
+ [0.02194, 0.19747, 0.0537, 0.11723, 0.11723, 0.05371, 0.19747, 0.02194],
1809
+ [0.19747, 0.02194, 0.25288, 0, 0.32275, 0, 0.4625, 0],
1810
+ [0.4625, 0, 0.4875, 0, 0.5125, 0, 0.5375, 0],
1811
+ [0.5375, 0, 0.67725, 0, 0.74712, 0, 0.80253, 0.02194],
1812
+ [0.80253, 0.02194, 0.88277, 0.05371, 0.9463, 0.11723, 0.97806, 0.19747],
1813
+ [0.97806, 0.19747, 1, 0.25288, 1, 0.32275, 1, 0.4625],
1814
+ [1, 0.4625, 1, 0.4875, 1, 0.5125, 1, 0.5375]
1815
+ ]);
1816
+ var sunnyShape = createShape([
1817
+ [0.77016, 0.1213, 0.80126, 0.12342, 0.81681, 0.12448, 0.82938, 0.12995],
1818
+ [0.82938, 0.12995, 0.84756, 0.13791, 0.86208, 0.15244, 0.87004, 0.17062],
1819
+ [0.87004, 0.17062, 0.87554, 0.18318, 0.8766, 0.19874, 0.87871, 0.22983],
1820
+ [0.87871, 0.22983, 0.88031, 0.25348, 0.88192, 0.27714, 0.88353, 0.3008],
1821
+ [0.88353, 0.3008, 0.88439, 0.31338, 0.88481, 0.31968, 0.88618, 0.32568],
1822
+ [0.88618, 0.32568, 0.88816, 0.33436, 0.89159, 0.34264, 0.89633, 0.35018],
1823
+ [0.89633, 0.35018, 0.89961, 0.35541, 0.90376, 0.36015, 0.91204, 0.36965],
1824
+ [0.91204, 0.36965, 0.92764, 0.38751, 0.94323, 0.40537, 0.95882, 0.42324],
1825
+ [0.95882, 0.42324, 0.97932, 0.44674, 0.98957, 0.45847, 0.99457, 0.47124],
1826
+ [0.99457, 0.47124, 1.0018, 0.48973, 1.0018, 0.51027, 0.99457, 0.52876],
1827
+ [0.99457, 0.52876, 0.98957, 0.54153, 0.97932, 0.55326, 0.95882, 0.57676],
1828
+ [0.95882, 0.57676, 0.94323, 0.59463, 0.92764, 0.61249, 0.91204, 0.63035],
1829
+ [0.91204, 0.63035, 0.90376, 0.63985, 0.89961, 0.64459, 0.89633, 0.64982],
1830
+ [0.89633, 0.64982, 0.89159, 0.65736, 0.88816, 0.66564, 0.88618, 0.67432],
1831
+ [0.88618, 0.67432, 0.88481, 0.68032, 0.88439, 0.68662, 0.88353, 0.6992],
1832
+ [0.88353, 0.6992, 0.88192, 0.72286, 0.88031, 0.74652, 0.87871, 0.77017],
1833
+ [0.87871, 0.77017, 0.8766, 0.80126, 0.87554, 0.81682, 0.87004, 0.82938],
1834
+ [0.87004, 0.82938, 0.86208, 0.84756, 0.84756, 0.86209, 0.82938, 0.87005],
1835
+ [0.82938, 0.87005, 0.81681, 0.87552, 0.80126, 0.87658, 0.77016, 0.8787],
1836
+ [0.77016, 0.8787, 0.7465, 0.88031, 0.72285, 0.88192, 0.69919, 0.88352],
1837
+ [0.69919, 0.88352, 0.68661, 0.88438, 0.68032, 0.88482, 0.67431, 0.88617],
1838
+ [0.67431, 0.88617, 0.66563, 0.88815, 0.65735, 0.89158, 0.64981, 0.89632],
1839
+ [0.64981, 0.89632, 0.6446, 0.89961, 0.63985, 0.90376, 0.63035, 0.91205],
1840
+ [0.63035, 0.91205, 0.61248, 0.92764, 0.59462, 0.94323, 0.57675, 0.95882],
1841
+ [0.57675, 0.95882, 0.55327, 0.97932, 0.54153, 0.98955, 0.52875, 0.99455],
1842
+ [0.52875, 0.99455, 0.51027, 1.00182, 0.48973, 1.00182, 0.47125, 0.99455],
1843
+ [0.47125, 0.99455, 0.45847, 0.98955, 0.44673, 0.97932, 0.42325, 0.95882],
1844
+ [0.42325, 0.95882, 0.40538, 0.94323, 0.38752, 0.92764, 0.36965, 0.91205],
1845
+ [0.36965, 0.91205, 0.36015, 0.90376, 0.3554, 0.89961, 0.35019, 0.89632],
1846
+ [0.35019, 0.89632, 0.34265, 0.89158, 0.33437, 0.88815, 0.32569, 0.88617],
1847
+ [0.32569, 0.88617, 0.31968, 0.88482, 0.31339, 0.88438, 0.30081, 0.88352],
1848
+ [0.30081, 0.88352, 0.27715, 0.88192, 0.2535, 0.88031, 0.22984, 0.8787],
1849
+ [0.22984, 0.8787, 0.19874, 0.87658, 0.18319, 0.87552, 0.17062, 0.87005],
1850
+ [0.17062, 0.87005, 0.15244, 0.86209, 0.13792, 0.84756, 0.12996, 0.82938],
1851
+ [0.12996, 0.82938, 0.12446, 0.81682, 0.1234, 0.80126, 0.12129, 0.77017],
1852
+ [0.12129, 0.77017, 0.11968, 0.74652, 0.11807, 0.72286, 0.11647, 0.6992],
1853
+ [0.11647, 0.6992, 0.11561, 0.68662, 0.11519, 0.68032, 0.11382, 0.67432],
1854
+ [0.11382, 0.67432, 0.11185, 0.66564, 0.10841, 0.65736, 0.10367, 0.64982],
1855
+ [0.10367, 0.64982, 0.10039, 0.64459, 0.09624, 0.63985, 0.08796, 0.63035],
1856
+ [0.08796, 0.63035, 0.07236, 0.61249, 0.05677, 0.59463, 0.04118, 0.57676],
1857
+ [0.04118, 0.57676, 0.02068, 0.55326, 0.01043, 0.54153, 543e-5, 0.52876],
1858
+ [543e-5, 0.52876, -18e-4, 0.51027, -18e-4, 0.48973, 543e-5, 0.47124],
1859
+ [543e-5, 0.47124, 0.01043, 0.45847, 0.02068, 0.44674, 0.04118, 0.42324],
1860
+ [0.04118, 0.42324, 0.05677, 0.40537, 0.07236, 0.38751, 0.08796, 0.36965],
1861
+ [0.08796, 0.36965, 0.09624, 0.36015, 0.10039, 0.35541, 0.10367, 0.35018],
1862
+ [0.10367, 0.35018, 0.10841, 0.34264, 0.11184, 0.33436, 0.11382, 0.32568],
1863
+ [0.11382, 0.32568, 0.11519, 0.31968, 0.11561, 0.31338, 0.11647, 0.3008],
1864
+ [0.11647, 0.3008, 0.11808, 0.27714, 0.11969, 0.25348, 0.12129, 0.22983],
1865
+ [0.12129, 0.22983, 0.1234, 0.19874, 0.12446, 0.18318, 0.12996, 0.17062],
1866
+ [0.12996, 0.17062, 0.13792, 0.15244, 0.15244, 0.13791, 0.17062, 0.12995],
1867
+ [0.17062, 0.12995, 0.18319, 0.12448, 0.19874, 0.12342, 0.22984, 0.1213],
1868
+ [0.22984, 0.1213, 0.2535, 0.11969, 0.27716, 0.11808, 0.30081, 0.11648],
1869
+ [0.30081, 0.11648, 0.31339, 0.11562, 0.31968, 0.11518, 0.32569, 0.11383],
1870
+ [0.32569, 0.11383, 0.33437, 0.11185, 0.34266, 0.10842, 0.35019, 0.10368],
1871
+ [0.35019, 0.10368, 0.3554, 0.10039, 0.36015, 0.09624, 0.36965, 0.08795],
1872
+ [0.36965, 0.08795, 0.38752, 0.07236, 0.40538, 0.05677, 0.42325, 0.04118],
1873
+ [0.42325, 0.04118, 0.44673, 0.02068, 0.45847, 0.01045, 0.47125, 545e-5],
1874
+ [0.47125, 545e-5, 0.48973, -182e-5, 0.51027, -182e-5, 0.52875, 545e-5],
1875
+ [0.52875, 545e-5, 0.54153, 0.01045, 0.55327, 0.02068, 0.57675, 0.04118],
1876
+ [0.57675, 0.04118, 0.59462, 0.05677, 0.61248, 0.07236, 0.63035, 0.08795],
1877
+ [0.63035, 0.08795, 0.63985, 0.09624, 0.6446, 0.10039, 0.64981, 0.10368],
1878
+ [0.64981, 0.10368, 0.65735, 0.10842, 0.66563, 0.11185, 0.67431, 0.11383],
1879
+ [0.67431, 0.11383, 0.68032, 0.11518, 0.68661, 0.11562, 0.69919, 0.11648],
1880
+ [0.69919, 0.11648, 0.72285, 0.11808, 0.7465, 0.11969, 0.77016, 0.1213]
1881
+ ]);
1882
+ var triangleShape = createShape([
1883
+ [0.33058, 0.2095, 0.37847, 0.12601, 0.40242, 0.08427, 0.43146, 0.06665],
1884
+ [0.43146, 0.06665, 0.47358, 0.04108, 0.52643, 0.04108, 0.56854, 0.06665],
1885
+ [0.56854, 0.06665, 0.59758, 0.08427, 0.62153, 0.12601, 0.66943, 0.2095],
1886
+ [0.66943, 0.2095, 0.75568, 0.35983, 0.84194, 0.51017, 0.92819, 0.66051],
1887
+ [0.92819, 0.66051, 0.97563, 0.7432, 0.99935, 0.78452, 0.99998, 0.81829],
1888
+ [0.99998, 0.81829, 1.00088, 0.86728, 0.97451, 0.91273, 0.93153, 0.93626],
1889
+ [0.93153, 0.93626, 0.90188, 0.95253, 0.85417, 0.95253, 0.75877, 0.95253],
1890
+ [0.75877, 0.95253, 0.58626, 0.95253, 0.41375, 0.95253, 0.24124, 0.95253],
1891
+ [0.24124, 0.95253, 0.14583, 0.95253, 0.09812, 0.95253, 0.06847, 0.93626],
1892
+ [0.06847, 0.93626, 0.02548, 0.91274, -89e-5, 0.86729, 2e-5, 0.81829],
1893
+ [2e-5, 0.81829, 65e-5, 0.78452, 0.02437, 0.7432, 0.07181, 0.66051],
1894
+ [0.07181, 0.66051, 0.15807, 0.51017, 0.24432, 0.35983, 0.33058, 0.2095]
1895
+ ]);
1896
+ var verySunnyShape = createShape([
1897
+ [0.42725, 0.04123, 0.46018, -0.01374, 0.53981, -0.01374, 0.57275, 0.04123],
1898
+ [0.57275, 0.04123, 0.58508, 0.06182, 0.59741, 0.08241, 0.60974, 0.10301],
1899
+ [0.60974, 0.10301, 0.62896, 0.13504, 0.66687, 0.15076, 0.70309, 0.14166],
1900
+ [0.70309, 0.14166, 0.72638, 0.13583, 0.74967, 0.13, 0.77296, 0.12416],
1901
+ [0.77296, 0.12416, 0.83512, 0.1086, 0.8914, 0.16488, 0.87583, 0.22704],
1902
+ [0.87583, 0.22704, 0.87, 0.25033, 0.86417, 0.27362, 0.85833, 0.29691],
1903
+ [0.85833, 0.29691, 0.84924, 0.33313, 0.86496, 0.37103, 0.89699, 0.39025],
1904
+ [0.89699, 0.39025, 0.91758, 0.40258, 0.93818, 0.41492, 0.95877, 0.42725],
1905
+ [0.95877, 0.42725, 1.01374, 0.46019, 1.01374, 0.53981, 0.95877, 0.57275],
1906
+ [0.95877, 0.57275, 0.93818, 0.58508, 0.91758, 0.59742, 0.89699, 0.60975],
1907
+ [0.89699, 0.60975, 0.86496, 0.62897, 0.84924, 0.66687, 0.85833, 0.70309],
1908
+ [0.85833, 0.70309, 0.86417, 0.72638, 0.87, 0.74967, 0.87583, 0.77296],
1909
+ [0.87583, 0.77296, 0.8914, 0.83512, 0.83512, 0.8914, 0.77296, 0.87584],
1910
+ [0.77296, 0.87584, 0.74967, 0.87, 0.72638, 0.86417, 0.70309, 0.85834],
1911
+ [0.70309, 0.85834, 0.66687, 0.84924, 0.62896, 0.86496, 0.60974, 0.89699],
1912
+ [0.60974, 0.89699, 0.59741, 0.91759, 0.58508, 0.93818, 0.57275, 0.95877],
1913
+ [0.57275, 0.95877, 0.53981, 1.01374, 0.46018, 1.01374, 0.42725, 0.95877],
1914
+ [0.42725, 0.95877, 0.41491, 0.93818, 0.40258, 0.91759, 0.39025, 0.89699],
1915
+ [0.39025, 0.89699, 0.37103, 0.86496, 0.33312, 0.84924, 0.29691, 0.85834],
1916
+ [0.29691, 0.85834, 0.27361, 0.86417, 0.25031, 0.87, 0.22702, 0.87584],
1917
+ [0.22702, 0.87584, 0.16489, 0.8914, 0.10859, 0.83512, 0.12416, 0.77296],
1918
+ [0.12416, 0.77296, 0.12999, 0.74967, 0.13583, 0.72638, 0.14167, 0.70309],
1919
+ [0.14167, 0.70309, 0.15075, 0.66687, 0.13505, 0.62897, 0.103, 0.60975],
1920
+ [0.103, 0.60975, 0.08241, 0.59742, 0.06181, 0.58508, 0.04121, 0.57275],
1921
+ [0.04121, 0.57275, -0.01373, 0.53981, -0.01373, 0.46019, 0.04121, 0.42725],
1922
+ [0.04121, 0.42725, 0.06181, 0.41492, 0.08241, 0.40258, 0.103, 0.39025],
1923
+ [0.103, 0.39025, 0.13505, 0.37103, 0.15075, 0.33313, 0.14167, 0.29691],
1924
+ [0.14167, 0.29691, 0.13583, 0.27362, 0.12999, 0.25033, 0.12416, 0.22704],
1925
+ [0.12416, 0.22704, 0.10859, 0.16488, 0.16489, 0.1086, 0.22702, 0.12416],
1926
+ [0.22702, 0.12416, 0.25031, 0.13, 0.27361, 0.13583, 0.29691, 0.14166],
1927
+ [0.29691, 0.14166, 0.33312, 0.15076, 0.37103, 0.13504, 0.39025, 0.10301],
1928
+ [0.39025, 0.10301, 0.40258, 0.08241, 0.41491, 0.06182, 0.42725, 0.04123]
1929
+ ]);
1930
+ function reversePolygon(polygon) {
1931
+ const reversedFeatures = polygon.features.map((f) => {
1932
+ const reversedCubics = f.cubics.map((c) => c.reverse()).reverse();
1933
+ if (f.type === "corner") {
1934
+ return cornerFeature(reversedCubics, f.convex);
1935
+ } else {
1936
+ return edgeFeature(reversedCubics);
1937
+ }
1938
+ }).reverse();
1939
+ return RoundedPolygon.fromFeatures(
1940
+ reversedFeatures,
1941
+ polygon.centerX,
1942
+ polygon.centerY
1943
+ );
1944
+ }
1945
+ function rotate180(polygon) {
1946
+ return polygon.transformed((x, y) => [1 - x, 1 - y]);
1947
+ }
1948
+ function flipV(polygon) {
1949
+ const flipped = polygon.transformed((x, y) => [x, 1 - y]);
1950
+ return reversePolygon(flipped);
1951
+ }
1952
+ var MD3Shapes = {
1953
+ arch: flipV(archShape),
1954
+ arrow: flipV(arrowShape),
1955
+ boom: boomShape,
1956
+ bun: bunShape,
1957
+ burst: burstShape,
1958
+ circle: circleShape,
1959
+ clamshell: clamshellShape,
1960
+ diamond: diamondShape,
1961
+ fan: rotate180(fanShape),
1962
+ flower: flowerShape,
1963
+ gem: flipV(gemShape),
1964
+ ghostish: flipV(ghostishShape),
1965
+ heart: flipV(heartShape),
1966
+ clover4Leaf: clover4LeafShape,
1967
+ clover8Leaf: clover8LeafShape,
1968
+ oval: flipV(ovalShape),
1969
+ pentagon: flipV(pentagonShape),
1970
+ pill: flipV(pillShape),
1971
+ pixelCircle: pixelCircleShape,
1972
+ pixelTriangle: pixelTriangleShape,
1973
+ puffyDiamond: puffyDiamondShape,
1974
+ puffy: puffyShape,
1975
+ semiCircle: flipV(semiCircleShape),
1976
+ cookie12Sided: cookie12SidedShape,
1977
+ cookie4Sided: cookie4SidedShape,
1978
+ cookie6Sided: cookie6SidedShape,
1979
+ cookie7Sided: cookie7SidedShape,
1980
+ cookie9Sided: cookie9SidedShape,
1981
+ slanted: flipV(slantedShape),
1982
+ softBoom: softBoomShape,
1983
+ softBurst: softBurstShape,
1984
+ square: squareShape,
1985
+ sunny: sunnyShape,
1986
+ triangle: flipV(triangleShape),
1987
+ verySunny: verySunnyShape
1988
+ };
1989
+ function resolveShape(ref) {
1990
+ if (ref instanceof RoundedPolygon) return ref;
1991
+ const shape = MD3Shapes[ref];
1992
+ if (!shape) throw new Error(`Unknown shape: "${ref}"`);
1993
+ return shape;
1994
+ }
1995
+
1996
+ // src/shapes/catalog/shape-tokens.ts
1997
+ var MD3CornerRadius = {
1998
+ /** 0dp — Sharp corners */
1999
+ none: 0,
2000
+ /** 4dp */
2001
+ extraSmall: 4,
2002
+ /** 8dp */
2003
+ small: 8,
2004
+ /** 12dp */
2005
+ medium: 12,
2006
+ /** 16dp */
2007
+ large: 16,
2008
+ /** 20dp (new in M3 Expressive) */
2009
+ largeIncreased: 20,
2010
+ /** 28dp */
2011
+ extraLarge: 28,
2012
+ /** 32dp (new in M3 Expressive) */
2013
+ extraLargeIncreased: 32,
2014
+ /** 48dp (new in M3 Expressive) */
2015
+ extraExtraLarge: 48,
2016
+ /** 9999dp — Fully rounded (pill/circle) */
2017
+ full: 9999
2018
+ };
2019
+
2020
+ // src/shapes/catalog/shapes.ts
2021
+ function circle(numVertices = 8, radius = 1, centerX = 0, centerY = 0) {
2022
+ if (numVertices < 3) throw new Error("Circle must have at least 3 vertices");
2023
+ const theta = FLOAT_PI / numVertices;
2024
+ const polygonRadius = radius / Math.cos(theta);
2025
+ return RoundedPolygon.fromNumVertices(
2026
+ numVertices,
2027
+ polygonRadius,
2028
+ centerX,
2029
+ centerY,
2030
+ cornerRounding(radius)
2031
+ );
2032
+ }
2033
+ function rectangle(width = 2, height = 2, rounding = UNROUNDED, perVertexRounding, centerX = 0, centerY = 0) {
2034
+ const left = centerX - width / 2;
2035
+ const top = centerY - height / 2;
2036
+ const right = centerX + width / 2;
2037
+ const bottom = centerY + height / 2;
2038
+ return RoundedPolygon.fromVertices(
2039
+ [right, bottom, left, bottom, left, top, right, top],
2040
+ rounding,
2041
+ perVertexRounding,
2042
+ centerX,
2043
+ centerY
2044
+ );
2045
+ }
2046
+ function star(numVerticesPerRadius, radius = 1, innerRadius = 0.5, rounding = UNROUNDED, innerRounding, perVertexRounding, centerX = 0, centerY = 0) {
2047
+ if (radius <= 0 || innerRadius <= 0)
2048
+ throw new Error("Star radii must be greater than 0");
2049
+ if (innerRadius >= radius)
2050
+ throw new Error("innerRadius must be less than radius");
2051
+ let pvRounding = perVertexRounding;
2052
+ if (!pvRounding && innerRounding) {
2053
+ const resolvedInnerRounding = innerRounding;
2054
+ pvRounding = Array.from(
2055
+ { length: numVerticesPerRadius },
2056
+ (_, i) => i % 2 === 0 ? rounding : resolvedInnerRounding
2057
+ );
2058
+ pvRounding = [];
2059
+ for (let i = 0; i < numVerticesPerRadius; i++) {
2060
+ pvRounding.push(rounding, resolvedInnerRounding);
2061
+ }
2062
+ }
2063
+ const vertices = starVertices(
2064
+ numVerticesPerRadius,
2065
+ radius,
2066
+ innerRadius,
2067
+ centerX,
2068
+ centerY
2069
+ );
2070
+ return RoundedPolygon.fromVertices(
2071
+ vertices,
2072
+ rounding,
2073
+ pvRounding,
2074
+ centerX,
2075
+ centerY
2076
+ );
2077
+ }
2078
+ function pill(width = 2, height = 1, smoothing = 0, centerX = 0, centerY = 0) {
2079
+ if (width <= 0 || height <= 0)
2080
+ throw new Error("Pill must have positive width and height");
2081
+ const wHalf = width / 2;
2082
+ const hHalf = height / 2;
2083
+ const r = Math.min(wHalf, hHalf);
2084
+ return RoundedPolygon.fromVertices(
2085
+ [
2086
+ wHalf + centerX,
2087
+ hHalf + centerY,
2088
+ -wHalf + centerX,
2089
+ hHalf + centerY,
2090
+ -wHalf + centerX,
2091
+ -hHalf + centerY,
2092
+ wHalf + centerX,
2093
+ -hHalf + centerY
2094
+ ],
2095
+ cornerRounding(r, smoothing),
2096
+ void 0,
2097
+ centerX,
2098
+ centerY
2099
+ );
2100
+ }
2101
+ function pillStar(width = 2, height = 1, numVerticesPerRadius = 8, innerRadiusRatio = 0.5, rounding = UNROUNDED, innerRounding, perVertexRounding, vertexSpacing = 0.5, centerX = 0, centerY = 0) {
2102
+ if (innerRadiusRatio <= 0 || innerRadiusRatio >= 1) {
2103
+ throw new Error("innerRadiusRatio must be between 0 and 1 (exclusive)");
2104
+ }
2105
+ const vertices = pillStarVertices(
2106
+ width,
2107
+ height,
2108
+ numVerticesPerRadius,
2109
+ innerRadiusRatio,
2110
+ vertexSpacing,
2111
+ centerX,
2112
+ centerY
2113
+ );
2114
+ let pvRounding = perVertexRounding;
2115
+ if (!pvRounding && innerRounding) {
2116
+ const resolvedInnerRounding = innerRounding;
2117
+ pvRounding = [];
2118
+ for (let i = 0; i < numVerticesPerRadius * 2; i++) {
2119
+ pvRounding.push(i % 2 === 0 ? rounding : resolvedInnerRounding);
2120
+ }
2121
+ }
2122
+ return RoundedPolygon.fromVertices(
2123
+ vertices,
2124
+ rounding,
2125
+ pvRounding,
2126
+ centerX,
2127
+ centerY
2128
+ );
2129
+ }
2130
+ function starVertices(numVerticesPerRadius, radius, innerRadius, cx, cy) {
2131
+ const result = [];
2132
+ const total = numVerticesPerRadius * 2;
2133
+ for (let i = 0; i < total; i++) {
2134
+ const r = i % 2 === 0 ? radius : innerRadius;
2135
+ const angle = FLOAT_PI / numVerticesPerRadius * i;
2136
+ const [rx, ry] = radialToCartesian(r, angle);
2137
+ result.push(cx + rx, cy + ry);
2138
+ }
2139
+ return result;
2140
+ }
2141
+ function pillStarVertices(width, height, numVerticesPerRadius, innerRadiusRatio, vertexSpacing, cx, cy) {
2142
+ const wHalf = width / 2;
2143
+ const hHalf = height / 2;
2144
+ const r = Math.min(wHalf, hHalf);
2145
+ const result = [];
2146
+ const total = numVerticesPerRadius * 2;
2147
+ for (let i = 0; i < total; i++) {
2148
+ const angle = FLOAT_PI / numVerticesPerRadius * i;
2149
+ const isOuter = i % 2 === 0;
2150
+ const cos = Math.cos(angle), sin = Math.sin(angle);
2151
+ const baseR = isOuter ? r : r * innerRadiusRatio;
2152
+ const rx = cos * wHalf;
2153
+ const ry = sin * hHalf;
2154
+ const pillR = distance(rx, ry);
2155
+ const finalR = baseR * vertexSpacing + pillR * (1 - vertexSpacing);
2156
+ result.push(cx + cos * finalR, cy + sin * finalR);
2157
+ }
2158
+ return result;
2159
+ }
2160
+
2161
+ // src/shapes/morph/float-mapping.ts
2162
+ function mapSegments(value, segments) {
2163
+ for (const seg of segments) {
2164
+ if (value <= seg.fromEnd) {
2165
+ if (seg.fromEnd === seg.fromStart) return seg.toStart;
2166
+ const t = (value - seg.fromStart) / (seg.fromEnd - seg.fromStart);
2167
+ return interpolate(seg.toStart, seg.toEnd, t);
2168
+ }
2169
+ }
2170
+ const last = segments[segments.length - 1];
2171
+ return last.toEnd;
2172
+ }
2173
+ function createDoubleMapper(fromValues, toValues) {
2174
+ if (fromValues.length !== toValues.length || fromValues.length === 0) {
2175
+ return { map: (v) => v, mapBack: (v) => v };
2176
+ }
2177
+ const n = fromValues.length;
2178
+ const forwardSegs = [];
2179
+ for (let i = 0; i < n; i++) {
2180
+ const next = (i + 1) % n;
2181
+ const fromStart = fromValues[i];
2182
+ let fromEnd = fromValues[next];
2183
+ const toStart = toValues[i];
2184
+ let toEnd = toValues[next];
2185
+ if (fromEnd < fromStart) fromEnd += 1;
2186
+ if (toEnd < toStart) toEnd += 1;
2187
+ forwardSegs.push({ fromStart, fromEnd, toStart, toEnd });
2188
+ }
2189
+ const reverseSegs = [];
2190
+ for (const seg of forwardSegs) {
2191
+ reverseSegs.push({
2192
+ fromStart: seg.toStart,
2193
+ fromEnd: seg.toEnd,
2194
+ toStart: seg.fromStart,
2195
+ toEnd: seg.fromEnd
2196
+ });
2197
+ }
2198
+ reverseSegs.sort((a, b) => a.fromStart - b.fromStart);
2199
+ return {
2200
+ map: (v) => positiveModulo(mapSegments(positiveModulo(v, 1), forwardSegs), 1),
2201
+ mapBack: (v) => positiveModulo(mapSegments(positiveModulo(v, 1), reverseSegs), 1)
2202
+ };
2203
+ }
2204
+
2205
+ // src/shapes/morph/feature-mapping.ts
2206
+ function featureMapper(features1, features2) {
2207
+ const convex1 = features1.filter((f) => f.convex);
2208
+ const convex2 = features2.filter((f) => f.convex);
2209
+ if (convex1.length === 0 || convex2.length === 0) {
2210
+ return createDoubleMapper([], []);
2211
+ }
2212
+ const fromValues = [];
2213
+ const toValues = [];
2214
+ for (const f1 of convex1) {
2215
+ let bestDist = Number.MAX_VALUE;
2216
+ let bestProgress = 0;
2217
+ for (const f2 of convex2) {
2218
+ const diff = Math.abs(f1.progress - f2.progress);
2219
+ const dist = Math.min(diff, 1 - diff);
2220
+ if (dist < bestDist) {
2221
+ bestDist = dist;
2222
+ bestProgress = f2.progress;
2223
+ }
2224
+ }
2225
+ fromValues.push(f1.progress);
2226
+ toValues.push(bestProgress);
2227
+ }
2228
+ return createDoubleMapper(fromValues, toValues);
2229
+ }
2230
+
2231
+ // src/shapes/morph/polygon-measure.ts
2232
+ var MeasuredPolygon = class _MeasuredPolygon {
2233
+ constructor(measuredCubics, features) {
2234
+ this.measuredCubics = measuredCubics;
2235
+ this.features = features;
2236
+ }
2237
+ get size() {
2238
+ return this.measuredCubics.length;
2239
+ }
2240
+ getOrNull(index) {
2241
+ return index >= 0 && index < this.measuredCubics.length ? this.measuredCubics[index] : null;
2242
+ }
2243
+ /**
2244
+ * Cuts the polygon at cutPoint and rotates so that cutPoint becomes progress=0.
2245
+ * Returns a new MeasuredPolygon with adjusted progress values.
2246
+ * @param cutPoint - Progress value [0, 1] at which to cut
2247
+ */
2248
+ cutAndShift(cutPoint) {
2249
+ if (cutPoint <= 0 || cutPoint >= 1) return this;
2250
+ const result = [];
2251
+ let cutCubicIdx = -1;
2252
+ for (let i = 0; i < this.measuredCubics.length; i++) {
2253
+ if (this.measuredCubics[i].endOutlineProgress >= cutPoint) {
2254
+ cutCubicIdx = i;
2255
+ break;
2256
+ }
2257
+ }
2258
+ if (cutCubicIdx === -1) cutCubicIdx = this.measuredCubics.length - 1;
2259
+ const cutCubic = this.measuredCubics[cutCubicIdx];
2260
+ const segLen = cutCubic.endOutlineProgress - cutCubic.startOutlineProgress;
2261
+ const t = segLen > 0 ? (cutPoint - cutCubic.startOutlineProgress) / segLen : 0;
2262
+ const [left, right] = cutCubic.cubic.split(t);
2263
+ const shift = (p) => {
2264
+ let s = p - cutPoint;
2265
+ if (s < 0) s += 1;
2266
+ return s;
2267
+ };
2268
+ if (!right.zeroLength()) {
2269
+ result.push({
2270
+ cubic: right,
2271
+ startOutlineProgress: 0,
2272
+ endOutlineProgress: shift(cutCubic.endOutlineProgress)
2273
+ });
2274
+ }
2275
+ for (let i = 1; i < this.measuredCubics.length; i++) {
2276
+ const idx = (cutCubicIdx + i) % this.measuredCubics.length;
2277
+ const mc = this.measuredCubics[idx];
2278
+ if (!mc.cubic.zeroLength()) {
2279
+ result.push({
2280
+ cubic: mc.cubic,
2281
+ startOutlineProgress: shift(mc.startOutlineProgress),
2282
+ endOutlineProgress: shift(mc.endOutlineProgress)
2283
+ });
2284
+ }
2285
+ }
2286
+ if (!left.zeroLength()) {
2287
+ result.push({
2288
+ cubic: left,
2289
+ startOutlineProgress: shift(cutCubic.startOutlineProgress),
2290
+ endOutlineProgress: 1
2291
+ });
2292
+ }
2293
+ return new _MeasuredPolygon(result, this.features);
2294
+ }
2295
+ /**
2296
+ * Cuts a MeasuredCubic at a given outline progress, returning [segment, rest].
2297
+ */
2298
+ cutAtProgress(measuredCubic, progress) {
2299
+ const segLen = measuredCubic.endOutlineProgress - measuredCubic.startOutlineProgress;
2300
+ const t = segLen > 0 ? (progress - measuredCubic.startOutlineProgress) / segLen : 0;
2301
+ const [left, right] = measuredCubic.cubic.split(
2302
+ Math.max(0, Math.min(1, t))
2303
+ );
2304
+ return [
2305
+ {
2306
+ cubic: left,
2307
+ startOutlineProgress: measuredCubic.startOutlineProgress,
2308
+ endOutlineProgress: progress
2309
+ },
2310
+ {
2311
+ cubic: right,
2312
+ startOutlineProgress: progress,
2313
+ endOutlineProgress: measuredCubic.endOutlineProgress
2314
+ }
2315
+ ];
2316
+ }
2317
+ /**
2318
+ * Measures a RoundedPolygon's outline by arc length.
2319
+ * Returns a MeasuredPolygon with normalized progress in [0, 1].
2320
+ */
2321
+ static measurePolygon(polygon) {
2322
+ const cubics = polygon.cubics;
2323
+ let totalLength = 0;
2324
+ const lengths = cubics.map((c) => {
2325
+ const len = approximateLength(c);
2326
+ totalLength += len;
2327
+ return len;
2328
+ });
2329
+ if (totalLength === 0) {
2330
+ return new _MeasuredPolygon(
2331
+ cubics.map((c) => ({
2332
+ cubic: c,
2333
+ startOutlineProgress: 0,
2334
+ endOutlineProgress: 0
2335
+ })),
2336
+ []
2337
+ );
2338
+ }
2339
+ const measured = [];
2340
+ let accumulated = 0;
2341
+ for (let i = 0; i < cubics.length; i++) {
2342
+ const startP = accumulated / totalLength;
2343
+ accumulated += lengths[i];
2344
+ const endP = accumulated / totalLength;
2345
+ measured.push({
2346
+ cubic: cubics[i],
2347
+ startOutlineProgress: startP,
2348
+ endOutlineProgress: endP
2349
+ });
2350
+ }
2351
+ const featureList = [];
2352
+ let cubicIdx = 0;
2353
+ for (const feature of polygon.features) {
2354
+ if (feature.type === "corner" && feature.cubics.length > 0) {
2355
+ const middleCubicIdx = feature.cubics.length > 1 ? 1 : 0;
2356
+ const mc = measured[Math.min(cubicIdx + middleCubicIdx, measured.length - 1)];
2357
+ if (mc) {
2358
+ const midProgress = (mc.startOutlineProgress + mc.endOutlineProgress) / 2;
2359
+ featureList.push({ progress: midProgress, convex: feature.convex });
2360
+ }
2361
+ }
2362
+ cubicIdx += feature.cubics.length;
2363
+ }
2364
+ return new _MeasuredPolygon(measured, featureList);
2365
+ }
2366
+ };
2367
+ function approximateLength(cubic) {
2368
+ let len = 0;
2369
+ let prevX = cubic.anchor0X, prevY = cubic.anchor0Y;
2370
+ const steps = 4;
2371
+ for (let i = 1; i <= steps; i++) {
2372
+ const p = cubic.pointOnCurve(i / steps);
2373
+ len += distance(p.x - prevX, p.y - prevY);
2374
+ prevX = p.x;
2375
+ prevY = p.y;
2376
+ }
2377
+ return len;
2378
+ }
2379
+
2380
+ // src/shapes/morph/morph.ts
2381
+ var Morph = class _Morph {
2382
+ /**
2383
+ * Creates a Morph between two shapes.
2384
+ * @param start - Starting shape
2385
+ * @param end - Ending shape
2386
+ */
2387
+ constructor(start, end) {
2388
+ this.start = start;
2389
+ this.end = end;
2390
+ this.morphMatch = _Morph.match(start, end);
2391
+ }
2392
+ /**
2393
+ * Returns the interpolated shape at the given progress as a list of Cubics.
2394
+ *
2395
+ * Note: This allocates a new list. For performance-critical animation loops,
2396
+ * use {@link forEachCubic} instead.
2397
+ *
2398
+ * @param progress - Value in [0, 1]. 0 = start shape, 1 = end shape.
2399
+ * Values outside [0, 1] produce exaggerated shapes (useful for bounce/overshoot).
2400
+ * @returns List of interpolated Cubic curves forming the morphed shape
2401
+ */
2402
+ asCubics(progress) {
2403
+ const result = [];
2404
+ for (const [c1, c2] of this.morphMatch) {
2405
+ result.push(
2406
+ new Cubic(
2407
+ c1.points.map((v, i) => interpolate(v, c2.points[i], progress))
2408
+ )
2409
+ );
2410
+ }
2411
+ return result;
2412
+ }
2413
+ /**
2414
+ * Iterates over the morphed cubics without allocating new Cubic instances.
2415
+ * Reuses a single MutableCubic for each callback invocation.
2416
+ *
2417
+ * @param progress - Value in [0, 1]
2418
+ * @param callback - Called for each interpolated cubic
2419
+ *
2420
+ * @example
2421
+ * const mutable = new MutableCubic();
2422
+ * morph.forEachCubic(progress, mutable, (c) => {
2423
+ * path.bezierCurveTo(c.control0X, c.control0Y, c.control1X, c.control1Y, c.anchor1X, c.anchor1Y);
2424
+ * });
2425
+ */
2426
+ forEachCubic(progress, mutableOrCallback, callback) {
2427
+ let mutable;
2428
+ let cb;
2429
+ if (typeof mutableOrCallback === "function") {
2430
+ mutable = new MutableCubic();
2431
+ cb = mutableOrCallback;
2432
+ } else {
2433
+ mutable = mutableOrCallback;
2434
+ if (!callback) {
2435
+ throw new Error(
2436
+ "Callback must be provided when passing a mutable cubic"
2437
+ );
2438
+ }
2439
+ cb = callback;
2440
+ }
2441
+ for (const [c1, c2] of this.morphMatch) {
2442
+ mutable.interpolate(c1, c2, progress);
2443
+ cb(mutable);
2444
+ }
2445
+ }
2446
+ /**
2447
+ * Calculates the axis-aligned bounding box of the morph (union of start + end bounds).
2448
+ * @param approximate - Use faster approximate bounds (default: true)
2449
+ */
2450
+ calculateBounds(approximate = true) {
2451
+ const [s0, s1, s2, s3] = this.start.calculateBounds(approximate);
2452
+ const [e0, e1, e2, e3] = this.end.calculateBounds(approximate);
2453
+ return [
2454
+ Math.min(s0, e0),
2455
+ Math.min(s1, e1),
2456
+ Math.max(s2, e2),
2457
+ Math.max(s3, e3)
2458
+ ];
2459
+ }
2460
+ /**
2461
+ * Calculates the max bounding square (union of start + end max bounds).
2462
+ */
2463
+ calculateMaxBounds() {
2464
+ const [s0, s1, s2, s3] = this.start.calculateMaxBounds();
2465
+ const [e0, e1, e2, e3] = this.end.calculateMaxBounds();
2466
+ return [
2467
+ Math.min(s0, e0),
2468
+ Math.min(s1, e1),
2469
+ Math.max(s2, e2),
2470
+ Math.max(s3, e3)
2471
+ ];
2472
+ }
2473
+ // ─── Internal: matching algorithm ──────────────────────────────────────
2474
+ /**
2475
+ * Matches cubic curves between two polygons.
2476
+ *
2477
+ * Algorithm:
2478
+ * 1. Measure both polygons (arc-length normalized progress)
2479
+ * 2. Use featureMapper to determine correspondence between features
2480
+ * 3. Cut and shift polygon2 so both start at the same logical point
2481
+ * 4. Walk both lists together, splitting curves when one extends past the other
2482
+ *
2483
+ * @internal
2484
+ */
2485
+ static match(p1, p2) {
2486
+ const measured1 = MeasuredPolygon.measurePolygon(p1);
2487
+ const measured2 = MeasuredPolygon.measurePolygon(p2);
2488
+ const doubleMapper = featureMapper(measured1.features, measured2.features);
2489
+ const polygon2CutPoint = doubleMapper.map(0);
2490
+ const bs1 = measured1;
2491
+ const bs2 = measured2.cutAndShift(polygon2CutPoint);
2492
+ const result = [];
2493
+ let i1 = 0, i2 = 0;
2494
+ let b1 = bs1.getOrNull(i1++);
2495
+ let b2 = bs2.getOrNull(i2++);
2496
+ while (b1 !== null && b2 !== null) {
2497
+ const b1a = i1 >= bs1.size ? 1 : b1.endOutlineProgress;
2498
+ const b2aRaw = i2 >= bs2.size ? 1 : positiveModulo(b2.endOutlineProgress + polygon2CutPoint, 1);
2499
+ const b2a = doubleMapper.mapBack(b2aRaw);
2500
+ const minb = Math.min(b1a, b2a);
2501
+ let seg1 = b1, newb1 = bs1.getOrNull(i1);
2502
+ let seg2 = b2, newb2 = bs2.getOrNull(i2);
2503
+ if (b1a > minb + ANGLE_EPSILON) {
2504
+ const [cut, rest] = bs1.cutAtProgress(b1, minb);
2505
+ seg1 = cut;
2506
+ newb1 = rest;
2507
+ } else {
2508
+ i1++;
2509
+ }
2510
+ if (b2a > minb + ANGLE_EPSILON) {
2511
+ const targetProgress = positiveModulo(
2512
+ doubleMapper.map(minb) - polygon2CutPoint,
2513
+ 1
2514
+ );
2515
+ const [cut, rest] = bs2.cutAtProgress(b2, targetProgress);
2516
+ seg2 = cut;
2517
+ newb2 = rest;
2518
+ } else {
2519
+ i2++;
2520
+ }
2521
+ result.push([seg1.cubic, seg2.cubic]);
2522
+ b1 = newb1;
2523
+ b2 = newb2;
2524
+ }
2525
+ return result;
2526
+ }
2527
+ };
2528
+
2529
+ // src/shapes/render/shape-rendering.ts
2530
+ function toSvgPath(cubics, width = 1, height = 1) {
2531
+ if (cubics.length === 0) return "";
2532
+ const paddingX = width * 0.015;
2533
+ const paddingY = height * 0.015;
2534
+ const sx = width - 2 * paddingX;
2535
+ const sy = height - 2 * paddingY;
2536
+ const flipY = (y) => paddingY + sy * (1 - y);
2537
+ const parts = [
2538
+ `M ${fmt(paddingX + cubics[0].anchor0X * sx)} ${fmt(flipY(cubics[0].anchor0Y))}`
2539
+ ];
2540
+ for (const c of cubics) {
2541
+ parts.push(
2542
+ `C ${fmt(paddingX + c.control0X * sx)} ${fmt(flipY(c.control0Y))},${fmt(paddingX + c.control1X * sx)} ${fmt(flipY(c.control1Y))},${fmt(paddingX + c.anchor1X * sx)} ${fmt(flipY(c.anchor1Y))}`
2543
+ );
2544
+ }
2545
+ parts.push("Z");
2546
+ return parts.join(" ");
2547
+ }
2548
+ function toClipPath(polygon, width, height) {
2549
+ const pathData = toSvgPath(polygon.cubics, width, height);
2550
+ return `path('${pathData}')`;
2551
+ }
2552
+ function interpolatePath(morph, progress, width, height) {
2553
+ const cubics = morph.asCubics(progress);
2554
+ return toClipPath({ cubics }, width, height);
2555
+ }
2556
+ function fmt(v) {
2557
+ return Number(v.toFixed(4)).toString();
2558
+ }
2559
+ function prefersReducedMotion() {
2560
+ if (typeof window === "undefined") return false;
2561
+ return window.matchMedia("(prefers-reduced-motion: reduce)").matches;
2562
+ }
2563
+ function useShapeMorph({
2564
+ shape,
2565
+ morphTo,
2566
+ morphOn = "hover",
2567
+ morphOptions,
2568
+ scrollProgress,
2569
+ width,
2570
+ height,
2571
+ disabled = false
2572
+ }) {
2573
+ var _a, _b;
2574
+ const duration = (_a = morphOptions == null ? void 0 : morphOptions.duration) != null ? _a : 0.3;
2575
+ const easing = (_b = morphOptions == null ? void 0 : morphOptions.easing) != null ? _b : "ease-in-out";
2576
+ const easingFunction = react.useMemo(() => getEasingFunction(easing), [easing]);
2577
+ const startShape = react.useMemo(() => resolveShape(shape), [shape]);
2578
+ const endShape = react.useMemo(
2579
+ () => morphTo ? resolveShape(morphTo) : null,
2580
+ [morphTo]
2581
+ );
2582
+ const morph = react.useMemo(
2583
+ () => endShape ? new Morph(startShape, endShape) : null,
2584
+ [startShape, endShape]
2585
+ );
2586
+ const [isActive, setIsActive] = react.useState(false);
2587
+ const [clipPath, setClipPath] = react.useState(
2588
+ () => toClipPath(startShape, width, height)
2589
+ );
2590
+ const animRef = react.useRef(null);
2591
+ const startTimeRef = react.useRef(0);
2592
+ const startProgressRef = react.useRef(0);
2593
+ const targetProgressRef = react.useRef(0);
2594
+ const currentProgressRef = react.useRef(0);
2595
+ react.useEffect(() => {
2596
+ if (morph) {
2597
+ setClipPath(
2598
+ interpolatePath(morph, currentProgressRef.current, width, height)
2599
+ );
2600
+ } else {
2601
+ setClipPath(toClipPath(startShape, width, height));
2602
+ }
2603
+ }, [width, height, startShape, morph]);
2604
+ react.useEffect(() => {
2605
+ if (morphOn !== "scroll" || !morph || scrollProgress === void 0) return;
2606
+ const p = Math.max(0, Math.min(1, scrollProgress));
2607
+ currentProgressRef.current = p;
2608
+ setClipPath(interpolatePath(morph, p, width, height));
2609
+ }, [scrollProgress, morphOn, morph, width, height]);
2610
+ const animate = react.useCallback(
2611
+ (timestamp) => {
2612
+ if (!morph) return;
2613
+ const elapsed = timestamp - startTimeRef.current;
2614
+ const durationMs = duration * 1e3;
2615
+ const rawT = Math.min(elapsed / durationMs, 1);
2616
+ const ease = easingFunction(rawT);
2617
+ const progress = startProgressRef.current + (targetProgressRef.current - startProgressRef.current) * ease;
2618
+ currentProgressRef.current = progress;
2619
+ setClipPath(interpolatePath(morph, progress, width, height));
2620
+ if (rawT < 1) {
2621
+ animRef.current = requestAnimationFrame(animate);
2622
+ } else {
2623
+ animRef.current = null;
2624
+ }
2625
+ },
2626
+ [morph, duration, easingFunction, width, height]
2627
+ );
2628
+ const startAnimation = react.useCallback(
2629
+ (toProgress) => {
2630
+ if (!morph) return;
2631
+ if (prefersReducedMotion()) {
2632
+ currentProgressRef.current = toProgress;
2633
+ setClipPath(interpolatePath(morph, toProgress, width, height));
2634
+ return;
2635
+ }
2636
+ if (animRef.current !== null) cancelAnimationFrame(animRef.current);
2637
+ startProgressRef.current = currentProgressRef.current;
2638
+ targetProgressRef.current = toProgress;
2639
+ startTimeRef.current = performance.now();
2640
+ animRef.current = requestAnimationFrame(animate);
2641
+ },
2642
+ [morph, animate, width, height]
2643
+ );
2644
+ react.useEffect(() => {
2645
+ return () => {
2646
+ if (animRef.current !== null) cancelAnimationFrame(animRef.current);
2647
+ };
2648
+ }, []);
2649
+ const activate = react.useCallback(() => {
2650
+ if (disabled || !morph) return;
2651
+ setIsActive(true);
2652
+ startAnimation(1);
2653
+ }, [disabled, morph, startAnimation]);
2654
+ const deactivate = react.useCallback(() => {
2655
+ if (disabled || !morph) return;
2656
+ setIsActive(false);
2657
+ startAnimation(0);
2658
+ }, [disabled, morph, startAnimation]);
2659
+ const setProgress = react.useCallback(
2660
+ (progress) => {
2661
+ if (!morph) return;
2662
+ const p = Math.max(0, Math.min(1, progress));
2663
+ currentProgressRef.current = p;
2664
+ setIsActive(p >= 0.5);
2665
+ setClipPath(interpolatePath(morph, p, width, height));
2666
+ },
2667
+ [morph, width, height]
2668
+ );
2669
+ const handlers = react.useMemo(() => {
2670
+ if (!morphTo || disabled) return {};
2671
+ if (morphOn === "hover") {
2672
+ return { onMouseEnter: activate, onMouseLeave: deactivate };
2673
+ }
2674
+ if (morphOn === "click") {
2675
+ return {
2676
+ onClick: () => {
2677
+ if (isActive) deactivate();
2678
+ else activate();
2679
+ }
2680
+ };
2681
+ }
2682
+ if (morphOn === "focus") {
2683
+ return { onFocus: activate, onBlur: deactivate };
2684
+ }
2685
+ return {};
2686
+ }, [morphTo, disabled, morphOn, activate, deactivate, isActive]);
2687
+ return { clipPath, isActive, activate, deactivate, setProgress, handlers };
2688
+ }
2689
+ function easeCubicInOut(t) {
2690
+ return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
2691
+ }
2692
+ function cubicBezier(x1, y1, x2, y2) {
2693
+ return (t) => {
2694
+ if (t === 0 || t === 1) return t;
2695
+ let tParam = t;
2696
+ for (let i = 0; i < 8; i++) {
2697
+ const x = 3 * (1 - tParam) ** 2 * tParam * x1 + 3 * (1 - tParam) * tParam ** 2 * x2 + tParam ** 3;
2698
+ const dx = 3 * (1 - tParam) ** 2 * x1 + 6 * (1 - tParam) * tParam * (x2 - x1) + 3 * tParam ** 2 * (1 - x2);
2699
+ if (Math.abs(dx) < 1e-6) break;
2700
+ tParam -= (x - t) / dx;
2701
+ }
2702
+ return 3 * (1 - tParam) ** 2 * tParam * y1 + 3 * (1 - tParam) * tParam ** 2 * y2 + tParam ** 3;
2703
+ };
2704
+ }
2705
+ function getEasingFunction(easing) {
2706
+ if (Array.isArray(easing)) {
2707
+ if (easing.length === 4) {
2708
+ const [x1, y1, x2, y2] = easing;
2709
+ return cubicBezier(x1, y1, x2, y2);
2710
+ }
2711
+ return easeCubicInOut;
2712
+ }
2713
+ switch (easing) {
2714
+ case "linear":
2715
+ return (t) => t;
2716
+ case "ease-in":
2717
+ return (t) => t * t * t;
2718
+ case "ease-out":
2719
+ return (t) => 1 - (1 - t) ** 3;
2720
+ default:
2721
+ return easeCubicInOut;
2722
+ }
2723
+ }
2724
+ function ShapeMedia({
2725
+ shape,
2726
+ morphTo,
2727
+ morphOn = "hover",
2728
+ morphOptions,
2729
+ scrollProgress,
2730
+ width: widthProp,
2731
+ height: heightProp,
2732
+ children,
2733
+ className,
2734
+ style,
2735
+ "aria-label": ariaLabel,
2736
+ role,
2737
+ disabled
2738
+ }) {
2739
+ const containerRef = react.useRef(null);
2740
+ const [measuredWidth, setMeasuredWidth] = react.useState(widthProp != null ? widthProp : 0);
2741
+ const [measuredHeight, setMeasuredHeight] = react.useState(heightProp != null ? heightProp : 0);
2742
+ const width = widthProp != null ? widthProp : measuredWidth;
2743
+ const height = heightProp != null ? heightProp : measuredHeight;
2744
+ react.useEffect(() => {
2745
+ if (widthProp !== void 0 && heightProp !== void 0) return;
2746
+ const el = containerRef.current;
2747
+ if (!el) return;
2748
+ const observer = new ResizeObserver(([entry]) => {
2749
+ const { width: w, height: h } = entry.contentRect;
2750
+ setMeasuredWidth(Math.round(w));
2751
+ setMeasuredHeight(Math.round(h));
2752
+ });
2753
+ observer.observe(el);
2754
+ return () => observer.disconnect();
2755
+ }, [widthProp, heightProp]);
2756
+ const { clipPath, handlers } = useShapeMorph({
2757
+ shape,
2758
+ morphTo,
2759
+ morphOn,
2760
+ morphOptions,
2761
+ scrollProgress,
2762
+ width: Math.max(width, 1),
2763
+ height: Math.max(height, 1),
2764
+ disabled
2765
+ });
2766
+ const resolvedRole = role != null ? role : ariaLabel ? "img" : "presentation";
2767
+ const accessibilityProps = ariaLabel ? { role: resolvedRole, "aria-label": ariaLabel } : { role: resolvedRole };
2768
+ const computedStyle = __spreadProps(__spreadValues({}, style), {
2769
+ clipPath,
2770
+ overflow: "hidden",
2771
+ position: "relative"
2772
+ });
2773
+ return /* @__PURE__ */ jsxRuntime.jsx(
2774
+ "div",
2775
+ __spreadProps(__spreadValues(__spreadValues({
2776
+ ref: containerRef,
2777
+ className,
2778
+ style: computedStyle
2779
+ }, accessibilityProps), handlers), {
2780
+ children
2781
+ })
2782
+ );
2783
+ }
2784
+ function ShapeIcon({
2785
+ shape,
2786
+ morphTo,
2787
+ size = 48,
2788
+ children,
2789
+ className,
2790
+ style,
2791
+ color,
2792
+ "aria-label": ariaLabel
2793
+ }) {
2794
+ const computedStyle = __spreadValues({
2795
+ width: size,
2796
+ height: size,
2797
+ display: "flex",
2798
+ alignItems: "center",
2799
+ justifyContent: "center",
2800
+ backgroundColor: color
2801
+ }, style);
2802
+ return /* @__PURE__ */ jsxRuntime.jsx(
2803
+ ShapeMedia,
2804
+ {
2805
+ shape,
2806
+ morphTo,
2807
+ morphOn: morphTo ? "hover" : "none",
2808
+ width: size,
2809
+ height: size,
2810
+ className,
2811
+ style: computedStyle,
2812
+ "aria-label": ariaLabel,
2813
+ children
2814
+ }
2815
+ );
2816
+ }
2817
+ function ShapeMediaServer({
2818
+ shape,
2819
+ width,
2820
+ height,
2821
+ children,
2822
+ className,
2823
+ style,
2824
+ "aria-label": ariaLabel,
2825
+ role
2826
+ }) {
2827
+ const polygon = resolveShape(shape);
2828
+ const clipPath = toClipPath(polygon, width, height);
2829
+ const resolvedRole = role != null ? role : ariaLabel ? "img" : "presentation";
2830
+ const accessibilityProps = ariaLabel ? { role: resolvedRole, "aria-label": ariaLabel } : { role: resolvedRole };
2831
+ const computedStyle = __spreadProps(__spreadValues({}, style), {
2832
+ clipPath,
2833
+ overflow: "hidden",
2834
+ position: "relative"
2835
+ });
2836
+ return /* @__PURE__ */ jsxRuntime.jsx("div", __spreadProps(__spreadValues({ className, style: computedStyle }, accessibilityProps), { children }));
2837
+ }
2838
+ function ShapeSvg({
2839
+ shape,
2840
+ morphTo,
2841
+ progress = 0,
2842
+ width = 100,
2843
+ height = 100,
2844
+ fill = "currentColor",
2845
+ stroke = "none",
2846
+ strokeWidth = 0,
2847
+ className,
2848
+ style,
2849
+ "aria-label": ariaLabel
2850
+ }) {
2851
+ const startPolygon = react.useMemo(() => resolveShape(shape), [shape]);
2852
+ const endPolygon = react.useMemo(
2853
+ () => morphTo ? resolveShape(morphTo) : null,
2854
+ [morphTo]
2855
+ );
2856
+ const morph = react.useMemo(
2857
+ () => endPolygon ? new Morph(startPolygon, endPolygon) : null,
2858
+ [startPolygon, endPolygon]
2859
+ );
2860
+ const pathData = react.useMemo(() => {
2861
+ const cubics = morph ? morph.asCubics(progress) : startPolygon.cubics;
2862
+ return toSvgPath(cubics, width, height);
2863
+ }, [morph, progress, startPolygon, width, height]);
2864
+ return /* @__PURE__ */ jsxRuntime.jsx(
2865
+ "svg",
2866
+ {
2867
+ xmlns: "http://www.w3.org/2000/svg",
2868
+ viewBox: `0 0 ${width} ${height}`,
2869
+ width,
2870
+ height,
2871
+ className,
2872
+ style,
2873
+ "aria-label": ariaLabel,
2874
+ role: ariaLabel ? "img" : "presentation",
2875
+ "aria-hidden": !ariaLabel,
2876
+ children: /* @__PURE__ */ jsxRuntime.jsx(
2877
+ "path",
2878
+ {
2879
+ d: pathData,
2880
+ fill,
2881
+ stroke,
2882
+ strokeWidth
2883
+ }
2884
+ )
2885
+ }
2886
+ );
2887
+ }
2888
+
2889
+ exports.ANGLE_EPSILON = ANGLE_EPSILON;
2890
+ exports.Cubic = Cubic;
2891
+ exports.DISTANCE_EPSILON = DISTANCE_EPSILON;
2892
+ exports.FLOAT_PI = FLOAT_PI;
2893
+ exports.MD3CornerRadius = MD3CornerRadius;
2894
+ exports.MD3Shapes = MD3Shapes;
2895
+ exports.MeasuredPolygon = MeasuredPolygon;
2896
+ exports.Morph = Morph;
2897
+ exports.MutableCubic = MutableCubic;
2898
+ exports.RoundedPolygon = RoundedPolygon;
2899
+ exports.ShapeIcon = ShapeIcon;
2900
+ exports.ShapeMedia = ShapeMedia;
2901
+ exports.ShapeMediaServer = ShapeMediaServer;
2902
+ exports.ShapeSvg = ShapeSvg;
2903
+ exports.UNROUNDED = UNROUNDED;
2904
+ exports.addPoints = addPoints;
2905
+ exports.circle = circle;
2906
+ exports.clockwise = clockwise;
2907
+ exports.convex = convex;
2908
+ exports.cornerFeature = cornerFeature;
2909
+ exports.cornerRounding = cornerRounding;
2910
+ exports.createDoubleMapper = createDoubleMapper;
2911
+ exports.directionVector = directionVector;
2912
+ exports.distance = distance;
2913
+ exports.distanceSquared = distanceSquared;
2914
+ exports.dividePoint = dividePoint;
2915
+ exports.dotProduct = dotProduct;
2916
+ exports.edgeFeature = edgeFeature;
2917
+ exports.featureMapper = featureMapper;
2918
+ exports.getDirection = getDirection;
2919
+ exports.getDistance = getDistance;
2920
+ exports.getDistanceSquared = getDistanceSquared;
2921
+ exports.interpolate = interpolate;
2922
+ exports.interpolatePath = interpolatePath;
2923
+ exports.lerpPoint = lerpPoint;
2924
+ exports.pill = pill;
2925
+ exports.pillStar = pillStar;
2926
+ exports.point = point;
2927
+ exports.positiveModulo = positiveModulo;
2928
+ exports.radialToCartesian = radialToCartesian;
2929
+ exports.rectangle = rectangle;
2930
+ exports.rotate90 = rotate90;
2931
+ exports.scalePoint = scalePoint;
2932
+ exports.square = square;
2933
+ exports.star = star;
2934
+ exports.subtractPoints = subtractPoints;
2935
+ exports.toClipPath = toClipPath;
2936
+ exports.toSvgPath = toSvgPath;
2937
+ exports.transformFeature = transformFeature;
2938
+ exports.transformPoint = transformPoint;
2939
+ exports.useShapeMorph = useShapeMorph;
2940
+ //# sourceMappingURL=shapes.js.map
2941
+ //# sourceMappingURL=shapes.js.map