ss-component-new 1.1.571 → 1.1.573
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/{index-DqrB6y2C.cjs → index-CtTsLJ50.cjs} +1 -1
- package/dist/{index-DdsIluSe.js → index-o2zYV6Ie.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +1 -1
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/dist/{threeModel-dMYA8w-e.js → threeModel-BzIk8lkl.js} +121 -120
- package/dist/{threeModel-DPoEsAzu.cjs → threeModel-CObKebbN.cjs} +1 -1
- package/package.json +1 -1
|
@@ -458,7 +458,7 @@ function Le(o) {
|
|
|
458
458
|
}
|
|
459
459
|
function Oe(o) {
|
|
460
460
|
let t = null, e = null, i = null, a = null, u = null, g = null, n = null, M = null;
|
|
461
|
-
const T = k([]),
|
|
461
|
+
const T = k([]), j = k(new _()), I = k(new _()), R = () => {
|
|
462
462
|
if (!o.value) return;
|
|
463
463
|
t = new ie(), t.background = new oe(15790320);
|
|
464
464
|
const m = o.value;
|
|
@@ -517,13 +517,13 @@ function Oe(o) {
|
|
|
517
517
|
T.value.forEach((st) => {
|
|
518
518
|
m.expandByObject(st);
|
|
519
519
|
});
|
|
520
|
-
const l = m.getSize(new _()), C = m.getCenter(new _()), V = Math.max(l.x, l.y, l.z), W = Math.max(V * 8, 50),
|
|
520
|
+
const l = m.getSize(new _()), C = m.getCenter(new _()), V = Math.max(l.x, l.y, l.z), W = Math.max(V * 8, 50), Y = new _(
|
|
521
521
|
C.x,
|
|
522
522
|
C.y,
|
|
523
523
|
m.min.z
|
|
524
524
|
// 模型的最底部
|
|
525
525
|
);
|
|
526
|
-
p(W,
|
|
526
|
+
p(W, Y);
|
|
527
527
|
}, v = () => {
|
|
528
528
|
const m = new de(4210752, 0.6);
|
|
529
529
|
t.add(m);
|
|
@@ -535,8 +535,8 @@ function Oe(o) {
|
|
|
535
535
|
V.position.set(0, -15, 2), t.add(V);
|
|
536
536
|
const W = new me(16777215, 4473924, 0.8);
|
|
537
537
|
t.add(W);
|
|
538
|
-
const
|
|
539
|
-
|
|
538
|
+
const Y = new Ut(16777215, 1, 50);
|
|
539
|
+
Y.position.set(15, 15, 15), t.add(Y);
|
|
540
540
|
const st = new Ut(16777215, 0.5, 50);
|
|
541
541
|
st.position.set(-15, -15, 15), t.add(st);
|
|
542
542
|
}, s = () => {
|
|
@@ -567,8 +567,8 @@ function Oe(o) {
|
|
|
567
567
|
return {
|
|
568
568
|
// 响应式数据
|
|
569
569
|
currentModels: T,
|
|
570
|
-
initialCameraPosition:
|
|
571
|
-
initialTargetPosition:
|
|
570
|
+
initialCameraPosition: j,
|
|
571
|
+
initialTargetPosition: I,
|
|
572
572
|
// 方法
|
|
573
573
|
initThreeJS: R,
|
|
574
574
|
handleResize: () => {
|
|
@@ -582,8 +582,8 @@ function Oe(o) {
|
|
|
582
582
|
T.value.forEach((st) => {
|
|
583
583
|
m.expandByObject(st);
|
|
584
584
|
});
|
|
585
|
-
const l = m.getSize(new _()), C = m.getCenter(new _()), W = Math.max(l.x, l.y, l.z) * 0.8,
|
|
586
|
-
e.position.copy(
|
|
585
|
+
const l = m.getSize(new _()), C = m.getCenter(new _()), W = Math.max(l.x, l.y, l.z) * 0.8, Y = new _(C.x + W, C.y - W, C.z + W);
|
|
586
|
+
e.position.copy(Y), e.lookAt(C), a.target.copy(C), a.update(), j.value.copy(Y), I.value.copy(C), D();
|
|
587
587
|
},
|
|
588
588
|
getThreeJSObjects: () => ({
|
|
589
589
|
scene: t,
|
|
@@ -613,19 +613,19 @@ function Oe(o) {
|
|
|
613
613
|
function je(o, t) {
|
|
614
614
|
const e = k(!1);
|
|
615
615
|
let i = null, a = 12700, u = new _(), g = new _(), n = new _(), M = 0, T = null;
|
|
616
|
-
const
|
|
617
|
-
const f = new _(), w = M * 1.2,
|
|
616
|
+
const j = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, I = (s) => {
|
|
617
|
+
const f = new _(), w = M * 1.2, F = new _(n.x + w, n.y, n.z), X = new _(n.x, n.y + w, n.z), G = new _(n.x, n.y - w, n.z);
|
|
618
618
|
if (s <= 0.567) {
|
|
619
619
|
const K = s / 0.567 * Math.PI * 2;
|
|
620
620
|
f.x = n.x + Math.cos(K) * w, f.z = n.z + Math.sin(K) * w, f.y = n.y;
|
|
621
621
|
} else if (s <= 0.724) {
|
|
622
|
-
const
|
|
623
|
-
f.lerpVectors(
|
|
622
|
+
const N = (s - 0.567) / 0.157, K = j(N);
|
|
623
|
+
f.lerpVectors(F, X, K);
|
|
624
624
|
} else if (s <= 0.881) {
|
|
625
|
-
const
|
|
625
|
+
const N = (s - 0.724) / 0.157, m = j(N) * Math.PI;
|
|
626
626
|
f.x = n.x + Math.sin(m) * w, f.y = n.y + Math.cos(m) * w, f.z = n.z;
|
|
627
627
|
} else {
|
|
628
|
-
const
|
|
628
|
+
const N = (s - 0.881) / 0.119, K = j(N);
|
|
629
629
|
f.lerpVectors(G, u, K);
|
|
630
630
|
}
|
|
631
631
|
return f;
|
|
@@ -633,12 +633,12 @@ function je(o, t) {
|
|
|
633
633
|
const { camera: s, controls: f } = o();
|
|
634
634
|
if (!s || !f) return;
|
|
635
635
|
i || (i = Date.now());
|
|
636
|
-
const w = Date.now() - i,
|
|
637
|
-
if (
|
|
636
|
+
const w = Date.now() - i, F = Math.min(w / a, 1);
|
|
637
|
+
if (F >= 1) {
|
|
638
638
|
D();
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
|
-
const X =
|
|
641
|
+
const X = I(F);
|
|
642
642
|
s.position.copy(X), s.lookAt(n), f.target.copy(n), T = requestAnimationFrame(R);
|
|
643
643
|
}, p = () => {
|
|
644
644
|
if (t.value.length === 0) return;
|
|
@@ -649,12 +649,12 @@ function je(o, t) {
|
|
|
649
649
|
t.value.forEach((l) => {
|
|
650
650
|
w.expandByObject(l);
|
|
651
651
|
});
|
|
652
|
-
const
|
|
653
|
-
n = w.getCenter(new _()), M = Math.max(
|
|
652
|
+
const F = w.getSize(new _());
|
|
653
|
+
n = w.getCenter(new _()), M = Math.max(F.x, F.y, F.z) * 1.2;
|
|
654
654
|
const X = new _(n.x + M * 1.2, n.y, n.z);
|
|
655
655
|
f.enabled = !1;
|
|
656
|
-
const G = s.position.clone(),
|
|
657
|
-
const l = Date.now() - K, C = Math.min(l /
|
|
656
|
+
const G = s.position.clone(), N = 1e3, K = Date.now(), m = () => {
|
|
657
|
+
const l = Date.now() - K, C = Math.min(l / N, 1), V = j(C);
|
|
658
658
|
s.position.lerpVectors(G, X, V), s.lookAt(n), f.target.copy(n), C < 1 ? requestAnimationFrame(m) : (e.value = !0, i = null, R());
|
|
659
659
|
};
|
|
660
660
|
m();
|
|
@@ -671,11 +671,11 @@ function je(o, t) {
|
|
|
671
671
|
const { camera: s, controls: f } = o();
|
|
672
672
|
if (!s || !f) return;
|
|
673
673
|
f.enabled = !0;
|
|
674
|
-
const w = s.position.clone(),
|
|
675
|
-
const K = Date.now() - G, m = Math.min(K / X, 1), l =
|
|
676
|
-
s.position.lerpVectors(w, u, l), f.target.lerpVectors(
|
|
674
|
+
const w = s.position.clone(), F = f.target.clone(), X = 1500, G = Date.now(), N = () => {
|
|
675
|
+
const K = Date.now() - G, m = Math.min(K / X, 1), l = j(m);
|
|
676
|
+
s.position.lerpVectors(w, u, l), f.target.lerpVectors(F, g, l), m < 1 && requestAnimationFrame(N);
|
|
677
677
|
};
|
|
678
|
-
|
|
678
|
+
N();
|
|
679
679
|
} else
|
|
680
680
|
p();
|
|
681
681
|
},
|
|
@@ -699,10 +699,10 @@ function Ie(o, t) {
|
|
|
699
699
|
g.makeEmpty(), t.value.forEach((v) => {
|
|
700
700
|
g.expandByObject(v);
|
|
701
701
|
}), n = g.getCenter(new _());
|
|
702
|
-
},
|
|
702
|
+
}, j = (v) => {
|
|
703
703
|
const s = g.getSize(new _());
|
|
704
|
-
let f, w,
|
|
705
|
-
v === "x" ? (f = new Pt(s.z * 1.2, s.y * 1.2), w = new _(n.x, n.y, n.z),
|
|
704
|
+
let f, w, F;
|
|
705
|
+
v === "x" ? (f = new Pt(s.z * 1.2, s.y * 1.2), w = new _(n.x, n.y, n.z), F = new Ct(0, Math.PI / 2, 0)) : v === "y" ? (f = new Pt(s.x * 1.2, s.z * 1.2), w = new _(n.x, n.y, n.z), F = new Ct(Math.PI / 2, 0, 0)) : v === "z" && (f = new Pt(s.x * 1.2, s.y * 1.2), w = new _(n.x, n.y, n.z), F = new Ct(0, 0, 0));
|
|
706
706
|
const X = new fe({
|
|
707
707
|
color: 8900331,
|
|
708
708
|
transparent: !0,
|
|
@@ -710,8 +710,8 @@ function Ie(o, t) {
|
|
|
710
710
|
side: _e,
|
|
711
711
|
depthWrite: !1
|
|
712
712
|
}), G = new At(f, X);
|
|
713
|
-
return G.position.copy(w), G.rotation.copy(
|
|
714
|
-
},
|
|
713
|
+
return G.position.copy(w), G.rotation.copy(F), G;
|
|
714
|
+
}, I = () => {
|
|
715
715
|
if (R(), p(), i.value === "none")
|
|
716
716
|
return;
|
|
717
717
|
T();
|
|
@@ -719,14 +719,14 @@ function Ie(o, t) {
|
|
|
719
719
|
if (i.value === "x" ? (a[0].constant = -n.x, v = a[0]) : i.value === "y" ? (a[1].constant = -n.y, v = a[1]) : i.value === "z" && (a[2].constant = -n.z, v = a[2]), v) {
|
|
720
720
|
t.value.forEach((f) => {
|
|
721
721
|
f.traverse((w) => {
|
|
722
|
-
w.isMesh && w.material && (Array.isArray(w.material) ? w.material.forEach((
|
|
723
|
-
|
|
722
|
+
w.isMesh && w.material && (Array.isArray(w.material) ? w.material.forEach((F) => {
|
|
723
|
+
F.clippingPlanes = [v];
|
|
724
724
|
}) : w.material.clippingPlanes = [v]);
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
727
|
const { scene: s } = o();
|
|
728
728
|
if (s) {
|
|
729
|
-
const f =
|
|
729
|
+
const f = j(i.value);
|
|
730
730
|
s.add(f), u.push(f);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
@@ -750,7 +750,7 @@ function Ie(o, t) {
|
|
|
750
750
|
toggleClipping: () => {
|
|
751
751
|
e.value = !e.value, e.value ? (M(), t.value.length > 0 && T()) : (i.value = "none", R(), p());
|
|
752
752
|
},
|
|
753
|
-
updateClippingPlanes:
|
|
753
|
+
updateClippingPlanes: I,
|
|
754
754
|
clearClippingPlanes: R,
|
|
755
755
|
clearClippingMeshes: p
|
|
756
756
|
};
|
|
@@ -843,7 +843,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
843
843
|
f.children && f.children.length > 0 && (v.push(f.id), s.push(...f.children));
|
|
844
844
|
}
|
|
845
845
|
return v;
|
|
846
|
-
},
|
|
846
|
+
}, j = (p, D) => {
|
|
847
847
|
const v = [];
|
|
848
848
|
return p.forEach((s) => {
|
|
849
849
|
if (s.children && s.children.length > 0) {
|
|
@@ -852,7 +852,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
852
852
|
v.push(...f);
|
|
853
853
|
}
|
|
854
854
|
}), v.slice(0, D + 1);
|
|
855
|
-
},
|
|
855
|
+
}, I = pt(() => !a.value || a.value.length === 0 ? [] : e.expandStrategy === "firstLevel" ? j(a.value, e.maxExpandCount) : T(a.value, e.maxExpandCount)), R = pt(() => e != null && e.model ? M(e.model) : []);
|
|
856
856
|
return Mt(
|
|
857
857
|
R,
|
|
858
858
|
(p) => {
|
|
@@ -865,7 +865,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
865
865
|
A(v, {
|
|
866
866
|
data: a.value,
|
|
867
867
|
props: u,
|
|
868
|
-
"default-expanded-keys":
|
|
868
|
+
"default-expanded-keys": I.value,
|
|
869
869
|
"node-key": Ve,
|
|
870
870
|
onNodeClick: g
|
|
871
871
|
}, null, 8, ["data", "default-expanded-keys"])
|
|
@@ -891,7 +891,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
891
891
|
setup(o, { expose: t }) {
|
|
892
892
|
const e = o;
|
|
893
893
|
k(!0);
|
|
894
|
-
const i = k([]), a = k(null), u = k(), g = k(729.2), n = k(!1), M = k(!1), T = k(0),
|
|
894
|
+
const i = k([]), a = k(null), u = k(), g = k(729.2), n = k(!1), M = k(!1), T = k(0), j = k(0), I = k(null), R = k(1), p = () => as / kt / R.value;
|
|
895
895
|
let D = [];
|
|
896
896
|
Mt(
|
|
897
897
|
() => e.animationData,
|
|
@@ -911,7 +911,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
911
911
|
const d = c.joints[P];
|
|
912
912
|
if (d._jointType === "fixed")
|
|
913
913
|
return;
|
|
914
|
-
const
|
|
914
|
+
const L = d.limit ? {
|
|
915
915
|
lower: d.limit.lower ?? s(d._jointType, !1),
|
|
916
916
|
upper: d.limit.upper ?? s(d._jointType, !0)
|
|
917
917
|
} : {
|
|
@@ -921,14 +921,15 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
921
921
|
h.push({
|
|
922
922
|
name: P,
|
|
923
923
|
type: d._jointType || "unknown",
|
|
924
|
-
limit:
|
|
924
|
+
limit: L,
|
|
925
925
|
currentValue: d.angle || 0,
|
|
926
926
|
urdfJoint: d
|
|
927
927
|
});
|
|
928
928
|
}), c.traverse((P) => {
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
929
|
+
var d;
|
|
930
|
+
console.log(2322, P), P.name === "Pipe_Link" && !y && ((d = P.children) == null || d.forEach((L) => {
|
|
931
|
+
console.log(2323, L), L instanceof At && !y && (y = L);
|
|
932
|
+
}));
|
|
932
933
|
}), y ? (console.log(2324, y), u.value = y, h.sort((P, d) => P.name.localeCompare(d.name))) : !1;
|
|
933
934
|
}, w = (c, y) => {
|
|
934
935
|
const h = i.value.find((d) => d.name === c);
|
|
@@ -940,12 +941,12 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
940
941
|
} else
|
|
941
942
|
h.currentValue = P;
|
|
942
943
|
e.model && e.model.setJointValue ? e.model.setJointValue(c, h.currentValue) : h.urdfJoint && h.urdfJoint.setJointValue(h.currentValue);
|
|
943
|
-
},
|
|
944
|
+
}, F = (c) => c.reduce((y, h) => {
|
|
944
945
|
let P = 0;
|
|
945
|
-
const d = h.Y ?? 0,
|
|
946
|
-
return d > 0 && (P += d),
|
|
946
|
+
const d = h.Y ?? 0, L = h.C ?? 0, x = h.R ?? 0;
|
|
947
|
+
return d > 0 && (P += d), L > 0 && x > 0 && (P += x * deg2rad(L)), y + P;
|
|
947
948
|
}, 0), X = (c) => {
|
|
948
|
-
const y = [], h = c.Y ?? 0, P = c.B ?? 0, d = c.C ?? 0,
|
|
949
|
+
const y = [], h = c.Y ?? 0, P = c.B ?? 0, d = c.C ?? 0, L = c.R ?? 0, x = {
|
|
949
950
|
pos: new _(0, 0, 0),
|
|
950
951
|
localY: new _(0, 1, 0),
|
|
951
952
|
localX: new _(1, 0, 0),
|
|
@@ -956,8 +957,8 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
956
957
|
const tt = new dt().makeRotationAxis(x.localY, deg2rad(P));
|
|
957
958
|
x.localX.applyMatrix4(tt), x.localZ.applyMatrix4(tt);
|
|
958
959
|
}
|
|
959
|
-
if (h > 0 && (x.pos.add(x.localY.clone().multiplyScalar(h * vt)), y.push(x.pos.clone())), d > 0 &&
|
|
960
|
-
const tt = deg2rad(d), B =
|
|
960
|
+
if (h > 0 && (x.pos.add(x.localY.clone().multiplyScalar(h * vt)), y.push(x.pos.clone())), d > 0 && L > 0) {
|
|
961
|
+
const tt = deg2rad(d), B = L * vt, S = x.pos.clone().add(x.localX.clone().multiplyScalar(-B)), r = Math.max(16, Math.ceil(d / 5));
|
|
961
962
|
for (let Z = 1; Z <= r; Z++) {
|
|
962
963
|
const lt = tt * Z / r, at = new dt().makeRotationAxis(x.localZ, lt), q = x.localX.clone().multiplyScalar(B).applyMatrix4(at), E = S.clone().add(q);
|
|
963
964
|
y.push(E);
|
|
@@ -966,12 +967,12 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
966
967
|
return y;
|
|
967
968
|
}, G = (c) => {
|
|
968
969
|
if (!u.value || !v.value) return;
|
|
969
|
-
const y = D.slice(0, c + 1), h =
|
|
970
|
+
const y = D.slice(0, c + 1), h = F(y), P = Math.max(0, g.value - h), d = [];
|
|
970
971
|
d.push(new _(0, 0, 0));
|
|
971
|
-
const
|
|
972
|
-
P > 0 && d.push(
|
|
972
|
+
const L = new _(0, P * vt, 0);
|
|
973
|
+
P > 0 && d.push(L);
|
|
973
974
|
let x = {
|
|
974
|
-
pos:
|
|
975
|
+
pos: L.clone(),
|
|
975
976
|
localY: new _(0, 1, 0),
|
|
976
977
|
localX: new _(1, 0, 0),
|
|
977
978
|
localZ: new _(0, 0, 1)
|
|
@@ -1017,17 +1018,17 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1017
1018
|
} catch (B) {
|
|
1018
1019
|
console.error("主管件更新失败", B);
|
|
1019
1020
|
}
|
|
1020
|
-
},
|
|
1021
|
+
}, N = (c) => {
|
|
1021
1022
|
c && Object.keys(c).forEach((y, h) => {
|
|
1022
|
-
const P = c[y], d = i.value.find((
|
|
1023
|
+
const P = c[y], d = i.value.find((L) => L.name === y);
|
|
1023
1024
|
d && (d.currentValue = P, e.model && e.model.setJointValue ? e.model.setJointValue(y, P) : d.urdfJoint && d.urdfJoint.setJointValue(P)), console.log(232, h), G(h);
|
|
1024
1025
|
});
|
|
1025
1026
|
}, K = (c, y, h) => c + (y - c) * h, m = (c, y, h) => {
|
|
1026
1027
|
if (!c || !y) return c || y;
|
|
1027
1028
|
const P = {};
|
|
1028
1029
|
return Object.keys(c).forEach((d) => {
|
|
1029
|
-
const
|
|
1030
|
-
P[d] = K(
|
|
1030
|
+
const L = c[d], x = y[d];
|
|
1031
|
+
P[d] = K(L, x || L, h);
|
|
1031
1032
|
}), P;
|
|
1032
1033
|
}, l = () => {
|
|
1033
1034
|
if (D.length === 0) {
|
|
@@ -1037,30 +1038,30 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1037
1038
|
n.value = !0, M.value = !1;
|
|
1038
1039
|
const c = () => {
|
|
1039
1040
|
if (!n.value || M.value) return;
|
|
1040
|
-
const y =
|
|
1041
|
+
const y = j.value / kt, h = D[T.value], P = D[T.value + 1];
|
|
1041
1042
|
if (P) {
|
|
1042
1043
|
const d = m(h, P, y);
|
|
1043
|
-
|
|
1044
|
+
N(d);
|
|
1044
1045
|
} else
|
|
1045
|
-
|
|
1046
|
-
if (
|
|
1046
|
+
N(h);
|
|
1047
|
+
if (j.value++, j.value >= kt && (j.value = 0, T.value++, T.value >= D.length - 1)) {
|
|
1047
1048
|
V();
|
|
1048
1049
|
return;
|
|
1049
1050
|
}
|
|
1050
|
-
|
|
1051
|
+
I.value = setTimeout(c, p());
|
|
1051
1052
|
};
|
|
1052
1053
|
c();
|
|
1053
1054
|
}, C = () => {
|
|
1054
|
-
M.value = !0,
|
|
1055
|
+
M.value = !0, I.value && (clearTimeout(I.value), I.value = null);
|
|
1055
1056
|
}, V = () => {
|
|
1056
|
-
n.value = !1, M.value = !1, R.value = 1,
|
|
1057
|
+
n.value = !1, M.value = !1, R.value = 1, I.value && (clearTimeout(I.value), I.value = null);
|
|
1057
1058
|
};
|
|
1058
1059
|
t({
|
|
1059
1060
|
startAnimation: l,
|
|
1060
1061
|
pauseAnimation: C,
|
|
1061
1062
|
stopAnimation: V,
|
|
1062
1063
|
resetAll: () => {
|
|
1063
|
-
V(), T.value = 0,
|
|
1064
|
+
V(), T.value = 0, j.value = 0, i.value.forEach((c) => {
|
|
1064
1065
|
(c.type === "revolute" || c.type === "prismatic") && w(c.name, 0);
|
|
1065
1066
|
});
|
|
1066
1067
|
},
|
|
@@ -1096,7 +1097,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1096
1097
|
}), (c, y) => ($(), Q("div", Ke, [
|
|
1097
1098
|
i.value.length > 0 ? ($(), Q("div", Xe, [
|
|
1098
1099
|
($(!0), Q(Jt, null, Wt(i.value, (h) => {
|
|
1099
|
-
var P, d,
|
|
1100
|
+
var P, d, L, x;
|
|
1100
1101
|
return $(), Q("div", {
|
|
1101
1102
|
key: h.name,
|
|
1102
1103
|
class: "joint-item"
|
|
@@ -1112,7 +1113,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1112
1113
|
b("div", Qe, [
|
|
1113
1114
|
b("input", {
|
|
1114
1115
|
type: "range",
|
|
1115
|
-
min: ((
|
|
1116
|
+
min: ((L = h.limit) == null ? void 0 : L.lower) ?? (h.type === "revolute" ? -Math.PI : -1),
|
|
1116
1117
|
max: ((x = h.limit) == null ? void 0 : x.upper) ?? (h.type === "revolute" ? Math.PI : 1),
|
|
1117
1118
|
step: 0.01,
|
|
1118
1119
|
value: h.currentValue,
|
|
@@ -1133,7 +1134,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1133
1134
|
])))
|
|
1134
1135
|
]));
|
|
1135
1136
|
}
|
|
1136
|
-
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-
|
|
1137
|
+
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-ec07720b"]]), rs = ["xlink:href"], cs = /* @__PURE__ */ qt({
|
|
1137
1138
|
__name: "svgIcon",
|
|
1138
1139
|
props: {
|
|
1139
1140
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1169,7 +1170,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1169
1170
|
], 6))
|
|
1170
1171
|
], 6));
|
|
1171
1172
|
}
|
|
1172
|
-
}),
|
|
1173
|
+
}), O = /* @__PURE__ */ mt(cs, [["__scopeId", "data-v-3150a90b"]]), hs = { class: "obj-viewer-container" }, us = { class: "buttonGroup-top" }, ps = { class: "buttonGroup-topLeft" }, ds = { class: "buttonGroup-left" }, ms = { class: "buttonGroup-right" }, fs = { class: "buttonGroup-bottom" }, _s = { class: "left-panel" }, gs = { class: "panel-header" }, ys = {
|
|
1173
1174
|
key: 1,
|
|
1174
1175
|
class: "clipping-content"
|
|
1175
1176
|
}, vs = { class: "radio-group" }, bs = { class: "radio-label" }, ws = { class: "radio-label" }, Ps = { class: "radio-label" }, Ms = { class: "radio-label" }, xs = { class: "right-panel" }, Es = { class: "panel-header" }, Ds = {
|
|
@@ -1190,34 +1191,34 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1190
1191
|
let u = null, g = !1;
|
|
1191
1192
|
const n = k(null), M = k(!1), T = k("");
|
|
1192
1193
|
k(!1);
|
|
1193
|
-
const
|
|
1194
|
+
const j = k(!1), I = k(!1), R = k(""), p = k(!1), D = k(""), v = k(), {
|
|
1194
1195
|
currentModels: s,
|
|
1195
1196
|
initialCameraPosition: f,
|
|
1196
1197
|
initialTargetPosition: w,
|
|
1197
|
-
initThreeJS:
|
|
1198
|
+
initThreeJS: F,
|
|
1198
1199
|
handleResize: X,
|
|
1199
1200
|
fitCameraToAllModels: G,
|
|
1200
|
-
getThreeJSObjects:
|
|
1201
|
+
getThreeJSObjects: N,
|
|
1201
1202
|
clearAllModels: K,
|
|
1202
1203
|
cleanup: m
|
|
1203
|
-
} = Oe(n), { isAnimating: l, toggleAnimation: C, stopAnimation: V } = je(
|
|
1204
|
-
|
|
1204
|
+
} = Oe(n), { isAnimating: l, toggleAnimation: C, stopAnimation: V } = je(N, s), { isClipping: W, activeClippingAxis: Y, toggleClipping: st, updateClippingPlanes: it } = Ie(
|
|
1205
|
+
N,
|
|
1205
1206
|
s
|
|
1206
1207
|
), { addModelsFromUrls: Et, loadModelByDefaultPath: Dt, urdfModel: c } = be(
|
|
1207
|
-
|
|
1208
|
+
N,
|
|
1208
1209
|
s,
|
|
1209
1210
|
M,
|
|
1210
1211
|
T,
|
|
1211
1212
|
K
|
|
1212
1213
|
), y = () => {
|
|
1213
|
-
if (
|
|
1214
|
-
|
|
1215
|
-
const { camera: S, controls: r } =
|
|
1214
|
+
if (j.value || s.value.length === 0) return;
|
|
1215
|
+
j.value = !0, l.value && V();
|
|
1216
|
+
const { camera: S, controls: r } = N();
|
|
1216
1217
|
if (!S || !r) return;
|
|
1217
1218
|
r.enabled = !0;
|
|
1218
1219
|
const Z = (ot) => ot < 0.5 ? 4 * ot * ot * ot : 1 - Math.pow(-2 * ot + 2, 3) / 2, lt = S.position.clone(), at = r.target.clone(), rt = 1500, q = Date.now(), E = () => {
|
|
1219
1220
|
const ot = Date.now() - q, Rt = Math.min(ot / rt, 1), Lt = Z(Rt);
|
|
1220
|
-
S.position.lerpVectors(lt, f.value, Lt), r.target.lerpVectors(at, w.value, Lt), Rt < 1 ? requestAnimationFrame(E) :
|
|
1221
|
+
S.position.lerpVectors(lt, f.value, Lt), r.target.lerpVectors(at, w.value, Lt), Rt < 1 ? requestAnimationFrame(E) : j.value = !1;
|
|
1221
1222
|
};
|
|
1222
1223
|
E();
|
|
1223
1224
|
}, h = async () => g ? Promise.resolve() : new Promise((S) => {
|
|
@@ -1233,8 +1234,8 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1233
1234
|
} catch (Z) {
|
|
1234
1235
|
throw console.error("加载模型失败:", Z), Z;
|
|
1235
1236
|
}
|
|
1236
|
-
}, d = async (S) => P(S, Et),
|
|
1237
|
-
|
|
1237
|
+
}, d = async (S) => P(S, Et), L = async (S) => P(S, Dt), x = (S) => {
|
|
1238
|
+
I.value = !0, R.value = S, S === "剖面视图" && !W.value && st();
|
|
1238
1239
|
}, tt = (S) => {
|
|
1239
1240
|
p.value = !0, D.value = S;
|
|
1240
1241
|
}, B = () => {
|
|
@@ -1246,7 +1247,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1246
1247
|
return Xt(async () => {
|
|
1247
1248
|
await It();
|
|
1248
1249
|
try {
|
|
1249
|
-
|
|
1250
|
+
F(), u = N().scene, g = !0, window.addEventListener("resize", X);
|
|
1250
1251
|
} catch (S) {
|
|
1251
1252
|
console.error("Three.js初始化失败:", S);
|
|
1252
1253
|
}
|
|
@@ -1254,7 +1255,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1254
1255
|
g = !1, R.value = "", D.value = "", window.removeEventListener("resize", X), l.value && V(), m();
|
|
1255
1256
|
}), t({
|
|
1256
1257
|
addModelsFromUrls: d,
|
|
1257
|
-
loadModelByDefaultPath:
|
|
1258
|
+
loadModelByDefaultPath: L
|
|
1258
1259
|
}), (S, r) => {
|
|
1259
1260
|
var lt, at, rt, q;
|
|
1260
1261
|
const Z = Kt("el-scrollbar");
|
|
@@ -1265,45 +1266,45 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1265
1266
|
class: "threejs-container"
|
|
1266
1267
|
}, null, 512),
|
|
1267
1268
|
b("div", us, [
|
|
1268
|
-
A(
|
|
1269
|
+
A(O, {
|
|
1269
1270
|
name: "guanjianjiexi",
|
|
1270
1271
|
size: "34"
|
|
1271
1272
|
}),
|
|
1272
|
-
A(
|
|
1273
|
+
A(O, {
|
|
1273
1274
|
name: "guanjiekongzhi",
|
|
1274
1275
|
size: "34"
|
|
1275
1276
|
}),
|
|
1276
|
-
A(
|
|
1277
|
+
A(O, {
|
|
1277
1278
|
name: "gongyishengcheng",
|
|
1278
1279
|
size: "34"
|
|
1279
1280
|
}),
|
|
1280
|
-
A(
|
|
1281
|
+
A(O, {
|
|
1281
1282
|
name: "buchangshezhi",
|
|
1282
1283
|
size: "34"
|
|
1283
1284
|
}),
|
|
1284
|
-
A(
|
|
1285
|
+
A(O, {
|
|
1285
1286
|
name: "shuchujiagongchengxu",
|
|
1286
1287
|
size: "34"
|
|
1287
1288
|
})
|
|
1288
1289
|
]),
|
|
1289
1290
|
b("div", ps, [
|
|
1290
|
-
A(
|
|
1291
|
+
A(O, {
|
|
1291
1292
|
name: "viewReset",
|
|
1292
1293
|
size: "24",
|
|
1293
1294
|
onClick: y,
|
|
1294
1295
|
title: "重置"
|
|
1295
1296
|
}),
|
|
1296
|
-
A(
|
|
1297
|
+
A(O, {
|
|
1297
1298
|
name: "fangda",
|
|
1298
1299
|
size: "24",
|
|
1299
1300
|
title: "放大"
|
|
1300
1301
|
}),
|
|
1301
|
-
A(
|
|
1302
|
+
A(O, {
|
|
1302
1303
|
name: "suoxiao",
|
|
1303
1304
|
size: "24",
|
|
1304
1305
|
title: "缩小"
|
|
1305
1306
|
}),
|
|
1306
|
-
A(
|
|
1307
|
+
A(O, {
|
|
1307
1308
|
name: "lookAround",
|
|
1308
1309
|
size: "24",
|
|
1309
1310
|
onClick: H(C),
|
|
@@ -1311,93 +1312,93 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1311
1312
|
}, null, 8, ["onClick", "title"])
|
|
1312
1313
|
]),
|
|
1313
1314
|
b("div", ds, [
|
|
1314
|
-
A(
|
|
1315
|
+
A(O, {
|
|
1315
1316
|
name: "jiegoushu",
|
|
1316
1317
|
size: "24",
|
|
1317
1318
|
onClick: r[0] || (r[0] = (E) => x("场景树")),
|
|
1318
|
-
active:
|
|
1319
|
+
active: I.value && R.value === "场景树",
|
|
1319
1320
|
title: "场景树"
|
|
1320
1321
|
}, null, 8, ["active"]),
|
|
1321
|
-
A(
|
|
1322
|
+
A(O, {
|
|
1322
1323
|
name: "clipping",
|
|
1323
1324
|
size: "24",
|
|
1324
1325
|
onClick: r[1] || (r[1] = (E) => x("剖面视图")),
|
|
1325
|
-
active:
|
|
1326
|
+
active: I.value && R.value === "剖面视图",
|
|
1326
1327
|
title: "剖面视图"
|
|
1327
1328
|
}, null, 8, ["active"]),
|
|
1328
|
-
A(
|
|
1329
|
+
A(O, {
|
|
1329
1330
|
name: "donghuafangzhen",
|
|
1330
1331
|
size: "24",
|
|
1331
1332
|
onClick: r[2] || (r[2] = (E) => x("场景树3"))
|
|
1332
1333
|
}),
|
|
1333
|
-
A(
|
|
1334
|
+
A(O, {
|
|
1334
1335
|
name: "donghuafangzhen",
|
|
1335
1336
|
size: "24",
|
|
1336
1337
|
onClick: r[3] || (r[3] = (E) => x("场景4"))
|
|
1337
1338
|
})
|
|
1338
1339
|
]),
|
|
1339
1340
|
b("div", ms, [
|
|
1340
|
-
A(
|
|
1341
|
+
A(O, {
|
|
1341
1342
|
name: "donghuafangzhen",
|
|
1342
1343
|
size: "24"
|
|
1343
1344
|
}),
|
|
1344
|
-
A(
|
|
1345
|
+
A(O, {
|
|
1345
1346
|
name: "donghuafangzhen",
|
|
1346
1347
|
size: "24"
|
|
1347
1348
|
}),
|
|
1348
|
-
A(
|
|
1349
|
+
A(O, {
|
|
1349
1350
|
name: "guanjiekongzhi",
|
|
1350
1351
|
size: "24",
|
|
1351
1352
|
onClick: r[4] || (r[4] = (E) => tt("关节控制")),
|
|
1352
1353
|
active: p.value && D.value === "关节控制",
|
|
1353
1354
|
title: "关节控制"
|
|
1354
1355
|
}, null, 8, ["active"]),
|
|
1355
|
-
A(
|
|
1356
|
+
A(O, {
|
|
1356
1357
|
name: "DongHuaFangZhen",
|
|
1357
1358
|
size: "24",
|
|
1358
1359
|
title: "动画仿真",
|
|
1359
1360
|
onClick: r[5] || (r[5] = (E) => tt("动画仿真")),
|
|
1360
1361
|
active: p.value && D.value === "动画仿真"
|
|
1361
1362
|
}, null, 8, ["active"]),
|
|
1362
|
-
A(
|
|
1363
|
+
A(O, {
|
|
1363
1364
|
name: "donghuafangzhen",
|
|
1364
1365
|
size: "24"
|
|
1365
1366
|
}),
|
|
1366
|
-
A(
|
|
1367
|
+
A(O, {
|
|
1367
1368
|
name: "donghuafangzhen",
|
|
1368
1369
|
size: "24"
|
|
1369
1370
|
})
|
|
1370
1371
|
]),
|
|
1371
1372
|
b("div", fs, [
|
|
1372
|
-
A(
|
|
1373
|
+
A(O, {
|
|
1373
1374
|
name: "kuaitui",
|
|
1374
1375
|
size: "24",
|
|
1375
1376
|
backgroundColor: "#ffffff",
|
|
1376
1377
|
title: "快退",
|
|
1377
1378
|
onClick: (lt = v.value) == null ? void 0 : lt.fastBackward
|
|
1378
1379
|
}, null, 8, ["onClick"]),
|
|
1379
|
-
A(
|
|
1380
|
+
A(O, {
|
|
1380
1381
|
name: "bofang",
|
|
1381
1382
|
size: "24",
|
|
1382
1383
|
backgroundColor: "#ffffff",
|
|
1383
1384
|
title: "播放",
|
|
1384
1385
|
onClick: B
|
|
1385
1386
|
}),
|
|
1386
|
-
A(
|
|
1387
|
+
A(O, {
|
|
1387
1388
|
name: "kuaijin",
|
|
1388
1389
|
size: "24",
|
|
1389
1390
|
backgroundColor: "#ffffff",
|
|
1390
1391
|
title: "快进",
|
|
1391
1392
|
onClick: (at = v.value) == null ? void 0 : at.fastForward
|
|
1392
1393
|
}, null, 8, ["onClick"]),
|
|
1393
|
-
A(
|
|
1394
|
+
A(O, {
|
|
1394
1395
|
name: "zanting",
|
|
1395
1396
|
size: "24",
|
|
1396
1397
|
backgroundColor: "#ffffff",
|
|
1397
1398
|
title: "暂停",
|
|
1398
1399
|
onClick: (rt = v.value) == null ? void 0 : rt.pauseAnimation
|
|
1399
1400
|
}, null, 8, ["onClick"]),
|
|
1400
|
-
A(
|
|
1401
|
+
A(O, {
|
|
1401
1402
|
name: "zhongzhi",
|
|
1402
1403
|
size: "24",
|
|
1403
1404
|
backgroundColor: "#ffffff",
|
|
@@ -1410,7 +1411,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1410
1411
|
b("span", null, nt(R.value), 1),
|
|
1411
1412
|
b("span", {
|
|
1412
1413
|
class: "close",
|
|
1413
|
-
onClick: r[6] || (r[6] = (E) =>
|
|
1414
|
+
onClick: r[6] || (r[6] = (E) => I.value = !1)
|
|
1414
1415
|
}, " X ")
|
|
1415
1416
|
]),
|
|
1416
1417
|
A(Z, { "max-height": "650px" }, {
|
|
@@ -1426,10 +1427,10 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1426
1427
|
type: "radio",
|
|
1427
1428
|
name: "clipping-axis",
|
|
1428
1429
|
value: "none",
|
|
1429
|
-
"onUpdate:modelValue": r[7] || (r[7] = (E) => ft(
|
|
1430
|
+
"onUpdate:modelValue": r[7] || (r[7] = (E) => ft(Y) ? Y.value = E : null),
|
|
1430
1431
|
onChange: r[8] || (r[8] = (...E) => H(it) && H(it)(...E))
|
|
1431
1432
|
}, null, 544), [
|
|
1432
|
-
[_t, H(
|
|
1433
|
+
[_t, H(Y)]
|
|
1433
1434
|
]),
|
|
1434
1435
|
r[16] || (r[16] = b("span", { class: "radio-text" }, "无切割", -1))
|
|
1435
1436
|
]),
|
|
@@ -1438,10 +1439,10 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1438
1439
|
type: "radio",
|
|
1439
1440
|
name: "clipping-axis",
|
|
1440
1441
|
value: "x",
|
|
1441
|
-
"onUpdate:modelValue": r[9] || (r[9] = (E) => ft(
|
|
1442
|
+
"onUpdate:modelValue": r[9] || (r[9] = (E) => ft(Y) ? Y.value = E : null),
|
|
1442
1443
|
onChange: r[10] || (r[10] = (...E) => H(it) && H(it)(...E))
|
|
1443
1444
|
}, null, 544), [
|
|
1444
|
-
[_t, H(
|
|
1445
|
+
[_t, H(Y)]
|
|
1445
1446
|
]),
|
|
1446
1447
|
r[17] || (r[17] = b("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1447
1448
|
]),
|
|
@@ -1450,10 +1451,10 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1450
1451
|
type: "radio",
|
|
1451
1452
|
name: "clipping-axis",
|
|
1452
1453
|
value: "y",
|
|
1453
|
-
"onUpdate:modelValue": r[11] || (r[11] = (E) => ft(
|
|
1454
|
+
"onUpdate:modelValue": r[11] || (r[11] = (E) => ft(Y) ? Y.value = E : null),
|
|
1454
1455
|
onChange: r[12] || (r[12] = (...E) => H(it) && H(it)(...E))
|
|
1455
1456
|
}, null, 544), [
|
|
1456
|
-
[_t, H(
|
|
1457
|
+
[_t, H(Y)]
|
|
1457
1458
|
]),
|
|
1458
1459
|
r[18] || (r[18] = b("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1459
1460
|
]),
|
|
@@ -1462,10 +1463,10 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1462
1463
|
type: "radio",
|
|
1463
1464
|
name: "clipping-axis",
|
|
1464
1465
|
value: "z",
|
|
1465
|
-
"onUpdate:modelValue": r[13] || (r[13] = (E) => ft(
|
|
1466
|
+
"onUpdate:modelValue": r[13] || (r[13] = (E) => ft(Y) ? Y.value = E : null),
|
|
1466
1467
|
onChange: r[14] || (r[14] = (...E) => H(it) && H(it)(...E))
|
|
1467
1468
|
}, null, 544), [
|
|
1468
|
-
[_t, H(
|
|
1469
|
+
[_t, H(Y)]
|
|
1469
1470
|
]),
|
|
1470
1471
|
r[19] || (r[19] = b("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1471
1472
|
])
|
|
@@ -1475,7 +1476,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1475
1476
|
_: 1
|
|
1476
1477
|
})
|
|
1477
1478
|
], 512), [
|
|
1478
|
-
[gt,
|
|
1479
|
+
[gt, I.value]
|
|
1479
1480
|
]),
|
|
1480
1481
|
ct(b("div", xs, [
|
|
1481
1482
|
b("div", Es, [
|