pantograph2d 0.11.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{QuadraticBezier-B2g_Iyyl.js → QuadraticBezier-BeY2TXKH.js} +464 -433
- package/dist/QuadraticBezier-BeY2TXKH.js.map +1 -0
- package/dist/{QuadraticBezier-CuRsIP_D.cjs → QuadraticBezier-eSR75IzC.cjs} +9 -9
- package/dist/QuadraticBezier-eSR75IzC.cjs.map +1 -0
- package/dist/draw-BmJ8wIc9.cjs +2 -0
- package/dist/draw-BmJ8wIc9.cjs.map +1 -0
- package/dist/{draw-BJW5kfm9.js → draw-DzKVhurb.js} +94 -89
- package/dist/draw-DzKVhurb.js.map +1 -0
- package/dist/{models-DdZq-waE.js → models-BHeLX0dj.js} +544 -527
- package/dist/models-BHeLX0dj.js.map +1 -0
- package/dist/models-Fv9xfQBT.cjs +4 -0
- package/dist/models-Fv9xfQBT.cjs.map +1 -0
- package/dist/pantograph/drawShape.cjs +1 -1
- package/dist/pantograph/drawShape.js +2 -2
- package/dist/pantograph/models.cjs +1 -1
- package/dist/pantograph/models.js +2 -2
- package/dist/pantograph/svg.cjs +1 -1
- package/dist/pantograph/svg.js +1 -1
- package/dist/pantograph.cjs +2 -2
- package/dist/pantograph.cjs.map +1 -1
- package/dist/pantograph.js +83 -83
- package/dist/pantograph.js.map +1 -1
- package/dist/svg-BTO7h1ix.js +62 -0
- package/dist/svg-BTO7h1ix.js.map +1 -0
- package/dist/svg-b6SOnbda.cjs +8 -0
- package/dist/svg-b6SOnbda.cjs.map +1 -0
- package/dist/types/src/algorithms/offsets/offsetSegment.d.ts +1 -0
- package/dist/types/src/models/BoundingBox.d.ts +1 -0
- package/dist/types/src/models/Diagram.d.ts +1 -0
- package/dist/types/src/models/Figure.d.ts +1 -0
- package/dist/types/src/models/Loop.d.ts +1 -0
- package/dist/types/src/models/Strand.d.ts +5 -0
- package/dist/types/src/models/TransformationMatrix.d.ts +1 -0
- package/dist/types/src/models/segments/Arc.d.ts +1 -0
- package/dist/types/src/models/segments/CubicBezier.d.ts +1 -0
- package/dist/types/src/models/segments/EllipseArc.d.ts +1 -0
- package/dist/types/src/models/segments/Line.d.ts +2 -0
- package/dist/types/src/models/segments/QuadraticBezier.d.ts +1 -0
- package/dist/types/src/tesselationOperations.d.ts +4 -4
- package/package.json +2 -2
- package/dist/QuadraticBezier-B2g_Iyyl.js.map +0 -1
- package/dist/QuadraticBezier-CuRsIP_D.cjs.map +0 -1
- package/dist/draw-9Elv4xz6.cjs +0 -2
- package/dist/draw-9Elv4xz6.cjs.map +0 -1
- package/dist/draw-BJW5kfm9.js.map +0 -1
- package/dist/models-DdZq-waE.js.map +0 -1
- package/dist/models-LHGiMarC.cjs +0 -4
- package/dist/models-LHGiMarC.cjs.map +0 -1
- package/dist/svg-BzloQ9l1.cjs +0 -8
- package/dist/svg-BzloQ9l1.cjs.map +0 -1
- package/dist/svg-D8vwkQf7.js +0 -62
- package/dist/svg-D8vwkQf7.js.map +0 -1
package/dist/pantograph.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
var Ut = Object.defineProperty;
|
|
2
2
|
var Vt = (t, n, e) => n in t ? Ut(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
|
-
var
|
|
4
|
-
import { o as Ht, D as U, f as
|
|
5
|
-
import { a as oe, d as ce } from "./draw-
|
|
6
|
-
import { F as m, L as P, D as h, a as W, s as Kt, b as Nt, c as qt, i as Xt, S as b, l as Jt, p as Qt, d as Yt, e as
|
|
7
|
-
import { h as fe } from "./models-
|
|
8
|
-
import { l as Zt, z as Wt, m as jt, e as E, n as j, b as F, a as tn, s as nn, o as en, q as At, L as v, A as y, C as _, p as it, u as N, d as q, T as rn, g as A, E as vt, Q as bt, t as sn, c as on, D as Lt, v as Et, B as cn } from "./QuadraticBezier-
|
|
9
|
-
import { s as an, a as fn, b as un, c as ln, d as hn, w as ot } from "./svg-
|
|
3
|
+
var I = (t, n, e) => Vt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { o as Ht, D as U, f as It } from "./draw-DzKVhurb.js";
|
|
5
|
+
import { a as oe, d as ce } from "./draw-DzKVhurb.js";
|
|
6
|
+
import { F as m, L as P, D as h, a as W, s as Kt, b as Nt, c as qt, i as Xt, S as b, l as Jt, p as Qt, d as Yt, e as Mt, g as St } from "./models-BHeLX0dj.js";
|
|
7
|
+
import { h as fe } from "./models-BHeLX0dj.js";
|
|
8
|
+
import { l as Zt, z as Wt, m as jt, e as E, n as j, b as F, a as tn, s as nn, o as en, q as At, L as v, A as y, C as _, p as it, u as N, d as q, T as rn, g as A, E as vt, Q as bt, t as sn, c as on, D as Lt, v as Et, B as cn } from "./QuadraticBezier-BeY2TXKH.js";
|
|
9
|
+
import { s as an, a as fn, b as un, c as ln, d as hn, w as ot } from "./svg-BTO7h1ix.js";
|
|
10
10
|
function x(t) {
|
|
11
|
-
if (t
|
|
11
|
+
if (m.isInstance(t))
|
|
12
12
|
return [t];
|
|
13
|
-
if (t
|
|
13
|
+
if (P.isInstance(t))
|
|
14
14
|
return [new m(t)];
|
|
15
|
-
if (t
|
|
15
|
+
if (h.isInstance(t))
|
|
16
16
|
return t.figures;
|
|
17
17
|
throw new Error("Unknown shape");
|
|
18
18
|
}
|
|
@@ -99,9 +99,9 @@ function Xn(t, n) {
|
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
101
|
function Jn(t, n, e = !0) {
|
|
102
|
-
if (n
|
|
102
|
+
if (P.isInstance(n))
|
|
103
103
|
return tt(t, n, e);
|
|
104
|
-
if (n
|
|
104
|
+
if (m.isInstance(n))
|
|
105
105
|
return ct(t, n, e);
|
|
106
106
|
let r = [new b([...t.segments])];
|
|
107
107
|
return n.figures.forEach((s) => {
|
|
@@ -109,9 +109,9 @@ function Jn(t, n, e = !0) {
|
|
|
109
109
|
}), r;
|
|
110
110
|
}
|
|
111
111
|
function Qn(t, n, e = !1) {
|
|
112
|
-
if (n
|
|
112
|
+
if (P.isInstance(n))
|
|
113
113
|
return nt(t, n, e);
|
|
114
|
-
if (n
|
|
114
|
+
if (m.isInstance(n))
|
|
115
115
|
return at(t, n, e);
|
|
116
116
|
let r = [new b([...t.segments])];
|
|
117
117
|
return n.figures.forEach((s) => {
|
|
@@ -217,9 +217,9 @@ function wn(t, n, e) {
|
|
|
217
217
|
const r = Pn(t, n, e);
|
|
218
218
|
r < 0 ? t.splice(-(r + 1), 0, n) : t.splice(r, 0, n);
|
|
219
219
|
}
|
|
220
|
-
class
|
|
220
|
+
class In {
|
|
221
221
|
constructor() {
|
|
222
|
-
|
|
222
|
+
I(this, "buckets");
|
|
223
223
|
this.buckets = [];
|
|
224
224
|
}
|
|
225
225
|
addInterval(n) {
|
|
@@ -258,26 +258,26 @@ class Mn {
|
|
|
258
258
|
return n;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
class
|
|
261
|
+
class Mn {
|
|
262
262
|
constructor(n, e) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
263
|
+
I(this, "diagonal");
|
|
264
|
+
I(this, "diagonalBucketIndex");
|
|
265
|
+
I(this, "xLength");
|
|
266
|
+
I(this, "yLength");
|
|
267
|
+
I(this, "index");
|
|
268
268
|
this.x = n, this.y = e, this.xLength = Math.pow(3, -n), this.yLength = Math.pow(3, -e), this.diagonal = Math.sqrt(
|
|
269
269
|
this.xLength * this.xLength + this.yLength * this.yLength
|
|
270
270
|
), this.diagonalBucketIndex = n + e, this.index = `${n},${e}`;
|
|
271
271
|
}
|
|
272
272
|
}
|
|
273
|
-
class
|
|
273
|
+
class Sn {
|
|
274
274
|
constructor(n, e = 1e-8, r = 1e3, s = 1e-6) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this.fcn = n, this.endTolerance = e, this.maxIterations = r, this.epsilon = s, this.fcn = n, this.epsilon = s, this.endTolerance = e, this.maxIterations = r, this.rectangles = /* @__PURE__ */ new Map(), this.buckets = new
|
|
275
|
+
I(this, "rectangles");
|
|
276
|
+
I(this, "buckets");
|
|
277
|
+
I(this, "fMin");
|
|
278
|
+
I(this, "argMin");
|
|
279
|
+
I(this, "tol");
|
|
280
|
+
this.fcn = n, this.endTolerance = e, this.maxIterations = r, this.epsilon = s, this.fcn = n, this.epsilon = s, this.endTolerance = e, this.maxIterations = r, this.rectangles = /* @__PURE__ */ new Map(), this.buckets = new In();
|
|
281
281
|
const i = [0.5, 0.5], o = this.rect(0, 0), c = this.fcn(i);
|
|
282
282
|
this.buckets.addInterval(new O(i, c, o)), this.fMin = c, this.argMin = i, this.tol = o.diagonal;
|
|
283
283
|
}
|
|
@@ -286,7 +286,7 @@ class In {
|
|
|
286
286
|
}
|
|
287
287
|
rect(n, e) {
|
|
288
288
|
const r = `${n},${e}`;
|
|
289
|
-
return this.rectangles.has(r) || this.rectangles.set(r, new
|
|
289
|
+
return this.rectangles.has(r) || this.rectangles.set(r, new Mn(n, e)), this.rectangles.get(r);
|
|
290
290
|
}
|
|
291
291
|
splitInterval(n) {
|
|
292
292
|
let e, r, s;
|
|
@@ -332,7 +332,7 @@ class O {
|
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
function An(t, n = 1e-8, e = 1e3, r = 1e-6) {
|
|
335
|
-
return new
|
|
335
|
+
return new Sn(
|
|
336
336
|
t,
|
|
337
337
|
n,
|
|
338
338
|
e,
|
|
@@ -347,10 +347,10 @@ function vn(t, n, e = 1e-9) {
|
|
|
347
347
|
return Math.sqrt(r.fMin);
|
|
348
348
|
}
|
|
349
349
|
function bn(t, n) {
|
|
350
|
-
return t
|
|
350
|
+
return v.isInstance(t) && v.isInstance(n) ? pn(t, n) : v.isInstance(t) && y.isInstance(n) ? lt(t, n) : y.isInstance(t) && v.isInstance(n) ? lt(n, t) : y.isInstance(t) && y.isInstance(n) ? mn(t, n) : vn(t, n);
|
|
351
351
|
}
|
|
352
352
|
function xt(t) {
|
|
353
|
-
if (t
|
|
353
|
+
if (_.isInstance(t)) {
|
|
354
354
|
const s = F(t.lastPoint, t.firstPoint), i = F(t.firstControlPoint, t.firstPoint), o = F(t.lastControlPoint, t.firstPoint), c = N(s, i), f = N(s, o);
|
|
355
355
|
if (c > 0 && f < 0 || c < 0 && f > 0) return !1;
|
|
356
356
|
}
|
|
@@ -375,22 +375,22 @@ function Ln(t) {
|
|
|
375
375
|
(f, a) => t.firstAngle + a * r * i
|
|
376
376
|
);
|
|
377
377
|
return o.slice(0, -1).map((f, a) => [f, o[a + 1]]).map(([f, a]) => {
|
|
378
|
-
const u = Math.cos(f), g = Math.sin(f), p = Math.cos(a), d = Math.sin(a), [l,
|
|
378
|
+
const u = Math.cos(f), g = Math.sin(f), p = Math.cos(a), d = Math.sin(a), [l, M] = t.center, w = t.minorRadius, S = t.majorRadius, L = new rn().rotate(
|
|
379
379
|
t.tiltAngle,
|
|
380
380
|
t.center
|
|
381
|
-
), k = ($t) => L.transform($t), D = k([l +
|
|
382
|
-
l +
|
|
383
|
-
|
|
381
|
+
), k = ($t) => L.transform($t), D = k([l + S * u, M + w * g]), $ = k([
|
|
382
|
+
l + S * (u - s * g * i),
|
|
383
|
+
M + w * (g + s * u * i)
|
|
384
384
|
]), Gt = k([
|
|
385
|
-
l +
|
|
386
|
-
|
|
387
|
-
]), _t = k([l +
|
|
385
|
+
l + S * (p + s * d * i),
|
|
386
|
+
M + w * (d - s * p * i)
|
|
387
|
+
]), _t = k([l + S * p, M + w * d]);
|
|
388
388
|
return new _(D, _t, $, Gt);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
const et = 1e-8, yt = (t) => t.flatMap((n) => n
|
|
391
|
+
const et = 1e-8, yt = (t) => t.flatMap((n) => v.isInstance(n) ? [n] : y.isInstance(n) ? [n] : vt.isInstance(n) ? Ln(n).flatMap(
|
|
392
392
|
(e) => ht(e)
|
|
393
|
-
) : n
|
|
393
|
+
) : bt.isInstance(n) || _.isInstance(n) ? ht(n) : [new v(n.firstPoint, n.lastPoint)]);
|
|
394
394
|
function J(t, n, e = !0) {
|
|
395
395
|
const r = t.map((a) => ({
|
|
396
396
|
offset: Ht(a, n),
|
|
@@ -399,7 +399,7 @@ function J(t, n, e = !0) {
|
|
|
399
399
|
let i = e ? null : r.at(-1), o = e ? r.at(-1) : null;
|
|
400
400
|
if (s.length === 1) return s;
|
|
401
401
|
const c = (a) => {
|
|
402
|
-
i ? a.offset
|
|
402
|
+
i ? U.isInstance(a.offset) ? A(a.offset.firstPoint, a.offset.lastPoint) || s.push(
|
|
403
403
|
new v(a.offset.firstPoint, a.offset.lastPoint)
|
|
404
404
|
) : s.push(a.offset) : i = a;
|
|
405
405
|
}, f = function* () {
|
|
@@ -419,15 +419,15 @@ function J(t, n, e = !0) {
|
|
|
419
419
|
continue;
|
|
420
420
|
}
|
|
421
421
|
let p = [];
|
|
422
|
-
if (!(o.offset
|
|
423
|
-
const { intersections: w, overlaps:
|
|
422
|
+
if (!U.isInstance(o.offset) && !U.isInstance(a.offset)) {
|
|
423
|
+
const { intersections: w, overlaps: S } = W(
|
|
424
424
|
o.offset,
|
|
425
425
|
a.offset,
|
|
426
426
|
et / 100
|
|
427
427
|
);
|
|
428
428
|
p = [
|
|
429
429
|
...w,
|
|
430
|
-
...
|
|
430
|
+
...S.flatMap((L) => [L.firstPoint, L.lastPoint])
|
|
431
431
|
];
|
|
432
432
|
}
|
|
433
433
|
if (p.length > 0) {
|
|
@@ -438,12 +438,12 @@ function J(t, n, e = !0) {
|
|
|
438
438
|
);
|
|
439
439
|
w = p[D.indexOf(Math.min(...D))];
|
|
440
440
|
}
|
|
441
|
-
const
|
|
441
|
+
const S = o.offset.splitAt([
|
|
442
442
|
w
|
|
443
443
|
])[0], L = a.offset.splitAt([w]).at(-1);
|
|
444
444
|
if (!L) throw new Error("Bug in the splitting algo in offset");
|
|
445
445
|
c({
|
|
446
|
-
offset:
|
|
446
|
+
offset: S,
|
|
447
447
|
original: o.original
|
|
448
448
|
}), o = { offset: L, original: a.original };
|
|
449
449
|
continue;
|
|
@@ -451,8 +451,8 @@ function J(t, n, e = !0) {
|
|
|
451
451
|
const d = o.original.lastPoint, l = on(
|
|
452
452
|
F(g, d),
|
|
453
453
|
F(u, d)
|
|
454
|
-
) > 0,
|
|
455
|
-
c(o), s.push(
|
|
454
|
+
) > 0, M = new y(u, g, d, l);
|
|
455
|
+
c(o), s.push(M), o = a;
|
|
456
456
|
}
|
|
457
457
|
return o && c(o), s;
|
|
458
458
|
}
|
|
@@ -497,7 +497,7 @@ function G(t, n) {
|
|
|
497
497
|
s
|
|
498
498
|
), c = Ot(o, t, n);
|
|
499
499
|
if (!c.length) return new h();
|
|
500
|
-
const a =
|
|
500
|
+
const a = Mt(c).filter((u) => u.length > 1).filter((u) => A(u[0].firstPoint, u.at(-1).lastPoint)).map((u) => new P(u));
|
|
501
501
|
return a.length ? new h(a.map((u) => new m(u))) : new h();
|
|
502
502
|
}
|
|
503
503
|
function En(t, n, e = "round") {
|
|
@@ -507,11 +507,11 @@ function En(t, n, e = "round") {
|
|
|
507
507
|
!1
|
|
508
508
|
).map((l) => l.reverse());
|
|
509
509
|
o.reverse();
|
|
510
|
-
const c = (l,
|
|
510
|
+
const c = (l, M) => e === "round" ? sn(
|
|
511
511
|
l.lastPoint,
|
|
512
|
-
|
|
512
|
+
M.firstPoint,
|
|
513
513
|
l.tangentAtLastPoint
|
|
514
|
-
) : new v(l.lastPoint,
|
|
514
|
+
) : new v(l.lastPoint, M.firstPoint), f = [
|
|
515
515
|
...i,
|
|
516
516
|
c(
|
|
517
517
|
i[i.length - 1],
|
|
@@ -532,7 +532,7 @@ function En(t, n, e = "round") {
|
|
|
532
532
|
f
|
|
533
533
|
), g = Ot(u, t, r);
|
|
534
534
|
if (!g.length) return new h();
|
|
535
|
-
const d =
|
|
535
|
+
const d = Mt(g).filter((l) => l.length > 1).filter((l) => A(l[0].firstPoint, l.at(-1).lastPoint)).map((l) => new P(l));
|
|
536
536
|
return d.length ? new h(d.map((l) => new m(l))) : new h();
|
|
537
537
|
}
|
|
538
538
|
function kn(t, n) {
|
|
@@ -556,11 +556,11 @@ function Yn(t, n) {
|
|
|
556
556
|
return kn(x(t), n);
|
|
557
557
|
}
|
|
558
558
|
function Zn(t, n, { endCap: e = "round" } = {}) {
|
|
559
|
-
return t
|
|
559
|
+
return b.isInstance(t) ? En(t, n, e) : Fn(x(t), n);
|
|
560
560
|
}
|
|
561
561
|
class xn {
|
|
562
562
|
constructor() {
|
|
563
|
-
|
|
563
|
+
I(this, "filters");
|
|
564
564
|
this.filters = [];
|
|
565
565
|
}
|
|
566
566
|
delete() {
|
|
@@ -700,7 +700,7 @@ function Bt(t, n, e, r = () => !0) {
|
|
|
700
700
|
if (!f) throw new Error("Bug in the stroke filletting algo");
|
|
701
701
|
i(f, c);
|
|
702
702
|
}), !s.at(-1)) throw new Error("Bug in the stroke corner algo");
|
|
703
|
-
if (n
|
|
703
|
+
if (P.isInstance(n)) {
|
|
704
704
|
const c = s.pop(), f = s.shift();
|
|
705
705
|
if (!c || !f)
|
|
706
706
|
throw new Error("Bug in the filletting algo");
|
|
@@ -710,13 +710,13 @@ function Bt(t, n, e, r = () => !0) {
|
|
|
710
710
|
}
|
|
711
711
|
function R(t, n, e) {
|
|
712
712
|
const r = typeof e == "function" ? e(new C()) : e, s = r && r.asFilterFun();
|
|
713
|
-
if (t
|
|
714
|
-
return Bt(
|
|
715
|
-
if (t
|
|
713
|
+
if (P.isInstance(t) || b.isInstance(t))
|
|
714
|
+
return Bt(It, t, n, s);
|
|
715
|
+
if (m.isInstance(t)) {
|
|
716
716
|
const i = R(t.contour, n, r), o = t.holes.map((c) => R(c, n, r));
|
|
717
717
|
return new m(i, o, { ignoreChecks: !0 });
|
|
718
718
|
}
|
|
719
|
-
if (t
|
|
719
|
+
if (h.isInstance(t)) {
|
|
720
720
|
const i = t.figures.map((o) => R(o, n, r));
|
|
721
721
|
return new h(i, { ignoreChecks: !0 });
|
|
722
722
|
}
|
|
@@ -724,13 +724,13 @@ function R(t, n, e) {
|
|
|
724
724
|
}
|
|
725
725
|
function T(t, n, e) {
|
|
726
726
|
const r = typeof e == "function" ? e(new C()) : e, s = r && r.asFilterFun();
|
|
727
|
-
if (t
|
|
728
|
-
return Bt(
|
|
729
|
-
if (t
|
|
727
|
+
if (P.isInstance(t) || b.isInstance(t))
|
|
728
|
+
return Bt(It, t, n, s);
|
|
729
|
+
if (m.isInstance(t)) {
|
|
730
730
|
const i = T(t.contour, n, r), o = t.holes.map((c) => T(c, n, r));
|
|
731
731
|
return new m(i, o, { ignoreChecks: !0 });
|
|
732
732
|
}
|
|
733
|
-
if (t
|
|
733
|
+
if (h.isInstance(t)) {
|
|
734
734
|
const i = t.figures.map((o) => T(o, n, r));
|
|
735
735
|
return new h(i, { ignoreChecks: !0 });
|
|
736
736
|
}
|
|
@@ -759,10 +759,10 @@ function Q(t, n, e, r, s, i) {
|
|
|
759
759
|
const o = t.paramPoint(n), c = t.paramPoint(e), f = F(c, o), a = Et(f);
|
|
760
760
|
if (a <= t.precision || i >= r.maxDepth)
|
|
761
761
|
return [o, c];
|
|
762
|
-
const u = [f[0] / a, f[1] / a], g = (n + e) * 0.5, p = H(t, n, u, t.precision), d = H(t, g, u, t.precision), l = H(t, e, u, t.precision),
|
|
763
|
-
if (
|
|
762
|
+
const u = [f[0] / a, f[1] / a], g = (n + e) * 0.5, p = H(t, n, u, t.precision), d = H(t, g, u, t.precision), l = H(t, e, u, t.precision), M = q(p, d), w = q(d, l);
|
|
763
|
+
if (M >= s && w >= s)
|
|
764
764
|
return [o, c];
|
|
765
|
-
const
|
|
765
|
+
const S = t.paramPoint(g), L = M >= s ? [o, S] : Q(t, n, g, r, s, i + 1), k = w >= s ? [S, c] : Q(t, g, e, r, s, i + 1);
|
|
766
766
|
return [...L.slice(0, -1), ...k];
|
|
767
767
|
}
|
|
768
768
|
function rt(t, n = {}) {
|
|
@@ -793,15 +793,15 @@ function st(t, n) {
|
|
|
793
793
|
return t.flatMap(n);
|
|
794
794
|
}
|
|
795
795
|
function Rn(t, n) {
|
|
796
|
-
if (t
|
|
796
|
+
if (h.isInstance(t))
|
|
797
797
|
return On(t, n);
|
|
798
|
-
if (t
|
|
798
|
+
if (m.isInstance(t))
|
|
799
799
|
return Rt(t, n);
|
|
800
|
-
if (t
|
|
800
|
+
if (P.isInstance(t))
|
|
801
801
|
return Y(t, n);
|
|
802
|
-
if (t
|
|
802
|
+
if (b.isInstance(t))
|
|
803
803
|
return Bn(t, n);
|
|
804
|
-
if (
|
|
804
|
+
if (St(t))
|
|
805
805
|
return st([t], n);
|
|
806
806
|
throw new Error("Unsupported shape type");
|
|
807
807
|
}
|
|
@@ -841,9 +841,9 @@ function jn(t, n = {}) {
|
|
|
841
841
|
return Rn(t, (r) => zn(r, n));
|
|
842
842
|
}
|
|
843
843
|
function _n(t, n = {}) {
|
|
844
|
-
if (t
|
|
845
|
-
return t.figures.
|
|
846
|
-
if (t
|
|
844
|
+
if (h.isInstance(t))
|
|
845
|
+
return t.figures.flatMap((e) => _n(e, n));
|
|
846
|
+
if (m.isInstance(t)) {
|
|
847
847
|
const e = K(
|
|
848
848
|
B(t.contour.segments, n),
|
|
849
849
|
!1
|
|
@@ -852,18 +852,18 @@ function _n(t, n = {}) {
|
|
|
852
852
|
);
|
|
853
853
|
return [e, ...r];
|
|
854
854
|
}
|
|
855
|
-
return t
|
|
855
|
+
return P.isInstance(t) ? [K(B(t.segments, n), !1)] : b.isInstance(t) ? [B(t.segments, n)] : [rt(t, n)];
|
|
856
856
|
}
|
|
857
857
|
function pt(t) {
|
|
858
|
-
if (t
|
|
858
|
+
if (h.isInstance(t))
|
|
859
859
|
return an(t);
|
|
860
|
-
if (t
|
|
860
|
+
if (m.isInstance(t))
|
|
861
861
|
return fn(t);
|
|
862
|
-
if (t
|
|
862
|
+
if (P.isInstance(t))
|
|
863
863
|
return `<path d="${un(t)}" />`;
|
|
864
|
-
if (t
|
|
864
|
+
if (b.isInstance(t))
|
|
865
865
|
return `<path d="${ln(t)}" />`;
|
|
866
|
-
if (
|
|
866
|
+
if (St(t))
|
|
867
867
|
return `<path d="${`M ${t.firstPoint.join(" ")}`} ${hn(
|
|
868
868
|
t
|
|
869
869
|
)}" />`;
|