ss-component-new 1.1.577 → 1.1.579
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-FR75nldT.cjs → index-CPn2W_Q4.cjs} +1 -1
- package/dist/{index-Df99Ox1E.js → index-Q-rYGelg.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-C44QlC8T.js → threeModel-CaPWbEgl.js} +28 -24
- package/dist/{threeModel-CGVdAHgP.cjs → threeModel-yhWQzRd0.cjs} +1 -1
- package/package.json +1 -1
package/dist/ss-component.js
CHANGED
|
@@ -31,7 +31,7 @@ const i = s(() => import("./index-DIQgn1lv.js"));
|
|
|
31
31
|
i.install = (o) => {
|
|
32
32
|
o.component("ssAvatar", i);
|
|
33
33
|
};
|
|
34
|
-
const c = s(() => import("./threeModel-
|
|
34
|
+
const c = s(() => import("./threeModel-CaPWbEgl.js"));
|
|
35
35
|
c.install = (o) => {
|
|
36
36
|
o.component("ssThree", c);
|
|
37
37
|
};
|
package/dist/ss-component2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DMcamypJ.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-
|
|
1
|
+
"use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DMcamypJ.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CPn2W_Q4.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-BOUxZx-8.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-Ddob8aEv.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-DiRp2gT0.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-BIrpXEcb.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-CW1z5f7l.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CJ7W9dEF.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-BfKDPIoL.cjs"))},{path:"priority",name:"Priority",component:async()=>Promise.resolve().then(()=>require("./index-D0QjuJev.cjs"))}]}],n=o.createRouter({history:o.createWebHashHistory(),routes:t});n.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=n;
|
package/dist/ss-component2.js
CHANGED
|
@@ -8,7 +8,7 @@ const a = [
|
|
|
8
8
|
{
|
|
9
9
|
path: "/",
|
|
10
10
|
name: "Model",
|
|
11
|
-
component: async () => import("./index-
|
|
11
|
+
component: async () => import("./index-Q-rYGelg.js"),
|
|
12
12
|
// component: async ()=>import('@/components/views/model/component/main.vue'),
|
|
13
13
|
// component: async ()=>import('@/components/views/canvas/index.vue'),
|
|
14
14
|
// component: async ()=>import('@/components/views/test/index.vue'),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as C, watch as xt, createElementBlock as q, openBlock as $, createBlock as Zt, computed as ut, resolveComponent as Ht, createVNode as A, onMounted as Kt, onUnmounted as
|
|
2
|
-
import { C as
|
|
1
|
+
import { ref as C, watch as xt, createElementBlock as q, openBlock as $, createBlock as Zt, computed as ut, resolveComponent as Ht, createVNode as A, onMounted as Kt, onUnmounted as qt, Fragment as Qt, renderList as te, createElementVNode as w, createCommentVNode as wt, toDisplayString as nt, defineComponent as ee, normalizeStyle as Lt, normalizeClass as Ot, nextTick as jt, onBeforeUnmount as se, withDirectives as rt, unref as Z, withCtx as It, isRef as _t, vModelRadio as gt, vShow as yt } from "vue";
|
|
2
|
+
import { C as ie, V as g, M as ct, T as ht, Q as Ft, D as Nt, E as tt, R as oe, P as Pt, F as Xt, G as Et, H as ae, J as ne, K as le, W as re, L as ce, N as he, O as ue, X as pe, U as de, Y as Mt, Z as me, _ as Bt, $ as fe, a0 as Ct, a1 as _e, a2 as Yt, a3 as $t, a4 as Gt, a5 as St, B as ge, a6 as dt, a7 as ye, a8 as ve, a9 as be } from "./index-DmVbKcfI.js";
|
|
3
3
|
import { _ as mt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
-
import { c as
|
|
5
|
-
const Ut = { type: "change" }, Rt = { type: "start" },
|
|
4
|
+
import { c as Jt } from "./menu-Qw1eGtzq.js";
|
|
5
|
+
const Ut = { type: "change" }, Rt = { type: "start" }, Wt = { type: "end" }, vt = new oe(), Vt = new Pt(), we = Math.cos(70 * Xt.DEG2RAD), U = new g(), W = 2 * Math.PI, R = {
|
|
6
6
|
NONE: -1,
|
|
7
7
|
ROTATE: 0,
|
|
8
8
|
DOLLY: 1,
|
|
@@ -12,7 +12,7 @@ const Ut = { type: "change" }, Rt = { type: "start" }, Gt = { type: "end" }, vt
|
|
|
12
12
|
TOUCH_DOLLY_PAN: 5,
|
|
13
13
|
TOUCH_DOLLY_ROTATE: 6
|
|
14
14
|
}, kt = 1e-6;
|
|
15
|
-
class Pe extends
|
|
15
|
+
class Pe extends ie {
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new controls instance.
|
|
18
18
|
*
|
|
@@ -317,7 +317,7 @@ function xe(o) {
|
|
|
317
317
|
function Ee(o) {
|
|
318
318
|
switch (this._removePointer(o), this._pointers.length) {
|
|
319
319
|
case 0:
|
|
320
|
-
this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(
|
|
320
|
+
this.domElement.releasePointerCapture(o.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Wt), this.state = R.NONE;
|
|
321
321
|
break;
|
|
322
322
|
case 1:
|
|
323
323
|
const t = this._pointers[0], e = this._pointerPositions[t];
|
|
@@ -385,7 +385,7 @@ function Te(o) {
|
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
387
|
function Ce(o) {
|
|
388
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== R.NONE || (o.preventDefault(), this.dispatchEvent(Rt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(
|
|
388
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== R.NONE || (o.preventDefault(), this.dispatchEvent(Rt), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent(Wt));
|
|
389
389
|
}
|
|
390
390
|
function Se(o) {
|
|
391
391
|
this.enabled !== !1 && this._handleKeyDown(o);
|
|
@@ -460,16 +460,16 @@ function Oe(o) {
|
|
|
460
460
|
let t = null, e = null, i = null, a = null, m = null, _ = null, n = null, P = null;
|
|
461
461
|
const E = C([]), I = C(new g()), N = C(new g()), z = () => {
|
|
462
462
|
if (!o.value) return;
|
|
463
|
-
t = new
|
|
463
|
+
t = new ae(), t.background = new ne(15790320);
|
|
464
464
|
const d = o.value;
|
|
465
|
-
e = new
|
|
465
|
+
e = new le(75, d.clientWidth / d.clientHeight, 0.1, 1e4), e.position.set(8, -8, 6), e.up.set(0, 0, 1), e.lookAt(0, 0, 0), i = new re({
|
|
466
466
|
antialias: !0,
|
|
467
467
|
alpha: !0
|
|
468
|
-
}), i.setSize(d.clientWidth, d.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type =
|
|
468
|
+
}), i.setSize(d.clientWidth, d.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = ce, i.toneMapping = he, i.toneMappingExposure = 1, i.outputColorSpace = ue, d.appendChild(i.domElement), a = new Pe(e, i.domElement), a.enableDamping = !0, a.dampingFactor = 0.05, a.mouseButtons = {
|
|
469
469
|
LEFT: ct.ROTATE,
|
|
470
470
|
MIDDLE: ct.PAN,
|
|
471
471
|
RIGHT: null
|
|
472
|
-
}, a.panSpeed = 0.7, m = new
|
|
472
|
+
}, a.panSpeed = 0.7, m = new pe(e, i, {
|
|
473
473
|
container: d,
|
|
474
474
|
type: "cube",
|
|
475
475
|
placement: "top-right",
|
|
@@ -503,8 +503,8 @@ function Oe(o) {
|
|
|
503
503
|
}, c = (d, r) => {
|
|
504
504
|
n && (t.remove(n), n.dispose()), P && (t.remove(P), P.geometry.dispose(), P.material.dispose());
|
|
505
505
|
const S = Math.min(Math.max(Math.floor(d / 20), 30), 40);
|
|
506
|
-
n = new
|
|
507
|
-
const X = new Mt(d, d), J = new
|
|
506
|
+
n = new de(d, S, 13421772, 14540253), n.rotateX(Math.PI / 2), n.position.copy(r), t.add(n);
|
|
507
|
+
const X = new Mt(d, d), J = new me({
|
|
508
508
|
opacity: 0.3,
|
|
509
509
|
// 阴影透明度
|
|
510
510
|
color: 0
|
|
@@ -525,7 +525,7 @@ function Oe(o) {
|
|
|
525
525
|
);
|
|
526
526
|
c(J, L);
|
|
527
527
|
}, v = () => {
|
|
528
|
-
const d = new
|
|
528
|
+
const d = new fe(4210752, 0.6);
|
|
529
529
|
t.add(d);
|
|
530
530
|
const r = new Ct(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, t.add(r);
|
|
@@ -533,7 +533,7 @@ function Oe(o) {
|
|
|
533
533
|
S.position.set(-8, -8, 6), t.add(S);
|
|
534
534
|
const X = new Ct(16777215, 0.6);
|
|
535
535
|
X.position.set(0, -15, 2), t.add(X);
|
|
536
|
-
const J = new
|
|
536
|
+
const J = new _e(16777215, 4473924, 0.8);
|
|
537
537
|
t.add(J);
|
|
538
538
|
const L = new Yt(16777215, 1, 50);
|
|
539
539
|
L.position.set(15, 15, 15), t.add(L);
|
|
@@ -703,11 +703,11 @@ function Ie(o, t) {
|
|
|
703
703
|
const s = _.getSize(new g());
|
|
704
704
|
let f, b, F;
|
|
705
705
|
v === "x" ? (f = new Mt(s.z * 1.2, s.y * 1.2), b = new g(n.x, n.y, n.z), F = new St(0, Math.PI / 2, 0)) : v === "y" ? (f = new Mt(s.x * 1.2, s.z * 1.2), b = new g(n.x, n.y, n.z), F = new St(Math.PI / 2, 0, 0)) : v === "z" && (f = new Mt(s.x * 1.2, s.y * 1.2), b = new g(n.x, n.y, n.z), F = new St(0, 0, 0));
|
|
706
|
-
const H = new
|
|
706
|
+
const H = new $t({
|
|
707
707
|
color: 8900331,
|
|
708
708
|
transparent: !0,
|
|
709
709
|
opacity: 0.3,
|
|
710
|
-
side:
|
|
710
|
+
side: Gt,
|
|
711
711
|
depthWrite: !1
|
|
712
712
|
}), G = new Bt(f, H);
|
|
713
713
|
return G.position.copy(b), G.rotation.copy(F), G;
|
|
@@ -769,7 +769,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
769
769
|
() => [t == null ? void 0 : t.animationData],
|
|
770
770
|
() => {
|
|
771
771
|
var a;
|
|
772
|
-
let i = ((a =
|
|
772
|
+
let i = ((a = Jt(t == null ? void 0 : t.animationData)) == null ? void 0 : a.动画输出Content) ?? [];
|
|
773
773
|
i && (e.value = i);
|
|
774
774
|
},
|
|
775
775
|
{ deep: !0, immediate: !0 }
|
|
@@ -897,7 +897,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
897
897
|
() => e.animationData,
|
|
898
898
|
(p) => {
|
|
899
899
|
var h;
|
|
900
|
-
let y = ((h =
|
|
900
|
+
let y = ((h = Jt(p)) == null ? void 0 : h.动画输出) ?? [];
|
|
901
901
|
y && y.length > 0 && (s = y, X());
|
|
902
902
|
},
|
|
903
903
|
{ deep: !0 }
|
|
@@ -930,7 +930,11 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
930
930
|
M.name === "Pipe_Link" && !y && ((u = M.children) == null || u.forEach((O) => {
|
|
931
931
|
O && !y && (y = O);
|
|
932
932
|
}));
|
|
933
|
-
}), y ? (
|
|
933
|
+
}), y ? (y.material = new $t({
|
|
934
|
+
color: 31743,
|
|
935
|
+
shininess: 80,
|
|
936
|
+
side: Gt
|
|
937
|
+
}), _.value = y, h.sort((M, u) => M.name.localeCompare(u.name))) : !1;
|
|
934
938
|
}, H = (p, y) => {
|
|
935
939
|
const h = i.value.find((u) => u.name === p);
|
|
936
940
|
if (!h) return;
|
|
@@ -1092,11 +1096,11 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1092
1096
|
};
|
|
1093
1097
|
return Kt(() => {
|
|
1094
1098
|
ft();
|
|
1095
|
-
}),
|
|
1099
|
+
}), qt(() => {
|
|
1096
1100
|
Tt(), L();
|
|
1097
1101
|
}), (p, y) => ($(), q("div", Ke, [
|
|
1098
1102
|
i.value.length > 0 ? ($(), q("div", Xe, [
|
|
1099
|
-
($(!0), q(
|
|
1103
|
+
($(!0), q(Qt, null, te(i.value, (h) => {
|
|
1100
1104
|
var M, u, O, D;
|
|
1101
1105
|
return $(), q("div", {
|
|
1102
1106
|
key: h.name,
|
|
@@ -1134,7 +1138,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1134
1138
|
])))
|
|
1135
1139
|
]));
|
|
1136
1140
|
}
|
|
1137
|
-
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-
|
|
1141
|
+
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-4a616c58"]]), rs = ["xlink:href"], cs = /* @__PURE__ */ ee({
|
|
1138
1142
|
__name: "svgIcon",
|
|
1139
1143
|
props: {
|
|
1140
1144
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1251,7 +1255,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1251
1255
|
} catch (T) {
|
|
1252
1256
|
console.error("Three.js初始化失败:", T);
|
|
1253
1257
|
}
|
|
1254
|
-
}),
|
|
1258
|
+
}), se(() => {
|
|
1255
1259
|
_ = !1, z.value = "", x.value = "", window.removeEventListener("resize", H), r.value && X(), d();
|
|
1256
1260
|
}), t({
|
|
1257
1261
|
addModelsFromUrls: h,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CNq0IT-6.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./menu-DYsWoy6Z.cjs"),de={type:"change"},he={type:"start"},fe={type:"end"},ne=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,X=2*Math.PI,T={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},re=1e-6;class ge extends o.Controls{constructor(t,i=null){super(t,i),this.state=T.NONE,this.target=new o.Vector3,this.cursor=new o.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.touches={ONE:o.TOUCH.ROTATE,TWO:o.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new o.Vector3,this._lastQuaternion=new o.Quaternion,this._lastTargetPosition=new o.Vector3,this._quat=new o.Quaternion().setFromUnitVectors(t.up,new o.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new o.Spherical,this._sphericalDelta=new o.Spherical,this._scale=1,this._panOffset=new o.Vector3,this._rotateStart=new o.Vector2,this._rotateEnd=new o.Vector2,this._rotateDelta=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._panDelta=new o.Vector2,this._dollyStart=new o.Vector2,this._dollyEnd=new o.Vector2,this._dollyDelta=new o.Vector2,this._dollyDirection=new o.Vector3,this._mouse=new o.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=ve.bind(this),this._onPointerDown=ye.bind(this),this._onPointerUp=be.bind(this),this._onContextMenu=Ve.bind(this),this._onMouseWheel=Pe.bind(this),this._onKeyDown=Me.bind(this),this._onTouchStart=xe.bind(this),this._onTouchMove=De.bind(this),this._onMouseDown=we.bind(this),this._onMouseMove=Ee.bind(this),this._interceptControlDown=Se.bind(this),this._interceptControlUp=ke.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(de),this.update(),this.state=T.NONE}update(t=null){const i=this.object.position;I.copy(i).sub(this.target),I.applyQuaternion(this._quat),this._spherical.setFromVector3(I),this.autoRotate&&this.state===T.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=X:s>Math.PI&&(s-=X),l<-Math.PI?l+=X:l>Math.PI&&(l-=X),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let _=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const y=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),_=y!=this._spherical.radius}if(I.setFromSpherical(this._spherical),I.applyQuaternion(this._quatInverse),i.copy(this.target).add(I),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let y=null;if(this.object.isPerspectiveCamera){const r=I.length();y=this._clampDistance(r*this._scale);const E=r-y;this.object.position.addScaledVector(this._dollyDirection,E),this.object.updateMatrixWorld(),_=!!E}else if(this.object.isOrthographicCamera){const r=new o.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const E=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),_=E!==this.object.zoom;const x=new o.Vector3(this._mouse.x,this._mouse.y,0);x.unproject(this.object),this.object.position.sub(x).add(r),this.object.updateMatrixWorld(),y=I.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;y!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(y).add(this.object.position):(ne.origin.copy(this.object.position),ne.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ne.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ne.intersectPlane(pe,this.target))))}else if(this.object.isOrthographicCamera){const y=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),y!==this.object.zoom&&(this.object.updateProjectionMatrix(),_=!0)}return this._scale=1,this._performCursorZoom=!1,_||this._lastPosition.distanceToSquared(this.object.position)>re||8*(1-this._lastQuaternion.dot(this.object.quaternion))>re||this._lastTargetPosition.distanceToSquared(this.target)>re?(this.dispatchEvent(de),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?X/60*this.autoRotateSpeed*t:X/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){I.setFromMatrixColumn(i,0),I.multiplyScalar(-t),this._panOffset.add(I)}_panUp(t,i){this.screenSpacePanning===!0?I.setFromMatrixColumn(i,1):(I.setFromMatrixColumn(i,0),I.crossVectors(this.object.up,I)),I.multiplyScalar(t),this._panOffset.add(I)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;I.copy(l).sub(this.target);let _=I.length();_*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*_/s.clientHeight,this.object.matrix),this._panUp(2*i*_/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,_=i-s.top,y=s.width,r=s.height;this._mouse.x=l/y*2-1,this._mouse.y=-(_/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyStart.set(0,_)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),_=.5*(t.pageY+s.y);this._rotateEnd.set(l,_)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,_),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const y=(t.pageX+i.x)*.5,r=(t.pageY+i.y)*.5;this._updateZoomParameters(y,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new o.Vector2,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function ye(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a)))}function ve(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function be(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(fe),this.state=T.NONE;break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function we(a){let t;switch(a.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case o.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=T.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function Ee(a){switch(this.state){case T.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case T.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case T.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Pe(a){this.enabled===!1||this.enableZoom===!1||this.state!==T.NONE||(a.preventDefault(),this.dispatchEvent(he),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(fe))}function Me(a){this.enabled!==!1&&this._handleKeyDown(a)}function xe(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case o.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=T.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=T.TOUCH_PAN;break;default:this.state=T.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=T.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=T.TOUCH_DOLLY_ROTATE;break;default:this.state=T.NONE}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function De(a){switch(this._trackPointer(a),this.state){case T.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case T.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case T.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case T.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=T.NONE}}function Ve(a){this.enabled!==!1&&a.preventDefault()}function Se(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ke(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Te(a){let t=null,i=null,s=null,l=null,_=null,y=null,r=null,E=null;const x=e.ref([]),z=e.ref(new o.Vector3),L=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const f=a.value;i=new o.PerspectiveCamera(75,f.clientWidth/f.clientHeight,.1,1e4),i.position.set(8,-8,6),i.up.set(0,0,1),i.lookAt(0,0,0),s=new o.WebGLRenderer({antialias:!0,alpha:!0}),s.setSize(f.clientWidth,f.clientHeight),s.localClippingEnabled=!0,s.shadowMap.enabled=!0,s.shadowMap.type=o.PCFSoftShadowMap,s.toneMapping=o.ACESFilmicToneMapping,s.toneMappingExposure=1,s.outputColorSpace=o.SRGBColorSpace,f.appendChild(s.domElement),l=new ge(i,s.domElement),l.enableDamping=!0,l.dampingFactor=.05,l.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.PAN,RIGHT:null},l.panSpeed=.7,_=new o.Xe(i,s,{container:f,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),_.attachControls(l),b(),n()},u=(f,h)=>{r&&(t.remove(r),r.dispose()),E&&(t.remove(E),E.geometry.dispose(),E.material.dispose());const S=Math.min(Math.max(Math.floor(f/20),30),40);r=new o.GridHelper(f,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(h),t.add(r);const Y=new o.PlaneGeometry(f,f),K=new o.ShadowMaterial({opacity:.3,color:0});E=new o.Mesh(Y,K),E.position.copy(h),E.position.z-=.01,E.receiveShadow=!0,t.add(E)},M=()=>{if(x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),Y=Math.max(h.x,h.y,h.z),K=Math.max(Y*8,50),A=new o.Vector3(S.x,S.y,f.min.z);u(K,A)},b=()=>{const f=new o.AmbientLight(4210752,.6);t.add(f);const h=new o.DirectionalLight(16777215,2);h.position.set(10,10,8),h.castShadow=!0,h.shadow.mapSize.width=4096,h.shadow.mapSize.height=4096,h.shadow.camera.near=.5,h.shadow.camera.far=50,h.shadow.camera.left=-50,h.shadow.camera.right=50,h.shadow.camera.top=50,h.shadow.camera.bottom=-50,t.add(h);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const Y=new o.DirectionalLight(16777215,.6);Y.position.set(0,-15,2),t.add(Y);const K=new o.HemisphereLight(16777215,4473924,.8);t.add(K);const A=new o.PointLight(16777215,1,50);A.position.set(15,15,15),t.add(A);const G=new o.PointLight(16777215,.5,50);G.position.set(-15,-15,15),t.add(G)},n=()=>{y=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),_&&_.render()},g=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{f[S]&&f[S].dispose&&f[S].dispose()}),f.dispose&&f.dispose()},w=f=>{f==null||f.traverse(h=>{h.geometry&&h.geometry.dispose(),h.material&&(Array.isArray(h.material)?h.material.forEach(S=>{g(S)}):g(h.material))})};return{currentModels:x,initialCameraPosition:z,initialTargetPosition:L,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!_)return;const f=a.value,h=f.clientWidth,S=f.clientHeight;i.aspect=h/S,i.updateProjectionMatrix(),s.setSize(h,S),_.update()},fitCameraToAllModels:()=>{if(!i||!l||x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),K=Math.max(h.x,h.y,h.z)*.8,A=new o.Vector3(S.x+K,S.y-K,S.z+K);i.position.copy(A),i.lookAt(S),l.target.copy(S),l.update(),z.value.copy(A),L.value.copy(S),M()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:_}),clearAllModels:()=>{if(!t)return;x.value.forEach(h=>{t.remove(h),w(h)});const f=[];t.children.forEach(h=>{!h.isLight&&!h.isCamera&&h.type!=="GridHelper"&&h!==E&&f.push(h)}),f.forEach(h=>{t.remove(h),w(h)}),x.value=[],M()},cleanup:()=>{y&&cancelAnimationFrame(y),r&&r.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),s&&s.dispose(),l&&l.dispose(),_&&_.dispose()},updateGridForModels:M}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,_=new o.Vector3,y=new o.Vector3,r=new o.Vector3,E=0,x=null;const z=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,L=n=>{const g=new o.Vector3,w=E*1.2,O=new o.Vector3(r.x+w,r.y,r.z),B=new o.Vector3(r.x,r.y+w,r.z),H=new o.Vector3(r.x,r.y-w,r.z);if(n<=.567){const F=n/.567*Math.PI*2;g.x=r.x+Math.cos(F)*w,g.z=r.z+Math.sin(F)*w,g.y=r.y}else if(n<=.724){const j=(n-.567)/.157,F=z(j);g.lerpVectors(O,B,F)}else if(n<=.881){const j=(n-.724)/.157,f=z(j)*Math.PI;g.x=r.x+Math.sin(f)*w,g.y=r.y+Math.cos(f)*w,g.z=r.z}else{const j=(n-.881)/.119,F=z(j);g.lerpVectors(H,_,F)}return g},C=()=>{const{camera:n,controls:g}=a();if(!n||!g)return;s||(s=Date.now());const w=Date.now()-s,O=Math.min(w/l,1);if(O>=1){M();return}const B=L(O);n.position.copy(B),n.lookAt(r),g.target.copy(r),x=requestAnimationFrame(C)},u=()=>{if(t.value.length===0)return;const{camera:n,controls:g}=a();if(!n||!g)return;_.copy(n.position),y.copy(g.target);const w=new o.Box3;t.value.forEach(h=>{w.expandByObject(h)});const O=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),E=Math.max(O.x,O.y,O.z)*1.2;const B=new o.Vector3(r.x+E*1.2,r.y,r.z);g.enabled=!1;const H=n.position.clone(),j=1e3,F=Date.now(),f=()=>{const h=Date.now()-F,S=Math.min(h/j,1),Y=z(S);n.position.lerpVectors(H,B,Y),n.lookAt(r),g.target.copy(r),S<1?requestAnimationFrame(f):(i.value=!0,s=null,C())};f()},M=()=>{i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{controls:n}=a();n&&(n.enabled=!0,n.target.copy(y))};return{isAnimating:i,toggleAnimation:()=>{if(i.value){i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{camera:n,controls:g}=a();if(!n||!g)return;g.enabled=!0;const w=n.position.clone(),O=g.target.clone(),B=1500,H=Date.now(),j=()=>{const F=Date.now()-H,f=Math.min(F/B,1),h=z(f);n.position.lerpVectors(w,_,h),g.target.lerpVectors(O,y,h),f<1&&requestAnimationFrame(j)};j()}else u()},startAnimation:u,stopAnimation:M}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],_=[],y=new o.Box3,r=new o.Vector3;const E=()=>{l=[new o.Plane(new o.Vector3(1,0,0),0),new o.Plane(new o.Vector3(0,1,0),0),new o.Plane(new o.Vector3(0,0,1),0)]},x=()=>{y.makeEmpty(),t.value.forEach(b=>{y.expandByObject(b)}),r=y.getCenter(new o.Vector3)},z=b=>{const n=y.getSize(new o.Vector3);let g,w,O;b==="x"?(g=new o.PlaneGeometry(n.z*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,Math.PI/2,0)):b==="y"?(g=new o.PlaneGeometry(n.x*1.2,n.z*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(Math.PI/2,0,0)):b==="z"&&(g=new o.PlaneGeometry(n.x*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,0,0));const B=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),H=new o.Mesh(g,B);return H.position.copy(w),H.rotation.copy(O),H},L=()=>{if(C(),u(),s.value==="none")return;x();let b=null;if(s.value==="x"?(l[0].constant=-r.x,b=l[0]):s.value==="y"?(l[1].constant=-r.y,b=l[1]):s.value==="z"&&(l[2].constant=-r.z,b=l[2]),b){t.value.forEach(g=>{g.traverse(w=>{w.isMesh&&w.material&&(Array.isArray(w.material)?w.material.forEach(O=>{O.clippingPlanes=[b]}):w.material.clippingPlanes=[b])})});const{scene:n}=a();if(n){const g=z(s.value);n.add(g),_.push(g)}}},C=()=>{t.value.forEach(b=>{b.traverse(n=>{n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(g=>{g.clippingPlanes=[]}):n.material.clippingPlanes=[])})})},u=()=>{const{scene:b}=a();b&&_.forEach(n=>{b.remove(n),n.geometry.dispose(),n.material.dispose()}),_=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(E(),t.value.length>0&&x()):(s.value="none",C(),u())},updateClippingPlanes:L,clearClippingPlanes:C,clearClippingMeshes:u}}const Ne={class:"panel-content"},Re={__name:"animationTable",props:{animationData:Object,model:Object},setup(a){const t=a;e.ref();const i=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var l;let s=((l=me.cloneDeep(t==null?void 0:t.animationData))==null?void 0:l.动画输出Content)??[];s&&(i.value=s)},{deep:!0,immediate:!0}),(s,l)=>{var _,y,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(_=i.value)==null?void 0:_.compData,key:(y=i.value)==null?void 0:y.id,index:(r=i.value)==null?void 0:r.id,showHeader:!1},null,8,["itemData","index"]))])}}},ze=oe._export_sfc(Re,[["__scopeId","data-v-02b89b4b"]]),Oe={class:"panel-content"},Le="id",je={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:a=>["breadth","firstLevel"].includes(a)}},emits:["nodeClick"],setup(a,{emit:t}){const i=a,s=t,l=e.ref([]),_={children:"children",label:"label"},y=u=>{s("nodeClick",u)},r=(u,M=0)=>{const b=[];return Array.isArray(u)&&(u==null?void 0:u.length)>0&&u.forEach(n=>{if(!(n!=null&&n.isMesh)&&((n==null?void 0:n.type)==="URDFJoint"||(n==null?void 0:n.type)==="URDFLink")){const g={name:n==null?void 0:n.name,label:n==null?void 0:n.name,show:!0,level:M+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:r(n==null?void 0:n.children,M+1),path:n==null?void 0:n.name};b.push(g)}}),b},E=u=>u?[{name:u==null?void 0:u.name,label:u==null?void 0:u.name,show:!0,level:1,isPenultimate:!1,type:u==null?void 0:u.type,id:u==null?void 0:u.id,limit:(u==null?void 0:u.limit)??"",children:r(u==null?void 0:u.children,1),path:u==null?void 0:u.name}]:[],x=(u,M)=>{const b=[],n=[...u];for(;n.length>0&&b.length<M;){const g=n.shift();g.children&&g.children.length>0&&(b.push(g.id),n.push(...g.children))}return b},z=(u,M)=>{const b=[];return u.forEach(n=>{if(n.children&&n.children.length>0){b.push(n.id);const g=n.children.filter(w=>w.children&&w.children.length>0).slice(0,M).map(w=>w.id);b.push(...g)}}),b.slice(0,M+1)},L=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?z(l.value,i.maxExpandCount):x(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?E(i.model):[]);return e.watch(C,u=>{l.value=JSON.parse(JSON.stringify(u))},{immediate:!0}),(u,M)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(b,{data:l.value,props:_,"default-expanded-keys":L.value,"node-key":Le,onNodeClick:y},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(je,[["__scopeId","data-v-290ff4e1"]]),Ue={class:"panel-content"},Be={key:0,class:"joints-list"},Fe={class:"joint-info-row"},Ye={class:"joint-left"},Ze={class:"joint-name"},He={class:"joint-range"},Ke={class:"joint-type"},Xe={key:0,class:"joint-control-row"},$e={class:"slider-container"},Ge=["min","max","value","onInput","disabled"],Je={class:"value-display"},qe={class:"joint-value"},We={class:"unit"},Qe={key:1,class:"empty-state"},se=.001,et=1e3,ce=60,tt={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const i=a;e.ref(!0);const s=e.ref([]),l=e.ref(null),_=e.ref(12.5),y=e.ref(),r=e.ref(1302),E=e.ref(!1),x=e.ref(!1),z=e.ref(0),L=e.ref(0),C=e.ref(null),u=o.MathUtils.degToRad,M=e.ref(1),b=()=>et/ce/M.value;let n=[];e.watch(()=>i.animationData,m=>{var d;let v=((d=me.cloneDeep(m))==null?void 0:d.动画输出)??[];v&&v.length>0&&(n=v,Y())},{deep:!0});const g=e.computed(()=>n.length>0),w=(m,v=!1)=>m==="revolute"?v?Math.PI:-Math.PI:m==="prismatic"?v?1:-1:0,O=m=>{if(!m||!m.joints)return console.warn("URDF模型没有关节信息"),[];let v;const d=[];return Object.keys(m.joints).forEach(P=>{const p=m.joints[P];if(p._jointType==="fixed")return;const N=p.limit?{lower:p.limit.lower??w(p._jointType,!1),upper:p.limit.upper??w(p._jointType,!0)}:{lower:w(p._jointType,!1),upper:w(p._jointType,!0)};d.push({name:P,type:p._jointType||"unknown",limit:N,currentValue:p.angle||0,urdfJoint:p})}),m.traverse(P=>{var p;P.name==="Pipe_Link"&&!v&&((p=P.children)==null||p.forEach(N=>{N&&!v&&(v=N)}))}),v?(y.value=v,d.sort((P,p)=>P.name.localeCompare(p.name))):!1},B=(m,v)=>{const d=s.value.find(p=>p.name===m);if(!d)return;const P=parseFloat(v);if(d.limit){const p=Math.max(d.limit.lower,Math.min(d.limit.upper,P));d.currentValue=p}else d.currentValue=P;i.model&&i.model.setJointValue?i.model.setJointValue(m,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},H=m=>m.reduce((v,d)=>{let P=0;const p=d.Y??0,N=d.C??0,D=d.R??0;return p>0&&(P+=p),N>0&&D>0&&(P+=D*u(N)),v+P},0),j=m=>{const v=[],d=m.Y??0,P=m.B??0,p=m.C??0,N=m.R??0,D={pos:new o.Vector3(0,0,0),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};if(!d&&!p)return v;if(v.push(D.pos.clone()),P!==0){const V=new o.Matrix4().makeRotationAxis(D.localY,u(P));D.localX.applyMatrix4(V),D.localZ.applyMatrix4(V)}if(d>0&&(D.pos.add(D.localY.clone().multiplyScalar(d*se)),v.push(D.pos.clone())),p>0&&N>0){const V=u(p),c=N*se,U=D.pos.clone().add(D.localX.clone().multiplyScalar(-c)),J=Math.max(16,Math.ceil(p/5));for(let $=1;$<=J;$++){const ee=V*$/J,Q=new o.Matrix4().makeRotationAxis(D.localZ,ee),Z=D.localX.clone().multiplyScalar(c).applyMatrix4(Q),q=U.clone().add(Z);v.push(q)}}return v},F=m=>{if(!y.value||!g.value)return;const v=n.slice(0,m+1),d=H(v),P=Math.max(0,r.value-d),p=[];p.push(new o.Vector3(0,0,0));const N=new o.Vector3(0,P*se,0);P>0&&p.push(N);let D={pos:N.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const V=[];for(let c=v.length-1;c>=0;c--){const U=v[c],J=j(U);if(J.length>0){const $=J.map(Z=>{const q=Z.clone(),te=new o.Matrix4;return te.makeBasis(D.localX,D.localY,D.localZ),q.applyMatrix4(te),q.add(D.pos)});V.push($);const ee=$[$.length-1];D.pos=ee.clone();const Q=U.B??0,k=U.C??0;if(Q!==0){const Z=new o.Matrix4().makeRotationAxis(D.localY,u(Q));D.localX.applyMatrix4(Z),D.localZ.applyMatrix4(Z)}if(k>0){const Z=u(k),q=new o.Matrix4().makeRotationAxis(D.localZ,Z);D.localY.applyMatrix4(q),D.localX.applyMatrix4(q)}}}for(const c of V)c.length>1&&p.push(...c.slice(1));p.length<2&&p.push(new o.Vector3(0,.001,0)),console.log(2321,p);try{const c=new o.CatmullRomCurve3(p,!1,"catmullrom",.01),U=new o.TubeGeometry(c,Math.max(2,p.length*4),_.value*se,18,!1);y.value.geometry.dispose(),y.value.geometry=U}catch(c){console.error("主管件更新失败",c)}},f=m=>{m&&Object.keys(m).forEach((v,d)=>{const P=m[v],p=s.value.find(N=>N.name===v);p&&(p.currentValue=P,i.model&&i.model.setJointValue?i.model.setJointValue(v,P):p.urdfJoint&&p.urdfJoint.setJointValue(P)),console.log(232,d),F(d)})},h=(m,v,d)=>m+(v-m)*d,S=(m,v,d)=>{if(!m||!v)return m||v;const P={};return Object.keys(m).forEach(p=>{const N=m[p],D=v[p];P[p]=h(N,D||N,d)}),P},Y=()=>{if(n.length===0){console.warn("没有动画数据");return}E.value=!0,x.value=!1;const m=()=>{if(!E.value||x.value)return;const v=L.value/ce,d=n[z.value],P=n[z.value+1];if(P){const p=S(d,P,v);f(p)}else f(d);if(L.value++,L.value>=ce&&(L.value=0,z.value++,z.value>=n.length-1)){A();return}C.value=setTimeout(m,b())};m()},K=()=>{x.value=!0,C.value&&(clearTimeout(C.value),C.value=null)},A=()=>{E.value=!1,x.value=!1,M.value=1,C.value&&(clearTimeout(C.value),C.value=null)};t({startAnimation:Y,pauseAnimation:K,stopAnimation:A,resetAll:()=>{A(),z.value=0,L.value=0,s.value.forEach(m=>{(m.type==="revolute"||m.type==="prismatic")&&B(m.name,0)})},fastForward:()=>{M.value<4&&(M.value=Math.min(4,M.value*2))},fastBackward:()=>{M.value>.25&&(M.value=Math.max(.25,M.value/2))}}),e.watch(()=>i.model,m=>{m?s.value=O(m):s.value=[]},{immediate:!0});const ae=()=>{!i.model||E.value&&!x.value||s.value.forEach(m=>{m.urdfJoint&&m.urdfJoint.angle!==void 0&&(m.currentValue=m.urdfJoint.angle)})},ie=()=>{const m=()=>{ae(),l.value=requestAnimationFrame(m)};m()},le=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{ie()}),e.onUnmounted(()=>{le(),A()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",Ue,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,d=>{var P,p,N,D;return e.openBlock(),e.createElementBlock("div",{key:d.name,class:"joint-item"},[e.createElementVNode("div",Fe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",Ze,e.toDisplayString(d.name),1),e.createElementVNode("span",He," ["+e.toDisplayString(((P=d.limit)==null?void 0:P.lower.toFixed(2))??(d.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((p=d.limit)==null?void 0:p.upper.toFixed(2))??(d.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Ke,e.toDisplayString(d.type),1)]),d.type==="revolute"||d.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",$e,[e.createElementVNode("input",{type:"range",min:((N=d.limit)==null?void 0:N.lower)??(d.type==="revolute"?-Math.PI:-1),max:((D=d.limit)==null?void 0:D.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:V=>B(d.name,V.target.value),class:"joint-slider",disabled:E.value&&!x.value},null,40,Ge)]),e.createElementVNode("div",Je,[e.createElementVNode("span",qe,e.toDisplayString(d.currentValue.toFixed(3)),1),e.createElementVNode("span",We,e.toDisplayString(d.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Qe,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},ot=oe._export_sfc(tt,[["__scopeId","data-v-9ee05a01"]]),it=["xlink:href"],nt=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(a){const t=a,i=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>{const{size:_}=t;let y=`${_}`;return y=`${y.replace("px","")}px`,{width:y,height:y}});return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:_.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[_.$attrs.class,_.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),R=oe._export_sfc(nt,[["__scopeId","data-v-3150a90b"]]),st={class:"obj-viewer-container"},at={class:"buttonGroup-top"},lt={class:"buttonGroup-topLeft"},rt={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ht={class:"buttonGroup-bottom"},ut={class:"left-panel"},dt={class:"panel-header"},pt={key:1,class:"clipping-content"},mt={class:"radio-group"},ft={class:"radio-label"},_t={class:"radio-label"},gt={class:"radio-label"},yt={class:"radio-label"},vt={class:"right-panel"},bt={class:"panel-header"},wt={key:0,class:"loading-overlay"},Et={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(a,{expose:t,emit:i}){const s=i,l=a;let _=null,y=!1;const r=e.ref(null),E=e.ref(!1),x=e.ref("");e.ref(!1);const z=e.ref(!1),L=e.ref(!1),C=e.ref(""),u=e.ref(!1),M=e.ref(""),b=e.ref(),{currentModels:n,initialCameraPosition:g,initialTargetPosition:w,initThreeJS:O,handleResize:B,fitCameraToAllModels:H,getThreeJSObjects:j,clearAllModels:F,cleanup:f}=Te(r),{isAnimating:h,toggleAnimation:S,stopAnimation:Y}=Ce(j,n),{isClipping:K,activeClippingAxis:A,toggleClipping:G,updateClippingPlanes:W}=Ae(j,n),{addModelsFromUrls:ue,loadModelByDefaultPath:ae,urdfModel:ie}=o.useModelLoader(j,n,E,x,F),le=()=>{if(z.value||n.value.length===0)return;z.value=!0,h.value&&Y();const{camera:V,controls:c}=j();if(!V||!c)return;c.enabled=!0;const U=Z=>Z<.5?4*Z*Z*Z:1-Math.pow(-2*Z+2,3)/2,J=V.position.clone(),$=c.target.clone(),ee=1500,Q=Date.now(),k=()=>{const Z=Date.now()-Q,q=Math.min(Z/ee,1),te=U(q);V.position.lerpVectors(J,g.value,te),c.target.lerpVectors($,w.value,te),q<1?requestAnimationFrame(k):z.value=!1};k()},m=async()=>y?Promise.resolve():new Promise(V=>{const c=()=>{y?V():requestAnimationFrame(c)};c()}),v=async(V,c)=>{try{await m(),h.value&&Y(),K.value&&G();const U=await c(V);return H(),U}catch(U){throw console.error("加载模型失败:",U),U}},d=async V=>v(V,ue),P=async V=>v(V,ae),p=V=>{L.value=!0,C.value=V,V==="剖面视图"&&!K.value&&G()},N=V=>{u.value=!0,M.value=V},D=()=>{s("getAnimationData"),e.nextTick(()=>{var V;(V=b.value)==null||V.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{O(),_=j().scene,y=!0,window.addEventListener("resize",B)}catch(V){console.error("Three.js初始化失败:",V)}}),e.onBeforeUnmount(()=>{y=!1,C.value="",M.value="",window.removeEventListener("resize",B),h.value&&Y(),f()}),t({addModelsFromUrls:d,loadModelByDefaultPath:P}),(V,c)=>{var J,$,ee,Q;const U=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",at,[e.createVNode(R,{name:"guanjianjiexi",size:"34"}),e.createVNode(R,{name:"guanjiekongzhi",size:"34"}),e.createVNode(R,{name:"gongyishengcheng",size:"34"}),e.createVNode(R,{name:"buchangshezhi",size:"34"}),e.createVNode(R,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",lt,[e.createVNode(R,{name:"viewReset",size:"24",onClick:le,title:"重置"}),e.createVNode(R,{name:"fangda",size:"24",title:"放大"}),e.createVNode(R,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(R,{name:"lookAround",size:"24",onClick:e.unref(S),title:e.unref(h)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(R,{name:"jiegoushu",size:"24",onClick:c[0]||(c[0]=k=>p("场景树")),active:L.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(R,{name:"clipping",size:"24",onClick:c[1]||(c[1]=k=>p("剖面视图")),active:L.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[2]||(c[2]=k=>p("场景树3"))}),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[3]||(c[3]=k=>p("场景4"))})]),e.createElementVNode("div",ct,[e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"guanjiekongzhi",size:"24",onClick:c[4]||(c[4]=k=>N("关节控制")),active:u.value&&M.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(R,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:c[5]||(c[5]=k=>N("动画仿真")),active:u.value&&M.value==="动画仿真"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ht,[e.createVNode(R,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(J=b.value)==null?void 0:J.fastBackward},null,8,["onClick"]),e.createVNode(R,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:D}),e.createVNode(R,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:($=b.value)==null?void 0:$.fastForward},null,8,["onClick"]),e.createVNode(R,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(ee=b.value)==null?void 0:ee.pauseAnimation},null,8,["onClick"]),e.createVNode(R,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(Q=b.value)==null?void 0:Q.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createElementVNode("span",{class:"close",onClick:c[6]||(c[6]=k=>L.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(ie)},null,8,["model"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("label",ft,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":c[7]||(c[7]=k=>e.isRef(A)?A.value=k:null),onChange:c[8]||(c[8]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[16]||(c[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",_t,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":c[9]||(c[9]=k=>e.isRef(A)?A.value=k:null),onChange:c[10]||(c[10]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[17]||(c[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":c[11]||(c[11]=k=>e.isRef(A)?A.value=k:null),onChange:c[12]||(c[12]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[18]||(c[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":c[13]||(c[13]=k=>e.isRef(A)?A.value=k:null),onChange:c[14]||(c[14]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[19]||(c[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(M.value),1),e.createElementVNode("span",{class:"close",onClick:c[15]||(c[15]=k=>u.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ot,{ref_key:"jointRef",ref:b,model:e.unref(ie),scene:e.unref(_),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,M.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,M.value==="动画仿真"]])]),_:1})],512),[[e.vShow,u.value]]),E.value?(e.openBlock(),e.createElementBlock("div",wt,[c[20]||(c[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},Pt=oe._export_sfc(Et,[["__scopeId","data-v-14112288"]]);exports.default=Pt;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CNq0IT-6.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./menu-DYsWoy6Z.cjs"),de={type:"change"},he={type:"start"},fe={type:"end"},ne=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,X=2*Math.PI,T={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},re=1e-6;class ge extends o.Controls{constructor(t,i=null){super(t,i),this.state=T.NONE,this.target=new o.Vector3,this.cursor=new o.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.touches={ONE:o.TOUCH.ROTATE,TWO:o.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new o.Vector3,this._lastQuaternion=new o.Quaternion,this._lastTargetPosition=new o.Vector3,this._quat=new o.Quaternion().setFromUnitVectors(t.up,new o.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new o.Spherical,this._sphericalDelta=new o.Spherical,this._scale=1,this._panOffset=new o.Vector3,this._rotateStart=new o.Vector2,this._rotateEnd=new o.Vector2,this._rotateDelta=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._panDelta=new o.Vector2,this._dollyStart=new o.Vector2,this._dollyEnd=new o.Vector2,this._dollyDelta=new o.Vector2,this._dollyDirection=new o.Vector3,this._mouse=new o.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=ve.bind(this),this._onPointerDown=ye.bind(this),this._onPointerUp=be.bind(this),this._onContextMenu=Ve.bind(this),this._onMouseWheel=Pe.bind(this),this._onKeyDown=Me.bind(this),this._onTouchStart=xe.bind(this),this._onTouchMove=De.bind(this),this._onMouseDown=we.bind(this),this._onMouseMove=Ee.bind(this),this._interceptControlDown=Se.bind(this),this._interceptControlUp=ke.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(de),this.update(),this.state=T.NONE}update(t=null){const i=this.object.position;I.copy(i).sub(this.target),I.applyQuaternion(this._quat),this._spherical.setFromVector3(I),this.autoRotate&&this.state===T.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=X:s>Math.PI&&(s-=X),l<-Math.PI?l+=X:l>Math.PI&&(l-=X),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let _=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const y=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),_=y!=this._spherical.radius}if(I.setFromSpherical(this._spherical),I.applyQuaternion(this._quatInverse),i.copy(this.target).add(I),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let y=null;if(this.object.isPerspectiveCamera){const r=I.length();y=this._clampDistance(r*this._scale);const E=r-y;this.object.position.addScaledVector(this._dollyDirection,E),this.object.updateMatrixWorld(),_=!!E}else if(this.object.isOrthographicCamera){const r=new o.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const E=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),_=E!==this.object.zoom;const x=new o.Vector3(this._mouse.x,this._mouse.y,0);x.unproject(this.object),this.object.position.sub(x).add(r),this.object.updateMatrixWorld(),y=I.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;y!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(y).add(this.object.position):(ne.origin.copy(this.object.position),ne.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ne.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ne.intersectPlane(pe,this.target))))}else if(this.object.isOrthographicCamera){const y=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),y!==this.object.zoom&&(this.object.updateProjectionMatrix(),_=!0)}return this._scale=1,this._performCursorZoom=!1,_||this._lastPosition.distanceToSquared(this.object.position)>re||8*(1-this._lastQuaternion.dot(this.object.quaternion))>re||this._lastTargetPosition.distanceToSquared(this.target)>re?(this.dispatchEvent(de),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?X/60*this.autoRotateSpeed*t:X/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){I.setFromMatrixColumn(i,0),I.multiplyScalar(-t),this._panOffset.add(I)}_panUp(t,i){this.screenSpacePanning===!0?I.setFromMatrixColumn(i,1):(I.setFromMatrixColumn(i,0),I.crossVectors(this.object.up,I)),I.multiplyScalar(t),this._panOffset.add(I)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;I.copy(l).sub(this.target);let _=I.length();_*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*_/s.clientHeight,this.object.matrix),this._panUp(2*i*_/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,_=i-s.top,y=s.width,r=s.height;this._mouse.x=l/y*2-1,this._mouse.y=-(_/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyStart.set(0,_)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),_=.5*(t.pageY+s.y);this._rotateEnd.set(l,_)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,_),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const y=(t.pageX+i.x)*.5,r=(t.pageY+i.y)*.5;this._updateZoomParameters(y,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new o.Vector2,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function ye(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a)))}function ve(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function be(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(fe),this.state=T.NONE;break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function we(a){let t;switch(a.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case o.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=T.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function Ee(a){switch(this.state){case T.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case T.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case T.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Pe(a){this.enabled===!1||this.enableZoom===!1||this.state!==T.NONE||(a.preventDefault(),this.dispatchEvent(he),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(fe))}function Me(a){this.enabled!==!1&&this._handleKeyDown(a)}function xe(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case o.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=T.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=T.TOUCH_PAN;break;default:this.state=T.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=T.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=T.TOUCH_DOLLY_ROTATE;break;default:this.state=T.NONE}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function De(a){switch(this._trackPointer(a),this.state){case T.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case T.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case T.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case T.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=T.NONE}}function Ve(a){this.enabled!==!1&&a.preventDefault()}function Se(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ke(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Te(a){let t=null,i=null,s=null,l=null,_=null,y=null,r=null,E=null;const x=e.ref([]),z=e.ref(new o.Vector3),L=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const f=a.value;i=new o.PerspectiveCamera(75,f.clientWidth/f.clientHeight,.1,1e4),i.position.set(8,-8,6),i.up.set(0,0,1),i.lookAt(0,0,0),s=new o.WebGLRenderer({antialias:!0,alpha:!0}),s.setSize(f.clientWidth,f.clientHeight),s.localClippingEnabled=!0,s.shadowMap.enabled=!0,s.shadowMap.type=o.PCFSoftShadowMap,s.toneMapping=o.ACESFilmicToneMapping,s.toneMappingExposure=1,s.outputColorSpace=o.SRGBColorSpace,f.appendChild(s.domElement),l=new ge(i,s.domElement),l.enableDamping=!0,l.dampingFactor=.05,l.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.PAN,RIGHT:null},l.panSpeed=.7,_=new o.Xe(i,s,{container:f,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),_.attachControls(l),b(),n()},u=(f,h)=>{r&&(t.remove(r),r.dispose()),E&&(t.remove(E),E.geometry.dispose(),E.material.dispose());const S=Math.min(Math.max(Math.floor(f/20),30),40);r=new o.GridHelper(f,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(h),t.add(r);const Y=new o.PlaneGeometry(f,f),K=new o.ShadowMaterial({opacity:.3,color:0});E=new o.Mesh(Y,K),E.position.copy(h),E.position.z-=.01,E.receiveShadow=!0,t.add(E)},M=()=>{if(x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),Y=Math.max(h.x,h.y,h.z),K=Math.max(Y*8,50),A=new o.Vector3(S.x,S.y,f.min.z);u(K,A)},b=()=>{const f=new o.AmbientLight(4210752,.6);t.add(f);const h=new o.DirectionalLight(16777215,2);h.position.set(10,10,8),h.castShadow=!0,h.shadow.mapSize.width=4096,h.shadow.mapSize.height=4096,h.shadow.camera.near=.5,h.shadow.camera.far=50,h.shadow.camera.left=-50,h.shadow.camera.right=50,h.shadow.camera.top=50,h.shadow.camera.bottom=-50,t.add(h);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const Y=new o.DirectionalLight(16777215,.6);Y.position.set(0,-15,2),t.add(Y);const K=new o.HemisphereLight(16777215,4473924,.8);t.add(K);const A=new o.PointLight(16777215,1,50);A.position.set(15,15,15),t.add(A);const G=new o.PointLight(16777215,.5,50);G.position.set(-15,-15,15),t.add(G)},n=()=>{y=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),_&&_.render()},g=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{f[S]&&f[S].dispose&&f[S].dispose()}),f.dispose&&f.dispose()},w=f=>{f==null||f.traverse(h=>{h.geometry&&h.geometry.dispose(),h.material&&(Array.isArray(h.material)?h.material.forEach(S=>{g(S)}):g(h.material))})};return{currentModels:x,initialCameraPosition:z,initialTargetPosition:L,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!_)return;const f=a.value,h=f.clientWidth,S=f.clientHeight;i.aspect=h/S,i.updateProjectionMatrix(),s.setSize(h,S),_.update()},fitCameraToAllModels:()=>{if(!i||!l||x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),K=Math.max(h.x,h.y,h.z)*.8,A=new o.Vector3(S.x+K,S.y-K,S.z+K);i.position.copy(A),i.lookAt(S),l.target.copy(S),l.update(),z.value.copy(A),L.value.copy(S),M()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:_}),clearAllModels:()=>{if(!t)return;x.value.forEach(h=>{t.remove(h),w(h)});const f=[];t.children.forEach(h=>{!h.isLight&&!h.isCamera&&h.type!=="GridHelper"&&h!==E&&f.push(h)}),f.forEach(h=>{t.remove(h),w(h)}),x.value=[],M()},cleanup:()=>{y&&cancelAnimationFrame(y),r&&r.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),s&&s.dispose(),l&&l.dispose(),_&&_.dispose()},updateGridForModels:M}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,_=new o.Vector3,y=new o.Vector3,r=new o.Vector3,E=0,x=null;const z=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,L=n=>{const g=new o.Vector3,w=E*1.2,O=new o.Vector3(r.x+w,r.y,r.z),B=new o.Vector3(r.x,r.y+w,r.z),H=new o.Vector3(r.x,r.y-w,r.z);if(n<=.567){const F=n/.567*Math.PI*2;g.x=r.x+Math.cos(F)*w,g.z=r.z+Math.sin(F)*w,g.y=r.y}else if(n<=.724){const j=(n-.567)/.157,F=z(j);g.lerpVectors(O,B,F)}else if(n<=.881){const j=(n-.724)/.157,f=z(j)*Math.PI;g.x=r.x+Math.sin(f)*w,g.y=r.y+Math.cos(f)*w,g.z=r.z}else{const j=(n-.881)/.119,F=z(j);g.lerpVectors(H,_,F)}return g},C=()=>{const{camera:n,controls:g}=a();if(!n||!g)return;s||(s=Date.now());const w=Date.now()-s,O=Math.min(w/l,1);if(O>=1){M();return}const B=L(O);n.position.copy(B),n.lookAt(r),g.target.copy(r),x=requestAnimationFrame(C)},u=()=>{if(t.value.length===0)return;const{camera:n,controls:g}=a();if(!n||!g)return;_.copy(n.position),y.copy(g.target);const w=new o.Box3;t.value.forEach(h=>{w.expandByObject(h)});const O=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),E=Math.max(O.x,O.y,O.z)*1.2;const B=new o.Vector3(r.x+E*1.2,r.y,r.z);g.enabled=!1;const H=n.position.clone(),j=1e3,F=Date.now(),f=()=>{const h=Date.now()-F,S=Math.min(h/j,1),Y=z(S);n.position.lerpVectors(H,B,Y),n.lookAt(r),g.target.copy(r),S<1?requestAnimationFrame(f):(i.value=!0,s=null,C())};f()},M=()=>{i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{controls:n}=a();n&&(n.enabled=!0,n.target.copy(y))};return{isAnimating:i,toggleAnimation:()=>{if(i.value){i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{camera:n,controls:g}=a();if(!n||!g)return;g.enabled=!0;const w=n.position.clone(),O=g.target.clone(),B=1500,H=Date.now(),j=()=>{const F=Date.now()-H,f=Math.min(F/B,1),h=z(f);n.position.lerpVectors(w,_,h),g.target.lerpVectors(O,y,h),f<1&&requestAnimationFrame(j)};j()}else u()},startAnimation:u,stopAnimation:M}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],_=[],y=new o.Box3,r=new o.Vector3;const E=()=>{l=[new o.Plane(new o.Vector3(1,0,0),0),new o.Plane(new o.Vector3(0,1,0),0),new o.Plane(new o.Vector3(0,0,1),0)]},x=()=>{y.makeEmpty(),t.value.forEach(b=>{y.expandByObject(b)}),r=y.getCenter(new o.Vector3)},z=b=>{const n=y.getSize(new o.Vector3);let g,w,O;b==="x"?(g=new o.PlaneGeometry(n.z*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,Math.PI/2,0)):b==="y"?(g=new o.PlaneGeometry(n.x*1.2,n.z*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(Math.PI/2,0,0)):b==="z"&&(g=new o.PlaneGeometry(n.x*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,0,0));const B=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),H=new o.Mesh(g,B);return H.position.copy(w),H.rotation.copy(O),H},L=()=>{if(C(),u(),s.value==="none")return;x();let b=null;if(s.value==="x"?(l[0].constant=-r.x,b=l[0]):s.value==="y"?(l[1].constant=-r.y,b=l[1]):s.value==="z"&&(l[2].constant=-r.z,b=l[2]),b){t.value.forEach(g=>{g.traverse(w=>{w.isMesh&&w.material&&(Array.isArray(w.material)?w.material.forEach(O=>{O.clippingPlanes=[b]}):w.material.clippingPlanes=[b])})});const{scene:n}=a();if(n){const g=z(s.value);n.add(g),_.push(g)}}},C=()=>{t.value.forEach(b=>{b.traverse(n=>{n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(g=>{g.clippingPlanes=[]}):n.material.clippingPlanes=[])})})},u=()=>{const{scene:b}=a();b&&_.forEach(n=>{b.remove(n),n.geometry.dispose(),n.material.dispose()}),_=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(E(),t.value.length>0&&x()):(s.value="none",C(),u())},updateClippingPlanes:L,clearClippingPlanes:C,clearClippingMeshes:u}}const Ne={class:"panel-content"},Re={__name:"animationTable",props:{animationData:Object,model:Object},setup(a){const t=a;e.ref();const i=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var l;let s=((l=me.cloneDeep(t==null?void 0:t.animationData))==null?void 0:l.动画输出Content)??[];s&&(i.value=s)},{deep:!0,immediate:!0}),(s,l)=>{var _,y,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(_=i.value)==null?void 0:_.compData,key:(y=i.value)==null?void 0:y.id,index:(r=i.value)==null?void 0:r.id,showHeader:!1},null,8,["itemData","index"]))])}}},ze=oe._export_sfc(Re,[["__scopeId","data-v-02b89b4b"]]),Oe={class:"panel-content"},Le="id",je={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:a=>["breadth","firstLevel"].includes(a)}},emits:["nodeClick"],setup(a,{emit:t}){const i=a,s=t,l=e.ref([]),_={children:"children",label:"label"},y=u=>{s("nodeClick",u)},r=(u,M=0)=>{const b=[];return Array.isArray(u)&&(u==null?void 0:u.length)>0&&u.forEach(n=>{if(!(n!=null&&n.isMesh)&&((n==null?void 0:n.type)==="URDFJoint"||(n==null?void 0:n.type)==="URDFLink")){const g={name:n==null?void 0:n.name,label:n==null?void 0:n.name,show:!0,level:M+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:r(n==null?void 0:n.children,M+1),path:n==null?void 0:n.name};b.push(g)}}),b},E=u=>u?[{name:u==null?void 0:u.name,label:u==null?void 0:u.name,show:!0,level:1,isPenultimate:!1,type:u==null?void 0:u.type,id:u==null?void 0:u.id,limit:(u==null?void 0:u.limit)??"",children:r(u==null?void 0:u.children,1),path:u==null?void 0:u.name}]:[],x=(u,M)=>{const b=[],n=[...u];for(;n.length>0&&b.length<M;){const g=n.shift();g.children&&g.children.length>0&&(b.push(g.id),n.push(...g.children))}return b},z=(u,M)=>{const b=[];return u.forEach(n=>{if(n.children&&n.children.length>0){b.push(n.id);const g=n.children.filter(w=>w.children&&w.children.length>0).slice(0,M).map(w=>w.id);b.push(...g)}}),b.slice(0,M+1)},L=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?z(l.value,i.maxExpandCount):x(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?E(i.model):[]);return e.watch(C,u=>{l.value=JSON.parse(JSON.stringify(u))},{immediate:!0}),(u,M)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(b,{data:l.value,props:_,"default-expanded-keys":L.value,"node-key":Le,onNodeClick:y},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(je,[["__scopeId","data-v-290ff4e1"]]),Ue={class:"panel-content"},Be={key:0,class:"joints-list"},Fe={class:"joint-info-row"},Ye={class:"joint-left"},Ze={class:"joint-name"},He={class:"joint-range"},Ke={class:"joint-type"},Xe={key:0,class:"joint-control-row"},$e={class:"slider-container"},Ge=["min","max","value","onInput","disabled"],Je={class:"value-display"},qe={class:"joint-value"},We={class:"unit"},Qe={key:1,class:"empty-state"},se=.001,et=1e3,ce=60,tt={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const i=a;e.ref(!0);const s=e.ref([]),l=e.ref(null),_=e.ref(12.5),y=e.ref(),r=e.ref(1302),E=e.ref(!1),x=e.ref(!1),z=e.ref(0),L=e.ref(0),C=e.ref(null),u=o.MathUtils.degToRad,M=e.ref(1),b=()=>et/ce/M.value;let n=[];e.watch(()=>i.animationData,m=>{var d;let v=((d=me.cloneDeep(m))==null?void 0:d.动画输出)??[];v&&v.length>0&&(n=v,Y())},{deep:!0});const g=e.computed(()=>n.length>0),w=(m,v=!1)=>m==="revolute"?v?Math.PI:-Math.PI:m==="prismatic"?v?1:-1:0,O=m=>{if(!m||!m.joints)return console.warn("URDF模型没有关节信息"),[];let v;const d=[];return Object.keys(m.joints).forEach(P=>{const p=m.joints[P];if(p._jointType==="fixed")return;const N=p.limit?{lower:p.limit.lower??w(p._jointType,!1),upper:p.limit.upper??w(p._jointType,!0)}:{lower:w(p._jointType,!1),upper:w(p._jointType,!0)};d.push({name:P,type:p._jointType||"unknown",limit:N,currentValue:p.angle||0,urdfJoint:p})}),m.traverse(P=>{var p;P.name==="Pipe_Link"&&!v&&((p=P.children)==null||p.forEach(N=>{N&&!v&&(v=N)}))}),v?(v.material=new o.MeshPhongMaterial({color:31743,shininess:80,side:o.DoubleSide}),y.value=v,d.sort((P,p)=>P.name.localeCompare(p.name))):!1},B=(m,v)=>{const d=s.value.find(p=>p.name===m);if(!d)return;const P=parseFloat(v);if(d.limit){const p=Math.max(d.limit.lower,Math.min(d.limit.upper,P));d.currentValue=p}else d.currentValue=P;i.model&&i.model.setJointValue?i.model.setJointValue(m,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},H=m=>m.reduce((v,d)=>{let P=0;const p=d.Y??0,N=d.C??0,D=d.R??0;return p>0&&(P+=p),N>0&&D>0&&(P+=D*u(N)),v+P},0),j=m=>{const v=[],d=m.Y??0,P=m.B??0,p=m.C??0,N=m.R??0,D={pos:new o.Vector3(0,0,0),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};if(!d&&!p)return v;if(v.push(D.pos.clone()),P!==0){const V=new o.Matrix4().makeRotationAxis(D.localY,u(P));D.localX.applyMatrix4(V),D.localZ.applyMatrix4(V)}if(d>0&&(D.pos.add(D.localY.clone().multiplyScalar(d*se)),v.push(D.pos.clone())),p>0&&N>0){const V=u(p),c=N*se,U=D.pos.clone().add(D.localX.clone().multiplyScalar(-c)),J=Math.max(16,Math.ceil(p/5));for(let $=1;$<=J;$++){const ee=V*$/J,Q=new o.Matrix4().makeRotationAxis(D.localZ,ee),Z=D.localX.clone().multiplyScalar(c).applyMatrix4(Q),q=U.clone().add(Z);v.push(q)}}return v},F=m=>{if(!y.value||!g.value)return;const v=n.slice(0,m+1),d=H(v),P=Math.max(0,r.value-d),p=[];p.push(new o.Vector3(0,0,0));const N=new o.Vector3(0,P*se,0);P>0&&p.push(N);let D={pos:N.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const V=[];for(let c=v.length-1;c>=0;c--){const U=v[c],J=j(U);if(J.length>0){const $=J.map(Z=>{const q=Z.clone(),te=new o.Matrix4;return te.makeBasis(D.localX,D.localY,D.localZ),q.applyMatrix4(te),q.add(D.pos)});V.push($);const ee=$[$.length-1];D.pos=ee.clone();const Q=U.B??0,k=U.C??0;if(Q!==0){const Z=new o.Matrix4().makeRotationAxis(D.localY,u(Q));D.localX.applyMatrix4(Z),D.localZ.applyMatrix4(Z)}if(k>0){const Z=u(k),q=new o.Matrix4().makeRotationAxis(D.localZ,Z);D.localY.applyMatrix4(q),D.localX.applyMatrix4(q)}}}for(const c of V)c.length>1&&p.push(...c.slice(1));p.length<2&&p.push(new o.Vector3(0,.001,0)),console.log(2321,p);try{const c=new o.CatmullRomCurve3(p,!1,"catmullrom",.01),U=new o.TubeGeometry(c,Math.max(2,p.length*4),_.value*se,18,!1);y.value.geometry.dispose(),y.value.geometry=U}catch(c){console.error("主管件更新失败",c)}},f=m=>{m&&Object.keys(m).forEach((v,d)=>{const P=m[v],p=s.value.find(N=>N.name===v);p&&(p.currentValue=P,i.model&&i.model.setJointValue?i.model.setJointValue(v,P):p.urdfJoint&&p.urdfJoint.setJointValue(P)),console.log(232,d),F(d)})},h=(m,v,d)=>m+(v-m)*d,S=(m,v,d)=>{if(!m||!v)return m||v;const P={};return Object.keys(m).forEach(p=>{const N=m[p],D=v[p];P[p]=h(N,D||N,d)}),P},Y=()=>{if(n.length===0){console.warn("没有动画数据");return}E.value=!0,x.value=!1;const m=()=>{if(!E.value||x.value)return;const v=L.value/ce,d=n[z.value],P=n[z.value+1];if(P){const p=S(d,P,v);f(p)}else f(d);if(L.value++,L.value>=ce&&(L.value=0,z.value++,z.value>=n.length-1)){A();return}C.value=setTimeout(m,b())};m()},K=()=>{x.value=!0,C.value&&(clearTimeout(C.value),C.value=null)},A=()=>{E.value=!1,x.value=!1,M.value=1,C.value&&(clearTimeout(C.value),C.value=null)};t({startAnimation:Y,pauseAnimation:K,stopAnimation:A,resetAll:()=>{A(),z.value=0,L.value=0,s.value.forEach(m=>{(m.type==="revolute"||m.type==="prismatic")&&B(m.name,0)})},fastForward:()=>{M.value<4&&(M.value=Math.min(4,M.value*2))},fastBackward:()=>{M.value>.25&&(M.value=Math.max(.25,M.value/2))}}),e.watch(()=>i.model,m=>{m?s.value=O(m):s.value=[]},{immediate:!0});const ae=()=>{!i.model||E.value&&!x.value||s.value.forEach(m=>{m.urdfJoint&&m.urdfJoint.angle!==void 0&&(m.currentValue=m.urdfJoint.angle)})},ie=()=>{const m=()=>{ae(),l.value=requestAnimationFrame(m)};m()},le=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{ie()}),e.onUnmounted(()=>{le(),A()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",Ue,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,d=>{var P,p,N,D;return e.openBlock(),e.createElementBlock("div",{key:d.name,class:"joint-item"},[e.createElementVNode("div",Fe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",Ze,e.toDisplayString(d.name),1),e.createElementVNode("span",He," ["+e.toDisplayString(((P=d.limit)==null?void 0:P.lower.toFixed(2))??(d.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((p=d.limit)==null?void 0:p.upper.toFixed(2))??(d.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Ke,e.toDisplayString(d.type),1)]),d.type==="revolute"||d.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",$e,[e.createElementVNode("input",{type:"range",min:((N=d.limit)==null?void 0:N.lower)??(d.type==="revolute"?-Math.PI:-1),max:((D=d.limit)==null?void 0:D.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:V=>B(d.name,V.target.value),class:"joint-slider",disabled:E.value&&!x.value},null,40,Ge)]),e.createElementVNode("div",Je,[e.createElementVNode("span",qe,e.toDisplayString(d.currentValue.toFixed(3)),1),e.createElementVNode("span",We,e.toDisplayString(d.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Qe,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},ot=oe._export_sfc(tt,[["__scopeId","data-v-4a616c58"]]),it=["xlink:href"],nt=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(a){const t=a,i=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>{const{size:_}=t;let y=`${_}`;return y=`${y.replace("px","")}px`,{width:y,height:y}});return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:_.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[_.$attrs.class,_.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),R=oe._export_sfc(nt,[["__scopeId","data-v-3150a90b"]]),st={class:"obj-viewer-container"},at={class:"buttonGroup-top"},lt={class:"buttonGroup-topLeft"},rt={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ht={class:"buttonGroup-bottom"},ut={class:"left-panel"},dt={class:"panel-header"},pt={key:1,class:"clipping-content"},mt={class:"radio-group"},ft={class:"radio-label"},_t={class:"radio-label"},gt={class:"radio-label"},yt={class:"radio-label"},vt={class:"right-panel"},bt={class:"panel-header"},wt={key:0,class:"loading-overlay"},Et={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(a,{expose:t,emit:i}){const s=i,l=a;let _=null,y=!1;const r=e.ref(null),E=e.ref(!1),x=e.ref("");e.ref(!1);const z=e.ref(!1),L=e.ref(!1),C=e.ref(""),u=e.ref(!1),M=e.ref(""),b=e.ref(),{currentModels:n,initialCameraPosition:g,initialTargetPosition:w,initThreeJS:O,handleResize:B,fitCameraToAllModels:H,getThreeJSObjects:j,clearAllModels:F,cleanup:f}=Te(r),{isAnimating:h,toggleAnimation:S,stopAnimation:Y}=Ce(j,n),{isClipping:K,activeClippingAxis:A,toggleClipping:G,updateClippingPlanes:W}=Ae(j,n),{addModelsFromUrls:ue,loadModelByDefaultPath:ae,urdfModel:ie}=o.useModelLoader(j,n,E,x,F),le=()=>{if(z.value||n.value.length===0)return;z.value=!0,h.value&&Y();const{camera:V,controls:c}=j();if(!V||!c)return;c.enabled=!0;const U=Z=>Z<.5?4*Z*Z*Z:1-Math.pow(-2*Z+2,3)/2,J=V.position.clone(),$=c.target.clone(),ee=1500,Q=Date.now(),k=()=>{const Z=Date.now()-Q,q=Math.min(Z/ee,1),te=U(q);V.position.lerpVectors(J,g.value,te),c.target.lerpVectors($,w.value,te),q<1?requestAnimationFrame(k):z.value=!1};k()},m=async()=>y?Promise.resolve():new Promise(V=>{const c=()=>{y?V():requestAnimationFrame(c)};c()}),v=async(V,c)=>{try{await m(),h.value&&Y(),K.value&&G();const U=await c(V);return H(),U}catch(U){throw console.error("加载模型失败:",U),U}},d=async V=>v(V,ue),P=async V=>v(V,ae),p=V=>{L.value=!0,C.value=V,V==="剖面视图"&&!K.value&&G()},N=V=>{u.value=!0,M.value=V},D=()=>{s("getAnimationData"),e.nextTick(()=>{var V;(V=b.value)==null||V.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{O(),_=j().scene,y=!0,window.addEventListener("resize",B)}catch(V){console.error("Three.js初始化失败:",V)}}),e.onBeforeUnmount(()=>{y=!1,C.value="",M.value="",window.removeEventListener("resize",B),h.value&&Y(),f()}),t({addModelsFromUrls:d,loadModelByDefaultPath:P}),(V,c)=>{var J,$,ee,Q;const U=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",at,[e.createVNode(R,{name:"guanjianjiexi",size:"34"}),e.createVNode(R,{name:"guanjiekongzhi",size:"34"}),e.createVNode(R,{name:"gongyishengcheng",size:"34"}),e.createVNode(R,{name:"buchangshezhi",size:"34"}),e.createVNode(R,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",lt,[e.createVNode(R,{name:"viewReset",size:"24",onClick:le,title:"重置"}),e.createVNode(R,{name:"fangda",size:"24",title:"放大"}),e.createVNode(R,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(R,{name:"lookAround",size:"24",onClick:e.unref(S),title:e.unref(h)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(R,{name:"jiegoushu",size:"24",onClick:c[0]||(c[0]=k=>p("场景树")),active:L.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(R,{name:"clipping",size:"24",onClick:c[1]||(c[1]=k=>p("剖面视图")),active:L.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[2]||(c[2]=k=>p("场景树3"))}),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[3]||(c[3]=k=>p("场景4"))})]),e.createElementVNode("div",ct,[e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"guanjiekongzhi",size:"24",onClick:c[4]||(c[4]=k=>N("关节控制")),active:u.value&&M.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(R,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:c[5]||(c[5]=k=>N("动画仿真")),active:u.value&&M.value==="动画仿真"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ht,[e.createVNode(R,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(J=b.value)==null?void 0:J.fastBackward},null,8,["onClick"]),e.createVNode(R,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:D}),e.createVNode(R,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:($=b.value)==null?void 0:$.fastForward},null,8,["onClick"]),e.createVNode(R,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(ee=b.value)==null?void 0:ee.pauseAnimation},null,8,["onClick"]),e.createVNode(R,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(Q=b.value)==null?void 0:Q.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createElementVNode("span",{class:"close",onClick:c[6]||(c[6]=k=>L.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(ie)},null,8,["model"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("label",ft,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":c[7]||(c[7]=k=>e.isRef(A)?A.value=k:null),onChange:c[8]||(c[8]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[16]||(c[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",_t,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":c[9]||(c[9]=k=>e.isRef(A)?A.value=k:null),onChange:c[10]||(c[10]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[17]||(c[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":c[11]||(c[11]=k=>e.isRef(A)?A.value=k:null),onChange:c[12]||(c[12]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[18]||(c[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":c[13]||(c[13]=k=>e.isRef(A)?A.value=k:null),onChange:c[14]||(c[14]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[19]||(c[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(M.value),1),e.createElementVNode("span",{class:"close",onClick:c[15]||(c[15]=k=>u.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ot,{ref_key:"jointRef",ref:b,model:e.unref(ie),scene:e.unref(_),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,M.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,M.value==="动画仿真"]])]),_:1})],512),[[e.vShow,u.value]]),E.value?(e.openBlock(),e.createElementBlock("div",wt,[c[20]||(c[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},Pt=oe._export_sfc(Et,[["__scopeId","data-v-14112288"]]);exports.default=Pt;
|