ss-component-new 1.1.607 → 1.1.608

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.
@@ -31,7 +31,7 @@ const i = s(() => import("./index-Z04SVHEk.js"));
31
31
  i.install = (o) => {
32
32
  o.component("ssAvatar", i);
33
33
  };
34
- const c = s(() => import("./threeModel-CGO5VFhW.js"));
34
+ const c = s(() => import("./threeModel-DTY2N9TB.js"));
35
35
  c.install = (o) => {
36
36
  o.component("ssThree", c);
37
37
  };
@@ -1 +1 @@
1
- "use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DB2epzvg.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-BhfNBV_Y.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-rTgVjPGa.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CEoanfoT.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BB7D-KhK.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-DGCcBd5v.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-uYHnI5wK.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-Df6NZqSR.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-D8E80dju.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;
1
+ "use strict";const o=require("vue-router"),t=[{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DB2epzvg.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CfJqgH7E.cjs")),children:[{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-rTgVjPGa.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CEoanfoT.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BB7D-KhK.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-DGCcBd5v.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-uYHnI5wK.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-Df6NZqSR.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-D8E80dju.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;
@@ -8,7 +8,7 @@ const a = [
8
8
  {
9
9
  path: "/",
10
10
  name: "Model",
11
- component: async () => import("./index-CV9GhHVQ.js"),
11
+ component: async () => import("./index-BgydVX0j.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'),
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-Cplpn8hS.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=require("./menu-1olc0mrV.cjs"),me={type:"change"},de={type:"start"},ge={type:"end"},se=new o.Ray,fe=new o.Plane,ye=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,H=2*Math.PI,S={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},he=1e-6;class ve extends o.Controls{constructor(t,i=null){super(t,i),this.state=S.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=we.bind(this),this._onPointerDown=be.bind(this),this._onPointerUp=Ee.bind(this),this._onContextMenu=Se.bind(this),this._onMouseWheel=xe.bind(this),this._onKeyDown=De.bind(this),this._onTouchStart=Ve.bind(this),this._onTouchMove=ke.bind(this),this._onMouseDown=Pe.bind(this),this._onMouseMove=Me.bind(this),this._interceptControlDown=Te.bind(this),this._interceptControlUp=Ce.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(me),this.update(),this.state=S.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===S.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,r=this.maxAzimuthAngle;isFinite(s)&&isFinite(r)&&(s<-Math.PI?s+=H:s>Math.PI&&(s-=H),r<-Math.PI?r+=H:r>Math.PI&&(r-=H),s<=r?this._spherical.theta=Math.max(s,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+r)/2?Math.max(s,this._spherical.theta):Math.min(r,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 m=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const b=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),m=b!=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 b=null;if(this.object.isPerspectiveCamera){const c=I.length();b=this._clampDistance(c*this._scale);const x=c-b;this.object.position.addScaledVector(this._dollyDirection,x),this.object.updateMatrixWorld(),m=!!x}else if(this.object.isOrthographicCamera){const c=new o.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object);const x=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),m=x!==this.object.zoom;const M=new o.Vector3(this._mouse.x,this._mouse.y,0);M.unproject(this.object),this.object.position.sub(M).add(c),this.object.updateMatrixWorld(),b=I.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;b!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(b).add(this.object.position):(se.origin.copy(this.object.position),se.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(se.direction))<ye?this.object.lookAt(this.target):(fe.setFromNormalAndCoplanarPoint(this.object.up,this.target),se.intersectPlane(fe,this.target))))}else if(this.object.isOrthographicCamera){const b=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),b!==this.object.zoom&&(this.object.updateProjectionMatrix(),m=!0)}return this._scale=1,this._performCursorZoom=!1,m||this._lastPosition.distanceToSquared(this.object.position)>he||8*(1-this._lastQuaternion.dot(this.object.quaternion))>he||this._lastTargetPosition.distanceToSquared(this.target)>he?(this.dispatchEvent(me),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?H/60*this.autoRotateSpeed*t:H/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 r=this.object.position;I.copy(r).sub(this.target);let m=I.length();m*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*m/s.clientHeight,this.object.matrix),this._panUp(2*i*m/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(),r=t-s.left,m=i-s.top,b=s.width,c=s.height;this._mouse.x=r/b*2-1,this._mouse.y=-(m/c)*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(H*this._rotateDelta.x/i.clientHeight),this._rotateUp(H*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(H*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(-H*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(H*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(-H*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),r=.5*(t.pageY+i.y);this._rotateStart.set(s,r)}}_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),r=.5*(t.pageY+i.y);this._panStart.set(s,r)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,r=t.pageY-i.y,m=Math.sqrt(s*s+r*r);this._dollyStart.set(0,m)}_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),r=.5*(t.pageX+s.x),m=.5*(t.pageY+s.y);this._rotateEnd.set(r,m)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(H*this._rotateDelta.x/i.clientHeight),this._rotateUp(H*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),r=.5*(t.pageY+i.y);this._panEnd.set(s,r)}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,r=t.pageY-i.y,m=Math.sqrt(s*s+r*r);this._dollyEnd.set(0,m),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 b=(t.pageX+i.x)*.5,c=(t.pageY+i.y)*.5;this._updateZoomParameters(b,c)}_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 be(l){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(l.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(l)&&(this._addPointer(l),l.pointerType==="touch"?this._onTouchStart(l):this._onMouseDown(l)))}function we(l){this.enabled!==!1&&(l.pointerType==="touch"?this._onTouchMove(l):this._onMouseMove(l))}function Ee(l){switch(this._removePointer(l),this._pointers.length){case 0:this.domElement.releasePointerCapture(l.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(ge),this.state=S.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 Pe(l){let t;switch(l.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(l),this.state=S.DOLLY;break;case o.MOUSE.ROTATE:if(l.ctrlKey||l.metaKey||l.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(l),this.state=S.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(l),this.state=S.ROTATE}break;case o.MOUSE.PAN:if(l.ctrlKey||l.metaKey||l.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(l),this.state=S.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(l),this.state=S.PAN}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(de)}function Me(l){switch(this.state){case S.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(l);break;case S.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(l);break;case S.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(l);break}}function xe(l){this.enabled===!1||this.enableZoom===!1||this.state!==S.NONE||(l.preventDefault(),this.dispatchEvent(de),this._handleMouseWheel(this._customWheelEvent(l)),this.dispatchEvent(ge))}function De(l){this.enabled!==!1&&this._handleKeyDown(l)}function Ve(l){switch(this._trackPointer(l),this._pointers.length){case 1:switch(this.touches.ONE){case o.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(l),this.state=S.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(l),this.state=S.TOUCH_PAN;break;default:this.state=S.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(l),this.state=S.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(l),this.state=S.TOUCH_DOLLY_ROTATE;break;default:this.state=S.NONE}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(de)}function ke(l){switch(this._trackPointer(l),this.state){case S.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(l),this.update();break;case S.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(l),this.update();break;case S.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(l),this.update();break;case S.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(l),this.update();break;default:this.state=S.NONE}}function Se(l){this.enabled!==!1&&l.preventDefault()}function Te(l){l.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ce(l){l.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Ae(l){let t=null,i=null,s=null,r=null,m=null,b=null,c=null,x=null;const M=e.ref([]),C=e.ref(new o.Vector3),N=e.ref(new o.Vector3),z=()=>{if(!l.value)return;t=new o.Scene,t.background=new o.Color(15790320);const _=l.value;i=new o.PerspectiveCamera(75,_.clientWidth/_.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(_.clientWidth,_.clientHeight),s.localClippingEnabled=!0,s.shadowMap.enabled=!0,s.shadowMap.type=o.PCFSoftShadowMap,s.toneMapping=o.ACESFilmicToneMapping,s.toneMappingExposure=1,s.outputColorSpace=o.SRGBColorSpace,_.appendChild(s.domElement),r=new ve(i,s.domElement),r.enableDamping=!0,r.dampingFactor=.05,r.mouseButtons={LEFT:null,MIDDLE:o.MOUSE.PAN,RIGHT:o.MOUSE.ROTATE},r.panSpeed=.7,m=new o.Xe(i,s,{container:_,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"}}),m.attachControls(r),y(),n()},d=(_,p)=>{c&&(t.remove(c),c.dispose()),x&&(t.remove(x),x.geometry.dispose(),x.material.dispose());const D=Math.min(Math.max(Math.floor(_/20),30),40);c=new o.GridHelper(_,D,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(p),t.add(c);const B=new o.PlaneGeometry(_,_),T=new o.ShadowMaterial({opacity:.3,color:0});x=new o.Mesh(B,T),x.position.copy(p),x.position.z-=.01,x.receiveShadow=!0,t.add(x)},V=()=>{if(M.value.length===0)return;const _=new o.Box3;let p=!1;if(M.value.forEach(K=>{if(K.userData.boundingBox)_.union(K.userData.boundingBox),p=!0;else if(K.userData.modelId&&modelBoundingBoxes.has(K.userData.modelId)){const J=modelBoundingBoxes.get(K.userData.modelId);_.union(J.box),p=!0}else _.expandByObject(K),p=!0}),!p){console.warn("无法计算包围盒,网格更新失败");return}const D=_.getSize(new o.Vector3),B=_.getCenter(new o.Vector3),T=Math.max(D.x,D.y,D.z),W=Math.max(T*8,50),O=new o.Vector3(B.x,B.y,_.min.z);d(W,O)},y=()=>{const _=new o.AmbientLight(4210752,.6);t.add(_);const p=new o.DirectionalLight(16777215,2);p.position.set(10,10,8),p.castShadow=!0,p.shadow.mapSize.width=4096,p.shadow.mapSize.height=4096,p.shadow.camera.near=.5,p.shadow.camera.far=50,p.shadow.camera.left=-50,p.shadow.camera.right=50,p.shadow.camera.top=50,p.shadow.camera.bottom=-50,t.add(p);const D=new o.DirectionalLight(16777215,.8);D.position.set(-8,-8,6),t.add(D);const B=new o.DirectionalLight(16777215,.6);B.position.set(0,-15,2),t.add(B);const T=new o.HemisphereLight(16777215,4473924,.8);t.add(T);const W=new o.PointLight(16777215,1,50);W.position.set(15,15,15),t.add(W);const O=new o.PointLight(16777215,.5,50);O.position.set(-15,-15,15),t.add(O)},n=()=>{b=requestAnimationFrame(n),r&&r.update(),s&&t&&i&&s.render(t,i),m&&m.render()},f=_=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(D=>{_[D]&&_[D].dispose&&_[D].dispose()}),_.dispose&&_.dispose()},E=_=>{_==null||_.traverse(p=>{p.geometry&&p.geometry.dispose(),p.material&&(Array.isArray(p.material)?p.material.forEach(D=>{f(D)}):f(p.material))})};return{currentModels:M,initialCameraPosition:C,initialTargetPosition:N,initThreeJS:z,handleResize:()=>{if(!l.value||!i||!s||!m)return;const _=l.value,p=_.clientWidth,D=_.clientHeight;i.aspect=p/D,i.updateProjectionMatrix(),s.setSize(p,D),m.update()},fitCameraToAllModels:_=>{if(!i||!r||M.value.length===0)return;const p=new o.Box3;let D=!1;if(M.value.forEach(J=>{if(J.userData.boundingBox)p.union(J.userData.boundingBox),D=!0;else if(J.userData.modelId&&_.has(J.userData.modelId)){const oe=_.get(J.userData.modelId);p.union(oe.box),D=!0}else p.expandByObject(J),D=!0}),!D){console.warn("无法计算包围盒");return}const B=p.getSize(new o.Vector3),T=p.getCenter(new o.Vector3),O=Math.max(B.x,B.y,B.z)*.8,K=new o.Vector3(T.x+O,T.y-O,T.z+O);i.position.copy(K),i.lookAt(T),r.target.copy(T),r.update(),C.value.copy(K),N.value.copy(T),V()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:r,gizmo:m}),clearAllModels:()=>{if(!t)return;M.value.forEach(p=>{t.remove(p),E(p)});const _=[];t.children.forEach(p=>{!p.isLight&&!p.isCamera&&p.type!=="GridHelper"&&p!==x&&_.push(p)}),_.forEach(p=>{t.remove(p),E(p)}),M.value=[],V()},cleanup:()=>{b&&cancelAnimationFrame(b),c&&c.dispose(),x&&(x.geometry.dispose(),x.material.dispose()),s&&s.dispose(),r&&r.dispose(),m&&m.dispose()},updateGridForModels:V}}function Ne(l,t){const i=e.ref(!1);let s=null,r=12700,m=new o.Vector3,b=new o.Vector3,c=new o.Vector3,x=0,M=null;const C=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,N=n=>{const f=new o.Vector3,E=x*1.2,R=new o.Vector3(c.x+E,c.y,c.z),Z=new o.Vector3(c.x,c.y+E,c.z),L=new o.Vector3(c.x,c.y-E,c.z);if(n<=.567){const Y=n/.567*Math.PI*2;f.x=c.x+Math.cos(Y)*E,f.z=c.z+Math.sin(Y)*E,f.y=c.y}else if(n<=.724){const F=(n-.567)/.157,Y=C(F);f.lerpVectors(R,Z,Y)}else if(n<=.881){const F=(n-.724)/.157,_=C(F)*Math.PI;f.x=c.x+Math.sin(_)*E,f.y=c.y+Math.cos(_)*E,f.z=c.z}else{const F=(n-.881)/.119,Y=C(F);f.lerpVectors(L,m,Y)}return f},z=()=>{const{camera:n,controls:f}=l();if(!n||!f)return;s||(s=Date.now());const E=Date.now()-s,R=Math.min(E/r,1);if(R>=1){V();return}const Z=N(R);n.position.copy(Z),n.lookAt(c),f.target.copy(c),M=requestAnimationFrame(z)},d=()=>{if(t.value.length===0)return;const{camera:n,controls:f}=l();if(!n||!f)return;m.copy(n.position),b.copy(f.target);const E=new o.Box3;t.value.forEach(p=>{E.expandByObject(p)});const R=E.getSize(new o.Vector3);c=E.getCenter(new o.Vector3),x=Math.max(R.x,R.y,R.z)*1.2;const Z=new o.Vector3(c.x+x*1.2,c.y,c.z);f.enabled=!1;const L=n.position.clone(),F=1e3,Y=Date.now(),_=()=>{const p=Date.now()-Y,D=Math.min(p/F,1),B=C(D);n.position.lerpVectors(L,Z,B),n.lookAt(c),f.target.copy(c),D<1?requestAnimationFrame(_):(i.value=!0,s=null,z())};_()},V=()=>{i.value=!1,s=null,M&&(cancelAnimationFrame(M),M=null);const{controls:n}=l();n&&(n.enabled=!0,n.target.copy(b))};return{isAnimating:i,toggleAnimation:()=>{if(i.value){i.value=!1,s=null,M&&(cancelAnimationFrame(M),M=null);const{camera:n,controls:f}=l();if(!n||!f)return;f.enabled=!0;const E=n.position.clone(),R=f.target.clone(),Z=1500,L=Date.now(),F=()=>{const Y=Date.now()-L,_=Math.min(Y/Z,1),p=C(_);n.position.lerpVectors(E,m,p),f.target.lerpVectors(R,b,p),_<1&&requestAnimationFrame(F)};F()}else d()},startAnimation:d,stopAnimation:V}}function Re(l,t){const i=e.ref(!1),s=e.ref("none");let r=[],m=[],b=new o.Box3,c=new o.Vector3;const x=()=>{r=[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)]},M=()=>{b.makeEmpty(),t.value.forEach(y=>{b.expandByObject(y)}),c=b.getCenter(new o.Vector3)},C=y=>{const n=b.getSize(new o.Vector3);let f,E,R;y==="x"?(f=new o.PlaneGeometry(n.z*1.2,n.y*1.2),E=new o.Vector3(c.x,c.y,c.z),R=new o.Euler(0,Math.PI/2,0)):y==="y"?(f=new o.PlaneGeometry(n.x*1.2,n.z*1.2),E=new o.Vector3(c.x,c.y,c.z),R=new o.Euler(Math.PI/2,0,0)):y==="z"&&(f=new o.PlaneGeometry(n.x*1.2,n.y*1.2),E=new o.Vector3(c.x,c.y,c.z),R=new o.Euler(0,0,0));const Z=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),L=new o.Mesh(f,Z);return L.position.copy(E),L.rotation.copy(R),L},N=()=>{if(z(),d(),s.value==="none")return;M();let y=null;if(s.value==="x"?(r[0].constant=-c.x,y=r[0]):s.value==="y"?(r[1].constant=-c.y,y=r[1]):s.value==="z"&&(r[2].constant=-c.z,y=r[2]),y){t.value.forEach(f=>{f.traverse(E=>{E.isMesh&&E.material&&(Array.isArray(E.material)?E.material.forEach(R=>{R.clippingPlanes=[y]}):E.material.clippingPlanes=[y])})});const{scene:n}=l();if(n){const f=C(s.value);n.add(f),m.push(f)}}},z=()=>{t.value.forEach(y=>{y.traverse(n=>{n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(f=>{f.clippingPlanes=[]}):n.material.clippingPlanes=[])})})},d=()=>{const{scene:y}=l();y&&m.forEach(n=>{y.remove(n),n.geometry.dispose(),n.material.dispose()}),m=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(x(),t.value.length>0&&M()):(s.value="none",z(),d())},updateClippingPlanes:N,clearClippingPlanes:z,clearClippingMeshes:d}}const ze={class:"panel-content"},Oe={__name:"animationTable",props:{animationData:Object,model:Object},setup(l){const t=l;e.ref();const i=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var r;let s=((r=_e.cloneDeep(t==null?void 0:t.animationData))==null?void 0:r.动画输出Content)??[];s&&(i.value=s)},{deep:!0,immediate:!0}),(s,r)=>{var m,b,c;return e.openBlock(),e.createElementBlock("div",ze,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(m=i.value)==null?void 0:m.compData,key:(b=i.value)==null?void 0:b.id,index:(c=i.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},Le=ne._export_sfc(Oe,[["__scopeId","data-v-02b89b4b"]]),je={class:"panel-content"},Ie="id",Be={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:l=>["breadth","firstLevel"].includes(l)}},emits:["nodeClick"],setup(l,{emit:t}){const i=l,s=t,r=e.ref([]),m={children:"children",label:"label"},b=d=>{s("nodeClick",d)},c=(d,V=0)=>{const y=[];return Array.isArray(d)&&(d==null?void 0:d.length)>0&&d.forEach(n=>{if(!(n!=null&&n.isMesh)&&((n==null?void 0:n.type)==="URDFJoint"||(n==null?void 0:n.type)==="URDFLink")){const f={name:n==null?void 0:n.name,label:n==null?void 0:n.name,show:!0,level:V+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:c(n==null?void 0:n.children,V+1),path:n==null?void 0:n.name};y.push(f)}}),y},x=d=>d?[{name:d==null?void 0:d.name,label:d==null?void 0:d.name,show:!0,level:1,isPenultimate:!1,type:d==null?void 0:d.type,id:d==null?void 0:d.id,limit:(d==null?void 0:d.limit)??"",children:c(d==null?void 0:d.children,1),path:d==null?void 0:d.name}]:[],M=(d,V)=>{const y=[],n=[...d];for(;n.length>0&&y.length<V;){const f=n.shift();f.children&&f.children.length>0&&(y.push(f.id),n.push(...f.children))}return y},C=(d,V)=>{const y=[];return d.forEach(n=>{if(n.children&&n.children.length>0){y.push(n.id);const f=n.children.filter(E=>E.children&&E.children.length>0).slice(0,V).map(E=>E.id);y.push(...f)}}),y.slice(0,V+1)},N=e.computed(()=>!r.value||r.value.length===0?[]:i.expandStrategy==="firstLevel"?C(r.value,i.maxExpandCount):M(r.value,i.maxExpandCount)),z=e.computed(()=>i!=null&&i.model?x(i.model):[]);return e.watch(z,d=>{r.value=JSON.parse(JSON.stringify(d))},{immediate:!0}),(d,V)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",je,[e.createVNode(y,{data:r.value,props:m,"default-expanded-keys":N.value,"node-key":Ie,onNodeClick:b},null,8,["data","default-expanded-keys"])])}}},Ue=ne._export_sfc(Be,[["__scopeId","data-v-fde9ea18"]]),Fe={key:0,class:"joints-list"},Ye={class:"joint-info-row"},Ze={class:"joint-left"},He={class:"joint-name"},Ke={class:"joint-range"},Xe={class:"joint-type"},$e={key:0,class:"joint-control-row"},Ge={class:"slider-container"},Je=["min","max","value","onInput","disabled"],qe={class:"value-display"},We={class:"joint-value"},Qe={class:"unit"},et={key:1,class:"empty-state"},ae=.001,tt=1e3,ue=60,ot={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(l,{expose:t}){const i=l;e.ref(!0);const s=e.ref([]),r=e.ref(null),m=e.ref(null),b=e.ref(12.5),c=e.ref(),x=e.ref(1302),M=e.ref(!1),C=e.ref(!1),N=e.ref(0),z=e.ref(0),d=e.ref(null),V=o.MathUtils.degToRad,y=e.ref(1),n=()=>tt/ue/y.value;let f=[];e.watch(()=>i.animationData,h=>{var u;console.log(111,h),x.value=h.extra.管长,b.value=h.extra.外径/2;let w=((u=_e.cloneDeep(h))==null?void 0:u.动画输出)??[];w&&w.length>0&&(f=w)},{deep:!0}),e.computed(()=>f.length>0);const E=(h,w=!1)=>h==="revolute"?w?Math.PI:-Math.PI:h==="prismatic"?w?1:-1:0,R=()=>{if(!r.value)return ElMessage.error("未加载 URDF"),!1;let h=null;return r.value.traverse(w=>{w.name==="Pipe_Link"&&!h&&w.traverse(u=>{u instanceof o.Mesh&&!h&&(h=u)})}),h?(c.value=h,h.material=new o.MeshPhongMaterial({color:11184810,shininess:80,side:o.DoubleSide}),!0):(ElMessage.error("Pipe_Link 内未找到 Mesh"),!1)},Z=h=>{if(!h||!h.joints)return console.warn("URDF模型没有关节信息"),[];let w=null;if(h.traverse(P=>{P.name==="Pipe_Link"&&!w&&(w=P)}),w)c.value=w;else return console.warn("未找到管子模型"),[];const u=[];return Object.keys(h.joints).forEach(P=>{const g=h.joints[P];if(g._jointType==="fixed")return;const v=g.limit?{lower:g.limit.lower??E(g._jointType,!1),upper:g.limit.upper??E(g._jointType,!0)}:{lower:E(g._jointType,!1),upper:E(g._jointType,!0)};u.push({name:P,type:g._jointType||"unknown",limit:v,currentValue:g.angle||0,urdfJoint:g})}),u.sort((P,g)=>P.name.localeCompare(g.name))},L=(h,w)=>{const u=s.value.find(g=>g.name===h);if(!u)return;const P=parseFloat(w);if(u.limit){const g=Math.max(u.limit.lower,Math.min(u.limit.upper,P));u.currentValue=g}else u.currentValue=P;i.model&&i.model.setJointValue?i.model.setJointValue(h,u.currentValue):u.urdfJoint&&u.urdfJoint.setJointValue(u.currentValue)},F=h=>h.reduce((w,u)=>{let P=0;const g=u.Y??0,v=u.C??0,a=u.R??0;return g>0&&(P+=g),v>0&&a>0&&(P+=a*V(v)),w+P},0),Y=h=>{const w=[],u=h.Y??0,P=h.B??0,g=h.C??0,v=h.R??0,a={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(!u&&!g)return w;if(w.push(a.pos.clone()),P!==0){const j=new o.Matrix4().makeRotationAxis(a.localY,V(P));a.localX.applyMatrix4(j),a.localZ.applyMatrix4(j)}if(u>0&&(a.pos.add(a.localY.clone().multiplyScalar(u*ae)),w.push(a.pos.clone())),g>0&&v>0){const j=V(g),U=v*ae,X=a.pos.clone().add(a.localX.clone().multiplyScalar(-U)),Q=Math.max(16,Math.ceil(g/5));for(let $=1;$<=Q;$++){const k=j*$/Q,G=new o.Matrix4().makeRotationAxis(a.localZ,k),q=a.localX.clone().multiplyScalar(U).applyMatrix4(G),ee=X.clone().add(q);w.push(ee)}}return w},_=h=>{const w=f.slice(0,h+1),u=F(w),P=Math.max(0,x.value-u),g=[];g.push(new o.Vector3(0,0,0));const v=new o.Vector3(0,P*ae,0);P>0&&g.push(v);let a={pos:v.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const j=[];for(let U=w.length-1;U>=0;U--){const X=w[U],Q=Y(X);if(Q.length>0){const $=Q.map(q=>{const ee=q.clone(),pe=new o.Matrix4;return pe.makeBasis(a.localX,a.localY,a.localZ),ee.applyMatrix4(pe),ee.add(a.pos)});j.push($);const k=$[$.length-1];a.pos=k.clone();const G=X.B??0,te=X.C??0;if(G!==0){const q=new o.Matrix4().makeRotationAxis(a.localY,V(G));a.localX.applyMatrix4(q),a.localZ.applyMatrix4(q)}if(te>0){const q=V(te),ee=new o.Matrix4().makeRotationAxis(a.localZ,q);a.localY.applyMatrix4(ee),a.localX.applyMatrix4(ee)}}}for(const U of j)U.length>1&&g.push(...U.slice(1));g.length<2&&g.push(new o.Vector3(0,.001,0));try{const U=new o.CatmullRomCurve3(g,!1,"catmullrom",.01),X=new o.TubeGeometry(U,Math.max(2,g.length*4),b.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=X}catch(U){console.error("管件更新失败",U)}},p=(h,w)=>{h&&(Object.keys(h).forEach(u=>{const P=h[u],g=s.value.find(v=>v.name===u);g&&(g.currentValue=P,i.model&&i.model.setJointValue?i.model.setJointValue(u,P):g.urdfJoint&&g.urdfJoint.setJointValue(P))}),_(w))},D=(h,w,u)=>h+(w-h)*u,B=(h,w,u)=>{if(!h||!w)return h||w;const P={};return Object.keys(h).forEach(g=>{const v=h[g],a=w[g];P[g]=D(v,a||v,u)}),P},T=()=>{if(f.length===0){console.warn("没有动画数据");return}R(),M.value=!0,C.value=!1;const h=()=>{if(!M.value||C.value)return;const w=z.value/ue,u=N.value,P=f[N.value],g=f[N.value+1];if(g){const v=B(P,g,w);p(v,u)}else p(P,u);if(z.value++,z.value>=ue&&(z.value=0,N.value++,N.value>=f.length-1)){O();return}d.value=setTimeout(h,n())};h()},W=()=>{C.value=!0,d.value&&(clearTimeout(d.value),d.value=null)},O=()=>{M.value=!1,C.value=!1,y.value=1,d.value&&(clearTimeout(d.value),d.value=null)};t({startAnimation:T,pauseAnimation:W,stopAnimation:O,resetAll:()=>{O(),N.value=0,z.value=0,s.value.forEach(h=>{(h.type==="revolute"||h.type==="prismatic")&&L(h.name,0)})},fastForward:()=>{y.value<4&&(y.value=Math.min(4,y.value*2))},fastBackward:()=>{y.value>.25&&(y.value=Math.max(.25,y.value/2))}}),e.watch(()=>i.model,h=>{h?(r.value=h,s.value=Z(h)):s.value=[]},{immediate:!0});const le=()=>{!i.model||M.value&&!C.value||s.value.forEach(h=>{h.urdfJoint&&h.urdfJoint.angle!==void 0&&(h.currentValue=h.urdfJoint.angle)})},re=()=>{const h=()=>{le(),m.value=requestAnimationFrame(h)};h()},ce=()=>{m.value&&(cancelAnimationFrame(m.value),m.value=null)},ie=e.ref(Date.now());return e.onMounted(()=>{re(),ie.value=Date.now()}),e.onUnmounted(()=>{ce(),O()}),(h,w)=>(e.openBlock(),e.createElementBlock("div",{class:"panel-content",key:ie.value},[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,u=>{var P,g,v,a;return e.openBlock(),e.createElementBlock("div",{key:u.name,class:"joint-item"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",He,e.toDisplayString(u.name),1),e.createElementVNode("span",Ke," ["+e.toDisplayString(((P=u.limit)==null?void 0:P.lower.toFixed(2))??(u.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((g=u.limit)==null?void 0:g.upper.toFixed(2))??(u.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Xe,e.toDisplayString(u.type),1)]),u.type==="revolute"||u.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("div",Ge,[e.createElementVNode("input",{type:"range",min:((v=u.limit)==null?void 0:v.lower)??(u.type==="revolute"?-Math.PI:-1),max:((a=u.limit)==null?void 0:a.upper)??(u.type==="revolute"?Math.PI:1),step:.01,value:u.currentValue,onInput:j=>L(u.name,j.target.value),class:"joint-slider",disabled:M.value&&!C.value},null,40,Je)]),e.createElementVNode("div",qe,[e.createElementVNode("span",We,e.toDisplayString(u.currentValue?Number(u.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Qe,e.toDisplayString(u.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",et,w[0]||(w[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},it=ne._export_sfc(ot,[["__scopeId","data-v-9a9fed3f"]]),nt=["xlink:href"],st=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(l){const t=l,i=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),r=e.computed(()=>{const{size:m}=t;let b=`${m}`;return b=`${b.replace("px","")}px`,{width:b,height:b}});return(m,b)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:m.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[m.$attrs.class,m.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(r.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,nt)],6))],6))}}),A=ne._export_sfc(st,[["__scopeId","data-v-53bfc052"]]),at={class:"obj-viewer-container"},lt={class:"buttonGroup-top"},rt={class:"buttonGroup-topLeft"},ct={class:"buttonGroup-left"},ht={class:"buttonGroup-right"},ut={class:"buttonGroup-bottom"},dt={class:"left-panel"},pt={class:"panel-header"},mt={key:1,class:"clipping-content"},ft={class:"radio-group"},_t={class:"radio-label"},gt={class:"radio-label"},yt={class:"radio-label"},vt={class:"radio-label"},bt={class:"right-panel"},wt={class:"panel-header"},Et={key:0,class:"loading-overlay"},Pt={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(l,{expose:t,emit:i}){const s=i;let r=null,m=!1;const b=e.ref(null),c=e.ref(!1),x=e.ref("");e.ref(!1);const M=e.ref(!1),C=e.ref(!1),N=e.ref(""),z=e.ref(!1),d=e.ref(""),V=e.ref(),{currentModels:y,initialCameraPosition:n,initialTargetPosition:f,initThreeJS:E,handleResize:R,fitCameraToAllModels:Z,getThreeJSObjects:L,clearAllModels:F,cleanup:Y}=Ae(b),{isAnimating:_,toggleAnimation:p,stopAnimation:D}=Ne(L,y),{isClipping:B,activeClippingAxis:T,toggleClipping:W,updateClippingPlanes:O}=Re(L,y),{addModelsFromUrls:K,loadModelByDefaultPath:J,urdfModel:oe,modelBoundingBoxes:le}=o.useModelLoader(L,y,c,x,F),re=()=>{if(M.value||y.value.length===0)return;M.value=!0,_.value&&D();const{camera:v,controls:a}=L();if(!v||!a)return;a.enabled=!0;const j=G=>G<.5?4*G*G*G:1-Math.pow(-2*G+2,3)/2,U=v.position.clone(),X=a.target.clone(),Q=1500,$=Date.now(),k=()=>{const G=Date.now()-$,te=Math.min(G/Q,1),q=j(te);v.position.lerpVectors(U,n.value,q),a.target.lerpVectors(X,f.value,q),te<1?requestAnimationFrame(k):M.value=!1};k()},ce=async()=>m?Promise.resolve():new Promise(v=>{const a=()=>{m?v():requestAnimationFrame(a)};a()}),ie=async(v,a)=>{try{await ce(),_.value&&D(),B.value&&W();const j=await a(v);return Z(le),j}catch(j){throw console.error("加载模型失败:",j),j}},h=async v=>ie(v,K),w=async v=>ie(v,J),u=v=>{C.value=!0,N.value=v,v==="剖面视图"&&!B.value&&W()},P=v=>{z.value=!0,d.value=v,v==="动画仿真"&&(s("getAnimationData"),console.log("获取动画数据"))},g=()=>{e.nextTick(()=>{var v;(v=V.value)==null||v.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{E(),r=L().scene,m=!0,window.addEventListener("resize",R)}catch(v){console.error("Three.js初始化失败:",v)}}),e.onBeforeUnmount(()=>{m=!1,N.value="",d.value="",window.removeEventListener("resize",R),_.value&&D(),Y()}),t({addModelsFromUrls:h,loadModelByDefaultPath:w}),(v,a)=>{var U,X,Q,$;const j=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",at,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:b,class:"threejs-container"},null,512),e.createElementVNode("div",lt,[e.createVNode(A,{name:"guanjianjiexi",size:"34"}),e.createVNode(A,{name:"guanjiekongzhi",size:"34"}),e.createVNode(A,{name:"gongyishengcheng",size:"34"}),e.createVNode(A,{name:"buchangshezhi",size:"34"}),e.createVNode(A,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",rt,[e.createVNode(A,{name:"viewReset",size:"24",onClick:re,title:"重置"}),e.createVNode(A,{name:"fangda",size:"24",title:"放大"}),e.createVNode(A,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(A,{name:"lookAround",size:"24",onClick:e.unref(p),title:e.unref(_)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",ct,[e.createVNode(A,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=k=>u("场景树")),active:C.value&&N.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(A,{name:"clipping",size:"24",onClick:a[1]||(a[1]=k=>u("剖面视图")),active:C.value&&N.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=k=>u("场景树3"))}),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=k=>u("场景4"))})]),e.createElementVNode("div",ht,[e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=k=>P("关节控制")),active:z.value&&d.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=k=>P("动画仿真")),active:z.value&&d.value==="动画仿真"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ut,[e.createVNode(A,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=V.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(A,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:g}),e.createVNode(A,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(X=V.value)==null?void 0:X.fastForward},null,8,["onClick"]),e.createVNode(A,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(Q=V.value)==null?void 0:Q.pauseAnimation},null,8,["onClick"]),e.createVNode(A,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:($=V.value)==null?void 0:$.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=k=>C.value=!1)}," X ")]),e.createVNode(j,{"max-height":"650px"},{default:e.withCtx(()=>[N.value==="场景树"?(e.openBlock(),e.createBlock(Ue,{key:0,model:e.unref(oe)},null,8,["model"])):e.createCommentVNode("",!0),N.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("div",ft,[e.createElementVNode("label",_t,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=k=>e.isRef(T)?T.value=k:null),onChange:a[8]||(a[8]=(...k)=>e.unref(O)&&e.unref(O)(...k))},null,544),[[e.vModelRadio,e.unref(T)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=k=>e.isRef(T)?T.value=k:null),onChange:a[10]||(a[10]=(...k)=>e.unref(O)&&e.unref(O)(...k))},null,544),[[e.vModelRadio,e.unref(T)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=k=>e.isRef(T)?T.value=k:null),onChange:a[12]||(a[12]=(...k)=>e.unref(O)&&e.unref(O)(...k))},null,544),[[e.vModelRadio,e.unref(T)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",vt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=k=>e.isRef(T)?T.value=k:null),onChange:a[14]||(a[14]=(...k)=>e.unref(O)&&e.unref(O)(...k))},null,544),[[e.vModelRadio,e.unref(T)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",bt,[e.createElementVNode("div",wt,[e.createElementVNode("span",null,e.toDisplayString(d.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=k=>z.value=!1)}," X ")]),e.createVNode(j,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(it,{ref_key:"jointRef",ref:V,model:e.unref(oe),scene:e.unref(r),animationData:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,d.value==="关节控制"]]),e.withDirectives(e.createVNode(Le,{animationData:l.animationData},null,8,["animationData"]),[[e.vShow,d.value==="动画仿真"]])]),_:1})],512),[[e.vShow,z.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Et,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},Mt=ne._export_sfc(Pt,[["__scopeId","data-v-24606bcb"]]);exports.default=Mt;