@sienci/gviewer 0.1.28 → 0.1.31
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/{GCodeSVGRenderer-Da9_qYpG.js → GCodeSVGRenderer-BeeQVu4r.js} +142 -101
- package/dist/{GCodeSVGRenderer-cMM0mATa.cjs → GCodeSVGRenderer-HssywtI7.cjs} +3 -3
- package/dist/gviewer.cjs +1 -1
- package/dist/gviewer.js +412 -407
- package/dist/react.cjs +1 -1
- package/dist/react.js +1 -1
- package/dist/types/geometry.d.ts +23 -5
- package/dist/types/types.d.ts +23 -0
- package/dist/types/viewer/GCodeViewer.d.ts +23 -2
- package/dist/types/viewer/index.d.ts +1 -1
- package/dist/types/viewer/toolpath/streams.d.ts +4 -0
- package/dist/viewcube.css +21 -0
- package/dist/viewer.cjs +1 -1
- package/dist/viewer.js +1 -1
- package/package.json +1 -1
|
@@ -28,6 +28,7 @@ function Oe(r) {
|
|
|
28
28
|
greyCursorVertex: 0,
|
|
29
29
|
kind: t.kind,
|
|
30
30
|
cutBucketIndex: t.cutBucketIndex,
|
|
31
|
+
lineGroupIndex: t.lineGroupIndex ?? null,
|
|
31
32
|
workerColors: t.colors ? e : void 0
|
|
32
33
|
}), i.boundingBox && (B = B ? B.union(i.boundingBox) : i.boundingBox.clone());
|
|
33
34
|
}
|
|
@@ -304,7 +305,7 @@ function pe() {
|
|
|
304
305
|
}
|
|
305
306
|
return NB = new h.CanvasTexture(Q), NB;
|
|
306
307
|
}
|
|
307
|
-
function
|
|
308
|
+
function xe(r, Q) {
|
|
308
309
|
const B = new h.Group();
|
|
309
310
|
B.name = "gviewer:sim3d-slab";
|
|
310
311
|
const t = r.xMax - r.xMin, A = r.yMax - r.yMin, e = r.zTop - r.zBot, P = (r.xMin + r.xMax) / 2, i = (r.yMin + r.yMax) / 2, s = (r.zBot + r.zTop) / 2, v = pe();
|
|
@@ -357,7 +358,7 @@ function VB(r, Q) {
|
|
|
357
358
|
}
|
|
358
359
|
B.needsUpdate = !0, r.topMesh.geometry.computeVertexNormals();
|
|
359
360
|
}
|
|
360
|
-
function
|
|
361
|
+
function me(r) {
|
|
361
362
|
r.group.traverse((Q) => {
|
|
362
363
|
if (Q instanceof h.Mesh) {
|
|
363
364
|
Q.geometry.dispose();
|
|
@@ -368,7 +369,7 @@ function xe(r) {
|
|
|
368
369
|
}
|
|
369
370
|
});
|
|
370
371
|
}
|
|
371
|
-
const ye = ".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#60a5faf2;box-shadow:0 0 0 1px #60a5fa59,0 10px 30px #00000059;color:#60a5faf2}.gViewer-viewcube__face--front{transform:translateZ(42px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(42px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(42px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(42px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(42px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(42px)}", Jt = "gviewer-viewcube-style";
|
|
372
|
+
const ye = ".gViewer-viewcube{position:absolute;left:60px;bottom:60px;width:84px;height:84px;z-index:9999;perspective:600px;pointer-events:auto}.gViewer-viewcube__cube{position:absolute;top:0;right:0;bottom:0;left:0;transform-style:preserve-3d;transition:transform 60ms linear}.gViewer-viewcube__face{position:absolute;width:84px;height:84px;display:flex;align-items:center;justify-content:center;font:600 11px system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;letter-spacing:.06em;text-transform:uppercase;color:#f0f5fce0;background:#0c1014b3;border:1px solid rgba(120,140,160,.35);border-radius:14px;cursor:pointer;-webkit-user-select:none;user-select:none;padding:0}.gViewer-viewcube__face:hover{background:#0c1014db;border-color:#a0bedc8c}.gViewer-viewcube__face.is-active{border-color:#60a5faf2;box-shadow:0 0 0 1px #60a5fa59,0 10px 30px #00000059;color:#60a5faf2}.gViewer-viewcube__face--front{transform:translateZ(42px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(42px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(42px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(42px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(42px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(42px)}@media (orientation: portrait){.gViewer-viewcube{left:60px;bottom:110px;width:64px;height:64px}.gViewer-viewcube__face{width:64px;height:64px}.gViewer-viewcube__face--front{transform:translateZ(32px)}.gViewer-viewcube__face--back{transform:rotateY(180deg) translateZ(32px)}.gViewer-viewcube__face--left{transform:rotateY(-90deg) translateZ(32px)}.gViewer-viewcube__face--right{transform:rotateY(90deg) translateZ(32px)}.gViewer-viewcube__face--top{transform:rotateX(-90deg) translateZ(32px)}.gViewer-viewcube__face--bottom{transform:rotateX(90deg) translateZ(32px)}}", Jt = "gviewer-viewcube-style";
|
|
372
373
|
function Ie() {
|
|
373
374
|
if (typeof document > "u" || document.getElementById(Jt)) return;
|
|
374
375
|
const r = document.createElement("style");
|
|
@@ -755,7 +756,7 @@ var zQ = {
|
|
|
755
756
|
duration: 0.5,
|
|
756
757
|
overwrite: !1,
|
|
757
758
|
delay: 0
|
|
758
|
-
}, Ut, q, y, hQ = 1e8,
|
|
759
|
+
}, Ut, q, y, hQ = 1e8, x = 1 / hQ, rt = Math.PI * 2, PP = rt / 4, iP = 0, UA = Math.sqrt, rP = Math.cos, sP = Math.sin, Z = function(Q) {
|
|
759
760
|
return typeof Q == "string";
|
|
760
761
|
}, J = function(Q) {
|
|
761
762
|
return typeof Q == "function";
|
|
@@ -869,7 +870,7 @@ var zQ = {
|
|
|
869
870
|
for (i = B[e]; P && P[e] > i; )
|
|
870
871
|
P = P._prev;
|
|
871
872
|
return P ? (B._next = P._next, P._next = B) : (B._next = Q[t], Q[t] = B), B._next ? B._next._prev = B : Q[A] = B, B._prev = P, B.parent = B._dp = Q, B;
|
|
872
|
-
},
|
|
873
|
+
}, mB = function(Q, B, t, A) {
|
|
873
874
|
t === void 0 && (t = "_first"), A === void 0 && (A = "_last");
|
|
874
875
|
var e = B._prev, P = B._next;
|
|
875
876
|
e ? e._next = P : Q[t] === B && (Q[t] = P), P ? P._prev = e : Q[A] === B && (Q[A] = e), B._next = B._prev = B.parent = null;
|
|
@@ -896,17 +897,17 @@ var zQ = {
|
|
|
896
897
|
}, bB = function(Q, B) {
|
|
897
898
|
return (Q - B._start) * B._ts + (B._ts >= 0 ? 0 : B._dirty ? B.totalDuration() : B._tDur);
|
|
898
899
|
}, yB = function(Q) {
|
|
899
|
-
return Q._end = S(Q._start + (Q._tDur / Math.abs(Q._ts || Q._rts ||
|
|
900
|
+
return Q._end = S(Q._start + (Q._tDur / Math.abs(Q._ts || Q._rts || x) || 0));
|
|
900
901
|
}, IB = function(Q, B) {
|
|
901
902
|
var t = Q._dp;
|
|
902
903
|
return t && t.smoothChildTiming && Q._ts && (Q._start = S(t._time - (Q._ts > 0 ? B / Q._ts : ((Q._dirty ? Q.totalDuration() : Q._tDur) - B) / -Q._ts)), yB(Q), t._dirty || VQ(t, Q)), Q;
|
|
903
904
|
}, bA = function(Q, B) {
|
|
904
905
|
var t;
|
|
905
|
-
if ((B._time || !B._dur && B._initted || B._start < Q._time && (B._dur || !B.add)) && (t = bB(Q.rawTime(), B), (!B._dur || dB(0, B.totalDuration(), t) - B._tTime >
|
|
906
|
+
if ((B._time || !B._dur && B._initted || B._start < Q._time && (B._dur || !B.add)) && (t = bB(Q.rawTime(), B), (!B._dur || dB(0, B.totalDuration(), t) - B._tTime > x) && B.render(t, !0)), VQ(Q, B)._dp && Q._initted && Q._time >= Q._dur && Q._ts) {
|
|
906
907
|
if (Q._dur < Q.duration())
|
|
907
908
|
for (t = Q; t._dp; )
|
|
908
909
|
t.rawTime() >= 0 && t.totalTime(t._tTime), t = t._dp;
|
|
909
|
-
Q._zTime = -
|
|
910
|
+
Q._zTime = -x;
|
|
910
911
|
}
|
|
911
912
|
}, uQ = function(Q, B, t, A) {
|
|
912
913
|
return B.parent && bQ(B), B._start = S((NQ(t) ? t : t || Q !== Y ? EQ(Q, t, B) : Q._time) + B._delay), B._end = S(B._start + (B.totalDuration() / Math.abs(B.timeScale()) || 0)), GA(Q, B, "_first", "_last", Q._sort ? "_start" : 0), nt(B) || (Q._recent = B), A || bA(Q, B), Q._ts < 0 && IB(Q, Q._tTime), Q;
|
|
@@ -925,10 +926,10 @@ var zQ = {
|
|
|
925
926
|
return B === "isFromStart" || B === "isStart";
|
|
926
927
|
}, uP = function(Q, B, t, A) {
|
|
927
928
|
var e = Q.ratio, P = B < 0 || !B && (!Q._start && kP(Q) && !(!Q._initted && nt(Q)) || (Q._ts < 0 || Q._dp._ts < 0) && !nt(Q)) ? 0 : 1, i = Q._rDelay, s = 0, v, c, n;
|
|
928
|
-
if (i && Q._repeat && (s = dB(0, Q._tDur, B), c = AB(s, i), Q._yoyo && c & 1 && (P = 1 - P), c !== AB(Q._tTime, i) && (e = 1 - P, Q.vars.repeatRefresh && Q._initted && Q.invalidate())), P !== e || q || A || Q._zTime ===
|
|
929
|
+
if (i && Q._repeat && (s = dB(0, Q._tDur, B), c = AB(s, i), Q._yoyo && c & 1 && (P = 1 - P), c !== AB(Q._tTime, i) && (e = 1 - P, Q.vars.repeatRefresh && Q._initted && Q.invalidate())), P !== e || q || A || Q._zTime === x || !B && Q._zTime) {
|
|
929
930
|
if (!Q._initted && pA(Q, B, A, t, s))
|
|
930
931
|
return;
|
|
931
|
-
for (n = Q._zTime, Q._zTime = B || (t ?
|
|
932
|
+
for (n = Q._zTime, Q._zTime = B || (t ? x : 0), t || (t = B && !n), Q.ratio = P, Q._from && (P = 1 - P), Q._time = 0, Q._tTime = s, v = Q._pt; v; )
|
|
932
933
|
v.r(P, v.d), v = v._next;
|
|
933
934
|
B < 0 && ct(Q, B, t, !0), Q._onUpdate && !t && oQ(Q, "onUpdate"), s && Q._repeat && !t && Q.parent && oQ(Q, "onRepeat"), (B >= Q._tDur || B < 0) && Q.ratio === P && (P && bQ(Q, 1), !t && !q && (oQ(Q, P ? "onComplete" : "onReverseComplete", !0), Q._prom && Q._prom()));
|
|
934
935
|
} else Q._zTime || (Q._zTime = B);
|
|
@@ -966,31 +967,31 @@ var zQ = {
|
|
|
966
967
|
P.immediateRender = AQ(i.immediateRender), Q < 2 ? P.runBackwards = 1 : P.startAt = B[e - 1];
|
|
967
968
|
}
|
|
968
969
|
return new K(B[0], P, B[e + 1]);
|
|
969
|
-
},
|
|
970
|
+
}, xQ = function(Q, B) {
|
|
970
971
|
return Q || Q === 0 ? B(Q) : B;
|
|
971
972
|
}, dB = function(Q, B, t) {
|
|
972
973
|
return t < Q ? Q : t > B ? B : t;
|
|
973
974
|
}, _ = function(Q, B) {
|
|
974
975
|
return !Z(Q) || !(B = oP.exec(Q)) ? "" : B[1];
|
|
975
976
|
}, dP = function(Q, B, t) {
|
|
976
|
-
return
|
|
977
|
+
return xQ(t, function(A) {
|
|
977
978
|
return dB(Q, B, A);
|
|
978
979
|
});
|
|
979
|
-
}, ot = [].slice,
|
|
980
|
+
}, ot = [].slice, xA = function(Q, B) {
|
|
980
981
|
return Q && DQ(Q) && "length" in Q && (!B && !Q.length || Q.length - 1 in Q && DQ(Q[0])) && !Q.nodeType && Q !== kQ;
|
|
981
982
|
}, CP = function(Q, B, t) {
|
|
982
983
|
return t === void 0 && (t = []), Q.forEach(function(A) {
|
|
983
984
|
var e;
|
|
984
|
-
return Z(A) && !B ||
|
|
985
|
+
return Z(A) && !B || xA(A, 1) ? (e = t).push.apply(e, lQ(A)) : t.push(A);
|
|
985
986
|
}) || t;
|
|
986
987
|
}, lQ = function(Q, B, t) {
|
|
987
|
-
return y && !B && y.selector ? y.selector(Q) : Z(Q) && !t && (st || !PB()) ? ot.call((B || Ct).querySelectorAll(Q), 0) : $(Q) ? CP(Q, t) :
|
|
988
|
+
return y && !B && y.selector ? y.selector(Q) : Z(Q) && !t && (st || !PB()) ? ot.call((B || Ct).querySelectorAll(Q), 0) : $(Q) ? CP(Q, t) : xA(Q) ? ot.call(Q, 0) : Q ? [Q] : [];
|
|
988
989
|
}, Tt = function(Q) {
|
|
989
990
|
return Q = lQ(Q)[0] || EB("Invalid scope") || {}, function(B) {
|
|
990
991
|
var t = Q.current || Q.nativeElement || Q;
|
|
991
992
|
return lQ(B, t.querySelectorAll ? t : t === Q ? EB("Invalid scope") || Ct.createElement("div") : Q);
|
|
992
993
|
};
|
|
993
|
-
},
|
|
994
|
+
}, mA = function(Q) {
|
|
994
995
|
return Q.sort(function() {
|
|
995
996
|
return 0.5 - Math.random();
|
|
996
997
|
});
|
|
@@ -1014,7 +1015,7 @@ var zQ = {
|
|
|
1014
1015
|
}
|
|
1015
1016
|
for (a = P[o] = [], E = s ? Math.min(d, o) * c - 0.5 : A % d, l = d === hQ ? 0 : s ? o * n / d - 0.5 : A / d | 0, D = 0, N = hQ, O = 0; O < o; O++)
|
|
1016
1017
|
u = O % d - E, U = l - (O / d | 0), a[O] = k = v ? Math.abs(v === "y" ? U : u) : UA(u * u + U * U), k > D && (D = k), k < N && (N = k);
|
|
1017
|
-
A === "random" &&
|
|
1018
|
+
A === "random" && mA(a), a.max = D - N, a.min = N, a.v = o = (parseFloat(B.amount) || parseFloat(B.each) * (d > o ? o - 1 : v ? v === "y" ? o / d : d : Math.max(d, o / d)) || 0) * (A === "edges" ? -1 : 1), a.b = o < 0 ? e - o : e, a.u = _(B.amount || B.each) || 0, t = t && o < 0 ? xP(t) : t;
|
|
1018
1019
|
}
|
|
1019
1020
|
return o = (a[T] - a.min) / a.max || 0, S(a.b + (t ? t(o) : o) * a.v) + a.u;
|
|
1020
1021
|
};
|
|
@@ -1026,7 +1027,7 @@ var zQ = {
|
|
|
1026
1027
|
};
|
|
1027
1028
|
}, IA = function(Q, B) {
|
|
1028
1029
|
var t = $(Q), A, e;
|
|
1029
|
-
return !t && DQ(Q) && (A = t = Q.radius || hQ, Q.values ? (Q = lQ(Q.values), (e = !NQ(Q[0])) && (A *= A)) : Q = zt(Q.increment)),
|
|
1030
|
+
return !t && DQ(Q) && (A = t = Q.radius || hQ, Q.values ? (Q = lQ(Q.values), (e = !NQ(Q[0])) && (A *= A)) : Q = zt(Q.increment)), xQ(B, t ? J(Q) ? function(P) {
|
|
1030
1031
|
return e = Q(P), Math.abs(e - P) <= A ? e : P;
|
|
1031
1032
|
} : function(P) {
|
|
1032
1033
|
for (var i = parseFloat(e ? P.x : P), s = parseFloat(e ? P.y : 0), v = hQ, c = 0, n = Q.length, T, z; n--; )
|
|
@@ -1034,7 +1035,7 @@ var zQ = {
|
|
|
1034
1035
|
return c = !A || v <= A ? Q[c] : P, e || c === P || NQ(P) ? c : c + _(P);
|
|
1035
1036
|
} : zt(Q));
|
|
1036
1037
|
}, SA = function(Q, B, t, A) {
|
|
1037
|
-
return
|
|
1038
|
+
return xQ($(Q) ? !B : t === !0 ? !!(t = 0) : !A, function() {
|
|
1038
1039
|
return $(Q) ? Q[~~(Math.random() * Q.length)] : (t = t || 1e-5) && (A = t < 1 ? Math.pow(10, (t + "").length - 2) : 1) && Math.floor(Math.round((Q - t / 2 + Math.random() * (B - Q + t * 0.99)) / t) * t * A) / A;
|
|
1039
1040
|
});
|
|
1040
1041
|
}, NP = function() {
|
|
@@ -1052,17 +1053,17 @@ var zQ = {
|
|
|
1052
1053
|
}, LP = function(Q, B, t) {
|
|
1053
1054
|
return VA(Q, B, 0, 1, t);
|
|
1054
1055
|
}, YA = function(Q, B, t) {
|
|
1055
|
-
return
|
|
1056
|
+
return xQ(t, function(A) {
|
|
1056
1057
|
return Q[~~B(A)];
|
|
1057
1058
|
});
|
|
1058
1059
|
}, MP = function r(Q, B, t) {
|
|
1059
1060
|
var A = B - Q;
|
|
1060
|
-
return $(Q) ? YA(Q, r(0, Q.length), B) :
|
|
1061
|
+
return $(Q) ? YA(Q, r(0, Q.length), B) : xQ(t, function(e) {
|
|
1061
1062
|
return (A + (e - Q) % A) % A + Q;
|
|
1062
1063
|
});
|
|
1063
1064
|
}, HP = function r(Q, B, t) {
|
|
1064
1065
|
var A = B - Q, e = A * 2;
|
|
1065
|
-
return $(Q) ? YA(Q, r(0, Q.length - 1), B) :
|
|
1066
|
+
return $(Q) ? YA(Q, r(0, Q.length - 1), B) : xQ(t, function(P) {
|
|
1066
1067
|
return P = (e + (P - Q) % e) % e || 0, Q + (P > A ? e - P : P);
|
|
1067
1068
|
});
|
|
1068
1069
|
}, lB = function(Q) {
|
|
@@ -1072,7 +1073,7 @@ var zQ = {
|
|
|
1072
1073
|
});
|
|
1073
1074
|
}, VA = function(Q, B, t, A, e) {
|
|
1074
1075
|
var P = B - Q, i = A - t;
|
|
1075
|
-
return
|
|
1076
|
+
return xQ(e, function(s) {
|
|
1076
1077
|
return t + ((s - Q) / P * i || 0);
|
|
1077
1078
|
});
|
|
1078
1079
|
}, jP = function r(Q, B, t, A) {
|
|
@@ -1104,7 +1105,7 @@ var zQ = {
|
|
|
1104
1105
|
};
|
|
1105
1106
|
}
|
|
1106
1107
|
}
|
|
1107
|
-
return
|
|
1108
|
+
return xQ(t, e);
|
|
1108
1109
|
}, QA = function(Q, B, t) {
|
|
1109
1110
|
var A = Q.labels, e = hQ, P, i, s;
|
|
1110
1111
|
for (P in A)
|
|
@@ -1265,7 +1266,7 @@ var zQ = {
|
|
|
1265
1266
|
}, pP = function(Q) {
|
|
1266
1267
|
var B = (Q + "").split("("), t = g[B[0]];
|
|
1267
1268
|
return t && B.length > 1 && t.config ? t.config.apply(null, ~Q.indexOf("{") ? [bP(B[1])] : gP(Q).split(",").map(FA)) : g._CE && fP.test(Q) ? g._CE("", Q) : t;
|
|
1268
|
-
},
|
|
1269
|
+
}, xP = function(Q) {
|
|
1269
1270
|
return function(B) {
|
|
1270
1271
|
return 1 - Q(1 - B);
|
|
1271
1272
|
};
|
|
@@ -1346,7 +1347,7 @@ XQ("Back", ZB("in"), ZB("out"), ZB());
|
|
|
1346
1347
|
g.SteppedEase = g.steps = wQ.SteppedEase = {
|
|
1347
1348
|
config: function(Q, B) {
|
|
1348
1349
|
Q === void 0 && (Q = 1);
|
|
1349
|
-
var t = 1 / Q, A = Q + (B ? 0 : 1), e = B ? 1 : 0, P = 1 -
|
|
1350
|
+
var t = 1 / Q, A = Q + (B ? 0 : 1), e = B ? 1 : 0, P = 1 - x;
|
|
1350
1351
|
return function(i) {
|
|
1351
1352
|
return ((A * dB(0, P, i) | 0) + e) * t;
|
|
1352
1353
|
};
|
|
@@ -1378,7 +1379,7 @@ var qA = function(Q, B) {
|
|
|
1378
1379
|
e.parent._time !== e._start + (e._ts >= 0 ? e._tTime / e._ts : (e.totalDuration() - e._tTime) / -e._ts) && e.totalTime(e._tTime, !0), e = e.parent;
|
|
1379
1380
|
!this.parent && this._dp.autoRemoveChildren && (this._ts > 0 && t < this._tDur || this._ts < 0 && t > 0 || !this._tDur && !t) && uQ(this._dp, this, this._start - this._delay);
|
|
1380
1381
|
}
|
|
1381
|
-
return (this._tTime !== t || !this._dur && !A || this._initted && Math.abs(this._zTime) ===
|
|
1382
|
+
return (this._tTime !== t || !this._dur && !A || this._initted && Math.abs(this._zTime) === x || !this._initted && this._dur && t || !t && !this._initted && (this.add || this._ptLookup)) && (this._ts || (this._pTime = t), jA(this, t, A)), this;
|
|
1382
1383
|
}, Q.time = function(t, A) {
|
|
1383
1384
|
return arguments.length ? this.totalTime(Math.min(this.totalDuration(), t + _t(this)) % (this._dur + this._rDelay) || (t ? this._dur : 0), A) : this._time;
|
|
1384
1385
|
}, Q.totalProgress = function(t, A) {
|
|
@@ -1390,13 +1391,13 @@ var qA = function(Q, B) {
|
|
|
1390
1391
|
return arguments.length ? this.totalTime(this._time + (t - 1) * e, A) : this._repeat ? AB(this._tTime, e) + 1 : 1;
|
|
1391
1392
|
}, Q.timeScale = function(t, A) {
|
|
1392
1393
|
if (!arguments.length)
|
|
1393
|
-
return this._rts === -
|
|
1394
|
+
return this._rts === -x ? 0 : this._rts;
|
|
1394
1395
|
if (this._rts === t)
|
|
1395
1396
|
return this;
|
|
1396
1397
|
var e = this.parent && this._ts ? bB(this.parent._time, this) : this._tTime;
|
|
1397
|
-
return this._rts = +t || 0, this._ts = this._ps || t === -
|
|
1398
|
+
return this._rts = +t || 0, this._ts = this._ps || t === -x ? 0 : this._rts, this.totalTime(dB(-Math.abs(this._delay), this.totalDuration(), e), A !== !1), yB(this), hP(this);
|
|
1398
1399
|
}, Q.paused = function(t) {
|
|
1399
|
-
return arguments.length ? (this._ps !== t && (this._ps = t, t ? (this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()), this._ts = this._act = 0) : (PB(), this._ts = this._rts, this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !==
|
|
1400
|
+
return arguments.length ? (this._ps !== t && (this._ps = t, t ? (this._pTime = this._tTime || Math.max(-this._delay, this.rawTime()), this._ts = this._act = 0) : (PB(), this._ts = this._rts, this.totalTime(this.parent && !this.parent.smoothChildTiming ? this.rawTime() : this._tTime || this._pTime, this.progress() === 1 && Math.abs(this._zTime) !== x && (this._tTime -= x)))), this) : this._ps;
|
|
1400
1401
|
}, Q.startTime = function(t) {
|
|
1401
1402
|
if (arguments.length) {
|
|
1402
1403
|
this._start = S(t);
|
|
@@ -1430,7 +1431,7 @@ var qA = function(Q, B) {
|
|
|
1430
1431
|
}, Q.seek = function(t, A) {
|
|
1431
1432
|
return this.totalTime(EQ(this, t), AQ(A));
|
|
1432
1433
|
}, Q.restart = function(t, A) {
|
|
1433
|
-
return this.play().totalTime(t ? -this._delay : 0, AQ(A)), this._dur || (this._zTime = -
|
|
1434
|
+
return this.play().totalTime(t ? -this._delay : 0, AQ(A)), this._dur || (this._zTime = -x), this;
|
|
1434
1435
|
}, Q.play = function(t, A) {
|
|
1435
1436
|
return t != null && this.seek(t, A), this.reversed(!1).paused(!1);
|
|
1436
1437
|
}, Q.reverse = function(t, A) {
|
|
@@ -1440,12 +1441,12 @@ var qA = function(Q, B) {
|
|
|
1440
1441
|
}, Q.resume = function() {
|
|
1441
1442
|
return this.paused(!1);
|
|
1442
1443
|
}, Q.reversed = function(t) {
|
|
1443
|
-
return arguments.length ? (!!t !== this.reversed() && this.timeScale(-this._rts || (t ? -
|
|
1444
|
+
return arguments.length ? (!!t !== this.reversed() && this.timeScale(-this._rts || (t ? -x : 0)), this) : this._rts < 0;
|
|
1444
1445
|
}, Q.invalidate = function() {
|
|
1445
|
-
return this._initted = this._act = 0, this._zTime = -
|
|
1446
|
+
return this._initted = this._act = 0, this._zTime = -x, this;
|
|
1446
1447
|
}, Q.isActive = function() {
|
|
1447
1448
|
var t = this.parent || this._dp, A = this._start, e;
|
|
1448
|
-
return !!(!t || this._ts && this._initted && t.isActive() && (e = t.rawTime(!0)) >= A && e < this.endTime(!0) -
|
|
1449
|
+
return !!(!t || this._ts && this._initted && t.isActive() && (e = t.rawTime(!0)) >= A && e < this.endTime(!0) - x);
|
|
1449
1450
|
}, Q.eventCallback = function(t, A, e) {
|
|
1450
1451
|
var P = this.vars;
|
|
1451
1452
|
return arguments.length > 1 ? (A ? (P[t] = A, e && (P[t + "Params"] = e), t === "onUpdate" && (this._onUpdate = A)) : delete P[t], this) : P[t];
|
|
@@ -1477,7 +1478,7 @@ aQ(uB.prototype, {
|
|
|
1477
1478
|
_ts: 1,
|
|
1478
1479
|
_dp: 0,
|
|
1479
1480
|
ratio: 0,
|
|
1480
|
-
_zTime: -
|
|
1481
|
+
_zTime: -x,
|
|
1481
1482
|
_prom: 0,
|
|
1482
1483
|
_ps: !1,
|
|
1483
1484
|
_rts: 1
|
|
@@ -1527,7 +1528,7 @@ var tQ = /* @__PURE__ */ function(r) {
|
|
|
1527
1528
|
if (z.parent !== this)
|
|
1528
1529
|
return this.render(A, e, P);
|
|
1529
1530
|
if (z.render(z._ts > 0 ? (T - z._start) * z._ts : (z._dirty ? z.totalDuration() : z._tDur) + (T - z._start) * z._ts, e, P), T !== this._time || !this._ts && !E) {
|
|
1530
|
-
l = 0, w && (c += this._zTime = -
|
|
1531
|
+
l = 0, w && (c += this._zTime = -x);
|
|
1531
1532
|
break;
|
|
1532
1533
|
}
|
|
1533
1534
|
}
|
|
@@ -1540,14 +1541,14 @@ var tQ = /* @__PURE__ */ function(r) {
|
|
|
1540
1541
|
if (z.parent !== this)
|
|
1541
1542
|
return this.render(A, e, P);
|
|
1542
1543
|
if (z.render(z._ts > 0 ? (M - z._start) * z._ts : (z._dirty ? z.totalDuration() : z._tDur) + (M - z._start) * z._ts, e, P || q && Ht(z)), T !== this._time || !this._ts && !E) {
|
|
1543
|
-
l = 0, w && (c += this._zTime = M ? -
|
|
1544
|
+
l = 0, w && (c += this._zTime = M ? -x : x);
|
|
1544
1545
|
break;
|
|
1545
1546
|
}
|
|
1546
1547
|
}
|
|
1547
1548
|
z = w;
|
|
1548
1549
|
}
|
|
1549
1550
|
}
|
|
1550
|
-
if (l && !e && (this.pause(), l.render(T >= i ? 0 : -
|
|
1551
|
+
if (l && !e && (this.pause(), l.render(T >= i ? 0 : -x)._zTime = T >= i ? 1 : -1, this._ts))
|
|
1551
1552
|
return this._start = U, yB(this), this.render(A, e, P);
|
|
1552
1553
|
this._onUpdate && !e && oQ(this, "onUpdate", !0), (c === s && this._tTime >= this.totalDuration() || !c && i) && (U === this._start || Math.abs(u) !== Math.abs(this._ts)) && (this._lock || ((A || !v) && (c === s && this._ts > 0 || !c && this._ts < 0) && bQ(this, 1), !e && !(A < 0 && !i) && (c || i || !s) && (oQ(this, c === s && A >= 0 ? "onComplete" : "onReverseComplete", !0), this._prom && !(c < s && this.timeScale() > 0) && this._prom())));
|
|
1553
1554
|
}
|
|
@@ -1577,7 +1578,7 @@ var tQ = /* @__PURE__ */ function(r) {
|
|
|
1577
1578
|
if (e[P].vars.id === A)
|
|
1578
1579
|
return e[P];
|
|
1579
1580
|
}, B.remove = function(A) {
|
|
1580
|
-
return Z(A) ? this.removeLabel(A) : J(A) ? this.killTweensOf(A) : (A.parent === this &&
|
|
1581
|
+
return Z(A) ? this.removeLabel(A) : J(A) ? this.killTweensOf(A) : (A.parent === this && mB(this, A), A === this._recent && (this._recent = this._last), VQ(this));
|
|
1581
1582
|
}, B.totalTime = function(A, e) {
|
|
1582
1583
|
return arguments.length ? (this._forcing = 1, !this._dp && this._ts && (this._start = S(nQ.time - (this._ts > 0 ? A / this._ts : (this.totalDuration() - A) / -this._ts))), r.prototype.totalTime.call(this, A, e), this._forcing = 0, this) : this._tTime;
|
|
1583
1584
|
}, B.addLabel = function(A, e) {
|
|
@@ -1607,7 +1608,7 @@ var tQ = /* @__PURE__ */ function(r) {
|
|
|
1607
1608
|
immediateRender: !1,
|
|
1608
1609
|
time: i,
|
|
1609
1610
|
overwrite: "auto",
|
|
1610
|
-
duration: e.duration || Math.abs((i - (v && "time" in v ? v.time : P._time)) / P.timeScale()) ||
|
|
1611
|
+
duration: e.duration || Math.abs((i - (v && "time" in v ? v.time : P._time)) / P.timeScale()) || x,
|
|
1611
1612
|
onStart: function() {
|
|
1612
1613
|
if (P.pause(), !z) {
|
|
1613
1614
|
var a = e.duration || Math.abs((i - (v && "time" in v ? v.time : P._time)) / P.timeScale());
|
|
@@ -1630,7 +1631,7 @@ var tQ = /* @__PURE__ */ function(r) {
|
|
|
1630
1631
|
}, B.previousLabel = function(A) {
|
|
1631
1632
|
return A === void 0 && (A = this._time), QA(this, EQ(this, A), 1);
|
|
1632
1633
|
}, B.currentLabel = function(A) {
|
|
1633
|
-
return arguments.length ? this.seek(A, !0) : this.previousLabel(this._time +
|
|
1634
|
+
return arguments.length ? this.seek(A, !0) : this.previousLabel(this._time + x);
|
|
1634
1635
|
}, B.shiftChildren = function(A, e, P) {
|
|
1635
1636
|
P === void 0 && (P = 0);
|
|
1636
1637
|
var i = this._first, s = this.labels, v;
|
|
@@ -1677,7 +1678,7 @@ aQ(tQ.prototype, {
|
|
|
1677
1678
|
_hasPause: 0,
|
|
1678
1679
|
_forcing: 0
|
|
1679
1680
|
});
|
|
1680
|
-
var
|
|
1681
|
+
var mP = function(Q, B, t, A, e, P, i) {
|
|
1681
1682
|
var s = new PQ(this._pt, Q, B, 0, 1, Ae, null, e), v = 0, c = 0, n, T, z, w, o, a, E, l;
|
|
1682
1683
|
for (s.b = t, s.e = A, t += "", A += "", (E = ~A.indexOf("random(")) && (A = lB(A)), P && (l = [t, A], P(l, Q, B), t = l[0], A = l[1]), T = t.match(JB) || []; n = JB.exec(A); )
|
|
1683
1684
|
w = n[0], o = A.substring(v, n.index), z ? z = (z + 1) % 5 : o.substr(-5) === "rgba(" && (z = 1), w !== T[c++] && (a = parseFloat(T[c - 1]) || 0, s._pt = {
|
|
@@ -1693,7 +1694,7 @@ var xP = function(Q, B, t, A, e, P, i) {
|
|
|
1693
1694
|
J(A) && (A = A(e || 0, Q, P));
|
|
1694
1695
|
var n = Q[B], T = t !== "get" ? t : J(n) ? v ? Q[B.indexOf("set") || !J(Q["get" + B.substr(3)]) ? B : "get" + B.substr(3)](v) : Q[B]() : n, z = J(n) ? v ? VP : Be : ft, w;
|
|
1695
1696
|
if (Z(A) && (~A.indexOf("random(") && (A = lB(A)), A.charAt(1) === "=" && (w = $Q(T, A) + (_(T) || 0), (w || w === 0) && (A = w))), !c || T !== A || wt)
|
|
1696
|
-
return !isNaN(T * A) && A !== "" ? (w = new PQ(this._pt, Q, B, +T || 0, A - (T || 0), typeof n == "boolean" ? RP : te, 0, z), v && (w.fp = v), i && w.modifier(i, this, Q), this._pt = w) : (!n && !(B in Q) && Nt(B, A),
|
|
1697
|
+
return !isNaN(T * A) && A !== "" ? (w = new PQ(this._pt, Q, B, +T || 0, A - (T || 0), typeof n == "boolean" ? RP : te, 0, z), v && (w.fp = v), i && w.modifier(i, this, Q), this._pt = w) : (!n && !(B in Q) && Nt(B, A), mP.call(this, Q, B, T, A, z, s || zQ.stringFilter, v));
|
|
1697
1698
|
}, yP = function(Q, B, t, A, e) {
|
|
1698
1699
|
if (J(Q) && (Q = wB(Q, e, B, t, A)), !DQ(Q) || Q.style && Q.nodeType || $(Q) || DA(Q))
|
|
1699
1700
|
return Z(Q) ? wB(Q, e, B, t, A) : Q;
|
|
@@ -1739,7 +1740,7 @@ var xP = function(Q, B, t, A, e, P, i) {
|
|
|
1739
1740
|
parent: E
|
|
1740
1741
|
//ensures that nested tweens that had a stagger are handled properly, like gsap.from(".class", {y: gsap.utils.wrap([-100,100]), stagger: 0.5})
|
|
1741
1742
|
}, O), f && (N[C.prop] = f), bQ(Q._startAt = K.set(a, N)), Q._startAt._dp = 0, Q._startAt._sat = Q, B < 0 && (q ? Q._startAt.revert(LB) : Q._startAt.render(-1, !0)), Q._zTime = B, !i)
|
|
1742
|
-
r(Q._startAt,
|
|
1743
|
+
r(Q._startAt, x, x);
|
|
1743
1744
|
else if (!B)
|
|
1744
1745
|
return;
|
|
1745
1746
|
}
|
|
@@ -1849,11 +1850,11 @@ var K = /* @__PURE__ */ function(r) {
|
|
|
1849
1850
|
v || i.duration(v = u.duration());
|
|
1850
1851
|
} else
|
|
1851
1852
|
i.timeline = 0;
|
|
1852
|
-
return z === !0 && !Ut && (HQ = dQ(i), Y.killTweensOf(l), HQ = 0), uQ(E, dQ(i), e), A.reversed && i.reverse(), A.paused && i.paused(!0), (n || !v && !w && i._start === S(E._time) && AQ(n) && lP(dQ(i)) && E.data !== "nested") && (i._tTime = -
|
|
1853
|
+
return z === !0 && !Ut && (HQ = dQ(i), Y.killTweensOf(l), HQ = 0), uQ(E, dQ(i), e), A.reversed && i.reverse(), A.paused && i.paused(!0), (n || !v && !w && i._start === S(E._time) && AQ(n) && lP(dQ(i)) && E.data !== "nested") && (i._tTime = -x, i.render(Math.max(0, -c) || 0)), a && gA(dQ(i), a), i;
|
|
1853
1854
|
}
|
|
1854
1855
|
var B = Q.prototype;
|
|
1855
1856
|
return B.render = function(A, e, P) {
|
|
1856
|
-
var i = this._time, s = this._tDur, v = this._dur, c = A < 0, n = A > s -
|
|
1857
|
+
var i = this._time, s = this._tDur, v = this._dur, c = A < 0, n = A > s - x && !c ? s : A < x ? 0 : A, T, z, w, o, a, E, l, u;
|
|
1857
1858
|
if (!v)
|
|
1858
1859
|
uP(this, A, e, P);
|
|
1859
1860
|
else if (n !== this._tTime || !A || P || !this._initted && this._tTime || this._startAt && this._zTime < 0 !== c || this._lazy) {
|
|
@@ -1912,7 +1913,7 @@ var K = /* @__PURE__ */ function(r) {
|
|
|
1912
1913
|
if (~s.indexOf(i[E])) {
|
|
1913
1914
|
T = v[E], e === "all" ? (n[E] = e, w = T, z = {}) : (z = n[E] = n[E] || {}, w = e);
|
|
1914
1915
|
for (o in w)
|
|
1915
|
-
a = T && T[o], a && ((!("kill" in a.d) || a.d.kill(o) === !0) &&
|
|
1916
|
+
a = T && T[o], a && ((!("kill" in a.d) || a.d.kill(o) === !0) && mB(this, a, "_pt"), delete T[o]), z !== "all" && (z[o] = 1);
|
|
1916
1917
|
}
|
|
1917
1918
|
return this._initted && !this._pt && c && nB(this), this;
|
|
1918
1919
|
}, Q.to = function(A, e) {
|
|
@@ -1986,7 +1987,7 @@ var ft = function(Q, B, t) {
|
|
|
1986
1987
|
P = e._next, e.p === A && e.modifier(Q, B, t), e = P;
|
|
1987
1988
|
}, KP = function(Q) {
|
|
1988
1989
|
for (var B = this._pt, t, A; B; )
|
|
1989
|
-
A = B._next, B.p === Q && !B.op || B.op === Q ?
|
|
1990
|
+
A = B._next, B.p === Q && !B.op || B.op === Q ? mB(this, B, "_pt") : B.dep || (t = 1), B = A;
|
|
1990
1991
|
return !t;
|
|
1991
1992
|
}, ZP = function(Q, B, t, A) {
|
|
1992
1993
|
A.mSet(Q, B, A.m.call(A.tween, t, A.mt), A);
|
|
@@ -2230,7 +2231,7 @@ var RQ = [], HB = {}, WP = [], tA = 0, qP = 0, WB = function(Q) {
|
|
|
2230
2231
|
pipe: NP,
|
|
2231
2232
|
unitize: OP,
|
|
2232
2233
|
interpolate: jP,
|
|
2233
|
-
shuffle:
|
|
2234
|
+
shuffle: mA
|
|
2234
2235
|
},
|
|
2235
2236
|
install: OA,
|
|
2236
2237
|
effects: RB,
|
|
@@ -2245,7 +2246,7 @@ var RQ = [], HB = {}, WP = [], tA = 0, qP = 0, WB = function(Q) {
|
|
|
2245
2246
|
Timeline: tQ,
|
|
2246
2247
|
Animation: uB,
|
|
2247
2248
|
getCache: YQ,
|
|
2248
|
-
_removeLinkedListItem:
|
|
2249
|
+
_removeLinkedListItem: mB,
|
|
2249
2250
|
reverting: function() {
|
|
2250
2251
|
return q;
|
|
2251
2252
|
},
|
|
@@ -2345,7 +2346,7 @@ g.Circ;
|
|
|
2345
2346
|
*/
|
|
2346
2347
|
var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
2347
2348
|
return typeof window < "u";
|
|
2348
|
-
}, OQ = {}, IQ = 180 / Math.PI, BB = Math.PI / 180, KQ = Math.atan2, PA = 1e8,
|
|
2349
|
+
}, OQ = {}, IQ = 180 / Math.PI, BB = Math.PI / 180, KQ = Math.atan2, PA = 1e8, xt = /([A-Z])/g, ti = /(left|right|width|margin|padding|x)/i, Ai = /[\s,\(]\S/, UQ = {
|
|
2349
2350
|
autoAlpha: "opacity,visibility",
|
|
2350
2351
|
scale: "scaleX,scaleY",
|
|
2351
2352
|
alpha: "opacity"
|
|
@@ -2399,7 +2400,7 @@ var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
|
2399
2400
|
}, wi = function() {
|
|
2400
2401
|
var Q = this.props, B = this.target, t = B.style, A = B._gsap, e, P;
|
|
2401
2402
|
for (e = 0; e < Q.length; e += 3)
|
|
2402
|
-
Q[e + 1] ? Q[e + 1] === 2 ? B[Q[e]](Q[e + 2]) : B[Q[e]] = Q[e + 2] : Q[e + 2] ? t[Q[e]] = Q[e + 2] : t.removeProperty(Q[e].substr(0, 2) === "--" ? Q[e] : Q[e].replace(
|
|
2403
|
+
Q[e + 1] ? Q[e + 1] === 2 ? B[Q[e]](Q[e + 2]) : B[Q[e]] = Q[e + 2] : Q[e + 2] ? t[Q[e]] = Q[e + 2] : t.removeProperty(Q[e].substr(0, 2) === "--" ? Q[e] : Q[e].replace(xt, "-$1").toLowerCase());
|
|
2403
2404
|
if (this.tfm) {
|
|
2404
2405
|
for (P in this.tfm)
|
|
2405
2406
|
A[P] = this.tfm[P];
|
|
@@ -2420,7 +2421,7 @@ var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
|
2420
2421
|
return t && t.style ? t : jQ.createElement(Q);
|
|
2421
2422
|
}, TQ = function r(Q, B, t) {
|
|
2422
2423
|
var A = getComputedStyle(Q);
|
|
2423
|
-
return A[B] || A.getPropertyValue(B.replace(
|
|
2424
|
+
return A[B] || A.getPropertyValue(B.replace(xt, "-$1").toLowerCase()) || A.getPropertyValue(B) || !t && r(Q, iB(B) || B, 1) || "";
|
|
2424
2425
|
}, iA = "O,Moz,ms,Ms,Webkit".split(","), iB = function(Q, B, t) {
|
|
2425
2426
|
var A = B || SQ, e = A.style, P = 5;
|
|
2426
2427
|
if (Q in e && !t)
|
|
@@ -2462,7 +2463,7 @@ var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
|
2462
2463
|
}, gQ = function(Q, B) {
|
|
2463
2464
|
if (B) {
|
|
2464
2465
|
var t = Q.style, A;
|
|
2465
|
-
B in OQ && B !== iQ && (B = V), t.removeProperty ? (A = B.substr(0, 2), (A === "ms" || B.substr(0, 6) === "webkit") && (B = "-" + B), t.removeProperty(A === "--" ? B : B.replace(
|
|
2466
|
+
B in OQ && B !== iQ && (B = V), t.removeProperty ? (A = B.substr(0, 2), (A === "ms" || B.substr(0, 6) === "webkit") && (B = "-" + B), t.removeProperty(A === "--" ? B : B.replace(xt, "-$1").toLowerCase())) : t.removeAttribute(B);
|
|
2466
2467
|
}
|
|
2467
2468
|
}, FQ = function(Q, B, t, A, e, P) {
|
|
2468
2469
|
var i = new PQ(Q._pt, B, t, 0, 1, P ? re : ie);
|
|
@@ -2490,7 +2491,7 @@ var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
|
2490
2491
|
return s && z && (a = YQ(o), a.time = nQ.time, a.width = o[c]), X(T ? w * e / n : w && e ? n / w * e : 0);
|
|
2491
2492
|
}, CQ = function(Q, B, t, A) {
|
|
2492
2493
|
var e;
|
|
2493
|
-
return gt || lt(), B in UQ && B !== "transform" && (B = UQ[B], ~B.indexOf(",") && (B = B.split(",")[0])), OQ[B] && B !== "transform" ? (e = DB(Q, A), e = B !== "transformOrigin" ? e[B] : e.svg ? e.origin :
|
|
2494
|
+
return gt || lt(), B in UQ && B !== "transform" && (B = UQ[B], ~B.indexOf(",") && (B = B.split(",")[0])), OQ[B] && B !== "transform" ? (e = DB(Q, A), e = B !== "transformOrigin" ? e[B] : e.svg ? e.origin : xB(TQ(Q, iQ)) + " " + e.zOrigin + "px") : (e = Q.style[B], (!e || e === "auto" || A || ~(e + "").indexOf("calc(")) && (e = pB[B] && pB[B](Q, B, t) || TQ(Q, B) || HA(Q, B) || (B === "opacity" ? 1 : 0))), t && !~(e + "").trim().indexOf(" ") ? pQ(Q, B, e, t) + t : e;
|
|
2494
2495
|
}, Ei = function(Q, B, t, A) {
|
|
2495
2496
|
if (!t || t === "none") {
|
|
2496
2497
|
var e = iB(B, Q, 1), P = e && TQ(Q, e, 1);
|
|
@@ -2605,32 +2606,32 @@ var AA, jQ, QB, gt, SQ, eA, pt, Bi = function() {
|
|
|
2605
2606
|
}, nA = function(Q) {
|
|
2606
2607
|
var B = TQ(Q, V);
|
|
2607
2608
|
return ze(B) ? UB : B.substr(7).match(dA).map(X);
|
|
2608
|
-
},
|
|
2609
|
+
}, mt = function(Q, B) {
|
|
2609
2610
|
var t = Q._gsap || YQ(Q), A = Q.style, e = nA(Q), P, i, s, v;
|
|
2610
2611
|
return t.svg && Q.getAttribute("transform") ? (s = Q.transform.baseVal.consolidate().matrix, e = [s.a, s.b, s.c, s.d, s.e, s.f], e.join(",") === "1,0,0,1,0,0" ? UB : e) : (e === UB && !Q.offsetParent && Q !== QB && !t.svg && (s = A.display, A.display = "block", P = Q.parentNode, (!P || !Q.offsetParent && !Q.getBoundingClientRect().width) && (v = 1, i = Q.nextElementSibling, QB.appendChild(Q)), e = nA(Q), s ? A.display = s : gQ(Q, "display"), v && (i ? P.insertBefore(Q, i) : P ? P.appendChild(Q) : QB.removeChild(Q))), B && e.length > 6 ? [e[0], e[1], e[4], e[5], e[12], e[13]] : e);
|
|
2611
2612
|
}, kt = function(Q, B, t, A, e, P) {
|
|
2612
|
-
var i = Q._gsap, s = e ||
|
|
2613
|
+
var i = Q._gsap, s = e || mt(Q, !0), v = i.xOrigin || 0, c = i.yOrigin || 0, n = i.xOffset || 0, T = i.yOffset || 0, z = s[0], w = s[1], o = s[2], a = s[3], E = s[4], l = s[5], u = B.split(" "), U = parseFloat(u[0]) || 0, k = parseFloat(u[1]) || 0, O, D, N, d;
|
|
2613
2614
|
t ? s !== UB && (D = z * a - w * o) && (N = U * (a / D) + k * (-o / D) + (o * l - a * E) / D, d = U * (-w / D) + k * (z / D) - (z * l - w * E) / D, U = N, k = d) : (O = ne(Q), U = O.x + (~u[0].indexOf("%") ? U / 100 * O.width : U), k = O.y + (~(u[1] || u[0]).indexOf("%") ? k / 100 * O.height : k)), A || A !== !1 && i.smooth ? (E = U - v, l = k - c, i.xOffset = n + (E * z + l * o) - E, i.yOffset = T + (E * w + l * a) - l) : i.xOffset = i.yOffset = 0, i.xOrigin = U, i.yOrigin = k, i.smooth = !!A, i.origin = B, i.originIsAbsolute = !!t, Q.style[iQ] = "0px 0px", P && (FQ(P, i, "xOrigin", v, U), FQ(P, i, "yOrigin", c, k), FQ(P, i, "xOffset", n, i.xOffset), FQ(P, i, "yOffset", T, i.yOffset)), Q.setAttribute("data-svg-origin", U + " " + k);
|
|
2614
2615
|
}, DB = function(Q, B) {
|
|
2615
2616
|
var t = Q._gsap || new qA(Q);
|
|
2616
2617
|
if ("x" in t && !B && !t.uncache)
|
|
2617
2618
|
return t;
|
|
2618
|
-
var A = Q.style, e = t.scaleX < 0, P = "px", i = "deg", s = getComputedStyle(Q), v = TQ(Q, iQ) || "0", c, n, T, z, w, o, a, E, l, u, U, k, O, D, N, d, M, b, G, C, j, F, H, f, I, R, QQ, sQ, W,
|
|
2619
|
-
return c = n = T = o = a = E = l = u = U = 0, z = w = 1, t.svg = !!(Q.getCTM && oe(Q)), s.translate && ((s.translate !== "none" || s.scale !== "none" || s.rotate !== "none") && (A[V] = (s.translate !== "none" ? "translate3d(" + (s.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (s.rotate !== "none" ? "rotate(" + s.rotate + ") " : "") + (s.scale !== "none" ? "scale(" + s.scale.split(" ").join(",") + ") " : "") + (s[V] !== "none" ? s[V] : "")), A.scale = A.rotate = A.translate = "none"), D =
|
|
2620
|
-
},
|
|
2619
|
+
var A = Q.style, e = t.scaleX < 0, P = "px", i = "deg", s = getComputedStyle(Q), v = TQ(Q, iQ) || "0", c, n, T, z, w, o, a, E, l, u, U, k, O, D, N, d, M, b, G, C, j, F, H, f, I, R, QQ, sQ, W, m, BQ, vQ;
|
|
2620
|
+
return c = n = T = o = a = E = l = u = U = 0, z = w = 1, t.svg = !!(Q.getCTM && oe(Q)), s.translate && ((s.translate !== "none" || s.scale !== "none" || s.rotate !== "none") && (A[V] = (s.translate !== "none" ? "translate3d(" + (s.translate + " 0 0").split(" ").slice(0, 3).join(", ") + ") " : "") + (s.rotate !== "none" ? "rotate(" + s.rotate + ") " : "") + (s.scale !== "none" ? "scale(" + s.scale.split(" ").join(",") + ") " : "") + (s[V] !== "none" ? s[V] : "")), A.scale = A.rotate = A.translate = "none"), D = mt(Q, t.svg), t.svg && (t.uncache ? (I = Q.getBBox(), v = t.xOrigin - I.x + "px " + (t.yOrigin - I.y) + "px", f = "") : f = !B && Q.getAttribute("data-svg-origin"), kt(Q, f || v, !!f || t.originIsAbsolute, t.smooth !== !1, D)), k = t.xOrigin || 0, O = t.yOrigin || 0, D !== UB && (b = D[0], G = D[1], C = D[2], j = D[3], c = F = D[4], n = H = D[5], D.length === 6 ? (z = Math.sqrt(b * b + G * G), w = Math.sqrt(j * j + C * C), o = b || G ? KQ(G, b) * IQ : 0, l = C || j ? KQ(C, j) * IQ + o : 0, l && (w *= Math.abs(Math.cos(l * BB))), t.svg && (c -= k - (k * b + O * C), n -= O - (k * G + O * j))) : (vQ = D[6], m = D[7], QQ = D[8], sQ = D[9], W = D[10], BQ = D[11], c = D[12], n = D[13], T = D[14], N = KQ(vQ, W), a = N * IQ, N && (d = Math.cos(-N), M = Math.sin(-N), f = F * d + QQ * M, I = H * d + sQ * M, R = vQ * d + W * M, QQ = F * -M + QQ * d, sQ = H * -M + sQ * d, W = vQ * -M + W * d, BQ = m * -M + BQ * d, F = f, H = I, vQ = R), N = KQ(-C, W), E = N * IQ, N && (d = Math.cos(-N), M = Math.sin(-N), f = b * d - QQ * M, I = G * d - sQ * M, R = C * d - W * M, BQ = j * M + BQ * d, b = f, G = I, C = R), N = KQ(G, b), o = N * IQ, N && (d = Math.cos(N), M = Math.sin(N), f = b * d + G * M, I = F * d + H * M, G = G * d - b * M, H = H * d - F * M, b = f, F = I), a && Math.abs(a) + Math.abs(o) > 359.9 && (a = o = 0, E = 180 - E), z = X(Math.sqrt(b * b + G * G + C * C)), w = X(Math.sqrt(H * H + vQ * vQ)), N = KQ(F, H), l = Math.abs(N) > 2e-4 ? N * IQ : 0, U = BQ ? 1 / (BQ < 0 ? -BQ : BQ) : 0), t.svg && (f = Q.getAttribute("transform"), t.forceCSS = Q.setAttribute("transform", "") || !ze(TQ(Q, V)), f && Q.setAttribute("transform", f))), Math.abs(l) > 90 && Math.abs(l) < 270 && (e ? (z *= -1, l += o <= 0 ? 180 : -180, o += o <= 0 ? 180 : -180) : (w *= -1, l += l <= 0 ? 180 : -180)), B = B || t.uncache, t.x = c - ((t.xPercent = c && (!B && t.xPercent || (Math.round(Q.offsetWidth / 2) === Math.round(-c) ? -50 : 0))) ? Q.offsetWidth * t.xPercent / 100 : 0) + P, t.y = n - ((t.yPercent = n && (!B && t.yPercent || (Math.round(Q.offsetHeight / 2) === Math.round(-n) ? -50 : 0))) ? Q.offsetHeight * t.yPercent / 100 : 0) + P, t.z = T + P, t.scaleX = X(z), t.scaleY = X(w), t.rotation = X(o) + i, t.rotationX = X(a) + i, t.rotationY = X(E) + i, t.skewX = l + i, t.skewY = u + i, t.transformPerspective = U + P, (t.zOrigin = parseFloat(v.split(" ")[2]) || !B && t.zOrigin || 0) && (A[iQ] = xB(v)), t.xOffset = t.yOffset = 0, t.force3D = zQ.force3D, t.renderTransform = t.svg ? ui : ce ? we : ki, t.uncache = 0, t;
|
|
2621
|
+
}, xB = function(Q) {
|
|
2621
2622
|
return (Q = Q.split(" "))[0] + " " + Q[1];
|
|
2622
2623
|
}, _B = function(Q, B, t) {
|
|
2623
2624
|
var A = _(B);
|
|
2624
2625
|
return X(parseFloat(B) + parseFloat(pQ(Q, "x", t + "px", A))) + A;
|
|
2625
2626
|
}, ki = function(Q, B) {
|
|
2626
2627
|
B.z = "0px", B.rotationY = B.rotationX = "0deg", B.force3D = 0, we(Q, B);
|
|
2627
|
-
},
|
|
2628
|
+
}, mQ = "0deg", sB = "0px", yQ = ") ", we = function(Q, B) {
|
|
2628
2629
|
var t = B || this, A = t.xPercent, e = t.yPercent, P = t.x, i = t.y, s = t.z, v = t.rotation, c = t.rotationY, n = t.rotationX, T = t.skewX, z = t.skewY, w = t.scaleX, o = t.scaleY, a = t.transformPerspective, E = t.force3D, l = t.target, u = t.zOrigin, U = "", k = E === "auto" && Q && Q !== 1 || E === !0;
|
|
2629
|
-
if (u && (n !==
|
|
2630
|
+
if (u && (n !== mQ || c !== mQ)) {
|
|
2630
2631
|
var O = parseFloat(c) * BB, D = Math.sin(O), N = Math.cos(O), d;
|
|
2631
2632
|
O = parseFloat(n) * BB, d = Math.cos(O), P = _B(l, P, D * d * -u), i = _B(l, i, -Math.sin(O) * -u), s = _B(l, s, N * d * -u + u);
|
|
2632
2633
|
}
|
|
2633
|
-
a !== sB && (U += "perspective(" + a + yQ), (A || e) && (U += "translate(" + A + "%, " + e + "%) "), (k || P !== sB || i !== sB || s !== sB) && (U += s !== sB || k ? "translate3d(" + P + ", " + i + ", " + s + ") " : "translate(" + P + ", " + i + yQ), v !==
|
|
2634
|
+
a !== sB && (U += "perspective(" + a + yQ), (A || e) && (U += "translate(" + A + "%, " + e + "%) "), (k || P !== sB || i !== sB || s !== sB) && (U += s !== sB || k ? "translate3d(" + P + ", " + i + ", " + s + ") " : "translate(" + P + ", " + i + yQ), v !== mQ && (U += "rotate(" + v + yQ), c !== mQ && (U += "rotateY(" + c + yQ), n !== mQ && (U += "rotateX(" + n + yQ), (T !== mQ || z !== mQ) && (U += "skew(" + T + ", " + z + yQ), (w !== 1 || o !== 1) && (U += "scale(" + w + ", " + o + yQ), l.style[V] = U || "translate(0, 0)";
|
|
2634
2635
|
}, ui = function(Q, B) {
|
|
2635
2636
|
var t = B || this, A = t.xPercent, e = t.yPercent, P = t.x, i = t.y, s = t.rotation, v = t.skewX, c = t.skewY, n = t.scaleX, T = t.scaleY, z = t.target, w = t.xOrigin, o = t.yOrigin, a = t.xOffset, E = t.yOffset, l = t.forceCSS, u = parseFloat(P), U = parseFloat(i), k, O, D, N, d;
|
|
2636
2637
|
s = parseFloat(s), v = parseFloat(v), c = parseFloat(c), c && (c = parseFloat(c), v += c, s += c), s || v ? (s *= BB, v *= BB, k = Math.cos(s) * n, O = Math.sin(s) * n, D = Math.sin(s - v) * -T, N = Math.cos(s - v) * T, v && (c *= BB, d = Math.tan(v - c), d = Math.sqrt(1 + d * d), D *= d, N *= d, c && (d = Math.tan(c), d = Math.sqrt(1 + d * d), k *= d, O *= d)), k = X(k), O = X(O), D = X(D), N = X(N)) : (k = n, N = T, O = D = 0), (u && !~(P + "").indexOf("px") || U && !~(i + "").indexOf("px")) && (u = pQ(z, "x", P, "px"), U = pQ(z, "y", i, "px")), (w || o || a || E) && (u = X(u + w - (w * k + o * D) + a), U = X(U + o - (w * O + o * N) + E)), (A || e) && (d = z.getBBox(), u = X(u + A / 100 * d.width), U = X(U + e / 100 * d.height)), d = "matrix(" + k + "," + O + "," + D + "," + N + "," + u + "," + U + ")", z.setAttribute("transform", d), l && (z.style[V] = d);
|
|
@@ -2690,7 +2691,7 @@ var ae = {
|
|
|
2690
2691
|
if (U || (k = Q._gsap, k.renderTransform && !B.parseTransform || DB(Q, B.parseTransform), O = B.smoothOrigin !== !1 && k.smooth, U = this._pt = new PQ(this._pt, i, V, 0, 1, k.renderTransform, k, 0, -1), U.dep = 1), o === "scale")
|
|
2691
2692
|
this._pt = new PQ(this._pt, k, "scaleY", k.scaleY, (l ? $Q(k.scaleY, l + n) : n) - k.scaleY || 0, Et), this._pt.u = 0, P.push("scaleY", o), o += "X";
|
|
2692
2693
|
else if (o === "transformOrigin") {
|
|
2693
|
-
N.push(iQ, 0, i[iQ]), c = hi(c), k.svg ? kt(Q, c, 0, O, 0, this) : (E = parseFloat(c.split(" ")[2]) || 0, E !== k.zOrigin && FQ(this, k, "zOrigin", k.zOrigin, E), FQ(this, i, o,
|
|
2694
|
+
N.push(iQ, 0, i[iQ]), c = hi(c), k.svg ? kt(Q, c, 0, O, 0, this) : (E = parseFloat(c.split(" ")[2]) || 0, E !== k.zOrigin && FQ(this, k, "zOrigin", k.zOrigin, E), FQ(this, i, o, xB(v), xB(c)));
|
|
2694
2695
|
continue;
|
|
2695
2696
|
} else if (o === "svgOrigin") {
|
|
2696
2697
|
kt(Q, c, 1, O, 0, this);
|
|
@@ -2739,7 +2740,7 @@ var ae = {
|
|
|
2739
2740
|
},
|
|
2740
2741
|
core: {
|
|
2741
2742
|
_removeProperty: gQ,
|
|
2742
|
-
_getMatrix:
|
|
2743
|
+
_getMatrix: mt
|
|
2743
2744
|
}
|
|
2744
2745
|
};
|
|
2745
2746
|
rQ.utils.checkPrefix = iB;
|
|
@@ -2980,7 +2981,7 @@ function bi(r) {
|
|
|
2980
2981
|
}
|
|
2981
2982
|
};
|
|
2982
2983
|
}
|
|
2983
|
-
const gi = 25.4, pi = 500,
|
|
2984
|
+
const gi = 25.4, pi = 500, xi = 300;
|
|
2984
2985
|
class Xi {
|
|
2985
2986
|
constructor(Q) {
|
|
2986
2987
|
this.viewCube = null, this.resizeObserver = null, this.onWindowResize = null, this.animationFrameId = null, this.gridGroup = null, this.axesGroup = null, this.gridLabelsGroup = null, this.boundingBoxGroup = null, this.machineBedGroup = null, this.bitMarker = null, this.preLaserBitType = "drill", this.toolpathStreams = [], this.toolpathCutBucketCount = 1, this.toolpathRotationA = 0, this.lastBitPosition = { x: 0, y: 0, z: 0, a: 0 }, this.sim3dHandle = null, this.currentLines = [], this.linePositions = null, this.renderSequence = 0, this.currentBounds = null, this.cameraFocusTransition = null, this.cameraFollowRequested = !1, this.cameraFollowInterrupted = !1, this.cameraFollowOffset = null, this.id = Q.id, this.container = Q.container, this.callbacks = Q.callbacks ?? {}, this.options = hA(Ge, Q.options), this.canvas = document.createElement("canvas"), this.canvas.style.width = "100%", this.canvas.style.height = "100%", this.canvas.style.display = "block", this.container.appendChild(this.canvas), qe(this.container), this.renderer = new h.WebGLRenderer({
|
|
@@ -3017,7 +3018,7 @@ class Xi {
|
|
|
3017
3018
|
var t;
|
|
3018
3019
|
if (this.ensureBitMarker(), this.lastBitPosition = { ...this.lastBitPosition, ...Q }, (t = this.bitMarker) == null || t.setTarget(Q, B), this.cameraFollowRequested && !this.cameraFollowInterrupted && this.cameraFollowOffset) {
|
|
3019
3020
|
const A = new h.Vector3(this.lastBitPosition.x, this.lastBitPosition.y, this.controls.target.z), e = A.clone().add(this.cameraFollowOffset);
|
|
3020
|
-
this.startCameraLerp(A, e,
|
|
3021
|
+
this.startCameraLerp(A, e, xi, "linear");
|
|
3021
3022
|
}
|
|
3022
3023
|
}
|
|
3023
3024
|
/**
|
|
@@ -3083,6 +3084,27 @@ class Xi {
|
|
|
3083
3084
|
for (const Q of this.toolpathStreams)
|
|
3084
3085
|
Q.line.geometry.setDrawRange(0, Q.totalVertices);
|
|
3085
3086
|
}
|
|
3087
|
+
/**
|
|
3088
|
+
* Show or hide one of the `lineGroups` the toolpath was loaded with.
|
|
3089
|
+
*
|
|
3090
|
+
* This is deliberately independent of `showAll()`, `hideUntilLine()` and
|
|
3091
|
+
* `resetColors()`, which are all about *progress*: they move draw ranges and
|
|
3092
|
+
* colors, while this flips object visibility. So the two compose in either
|
|
3093
|
+
* order - but note a hidden group therefore stays hidden across a `showAll()`,
|
|
3094
|
+
* which looks surprising if you expect "show all" to mean everything. Call
|
|
3095
|
+
* `showAllLineGroups()` for that.
|
|
3096
|
+
*
|
|
3097
|
+
* A no-op when the load passed no `lineGroups`, or for the catch-all stream of
|
|
3098
|
+
* lines outside every group, which has no index and is always visible.
|
|
3099
|
+
*/
|
|
3100
|
+
setLineGroupVisible(Q, B) {
|
|
3101
|
+
for (const t of this.toolpathStreams)
|
|
3102
|
+
t.lineGroupIndex === Q && (t.line.visible = B);
|
|
3103
|
+
}
|
|
3104
|
+
showAllLineGroups() {
|
|
3105
|
+
for (const Q of this.toolpathStreams)
|
|
3106
|
+
Q.line.visible = !0;
|
|
3107
|
+
}
|
|
3086
3108
|
resetColors() {
|
|
3087
3109
|
for (const Q of this.toolpathStreams) {
|
|
3088
3110
|
Q.greyCursorVertex = 0, Q.simColors.set(Q.baseColors);
|
|
@@ -3192,20 +3214,31 @@ class Xi {
|
|
|
3192
3214
|
async loadFromLines(Q) {
|
|
3193
3215
|
this.currentLines = Array.from(Q), await this.renderScene();
|
|
3194
3216
|
}
|
|
3195
|
-
|
|
3217
|
+
/**
|
|
3218
|
+
* Pass `options.lineGroups` to split the toolpath into separately hideable
|
|
3219
|
+
* streams by source-line range; `setLineGroupVisible` then shows or hides a
|
|
3220
|
+
* group. Without it the toolpath is one rapid + one cut stream, exactly as
|
|
3221
|
+
* before, and only a prefix can be hidden (`hideUntilLine`).
|
|
3222
|
+
*/
|
|
3223
|
+
async loadFromWorkerData(Q, B) {
|
|
3196
3224
|
this.currentLines = [];
|
|
3197
|
-
const {
|
|
3225
|
+
const { rapids: t, cuts: A } = Ue(Q, B), e = (Q.toolchangeCount ?? 0) > 0;
|
|
3198
3226
|
this.setToolpathGeometry({
|
|
3199
|
-
|
|
3200
|
-
positions:
|
|
3227
|
+
rapids: t.map((P) => ({
|
|
3228
|
+
positions: P.positions,
|
|
3201
3229
|
colors: void 0,
|
|
3202
|
-
prefixEndVertex:
|
|
3203
|
-
|
|
3204
|
-
|
|
3205
|
-
|
|
3206
|
-
|
|
3207
|
-
|
|
3208
|
-
|
|
3230
|
+
prefixEndVertex: P.prefixEndVertex,
|
|
3231
|
+
lineGroupIndex: P.lineGroupIndex
|
|
3232
|
+
})),
|
|
3233
|
+
cuts: A.map((P) => ({
|
|
3234
|
+
positions: P.positions,
|
|
3235
|
+
colors: e ? P.colors : void 0,
|
|
3236
|
+
prefixEndVertex: P.prefixEndVertex,
|
|
3237
|
+
// Line groups are not laser-power buckets: every cut stream here sits in
|
|
3238
|
+
// bucket 0, so splitting by group leaves opacity untouched.
|
|
3239
|
+
cutBucketIndex: 0,
|
|
3240
|
+
lineGroupIndex: P.lineGroupIndex
|
|
3241
|
+
})),
|
|
3209
3242
|
cutBucketCount: 1
|
|
3210
3243
|
});
|
|
3211
3244
|
}
|
|
@@ -3213,11 +3246,11 @@ class Xi {
|
|
|
3213
3246
|
this.currentLines = [], this.setGeometryEmpty(), this.emitProgress({ state: "hidden" });
|
|
3214
3247
|
}
|
|
3215
3248
|
setOptions(Q) {
|
|
3216
|
-
var T, z, w, o, a, E, l, u, U, k, O, D, N, d, M, b, G, C, j, F, H, f, I, R, QQ, sQ, W,
|
|
3249
|
+
var T, z, w, o, a, E, l, u, U, k, O, D, N, d, M, b, G, C, j, F, H, f, I, R, QQ, sQ, W, m, BQ, vQ, rB, yt, It, St;
|
|
3217
3250
|
const B = this.options;
|
|
3218
3251
|
this.options = hA(this.options, Q), (B.render.antialias !== this.options.render.antialias || B.render.theme.background !== this.options.render.theme.background) && this.renderer.setClearColor(this.options.render.theme.background, 1), (B.render.theme.opacity !== this.options.render.theme.opacity || B.render.theme.rapidOpacity !== this.options.render.theme.rapidOpacity) && this.refreshToolpathOpacities(), B.camera.fov !== this.options.camera.fov && (this.camera.fov = this.options.camera.fov, this.camera.updateProjectionMatrix()), B.camera.orbit.enableDamping !== this.options.camera.orbit.enableDamping && (this.controls.enableDamping = this.options.camera.orbit.enableDamping);
|
|
3219
3252
|
const t = ((T = B.grid.bounds) == null ? void 0 : T.min.x) !== ((z = this.options.grid.bounds) == null ? void 0 : z.min.x) || ((w = B.grid.bounds) == null ? void 0 : w.min.y) !== ((o = this.options.grid.bounds) == null ? void 0 : o.min.y) || ((a = B.grid.bounds) == null ? void 0 : a.max.x) !== ((E = this.options.grid.bounds) == null ? void 0 : E.max.x) || ((l = B.grid.bounds) == null ? void 0 : l.max.y) !== ((u = this.options.grid.bounds) == null ? void 0 : u.max.y), A = B.units !== this.options.units || B.grid.sizeX !== this.options.grid.sizeX || B.grid.sizeY !== this.options.grid.sizeY || B.grid.axisDepth !== this.options.grid.axisDepth || t, e = B.render.theme.colors.grid.major !== this.options.render.theme.colors.grid.major || B.render.theme.colors.grid.minor !== this.options.render.theme.colors.grid.minor || B.render.theme.colors.axes.x !== this.options.render.theme.colors.axes.x || B.render.theme.colors.axes.y !== this.options.render.theme.colors.axes.y || B.render.theme.colors.axes.z !== this.options.render.theme.colors.axes.z;
|
|
3220
|
-
(A || e) && this.renderGridAndAxes(), (B.grid.labels !== this.options.grid.labels || B.units !== this.options.units || B.grid.sizeX !== this.options.grid.sizeX || B.grid.sizeY !== this.options.grid.sizeY || t || e) && this.refreshGridLabels(), (B.boundingBox.visible !== this.options.boundingBox.visible || B.boundingBox.labels !== this.options.boundingBox.labels || B.units !== this.options.units || B.render.theme.colors.boundingBox !== this.options.render.theme.colors.boundingBox) && this.refreshBoundingBox(), (B.machineBed.visible !== this.options.machineBed.visible || ((U = B.machineBed.min) == null ? void 0 : U.x) !== ((k = this.options.machineBed.min) == null ? void 0 : k.x) || ((O = B.machineBed.min) == null ? void 0 : O.y) !== ((D = this.options.machineBed.min) == null ? void 0 : D.y) || ((N = B.machineBed.max) == null ? void 0 : N.x) !== ((d = this.options.machineBed.max) == null ? void 0 : d.x) || ((M = B.machineBed.max) == null ? void 0 : M.y) !== ((b = this.options.machineBed.max) == null ? void 0 : b.y) || ((C = (G = B.machineBed.keepout) == null ? void 0 : G.min) == null ? void 0 : C.x) !== ((F = (j = this.options.machineBed.keepout) == null ? void 0 : j.min) == null ? void 0 : F.x) || ((f = (H = B.machineBed.keepout) == null ? void 0 : H.min) == null ? void 0 : f.y) !== ((R = (I = this.options.machineBed.keepout) == null ? void 0 : I.min) == null ? void 0 : R.y) || ((sQ = (QQ = B.machineBed.keepout) == null ? void 0 : QQ.max) == null ? void 0 : sQ.x) !== ((
|
|
3253
|
+
(A || e) && this.renderGridAndAxes(), (B.grid.labels !== this.options.grid.labels || B.units !== this.options.units || B.grid.sizeX !== this.options.grid.sizeX || B.grid.sizeY !== this.options.grid.sizeY || t || e) && this.refreshGridLabels(), (B.boundingBox.visible !== this.options.boundingBox.visible || B.boundingBox.labels !== this.options.boundingBox.labels || B.units !== this.options.units || B.render.theme.colors.boundingBox !== this.options.render.theme.colors.boundingBox) && this.refreshBoundingBox(), (B.machineBed.visible !== this.options.machineBed.visible || ((U = B.machineBed.min) == null ? void 0 : U.x) !== ((k = this.options.machineBed.min) == null ? void 0 : k.x) || ((O = B.machineBed.min) == null ? void 0 : O.y) !== ((D = this.options.machineBed.min) == null ? void 0 : D.y) || ((N = B.machineBed.max) == null ? void 0 : N.x) !== ((d = this.options.machineBed.max) == null ? void 0 : d.x) || ((M = B.machineBed.max) == null ? void 0 : M.y) !== ((b = this.options.machineBed.max) == null ? void 0 : b.y) || ((C = (G = B.machineBed.keepout) == null ? void 0 : G.min) == null ? void 0 : C.x) !== ((F = (j = this.options.machineBed.keepout) == null ? void 0 : j.min) == null ? void 0 : F.x) || ((f = (H = B.machineBed.keepout) == null ? void 0 : H.min) == null ? void 0 : f.y) !== ((R = (I = this.options.machineBed.keepout) == null ? void 0 : I.min) == null ? void 0 : R.y) || ((sQ = (QQ = B.machineBed.keepout) == null ? void 0 : QQ.max) == null ? void 0 : sQ.x) !== ((m = (W = this.options.machineBed.keepout) == null ? void 0 : W.max) == null ? void 0 : m.x) || ((vQ = (BQ = B.machineBed.keepout) == null ? void 0 : BQ.max) == null ? void 0 : vQ.y) !== ((yt = (rB = this.options.machineBed.keepout) == null ? void 0 : rB.max) == null ? void 0 : yt.y) || B.render.theme.colors.machineBed !== this.options.render.theme.colors.machineBed || B.render.theme.colors.machineBedKeepout !== this.options.render.theme.colors.machineBedKeepout) && this.refreshMachineBed();
|
|
3221
3254
|
const v = B.render.theme.colors.rapid !== this.options.render.theme.colors.rapid || B.render.theme.colors.cutting !== this.options.render.theme.colors.cutting || B.render.theme.colors.laser !== this.options.render.theme.colors.laser || B.render.theme.background !== this.options.render.theme.background || B.render.theme.colors.processed !== this.options.render.theme.colors.processed;
|
|
3222
3255
|
if (v && this.refreshToolpathColors(), (B.bit.enabled !== this.options.bit.enabled || B.bit.type !== this.options.bit.type || B.bit.size !== this.options.bit.size || B.bit.opacity !== this.options.bit.opacity || B.bit.colorSource !== this.options.bit.colorSource || B.bit.color !== this.options.bit.color || v) && (this.ensureBitMarker(), (It = this.bitMarker) == null || It.setOptions(this.options)), B.mode.laser !== this.options.mode.laser && (this.options.mode.laser ? this.options.bit.type !== "laser" && (this.preLaserBitType = this.options.bit.type, this.options = { ...this.options, bit: { ...this.options.bit, type: "laser" } }) : this.options = { ...this.options, bit: { ...this.options.bit, type: this.preLaserBitType } }, this.ensureBitMarker(), (St = this.bitMarker) == null || St.setOptions(this.options), this.currentLines.length > 0 && this.renderScene()), B.mode.sim3d !== this.options.mode.sim3d)
|
|
3223
3256
|
if (!this.options.mode.sim3d)
|
|
@@ -3377,22 +3410,27 @@ class Xi {
|
|
|
3377
3410
|
setToolpathGeometry(Q) {
|
|
3378
3411
|
this.setGeometryEmpty(), this.toolpathCutBucketCount = Math.max(1, Math.floor(Q.cutBucketCount));
|
|
3379
3412
|
const B = [
|
|
3380
|
-
{
|
|
3413
|
+
...Q.rapids.map((e) => ({
|
|
3381
3414
|
kind: "rapid",
|
|
3382
3415
|
cutBucketIndex: null,
|
|
3383
|
-
|
|
3384
|
-
prefixEndVertex: Q.rapid.prefixEndVertex,
|
|
3385
|
-
colors: Q.rapid.colors,
|
|
3386
|
-
opacity: EA(this.options.render.theme.rapidOpacity ?? 0.3)
|
|
3387
|
-
},
|
|
3388
|
-
...Q.cuts.map((e, P) => ({
|
|
3389
|
-
kind: "cut",
|
|
3390
|
-
cutBucketIndex: P,
|
|
3416
|
+
lineGroupIndex: e.lineGroupIndex ?? null,
|
|
3391
3417
|
positions: e.positions,
|
|
3392
3418
|
prefixEndVertex: e.prefixEndVertex,
|
|
3393
3419
|
colors: e.colors,
|
|
3394
|
-
opacity: this.
|
|
3395
|
-
}))
|
|
3420
|
+
opacity: EA(this.options.render.theme.rapidOpacity ?? 0.3)
|
|
3421
|
+
})),
|
|
3422
|
+
...Q.cuts.map((e, P) => {
|
|
3423
|
+
const i = e.cutBucketIndex ?? P;
|
|
3424
|
+
return {
|
|
3425
|
+
kind: "cut",
|
|
3426
|
+
cutBucketIndex: i,
|
|
3427
|
+
lineGroupIndex: e.lineGroupIndex ?? null,
|
|
3428
|
+
positions: e.positions,
|
|
3429
|
+
prefixEndVertex: e.prefixEndVertex,
|
|
3430
|
+
colors: e.colors,
|
|
3431
|
+
opacity: this.cutBucketOpacity(i)
|
|
3432
|
+
};
|
|
3433
|
+
})
|
|
3396
3434
|
], { streams: t, bounds: A } = Oe({
|
|
3397
3435
|
specs: B,
|
|
3398
3436
|
options: this.options,
|
|
@@ -3465,7 +3503,7 @@ class Xi {
|
|
|
3465
3503
|
if (Q !== this.renderSequence)
|
|
3466
3504
|
return;
|
|
3467
3505
|
this.setToolpathGeometry({
|
|
3468
|
-
|
|
3506
|
+
rapids: [B.rapid],
|
|
3469
3507
|
cuts: B.cuts,
|
|
3470
3508
|
cutBucketCount: B.cutBucketCount
|
|
3471
3509
|
}), this.buildLinePositions(), this.options.mode.sim3d && (this.setToolpathStreamsVisible(this.options.sim3d.showToolpath), await this.buildAndApplySim3d(Q));
|
|
@@ -3478,8 +3516,11 @@ class Xi {
|
|
|
3478
3516
|
}
|
|
3479
3517
|
}
|
|
3480
3518
|
setSim3dHandle(Q) {
|
|
3481
|
-
this.sim3dHandle && (this.scene.remove(this.sim3dHandle.slab.group),
|
|
3519
|
+
this.sim3dHandle && (this.scene.remove(this.sim3dHandle.slab.group), me(this.sim3dHandle.slab), this.sim3dHandle = null), Q && (this.sim3dHandle = Q, this.scene.add(Q.slab.group));
|
|
3482
3520
|
}
|
|
3521
|
+
// Whole-toolpath visibility for sim3d. Shares `line.visible` with
|
|
3522
|
+
// setLineGroupVisible, so turning the toolpath back on here also un-hides any
|
|
3523
|
+
// hidden line groups; sim3d and grouped loads are not used together today.
|
|
3483
3524
|
setToolpathStreamsVisible(Q) {
|
|
3484
3525
|
for (const B of this.toolpathStreams)
|
|
3485
3526
|
B.line.visible = Q;
|
|
@@ -3510,7 +3551,7 @@ class Xi {
|
|
|
3510
3551
|
if (Q !== this.renderSequence) return;
|
|
3511
3552
|
const e = SB(0, A);
|
|
3512
3553
|
YB(e, t, this.options.sim3d.erosionPasses, A.slabBounds.zTop);
|
|
3513
|
-
const P =
|
|
3554
|
+
const P = xe(A.slabBounds, t);
|
|
3514
3555
|
VB(P, e), this.setSim3dHandle({ data: A, slab: P, currentLine: 0 });
|
|
3515
3556
|
}
|
|
3516
3557
|
startCameraFocus(Q) {
|
|
@@ -3548,7 +3589,7 @@ function hA(r, Q) {
|
|
|
3548
3589
|
var t, A, e, P;
|
|
3549
3590
|
if (!Q)
|
|
3550
3591
|
return { ...r };
|
|
3551
|
-
const B =
|
|
3592
|
+
const B = mi(r.render.theme, (t = Q.render) == null ? void 0 : t.theme);
|
|
3552
3593
|
return {
|
|
3553
3594
|
...r,
|
|
3554
3595
|
...Q,
|
|
@@ -3577,7 +3618,7 @@ function hA(r, Q) {
|
|
|
3577
3618
|
}
|
|
3578
3619
|
};
|
|
3579
3620
|
}
|
|
3580
|
-
function
|
|
3621
|
+
function mi(r, Q) {
|
|
3581
3622
|
var B, t;
|
|
3582
3623
|
return Q ? {
|
|
3583
3624
|
...r,
|
|
@@ -3835,10 +3876,10 @@ class Ki {
|
|
|
3835
3876
|
this.viewBox = { x: -50, y: -50, w: 100, h: 100 };
|
|
3836
3877
|
return;
|
|
3837
3878
|
}
|
|
3838
|
-
const { minX: Q, maxX: B, minY: t, maxY: A, minZ: e, maxZ: P } = this.bounds, i = this.project, s = i(Q, t, e), v = i(B, t, e), c = i(B, A, e), n = i(Q, A, e), T = i(Q, t, P), z = i(B, t, P), w = i(B, A, P), o = i(Q, A, P), a = Math.hypot(v.x - s.x, v.y - s.y), E = Math.hypot(n.x - s.x, n.y - s.y), l = Math.hypot(T.x - s.x, T.y - s.y), u = Math.max(a, E, l) * 0.07, U = u * 0.5, k = tt(LQ(s, v), LQ(c, n), U), O = [s, v, c, n, T, z, w, o], D = Math.min(...O.map((
|
|
3879
|
+
const { minX: Q, maxX: B, minY: t, maxY: A, minZ: e, maxZ: P } = this.bounds, i = this.project, s = i(Q, t, e), v = i(B, t, e), c = i(B, A, e), n = i(Q, A, e), T = i(Q, t, P), z = i(B, t, P), w = i(B, A, P), o = i(Q, A, P), a = Math.hypot(v.x - s.x, v.y - s.y), E = Math.hypot(n.x - s.x, n.y - s.y), l = Math.hypot(T.x - s.x, T.y - s.y), u = Math.max(a, E, l) * 0.07, U = u * 0.5, k = tt(LQ(s, v), LQ(c, n), U), O = [s, v, c, n, T, z, w, o], D = Math.min(...O.map((m) => m.y)), N = Math.max(...O.map((m) => m.y)), d = Math.min(...O.map((m) => m.x)), M = Math.max(...O.map((m) => m.x)), b = { x: M + U, y: (D + N) / 2 }, G = { x: b.x + u * 5, y: b.y }, C = { x: (d + M) / 2, y: D - u }, j = [s, v, c, n, T, z, w, o, k, b, G, C];
|
|
3839
3880
|
let F = 1 / 0, H = 1 / 0, f = -1 / 0, I = -1 / 0;
|
|
3840
|
-
for (const
|
|
3841
|
-
|
|
3881
|
+
for (const m of j)
|
|
3882
|
+
m.x < F && (F = m.x), m.y < H && (H = m.y), m.x > f && (f = m.x), m.y > I && (I = m.y);
|
|
3842
3883
|
const R = f - F, QQ = I - H, sQ = Math.max(R, QQ) * 0.08, W = this.options.padding + sQ;
|
|
3843
3884
|
this.viewBox = {
|
|
3844
3885
|
x: F - W,
|
|
@@ -3872,9 +3913,9 @@ class Ki {
|
|
|
3872
3913
|
);
|
|
3873
3914
|
const f = Math.abs(j.x - C.x), I = Math.abs(H.y - C.y), R = Math.max(f, I) * 0.07, QQ = R * 0.5;
|
|
3874
3915
|
ZQ(this.bboxLabelX, LQ(C, j), tt(LQ(C, j), LQ(F, H), QQ), R, `X: ${WQ(B - Q)}`);
|
|
3875
|
-
const sQ = Math.min(C.y, j.y, F.y, H.y), W = Math.max(C.y, j.y, F.y, H.y),
|
|
3916
|
+
const sQ = Math.min(C.y, j.y, F.y, H.y), W = Math.max(C.y, j.y, F.y, H.y), m = Math.max(C.x, j.x, F.x, H.x), BQ = Math.min(C.x, j.x, F.x, H.x), vQ = { x: m + QQ, y: (sQ + W) / 2 };
|
|
3876
3917
|
if (ZQ(this.bboxLabelY, vQ, vQ, R, `Y: ${WQ(A - t)}`), this.hasZInfo) {
|
|
3877
|
-
const rB = { x: (BQ +
|
|
3918
|
+
const rB = { x: (BQ + m) / 2, y: sQ - R };
|
|
3878
3919
|
ZQ(this.bboxLabelZ, rB, rB, R, `Z: ${WQ(P - e)}`);
|
|
3879
3920
|
} else
|
|
3880
3921
|
this.bboxLabelZ.setAttribute("visibility", "hidden");
|