pantograph2d 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{QuadraticBezier-DxieHk9z.js → QuadraticBezier-B2g_Iyyl.js} +15 -14
- package/dist/{QuadraticBezier-DxieHk9z.js.map → QuadraticBezier-B2g_Iyyl.js.map} +1 -1
- package/dist/{QuadraticBezier--UZr_xcV.cjs → QuadraticBezier-CuRsIP_D.cjs} +4 -4
- package/dist/{QuadraticBezier--UZr_xcV.cjs.map → QuadraticBezier-CuRsIP_D.cjs.map} +1 -1
- package/dist/{draw-BUUNobTS.cjs → draw-9Elv4xz6.cjs} +2 -2
- package/dist/{draw-BUUNobTS.cjs.map → draw-9Elv4xz6.cjs.map} +1 -1
- package/dist/{draw-lOWnIN1o.js → draw-BJW5kfm9.js} +3 -3
- package/dist/{draw-lOWnIN1o.js.map → draw-BJW5kfm9.js.map} +1 -1
- package/dist/{models-DCkOI0hV.js → models-DdZq-waE.js} +2 -2
- package/dist/{models-DCkOI0hV.js.map → models-DdZq-waE.js.map} +1 -1
- package/dist/{models-CCo90hZc.cjs → models-LHGiMarC.cjs} +2 -2
- package/dist/{models-CCo90hZc.cjs.map → models-LHGiMarC.cjs.map} +1 -1
- package/dist/pantograph/drawShape.cjs +1 -1
- package/dist/pantograph/drawShape.cjs.map +1 -1
- package/dist/pantograph/drawShape.js +374 -14
- package/dist/pantograph/drawShape.js.map +1 -1
- 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 +674 -568
- package/dist/pantograph.js.map +1 -1
- package/dist/{svg-BY5h3CDD.cjs → svg-BzloQ9l1.cjs} +2 -2
- package/dist/{svg-BY5h3CDD.cjs.map → svg-BzloQ9l1.cjs.map} +1 -1
- package/dist/{svg-BIphc_zE.js → svg-D8vwkQf7.js} +2 -2
- package/dist/{svg-BIphc_zE.js.map → svg-D8vwkQf7.js.map} +1 -1
- package/dist/types/src/algorithms/tesselate/tesselateSegment.d.ts +7 -0
- package/dist/types/src/api/drawShape.d.ts +3 -0
- package/dist/types/src/drawShape/index.d.ts +1 -1
- package/dist/types/src/main.d.ts +1 -1
- package/dist/types/src/operations.d.ts +1 -0
- package/dist/types/src/tesselationOperations.d.ts +15 -0
- package/package.json +3 -3
package/dist/pantograph.js
CHANGED
|
@@ -1,566 +1,566 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { o as
|
|
5
|
-
import { a as
|
|
6
|
-
import { F as m, L as
|
|
7
|
-
import { h as
|
|
8
|
-
import {
|
|
9
|
-
import { s as
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
return [
|
|
13
|
-
if (
|
|
14
|
-
return [new m(
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
1
|
+
var Ut = Object.defineProperty;
|
|
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 M = (t, n, e) => Vt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
+
import { o as Ht, D as U, f as Mt } from "./draw-BJW5kfm9.js";
|
|
5
|
+
import { a as oe, d as ce } from "./draw-BJW5kfm9.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 St, g as It } from "./models-DdZq-waE.js";
|
|
7
|
+
import { h as fe } from "./models-DdZq-waE.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-B2g_Iyyl.js";
|
|
9
|
+
import { s as an, a as fn, b as un, c as ln, d as hn, w as ot } from "./svg-D8vwkQf7.js";
|
|
10
|
+
function x(t) {
|
|
11
|
+
if (t instanceof m)
|
|
12
|
+
return [t];
|
|
13
|
+
if (t instanceof P)
|
|
14
|
+
return [new m(t)];
|
|
15
|
+
if (t instanceof h)
|
|
16
|
+
return t.figures;
|
|
17
17
|
throw new Error("Unknown shape");
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const { intersections:
|
|
25
|
-
a,
|
|
19
|
+
function kt(t, n, e = 1e-9) {
|
|
20
|
+
let r = [];
|
|
21
|
+
const s = [], i = new Array(n.segments.length).fill(0).map(() => []);
|
|
22
|
+
n.segments.forEach((c, f) => {
|
|
23
|
+
t.segments.forEach((a) => {
|
|
24
|
+
const { intersections: u, overlaps: g } = W(
|
|
26
25
|
c,
|
|
26
|
+
a,
|
|
27
27
|
e
|
|
28
28
|
);
|
|
29
|
-
|
|
30
|
-
const
|
|
29
|
+
r.push(...u), i[f].push(...u), s.push(...g);
|
|
30
|
+
const p = g.flatMap((d) => [
|
|
31
31
|
d.firstPoint,
|
|
32
32
|
d.lastPoint
|
|
33
33
|
]);
|
|
34
|
-
|
|
34
|
+
r.push(...p), i[f].push(...p);
|
|
35
35
|
});
|
|
36
|
-
}),
|
|
37
|
-
const o =
|
|
36
|
+
}), r = Zt(r, e);
|
|
37
|
+
const o = Wt([n.segments, i]).flatMap(([c, f]) => f.length ? c.splitAt(f) : [c]);
|
|
38
38
|
return Array.from(
|
|
39
|
-
|
|
39
|
+
Kt(
|
|
40
40
|
o,
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
r,
|
|
42
|
+
s
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
|
-
function
|
|
47
|
-
return
|
|
48
|
-
const i =
|
|
49
|
-
return
|
|
46
|
+
function tt(t, n, e = !1) {
|
|
47
|
+
return kt(n, t).filter((s) => {
|
|
48
|
+
const i = s.segments[0].midPoint;
|
|
49
|
+
return n.onStroke(i) ? !e : !n.contains(i);
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
54
|
-
const i =
|
|
55
|
-
return
|
|
52
|
+
function nt(t, n, e = !1) {
|
|
53
|
+
return kt(n, t).filter((s) => {
|
|
54
|
+
const i = s.segments[0].midPoint;
|
|
55
|
+
return n.onStroke(i) ? !e : n.contains(i);
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
function
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
function ct(t, n, e = !1) {
|
|
59
|
+
const r = tt(
|
|
60
|
+
t,
|
|
61
|
+
n.contour,
|
|
62
62
|
e
|
|
63
|
-
),
|
|
64
|
-
(i) =>
|
|
63
|
+
), s = n.holes.flatMap(
|
|
64
|
+
(i) => nt(t, i, e)
|
|
65
65
|
);
|
|
66
|
-
return [...
|
|
66
|
+
return [...r, ...s];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
let
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
function at(t, n, e = !1) {
|
|
69
|
+
let r = nt(
|
|
70
|
+
t,
|
|
71
|
+
n.contour,
|
|
72
72
|
e
|
|
73
73
|
);
|
|
74
|
-
return
|
|
75
|
-
|
|
76
|
-
(i) =>
|
|
74
|
+
return n.holes.forEach((s) => {
|
|
75
|
+
r = r.flatMap(
|
|
76
|
+
(i) => tt(i, s, e)
|
|
77
77
|
);
|
|
78
|
-
}),
|
|
78
|
+
}), r;
|
|
79
79
|
}
|
|
80
|
-
function
|
|
80
|
+
function gn(t, n) {
|
|
81
81
|
return new h(
|
|
82
|
-
|
|
82
|
+
Nt(x(t), x(n))
|
|
83
83
|
);
|
|
84
84
|
}
|
|
85
|
-
function z(
|
|
86
|
-
return
|
|
87
|
-
(
|
|
85
|
+
function z(t) {
|
|
86
|
+
return t.reduce(
|
|
87
|
+
(n, e) => gn(n, e),
|
|
88
88
|
new h()
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function Ft(t, n) {
|
|
92
92
|
return new h(
|
|
93
|
-
|
|
93
|
+
qt(x(t), x(n))
|
|
94
94
|
);
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Xn(t, n) {
|
|
97
97
|
return new h(
|
|
98
|
-
|
|
98
|
+
Xt(x(t), x(n))
|
|
99
99
|
);
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
if (
|
|
103
|
-
return
|
|
104
|
-
if (
|
|
105
|
-
return
|
|
106
|
-
let
|
|
107
|
-
return
|
|
108
|
-
|
|
109
|
-
}),
|
|
110
|
-
}
|
|
111
|
-
function
|
|
112
|
-
if (
|
|
113
|
-
return
|
|
114
|
-
if (
|
|
115
|
-
return
|
|
116
|
-
let
|
|
117
|
-
return
|
|
118
|
-
|
|
119
|
-
}),
|
|
101
|
+
function Jn(t, n, e = !0) {
|
|
102
|
+
if (n instanceof P)
|
|
103
|
+
return tt(t, n, e);
|
|
104
|
+
if (n instanceof m)
|
|
105
|
+
return ct(t, n, e);
|
|
106
|
+
let r = [new b([...t.segments])];
|
|
107
|
+
return n.figures.forEach((s) => {
|
|
108
|
+
r = r.flatMap((i) => ct(i, s, e));
|
|
109
|
+
}), r;
|
|
110
|
+
}
|
|
111
|
+
function Qn(t, n, e = !1) {
|
|
112
|
+
if (n instanceof P)
|
|
113
|
+
return nt(t, n, e);
|
|
114
|
+
if (n instanceof m)
|
|
115
|
+
return at(t, n, e);
|
|
116
|
+
let r = [new b([...t.segments])];
|
|
117
|
+
return n.figures.forEach((s) => {
|
|
118
|
+
r = r.flatMap((i) => at(i, s, e));
|
|
119
|
+
}), r;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
return
|
|
121
|
+
function ft(t) {
|
|
122
|
+
return t < 0 ? "before" : t > 1 ? "after" : "between";
|
|
123
123
|
}
|
|
124
|
-
const
|
|
124
|
+
const ut = (t, n, e) => {
|
|
125
125
|
if (e === "before")
|
|
126
|
-
return
|
|
126
|
+
return t.distanceFrom(n.firstPoint);
|
|
127
127
|
if (e === "after")
|
|
128
|
-
return
|
|
128
|
+
return t.distanceFrom(n.lastPoint);
|
|
129
129
|
throw new Error("Invalid position");
|
|
130
130
|
};
|
|
131
|
-
function
|
|
132
|
-
const e =
|
|
131
|
+
function pn(t, n) {
|
|
132
|
+
const e = jt(t, n);
|
|
133
133
|
if (e === "parallel")
|
|
134
134
|
return Math.min(
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
t.distanceFrom(n.firstPoint),
|
|
136
|
+
t.distanceFrom(n.lastPoint)
|
|
137
137
|
);
|
|
138
|
-
const { intersectionParam1:
|
|
138
|
+
const { intersectionParam1: r, intersectionParam2: s } = e, i = ft(r), o = ft(s);
|
|
139
139
|
if (i === "between" && o === "between")
|
|
140
140
|
return 0;
|
|
141
141
|
if (i === "between" && o !== "between")
|
|
142
|
-
return
|
|
142
|
+
return ut(t, n, o);
|
|
143
143
|
if (o === "between" && i !== "between")
|
|
144
|
-
return
|
|
144
|
+
return ut(n, t, i);
|
|
145
145
|
if (i === "before" && o === "before")
|
|
146
|
-
return
|
|
146
|
+
return E(t.firstPoint, n.firstPoint);
|
|
147
147
|
if (i === "after" && o === "after")
|
|
148
|
-
return
|
|
148
|
+
return E(t.lastPoint, n.lastPoint);
|
|
149
149
|
if (i === "before" && o === "after")
|
|
150
|
-
return
|
|
150
|
+
return E(t.firstPoint, n.lastPoint);
|
|
151
151
|
if (i === "after" && o === "before")
|
|
152
|
-
return
|
|
152
|
+
return E(t.lastPoint, n.firstPoint);
|
|
153
153
|
throw new Error("Invalid position");
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
if (
|
|
155
|
+
function lt(t, n) {
|
|
156
|
+
if (Jt(t, n).length > 0)
|
|
157
157
|
return 0;
|
|
158
|
-
const e =
|
|
159
|
-
if (
|
|
160
|
-
const
|
|
161
|
-
if (Math.abs(
|
|
158
|
+
const e = Qt(t, n.center);
|
|
159
|
+
if (t.isOnSegment(e)) {
|
|
160
|
+
const r = E(e, n.center);
|
|
161
|
+
if (Math.abs(r - n.radius) < t.precision && n.isOnSegment(e))
|
|
162
162
|
return 0;
|
|
163
|
-
if (
|
|
164
|
-
const
|
|
165
|
-
F(e,
|
|
166
|
-
), i =
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
if (r - n.radius > t.precision) {
|
|
164
|
+
const s = j(
|
|
165
|
+
F(e, n.center)
|
|
166
|
+
), i = tn(
|
|
167
|
+
n.center,
|
|
168
|
+
nn(s, n.radius)
|
|
169
169
|
);
|
|
170
|
-
if (
|
|
171
|
-
return
|
|
170
|
+
if (n.isOnSegment(i))
|
|
171
|
+
return E(i, e);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
return Math.min(
|
|
175
|
-
t.distanceFrom(n.firstPoint),
|
|
176
|
-
t.distanceFrom(n.lastPoint),
|
|
177
175
|
n.distanceFrom(t.firstPoint),
|
|
178
|
-
n.distanceFrom(t.lastPoint)
|
|
176
|
+
n.distanceFrom(t.lastPoint),
|
|
177
|
+
t.distanceFrom(n.firstPoint),
|
|
178
|
+
t.distanceFrom(n.lastPoint)
|
|
179
179
|
);
|
|
180
180
|
}
|
|
181
|
-
const
|
|
182
|
-
const e =
|
|
183
|
-
if (
|
|
184
|
-
const
|
|
185
|
-
return !!
|
|
181
|
+
const dn = (t, n) => {
|
|
182
|
+
const e = t.angleToParam(n.firstAngle);
|
|
183
|
+
if (t.isValidParameter(e)) return !0;
|
|
184
|
+
const r = t.angleToParam(n.lastAngle);
|
|
185
|
+
return !!t.isValidParameter(r);
|
|
186
186
|
};
|
|
187
|
-
function
|
|
188
|
-
if (
|
|
189
|
-
const e =
|
|
190
|
-
if (e <
|
|
191
|
-
return Math.abs(
|
|
192
|
-
const
|
|
193
|
-
let i =
|
|
194
|
-
|
|
195
|
-
const o =
|
|
196
|
-
return
|
|
197
|
-
n.distanceFrom(t.firstPoint),
|
|
198
|
-
n.distanceFrom(t.lastPoint),
|
|
187
|
+
function mn(t, n) {
|
|
188
|
+
if (Yt(t, n, !0).length > 0) return 0;
|
|
189
|
+
const e = E(t.center, n.center);
|
|
190
|
+
if (e < t.precision && dn(t, n))
|
|
191
|
+
return Math.abs(t.radius - n.radius);
|
|
192
|
+
const r = j(F(n.center, t.center)), s = e - Math.abs(t.radius - n.radius) < t.precision;
|
|
193
|
+
let i = en(r);
|
|
194
|
+
s && n.radius > t.radius && (i += Math.PI);
|
|
195
|
+
const o = s ? i : i + Math.PI, c = t.angleToParam(i), f = n.angleToParam(o);
|
|
196
|
+
return t.isValidParameter(c) && n.isValidParameter(f) ? E(t.paramPoint(c), n.paramPoint(f)) : Math.min(
|
|
199
197
|
t.distanceFrom(n.firstPoint),
|
|
200
|
-
t.distanceFrom(n.lastPoint)
|
|
198
|
+
t.distanceFrom(n.lastPoint),
|
|
199
|
+
n.distanceFrom(t.firstPoint),
|
|
200
|
+
n.distanceFrom(t.lastPoint)
|
|
201
201
|
);
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
let
|
|
205
|
-
for (;
|
|
206
|
-
const i = Math.floor((
|
|
203
|
+
function Pn(t, n, e) {
|
|
204
|
+
let r = 0, s = t.length - 1;
|
|
205
|
+
for (; r <= s; ) {
|
|
206
|
+
const i = Math.floor((r + s) / 2), o = e(t[i], n);
|
|
207
207
|
if (o < 0)
|
|
208
|
-
|
|
208
|
+
r = i + 1;
|
|
209
209
|
else if (o > 0)
|
|
210
|
-
|
|
210
|
+
s = i - 1;
|
|
211
211
|
else
|
|
212
212
|
return i;
|
|
213
213
|
}
|
|
214
|
-
return -(
|
|
214
|
+
return -(r + 1);
|
|
215
215
|
}
|
|
216
|
-
function
|
|
217
|
-
const
|
|
218
|
-
|
|
216
|
+
function wn(t, n, e) {
|
|
217
|
+
const r = Pn(t, n, e);
|
|
218
|
+
r < 0 ? t.splice(-(r + 1), 0, n) : t.splice(r, 0, n);
|
|
219
219
|
}
|
|
220
|
-
class
|
|
220
|
+
class Mn {
|
|
221
221
|
constructor() {
|
|
222
|
-
|
|
222
|
+
M(this, "buckets");
|
|
223
223
|
this.buckets = [];
|
|
224
224
|
}
|
|
225
|
-
addInterval(
|
|
226
|
-
const e = this.buckets[
|
|
227
|
-
e === void 0 ? this.buckets[
|
|
225
|
+
addInterval(n) {
|
|
226
|
+
const e = this.buckets[n.rectangle.diagonalBucketIndex];
|
|
227
|
+
e === void 0 ? this.buckets[n.rectangle.diagonalBucketIndex] = [n] : wn(e, n, (r, s) => r.value - s.value);
|
|
228
228
|
}
|
|
229
|
-
removeInterval(
|
|
230
|
-
const e = this.buckets[
|
|
229
|
+
removeInterval(n) {
|
|
230
|
+
const e = this.buckets[n.rectangle.diagonalBucketIndex];
|
|
231
231
|
if (e === void 0)
|
|
232
232
|
throw new Error("Interval not found");
|
|
233
233
|
e.shift();
|
|
234
234
|
}
|
|
235
235
|
getBottomRightHullIntervals() {
|
|
236
|
-
const
|
|
236
|
+
const n = [];
|
|
237
237
|
for (let e = this.buckets.length - 1; e >= 0; e--) {
|
|
238
|
-
const
|
|
239
|
-
if (!
|
|
240
|
-
const
|
|
241
|
-
if (
|
|
242
|
-
if (!
|
|
243
|
-
|
|
238
|
+
const r = this.buckets[e];
|
|
239
|
+
if (!r === void 0) continue;
|
|
240
|
+
const s = r[0];
|
|
241
|
+
if (s !== void 0) {
|
|
242
|
+
if (!n.length) {
|
|
243
|
+
n.push(s);
|
|
244
244
|
continue;
|
|
245
245
|
}
|
|
246
|
-
for (;
|
|
247
|
-
|
|
248
|
-
for (;
|
|
249
|
-
const i =
|
|
250
|
-
if (o.value + (i.rectangle.diagonal - o.rectangle.diagonal) / 2 *
|
|
251
|
-
|
|
246
|
+
for (; n.length && n[n.length - 1].value >= s.value; )
|
|
247
|
+
n.pop();
|
|
248
|
+
for (; n.length >= 2; ) {
|
|
249
|
+
const i = n[n.length - 1], o = n[n.length - 2], c = (s.value - o.value) / ((s.rectangle.diagonal - o.rectangle.diagonal) * 2);
|
|
250
|
+
if (o.value + (i.rectangle.diagonal - o.rectangle.diagonal) / 2 * c < i.value)
|
|
251
|
+
n.pop();
|
|
252
252
|
else
|
|
253
253
|
break;
|
|
254
254
|
}
|
|
255
|
-
|
|
255
|
+
n.push(s);
|
|
256
256
|
}
|
|
257
257
|
}
|
|
258
|
-
return
|
|
258
|
+
return n;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
-
class
|
|
262
|
-
constructor(
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
this.x =
|
|
261
|
+
class Sn {
|
|
262
|
+
constructor(n, e) {
|
|
263
|
+
M(this, "diagonal");
|
|
264
|
+
M(this, "diagonalBucketIndex");
|
|
265
|
+
M(this, "xLength");
|
|
266
|
+
M(this, "yLength");
|
|
267
|
+
M(this, "index");
|
|
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
|
-
), this.diagonalBucketIndex =
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
class
|
|
274
|
-
constructor(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
this.fcn =
|
|
281
|
-
const i = [0.5, 0.5], o = this.rect(0, 0),
|
|
282
|
-
this.buckets.addInterval(new O(i,
|
|
283
|
-
}
|
|
284
|
-
registerInterval(
|
|
285
|
-
this.buckets.addInterval(
|
|
286
|
-
}
|
|
287
|
-
rect(
|
|
288
|
-
const
|
|
289
|
-
return this.rectangles.has(
|
|
290
|
-
}
|
|
291
|
-
splitInterval(
|
|
292
|
-
let e,
|
|
293
|
-
const [i, o] =
|
|
294
|
-
return
|
|
295
|
-
new O(
|
|
296
|
-
new O(
|
|
297
|
-
new O(
|
|
270
|
+
), this.diagonalBucketIndex = n + e, this.index = `${n},${e}`;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
class In {
|
|
274
|
+
constructor(n, e = 1e-8, r = 1e3, s = 1e-6) {
|
|
275
|
+
M(this, "rectangles");
|
|
276
|
+
M(this, "buckets");
|
|
277
|
+
M(this, "fMin");
|
|
278
|
+
M(this, "argMin");
|
|
279
|
+
M(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 Mn();
|
|
281
|
+
const i = [0.5, 0.5], o = this.rect(0, 0), c = this.fcn(i);
|
|
282
|
+
this.buckets.addInterval(new O(i, c, o)), this.fMin = c, this.argMin = i, this.tol = o.diagonal;
|
|
283
|
+
}
|
|
284
|
+
registerInterval(n) {
|
|
285
|
+
this.buckets.addInterval(n), n.value <= this.fMin && (this.fMin = n.value, this.argMin = n.center, this.tol = n.rectangle.diagonal);
|
|
286
|
+
}
|
|
287
|
+
rect(n, e) {
|
|
288
|
+
const r = `${n},${e}`;
|
|
289
|
+
return this.rectangles.has(r) || this.rectangles.set(r, new Sn(n, e)), this.rectangles.get(r);
|
|
290
|
+
}
|
|
291
|
+
splitInterval(n) {
|
|
292
|
+
let e, r, s;
|
|
293
|
+
const [i, o] = n.center;
|
|
294
|
+
return n.rectangle.x <= n.rectangle.y ? (e = this.rect(n.rectangle.x + 1, n.rectangle.y), r = [i - e.xLength, o], s = [i + e.xLength, o]) : (e = this.rect(n.rectangle.x, n.rectangle.y + 1), r = [i, o - e.yLength], s = [i, o + e.yLength]), [
|
|
295
|
+
new O(r, this.fcn(r), e),
|
|
296
|
+
new O(n.center, n.value, e),
|
|
297
|
+
new O(s, this.fcn(s), e)
|
|
298
298
|
];
|
|
299
299
|
}
|
|
300
300
|
single_iteration() {
|
|
301
|
-
const
|
|
302
|
-
for (;
|
|
303
|
-
const e =
|
|
301
|
+
const n = this.buckets.getBottomRightHullIntervals();
|
|
302
|
+
for (; n.length >= 2; ) {
|
|
303
|
+
const e = n[0], r = n[1], s = (r.value - e.value) / ((r.rectangle.diagonal - e.rectangle.diagonal) / 2), i = e.value - s * r.value / 2;
|
|
304
304
|
if ((this.fMin - i) / Math.abs(this.fMin) < this.epsilon)
|
|
305
|
-
|
|
305
|
+
n.shift();
|
|
306
306
|
else
|
|
307
307
|
break;
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
n.forEach((e) => {
|
|
310
310
|
this.buckets.removeInterval(e);
|
|
311
311
|
});
|
|
312
|
-
for (const e of
|
|
313
|
-
const [
|
|
314
|
-
this.registerInterval(
|
|
312
|
+
for (const e of n) {
|
|
313
|
+
const [r, s, i] = this.splitInterval(e);
|
|
314
|
+
this.registerInterval(r), this.registerInterval(s), this.registerInterval(i);
|
|
315
315
|
}
|
|
316
316
|
}
|
|
317
317
|
run() {
|
|
318
|
-
let
|
|
319
|
-
for (; this.tol > this.endTolerance / 2 && (this.single_iteration(),
|
|
318
|
+
let n = 0;
|
|
319
|
+
for (; this.tol > this.endTolerance / 2 && (this.single_iteration(), n++, !(n > this.maxIterations)); )
|
|
320
320
|
;
|
|
321
321
|
return {
|
|
322
322
|
fMin: this.fMin,
|
|
323
323
|
argMin: this.argMin,
|
|
324
324
|
tol: this.tol,
|
|
325
|
-
iterations:
|
|
325
|
+
iterations: n
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
class O {
|
|
330
|
-
constructor(
|
|
331
|
-
this.center =
|
|
330
|
+
constructor(n, e, r) {
|
|
331
|
+
this.center = n, this.value = e, this.rectangle = r;
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
|
-
function
|
|
335
|
-
return new
|
|
336
|
-
n,
|
|
334
|
+
function An(t, n = 1e-8, e = 1e3, r = 1e-6) {
|
|
335
|
+
return new In(
|
|
337
336
|
t,
|
|
337
|
+
n,
|
|
338
338
|
e,
|
|
339
|
-
|
|
339
|
+
r
|
|
340
340
|
).run();
|
|
341
341
|
}
|
|
342
|
-
function
|
|
343
|
-
const
|
|
344
|
-
const i =
|
|
345
|
-
return
|
|
342
|
+
function vn(t, n, e = 1e-9) {
|
|
343
|
+
const r = An((s) => {
|
|
344
|
+
const i = t.paramPoint(s[0]), o = n.paramPoint(s[1]);
|
|
345
|
+
return At(i, o);
|
|
346
346
|
}, e);
|
|
347
|
-
return Math.sqrt(
|
|
347
|
+
return Math.sqrt(r.fMin);
|
|
348
348
|
}
|
|
349
|
-
function
|
|
350
|
-
return
|
|
349
|
+
function bn(t, n) {
|
|
350
|
+
return t instanceof v && n instanceof v ? pn(t, n) : t instanceof v && n instanceof y ? lt(t, n) : t instanceof y && n instanceof v ? lt(n, t) : t instanceof y && n instanceof y ? mn(t, n) : vn(t, n);
|
|
351
351
|
}
|
|
352
|
-
function
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
352
|
+
function xt(t) {
|
|
353
|
+
if (t instanceof _) {
|
|
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
|
+
if (c > 0 && f < 0 || c < 0 && f > 0) return !1;
|
|
356
356
|
}
|
|
357
|
-
const
|
|
358
|
-
let
|
|
359
|
-
return Math.abs(Math.acos(
|
|
357
|
+
const n = it(t.tangentAtFirstPoint), e = it(t.tangentAtLastPoint);
|
|
358
|
+
let r = q(n, e);
|
|
359
|
+
return Math.abs(Math.acos(r)) < Math.PI / 3;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
362
|
-
if (
|
|
363
|
-
const [
|
|
361
|
+
function X(t) {
|
|
362
|
+
if (xt(t)) return [t];
|
|
363
|
+
const [n, e] = t.splitAtParameters([0.5]);
|
|
364
364
|
return [
|
|
365
|
-
...
|
|
366
|
-
...
|
|
365
|
+
...X(n),
|
|
366
|
+
...X(e)
|
|
367
367
|
];
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
return
|
|
369
|
+
function ht(t) {
|
|
370
|
+
return xt(t) ? [t] : t.splitAtParameters(t.getParametersOfExtrema()).flatMap(X);
|
|
371
371
|
}
|
|
372
|
-
function
|
|
373
|
-
const
|
|
372
|
+
function Ln(t) {
|
|
373
|
+
const n = t.deltaAngle, e = Math.ceil(Math.abs(n) / (Math.PI / 2)), r = n / e, s = 4 * Math.tan(r / 4) / 3, i = t.clockwise ? -1 : 1, o = Array.from(
|
|
374
374
|
{ length: e + 1 },
|
|
375
|
-
(f,
|
|
375
|
+
(f, a) => t.firstAngle + a * r * i
|
|
376
376
|
);
|
|
377
|
-
return o.slice(0, -1).map((f,
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
),
|
|
382
|
-
|
|
383
|
-
S +
|
|
384
|
-
]),
|
|
385
|
-
|
|
386
|
-
S +
|
|
387
|
-
]),
|
|
388
|
-
return new
|
|
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, S] = t.center, w = t.minorRadius, I = t.majorRadius, L = new rn().rotate(
|
|
379
|
+
t.tiltAngle,
|
|
380
|
+
t.center
|
|
381
|
+
), k = ($t) => L.transform($t), D = k([l + I * u, S + w * g]), $ = k([
|
|
382
|
+
l + I * (u - s * g * i),
|
|
383
|
+
S + w * (g + s * u * i)
|
|
384
|
+
]), Gt = k([
|
|
385
|
+
l + I * (p + s * d * i),
|
|
386
|
+
S + w * (d - s * p * i)
|
|
387
|
+
]), _t = k([l + I * p, S + w * d]);
|
|
388
|
+
return new _(D, _t, $, Gt);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
|
-
const
|
|
392
|
-
(e) =>
|
|
393
|
-
) :
|
|
394
|
-
function
|
|
395
|
-
const
|
|
396
|
-
offset:
|
|
397
|
-
original:
|
|
398
|
-
})),
|
|
399
|
-
let i = e ? null :
|
|
400
|
-
if (
|
|
401
|
-
const
|
|
402
|
-
i ?
|
|
403
|
-
new
|
|
404
|
-
) :
|
|
391
|
+
const et = 1e-8, yt = (t) => t.flatMap((n) => n instanceof v ? [n] : n instanceof y ? [n] : n instanceof vt ? Ln(n).flatMap(
|
|
392
|
+
(e) => ht(e)
|
|
393
|
+
) : n instanceof bt || n instanceof _ ? ht(n) : [new v(n.firstPoint, n.lastPoint)]);
|
|
394
|
+
function J(t, n, e = !0) {
|
|
395
|
+
const r = t.map((a) => ({
|
|
396
|
+
offset: Ht(a, n),
|
|
397
|
+
original: a
|
|
398
|
+
})), s = [];
|
|
399
|
+
let i = e ? null : r.at(-1), o = e ? r.at(-1) : null;
|
|
400
|
+
if (s.length === 1) return s;
|
|
401
|
+
const c = (a) => {
|
|
402
|
+
i ? a.offset instanceof U ? A(a.offset.firstPoint, a.offset.lastPoint) || s.push(
|
|
403
|
+
new v(a.offset.firstPoint, a.offset.lastPoint)
|
|
404
|
+
) : s.push(a.offset) : i = a;
|
|
405
405
|
}, f = function* () {
|
|
406
|
-
for (const
|
|
407
|
-
yield
|
|
406
|
+
for (const a of r.slice(0, -1))
|
|
407
|
+
yield a;
|
|
408
408
|
if (!i) throw new Error("Bug in the offset algorithm");
|
|
409
409
|
yield i;
|
|
410
410
|
};
|
|
411
|
-
for (const
|
|
411
|
+
for (const a of f()) {
|
|
412
412
|
if (!o) {
|
|
413
|
-
o =
|
|
413
|
+
o = a;
|
|
414
414
|
continue;
|
|
415
415
|
}
|
|
416
|
-
const
|
|
417
|
-
if (
|
|
418
|
-
|
|
416
|
+
const u = o.offset.lastPoint, g = a.offset.firstPoint;
|
|
417
|
+
if (A(u, g)) {
|
|
418
|
+
c(o), o = a;
|
|
419
419
|
continue;
|
|
420
420
|
}
|
|
421
|
-
let
|
|
422
|
-
if (!(o.offset instanceof U) && !(
|
|
423
|
-
const { intersections:
|
|
421
|
+
let p = [];
|
|
422
|
+
if (!(o.offset instanceof U) && !(a.offset instanceof U)) {
|
|
423
|
+
const { intersections: w, overlaps: I } = W(
|
|
424
424
|
o.offset,
|
|
425
|
-
|
|
426
|
-
|
|
425
|
+
a.offset,
|
|
426
|
+
et / 100
|
|
427
427
|
);
|
|
428
|
-
|
|
429
|
-
...
|
|
430
|
-
...
|
|
428
|
+
p = [
|
|
429
|
+
...w,
|
|
430
|
+
...I.flatMap((L) => [L.firstPoint, L.lastPoint])
|
|
431
431
|
];
|
|
432
432
|
}
|
|
433
|
-
if (
|
|
434
|
-
let
|
|
435
|
-
if (
|
|
436
|
-
const
|
|
437
|
-
(
|
|
433
|
+
if (p.length > 0) {
|
|
434
|
+
let w = p[0];
|
|
435
|
+
if (p.length > 1) {
|
|
436
|
+
const k = o == null ? void 0 : o.original.lastPoint, D = p.map(
|
|
437
|
+
($) => At($, k)
|
|
438
438
|
);
|
|
439
|
-
|
|
439
|
+
w = p[D.indexOf(Math.min(...D))];
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
|
|
443
|
-
])[0],
|
|
444
|
-
if (!
|
|
445
|
-
|
|
446
|
-
offset:
|
|
441
|
+
const I = o.offset.splitAt([
|
|
442
|
+
w
|
|
443
|
+
])[0], L = a.offset.splitAt([w]).at(-1);
|
|
444
|
+
if (!L) throw new Error("Bug in the splitting algo in offset");
|
|
445
|
+
c({
|
|
446
|
+
offset: I,
|
|
447
447
|
original: o.original
|
|
448
|
-
}), o = { offset:
|
|
448
|
+
}), o = { offset: L, original: a.original };
|
|
449
449
|
continue;
|
|
450
450
|
}
|
|
451
|
-
const d = o.original.lastPoint,
|
|
452
|
-
F(
|
|
453
|
-
F(
|
|
454
|
-
) > 0, S = new
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
return o &&
|
|
458
|
-
}
|
|
459
|
-
function
|
|
460
|
-
const
|
|
461
|
-
const i =
|
|
462
|
-
|
|
451
|
+
const d = o.original.lastPoint, l = on(
|
|
452
|
+
F(g, d),
|
|
453
|
+
F(u, d)
|
|
454
|
+
) > 0, S = new y(u, g, d, l);
|
|
455
|
+
c(o), s.push(S), o = a;
|
|
456
|
+
}
|
|
457
|
+
return o && c(o), s;
|
|
458
|
+
}
|
|
459
|
+
function Ct(t) {
|
|
460
|
+
const n = /* @__PURE__ */ new Map(), e = (r, s) => {
|
|
461
|
+
const i = n.get(r) || [];
|
|
462
|
+
n.set(r, [...i, ...s]);
|
|
463
463
|
};
|
|
464
|
-
return
|
|
465
|
-
|
|
466
|
-
const { intersections:
|
|
467
|
-
...
|
|
468
|
-
...f.flatMap((
|
|
469
|
-
].filter((
|
|
470
|
-
const
|
|
471
|
-
return !(
|
|
464
|
+
return t.forEach((r, s) => {
|
|
465
|
+
t.slice(s + 1).forEach((i, o) => {
|
|
466
|
+
const { intersections: c, overlaps: f } = W(r, i, et), a = [
|
|
467
|
+
...c,
|
|
468
|
+
...f.flatMap((u) => [u.firstPoint, u.lastPoint])
|
|
469
|
+
].filter((u) => {
|
|
470
|
+
const g = A(u, r.firstPoint) || A(u, r.lastPoint), p = A(u, i.firstPoint) || A(u, i.lastPoint);
|
|
471
|
+
return !(g && p);
|
|
472
472
|
});
|
|
473
|
-
|
|
473
|
+
a.length && (e(s, a), e(o + s + 1, a));
|
|
474
474
|
});
|
|
475
|
-
}),
|
|
475
|
+
}), n;
|
|
476
476
|
}
|
|
477
|
-
function
|
|
478
|
-
return
|
|
479
|
-
if (!
|
|
480
|
-
const
|
|
481
|
-
return
|
|
477
|
+
function Dt(t, n) {
|
|
478
|
+
return n.flatMap((e, r) => {
|
|
479
|
+
if (!t.has(r)) return e;
|
|
480
|
+
const s = t.get(r);
|
|
481
|
+
return s ? e.splitAt(s) : e;
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
|
-
function
|
|
485
|
-
return
|
|
484
|
+
function Ot(t, n, e) {
|
|
485
|
+
return t.filter((r) => !n.segments.some((i) => bn(i, r) < Math.abs(e) - et));
|
|
486
486
|
}
|
|
487
|
-
function
|
|
488
|
-
const e =
|
|
489
|
-
if (
|
|
490
|
-
const i =
|
|
487
|
+
function G(t, n) {
|
|
488
|
+
const e = t.clockwise ? n : -n, r = yt(t.segments), s = J(r, e);
|
|
489
|
+
if (s.length < 2) return new h();
|
|
490
|
+
const i = Ct(s);
|
|
491
491
|
if (!i.size) {
|
|
492
|
-
const
|
|
493
|
-
return new h([new m(
|
|
492
|
+
const u = new P(s);
|
|
493
|
+
return new h([new m(u)]);
|
|
494
494
|
}
|
|
495
|
-
const o =
|
|
495
|
+
const o = Dt(
|
|
496
496
|
i,
|
|
497
|
-
|
|
498
|
-
),
|
|
499
|
-
if (!
|
|
500
|
-
const
|
|
501
|
-
return
|
|
502
|
-
}
|
|
503
|
-
function
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
-
|
|
497
|
+
s
|
|
498
|
+
), c = Ot(o, t, n);
|
|
499
|
+
if (!c.length) return new h();
|
|
500
|
+
const a = St(c).filter((u) => u.length > 1).filter((u) => A(u[0].firstPoint, u.at(-1).lastPoint)).map((u) => new P(u));
|
|
501
|
+
return a.length ? new h(a.map((u) => new m(u))) : new h();
|
|
502
|
+
}
|
|
503
|
+
function En(t, n, e = "round") {
|
|
504
|
+
const r = n / 2, s = yt(t.segments), i = J(s, r, !1), o = J(
|
|
505
|
+
s,
|
|
506
|
+
-r,
|
|
507
507
|
!1
|
|
508
|
-
).map((
|
|
508
|
+
).map((l) => l.reverse());
|
|
509
509
|
o.reverse();
|
|
510
|
-
const
|
|
511
|
-
|
|
510
|
+
const c = (l, S) => e === "round" ? sn(
|
|
511
|
+
l.lastPoint,
|
|
512
512
|
S.firstPoint,
|
|
513
|
-
|
|
514
|
-
) : new
|
|
513
|
+
l.tangentAtLastPoint
|
|
514
|
+
) : new v(l.lastPoint, S.firstPoint), f = [
|
|
515
515
|
...i,
|
|
516
|
-
|
|
516
|
+
c(
|
|
517
517
|
i[i.length - 1],
|
|
518
518
|
o[0]
|
|
519
519
|
),
|
|
520
520
|
...o,
|
|
521
|
-
|
|
521
|
+
c(
|
|
522
522
|
o[o.length - 1],
|
|
523
523
|
i[0]
|
|
524
524
|
)
|
|
525
|
-
],
|
|
526
|
-
if (!
|
|
527
|
-
const
|
|
528
|
-
return new h([new m(
|
|
525
|
+
], a = Ct(f);
|
|
526
|
+
if (!a.size) {
|
|
527
|
+
const l = new P(f);
|
|
528
|
+
return new h([new m(l)]);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
531
|
-
|
|
530
|
+
const u = Dt(
|
|
531
|
+
a,
|
|
532
532
|
f
|
|
533
|
-
),
|
|
534
|
-
if (!
|
|
535
|
-
const d =
|
|
536
|
-
return d.length ? new h(d.map((
|
|
537
|
-
}
|
|
538
|
-
function
|
|
539
|
-
const e =
|
|
540
|
-
const
|
|
541
|
-
|
|
533
|
+
), g = Ot(u, t, r);
|
|
534
|
+
if (!g.length) return new h();
|
|
535
|
+
const d = St(g).filter((l) => l.length > 1).filter((l) => A(l[0].firstPoint, l.at(-1).lastPoint)).map((l) => new P(l));
|
|
536
|
+
return d.length ? new h(d.map((l) => new m(l))) : new h();
|
|
537
|
+
}
|
|
538
|
+
function kn(t, n) {
|
|
539
|
+
const e = t.map((r) => {
|
|
540
|
+
const s = z(
|
|
541
|
+
r.holes.map((i) => G(i, n))
|
|
542
542
|
);
|
|
543
|
-
return
|
|
543
|
+
return Ft(G(r.contour, n), s);
|
|
544
544
|
});
|
|
545
545
|
return z(e);
|
|
546
546
|
}
|
|
547
|
-
function
|
|
548
|
-
const e = Math.abs(
|
|
549
|
-
(
|
|
550
|
-
|
|
547
|
+
function Fn(t, n) {
|
|
548
|
+
const e = Math.abs(n / 2), r = t.map(
|
|
549
|
+
(s) => z(
|
|
550
|
+
s.allLoops.map((i) => Ft(G(i, e), G(i, -e)))
|
|
551
551
|
)
|
|
552
552
|
);
|
|
553
|
-
return z(
|
|
553
|
+
return z(r);
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
return
|
|
555
|
+
function Yn(t, n) {
|
|
556
|
+
return kn(x(t), n);
|
|
557
557
|
}
|
|
558
|
-
function
|
|
559
|
-
return
|
|
558
|
+
function Zn(t, n, { endCap: e = "round" } = {}) {
|
|
559
|
+
return t instanceof b ? En(t, n, e) : Fn(x(t), n);
|
|
560
560
|
}
|
|
561
|
-
class
|
|
561
|
+
class xn {
|
|
562
562
|
constructor() {
|
|
563
|
-
|
|
563
|
+
M(this, "filters");
|
|
564
564
|
this.filters = [];
|
|
565
565
|
}
|
|
566
566
|
delete() {
|
|
@@ -570,66 +570,66 @@ class In {
|
|
|
570
570
|
* Combine logically a set of filter with an AND operation.
|
|
571
571
|
*
|
|
572
572
|
*/
|
|
573
|
-
and(
|
|
574
|
-
return
|
|
573
|
+
and(n) {
|
|
574
|
+
return n.forEach((e) => e(this)), this;
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
577
|
* Invert the result of a particular filter
|
|
578
578
|
*
|
|
579
579
|
*/
|
|
580
|
-
not(
|
|
580
|
+
not(n) {
|
|
581
581
|
const e = new this.constructor();
|
|
582
|
-
|
|
583
|
-
const
|
|
584
|
-
return this.filters.push(
|
|
582
|
+
n(e);
|
|
583
|
+
const r = ({ element: s }) => !e.shouldKeep(s);
|
|
584
|
+
return this.filters.push(r), this;
|
|
585
585
|
}
|
|
586
586
|
/**
|
|
587
587
|
* Combine logically a set of filter with an OR operation.
|
|
588
588
|
*
|
|
589
589
|
*/
|
|
590
|
-
either(
|
|
591
|
-
const e =
|
|
590
|
+
either(n) {
|
|
591
|
+
const e = n.map((s) => {
|
|
592
592
|
const i = new this.constructor();
|
|
593
|
-
return
|
|
594
|
-
}),
|
|
595
|
-
return this.filters.push(
|
|
593
|
+
return s(i), i;
|
|
594
|
+
}), r = ({ element: s }) => e.some((i) => i.shouldKeep(s));
|
|
595
|
+
return this.filters.push(r), this;
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
|
-
const
|
|
599
|
-
const
|
|
600
|
-
return e < Math.PI ? e : e === Math.PI ? 0 : Math.abs(e -
|
|
598
|
+
const V = 2 * Math.PI, gt = (t) => {
|
|
599
|
+
const n = t % V, e = n < 0 ? n + V : n;
|
|
600
|
+
return e < Math.PI ? e : e === Math.PI ? 0 : Math.abs(e - V);
|
|
601
601
|
};
|
|
602
|
-
class
|
|
602
|
+
class C extends xn {
|
|
603
603
|
clone() {
|
|
604
|
-
const
|
|
605
|
-
return
|
|
604
|
+
const n = new C();
|
|
605
|
+
return n.filters = [...this.filters], n;
|
|
606
606
|
}
|
|
607
607
|
/**
|
|
608
608
|
* Filter to find corner that have their point are in the list.
|
|
609
609
|
*
|
|
610
610
|
*/
|
|
611
|
-
inList(
|
|
612
|
-
const e = ({ element:
|
|
611
|
+
inList(n) {
|
|
612
|
+
const e = ({ element: r }) => !!n.find((s) => A(s, r.point));
|
|
613
613
|
return this.filters.push(e), this;
|
|
614
614
|
}
|
|
615
615
|
/**
|
|
616
616
|
* Filter to find elements that are at a specified distance from a point.
|
|
617
617
|
*
|
|
618
618
|
*/
|
|
619
|
-
atDistance(
|
|
620
|
-
function
|
|
621
|
-
return Math.abs(
|
|
619
|
+
atDistance(n, e = [0, 0]) {
|
|
620
|
+
function r({ element: s }) {
|
|
621
|
+
return Math.abs(E(e, s.point) - n) < 1e-9;
|
|
622
622
|
}
|
|
623
|
-
return this.filters.push(
|
|
623
|
+
return this.filters.push(r), this;
|
|
624
624
|
}
|
|
625
625
|
/**
|
|
626
626
|
* Filter to find elements that contain a certain point
|
|
627
627
|
*
|
|
628
628
|
* @category Filter
|
|
629
629
|
*/
|
|
630
|
-
atPoint(
|
|
631
|
-
function e({ element:
|
|
632
|
-
return
|
|
630
|
+
atPoint(n) {
|
|
631
|
+
function e({ element: r }) {
|
|
632
|
+
return A(n, r.point);
|
|
633
633
|
}
|
|
634
634
|
return this.filters.push(e), this;
|
|
635
635
|
}
|
|
@@ -638,242 +638,348 @@ class x extends In {
|
|
|
638
638
|
*
|
|
639
639
|
* @category Filter
|
|
640
640
|
*/
|
|
641
|
-
inBox(
|
|
642
|
-
const [
|
|
643
|
-
function
|
|
644
|
-
const [d,
|
|
645
|
-
return d >=
|
|
641
|
+
inBox(n, e) {
|
|
642
|
+
const [r, s] = n, [i, o] = e, c = Math.min(r, i), f = Math.max(r, i), a = Math.min(s, o), u = Math.max(s, o);
|
|
643
|
+
function g({ element: p }) {
|
|
644
|
+
const [d, l] = p.point;
|
|
645
|
+
return d >= c && d <= f && l >= a && l <= u;
|
|
646
646
|
}
|
|
647
|
-
return this.filters.push(
|
|
647
|
+
return this.filters.push(g), this;
|
|
648
648
|
}
|
|
649
649
|
/**
|
|
650
650
|
* Filter to find corner that a certain angle between them - only between
|
|
651
651
|
* 0 and 180.
|
|
652
652
|
*
|
|
653
653
|
*/
|
|
654
|
-
ofAngle(
|
|
655
|
-
function e({ element:
|
|
656
|
-
const
|
|
654
|
+
ofAngle(n) {
|
|
655
|
+
function e({ element: r }) {
|
|
656
|
+
const s = r.firstCurve.tangentAtLastPoint, i = r.secondCurve.tangentAtFirstPoint;
|
|
657
657
|
return Math.abs(
|
|
658
|
-
|
|
658
|
+
gt(N(s, i)) - gt(Lt * n)
|
|
659
659
|
) < 1e-9;
|
|
660
660
|
}
|
|
661
661
|
return this.filters.push(e), this;
|
|
662
662
|
}
|
|
663
|
-
above(
|
|
664
|
-
function e({ element:
|
|
665
|
-
return
|
|
663
|
+
above(n = 0) {
|
|
664
|
+
function e({ element: r }) {
|
|
665
|
+
return r.point[1] > n;
|
|
666
666
|
}
|
|
667
667
|
return this.filters.push(e), this;
|
|
668
668
|
}
|
|
669
|
-
below(
|
|
670
|
-
function e({ element:
|
|
671
|
-
return
|
|
669
|
+
below(n = 0) {
|
|
670
|
+
function e({ element: r }) {
|
|
671
|
+
return r.point[1] < n;
|
|
672
672
|
}
|
|
673
673
|
return this.filters.push(e), this;
|
|
674
674
|
}
|
|
675
|
-
leftOf(
|
|
676
|
-
function e({ element:
|
|
677
|
-
return
|
|
675
|
+
leftOf(n = 0) {
|
|
676
|
+
function e({ element: r }) {
|
|
677
|
+
return r.point[0] < n;
|
|
678
678
|
}
|
|
679
679
|
return this.filters.push(e), this;
|
|
680
680
|
}
|
|
681
|
-
rightOf(
|
|
682
|
-
function e({ element:
|
|
683
|
-
return
|
|
681
|
+
rightOf(n = 0) {
|
|
682
|
+
function e({ element: r }) {
|
|
683
|
+
return r.point[0] > n;
|
|
684
684
|
}
|
|
685
685
|
return this.filters.push(e), this;
|
|
686
686
|
}
|
|
687
|
-
shouldKeep(
|
|
688
|
-
return this.filters.every((
|
|
687
|
+
shouldKeep(n) {
|
|
688
|
+
return this.filters.every((r) => r({ element: n }));
|
|
689
689
|
}
|
|
690
690
|
asFilterFun() {
|
|
691
691
|
return this.shouldKeep.bind(this);
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
function
|
|
695
|
-
const
|
|
696
|
-
|
|
694
|
+
function Bt(t, n, e, r = () => !0) {
|
|
695
|
+
const s = [n.segments[0]], i = (c, f) => {
|
|
696
|
+
r({ firstCurve: c, secondCurve: f, point: c.lastPoint }) ? s.push(...t(c, f, e)) : s.push(c, f);
|
|
697
697
|
};
|
|
698
|
-
if (
|
|
699
|
-
const f =
|
|
698
|
+
if (n.segments.slice(1).forEach((c) => {
|
|
699
|
+
const f = s.pop();
|
|
700
700
|
if (!f) throw new Error("Bug in the stroke filletting algo");
|
|
701
|
-
i(f,
|
|
702
|
-
}), !
|
|
703
|
-
if (
|
|
704
|
-
const
|
|
705
|
-
if (!
|
|
701
|
+
i(f, c);
|
|
702
|
+
}), !s.at(-1)) throw new Error("Bug in the stroke corner algo");
|
|
703
|
+
if (n instanceof P) {
|
|
704
|
+
const c = s.pop(), f = s.shift();
|
|
705
|
+
if (!c || !f)
|
|
706
706
|
throw new Error("Bug in the filletting algo");
|
|
707
|
-
return i(
|
|
707
|
+
return i(c, f), new P(s, { ignoreChecks: !0 });
|
|
708
708
|
} else
|
|
709
|
-
return new
|
|
710
|
-
}
|
|
711
|
-
function
|
|
712
|
-
const
|
|
713
|
-
if (
|
|
714
|
-
return
|
|
715
|
-
if (
|
|
716
|
-
const i =
|
|
709
|
+
return new b(s, { ignoreChecks: !0 });
|
|
710
|
+
}
|
|
711
|
+
function R(t, n, e) {
|
|
712
|
+
const r = typeof e == "function" ? e(new C()) : e, s = r && r.asFilterFun();
|
|
713
|
+
if (t instanceof P || t instanceof b)
|
|
714
|
+
return Bt(Mt, t, n, s);
|
|
715
|
+
if (t instanceof m) {
|
|
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 (
|
|
720
|
-
const i =
|
|
719
|
+
if (t instanceof h) {
|
|
720
|
+
const i = t.figures.map((o) => R(o, n, r));
|
|
721
721
|
return new h(i, { ignoreChecks: !0 });
|
|
722
722
|
}
|
|
723
723
|
throw new Error("invalid shape to fillet");
|
|
724
724
|
}
|
|
725
|
-
function
|
|
726
|
-
const
|
|
727
|
-
if (
|
|
728
|
-
return
|
|
729
|
-
if (
|
|
730
|
-
const i =
|
|
725
|
+
function T(t, n, e) {
|
|
726
|
+
const r = typeof e == "function" ? e(new C()) : e, s = r && r.asFilterFun();
|
|
727
|
+
if (t instanceof P || t instanceof b)
|
|
728
|
+
return Bt(Mt, t, n, s);
|
|
729
|
+
if (t instanceof m) {
|
|
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 (
|
|
734
|
-
const i =
|
|
733
|
+
if (t instanceof h) {
|
|
734
|
+
const i = t.figures.map((o) => T(o, n, r));
|
|
735
735
|
return new h(i, { ignoreChecks: !0 });
|
|
736
736
|
}
|
|
737
737
|
throw new Error("invalid shape to chamfer");
|
|
738
738
|
}
|
|
739
|
-
class
|
|
740
|
-
constructor(
|
|
741
|
-
super(), this.shape =
|
|
739
|
+
class yn extends C {
|
|
740
|
+
constructor(n) {
|
|
741
|
+
super(), this.shape = n;
|
|
742
742
|
}
|
|
743
|
-
fillet(
|
|
744
|
-
return
|
|
743
|
+
fillet(n) {
|
|
744
|
+
return R(this.shape, n, this.clone());
|
|
745
745
|
}
|
|
746
|
-
chamfer(
|
|
747
|
-
return
|
|
746
|
+
chamfer(n) {
|
|
747
|
+
return T(this.shape, n, this.clone());
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
return new
|
|
750
|
+
function Wn(t) {
|
|
751
|
+
return new yn(t);
|
|
752
752
|
}
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
if (
|
|
761
|
-
return
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
753
|
+
const Cn = 1 * Lt, Dn = 24;
|
|
754
|
+
function H(t, n, e, r) {
|
|
755
|
+
const s = t.gradientAt(n);
|
|
756
|
+
return Et(s) <= r ? e : j(s);
|
|
757
|
+
}
|
|
758
|
+
function Q(t, n, e, r, s, i) {
|
|
759
|
+
const o = t.paramPoint(n), c = t.paramPoint(e), f = F(c, o), a = Et(f);
|
|
760
|
+
if (a <= t.precision || i >= r.maxDepth)
|
|
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), S = q(p, d), w = q(d, l);
|
|
763
|
+
if (S >= s && w >= s)
|
|
764
|
+
return [o, c];
|
|
765
|
+
const I = t.paramPoint(g), L = S >= s ? [o, I] : Q(t, n, g, r, s, i + 1), k = w >= s ? [I, c] : Q(t, g, e, r, s, i + 1);
|
|
766
|
+
return [...L.slice(0, -1), ...k];
|
|
767
|
+
}
|
|
768
|
+
function rt(t, n = {}) {
|
|
769
|
+
const e = {
|
|
770
|
+
maxAngle: n.maxAngle ?? Cn,
|
|
771
|
+
maxDepth: n.maxDepth ?? Dn
|
|
772
|
+
}, r = Math.cos(e.maxAngle);
|
|
773
|
+
return Q(t, 0, 1, e, r, 0);
|
|
774
|
+
}
|
|
775
|
+
function On(t, n) {
|
|
776
|
+
return new h(
|
|
777
|
+
t.figures.map((e) => Rt(e, n))
|
|
778
|
+
);
|
|
779
|
+
}
|
|
780
|
+
function Rt(t, n) {
|
|
781
|
+
return new m(
|
|
782
|
+
Y(t.contour, n),
|
|
783
|
+
t.holes.map((e) => Y(e, n))
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
function Y(t, n) {
|
|
787
|
+
return new P(st(t.segments, n));
|
|
788
|
+
}
|
|
789
|
+
function Bn(t, n) {
|
|
790
|
+
return new b(st(t.segments, n));
|
|
791
|
+
}
|
|
792
|
+
function st(t, n) {
|
|
793
|
+
return t.flatMap(n);
|
|
794
|
+
}
|
|
795
|
+
function Rn(t, n) {
|
|
796
|
+
if (t instanceof h)
|
|
797
|
+
return On(t, n);
|
|
798
|
+
if (t instanceof m)
|
|
799
|
+
return Rt(t, n);
|
|
800
|
+
if (t instanceof P)
|
|
801
|
+
return Y(t, n);
|
|
802
|
+
if (t instanceof b)
|
|
803
|
+
return Bn(t, n);
|
|
804
|
+
if (It(t))
|
|
805
|
+
return st([t], n);
|
|
806
|
+
throw new Error("Unsupported shape type");
|
|
807
|
+
}
|
|
808
|
+
function Tn(t) {
|
|
809
|
+
if (t.length < 2) return [];
|
|
810
|
+
const n = [];
|
|
811
|
+
for (let e = 0; e < t.length - 1; e += 1)
|
|
812
|
+
n.push(new v(t[e], t[e + 1]));
|
|
813
|
+
return n;
|
|
814
|
+
}
|
|
815
|
+
function zn(t, n) {
|
|
816
|
+
return Tn(rt(t, n));
|
|
817
|
+
}
|
|
818
|
+
function B(t, n) {
|
|
819
|
+
const e = [];
|
|
820
|
+
return t.forEach((r, s) => {
|
|
821
|
+
const i = rt(r, n);
|
|
822
|
+
if (i.length !== 0) {
|
|
823
|
+
if (s === 0) {
|
|
824
|
+
e.push(...i);
|
|
825
|
+
return;
|
|
826
|
+
}
|
|
827
|
+
e.push(...i.slice(1));
|
|
828
|
+
}
|
|
829
|
+
}), e.length > 1 && A(e[0], e[e.length - 1]) && e.pop(), e;
|
|
830
|
+
}
|
|
831
|
+
function Gn(t) {
|
|
832
|
+
return t.length < 3 ? !1 : t.map((e, r) => {
|
|
833
|
+
const s = t[(r + 1) % t.length];
|
|
834
|
+
return (s[0] - e[0]) * (s[1] + e[1]);
|
|
835
|
+
}).reduce((e, r) => e + r, 0) > 0;
|
|
836
|
+
}
|
|
837
|
+
function K(t, n) {
|
|
838
|
+
return t.length < 3 || Gn(t) === n ? t : [...t].reverse();
|
|
839
|
+
}
|
|
840
|
+
function jn(t, n = {}) {
|
|
841
|
+
return Rn(t, (r) => zn(r, n));
|
|
842
|
+
}
|
|
843
|
+
function _n(t, n = {}) {
|
|
844
|
+
if (t instanceof h)
|
|
845
|
+
return t.figures.map((e) => _n(e, n));
|
|
846
|
+
if (t instanceof m) {
|
|
847
|
+
const e = K(
|
|
848
|
+
B(t.contour.segments, n),
|
|
849
|
+
!1
|
|
850
|
+
), r = t.holes.map(
|
|
851
|
+
(s) => K(B(s.segments, n), !0)
|
|
852
|
+
);
|
|
853
|
+
return [e, ...r];
|
|
854
|
+
}
|
|
855
|
+
return t instanceof P ? K(B(t.segments, n), !1) : t instanceof b ? B(t.segments, n) : rt(t, n);
|
|
856
|
+
}
|
|
857
|
+
function pt(t) {
|
|
858
|
+
if (t instanceof h)
|
|
859
|
+
return an(t);
|
|
860
|
+
if (t instanceof m)
|
|
861
|
+
return fn(t);
|
|
862
|
+
if (t instanceof P)
|
|
863
|
+
return `<path d="${un(t)}" />`;
|
|
864
|
+
if (t instanceof b)
|
|
865
|
+
return `<path d="${ln(t)}" />`;
|
|
866
|
+
if (It(t))
|
|
867
|
+
return `<path d="${`M ${t.firstPoint.join(" ")}`} ${hn(
|
|
868
|
+
t
|
|
765
869
|
)}" />`;
|
|
766
870
|
throw new Error("Unknown shape type");
|
|
767
871
|
}
|
|
768
|
-
const
|
|
769
|
-
if (!("shape" in
|
|
770
|
-
const { color: e } =
|
|
771
|
-
return e ? `<g stroke="${e}">${
|
|
772
|
-
},
|
|
773
|
-
function
|
|
774
|
-
margin:
|
|
872
|
+
const dt = (t) => "shape" in t ? t.shape : t, mt = (t, n) => {
|
|
873
|
+
if (!("shape" in t)) return n;
|
|
874
|
+
const { color: e } = t;
|
|
875
|
+
return e ? `<g stroke="${e}">${n}</g>` : n;
|
|
876
|
+
}, Pt = (t) => new cn(t.xMin, -t.yMax, t.xMax, -t.yMin);
|
|
877
|
+
function te(t, {
|
|
878
|
+
margin: n = 1,
|
|
775
879
|
unit: e = null,
|
|
776
|
-
viewBox:
|
|
880
|
+
viewBox: r
|
|
777
881
|
} = {}) {
|
|
778
|
-
if (Array.isArray(
|
|
779
|
-
const i =
|
|
780
|
-
`),
|
|
781
|
-
return
|
|
782
|
-
}
|
|
783
|
-
const
|
|
784
|
-
return
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
882
|
+
if (Array.isArray(t)) {
|
|
883
|
+
const i = t.map((f) => dt(f).mirror()), o = i.map((f, a) => mt(t[a], pt(f))).join(`
|
|
884
|
+
`), c = i.slice(1).reduce((f, a) => f.merge(a.boundingBox), i[0].boundingBox);
|
|
885
|
+
return ot(o, r ? Pt(r) : c, n, e);
|
|
886
|
+
}
|
|
887
|
+
const s = dt(t).mirror();
|
|
888
|
+
return ot(
|
|
889
|
+
mt(t, pt(s)),
|
|
890
|
+
r ? Pt(r) : s.boundingBox,
|
|
891
|
+
n,
|
|
788
892
|
e
|
|
789
893
|
);
|
|
790
894
|
}
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
return new
|
|
794
|
-
if (
|
|
795
|
-
return new
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
895
|
+
const Tt = (t) => {
|
|
896
|
+
if (t.type === "LINE")
|
|
897
|
+
return new v(t.firstPoint, t.lastPoint);
|
|
898
|
+
if (t.type === "ARC")
|
|
899
|
+
return new y(
|
|
900
|
+
t.firstPoint,
|
|
901
|
+
t.lastPoint,
|
|
902
|
+
t.center,
|
|
903
|
+
t.clockwise
|
|
800
904
|
);
|
|
801
|
-
if (
|
|
802
|
-
return new
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
905
|
+
if (t.type === "ELLIPSE_ARC")
|
|
906
|
+
return new vt(
|
|
907
|
+
t.firstPoint,
|
|
908
|
+
t.lastPoint,
|
|
909
|
+
t.center,
|
|
910
|
+
t.majorRadius,
|
|
911
|
+
t.minorRadius,
|
|
912
|
+
t.tiltAngle,
|
|
913
|
+
t.clockwise,
|
|
810
914
|
{ angleUnits: "rad" }
|
|
811
915
|
);
|
|
812
|
-
if (
|
|
813
|
-
return new
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
916
|
+
if (t.type === "QUADRATIC_BEZIER")
|
|
917
|
+
return new bt(
|
|
918
|
+
t.firstPoint,
|
|
919
|
+
t.lastPoint,
|
|
920
|
+
t.controlPoint
|
|
817
921
|
);
|
|
818
|
-
if (
|
|
819
|
-
return new
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
922
|
+
if (t.type === "CUBIC_BEZIER")
|
|
923
|
+
return new _(
|
|
924
|
+
t.firstPoint,
|
|
925
|
+
t.lastPoint,
|
|
926
|
+
t.firstControlPoint,
|
|
927
|
+
t.lastControlPoint
|
|
824
928
|
);
|
|
825
929
|
throw new Error("Unknown segment type");
|
|
826
|
-
},
|
|
827
|
-
const
|
|
828
|
-
return new
|
|
829
|
-
},
|
|
830
|
-
const
|
|
831
|
-
return new m(
|
|
832
|
-
},
|
|
833
|
-
const
|
|
834
|
-
return new h(
|
|
930
|
+
}, Z = (t) => {
|
|
931
|
+
const n = t.segments.map(Tt);
|
|
932
|
+
return new P(n);
|
|
933
|
+
}, zt = (t) => {
|
|
934
|
+
const n = Z(t.contour), e = t.holes.map(Z);
|
|
935
|
+
return new m(n, e);
|
|
936
|
+
}, $n = (t) => {
|
|
937
|
+
const n = t.figures.map(zt);
|
|
938
|
+
return new h(n);
|
|
835
939
|
};
|
|
836
|
-
function
|
|
837
|
-
if (
|
|
838
|
-
return
|
|
839
|
-
if (
|
|
840
|
-
return
|
|
841
|
-
if (
|
|
842
|
-
return
|
|
843
|
-
if (
|
|
844
|
-
return
|
|
940
|
+
function ne(t) {
|
|
941
|
+
if (t.type === "DIAGRAM")
|
|
942
|
+
return $n(t);
|
|
943
|
+
if (t.type === "FIGURE")
|
|
944
|
+
return zt(t);
|
|
945
|
+
if (t.type === "LOOP")
|
|
946
|
+
return Z(t);
|
|
947
|
+
if (t.type === "LINE" || t.type === "ARC" || t.type === "ELLIPSE_ARC" || t.type === "CUBIC_BEZIER")
|
|
948
|
+
return Tt(t);
|
|
845
949
|
throw new Error("Unknown shape type");
|
|
846
950
|
}
|
|
847
|
-
const
|
|
848
|
-
function
|
|
849
|
-
const e = Math.cos(
|
|
850
|
-
return [e,
|
|
951
|
+
const wt = Math.PI / 180, Un = 180 / Math.PI;
|
|
952
|
+
function ee(t, n) {
|
|
953
|
+
const e = Math.cos(n * wt) * t, r = Math.sin(n * wt) * t;
|
|
954
|
+
return [e, r];
|
|
851
955
|
}
|
|
852
|
-
function
|
|
853
|
-
const e = Math.sqrt(
|
|
854
|
-
return [e,
|
|
956
|
+
function re([t, n]) {
|
|
957
|
+
const e = Math.sqrt(t * t + n * n), r = Math.atan2(n, t) * Un;
|
|
958
|
+
return [e, r];
|
|
855
959
|
}
|
|
856
960
|
export {
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
961
|
+
wt as DEG2RAD,
|
|
962
|
+
oe as DrawingPen,
|
|
963
|
+
Un as RAD2DEG,
|
|
964
|
+
re as cartesianToPolar,
|
|
965
|
+
T as chamfer,
|
|
966
|
+
Qn as confineStrand,
|
|
967
|
+
Ft as cut,
|
|
968
|
+
ce as draw,
|
|
969
|
+
Jn as eraseStrand,
|
|
970
|
+
fe as exportJSON,
|
|
971
|
+
te as exportSVG,
|
|
972
|
+
R as fillet,
|
|
973
|
+
gn as fuse,
|
|
870
974
|
z as fuseAll,
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
975
|
+
ne as importJSON,
|
|
976
|
+
Xn as intersect,
|
|
977
|
+
Yn as offset,
|
|
978
|
+
Zn as outlineStroke,
|
|
979
|
+
ee as polarToCartesian,
|
|
980
|
+
Wn as selectCorners,
|
|
981
|
+
pt as svgBody,
|
|
982
|
+
jn as tesselate,
|
|
983
|
+
_n as tesselatePoints
|
|
878
984
|
};
|
|
879
985
|
//# sourceMappingURL=pantograph.js.map
|