ss-component-new 1.1.586 → 1.1.587
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-DzJUB5M0.js → index-D9XuBLBf.js} +1 -1
- package/dist/{index-Dgr_upRm.cjs → index-oIRe8j9f.cjs} +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-Dy62X6VA.js → threeModel-DTfSO1TZ.js} +252 -250
- package/dist/{threeModel-25JIkmAh.cjs → threeModel-l2JuUHQ8.cjs} +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as D, watch as xe, createElementBlock as J, openBlock as B, createBlock as Ze, computed as ue, resolveComponent as Ke, createVNode as T, onMounted as Be, onUnmounted as We, Fragment as qe, renderList as Qe, createElementVNode as g, createCommentVNode as we, toDisplayString as ie, defineComponent as et, normalizeStyle as Le, normalizeClass as je, nextTick as Ie, onBeforeUnmount as tt, withDirectives as ne, unref as
|
|
1
|
+
import { ref as D, watch as xe, createElementBlock as J, openBlock as B, createBlock as Ze, computed as ue, resolveComponent as Ke, createVNode as T, onMounted as Be, onUnmounted as We, Fragment as qe, renderList as Qe, createElementVNode as g, createCommentVNode as we, toDisplayString as ie, defineComponent as et, normalizeStyle as Le, normalizeClass as je, nextTick as Ie, onBeforeUnmount as tt, withDirectives as ne, unref as U, withCtx as Fe, isRef as ge, vModelRadio as ye, vShow as ve } from "vue";
|
|
2
2
|
import { C as st, V as y, M as ae, T as ce, Q as Ne, D as Ue, E as ee, R as it, P as Pe, F as $e, G as Ee, H as ot, J as nt, K as at, W as lt, L as rt, N as ht, O as ct, X as ut, U as pt, Y as Me, Z as dt, _ as Xe, $ as mt, a0 as Te, a1 as ft, a2 as Ye, a3 as _t, a4 as gt, a5 as Ce, B as yt, a6 as Se, a7 as vt, a8 as bt, a9 as wt } from "./index-Bqwsx3he.js";
|
|
3
3
|
import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
import { c as Ge } from "./menu-Qw1eGtzq.js";
|
|
@@ -100,15 +100,15 @@ class Mt extends st {
|
|
|
100
100
|
if (this.object.isPerspectiveCamera) {
|
|
101
101
|
const a = N.length();
|
|
102
102
|
m = this._clampDistance(a * this._scale);
|
|
103
|
-
const
|
|
104
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
103
|
+
const b = a - m;
|
|
104
|
+
this.object.position.addScaledVector(this._dollyDirection, b), this.object.updateMatrixWorld(), d = !!b;
|
|
105
105
|
} else if (this.object.isOrthographicCamera) {
|
|
106
106
|
const a = new y(this._mouse.x, this._mouse.y, 0);
|
|
107
107
|
a.unproject(this.object);
|
|
108
|
-
const
|
|
109
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), d =
|
|
110
|
-
const
|
|
111
|
-
|
|
108
|
+
const b = this.object.zoom;
|
|
109
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), d = b !== this.object.zoom;
|
|
110
|
+
const P = new y(this._mouse.x, this._mouse.y, 0);
|
|
111
|
+
P.unproject(this.object), this.object.position.sub(P).add(a), this.object.updateMatrixWorld(), m = N.length();
|
|
112
112
|
} else
|
|
113
113
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
114
114
|
m !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(m).add(this.object.position) : (be.origin.copy(this.object.position), be.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(be.direction)) < Pt ? this.object.lookAt(this.target) : (He.setFromNormalAndCoplanarPoint(this.object.up, this.target), be.intersectPlane(He, this.target))));
|
|
@@ -457,20 +457,20 @@ function Lt(o) {
|
|
|
457
457
|
o.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
458
458
|
}
|
|
459
459
|
function jt(o) {
|
|
460
|
-
let e = null, t = null, i = null, n = null, d = null, m = null, a = null,
|
|
461
|
-
const
|
|
460
|
+
let e = null, t = null, i = null, n = null, d = null, m = null, a = null, b = null;
|
|
461
|
+
const P = D([]), O = D(new y()), L = D(new y()), j = () => {
|
|
462
462
|
if (!o.value) return;
|
|
463
463
|
e = new ot(), e.background = new nt(15790320);
|
|
464
|
-
const
|
|
465
|
-
t = new at(75,
|
|
464
|
+
const p = o.value;
|
|
465
|
+
t = new at(75, p.clientWidth / p.clientHeight, 0.1, 1e4), t.position.set(8, -8, 6), t.up.set(0, 0, 1), t.lookAt(0, 0, 0), i = new lt({
|
|
466
466
|
antialias: !0,
|
|
467
467
|
alpha: !0
|
|
468
|
-
}), i.setSize(
|
|
468
|
+
}), i.setSize(p.clientWidth, p.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = rt, i.toneMapping = ht, i.toneMappingExposure = 1, i.outputColorSpace = ct, p.appendChild(i.domElement), n = new Mt(t, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
|
|
469
469
|
LEFT: ae.ROTATE,
|
|
470
470
|
MIDDLE: ae.PAN,
|
|
471
471
|
RIGHT: null
|
|
472
472
|
}, n.panSpeed = 0.7, d = new ut(t, i, {
|
|
473
|
-
container:
|
|
473
|
+
container: p,
|
|
474
474
|
type: "cube",
|
|
475
475
|
placement: "top-right",
|
|
476
476
|
offset: {
|
|
@@ -500,37 +500,37 @@ function jt(o) {
|
|
|
500
500
|
label: "Bottom"
|
|
501
501
|
}
|
|
502
502
|
}), d.attachControls(n), f(), s();
|
|
503
|
-
}, l = (
|
|
504
|
-
a && (e.remove(a), a.dispose()),
|
|
505
|
-
const
|
|
506
|
-
a = new pt(
|
|
507
|
-
const $ = new Me(
|
|
503
|
+
}, l = (p, r) => {
|
|
504
|
+
a && (e.remove(a), a.dispose()), b && (e.remove(b), b.geometry.dispose(), b.material.dispose());
|
|
505
|
+
const M = Math.min(Math.max(Math.floor(p / 20), 30), 40);
|
|
506
|
+
a = new pt(p, M, 13421772, 14540253), a.rotateX(Math.PI / 2), a.position.copy(r), e.add(a);
|
|
507
|
+
const $ = new Me(p, p), G = new dt({
|
|
508
508
|
opacity: 0.3,
|
|
509
509
|
// 阴影透明度
|
|
510
510
|
color: 0
|
|
511
511
|
});
|
|
512
|
-
|
|
512
|
+
b = new Xe($, G), b.position.copy(r), b.position.z -= 0.01, b.receiveShadow = !0, e.add(b);
|
|
513
513
|
}, k = () => {
|
|
514
|
-
if (
|
|
514
|
+
if (P.value.length === 0)
|
|
515
515
|
return;
|
|
516
|
-
const
|
|
517
|
-
|
|
518
|
-
|
|
516
|
+
const p = new Ee();
|
|
517
|
+
P.value.forEach((W) => {
|
|
518
|
+
p.expandByObject(W);
|
|
519
519
|
});
|
|
520
|
-
const r =
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
520
|
+
const r = p.getSize(new y()), M = p.getCenter(new y()), $ = Math.max(r.x, r.y, r.z), G = Math.max($ * 8, 50), I = new y(
|
|
521
|
+
M.x,
|
|
522
|
+
M.y,
|
|
523
|
+
p.min.z
|
|
524
524
|
// 模型的最底部
|
|
525
525
|
);
|
|
526
526
|
l(G, I);
|
|
527
527
|
}, f = () => {
|
|
528
|
-
const
|
|
529
|
-
e.add(
|
|
528
|
+
const p = new mt(4210752, 0.6);
|
|
529
|
+
e.add(p);
|
|
530
530
|
const r = new Te(16777215, 2);
|
|
531
531
|
r.position.set(10, 10, 8), r.castShadow = !0, r.shadow.mapSize.width = 4096, r.shadow.mapSize.height = 4096, r.shadow.camera.near = 0.5, r.shadow.camera.far = 50, r.shadow.camera.left = -50, r.shadow.camera.right = 50, r.shadow.camera.top = 50, r.shadow.camera.bottom = -50, e.add(r);
|
|
532
|
-
const
|
|
533
|
-
|
|
532
|
+
const M = new Te(16777215, 0.8);
|
|
533
|
+
M.position.set(-8, -8, 6), e.add(M);
|
|
534
534
|
const $ = new Te(16777215, 0.6);
|
|
535
535
|
$.position.set(0, -15, 2), e.add($);
|
|
536
536
|
const G = new ft(16777215, 4473924, 0.8);
|
|
@@ -541,7 +541,7 @@ function jt(o) {
|
|
|
541
541
|
W.position.set(-15, -15, 15), e.add(W);
|
|
542
542
|
}, s = () => {
|
|
543
543
|
m = requestAnimationFrame(s), n && n.update(), i && e && t && i.render(e, t), d && d.render();
|
|
544
|
-
},
|
|
544
|
+
}, u = (p) => {
|
|
545
545
|
[
|
|
546
546
|
"map",
|
|
547
547
|
"normalMap",
|
|
@@ -554,36 +554,36 @@ function jt(o) {
|
|
|
554
554
|
"lightMap",
|
|
555
555
|
"aoMap",
|
|
556
556
|
"displacementMap"
|
|
557
|
-
].forEach((
|
|
558
|
-
|
|
559
|
-
}),
|
|
560
|
-
},
|
|
561
|
-
|
|
562
|
-
r.geometry && r.geometry.dispose(), r.material && (Array.isArray(r.material) ? r.material.forEach((
|
|
563
|
-
|
|
564
|
-
}) :
|
|
557
|
+
].forEach((M) => {
|
|
558
|
+
p[M] && p[M].dispose && p[M].dispose();
|
|
559
|
+
}), p.dispose && p.dispose();
|
|
560
|
+
}, v = (p) => {
|
|
561
|
+
p == null || p.traverse((r) => {
|
|
562
|
+
r.geometry && r.geometry.dispose(), r.material && (Array.isArray(r.material) ? r.material.forEach((M) => {
|
|
563
|
+
u(M);
|
|
564
|
+
}) : u(r.material));
|
|
565
565
|
});
|
|
566
566
|
};
|
|
567
567
|
return {
|
|
568
568
|
// 响应式数据
|
|
569
|
-
currentModels:
|
|
569
|
+
currentModels: P,
|
|
570
570
|
initialCameraPosition: O,
|
|
571
571
|
initialTargetPosition: L,
|
|
572
572
|
// 方法
|
|
573
573
|
initThreeJS: j,
|
|
574
574
|
handleResize: () => {
|
|
575
575
|
if (!o.value || !t || !i || !d) return;
|
|
576
|
-
const
|
|
577
|
-
t.aspect = r /
|
|
576
|
+
const p = o.value, r = p.clientWidth, M = p.clientHeight;
|
|
577
|
+
t.aspect = r / M, t.updateProjectionMatrix(), i.setSize(r, M), d.update();
|
|
578
578
|
},
|
|
579
579
|
fitCameraToAllModels: () => {
|
|
580
|
-
if (!t || !n ||
|
|
581
|
-
const
|
|
582
|
-
|
|
583
|
-
|
|
580
|
+
if (!t || !n || P.value.length === 0) return;
|
|
581
|
+
const p = new Ee();
|
|
582
|
+
P.value.forEach((W) => {
|
|
583
|
+
p.expandByObject(W);
|
|
584
584
|
});
|
|
585
|
-
const r =
|
|
586
|
-
t.position.copy(I), t.lookAt(
|
|
585
|
+
const r = p.getSize(new y()), M = p.getCenter(new y()), G = Math.max(r.x, r.y, r.z) * 0.8, I = new y(M.x + G, M.y - G, M.z + G);
|
|
586
|
+
t.position.copy(I), t.lookAt(M), n.target.copy(M), n.update(), O.value.copy(I), L.value.copy(M), k();
|
|
587
587
|
},
|
|
588
588
|
getThreeJSObjects: () => ({
|
|
589
589
|
scene: e,
|
|
@@ -594,72 +594,72 @@ function jt(o) {
|
|
|
594
594
|
}),
|
|
595
595
|
clearAllModels: () => {
|
|
596
596
|
if (!e) return;
|
|
597
|
-
|
|
598
|
-
e.remove(r),
|
|
597
|
+
P.value.forEach((r) => {
|
|
598
|
+
e.remove(r), v(r);
|
|
599
599
|
});
|
|
600
|
-
const
|
|
600
|
+
const p = [];
|
|
601
601
|
e.children.forEach((r) => {
|
|
602
|
-
!r.isLight && !r.isCamera && r.type !== "GridHelper" && r !==
|
|
603
|
-
}),
|
|
604
|
-
e.remove(r),
|
|
605
|
-
}),
|
|
602
|
+
!r.isLight && !r.isCamera && r.type !== "GridHelper" && r !== b && p.push(r);
|
|
603
|
+
}), p.forEach((r) => {
|
|
604
|
+
e.remove(r), v(r);
|
|
605
|
+
}), P.value = [], k();
|
|
606
606
|
},
|
|
607
607
|
cleanup: () => {
|
|
608
|
-
m && cancelAnimationFrame(m), a && a.dispose(),
|
|
608
|
+
m && cancelAnimationFrame(m), a && a.dispose(), b && (b.geometry.dispose(), b.material.dispose()), i && i.dispose(), n && n.dispose(), d && d.dispose();
|
|
609
609
|
},
|
|
610
610
|
updateGridForModels: k
|
|
611
611
|
};
|
|
612
612
|
}
|
|
613
613
|
function It(o, e) {
|
|
614
614
|
const t = D(!1);
|
|
615
|
-
let i = null, n = 12700, d = new y(), m = new y(), a = new y(),
|
|
615
|
+
let i = null, n = 12700, d = new y(), m = new y(), a = new y(), b = 0, P = null;
|
|
616
616
|
const O = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, L = (s) => {
|
|
617
|
-
const
|
|
617
|
+
const u = new y(), v = b * 1.2, R = new y(a.x + v, a.y, a.z), V = new y(a.x, a.y + v, a.z), H = new y(a.x, a.y - v, a.z);
|
|
618
618
|
if (s <= 0.567) {
|
|
619
|
-
const
|
|
620
|
-
|
|
619
|
+
const Y = s / 0.567 * Math.PI * 2;
|
|
620
|
+
u.x = a.x + Math.cos(Y) * v, u.z = a.z + Math.sin(Y) * v, u.y = a.y;
|
|
621
621
|
} else if (s <= 0.724) {
|
|
622
|
-
const F = (s - 0.567) / 0.157,
|
|
623
|
-
|
|
622
|
+
const F = (s - 0.567) / 0.157, Y = O(F);
|
|
623
|
+
u.lerpVectors(R, V, Y);
|
|
624
624
|
} else if (s <= 0.881) {
|
|
625
|
-
const F = (s - 0.724) / 0.157,
|
|
626
|
-
|
|
625
|
+
const F = (s - 0.724) / 0.157, p = O(F) * Math.PI;
|
|
626
|
+
u.x = a.x + Math.sin(p) * v, u.y = a.y + Math.cos(p) * v, u.z = a.z;
|
|
627
627
|
} else {
|
|
628
|
-
const F = (s - 0.881) / 0.119,
|
|
629
|
-
|
|
628
|
+
const F = (s - 0.881) / 0.119, Y = O(F);
|
|
629
|
+
u.lerpVectors(H, d, Y);
|
|
630
630
|
}
|
|
631
|
-
return
|
|
631
|
+
return u;
|
|
632
632
|
}, j = () => {
|
|
633
|
-
const { camera: s, controls:
|
|
634
|
-
if (!s || !
|
|
633
|
+
const { camera: s, controls: u } = o();
|
|
634
|
+
if (!s || !u) return;
|
|
635
635
|
i || (i = Date.now());
|
|
636
|
-
const
|
|
636
|
+
const v = Date.now() - i, R = Math.min(v / n, 1);
|
|
637
637
|
if (R >= 1) {
|
|
638
638
|
k();
|
|
639
639
|
return;
|
|
640
640
|
}
|
|
641
|
-
const
|
|
642
|
-
s.position.copy(
|
|
641
|
+
const V = L(R);
|
|
642
|
+
s.position.copy(V), s.lookAt(a), u.target.copy(a), P = requestAnimationFrame(j);
|
|
643
643
|
}, l = () => {
|
|
644
644
|
if (e.value.length === 0) return;
|
|
645
|
-
const { camera: s, controls:
|
|
646
|
-
if (!s || !
|
|
647
|
-
d.copy(s.position), m.copy(
|
|
648
|
-
const
|
|
645
|
+
const { camera: s, controls: u } = o();
|
|
646
|
+
if (!s || !u) return;
|
|
647
|
+
d.copy(s.position), m.copy(u.target);
|
|
648
|
+
const v = new Ee();
|
|
649
649
|
e.value.forEach((r) => {
|
|
650
|
-
|
|
650
|
+
v.expandByObject(r);
|
|
651
651
|
});
|
|
652
|
-
const R =
|
|
653
|
-
a =
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
const r = Date.now() -
|
|
658
|
-
s.position.lerpVectors(
|
|
652
|
+
const R = v.getSize(new y());
|
|
653
|
+
a = v.getCenter(new y()), b = Math.max(R.x, R.y, R.z) * 1.2;
|
|
654
|
+
const V = new y(a.x + b * 1.2, a.y, a.z);
|
|
655
|
+
u.enabled = !1;
|
|
656
|
+
const H = s.position.clone(), F = 1e3, Y = Date.now(), p = () => {
|
|
657
|
+
const r = Date.now() - Y, M = Math.min(r / F, 1), $ = O(M);
|
|
658
|
+
s.position.lerpVectors(H, V, $), s.lookAt(a), u.target.copy(a), M < 1 ? requestAnimationFrame(p) : (t.value = !0, i = null, j());
|
|
659
659
|
};
|
|
660
|
-
|
|
660
|
+
p();
|
|
661
661
|
}, k = () => {
|
|
662
|
-
t.value = !1, i = null,
|
|
662
|
+
t.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
|
|
663
663
|
const { controls: s } = o();
|
|
664
664
|
s && (s.enabled = !0, s.target.copy(m));
|
|
665
665
|
};
|
|
@@ -667,13 +667,13 @@ function It(o, e) {
|
|
|
667
667
|
isAnimating: t,
|
|
668
668
|
toggleAnimation: () => {
|
|
669
669
|
if (t.value) {
|
|
670
|
-
t.value = !1, i = null,
|
|
671
|
-
const { camera: s, controls:
|
|
672
|
-
if (!s || !
|
|
673
|
-
|
|
674
|
-
const
|
|
675
|
-
const
|
|
676
|
-
s.position.lerpVectors(
|
|
670
|
+
t.value = !1, i = null, P && (cancelAnimationFrame(P), P = null);
|
|
671
|
+
const { camera: s, controls: u } = o();
|
|
672
|
+
if (!s || !u) return;
|
|
673
|
+
u.enabled = !0;
|
|
674
|
+
const v = s.position.clone(), R = u.target.clone(), V = 1500, H = Date.now(), F = () => {
|
|
675
|
+
const Y = Date.now() - H, p = Math.min(Y / V, 1), r = O(p);
|
|
676
|
+
s.position.lerpVectors(v, d, r), u.target.lerpVectors(R, m, r), p < 1 && requestAnimationFrame(F);
|
|
677
677
|
};
|
|
678
678
|
F();
|
|
679
679
|
} else
|
|
@@ -686,7 +686,7 @@ function It(o, e) {
|
|
|
686
686
|
function Ft(o, e) {
|
|
687
687
|
const t = D(!1), i = D("none");
|
|
688
688
|
let n = [], d = [], m = new Ee(), a = new y();
|
|
689
|
-
const
|
|
689
|
+
const b = () => {
|
|
690
690
|
n = [
|
|
691
691
|
new Pe(new y(1, 0, 0), 0),
|
|
692
692
|
// X轴平面
|
|
@@ -695,46 +695,46 @@ function Ft(o, e) {
|
|
|
695
695
|
new Pe(new y(0, 0, 1), 0)
|
|
696
696
|
// Z轴平面
|
|
697
697
|
];
|
|
698
|
-
},
|
|
698
|
+
}, P = () => {
|
|
699
699
|
m.makeEmpty(), e.value.forEach((f) => {
|
|
700
700
|
m.expandByObject(f);
|
|
701
701
|
}), a = m.getCenter(new y());
|
|
702
702
|
}, O = (f) => {
|
|
703
703
|
const s = m.getSize(new y());
|
|
704
|
-
let
|
|
705
|
-
f === "x" ? (
|
|
706
|
-
const
|
|
704
|
+
let u, v, R;
|
|
705
|
+
f === "x" ? (u = new Me(s.z * 1.2, s.y * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(0, Math.PI / 2, 0)) : f === "y" ? (u = new Me(s.x * 1.2, s.z * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(Math.PI / 2, 0, 0)) : f === "z" && (u = new Me(s.x * 1.2, s.y * 1.2), v = new y(a.x, a.y, a.z), R = new Ce(0, 0, 0));
|
|
706
|
+
const V = new _t({
|
|
707
707
|
color: 8900331,
|
|
708
708
|
transparent: !0,
|
|
709
709
|
opacity: 0.3,
|
|
710
710
|
side: gt,
|
|
711
711
|
depthWrite: !1
|
|
712
|
-
}),
|
|
713
|
-
return
|
|
712
|
+
}), H = new Xe(u, V);
|
|
713
|
+
return H.position.copy(v), H.rotation.copy(R), H;
|
|
714
714
|
}, L = () => {
|
|
715
715
|
if (j(), l(), i.value === "none")
|
|
716
716
|
return;
|
|
717
|
-
|
|
717
|
+
P();
|
|
718
718
|
let f = null;
|
|
719
719
|
if (i.value === "x" ? (n[0].constant = -a.x, f = n[0]) : i.value === "y" ? (n[1].constant = -a.y, f = n[1]) : i.value === "z" && (n[2].constant = -a.z, f = n[2]), f) {
|
|
720
|
-
e.value.forEach((
|
|
721
|
-
|
|
722
|
-
|
|
720
|
+
e.value.forEach((u) => {
|
|
721
|
+
u.traverse((v) => {
|
|
722
|
+
v.isMesh && v.material && (Array.isArray(v.material) ? v.material.forEach((R) => {
|
|
723
723
|
R.clippingPlanes = [f];
|
|
724
|
-
}) :
|
|
724
|
+
}) : v.material.clippingPlanes = [f]);
|
|
725
725
|
});
|
|
726
726
|
});
|
|
727
727
|
const { scene: s } = o();
|
|
728
728
|
if (s) {
|
|
729
|
-
const
|
|
730
|
-
s.add(
|
|
729
|
+
const u = O(i.value);
|
|
730
|
+
s.add(u), d.push(u);
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
}, j = () => {
|
|
734
734
|
e.value.forEach((f) => {
|
|
735
735
|
f.traverse((s) => {
|
|
736
|
-
s.isMesh && s.material && (Array.isArray(s.material) ? s.material.forEach((
|
|
737
|
-
|
|
736
|
+
s.isMesh && s.material && (Array.isArray(s.material) ? s.material.forEach((u) => {
|
|
737
|
+
u.clippingPlanes = [];
|
|
738
738
|
}) : s.material.clippingPlanes = []);
|
|
739
739
|
});
|
|
740
740
|
});
|
|
@@ -748,7 +748,7 @@ function Ft(o, e) {
|
|
|
748
748
|
isClipping: t,
|
|
749
749
|
activeClippingAxis: i,
|
|
750
750
|
toggleClipping: () => {
|
|
751
|
-
t.value = !t.value, t.value ? (
|
|
751
|
+
t.value = !t.value, t.value ? (b(), e.value.length > 0 && P()) : (i.value = "none", j(), l());
|
|
752
752
|
},
|
|
753
753
|
updateClippingPlanes: L,
|
|
754
754
|
clearClippingPlanes: j,
|
|
@@ -810,7 +810,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
810
810
|
const f = [];
|
|
811
811
|
return Array.isArray(l) && (l == null ? void 0 : l.length) > 0 && l.forEach((s) => {
|
|
812
812
|
if (!(s != null && s.isMesh) && ((s == null ? void 0 : s.type) === "URDFJoint" || (s == null ? void 0 : s.type) === "URDFLink")) {
|
|
813
|
-
const
|
|
813
|
+
const u = {
|
|
814
814
|
name: s == null ? void 0 : s.name,
|
|
815
815
|
label: s == null ? void 0 : s.name,
|
|
816
816
|
show: !0,
|
|
@@ -822,10 +822,10 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
822
822
|
children: a(s == null ? void 0 : s.children, k + 1),
|
|
823
823
|
path: s == null ? void 0 : s.name
|
|
824
824
|
};
|
|
825
|
-
f.push(
|
|
825
|
+
f.push(u);
|
|
826
826
|
}
|
|
827
827
|
}), f;
|
|
828
|
-
},
|
|
828
|
+
}, b = (l) => l ? [{
|
|
829
829
|
name: l == null ? void 0 : l.name,
|
|
830
830
|
label: l == null ? void 0 : l.name,
|
|
831
831
|
show: !0,
|
|
@@ -836,11 +836,11 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
836
836
|
limit: (l == null ? void 0 : l.limit) ?? "",
|
|
837
837
|
children: a(l == null ? void 0 : l.children, 1),
|
|
838
838
|
path: l == null ? void 0 : l.name
|
|
839
|
-
}] : [],
|
|
839
|
+
}] : [], P = (l, k) => {
|
|
840
840
|
const f = [], s = [...l];
|
|
841
841
|
for (; s.length > 0 && f.length < k; ) {
|
|
842
|
-
const
|
|
843
|
-
|
|
842
|
+
const u = s.shift();
|
|
843
|
+
u.children && u.children.length > 0 && (f.push(u.id), s.push(...u.children));
|
|
844
844
|
}
|
|
845
845
|
return f;
|
|
846
846
|
}, O = (l, k) => {
|
|
@@ -848,11 +848,11 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
848
848
|
return l.forEach((s) => {
|
|
849
849
|
if (s.children && s.children.length > 0) {
|
|
850
850
|
f.push(s.id);
|
|
851
|
-
const
|
|
852
|
-
f.push(...
|
|
851
|
+
const u = s.children.filter((v) => v.children && v.children.length > 0).slice(0, k).map((v) => v.id);
|
|
852
|
+
f.push(...u);
|
|
853
853
|
}
|
|
854
854
|
}), f.slice(0, k + 1);
|
|
855
|
-
}, L = ue(() => !n.value || n.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? O(n.value, t.maxExpandCount) :
|
|
855
|
+
}, L = ue(() => !n.value || n.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? O(n.value, t.maxExpandCount) : P(n.value, t.maxExpandCount)), j = ue(() => t != null && t.model ? b(t.model) : []);
|
|
856
856
|
return xe(
|
|
857
857
|
j,
|
|
858
858
|
(l) => {
|
|
@@ -893,97 +893,97 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
893
893
|
D(!0);
|
|
894
894
|
const i = D([]), n = D(null), d = D(12.5), m = D();
|
|
895
895
|
D(1302);
|
|
896
|
-
const a = D(!1),
|
|
896
|
+
const a = D(!1), b = D(!1), P = D(0), O = D(0), L = D(null), j = $e.degToRad, l = D(1), k = () => as / ze / l.value;
|
|
897
897
|
let f = [];
|
|
898
898
|
xe(
|
|
899
899
|
() => t.animationData,
|
|
900
900
|
(_) => {
|
|
901
|
-
var
|
|
902
|
-
let
|
|
903
|
-
|
|
901
|
+
var c;
|
|
902
|
+
let x = ((c = Ge(_)) == null ? void 0 : c.动画输出) ?? [];
|
|
903
|
+
x && x.length > 0 && (f = x, p());
|
|
904
904
|
},
|
|
905
905
|
{ deep: !0 }
|
|
906
906
|
);
|
|
907
|
-
const s = ue(() => f.length > 0),
|
|
907
|
+
const s = ue(() => f.length > 0), u = (_, x = !1) => _ === "revolute" ? x ? Math.PI : -Math.PI : _ === "prismatic" ? x ? 1 : -1 : 0, v = (_) => {
|
|
908
908
|
if (!_ || !_.joints)
|
|
909
909
|
return console.warn("URDF模型没有关节信息"), [];
|
|
910
|
-
let
|
|
910
|
+
let x = null;
|
|
911
911
|
if (_.traverse((E) => {
|
|
912
|
-
E.name === "Pipe_Link" && !
|
|
913
|
-
}),
|
|
914
|
-
m.value =
|
|
912
|
+
E.name === "Pipe_Link" && !x && (x = E);
|
|
913
|
+
}), x)
|
|
914
|
+
m.value = x;
|
|
915
915
|
else
|
|
916
916
|
return console.warn("未找到管子模型"), [];
|
|
917
|
-
const
|
|
917
|
+
const c = [];
|
|
918
918
|
return Object.keys(_.joints).forEach((E) => {
|
|
919
|
-
const
|
|
920
|
-
if (
|
|
919
|
+
const w = _.joints[E];
|
|
920
|
+
if (w._jointType === "fixed")
|
|
921
921
|
return;
|
|
922
|
-
const
|
|
923
|
-
lower:
|
|
924
|
-
upper:
|
|
922
|
+
const Z = w.limit ? {
|
|
923
|
+
lower: w.limit.lower ?? u(w._jointType, !1),
|
|
924
|
+
upper: w.limit.upper ?? u(w._jointType, !0)
|
|
925
925
|
} : {
|
|
926
|
-
lower:
|
|
927
|
-
upper:
|
|
926
|
+
lower: u(w._jointType, !1),
|
|
927
|
+
upper: u(w._jointType, !0)
|
|
928
928
|
};
|
|
929
|
-
|
|
929
|
+
c.push({
|
|
930
930
|
name: E,
|
|
931
|
-
type:
|
|
932
|
-
limit:
|
|
933
|
-
currentValue:
|
|
934
|
-
urdfJoint:
|
|
931
|
+
type: w._jointType || "unknown",
|
|
932
|
+
limit: Z,
|
|
933
|
+
currentValue: w.angle || 0,
|
|
934
|
+
urdfJoint: w
|
|
935
935
|
});
|
|
936
|
-
}),
|
|
937
|
-
}, R = (_,
|
|
938
|
-
const
|
|
939
|
-
if (!
|
|
940
|
-
const E = parseFloat(
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
|
|
936
|
+
}), c.sort((E, w) => E.name.localeCompare(w.name));
|
|
937
|
+
}, R = (_, x) => {
|
|
938
|
+
const c = i.value.find((w) => w.name === _);
|
|
939
|
+
if (!c) return;
|
|
940
|
+
const E = parseFloat(x);
|
|
941
|
+
if (c.limit) {
|
|
942
|
+
const w = Math.max(c.limit.lower, Math.min(c.limit.upper, E));
|
|
943
|
+
c.currentValue = w;
|
|
944
944
|
} else
|
|
945
|
-
|
|
946
|
-
t.model && t.model.setJointValue ? t.model.setJointValue(_,
|
|
947
|
-
},
|
|
945
|
+
c.currentValue = E;
|
|
946
|
+
t.model && t.model.setJointValue ? t.model.setJointValue(_, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
|
|
947
|
+
}, V = (_) => {
|
|
948
948
|
if (!m.value || !s.value) return;
|
|
949
|
-
const
|
|
950
|
-
let E = new y(0, 0, 0),
|
|
951
|
-
|
|
952
|
-
for (const K of
|
|
949
|
+
const x = f.slice(0, _ + 1), c = [];
|
|
950
|
+
let E = new y(0, 0, 0), w = new y(0, 1, 0), Z = new y(1, 0, 0);
|
|
951
|
+
c.push(E.clone());
|
|
952
|
+
for (const K of x) {
|
|
953
953
|
const q = K.Y ?? 0, pe = K.B ?? 0, de = K.C ?? 0, A = K.R ?? 0;
|
|
954
954
|
if (pe !== 0) {
|
|
955
|
-
const h = new Se().makeRotationAxis(
|
|
956
|
-
|
|
955
|
+
const h = new Se().makeRotationAxis(w, j(pe));
|
|
956
|
+
Z.applyMatrix4(h);
|
|
957
957
|
}
|
|
958
958
|
if (q > 0) {
|
|
959
|
-
const h =
|
|
960
|
-
E.add(h),
|
|
959
|
+
const h = w.clone().multiplyScalar(q * Ae);
|
|
960
|
+
E.add(h), c.push(E.clone());
|
|
961
961
|
}
|
|
962
962
|
if (de > 0 && A > 0) {
|
|
963
963
|
const h = j(de), Q = A * Ae, le = Math.max(16, Math.ceil(de / 5)), re = E.clone().add(
|
|
964
|
-
|
|
964
|
+
Z.clone().multiplyScalar(-Q)
|
|
965
965
|
);
|
|
966
966
|
for (let oe = 1; oe <= le; oe++) {
|
|
967
967
|
const C = oe / le, se = h * C, _e = new Se().makeRotationAxis(
|
|
968
|
-
|
|
968
|
+
w.clone().cross(Z).normalize(),
|
|
969
969
|
se
|
|
970
970
|
), me = E.clone().sub(re);
|
|
971
971
|
me.applyMatrix4(_e);
|
|
972
972
|
const Oe = re.clone().add(me);
|
|
973
|
-
|
|
973
|
+
c.push(Oe), E.copy(Oe);
|
|
974
974
|
}
|
|
975
975
|
const he = new Se().makeRotationAxis(
|
|
976
|
-
|
|
976
|
+
w.clone().cross(Z).normalize(),
|
|
977
977
|
h
|
|
978
978
|
);
|
|
979
|
-
|
|
979
|
+
Z.applyMatrix4(he);
|
|
980
980
|
}
|
|
981
981
|
}
|
|
982
|
-
|
|
982
|
+
c.length < 2 && c.push(new y(0, 1e-3, 0));
|
|
983
983
|
try {
|
|
984
|
-
const K = new vt(
|
|
984
|
+
const K = new vt(c), q = new bt(
|
|
985
985
|
K,
|
|
986
|
-
Math.max(2,
|
|
986
|
+
Math.max(2, c.length * 4),
|
|
987
987
|
d.value * Ae,
|
|
988
988
|
18,
|
|
989
989
|
!1
|
|
@@ -992,50 +992,52 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
992
992
|
} catch (K) {
|
|
993
993
|
console.error("更新管子几何体失败:", K);
|
|
994
994
|
}
|
|
995
|
-
},
|
|
996
|
-
_ && (Object.keys(_).forEach((
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
}), console.log(232, index),
|
|
1000
|
-
}, F = (_,
|
|
1001
|
-
if (!_ || !
|
|
995
|
+
}, H = (_) => {
|
|
996
|
+
_ && (Object.keys(_).forEach((x) => {
|
|
997
|
+
const c = _[x], E = i.value.find((w) => w.name === x);
|
|
998
|
+
E && (E.currentValue = c, t.model && t.model.setJointValue ? t.model.setJointValue(x, c) : E.urdfJoint && E.urdfJoint.setJointValue(c));
|
|
999
|
+
}), console.log(232, index), V(index));
|
|
1000
|
+
}, F = (_, x, c) => _ + (x - _) * c, Y = (_, x, c) => {
|
|
1001
|
+
if (!_ || !x) return _ || x;
|
|
1002
1002
|
const E = {};
|
|
1003
|
-
return Object.keys(_).forEach((
|
|
1004
|
-
const
|
|
1005
|
-
E[
|
|
1003
|
+
return Object.keys(_).forEach((w) => {
|
|
1004
|
+
const Z = _[w], K = x[w];
|
|
1005
|
+
E[w] = F(Z, K || Z, c);
|
|
1006
1006
|
}), E;
|
|
1007
|
-
},
|
|
1007
|
+
}, p = () => {
|
|
1008
1008
|
if (f.length === 0) {
|
|
1009
1009
|
console.warn("没有动画数据");
|
|
1010
1010
|
return;
|
|
1011
1011
|
}
|
|
1012
|
-
a.value = !0,
|
|
1012
|
+
a.value = !0, b.value = !1;
|
|
1013
1013
|
const _ = () => {
|
|
1014
|
-
if (!a.value ||
|
|
1015
|
-
const
|
|
1014
|
+
if (!a.value || b.value) return;
|
|
1015
|
+
const x = O.value / ze;
|
|
1016
|
+
P.value;
|
|
1017
|
+
const c = f[P.value], E = f[P.value + 1];
|
|
1016
1018
|
if (E) {
|
|
1017
|
-
const
|
|
1018
|
-
|
|
1019
|
+
const w = Y(c, E, x);
|
|
1020
|
+
H(w);
|
|
1019
1021
|
} else
|
|
1020
|
-
|
|
1021
|
-
if (O.value++, O.value >= ze && (O.value = 0,
|
|
1022
|
-
|
|
1022
|
+
H(c);
|
|
1023
|
+
if (O.value++, O.value >= ze && (O.value = 0, P.value++, P.value >= f.length - 1)) {
|
|
1024
|
+
M();
|
|
1023
1025
|
return;
|
|
1024
1026
|
}
|
|
1025
1027
|
L.value = setTimeout(_, k());
|
|
1026
1028
|
};
|
|
1027
1029
|
_();
|
|
1028
1030
|
}, r = () => {
|
|
1029
|
-
|
|
1030
|
-
},
|
|
1031
|
-
a.value = !1,
|
|
1031
|
+
b.value = !0, L.value && (clearTimeout(L.value), L.value = null);
|
|
1032
|
+
}, M = () => {
|
|
1033
|
+
a.value = !1, b.value = !1, l.value = 1, L.value && (clearTimeout(L.value), L.value = null);
|
|
1032
1034
|
};
|
|
1033
1035
|
e({
|
|
1034
|
-
startAnimation:
|
|
1036
|
+
startAnimation: p,
|
|
1035
1037
|
pauseAnimation: r,
|
|
1036
|
-
stopAnimation:
|
|
1038
|
+
stopAnimation: M,
|
|
1037
1039
|
resetAll: () => {
|
|
1038
|
-
|
|
1040
|
+
M(), P.value = 0, O.value = 0, i.value.forEach((_) => {
|
|
1039
1041
|
(_.type === "revolute" || _.type === "prismatic") && R(_.name, 0);
|
|
1040
1042
|
});
|
|
1041
1043
|
},
|
|
@@ -1048,12 +1050,12 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1048
1050
|
}), xe(
|
|
1049
1051
|
() => t.model,
|
|
1050
1052
|
(_) => {
|
|
1051
|
-
_ ? i.value =
|
|
1053
|
+
_ ? i.value = v(_) : i.value = [];
|
|
1052
1054
|
},
|
|
1053
1055
|
{ immediate: !0 }
|
|
1054
1056
|
);
|
|
1055
1057
|
const W = () => {
|
|
1056
|
-
!t.model || a.value && !
|
|
1058
|
+
!t.model || a.value && !b.value || i.value.forEach((_) => {
|
|
1057
1059
|
_.urdfJoint && _.urdfJoint.angle !== void 0 && (_.currentValue = _.urdfJoint.angle);
|
|
1058
1060
|
});
|
|
1059
1061
|
}, te = () => {
|
|
@@ -1067,48 +1069,48 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1067
1069
|
return Be(() => {
|
|
1068
1070
|
te();
|
|
1069
1071
|
}), We(() => {
|
|
1070
|
-
De(),
|
|
1071
|
-
}), (_,
|
|
1072
|
+
De(), M();
|
|
1073
|
+
}), (_, x) => (B(), J("div", Bt, [
|
|
1072
1074
|
i.value.length > 0 ? (B(), J("div", $t, [
|
|
1073
|
-
(B(!0), J(qe, null, Qe(i.value, (
|
|
1074
|
-
var E,
|
|
1075
|
+
(B(!0), J(qe, null, Qe(i.value, (c) => {
|
|
1076
|
+
var E, w, Z, K;
|
|
1075
1077
|
return B(), J("div", {
|
|
1076
|
-
key:
|
|
1078
|
+
key: c.name,
|
|
1077
1079
|
class: "joint-item"
|
|
1078
1080
|
}, [
|
|
1079
1081
|
g("div", Xt, [
|
|
1080
1082
|
g("div", Gt, [
|
|
1081
|
-
g("span", Jt, ie(
|
|
1082
|
-
g("span", Wt, " [" + ie(((E =
|
|
1083
|
+
g("span", Jt, ie(c.name), 1),
|
|
1084
|
+
g("span", Wt, " [" + ie(((E = c.limit) == null ? void 0 : E.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ie(((w = c.limit) == null ? void 0 : w.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
|
|
1083
1085
|
]),
|
|
1084
|
-
g("span", qt, ie(
|
|
1086
|
+
g("span", qt, ie(c.type), 1)
|
|
1085
1087
|
]),
|
|
1086
|
-
|
|
1088
|
+
c.type === "revolute" || c.type === "prismatic" ? (B(), J("div", Qt, [
|
|
1087
1089
|
g("div", es, [
|
|
1088
1090
|
g("input", {
|
|
1089
1091
|
type: "range",
|
|
1090
|
-
min: ((
|
|
1091
|
-
max: ((K =
|
|
1092
|
+
min: ((Z = c.limit) == null ? void 0 : Z.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
|
|
1093
|
+
max: ((K = c.limit) == null ? void 0 : K.upper) ?? (c.type === "revolute" ? Math.PI : 1),
|
|
1092
1094
|
step: 0.01,
|
|
1093
|
-
value:
|
|
1094
|
-
onInput: (q) => R(
|
|
1095
|
+
value: c.currentValue,
|
|
1096
|
+
onInput: (q) => R(c.name, q.target.value),
|
|
1095
1097
|
class: "joint-slider",
|
|
1096
|
-
disabled: a.value && !
|
|
1098
|
+
disabled: a.value && !b.value
|
|
1097
1099
|
}, null, 40, ts)
|
|
1098
1100
|
]),
|
|
1099
1101
|
g("div", ss, [
|
|
1100
|
-
g("span", is, ie(
|
|
1101
|
-
g("span", os, ie(
|
|
1102
|
+
g("span", is, ie(c.currentValue.toFixed(3)), 1),
|
|
1103
|
+
g("span", os, ie(c.type === "revolute" ? "rad" : "m"), 1)
|
|
1102
1104
|
])
|
|
1103
1105
|
])) : we("", !0)
|
|
1104
1106
|
]);
|
|
1105
1107
|
}), 128))
|
|
1106
|
-
])) : (B(), J("div", ns,
|
|
1108
|
+
])) : (B(), J("div", ns, x[0] || (x[0] = [
|
|
1107
1109
|
g("p", null, "未检测到可控制的关节", -1)
|
|
1108
1110
|
])))
|
|
1109
1111
|
]));
|
|
1110
1112
|
}
|
|
1111
|
-
}, rs = /* @__PURE__ */ fe(ls, [["__scopeId", "data-v-
|
|
1113
|
+
}, rs = /* @__PURE__ */ fe(ls, [["__scopeId", "data-v-1d84cea4"]]), hs = ["xlink:href"], cs = /* @__PURE__ */ et({
|
|
1112
1114
|
__name: "svgIcon",
|
|
1113
1115
|
props: {
|
|
1114
1116
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1163,28 +1165,28 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1163
1165
|
setup(o, { expose: e, emit: t }) {
|
|
1164
1166
|
const i = t, n = o;
|
|
1165
1167
|
let d = null, m = !1;
|
|
1166
|
-
const a = D(null),
|
|
1168
|
+
const a = D(null), b = D(!1), P = D("");
|
|
1167
1169
|
D(!1);
|
|
1168
1170
|
const O = D(!1), L = D(!1), j = D(""), l = D(!1), k = D(""), f = D(), {
|
|
1169
1171
|
currentModels: s,
|
|
1170
|
-
initialCameraPosition:
|
|
1171
|
-
initialTargetPosition:
|
|
1172
|
+
initialCameraPosition: u,
|
|
1173
|
+
initialTargetPosition: v,
|
|
1172
1174
|
initThreeJS: R,
|
|
1173
|
-
handleResize:
|
|
1174
|
-
fitCameraToAllModels:
|
|
1175
|
+
handleResize: V,
|
|
1176
|
+
fitCameraToAllModels: H,
|
|
1175
1177
|
getThreeJSObjects: F,
|
|
1176
|
-
clearAllModels:
|
|
1177
|
-
cleanup:
|
|
1178
|
-
} = jt(a), { isAnimating: r, toggleAnimation:
|
|
1178
|
+
clearAllModels: Y,
|
|
1179
|
+
cleanup: p
|
|
1180
|
+
} = jt(a), { isAnimating: r, toggleAnimation: M, stopAnimation: $ } = It(F, s), { isClipping: G, activeClippingAxis: I, toggleClipping: W, updateClippingPlanes: te } = Ft(
|
|
1179
1181
|
F,
|
|
1180
1182
|
s
|
|
1181
|
-
), { addModelsFromUrls: De, loadModelByDefaultPath: _, urdfModel:
|
|
1183
|
+
), { addModelsFromUrls: De, loadModelByDefaultPath: _, urdfModel: x } = wt(
|
|
1182
1184
|
F,
|
|
1183
1185
|
s,
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
),
|
|
1186
|
+
b,
|
|
1187
|
+
P,
|
|
1188
|
+
Y
|
|
1189
|
+
), c = () => {
|
|
1188
1190
|
if (O.value || s.value.length === 0) return;
|
|
1189
1191
|
O.value = !0, r.value && $();
|
|
1190
1192
|
const { camera: A, controls: h } = F();
|
|
@@ -1192,7 +1194,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1192
1194
|
h.enabled = !0;
|
|
1193
1195
|
const Q = (se) => se < 0.5 ? 4 * se * se * se : 1 - Math.pow(-2 * se + 2, 3) / 2, le = A.position.clone(), re = h.target.clone(), he = 1500, oe = Date.now(), C = () => {
|
|
1194
1196
|
const se = Date.now() - oe, _e = Math.min(se / he, 1), me = Q(_e);
|
|
1195
|
-
A.position.lerpVectors(le,
|
|
1197
|
+
A.position.lerpVectors(le, u.value, me), h.target.lerpVectors(re, v.value, me), _e < 1 ? requestAnimationFrame(C) : O.value = !1;
|
|
1196
1198
|
};
|
|
1197
1199
|
C();
|
|
1198
1200
|
}, E = async () => m ? Promise.resolve() : new Promise((A) => {
|
|
@@ -1200,15 +1202,15 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1200
1202
|
m ? A() : requestAnimationFrame(h);
|
|
1201
1203
|
};
|
|
1202
1204
|
h();
|
|
1203
|
-
}),
|
|
1205
|
+
}), w = async (A, h) => {
|
|
1204
1206
|
try {
|
|
1205
1207
|
await E(), r.value && $(), G.value && W();
|
|
1206
1208
|
const Q = await h(A);
|
|
1207
|
-
return
|
|
1209
|
+
return H(), Q;
|
|
1208
1210
|
} catch (Q) {
|
|
1209
1211
|
throw console.error("加载模型失败:", Q), Q;
|
|
1210
1212
|
}
|
|
1211
|
-
},
|
|
1213
|
+
}, Z = async (A) => w(A, De), K = async (A) => w(A, _), q = (A) => {
|
|
1212
1214
|
L.value = !0, j.value = A, A === "剖面视图" && !G.value && W();
|
|
1213
1215
|
}, pe = (A) => {
|
|
1214
1216
|
l.value = !0, k.value = A;
|
|
@@ -1221,14 +1223,14 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1221
1223
|
return Be(async () => {
|
|
1222
1224
|
await Ie();
|
|
1223
1225
|
try {
|
|
1224
|
-
R(), d = F().scene, m = !0, window.addEventListener("resize",
|
|
1226
|
+
R(), d = F().scene, m = !0, window.addEventListener("resize", V);
|
|
1225
1227
|
} catch (A) {
|
|
1226
1228
|
console.error("Three.js初始化失败:", A);
|
|
1227
1229
|
}
|
|
1228
1230
|
}), tt(() => {
|
|
1229
|
-
m = !1, j.value = "", k.value = "", window.removeEventListener("resize",
|
|
1231
|
+
m = !1, j.value = "", k.value = "", window.removeEventListener("resize", V), r.value && $(), p();
|
|
1230
1232
|
}), e({
|
|
1231
|
-
addModelsFromUrls:
|
|
1233
|
+
addModelsFromUrls: Z,
|
|
1232
1234
|
loadModelByDefaultPath: K
|
|
1233
1235
|
}), (A, h) => {
|
|
1234
1236
|
var le, re, he, oe;
|
|
@@ -1265,7 +1267,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1265
1267
|
T(z, {
|
|
1266
1268
|
name: "viewReset",
|
|
1267
1269
|
size: "24",
|
|
1268
|
-
onClick:
|
|
1270
|
+
onClick: c,
|
|
1269
1271
|
title: "重置"
|
|
1270
1272
|
}),
|
|
1271
1273
|
T(z, {
|
|
@@ -1281,8 +1283,8 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1281
1283
|
T(z, {
|
|
1282
1284
|
name: "lookAround",
|
|
1283
1285
|
size: "24",
|
|
1284
|
-
onClick:
|
|
1285
|
-
title:
|
|
1286
|
+
onClick: U(M),
|
|
1287
|
+
title: U(r) ? "停止动画" : "动画视图"
|
|
1286
1288
|
}, null, 8, ["onClick", "title"])
|
|
1287
1289
|
]),
|
|
1288
1290
|
g("div", ms, [
|
|
@@ -1392,7 +1394,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1392
1394
|
default: Fe(() => [
|
|
1393
1395
|
j.value === "场景树" ? (B(), Ze(Kt, {
|
|
1394
1396
|
key: 0,
|
|
1395
|
-
model:
|
|
1397
|
+
model: U(x)
|
|
1396
1398
|
}, null, 8, ["model"])) : we("", !0),
|
|
1397
1399
|
j.value === "剖面视图" ? (B(), J("div", vs, [
|
|
1398
1400
|
g("div", bs, [
|
|
@@ -1402,9 +1404,9 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1402
1404
|
name: "clipping-axis",
|
|
1403
1405
|
value: "none",
|
|
1404
1406
|
"onUpdate:modelValue": h[7] || (h[7] = (C) => ge(I) ? I.value = C : null),
|
|
1405
|
-
onChange: h[8] || (h[8] = (...C) =>
|
|
1407
|
+
onChange: h[8] || (h[8] = (...C) => U(te) && U(te)(...C))
|
|
1406
1408
|
}, null, 544), [
|
|
1407
|
-
[ye,
|
|
1409
|
+
[ye, U(I)]
|
|
1408
1410
|
]),
|
|
1409
1411
|
h[16] || (h[16] = g("span", { class: "radio-text" }, "无切割", -1))
|
|
1410
1412
|
]),
|
|
@@ -1414,9 +1416,9 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1414
1416
|
name: "clipping-axis",
|
|
1415
1417
|
value: "x",
|
|
1416
1418
|
"onUpdate:modelValue": h[9] || (h[9] = (C) => ge(I) ? I.value = C : null),
|
|
1417
|
-
onChange: h[10] || (h[10] = (...C) =>
|
|
1419
|
+
onChange: h[10] || (h[10] = (...C) => U(te) && U(te)(...C))
|
|
1418
1420
|
}, null, 544), [
|
|
1419
|
-
[ye,
|
|
1421
|
+
[ye, U(I)]
|
|
1420
1422
|
]),
|
|
1421
1423
|
h[17] || (h[17] = g("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1422
1424
|
]),
|
|
@@ -1426,9 +1428,9 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1426
1428
|
name: "clipping-axis",
|
|
1427
1429
|
value: "y",
|
|
1428
1430
|
"onUpdate:modelValue": h[11] || (h[11] = (C) => ge(I) ? I.value = C : null),
|
|
1429
|
-
onChange: h[12] || (h[12] = (...C) =>
|
|
1431
|
+
onChange: h[12] || (h[12] = (...C) => U(te) && U(te)(...C))
|
|
1430
1432
|
}, null, 544), [
|
|
1431
|
-
[ye,
|
|
1433
|
+
[ye, U(I)]
|
|
1432
1434
|
]),
|
|
1433
1435
|
h[18] || (h[18] = g("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1434
1436
|
]),
|
|
@@ -1438,9 +1440,9 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1438
1440
|
name: "clipping-axis",
|
|
1439
1441
|
value: "z",
|
|
1440
1442
|
"onUpdate:modelValue": h[13] || (h[13] = (C) => ge(I) ? I.value = C : null),
|
|
1441
|
-
onChange: h[14] || (h[14] = (...C) =>
|
|
1443
|
+
onChange: h[14] || (h[14] = (...C) => U(te) && U(te)(...C))
|
|
1442
1444
|
}, null, 544), [
|
|
1443
|
-
[ye,
|
|
1445
|
+
[ye, U(I)]
|
|
1444
1446
|
]),
|
|
1445
1447
|
h[19] || (h[19] = g("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1446
1448
|
])
|
|
@@ -1465,8 +1467,8 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1465
1467
|
ne(T(rs, {
|
|
1466
1468
|
ref_key: "jointRef",
|
|
1467
1469
|
ref: f,
|
|
1468
|
-
model:
|
|
1469
|
-
scene:
|
|
1470
|
+
model: U(x),
|
|
1471
|
+
scene: U(d),
|
|
1470
1472
|
animationData: n == null ? void 0 : n.animationData
|
|
1471
1473
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1472
1474
|
[ve, k.value === "关节控制"]
|
|
@@ -1482,9 +1484,9 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1482
1484
|
], 512), [
|
|
1483
1485
|
[ve, l.value]
|
|
1484
1486
|
]),
|
|
1485
|
-
|
|
1487
|
+
b.value ? (B(), J("div", Ts, [
|
|
1486
1488
|
h[20] || (h[20] = g("div", { class: "loading-spinner" }, null, -1)),
|
|
1487
|
-
g("p", null, ie(
|
|
1489
|
+
g("p", null, ie(P.value), 1)
|
|
1488
1490
|
])) : we("", !0)
|
|
1489
1491
|
]);
|
|
1490
1492
|
};
|