dielines 0.10.1 → 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/dielines.js +90 -90
- package/dist/dielines.js.map +1 -1
- package/dist/dielines.umd.cjs +1 -1
- package/dist/dielines.umd.cjs.map +1 -1
- package/package.json +3 -3
package/dist/dielines.js
CHANGED
|
@@ -3,13 +3,13 @@ var Ui = (i, t, e) => t in i ? Di(i, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var St = (i, t, e) => Ui(i, typeof t != "symbol" ? t + "" : t, e);
|
|
4
4
|
var Yi = Object.defineProperty, si = (i) => {
|
|
5
5
|
throw TypeError(i);
|
|
6
|
-
}, Xi = (i, t, e) => t in i ? Yi(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e,
|
|
6
|
+
}, Xi = (i, t, e) => t in i ? Yi(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, _ = (i, t, e) => Xi(i, typeof t != "symbol" ? t + "" : t, e), en = (i, t, e) => t.has(i) || si("Cannot " + e), Mt = (i, t, e) => (en(i, t, "read from private field"), e ? e.call(i) : t.get(i)), ri = (i, t, e) => t.has(i) ? si("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), Oe = (i, t, e, n) => (en(i, t, "write to private field"), t.set(i, e), e), Mn = (i, t, e) => (en(i, t, "access private method"), e);
|
|
7
7
|
function me(i, t, e, n) {
|
|
8
8
|
return i <= n && t >= e;
|
|
9
9
|
}
|
|
10
10
|
let oe = class Qt {
|
|
11
11
|
constructor(t = 1 / 0, e = 1 / 0, n = -1 / 0, s = -1 / 0) {
|
|
12
|
-
|
|
12
|
+
_(this, "xMin"), _(this, "yMin"), _(this, "xMax"), _(this, "yMax"), this.xMin = t, this.yMin = e, this.xMax = n, this.yMax = s;
|
|
13
13
|
}
|
|
14
14
|
get width() {
|
|
15
15
|
return this.xMax - this.xMin;
|
|
@@ -78,7 +78,7 @@ function At(i, t = 1e-9) {
|
|
|
78
78
|
).values()
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
const $t = Math.PI / 180, sn = 180 / Math.PI, it = (i) => `[${i[0]}, ${i[1]}]`, R = ([i, t], [e, n], s = 1e-9) => Math.abs(i - e) <= s && Math.abs(t - n) <= s, X = ([i, t], [e, n]) => [i + e, t + n], q = ([i, t], [e, n]) => [i - e, t - n], yt = ([i, t]) => i * i + t * t, Wi = ([i, t]) => Math.sqrt(yt([i, t])), Q = ([i, t], e) => [i * e, t * e],
|
|
81
|
+
const $t = Math.PI / 180, sn = 180 / Math.PI, it = (i) => `[${i[0]}, ${i[1]}]`, R = ([i, t], [e, n], s = 1e-9) => Math.abs(i - e) <= s && Math.abs(t - n) <= s, X = ([i, t], [e, n]) => [i + e, t + n], q = ([i, t], [e, n]) => [i - e, t - n], yt = ([i, t]) => i * i + t * t, Wi = ([i, t]) => Math.sqrt(yt([i, t])), Q = ([i, t], e) => [i * e, t * e], Ft = ([i, t], [e, n] = [0, 0]) => (i - e) ** 2 + (t - n) ** 2, J = (i, t = [0, 0]) => Math.sqrt(Ft(i, t));
|
|
82
82
|
function bt([i, t], [e, n]) {
|
|
83
83
|
return i * n - t * e;
|
|
84
84
|
}
|
|
@@ -145,7 +145,7 @@ const Bt = (i, t) => {
|
|
|
145
145
|
};
|
|
146
146
|
let ct = class ai {
|
|
147
147
|
constructor(t) {
|
|
148
|
-
|
|
148
|
+
_(this, "_matrix", [1, 0, 0, 0, 1, 0, 0, 0, 1]), t && (this._matrix = [...t]);
|
|
149
149
|
}
|
|
150
150
|
clone() {
|
|
151
151
|
return new ai(this._matrix);
|
|
@@ -196,7 +196,7 @@ let ct = class ai {
|
|
|
196
196
|
return Math.sqrt(t * t + e * e);
|
|
197
197
|
}
|
|
198
198
|
};
|
|
199
|
-
class
|
|
199
|
+
class _t {
|
|
200
200
|
translateX(t) {
|
|
201
201
|
const e = new ct().translate(t, 0);
|
|
202
202
|
return this.transform(e);
|
|
@@ -233,9 +233,9 @@ class Ft {
|
|
|
233
233
|
return t === "x" ? n.mirrorX() : t === "y" ? n.mirrorY() : n.mirrorLine(t, e), this.transform(n);
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
|
-
let ae = class extends
|
|
236
|
+
let ae = class extends _t {
|
|
237
237
|
constructor(t, e) {
|
|
238
|
-
super(),
|
|
238
|
+
super(), _(this, "precision", 1e-9), this.firstPoint = t, this.lastPoint = e, this.firstPoint = t, this.lastPoint = e;
|
|
239
239
|
}
|
|
240
240
|
get repr() {
|
|
241
241
|
return `${this.segmentType} ${it(this.firstPoint)} - ${it(
|
|
@@ -250,7 +250,7 @@ let ae = class extends Ft {
|
|
|
250
250
|
}
|
|
251
251
|
}, D = class jt extends ae {
|
|
252
252
|
constructor() {
|
|
253
|
-
super(...arguments),
|
|
253
|
+
super(...arguments), _(this, "segmentType", "LINE"), _(this, "_V", null), _(this, "_slope", null), _(this, "_yIntercept", null), _(this, "_boundingBox", null);
|
|
254
254
|
}
|
|
255
255
|
isValidParameter(t) {
|
|
256
256
|
const e = this.length * this.precision;
|
|
@@ -263,7 +263,7 @@ let ae = class extends Ft {
|
|
|
263
263
|
return J(this.firstPoint, this.lastPoint);
|
|
264
264
|
}
|
|
265
265
|
get squareLength() {
|
|
266
|
-
return
|
|
266
|
+
return Ft(this.firstPoint, this.lastPoint);
|
|
267
267
|
}
|
|
268
268
|
get V() {
|
|
269
269
|
return this._V === null && (this._V = q(this.lastPoint, this.firstPoint)), this._V;
|
|
@@ -367,7 +367,7 @@ function Re(i, t, e, n = 1e-9) {
|
|
|
367
367
|
let s = t - i;
|
|
368
368
|
return e && (s = -s), s < 0 && (s += 2 * Math.PI), s > 2 * Math.PI - n ? 0 : s;
|
|
369
369
|
}
|
|
370
|
-
const
|
|
370
|
+
const Fe = (i, t, e) => {
|
|
371
371
|
const n = bt(i.V, t.V), s = yt(i.V), r = yt(t.V), o = e ? e * e : i.precision * t.precision;
|
|
372
372
|
if (n * n < s * r * o)
|
|
373
373
|
return "parallel";
|
|
@@ -378,7 +378,7 @@ const _e = (i, t, e) => {
|
|
|
378
378
|
};
|
|
379
379
|
};
|
|
380
380
|
function hi(i, t, e = !1, n) {
|
|
381
|
-
const s =
|
|
381
|
+
const s = Fe(i, t, n);
|
|
382
382
|
if (s === "parallel") {
|
|
383
383
|
if (!e) return null;
|
|
384
384
|
if (i.isSame(t)) return i;
|
|
@@ -405,7 +405,7 @@ const ge = (i, t) => {
|
|
|
405
405
|
};
|
|
406
406
|
let z = class qt extends ae {
|
|
407
407
|
constructor(t, e, n, s = !1, { ignoreChecks: r = !1 } = {}) {
|
|
408
|
-
if (super(t, e),
|
|
408
|
+
if (super(t, e), _(this, "segmentType", "ARC"), _(this, "center"), _(this, "clockwise"), _(this, "_coefficients", null), _(this, "_angularLength", null), _(this, "_radius", null), _(this, "_firstAngle", null), _(this, "_lastAngle", null), _(this, "_boundingBox", null), this.center = n, this.clockwise = s, !r) {
|
|
409
409
|
if (R(t, e))
|
|
410
410
|
throw new Error("Invalid arc, cannot be a full circle");
|
|
411
411
|
if (Math.abs(this.radius - J(this.lastPoint, this.center)) > this.precision)
|
|
@@ -531,8 +531,8 @@ let z = class qt extends ae {
|
|
|
531
531
|
const [e, n] = ge(t, this.center);
|
|
532
532
|
return this.isValidParameter(this.angleToParam(n)) ? Math.abs(e - this.radius) : Math.sqrt(
|
|
533
533
|
Math.min(
|
|
534
|
-
|
|
535
|
-
|
|
534
|
+
Ft(t, this.firstPoint),
|
|
535
|
+
Ft(t, this.lastPoint)
|
|
536
536
|
)
|
|
537
537
|
);
|
|
538
538
|
}
|
|
@@ -600,7 +600,7 @@ let z = class qt extends ae {
|
|
|
600
600
|
}
|
|
601
601
|
};
|
|
602
602
|
function Ki(i, t, e) {
|
|
603
|
-
const n = new D(t, i), s = new D(t, e), r = nt(n.tangentAtFirstPoint), o = nt(s.tangentAtLastPoint), a =
|
|
603
|
+
const n = new D(t, i), s = new D(t, e), r = nt(n.tangentAtFirstPoint), o = nt(s.tangentAtLastPoint), a = Fe(
|
|
604
604
|
{ firstPoint: n.midPoint, V: r, precision: 1e-9 },
|
|
605
605
|
{ firstPoint: s.midPoint, V: o, precision: 1e-9 }
|
|
606
606
|
);
|
|
@@ -619,7 +619,7 @@ function Ki(i, t, e) {
|
|
|
619
619
|
);
|
|
620
620
|
}
|
|
621
621
|
function li(i, t, e) {
|
|
622
|
-
const n = new D(i, t), s = nt(n.tangentAtFirstPoint), r =
|
|
622
|
+
const n = new D(i, t), s = nt(n.tangentAtFirstPoint), r = Fe(
|
|
623
623
|
{ firstPoint: n.midPoint, V: s, precision: 1e-9 },
|
|
624
624
|
{
|
|
625
625
|
firstPoint: i,
|
|
@@ -661,7 +661,7 @@ function xn(i, t = 0, e = 1, n = 110, s = 1e3) {
|
|
|
661
661
|
const vn = 0.381966, ts = 1e-11;
|
|
662
662
|
class es {
|
|
663
663
|
constructor(t, e = 148e-10, n = 500) {
|
|
664
|
-
|
|
664
|
+
_(this, "xmin"), _(this, "fval"), _(this, "iter"), _(this, "funcalls"), _(this, "brack"), this.func = t, this.tol = e, this.maxiter = n, this.func = t, this.tol = e, this.maxiter = n, this.xmin = 1 / 0, this.fval = 1 / 0, this.iter = 0, this.funcalls = 0, this.brack = null;
|
|
665
665
|
}
|
|
666
666
|
setBracket(t = null) {
|
|
667
667
|
this.brack = t;
|
|
@@ -1306,7 +1306,7 @@ function Xe(i, t, e, n, s) {
|
|
|
1306
1306
|
if (de("startRow", t), de("endRow", e), de("startColumn", n), de("endColumn", s), t > e || n > s || t < 0 || t >= i.rows || e < 0 || e >= i.rows || n < 0 || n >= i.columns || s < 0 || s >= i.columns)
|
|
1307
1307
|
throw new RangeError("Submatrix indices are out of range");
|
|
1308
1308
|
}
|
|
1309
|
-
function
|
|
1309
|
+
function _e(i, t = 0) {
|
|
1310
1310
|
let e = [];
|
|
1311
1311
|
for (let n = 0; n < i; n++)
|
|
1312
1312
|
e.push(t);
|
|
@@ -1321,14 +1321,14 @@ function Vt(i) {
|
|
|
1321
1321
|
throw new Error("Empty matrix has no elements to index");
|
|
1322
1322
|
}
|
|
1323
1323
|
function gs(i) {
|
|
1324
|
-
let t =
|
|
1324
|
+
let t = _e(i.rows);
|
|
1325
1325
|
for (let e = 0; e < i.rows; ++e)
|
|
1326
1326
|
for (let n = 0; n < i.columns; ++n)
|
|
1327
1327
|
t[e] += i.get(e, n);
|
|
1328
1328
|
return t;
|
|
1329
1329
|
}
|
|
1330
1330
|
function ps(i) {
|
|
1331
|
-
let t =
|
|
1331
|
+
let t = _e(i.columns);
|
|
1332
1332
|
for (let e = 0; e < i.rows; ++e)
|
|
1333
1333
|
for (let n = 0; n < i.columns; ++n)
|
|
1334
1334
|
t[n] += i.get(e, n);
|
|
@@ -1342,14 +1342,14 @@ function ws(i) {
|
|
|
1342
1342
|
return t;
|
|
1343
1343
|
}
|
|
1344
1344
|
function ds(i) {
|
|
1345
|
-
let t =
|
|
1345
|
+
let t = _e(i.rows, 1);
|
|
1346
1346
|
for (let e = 0; e < i.rows; ++e)
|
|
1347
1347
|
for (let n = 0; n < i.columns; ++n)
|
|
1348
1348
|
t[e] *= i.get(e, n);
|
|
1349
1349
|
return t;
|
|
1350
1350
|
}
|
|
1351
1351
|
function Ps(i) {
|
|
1352
|
-
let t =
|
|
1352
|
+
let t = _e(i.columns, 1);
|
|
1353
1353
|
for (let e = 0; e < i.rows; ++e)
|
|
1354
1354
|
for (let n = 0; n < i.columns; ++n)
|
|
1355
1355
|
t[n] *= i.get(e, n);
|
|
@@ -2009,7 +2009,7 @@ let Z = class st {
|
|
|
2009
2009
|
strassen3x3(t) {
|
|
2010
2010
|
t = E.checkMatrix(t);
|
|
2011
2011
|
let e = new E(3, 3);
|
|
2012
|
-
const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), S = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + S), k = (-n + o + a) * (m - w + M), j = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), I = (n + s + r - a - h - l - c) * f, $ = c * (-m + g + p - M - f - P + b),
|
|
2012
|
+
const n = this.get(0, 0), s = this.get(0, 1), r = this.get(0, 2), o = this.get(1, 0), a = this.get(1, 1), h = this.get(1, 2), l = this.get(2, 0), c = this.get(2, 1), u = this.get(2, 2), m = t.get(0, 0), w = t.get(0, 1), g = t.get(0, 2), p = t.get(1, 0), M = t.get(1, 1), f = t.get(1, 2), P = t.get(2, 0), b = t.get(2, 1), S = t.get(2, 2), C = (n + s + r - o - a - c - u) * M, V = (n - o) * (-w + M), v = a * (-m + w + p - M - f - P + S), k = (-n + o + a) * (m - w + M), j = (o + a) * (-m + w), d = n * m, x = (-n + l + c) * (m - g + f), A = (-n + l) * (g - f), y = (l + c) * (-m + g), I = (n + s + r - a - h - l - c) * f, $ = c * (-m + g + p - M - f - P + b), F = (-r + c + u) * (M + P - b), W = (r - u) * (M - b), L = r * P, N = (c + u) * (-P + b), B = (-r + a + h) * (f + P - S), Y = (r - h) * (f - S), H = (a + h) * (-P + S), T = s * p, U = h * b, tt = o * g, K = l * w, G = u * S, Ve = d + L + T, je = C + k + j + d + F + L + N, qe = d + x + y + I + L + B + H, Ne = V + v + k + d + L + B + Y, he = V + k + j + d + U, le = L + B + Y + H + tt, ue = d + x + A + $ + F + W + L, ce = F + W + L + N + K, fe = d + x + A + y + G;
|
|
2013
2013
|
return e.set(0, 0, Ve), e.set(0, 1, je), e.set(0, 2, qe), e.set(1, 0, Ne), e.set(1, 1, he), e.set(1, 2, le), e.set(2, 0, ue), e.set(2, 1, ce), e.set(2, 2, fe), e;
|
|
2014
2014
|
}
|
|
2015
2015
|
mmulStrassen(t) {
|
|
@@ -2048,12 +2048,12 @@ let Z = class st {
|
|
|
2048
2048
|
st.add(V, k),
|
|
2049
2049
|
p,
|
|
2050
2050
|
M
|
|
2051
|
-
),
|
|
2052
|
-
|
|
2051
|
+
), F = st.add(j, A);
|
|
2052
|
+
F.sub(y), F.add($);
|
|
2053
2053
|
let W = st.add(x, y), L = st.add(d, A), N = st.sub(j, d);
|
|
2054
2054
|
N.add(x), N.add(I);
|
|
2055
|
-
let B = st.zeros(2 *
|
|
2056
|
-
return B = B.setSubMatrix(
|
|
2055
|
+
let B = st.zeros(2 * F.rows, 2 * F.columns);
|
|
2056
|
+
return B = B.setSubMatrix(F, 0, 0), B = B.setSubMatrix(W, F.rows, 0), B = B.setSubMatrix(L, 0, F.columns), B = B.setSubMatrix(N, F.rows, F.columns), B.subMatrix(0, w - 1, 0, g - 1);
|
|
2057
2057
|
}
|
|
2058
2058
|
return c(e, t, h, l);
|
|
2059
2059
|
}
|
|
@@ -2394,7 +2394,7 @@ Z.prototype.tensorProduct = Z.prototype.kroneckerProduct;
|
|
|
2394
2394
|
var Pe, ze, Me;
|
|
2395
2395
|
let E = (Me = class extends Z {
|
|
2396
2396
|
constructor(i, t) {
|
|
2397
|
-
if (super(), ri(this, Pe),
|
|
2397
|
+
if (super(), ri(this, Pe), _(this, "data"), Me.isMatrix(i))
|
|
2398
2398
|
Mn(this, Pe, ze).call(this, i.rows, i.columns), Me.copy(i, this);
|
|
2399
2399
|
else if (Number.isInteger(i) && i >= 0)
|
|
2400
2400
|
Mn(this, Pe, ze).call(this, i, t);
|
|
@@ -2470,7 +2470,7 @@ ze = function(i, t) {
|
|
|
2470
2470
|
}, Me);
|
|
2471
2471
|
ms(Z, E);
|
|
2472
2472
|
var ht;
|
|
2473
|
-
const
|
|
2473
|
+
const Fs = class We extends Z {
|
|
2474
2474
|
/**
|
|
2475
2475
|
* @param {number | AbstractMatrix | ArrayLike<ArrayLike<number>>} diagonalSize
|
|
2476
2476
|
* @return {this}
|
|
@@ -2626,7 +2626,7 @@ const _s = class We extends Z {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
};
|
|
2628
2628
|
ht = /* @__PURE__ */ new WeakMap();
|
|
2629
|
-
let te =
|
|
2629
|
+
let te = Fs;
|
|
2630
2630
|
te.prototype.klassType = "SymmetricMatrix";
|
|
2631
2631
|
let gi = class pi extends te {
|
|
2632
2632
|
/**
|
|
@@ -2709,7 +2709,7 @@ let Et = class extends Z {
|
|
|
2709
2709
|
super(), this.matrix = t, this.rows = e, this.columns = n;
|
|
2710
2710
|
}
|
|
2711
2711
|
};
|
|
2712
|
-
class
|
|
2712
|
+
class _s extends Et {
|
|
2713
2713
|
constructor(t, e) {
|
|
2714
2714
|
wt(t, e), super(t, t.rows, 1), this.column = e;
|
|
2715
2715
|
}
|
|
@@ -3170,10 +3170,10 @@ let Wt = class {
|
|
|
3170
3170
|
let A = f[v - 2];
|
|
3171
3171
|
f[v - 2] = 0;
|
|
3172
3172
|
for (let y = v - 2; y >= d; y--) {
|
|
3173
|
-
let I = xt(g[y], A), $ = g[y] / I,
|
|
3174
|
-
if (g[y] = I, y !== d && (A = -
|
|
3173
|
+
let I = xt(g[y], A), $ = g[y] / I, F = A / I;
|
|
3174
|
+
if (g[y] = I, y !== d && (A = -F * f[y - 1], f[y - 1] = $ * f[y - 1]), l)
|
|
3175
3175
|
for (let W = 0; W < s; W++)
|
|
3176
|
-
I = $ * M.get(W, y) +
|
|
3176
|
+
I = $ * M.get(W, y) + F * M.get(W, v - 1), M.set(W, v - 1, -F * M.get(W, y) + $ * M.get(W, v - 1)), M.set(W, y, I);
|
|
3177
3177
|
}
|
|
3178
3178
|
break;
|
|
3179
3179
|
}
|
|
@@ -3181,10 +3181,10 @@ let Wt = class {
|
|
|
3181
3181
|
let A = f[d - 1];
|
|
3182
3182
|
f[d - 1] = 0;
|
|
3183
3183
|
for (let y = d; y < v; y++) {
|
|
3184
|
-
let I = xt(g[y], A), $ = g[y] / I,
|
|
3185
|
-
if (g[y] = I, A = -
|
|
3184
|
+
let I = xt(g[y], A), $ = g[y] / I, F = A / I;
|
|
3185
|
+
if (g[y] = I, A = -F * f[y], f[y] = $ * f[y], h)
|
|
3186
3186
|
for (let W = 0; W < n; W++)
|
|
3187
|
-
I = $ * p.get(W, y) +
|
|
3187
|
+
I = $ * p.get(W, y) + F * p.get(W, d - 1), p.set(W, d - 1, -F * p.get(W, y) + $ * p.get(W, d - 1)), p.set(W, y, I);
|
|
3188
3188
|
}
|
|
3189
3189
|
break;
|
|
3190
3190
|
}
|
|
@@ -3195,10 +3195,10 @@ let Wt = class {
|
|
|
3195
3195
|
Math.abs(f[v - 2]),
|
|
3196
3196
|
Math.abs(g[d]),
|
|
3197
3197
|
Math.abs(f[d])
|
|
3198
|
-
), y = g[v - 1] / A, I = g[v - 2] / A, $ = f[v - 2] / A,
|
|
3198
|
+
), y = g[v - 1] / A, I = g[v - 2] / A, $ = f[v - 2] / A, F = g[d] / A, W = f[d] / A, L = ((I + y) * (I - y) + $ * $) / 2, N = y * $ * (y * $);
|
|
3199
3199
|
let B = 0;
|
|
3200
3200
|
(L !== 0 || N !== 0) && (L < 0 ? B = 0 - Math.sqrt(L * L + N) : B = Math.sqrt(L * L + N), B = N / (L + B));
|
|
3201
|
-
let Y = (
|
|
3201
|
+
let Y = (F + y) * (F - y) + B, H = F * W;
|
|
3202
3202
|
for (let T = d; T < v - 1; T++) {
|
|
3203
3203
|
let U = xt(Y, H);
|
|
3204
3204
|
U === 0 && (U = Number.MIN_VALUE);
|
|
@@ -3737,7 +3737,7 @@ O.LU = Le;
|
|
|
3737
3737
|
O.LuDecomposition = Le;
|
|
3738
3738
|
var er = O.Matrix = E;
|
|
3739
3739
|
O.MatrixColumnSelectionView = Ls;
|
|
3740
|
-
O.MatrixColumnView =
|
|
3740
|
+
O.MatrixColumnView = _s;
|
|
3741
3741
|
O.MatrixFlipColumnView = Bs;
|
|
3742
3742
|
O.MatrixFlipRowView = Vs;
|
|
3743
3743
|
O.MatrixRowSelectionView = qs;
|
|
@@ -3864,44 +3864,44 @@ function rr(i, t, e, n, s) {
|
|
|
3864
3864
|
(L == 0 || U < d) && (k = N, j = B, d = U);
|
|
3865
3865
|
}
|
|
3866
3866
|
const x = k, A = j;
|
|
3867
|
-
let y = 0, I = 0, $ = 0,
|
|
3867
|
+
let y = 0, I = 0, $ = 0, F = 0;
|
|
3868
3868
|
if (x < 0) {
|
|
3869
3869
|
const L = Math.sqrt(-x);
|
|
3870
|
-
if (y = f + L, I = P + L * A, $ = f - L,
|
|
3870
|
+
if (y = f + L, I = P + L * A, $ = f - L, F = P - L * A, Math.abs(F) < Math.abs(I) ? F = n / I : Math.abs(F) > Math.abs(I) && (I = n / F), Math.abs(y) != Math.abs($)) {
|
|
3871
3871
|
let N = null, B = null;
|
|
3872
3872
|
if (Math.abs(y) < Math.abs($)) {
|
|
3873
|
-
const H = (e - I * $) /
|
|
3873
|
+
const H = (e - I * $) / F, T = (t - F - I) / $;
|
|
3874
3874
|
N = [i - $, H, T], B = [$, $, $];
|
|
3875
3875
|
} else {
|
|
3876
|
-
const H = (e - y *
|
|
3876
|
+
const H = (e - y * F) / I, T = (t - F - I) / y, U = i - y;
|
|
3877
3877
|
N = [y, y, y], B = [U, H, T];
|
|
3878
3878
|
}
|
|
3879
3879
|
let Y = 0;
|
|
3880
3880
|
for (let H = 0; H < 3; H++) {
|
|
3881
3881
|
const T = N[H], U = B[H];
|
|
3882
3882
|
if (isFinite(T) && isFinite(U)) {
|
|
3883
|
-
const tt = r(T, I, U,
|
|
3883
|
+
const tt = r(T, I, U, F);
|
|
3884
3884
|
(H == 0 || tt < Y) && (y = T, $ = U, Y = tt);
|
|
3885
3885
|
}
|
|
3886
3886
|
}
|
|
3887
3887
|
}
|
|
3888
3888
|
} else if (x == 0) {
|
|
3889
3889
|
const L = n - P * P;
|
|
3890
|
-
y = f, I = P + Math.sqrt(-L), $ = f,
|
|
3890
|
+
y = f, I = P + Math.sqrt(-L), $ = f, F = P - Math.sqrt(-L), Math.abs(I) > Math.abs(F) ? F = n / I : Math.abs(F) > Math.abs(I) && (I = n / F);
|
|
3891
3891
|
} else
|
|
3892
3892
|
return [];
|
|
3893
|
-
let W = o(y, I, $,
|
|
3893
|
+
let W = o(y, I, $, F);
|
|
3894
3894
|
for (let L = 0; L < 8 && W != 0; L++) {
|
|
3895
|
-
const N = I *
|
|
3895
|
+
const N = I * F - n, B = I * $ + y * F - e, Y = I + y * $ + F - t, H = y + $ - i, T = y - $, U = I * I - I * ($ * T + 2 * F) + F * (y * T + F);
|
|
3896
3896
|
if (U == 0)
|
|
3897
3897
|
break;
|
|
3898
|
-
const tt = 1 / U, K =
|
|
3898
|
+
const tt = 1 / U, K = F - I, G = I * $ - y * F, Ve = T * N + K * B + G * Y - (I * K + y * G) * H, je = (y * T + K) * N - I * (T * B + K * Y + G * H), qe = -T * N - K * B - G * Y + ($ * G + F * K) * H, Ne = -($ * T + K) * N + F * (T * B + K * Y + G * H), he = y - tt * Ve, le = I - tt * je, ue = $ - tt * qe, ce = F - tt * Ne, fe = o(he, le, ue, ce);
|
|
3899
3899
|
if (fe < W)
|
|
3900
|
-
y = he, I = le, $ = ue,
|
|
3900
|
+
y = he, I = le, $ = ue, F = ce, W = fe;
|
|
3901
3901
|
else
|
|
3902
3902
|
break;
|
|
3903
3903
|
}
|
|
3904
|
-
return [y, I, $,
|
|
3904
|
+
return [y, I, $, F];
|
|
3905
3905
|
}
|
|
3906
3906
|
function or(i, t) {
|
|
3907
3907
|
const e = -0.3333333333333333 * i, n = 0.5 * t;
|
|
@@ -3964,7 +3964,7 @@ function un(i, t) {
|
|
|
3964
3964
|
}
|
|
3965
3965
|
let rt = class zt extends ae {
|
|
3966
3966
|
constructor(t, e, n, s) {
|
|
3967
|
-
super(t, e),
|
|
3967
|
+
super(t, e), _(this, "segmentType", "CUBIC_BEZIER"), _(this, "firstControlPoint"), _(this, "lastControlPoint"), _(this, "_boundingBox", null), _(this, "_polynomialCoefficients", null), this.firstControlPoint = n, this.lastControlPoint = s;
|
|
3968
3968
|
}
|
|
3969
3969
|
get midPoint() {
|
|
3970
3970
|
return this.paramPoint(0.5);
|
|
@@ -4020,7 +4020,7 @@ let rt = class zt extends ae {
|
|
|
4020
4020
|
return t.segmentType !== "CUBIC_BEZIER" ? !1 : R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) && R(this.firstControlPoint, t.firstControlPoint) && R(this.lastControlPoint, t.lastControlPoint);
|
|
4021
4021
|
}
|
|
4022
4022
|
distanceFrom(t) {
|
|
4023
|
-
const e = ui((n) =>
|
|
4023
|
+
const e = ui((n) => Ft(this.paramPoint(n), t), this.precision);
|
|
4024
4024
|
return e.argMin < -this.precision || e.argMin > 1 + this.precision ? Math.min(
|
|
4025
4025
|
J(this.firstPoint, t),
|
|
4026
4026
|
J(this.lastPoint, t)
|
|
@@ -4168,7 +4168,7 @@ let rt = class zt extends ae {
|
|
|
4168
4168
|
ignoreChecks: h = !1,
|
|
4169
4169
|
angleUnits: l = "deg"
|
|
4170
4170
|
} = {}) {
|
|
4171
|
-
super(t, e),
|
|
4171
|
+
super(t, e), _(this, "segmentType", "ELLIPSE_ARC"), _(this, "precision", 1e-6), _(this, "majorRadius"), _(this, "minorRadius"), _(this, "center"), _(this, "tiltAngle"), _(this, "clockwise"), _(this, "_coefficients", null), _(this, "_boundingBox"), _(this, "_linearExentricity"), _(this, "_exentricity"), _(this, "_focals"), _(this, "_ellipseReferenceFrameTransform"), _(this, "_reverseEllipseReferenceFrameTransform"), _(this, "_rotateFromEllipseReferenceFrame"), _(this, "_firstAngle"), _(this, "_lastAngle"), _(this, "_deltaAngle"), this.center = n;
|
|
4172
4172
|
const c = s >= r;
|
|
4173
4173
|
this.majorRadius = c ? s : r, this.minorRadius = c ? r : s;
|
|
4174
4174
|
const u = l === "deg" ? o * $t : o;
|
|
@@ -4471,7 +4471,7 @@ function cr(i, t, e) {
|
|
|
4471
4471
|
}
|
|
4472
4472
|
let et = class Dt extends ae {
|
|
4473
4473
|
constructor(t, e, n) {
|
|
4474
|
-
super(t, e),
|
|
4474
|
+
super(t, e), _(this, "segmentType", "QUADRATIC_BEZIER"), _(this, "controlPoint"), _(this, "_boundingBox", null), _(this, "_polynomialCoefficients", null), this.controlPoint = n;
|
|
4475
4475
|
}
|
|
4476
4476
|
get midPoint() {
|
|
4477
4477
|
return this.paramPoint(0.5);
|
|
@@ -4518,7 +4518,7 @@ let et = class Dt extends ae {
|
|
|
4518
4518
|
return t.segmentType !== "QUADRATIC_BEZIER" ? !1 : R(this.firstPoint, t.firstPoint) && R(this.lastPoint, t.lastPoint) && R(this.controlPoint, t.controlPoint);
|
|
4519
4519
|
}
|
|
4520
4520
|
distanceFrom(t) {
|
|
4521
|
-
const e = ui((n) =>
|
|
4521
|
+
const e = ui((n) => Ft(this.paramPoint(n), t), this.precision);
|
|
4522
4522
|
return e.argMin < -this.precision || e.argMin > 1 + this.precision ? Math.min(
|
|
4523
4523
|
J(this.firstPoint, t),
|
|
4524
4524
|
J(this.lastPoint, t)
|
|
@@ -4946,7 +4946,7 @@ function Rr(i) {
|
|
|
4946
4946
|
Math.max(...r)
|
|
4947
4947
|
);
|
|
4948
4948
|
}
|
|
4949
|
-
function
|
|
4949
|
+
function Fn(i, t) {
|
|
4950
4950
|
const e = [];
|
|
4951
4951
|
for (let n = 1; n < i.length; n++) {
|
|
4952
4952
|
const s = i[n];
|
|
@@ -5024,11 +5024,11 @@ class Ir {
|
|
|
5024
5024
|
return this.distances[3];
|
|
5025
5025
|
}
|
|
5026
5026
|
}
|
|
5027
|
-
function
|
|
5028
|
-
const e = Cr(t, i), n =
|
|
5027
|
+
function _n(i, t) {
|
|
5028
|
+
const e = Cr(t, i), n = Fn(
|
|
5029
5029
|
e.topHull,
|
|
5030
5030
|
i.negativeThickness
|
|
5031
|
-
), s =
|
|
5031
|
+
), s = Fn(
|
|
5032
5032
|
e.bottomHull,
|
|
5033
5033
|
i.positiveThickness
|
|
5034
5034
|
), r = e.endDistance >= i.negativeThickness && e.endDistance <= i.positiveThickness;
|
|
@@ -5044,10 +5044,10 @@ function Fn(i, t) {
|
|
|
5044
5044
|
return o.length === 2 ? new Ht(o[0], o[1]) : r ? new Ht(o[0], "end") : new Ht("start", o[0]);
|
|
5045
5045
|
}
|
|
5046
5046
|
function Ln(i, t) {
|
|
5047
|
-
const e = kr(i), n =
|
|
5047
|
+
const e = kr(i), n = _n(e, t);
|
|
5048
5048
|
if (!n)
|
|
5049
5049
|
return null;
|
|
5050
|
-
const s = Rr(i), r =
|
|
5050
|
+
const s = Rr(i), r = _n(
|
|
5051
5051
|
s,
|
|
5052
5052
|
t
|
|
5053
5053
|
);
|
|
@@ -5125,7 +5125,7 @@ function $r(i, t) {
|
|
|
5125
5125
|
if (e.length === 4)
|
|
5126
5126
|
return [i];
|
|
5127
5127
|
}
|
|
5128
|
-
function
|
|
5128
|
+
function Fr(i, t, e = !1) {
|
|
5129
5129
|
const n = Math.max(i.precision, t.precision);
|
|
5130
5130
|
if (e) {
|
|
5131
5131
|
const s = $r(i, t);
|
|
@@ -5134,7 +5134,7 @@ function _r(i, t, e = !1) {
|
|
|
5134
5134
|
}
|
|
5135
5135
|
return It(i, t, n);
|
|
5136
5136
|
}
|
|
5137
|
-
function
|
|
5137
|
+
function _r(i, t) {
|
|
5138
5138
|
const e = [];
|
|
5139
5139
|
if ([
|
|
5140
5140
|
[i.firstPoint, t],
|
|
@@ -5155,7 +5155,7 @@ function Fr(i, t) {
|
|
|
5155
5155
|
function Lr(i, t, e = !1) {
|
|
5156
5156
|
const n = Math.max(i.precision, t.precision);
|
|
5157
5157
|
if (e) {
|
|
5158
|
-
const s =
|
|
5158
|
+
const s = _r(i, t);
|
|
5159
5159
|
if (s)
|
|
5160
5160
|
return s;
|
|
5161
5161
|
}
|
|
@@ -5300,7 +5300,7 @@ function se(i, t, e) {
|
|
|
5300
5300
|
return { intersections: n, overlaps: [], count: n.length };
|
|
5301
5301
|
}
|
|
5302
5302
|
if (i instanceof rt && t instanceof rt) {
|
|
5303
|
-
const n =
|
|
5303
|
+
const n = Fr(
|
|
5304
5304
|
i,
|
|
5305
5305
|
t
|
|
5306
5306
|
);
|
|
@@ -5327,7 +5327,7 @@ function* Qe(i) {
|
|
|
5327
5327
|
for (const [t, e] of Ei(i.length))
|
|
5328
5328
|
t !== e && (yield [i[t], i[e]]);
|
|
5329
5329
|
}
|
|
5330
|
-
class Si extends
|
|
5330
|
+
class Si extends _t {
|
|
5331
5331
|
constructor(t, { ignoreChecks: e = !1 } = {}) {
|
|
5332
5332
|
super(), ut(this, "segments"), ut(this, "_boundingBox", null), e || ki(t), this.segments = t;
|
|
5333
5333
|
}
|
|
@@ -5490,7 +5490,7 @@ let Rt = class Ut extends Si {
|
|
|
5490
5490
|
}
|
|
5491
5491
|
};
|
|
5492
5492
|
const jr = (i, t) => {
|
|
5493
|
-
const e =
|
|
5493
|
+
const e = Fe(t, {
|
|
5494
5494
|
V: [1, 0],
|
|
5495
5495
|
firstPoint: i,
|
|
5496
5496
|
precision: t.precision
|
|
@@ -5505,7 +5505,7 @@ const jr = (i, t) => {
|
|
|
5505
5505
|
}
|
|
5506
5506
|
return 1;
|
|
5507
5507
|
};
|
|
5508
|
-
|
|
5508
|
+
class fn {
|
|
5509
5509
|
constructor(t) {
|
|
5510
5510
|
ut(this, "_count", 0), ut(this, "segment"), this.segment = t;
|
|
5511
5511
|
}
|
|
@@ -5515,11 +5515,11 @@ let fn = class {
|
|
|
5515
5515
|
get count() {
|
|
5516
5516
|
return this._count;
|
|
5517
5517
|
}
|
|
5518
|
-
}
|
|
5518
|
+
}
|
|
5519
5519
|
const qr = (i, t) => {
|
|
5520
5520
|
const e = t.precision, n = Math.abs(i[1] - t.center[1]);
|
|
5521
5521
|
if (n > t.radius + e) return 0;
|
|
5522
|
-
const s =
|
|
5522
|
+
const s = Ft(i, t.center), r = t.radius * t.radius, o = e * e;
|
|
5523
5523
|
if (Math.abs(s - r) < o && t.isOnSegment(i))
|
|
5524
5524
|
return 0;
|
|
5525
5525
|
const a = s - r > o;
|
|
@@ -5947,7 +5947,7 @@ function $i(i, t = 1e-7) {
|
|
|
5947
5947
|
}
|
|
5948
5948
|
}), n;
|
|
5949
5949
|
}
|
|
5950
|
-
let mt = class Se extends
|
|
5950
|
+
let mt = class Se extends _t {
|
|
5951
5951
|
constructor(t, e = [], { ignoreChecks: n = !1 } = {}) {
|
|
5952
5952
|
super(), ut(this, "contour"), ut(this, "holes"), n || Qr(t, e), this.contour = t, this.holes = e;
|
|
5953
5953
|
}
|
|
@@ -6027,7 +6027,7 @@ const xe = (i, t, e = 1e-7) => Math.abs(i - t) <= e, Gr = (i, t) => {
|
|
|
6027
6027
|
n[a] = o;
|
|
6028
6028
|
});
|
|
6029
6029
|
}), e;
|
|
6030
|
-
},
|
|
6030
|
+
}, Fi = (i) => i.map((t, e) => {
|
|
6031
6031
|
const n = t.segments[0].midPoint, s = i.filter((r, o) => e === o ? !1 : r.contains(n));
|
|
6032
6032
|
return {
|
|
6033
6033
|
loop: t,
|
|
@@ -6039,7 +6039,7 @@ const xe = (i, t, e = 1e-7) => Math.abs(i - t) <= e, Gr = (i, t) => {
|
|
|
6039
6039
|
)
|
|
6040
6040
|
)), eo = (i, t) => {
|
|
6041
6041
|
const e = t.filter(({ isIn: s }) => s.length <= 1), n = gn(
|
|
6042
|
-
|
|
6042
|
+
Fi(i.map(({ loop: s }) => s))
|
|
6043
6043
|
);
|
|
6044
6044
|
return [e, ...n];
|
|
6045
6045
|
}, gn = (i) => {
|
|
@@ -6049,7 +6049,7 @@ const xe = (i, t, e = 1e-7) => Math.abs(i - t) <= e, Gr = (i, t) => {
|
|
|
6049
6049
|
};
|
|
6050
6050
|
function ee(i) {
|
|
6051
6051
|
const t = Zr(i);
|
|
6052
|
-
return Kr(t).map(
|
|
6052
|
+
return Kr(t).map(Fi).flatMap(gn).map((e) => {
|
|
6053
6053
|
if (e.length === 1) return new mt(e[0].loop);
|
|
6054
6054
|
e.sort((r, o) => r.isIn.length - o.isIn.length);
|
|
6055
6055
|
const [n, ...s] = e.map(({ loop: r }) => r);
|
|
@@ -6294,11 +6294,11 @@ function lo(i) {
|
|
|
6294
6294
|
(w) => c.some((g) => w.intersects(g))
|
|
6295
6295
|
)) return;
|
|
6296
6296
|
let m;
|
|
6297
|
-
h.length > 1 || c.length > 1 ? m = re(h, c) : m =
|
|
6297
|
+
h.length > 1 || c.length > 1 ? m = re(h, c) : m = _i(h[0], c[0]), r.fusedWith.add(l), r.current = m, u || t.set(l, r);
|
|
6298
6298
|
});
|
|
6299
6299
|
}), e.flatMap(({ current: n }) => n);
|
|
6300
6300
|
}
|
|
6301
|
-
function
|
|
6301
|
+
function _i(i, t) {
|
|
6302
6302
|
const e = ho(i.contour, t.contour), n = t.holes.flatMap((o) => Te(o, i.contour)), s = i.holes.flatMap((o) => Te(o, t.contour)), r = no(i.holes, t.holes).flatMap(
|
|
6303
6303
|
([o, a]) => wn(o, a)
|
|
6304
6304
|
);
|
|
@@ -6357,7 +6357,7 @@ function re(i, t) {
|
|
|
6357
6357
|
e = re([n], e);
|
|
6358
6358
|
}), e;
|
|
6359
6359
|
}
|
|
6360
|
-
return i.length === 1 && t.length === 1 ?
|
|
6360
|
+
return i.length === 1 && t.length === 1 ? _i(i[0], t[0]) : [];
|
|
6361
6361
|
}
|
|
6362
6362
|
function Xt(i, t) {
|
|
6363
6363
|
if (!i.length) return [];
|
|
@@ -6374,7 +6374,7 @@ function Xt(i, t) {
|
|
|
6374
6374
|
function Ke(i, t) {
|
|
6375
6375
|
return !i.length || !t.length ? [] : i.length === 1 && t.length === 1 ? uo(i[0], t[0]) : i.length > 1 ? i.flatMap((e) => Ke([e], t)) : t.flatMap((e) => Ke(i, [e]));
|
|
6376
6376
|
}
|
|
6377
|
-
class dt extends
|
|
6377
|
+
class dt extends _t {
|
|
6378
6378
|
constructor(t = [], { ignoreChecks: e = !1 } = {}) {
|
|
6379
6379
|
super(), ut(this, "figures"), ut(this, "_boundingBox", null), e || co(t), this.figures = t;
|
|
6380
6380
|
}
|
|
@@ -6603,7 +6603,7 @@ const Po = (i) => {
|
|
|
6603
6603
|
function Qn(i, { ignoreChecks: t = !1 } = {}) {
|
|
6604
6604
|
return new dt([new mt(new Lt([...i], { ignoreChecks: t }))]);
|
|
6605
6605
|
}
|
|
6606
|
-
|
|
6606
|
+
class Mo {
|
|
6607
6607
|
constructor(t = [0, 0]) {
|
|
6608
6608
|
ve(this, "pointer"), ve(this, "firstPoint"), ve(this, "pendingSegments"), ve(this, "_nextCorner"), this.pointer = t, this.firstPoint = t, this.pendingSegments = [], this._nextCorner = null;
|
|
6609
6609
|
}
|
|
@@ -6826,7 +6826,7 @@ let Mo = class {
|
|
|
6826
6826
|
var t;
|
|
6827
6827
|
return R(this.pointer, (t = this.pendingSegments[0]) == null ? void 0 : t.firstPoint);
|
|
6828
6828
|
}
|
|
6829
|
-
}
|
|
6829
|
+
}
|
|
6830
6830
|
function Vi(i = [0, 0]) {
|
|
6831
6831
|
return new Mo(i);
|
|
6832
6832
|
}
|
|
@@ -6992,7 +6992,7 @@ function Eo(i, {
|
|
|
6992
6992
|
e
|
|
6993
6993
|
);
|
|
6994
6994
|
}
|
|
6995
|
-
class Zt extends
|
|
6995
|
+
class Zt extends _t {
|
|
6996
6996
|
constructor(e, {
|
|
6997
6997
|
cutLines: n = [],
|
|
6998
6998
|
foldLines: s = [],
|
|
@@ -7098,13 +7098,13 @@ function zi(i, t, {
|
|
|
7098
7098
|
function Ro(i, t, e = {}) {
|
|
7099
7099
|
return zi(i, t, e).mirror("y");
|
|
7100
7100
|
}
|
|
7101
|
-
const
|
|
7101
|
+
const Vo = {
|
|
7102
7102
|
right: Ro,
|
|
7103
7103
|
left: zi,
|
|
7104
7104
|
top: So,
|
|
7105
7105
|
bottom: ko
|
|
7106
7106
|
}, ii = (i, t) => Vi([-i / 2, 0]).line(t, -t).hLine(i - 2 * t).line(t, t);
|
|
7107
|
-
class tn extends
|
|
7107
|
+
class tn extends _t {
|
|
7108
7108
|
constructor(e, n = 0.2) {
|
|
7109
7109
|
super();
|
|
7110
7110
|
St(this, "cut");
|
|
@@ -7134,7 +7134,7 @@ class tn extends Ft {
|
|
|
7134
7134
|
e.fuseBody(this.bump);
|
|
7135
7135
|
}
|
|
7136
7136
|
}
|
|
7137
|
-
class Be extends
|
|
7137
|
+
class Be extends _t {
|
|
7138
7138
|
constructor(t) {
|
|
7139
7139
|
super(), this.points = t, this.points = t;
|
|
7140
7140
|
}
|
|
@@ -7148,7 +7148,7 @@ class Be extends Ft {
|
|
|
7148
7148
|
return this.points.map((e) => t.clone().translateTo(e));
|
|
7149
7149
|
}
|
|
7150
7150
|
}
|
|
7151
|
-
function
|
|
7151
|
+
function jo(i, t, e = 3, n = 0) {
|
|
7152
7152
|
if (i <= t * 2)
|
|
7153
7153
|
throw new Error("totalWidth must be greater than twice the objectWidth");
|
|
7154
7154
|
const s = Math.max(
|
|
@@ -7161,7 +7161,7 @@ function No(i, t, e = 3, n = 0) {
|
|
|
7161
7161
|
);
|
|
7162
7162
|
return new Be(a.map((h) => [h, 0]));
|
|
7163
7163
|
}
|
|
7164
|
-
function
|
|
7164
|
+
function qo(i, t, e = "x") {
|
|
7165
7165
|
const n = i * (t - 1), s = [];
|
|
7166
7166
|
for (let r = 0; r < t; r++)
|
|
7167
7167
|
s.push(r * i - n / 2);
|
|
@@ -7173,10 +7173,10 @@ export {
|
|
|
7173
7173
|
Zt as Dieline,
|
|
7174
7174
|
tn as FoldLockBump,
|
|
7175
7175
|
ko as bottomFlap,
|
|
7176
|
-
|
|
7176
|
+
Vo as drawFlaps,
|
|
7177
7177
|
zi as leftFlap,
|
|
7178
|
-
|
|
7179
|
-
|
|
7178
|
+
jo as linearDistribution,
|
|
7179
|
+
qo as linearSpread,
|
|
7180
7180
|
Ro as rightFlap,
|
|
7181
7181
|
So as topFlap
|
|
7182
7182
|
};
|