ss-component-new 1.1.573 → 1.1.574
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-CtTsLJ50.cjs → index-B3yZQmwY.cjs} +1 -1
- package/dist/{index-o2zYV6Ie.js → index-C-Fo1haM.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-CObKebbN.cjs → threeModel-BRtvSEdk.cjs} +1 -1
- package/dist/{threeModel-BzIk8lkl.js → threeModel-D9_s7S5l.js} +32 -32
- 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-D9_s7S5l.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-B3yZQmwY.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-C-Fo1haM.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 +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"},ce={type:"start"},fe={type:"end"},ie=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,K=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},le=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+=K:s>Math.PI&&(s-=K),l<-Math.PI?l+=K:l>Math.PI&&(l-=K),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 p=!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),p=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 P=r-y;this.object.position.addScaledVector(this._dollyDirection,P),this.object.updateMatrixWorld(),p=!!P}else if(this.object.isOrthographicCamera){const r=new o.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const P=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),p=P!==this.object.zoom;const V=new o.Vector3(this._mouse.x,this._mouse.y,0);V.unproject(this.object),this.object.position.sub(V).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):(ie.origin.copy(this.object.position),ie.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ie.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ie.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(),p=!0)}return this._scale=1,this._performCursorZoom=!1,p||this._lastPosition.distanceToSquared(this.object.position)>le||8*(1-this._lastQuaternion.dot(this.object.quaternion))>le||this._lastTargetPosition.distanceToSquared(this.target)>le?(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?K/60*this.autoRotateSpeed*t:K/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 p=I.length();p*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*p/s.clientHeight,this.object.matrix),this._panUp(2*i*p/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,p=i-s.top,y=s.width,r=s.height;this._mouse.x=l/y*2-1,this._mouse.y=-(p/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(K*this._rotateDelta.x/i.clientHeight),this._rotateUp(K*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(K*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(-K*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(K*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(-K*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,p=Math.sqrt(s*s+l*l);this._dollyStart.set(0,p)}_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),p=.5*(t.pageY+s.y);this._rotateEnd.set(l,p)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(K*this._rotateDelta.x/i.clientHeight),this._rotateUp(K*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,p=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,p),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(ce)}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(ce),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(ce)}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,p=null,y=null,r=null,P=null;const V=e.ref([]),R=e.ref(new o.Vector3),z=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const _=a.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),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,p=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"}}),p.attachControls(l),b(),n()},m=(_,c)=>{r&&(t.remove(r),r.dispose()),P&&(t.remove(P),P.geometry.dispose(),P.material.dispose());const S=Math.min(Math.max(Math.floor(_/20),30),40);r=new o.GridHelper(_,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(c),t.add(r);const B=new o.PlaneGeometry(_,_),X=new o.ShadowMaterial({opacity:.3,color:0});P=new o.Mesh(B,X),P.position.copy(c),P.position.z-=.01,P.receiveShadow=!0,t.add(P)},D=()=>{if(V.value.length===0)return;const _=new o.Box3;V.value.forEach(J=>{_.expandByObject(J)});const c=_.getSize(new o.Vector3),S=_.getCenter(new o.Vector3),B=Math.max(c.x,c.y,c.z),X=Math.max(B*8,50),j=new o.Vector3(S.x,S.y,_.min.z);m(X,j)},b=()=>{const _=new o.AmbientLight(4210752,.6);t.add(_);const c=new o.DirectionalLight(16777215,2);c.position.set(10,10,8),c.castShadow=!0,c.shadow.mapSize.width=4096,c.shadow.mapSize.height=4096,c.shadow.camera.near=.5,c.shadow.camera.far=50,c.shadow.camera.left=-50,c.shadow.camera.right=50,c.shadow.camera.top=50,c.shadow.camera.bottom=-50,t.add(c);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const B=new o.DirectionalLight(16777215,.6);B.position.set(0,-15,2),t.add(B);const X=new o.HemisphereLight(16777215,4473924,.8);t.add(X);const j=new o.PointLight(16777215,1,50);j.position.set(15,15,15),t.add(j);const J=new o.PointLight(16777215,.5,50);J.position.set(-15,-15,15),t.add(J)},n=()=>{y=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),p&&p.render()},g=_=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{_[S]&&_[S].dispose&&_[S].dispose()}),_.dispose&&_.dispose()},w=_=>{_==null||_.traverse(c=>{c.geometry&&c.geometry.dispose(),c.material&&(Array.isArray(c.material)?c.material.forEach(S=>{g(S)}):g(c.material))})};return{currentModels:V,initialCameraPosition:R,initialTargetPosition:z,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!p)return;const _=a.value,c=_.clientWidth,S=_.clientHeight;i.aspect=c/S,i.updateProjectionMatrix(),s.setSize(c,S),p.update()},fitCameraToAllModels:()=>{if(!i||!l||V.value.length===0)return;const _=new o.Box3;V.value.forEach(J=>{_.expandByObject(J)});const c=_.getSize(new o.Vector3),S=_.getCenter(new o.Vector3),X=Math.max(c.x,c.y,c.z)*.8,j=new o.Vector3(S.x+X,S.y-X,S.z+X);i.position.copy(j),i.lookAt(S),l.target.copy(S),l.update(),R.value.copy(j),z.value.copy(S),D()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:p}),clearAllModels:()=>{if(!t)return;V.value.forEach(c=>{t.remove(c),w(c)});const _=[];t.children.forEach(c=>{!c.isLight&&!c.isCamera&&c.type!=="GridHelper"&&c!==P&&_.push(c)}),_.forEach(c=>{t.remove(c),w(c)}),V.value=[],D()},cleanup:()=>{y&&cancelAnimationFrame(y),r&&r.dispose(),P&&(P.geometry.dispose(),P.material.dispose()),s&&s.dispose(),l&&l.dispose(),p&&p.dispose()},updateGridForModels:D}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,p=new o.Vector3,y=new o.Vector3,r=new o.Vector3,P=0,V=null;const R=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,z=n=>{const g=new o.Vector3,w=P*1.2,O=new o.Vector3(r.x+w,r.y,r.z),Y=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 L=(n-.567)/.157,F=R(L);g.lerpVectors(O,Y,F)}else if(n<=.881){const L=(n-.724)/.157,_=R(L)*Math.PI;g.x=r.x+Math.sin(_)*w,g.y=r.y+Math.cos(_)*w,g.z=r.z}else{const L=(n-.881)/.119,F=R(L);g.lerpVectors(H,p,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){D();return}const Y=z(O);n.position.copy(Y),n.lookAt(r),g.target.copy(r),V=requestAnimationFrame(C)},m=()=>{if(t.value.length===0)return;const{camera:n,controls:g}=a();if(!n||!g)return;p.copy(n.position),y.copy(g.target);const w=new o.Box3;t.value.forEach(c=>{w.expandByObject(c)});const O=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),P=Math.max(O.x,O.y,O.z)*1.2;const Y=new o.Vector3(r.x+P*1.2,r.y,r.z);g.enabled=!1;const H=n.position.clone(),L=1e3,F=Date.now(),_=()=>{const c=Date.now()-F,S=Math.min(c/L,1),B=R(S);n.position.lerpVectors(H,Y,B),n.lookAt(r),g.target.copy(r),S<1?requestAnimationFrame(_):(i.value=!0,s=null,C())};_()},D=()=>{i.value=!1,s=null,V&&(cancelAnimationFrame(V),V=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,V&&(cancelAnimationFrame(V),V=null);const{camera:n,controls:g}=a();if(!n||!g)return;g.enabled=!0;const w=n.position.clone(),O=g.target.clone(),Y=1500,H=Date.now(),L=()=>{const F=Date.now()-H,_=Math.min(F/Y,1),c=R(_);n.position.lerpVectors(w,p,c),g.target.lerpVectors(O,y,c),_<1&&requestAnimationFrame(L)};L()}else m()},startAnimation:m,stopAnimation:D}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],p=[],y=new o.Box3,r=new o.Vector3;const P=()=>{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)]},V=()=>{y.makeEmpty(),t.value.forEach(b=>{y.expandByObject(b)}),r=y.getCenter(new o.Vector3)},R=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 Y=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),H=new o.Mesh(g,Y);return H.position.copy(w),H.rotation.copy(O),H},z=()=>{if(C(),m(),s.value==="none")return;V();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=R(s.value);n.add(g),p.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=[])})})},m=()=>{const{scene:b}=a();b&&p.forEach(n=>{b.remove(n),n.geometry.dispose(),n.material.dispose()}),p=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(P(),t.value.length>0&&V()):(s.value="none",C(),m())},updateClippingPlanes:z,clearClippingPlanes:C,clearClippingMeshes:m}}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 p,y,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(p=i.value)==null?void 0:p.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([]),p={children:"children",label:"label"},y=m=>{s("nodeClick",m)},r=(m,D=0)=>{const b=[];return Array.isArray(m)&&(m==null?void 0:m.length)>0&&m.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:D+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,D+1),path:n==null?void 0:n.name};b.push(g)}}),b},P=m=>m?[{name:m==null?void 0:m.name,label:m==null?void 0:m.name,show:!0,level:1,isPenultimate:!1,type:m==null?void 0:m.type,id:m==null?void 0:m.id,limit:(m==null?void 0:m.limit)??"",children:r(m==null?void 0:m.children,1),path:m==null?void 0:m.name}]:[],V=(m,D)=>{const b=[],n=[...m];for(;n.length>0&&b.length<D;){const g=n.shift();g.children&&g.children.length>0&&(b.push(g.id),n.push(...g.children))}return b},R=(m,D)=>{const b=[];return m.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,D).map(w=>w.id);b.push(...g)}}),b.slice(0,D+1)},z=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?R(l.value,i.maxExpandCount):V(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?P(i.model):[]);return e.watch(C,m=>{l.value=JSON.parse(JSON.stringify(m))},{immediate:!0}),(m,D)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(b,{data:l.value,props:p,"default-expanded-keys":z.value,"node-key":Le,onNodeClick:y},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(je,[["__scopeId","data-v-290ff4e1"]]),Be={class:"panel-content"},Ue={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"},ne=.001,et=1e3,re=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),p=e.ref(),y=e.ref(729.2),r=e.ref(!1),P=e.ref(!1),V=e.ref(0),R=e.ref(0),z=e.ref(null),C=e.ref(1),m=()=>et/re/C.value;let D=[];e.watch(()=>i.animationData,u=>{var d;let v=((d=me.cloneDeep(u))==null?void 0:d.动画输出)??[];v&&v.length>0&&(D=v,c())},{deep:!0});const b=e.computed(()=>D.length>0),n=(u,v=!1)=>u==="revolute"?v?Math.PI:-Math.PI:u==="prismatic"?v?1:-1:0,g=u=>{if(!u||!u.joints)return console.warn("URDF模型没有关节信息"),[];let v;const d=[];return Object.keys(u.joints).forEach(E=>{const f=u.joints[E];if(f._jointType==="fixed")return;const A=f.limit?{lower:f.limit.lower??n(f._jointType,!1),upper:f.limit.upper??n(f._jointType,!0)}:{lower:n(f._jointType,!1),upper:n(f._jointType,!0)};d.push({name:E,type:f._jointType||"unknown",limit:A,currentValue:f.angle||0,urdfJoint:f})}),u.traverse(E=>{var f;console.log(2322,E),E.name==="Pipe_Link"&&!v&&((f=E.children)==null||f.forEach(A=>{console.log(2323,A),A instanceof o.Mesh&&!v&&(v=A)}))}),v?(console.log(2324,v),p.value=v,d.sort((E,f)=>E.name.localeCompare(f.name))):!1},w=(u,v)=>{const d=s.value.find(f=>f.name===u);if(!d)return;const E=parseFloat(v);if(d.limit){const f=Math.max(d.limit.lower,Math.min(d.limit.upper,E));d.currentValue=f}else d.currentValue=E;i.model&&i.model.setJointValue?i.model.setJointValue(u,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},O=u=>u.reduce((v,d)=>{let E=0;const f=d.Y??0,A=d.C??0,M=d.R??0;return f>0&&(E+=f),A>0&&M>0&&(E+=M*deg2rad(A)),v+E},0),Y=u=>{const v=[],d=u.Y??0,E=u.B??0,f=u.C??0,A=u.R??0,M={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&&!f)return v;if(v.push(M.pos.clone()),E!==0){const G=new o.Matrix4().makeRotationAxis(M.localY,deg2rad(E));M.localX.applyMatrix4(G),M.localZ.applyMatrix4(G)}if(d>0&&(M.pos.add(M.localY.clone().multiplyScalar(d*ne)),v.push(M.pos.clone())),f>0&&A>0){const G=deg2rad(f),Z=A*ne,k=M.pos.clone().add(M.localX.clone().multiplyScalar(-Z)),h=Math.max(16,Math.ceil(f/5));for(let U=1;U<=h;U++){const ee=G*U/h,Q=new o.Matrix4().makeRotationAxis(M.localZ,ee),$=M.localX.clone().multiplyScalar(Z).applyMatrix4(Q),x=k.clone().add($);v.push(x)}}return v},H=u=>{if(!p.value||!b.value)return;const v=D.slice(0,u+1),d=O(v),E=Math.max(0,y.value-d),f=[];f.push(new o.Vector3(0,0,0));const A=new o.Vector3(0,E*ne,0);E>0&&f.push(A);let M={pos:A.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const G=[];for(let Z=v.length-1;Z>=0;Z--){const k=v[Z],h=Y(k);if(h.length>0){const U=h.map($=>{const x=$.clone(),W=new o.Matrix4;return W.makeBasis(M.localX,M.localY,M.localZ),x.applyMatrix4(W),x.add(M.pos)});G.push(U);const ee=U[U.length-1];M.pos=ee.clone();const Q=k.B??0,te=k.C??0;if(Q!==0){const $=new o.Matrix4().makeRotationAxis(M.localY,deg2rad(Q));M.localX.applyMatrix4($),M.localZ.applyMatrix4($)}if(te>0){const $=deg2rad(te),x=new o.Matrix4().makeRotationAxis(M.localZ,$);M.localY.applyMatrix4(x),M.localX.applyMatrix4(x)}}}for(const Z of G)Z.length>1&&f.push(...Z.slice(1));f.length<2&&f.push(new o.Vector3(0,.001,0)),console.log(2321,f);try{const Z=new o.CatmullRomCurve3(f,!1,"catmullrom",.01),k=new o.TubeGeometry(Z,Math.max(2,f.length*4),pipeRadius.value*ne,18,!1);p.value.geometry.dispose(),p.value.geometry=k}catch(Z){console.error("主管件更新失败",Z)}},L=u=>{u&&Object.keys(u).forEach((v,d)=>{const E=u[v],f=s.value.find(A=>A.name===v);f&&(f.currentValue=E,i.model&&i.model.setJointValue?i.model.setJointValue(v,E):f.urdfJoint&&f.urdfJoint.setJointValue(E)),console.log(232,d),H(d)})},F=(u,v,d)=>u+(v-u)*d,_=(u,v,d)=>{if(!u||!v)return u||v;const E={};return Object.keys(u).forEach(f=>{const A=u[f],M=v[f];E[f]=F(A,M||A,d)}),E},c=()=>{if(D.length===0){console.warn("没有动画数据");return}r.value=!0,P.value=!1;const u=()=>{if(!r.value||P.value)return;const v=R.value/re,d=D[V.value],E=D[V.value+1];if(E){const f=_(d,E,v);L(f)}else L(d);if(R.value++,R.value>=re&&(R.value=0,V.value++,V.value>=D.length-1)){B();return}z.value=setTimeout(u,m())};u()},S=()=>{P.value=!0,z.value&&(clearTimeout(z.value),z.value=null)},B=()=>{r.value=!1,P.value=!1,C.value=1,z.value&&(clearTimeout(z.value),z.value=null)};t({startAnimation:c,pauseAnimation:S,stopAnimation:B,resetAll:()=>{B(),V.value=0,R.value=0,s.value.forEach(u=>{(u.type==="revolute"||u.type==="prismatic")&&w(u.name,0)})},fastForward:()=>{C.value<4&&(C.value=Math.min(4,C.value*2))},fastBackward:()=>{C.value>.25&&(C.value=Math.max(.25,C.value/2))}}),e.watch(()=>i.model,u=>{u?s.value=g(u):s.value=[]},{immediate:!0});const q=()=>{!i.model||r.value&&!P.value||s.value.forEach(u=>{u.urdfJoint&&u.urdfJoint.angle!==void 0&&(u.currentValue=u.urdfJoint.angle)})},se=()=>{const u=()=>{q(),l.value=requestAnimationFrame(u)};u()},ae=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{se()}),e.onUnmounted(()=>{ae(),B()}),(u,v)=>(e.openBlock(),e.createElementBlock("div",Be,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,d=>{var E,f,A,M;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(((E=d.limit)==null?void 0:E.lower.toFixed(2))??(d.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((f=d.limit)==null?void 0:f.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:((A=d.limit)==null?void 0:A.lower)??(d.type==="revolute"?-Math.PI:-1),max:((M=d.limit)==null?void 0:M.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:G=>w(d.name,G.target.value),class:"joint-slider",disabled:r.value&&!P.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-ec07720b"]]),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:p}=t;let y=`${p}`;return y=`${y.replace("px","")}px`,{width:y,height:y}});return(p,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:p.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[p.$attrs.class,p.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),N=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 p=null,y=!1;const r=e.ref(null),P=e.ref(!1),V=e.ref("");e.ref(!1);const R=e.ref(!1),z=e.ref(!1),C=e.ref(""),m=e.ref(!1),D=e.ref(""),b=e.ref(),{currentModels:n,initialCameraPosition:g,initialTargetPosition:w,initThreeJS:O,handleResize:Y,fitCameraToAllModels:H,getThreeJSObjects:L,clearAllModels:F,cleanup:_}=Te(r),{isAnimating:c,toggleAnimation:S,stopAnimation:B}=Ce(L,n),{isClipping:X,activeClippingAxis:j,toggleClipping:J,updateClippingPlanes:q}=Ae(L,n),{addModelsFromUrls:se,loadModelByDefaultPath:ae,urdfModel:u}=o.useModelLoader(L,n,P,V,F),v=()=>{if(R.value||n.value.length===0)return;R.value=!0,c.value&&B();const{camera:k,controls:h}=L();if(!k||!h)return;h.enabled=!0;const U=W=>W<.5?4*W*W*W:1-Math.pow(-2*W+2,3)/2,ee=k.position.clone(),Q=h.target.clone(),te=1500,$=Date.now(),x=()=>{const W=Date.now()-$,he=Math.min(W/te,1),ue=U(he);k.position.lerpVectors(ee,g.value,ue),h.target.lerpVectors(Q,w.value,ue),he<1?requestAnimationFrame(x):R.value=!1};x()},d=async()=>y?Promise.resolve():new Promise(k=>{const h=()=>{y?k():requestAnimationFrame(h)};h()}),E=async(k,h)=>{try{await d(),c.value&&B(),X.value&&J();const U=await h(k);return H(),U}catch(U){throw console.error("加载模型失败:",U),U}},f=async k=>E(k,se),A=async k=>E(k,ae),M=k=>{z.value=!0,C.value=k,k==="剖面视图"&&!X.value&&J()},G=k=>{m.value=!0,D.value=k},Z=()=>{s("getAnimationData"),e.nextTick(()=>{var k;(k=b.value)==null||k.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{O(),p=L().scene,y=!0,window.addEventListener("resize",Y)}catch(k){console.error("Three.js初始化失败:",k)}}),e.onBeforeUnmount(()=>{y=!1,C.value="",D.value="",window.removeEventListener("resize",Y),c.value&&B(),_()}),t({addModelsFromUrls:f,loadModelByDefaultPath:A}),(k,h)=>{var ee,Q,te,$;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(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",lt,[e.createVNode(N,{name:"viewReset",size:"24",onClick:v,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(S),title:e.unref(c)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:h[0]||(h[0]=x=>M("场景树")),active:z.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:h[1]||(h[1]=x=>M("剖面视图")),active:z.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[2]||(h[2]=x=>M("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[3]||(h[3]=x=>M("场景4"))})]),e.createElementVNode("div",ct,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:h[4]||(h[4]=x=>G("关节控制")),active:m.value&&D.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:h[5]||(h[5]=x=>G("动画仿真")),active:m.value&&D.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ht,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(ee=b.value)==null?void 0:ee.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Z}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(Q=b.value)==null?void 0:Q.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(te=b.value)==null?void 0:te.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:($=b.value)==null?void 0:$.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:h[6]||(h[6]=x=>z.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(u)},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":h[7]||(h[7]=x=>e.isRef(j)?j.value=x:null),onChange:h[8]||(h[8]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[16]||(h[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":h[9]||(h[9]=x=>e.isRef(j)?j.value=x:null),onChange:h[10]||(h[10]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[17]||(h[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":h[11]||(h[11]=x=>e.isRef(j)?j.value=x:null),onChange:h[12]||(h[12]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[18]||(h[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":h[13]||(h[13]=x=>e.isRef(j)?j.value=x:null),onChange:h[14]||(h[14]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,z.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(D.value),1),e.createElementVNode("span",{class:"close",onClick:h[15]||(h[15]=x=>m.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(u),scene:e.unref(p),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,D.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,D.value==="动画仿真"]])]),_:1})],512),[[e.vShow,m.value]]),P.value?(e.openBlock(),e.createElementBlock("div",wt,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(V.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"},ce={type:"start"},fe={type:"end"},ie=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,K=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},le=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+=K:s>Math.PI&&(s-=K),l<-Math.PI?l+=K:l>Math.PI&&(l-=K),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 p=!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),p=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 P=r-y;this.object.position.addScaledVector(this._dollyDirection,P),this.object.updateMatrixWorld(),p=!!P}else if(this.object.isOrthographicCamera){const r=new o.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const P=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),p=P!==this.object.zoom;const V=new o.Vector3(this._mouse.x,this._mouse.y,0);V.unproject(this.object),this.object.position.sub(V).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):(ie.origin.copy(this.object.position),ie.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ie.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ie.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(),p=!0)}return this._scale=1,this._performCursorZoom=!1,p||this._lastPosition.distanceToSquared(this.object.position)>le||8*(1-this._lastQuaternion.dot(this.object.quaternion))>le||this._lastTargetPosition.distanceToSquared(this.target)>le?(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?K/60*this.autoRotateSpeed*t:K/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 p=I.length();p*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*p/s.clientHeight,this.object.matrix),this._panUp(2*i*p/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,p=i-s.top,y=s.width,r=s.height;this._mouse.x=l/y*2-1,this._mouse.y=-(p/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(K*this._rotateDelta.x/i.clientHeight),this._rotateUp(K*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(K*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(-K*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(K*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(-K*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,p=Math.sqrt(s*s+l*l);this._dollyStart.set(0,p)}_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),p=.5*(t.pageY+s.y);this._rotateEnd.set(l,p)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(K*this._rotateDelta.x/i.clientHeight),this._rotateUp(K*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,p=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,p),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(ce)}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(ce),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(ce)}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,p=null,y=null,r=null,P=null;const V=e.ref([]),R=e.ref(new o.Vector3),z=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const _=a.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),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,p=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"}}),p.attachControls(l),b(),n()},m=(_,c)=>{r&&(t.remove(r),r.dispose()),P&&(t.remove(P),P.geometry.dispose(),P.material.dispose());const S=Math.min(Math.max(Math.floor(_/20),30),40);r=new o.GridHelper(_,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(c),t.add(r);const B=new o.PlaneGeometry(_,_),X=new o.ShadowMaterial({opacity:.3,color:0});P=new o.Mesh(B,X),P.position.copy(c),P.position.z-=.01,P.receiveShadow=!0,t.add(P)},D=()=>{if(V.value.length===0)return;const _=new o.Box3;V.value.forEach(J=>{_.expandByObject(J)});const c=_.getSize(new o.Vector3),S=_.getCenter(new o.Vector3),B=Math.max(c.x,c.y,c.z),X=Math.max(B*8,50),j=new o.Vector3(S.x,S.y,_.min.z);m(X,j)},b=()=>{const _=new o.AmbientLight(4210752,.6);t.add(_);const c=new o.DirectionalLight(16777215,2);c.position.set(10,10,8),c.castShadow=!0,c.shadow.mapSize.width=4096,c.shadow.mapSize.height=4096,c.shadow.camera.near=.5,c.shadow.camera.far=50,c.shadow.camera.left=-50,c.shadow.camera.right=50,c.shadow.camera.top=50,c.shadow.camera.bottom=-50,t.add(c);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const B=new o.DirectionalLight(16777215,.6);B.position.set(0,-15,2),t.add(B);const X=new o.HemisphereLight(16777215,4473924,.8);t.add(X);const j=new o.PointLight(16777215,1,50);j.position.set(15,15,15),t.add(j);const J=new o.PointLight(16777215,.5,50);J.position.set(-15,-15,15),t.add(J)},n=()=>{y=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),p&&p.render()},g=_=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{_[S]&&_[S].dispose&&_[S].dispose()}),_.dispose&&_.dispose()},w=_=>{_==null||_.traverse(c=>{c.geometry&&c.geometry.dispose(),c.material&&(Array.isArray(c.material)?c.material.forEach(S=>{g(S)}):g(c.material))})};return{currentModels:V,initialCameraPosition:R,initialTargetPosition:z,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!p)return;const _=a.value,c=_.clientWidth,S=_.clientHeight;i.aspect=c/S,i.updateProjectionMatrix(),s.setSize(c,S),p.update()},fitCameraToAllModels:()=>{if(!i||!l||V.value.length===0)return;const _=new o.Box3;V.value.forEach(J=>{_.expandByObject(J)});const c=_.getSize(new o.Vector3),S=_.getCenter(new o.Vector3),X=Math.max(c.x,c.y,c.z)*.8,j=new o.Vector3(S.x+X,S.y-X,S.z+X);i.position.copy(j),i.lookAt(S),l.target.copy(S),l.update(),R.value.copy(j),z.value.copy(S),D()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:p}),clearAllModels:()=>{if(!t)return;V.value.forEach(c=>{t.remove(c),w(c)});const _=[];t.children.forEach(c=>{!c.isLight&&!c.isCamera&&c.type!=="GridHelper"&&c!==P&&_.push(c)}),_.forEach(c=>{t.remove(c),w(c)}),V.value=[],D()},cleanup:()=>{y&&cancelAnimationFrame(y),r&&r.dispose(),P&&(P.geometry.dispose(),P.material.dispose()),s&&s.dispose(),l&&l.dispose(),p&&p.dispose()},updateGridForModels:D}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,p=new o.Vector3,y=new o.Vector3,r=new o.Vector3,P=0,V=null;const R=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,z=n=>{const g=new o.Vector3,w=P*1.2,O=new o.Vector3(r.x+w,r.y,r.z),Y=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 L=(n-.567)/.157,F=R(L);g.lerpVectors(O,Y,F)}else if(n<=.881){const L=(n-.724)/.157,_=R(L)*Math.PI;g.x=r.x+Math.sin(_)*w,g.y=r.y+Math.cos(_)*w,g.z=r.z}else{const L=(n-.881)/.119,F=R(L);g.lerpVectors(H,p,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){D();return}const Y=z(O);n.position.copy(Y),n.lookAt(r),g.target.copy(r),V=requestAnimationFrame(C)},m=()=>{if(t.value.length===0)return;const{camera:n,controls:g}=a();if(!n||!g)return;p.copy(n.position),y.copy(g.target);const w=new o.Box3;t.value.forEach(c=>{w.expandByObject(c)});const O=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),P=Math.max(O.x,O.y,O.z)*1.2;const Y=new o.Vector3(r.x+P*1.2,r.y,r.z);g.enabled=!1;const H=n.position.clone(),L=1e3,F=Date.now(),_=()=>{const c=Date.now()-F,S=Math.min(c/L,1),B=R(S);n.position.lerpVectors(H,Y,B),n.lookAt(r),g.target.copy(r),S<1?requestAnimationFrame(_):(i.value=!0,s=null,C())};_()},D=()=>{i.value=!1,s=null,V&&(cancelAnimationFrame(V),V=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,V&&(cancelAnimationFrame(V),V=null);const{camera:n,controls:g}=a();if(!n||!g)return;g.enabled=!0;const w=n.position.clone(),O=g.target.clone(),Y=1500,H=Date.now(),L=()=>{const F=Date.now()-H,_=Math.min(F/Y,1),c=R(_);n.position.lerpVectors(w,p,c),g.target.lerpVectors(O,y,c),_<1&&requestAnimationFrame(L)};L()}else m()},startAnimation:m,stopAnimation:D}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],p=[],y=new o.Box3,r=new o.Vector3;const P=()=>{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)]},V=()=>{y.makeEmpty(),t.value.forEach(b=>{y.expandByObject(b)}),r=y.getCenter(new o.Vector3)},R=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 Y=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),H=new o.Mesh(g,Y);return H.position.copy(w),H.rotation.copy(O),H},z=()=>{if(C(),m(),s.value==="none")return;V();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=R(s.value);n.add(g),p.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=[])})})},m=()=>{const{scene:b}=a();b&&p.forEach(n=>{b.remove(n),n.geometry.dispose(),n.material.dispose()}),p=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(P(),t.value.length>0&&V()):(s.value="none",C(),m())},updateClippingPlanes:z,clearClippingPlanes:C,clearClippingMeshes:m}}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 p,y,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(p=i.value)==null?void 0:p.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([]),p={children:"children",label:"label"},y=m=>{s("nodeClick",m)},r=(m,D=0)=>{const b=[];return Array.isArray(m)&&(m==null?void 0:m.length)>0&&m.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:D+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,D+1),path:n==null?void 0:n.name};b.push(g)}}),b},P=m=>m?[{name:m==null?void 0:m.name,label:m==null?void 0:m.name,show:!0,level:1,isPenultimate:!1,type:m==null?void 0:m.type,id:m==null?void 0:m.id,limit:(m==null?void 0:m.limit)??"",children:r(m==null?void 0:m.children,1),path:m==null?void 0:m.name}]:[],V=(m,D)=>{const b=[],n=[...m];for(;n.length>0&&b.length<D;){const g=n.shift();g.children&&g.children.length>0&&(b.push(g.id),n.push(...g.children))}return b},R=(m,D)=>{const b=[];return m.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,D).map(w=>w.id);b.push(...g)}}),b.slice(0,D+1)},z=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?R(l.value,i.maxExpandCount):V(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?P(i.model):[]);return e.watch(C,m=>{l.value=JSON.parse(JSON.stringify(m))},{immediate:!0}),(m,D)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(b,{data:l.value,props:p,"default-expanded-keys":z.value,"node-key":Le,onNodeClick:y},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(je,[["__scopeId","data-v-290ff4e1"]]),Be={class:"panel-content"},Ue={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"},ne=.001,et=1e3,re=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),p=e.ref(),y=e.ref(729.2),r=e.ref(!1),P=e.ref(!1),V=e.ref(0),R=e.ref(0),z=e.ref(null),C=e.ref(1),m=()=>et/re/C.value;let D=[];e.watch(()=>i.animationData,u=>{var d;let v=((d=me.cloneDeep(u))==null?void 0:d.动画输出)??[];v&&v.length>0&&(D=v,c())},{deep:!0});const b=e.computed(()=>D.length>0),n=(u,v=!1)=>u==="revolute"?v?Math.PI:-Math.PI:u==="prismatic"?v?1:-1:0,g=u=>{if(!u||!u.joints)return console.warn("URDF模型没有关节信息"),[];let v;const d=[];return Object.keys(u.joints).forEach(E=>{const f=u.joints[E];if(f._jointType==="fixed")return;const A=f.limit?{lower:f.limit.lower??n(f._jointType,!1),upper:f.limit.upper??n(f._jointType,!0)}:{lower:n(f._jointType,!1),upper:n(f._jointType,!0)};d.push({name:E,type:f._jointType||"unknown",limit:A,currentValue:f.angle||0,urdfJoint:f})}),u.traverse(E=>{var f;console.log(2322,E),E.name==="Pipe_Link"&&!v&&((f=E.children)==null||f.forEach(A=>{console.log(2323,A),A&&!v&&(v=A)}))}),v?(console.log(2324,v),p.value=v,d.sort((E,f)=>E.name.localeCompare(f.name))):!1},w=(u,v)=>{const d=s.value.find(f=>f.name===u);if(!d)return;const E=parseFloat(v);if(d.limit){const f=Math.max(d.limit.lower,Math.min(d.limit.upper,E));d.currentValue=f}else d.currentValue=E;i.model&&i.model.setJointValue?i.model.setJointValue(u,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},O=u=>u.reduce((v,d)=>{let E=0;const f=d.Y??0,A=d.C??0,M=d.R??0;return f>0&&(E+=f),A>0&&M>0&&(E+=M*deg2rad(A)),v+E},0),Y=u=>{const v=[],d=u.Y??0,E=u.B??0,f=u.C??0,A=u.R??0,M={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&&!f)return v;if(v.push(M.pos.clone()),E!==0){const G=new o.Matrix4().makeRotationAxis(M.localY,deg2rad(E));M.localX.applyMatrix4(G),M.localZ.applyMatrix4(G)}if(d>0&&(M.pos.add(M.localY.clone().multiplyScalar(d*ne)),v.push(M.pos.clone())),f>0&&A>0){const G=deg2rad(f),Z=A*ne,k=M.pos.clone().add(M.localX.clone().multiplyScalar(-Z)),h=Math.max(16,Math.ceil(f/5));for(let U=1;U<=h;U++){const ee=G*U/h,Q=new o.Matrix4().makeRotationAxis(M.localZ,ee),$=M.localX.clone().multiplyScalar(Z).applyMatrix4(Q),x=k.clone().add($);v.push(x)}}return v},H=u=>{if(!p.value||!b.value)return;const v=D.slice(0,u+1),d=O(v),E=Math.max(0,y.value-d),f=[];f.push(new o.Vector3(0,0,0));const A=new o.Vector3(0,E*ne,0);E>0&&f.push(A);let M={pos:A.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const G=[];for(let Z=v.length-1;Z>=0;Z--){const k=v[Z],h=Y(k);if(h.length>0){const U=h.map($=>{const x=$.clone(),W=new o.Matrix4;return W.makeBasis(M.localX,M.localY,M.localZ),x.applyMatrix4(W),x.add(M.pos)});G.push(U);const ee=U[U.length-1];M.pos=ee.clone();const Q=k.B??0,te=k.C??0;if(Q!==0){const $=new o.Matrix4().makeRotationAxis(M.localY,deg2rad(Q));M.localX.applyMatrix4($),M.localZ.applyMatrix4($)}if(te>0){const $=deg2rad(te),x=new o.Matrix4().makeRotationAxis(M.localZ,$);M.localY.applyMatrix4(x),M.localX.applyMatrix4(x)}}}for(const Z of G)Z.length>1&&f.push(...Z.slice(1));f.length<2&&f.push(new o.Vector3(0,.001,0)),console.log(2321,f);try{const Z=new o.CatmullRomCurve3(f,!1,"catmullrom",.01),k=new o.TubeGeometry(Z,Math.max(2,f.length*4),pipeRadius.value*ne,18,!1);p.value.geometry.dispose(),p.value.geometry=k}catch(Z){console.error("主管件更新失败",Z)}},L=u=>{u&&Object.keys(u).forEach((v,d)=>{const E=u[v],f=s.value.find(A=>A.name===v);f&&(f.currentValue=E,i.model&&i.model.setJointValue?i.model.setJointValue(v,E):f.urdfJoint&&f.urdfJoint.setJointValue(E)),console.log(232,d),H(d)})},F=(u,v,d)=>u+(v-u)*d,_=(u,v,d)=>{if(!u||!v)return u||v;const E={};return Object.keys(u).forEach(f=>{const A=u[f],M=v[f];E[f]=F(A,M||A,d)}),E},c=()=>{if(D.length===0){console.warn("没有动画数据");return}r.value=!0,P.value=!1;const u=()=>{if(!r.value||P.value)return;const v=R.value/re,d=D[V.value],E=D[V.value+1];if(E){const f=_(d,E,v);L(f)}else L(d);if(R.value++,R.value>=re&&(R.value=0,V.value++,V.value>=D.length-1)){B();return}z.value=setTimeout(u,m())};u()},S=()=>{P.value=!0,z.value&&(clearTimeout(z.value),z.value=null)},B=()=>{r.value=!1,P.value=!1,C.value=1,z.value&&(clearTimeout(z.value),z.value=null)};t({startAnimation:c,pauseAnimation:S,stopAnimation:B,resetAll:()=>{B(),V.value=0,R.value=0,s.value.forEach(u=>{(u.type==="revolute"||u.type==="prismatic")&&w(u.name,0)})},fastForward:()=>{C.value<4&&(C.value=Math.min(4,C.value*2))},fastBackward:()=>{C.value>.25&&(C.value=Math.max(.25,C.value/2))}}),e.watch(()=>i.model,u=>{u?s.value=g(u):s.value=[]},{immediate:!0});const q=()=>{!i.model||r.value&&!P.value||s.value.forEach(u=>{u.urdfJoint&&u.urdfJoint.angle!==void 0&&(u.currentValue=u.urdfJoint.angle)})},se=()=>{const u=()=>{q(),l.value=requestAnimationFrame(u)};u()},ae=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{se()}),e.onUnmounted(()=>{ae(),B()}),(u,v)=>(e.openBlock(),e.createElementBlock("div",Be,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,d=>{var E,f,A,M;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(((E=d.limit)==null?void 0:E.lower.toFixed(2))??(d.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((f=d.limit)==null?void 0:f.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:((A=d.limit)==null?void 0:A.lower)??(d.type==="revolute"?-Math.PI:-1),max:((M=d.limit)==null?void 0:M.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:G=>w(d.name,G.target.value),class:"joint-slider",disabled:r.value&&!P.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-9fbcb301"]]),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:p}=t;let y=`${p}`;return y=`${y.replace("px","")}px`,{width:y,height:y}});return(p,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:p.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[p.$attrs.class,p.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),N=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 p=null,y=!1;const r=e.ref(null),P=e.ref(!1),V=e.ref("");e.ref(!1);const R=e.ref(!1),z=e.ref(!1),C=e.ref(""),m=e.ref(!1),D=e.ref(""),b=e.ref(),{currentModels:n,initialCameraPosition:g,initialTargetPosition:w,initThreeJS:O,handleResize:Y,fitCameraToAllModels:H,getThreeJSObjects:L,clearAllModels:F,cleanup:_}=Te(r),{isAnimating:c,toggleAnimation:S,stopAnimation:B}=Ce(L,n),{isClipping:X,activeClippingAxis:j,toggleClipping:J,updateClippingPlanes:q}=Ae(L,n),{addModelsFromUrls:se,loadModelByDefaultPath:ae,urdfModel:u}=o.useModelLoader(L,n,P,V,F),v=()=>{if(R.value||n.value.length===0)return;R.value=!0,c.value&&B();const{camera:k,controls:h}=L();if(!k||!h)return;h.enabled=!0;const U=W=>W<.5?4*W*W*W:1-Math.pow(-2*W+2,3)/2,ee=k.position.clone(),Q=h.target.clone(),te=1500,$=Date.now(),x=()=>{const W=Date.now()-$,he=Math.min(W/te,1),ue=U(he);k.position.lerpVectors(ee,g.value,ue),h.target.lerpVectors(Q,w.value,ue),he<1?requestAnimationFrame(x):R.value=!1};x()},d=async()=>y?Promise.resolve():new Promise(k=>{const h=()=>{y?k():requestAnimationFrame(h)};h()}),E=async(k,h)=>{try{await d(),c.value&&B(),X.value&&J();const U=await h(k);return H(),U}catch(U){throw console.error("加载模型失败:",U),U}},f=async k=>E(k,se),A=async k=>E(k,ae),M=k=>{z.value=!0,C.value=k,k==="剖面视图"&&!X.value&&J()},G=k=>{m.value=!0,D.value=k},Z=()=>{s("getAnimationData"),e.nextTick(()=>{var k;(k=b.value)==null||k.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{O(),p=L().scene,y=!0,window.addEventListener("resize",Y)}catch(k){console.error("Three.js初始化失败:",k)}}),e.onBeforeUnmount(()=>{y=!1,C.value="",D.value="",window.removeEventListener("resize",Y),c.value&&B(),_()}),t({addModelsFromUrls:f,loadModelByDefaultPath:A}),(k,h)=>{var ee,Q,te,$;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(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",lt,[e.createVNode(N,{name:"viewReset",size:"24",onClick:v,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(S),title:e.unref(c)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:h[0]||(h[0]=x=>M("场景树")),active:z.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:h[1]||(h[1]=x=>M("剖面视图")),active:z.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[2]||(h[2]=x=>M("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[3]||(h[3]=x=>M("场景4"))})]),e.createElementVNode("div",ct,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:h[4]||(h[4]=x=>G("关节控制")),active:m.value&&D.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:h[5]||(h[5]=x=>G("动画仿真")),active:m.value&&D.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ht,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(ee=b.value)==null?void 0:ee.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Z}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(Q=b.value)==null?void 0:Q.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(te=b.value)==null?void 0:te.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:($=b.value)==null?void 0:$.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:h[6]||(h[6]=x=>z.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(u)},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":h[7]||(h[7]=x=>e.isRef(j)?j.value=x:null),onChange:h[8]||(h[8]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[16]||(h[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":h[9]||(h[9]=x=>e.isRef(j)?j.value=x:null),onChange:h[10]||(h[10]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[17]||(h[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":h[11]||(h[11]=x=>e.isRef(j)?j.value=x:null),onChange:h[12]||(h[12]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[18]||(h[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":h[13]||(h[13]=x=>e.isRef(j)?j.value=x:null),onChange:h[14]||(h[14]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(j)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,z.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(D.value),1),e.createElementVNode("span",{class:"close",onClick:h[15]||(h[15]=x=>m.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(u),scene:e.unref(p),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,D.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,D.value==="动画仿真"]])]),_:1})],512),[[e.vShow,m.value]]),P.value?(e.openBlock(),e.createElementBlock("div",wt,[h[20]||(h[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(V.value),1)])):e.createCommentVNode("",!0)])}}},Pt=oe._export_sfc(Et,[["__scopeId","data-v-14112288"]]);exports.default=Pt;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as k, watch as Mt, createElementBlock as Q, openBlock as $, createBlock as
|
|
2
|
-
import { C as te, V as _, M as ht, T as ut, Q as
|
|
1
|
+
import { ref as k, watch as Mt, createElementBlock as Q, openBlock as $, createBlock as Zt, computed as pt, resolveComponent as Ht, createVNode as A, onMounted as Kt, onUnmounted as Gt, Fragment as Jt, renderList as Wt, createElementVNode as b, createCommentVNode as bt, toDisplayString as nt, defineComponent as qt, normalizeStyle as Lt, normalizeClass as Ot, nextTick as jt, onBeforeUnmount as Qt, withDirectives as ct, unref as H, withCtx as It, isRef as ft, vModelRadio as _t, vShow as gt } from "vue";
|
|
2
|
+
import { C as te, V as _, M as ht, T as ut, Q as Ft, D as Nt, E as et, R as ee, P as wt, F as se, G as xt, H as ie, J as oe, K as ae, W as ne, L as le, N as re, O as ce, X as he, U as ue, Y as Pt, Z as pe, _ as Xt, $ as de, a0 as Tt, a1 as me, a2 as Yt, a3 as fe, a4 as _e, a5 as Ct, 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
4
|
import { c as Bt } from "./menu-Qw1eGtzq.js";
|
|
5
|
-
const
|
|
5
|
+
const Ut = { type: "change" }, At = { type: "start" }, $t = { type: "end" }, yt = new ee(), Vt = new wt(), we = Math.cos(70 * se.DEG2RAD), U = new _(), J = 2 * Math.PI, z = {
|
|
6
6
|
NONE: -1,
|
|
7
7
|
ROTATE: 0,
|
|
8
8
|
DOLLY: 1,
|
|
@@ -20,7 +20,7 @@ class Pe extends te {
|
|
|
20
20
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
21
21
|
*/
|
|
22
22
|
constructor(t, e = null) {
|
|
23
|
-
super(t, e), this.state = z.NONE, this.target = new _(), this.cursor = new _(), 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 = 0.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: ht.ROTATE, MIDDLE: ht.DOLLY, RIGHT: ht.PAN }, this.touches = { ONE: ut.ROTATE, TWO: ut.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new _(), this._lastQuaternion = new
|
|
23
|
+
super(t, e), this.state = z.NONE, this.target = new _(), this.cursor = new _(), 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 = 0.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: ht.ROTATE, MIDDLE: ht.DOLLY, RIGHT: ht.PAN }, this.touches = { ONE: ut.ROTATE, TWO: ut.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new _(), this._lastQuaternion = new Ft(), this._lastTargetPosition = new _(), this._quat = new Ft().setFromUnitVectors(t.up, new _(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Nt(), this._sphericalDelta = new Nt(), this._scale = 1, this._panOffset = new _(), this._rotateStart = new et(), this._rotateEnd = new et(), this._rotateDelta = new et(), this._panStart = new et(), this._panEnd = new et(), this._panDelta = new et(), this._dollyStart = new et(), this._dollyEnd = new et(), this._dollyDelta = new et(), this._dollyDirection = new _(), this._mouse = new et(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = xe.bind(this), this._onPointerDown = Me.bind(this), this._onPointerUp = Ee.bind(this), this._onContextMenu = ze.bind(this), this._onMouseWheel = Ce.bind(this), this._onKeyDown = Se.bind(this), this._onTouchStart = ke.bind(this), this._onTouchMove = Ae.bind(this), this._onMouseDown = De.bind(this), this._onMouseMove = Te.bind(this), this._interceptControlDown = Re.bind(this), this._interceptControlUp = Le.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
24
24
|
}
|
|
25
25
|
connect(t) {
|
|
26
26
|
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";
|
|
@@ -81,7 +81,7 @@ class Pe extends te {
|
|
|
81
81
|
* was called, or the initial state.
|
|
82
82
|
*/
|
|
83
83
|
reset() {
|
|
84
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
84
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ut), this.update(), this.state = z.NONE;
|
|
85
85
|
}
|
|
86
86
|
update(t = null) {
|
|
87
87
|
const e = this.object.position;
|
|
@@ -111,12 +111,12 @@ class Pe extends te {
|
|
|
111
111
|
T.unproject(this.object), this.object.position.sub(T).add(n), this.object.updateMatrixWorld(), g = U.length();
|
|
112
112
|
} else
|
|
113
113
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
114
|
-
g !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(g).add(this.object.position) : (yt.origin.copy(this.object.position), yt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(yt.direction)) < we ? this.object.lookAt(this.target) : (
|
|
114
|
+
g !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(g).add(this.object.position) : (yt.origin.copy(this.object.position), yt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(yt.direction)) < we ? this.object.lookAt(this.target) : (Vt.setFromNormalAndCoplanarPoint(this.object.up, this.target), yt.intersectPlane(Vt, this.target))));
|
|
115
115
|
} else if (this.object.isOrthographicCamera) {
|
|
116
116
|
const g = this.object.zoom;
|
|
117
117
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), g !== this.object.zoom && (this.object.updateProjectionMatrix(), u = !0);
|
|
118
118
|
}
|
|
119
|
-
return this._scale = 1, this._performCursorZoom = !1, u || this._lastPosition.distanceToSquared(this.object.position) > St || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > St || this._lastTargetPosition.distanceToSquared(this.target) > St ? (this.dispatchEvent(
|
|
119
|
+
return this._scale = 1, this._performCursorZoom = !1, u || this._lastPosition.distanceToSquared(this.object.position) > St || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > St || this._lastTargetPosition.distanceToSquared(this.target) > St ? (this.dispatchEvent(Ut), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
120
120
|
}
|
|
121
121
|
_getAutoRotationAngle(t) {
|
|
122
122
|
return t !== null ? J / 60 * this.autoRotateSpeed * t : J / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -366,7 +366,7 @@ function De(o) {
|
|
|
366
366
|
default:
|
|
367
367
|
this.state = z.NONE;
|
|
368
368
|
}
|
|
369
|
-
this.state !== z.NONE && this.dispatchEvent(
|
|
369
|
+
this.state !== z.NONE && this.dispatchEvent(At);
|
|
370
370
|
}
|
|
371
371
|
function Te(o) {
|
|
372
372
|
switch (this.state) {
|
|
@@ -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 !== z.NONE || (o.preventDefault(), this.dispatchEvent(
|
|
388
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== z.NONE || (o.preventDefault(), this.dispatchEvent(At), this._handleMouseWheel(this._customWheelEvent(o)), this.dispatchEvent($t));
|
|
389
389
|
}
|
|
390
390
|
function Se(o) {
|
|
391
391
|
this.enabled !== !1 && this._handleKeyDown(o);
|
|
@@ -423,7 +423,7 @@ function ke(o) {
|
|
|
423
423
|
default:
|
|
424
424
|
this.state = z.NONE;
|
|
425
425
|
}
|
|
426
|
-
this.state !== z.NONE && this.dispatchEvent(
|
|
426
|
+
this.state !== z.NONE && this.dispatchEvent(At);
|
|
427
427
|
}
|
|
428
428
|
function Ae(o) {
|
|
429
429
|
switch (this._trackPointer(o), this.state) {
|
|
@@ -509,7 +509,7 @@ function Oe(o) {
|
|
|
509
509
|
// 阴影透明度
|
|
510
510
|
color: 0
|
|
511
511
|
});
|
|
512
|
-
M = new
|
|
512
|
+
M = new Xt(V, W), M.position.copy(l), M.position.z -= 0.01, M.receiveShadow = !0, t.add(M);
|
|
513
513
|
}, D = () => {
|
|
514
514
|
if (T.value.length === 0)
|
|
515
515
|
return;
|
|
@@ -535,9 +535,9 @@ function Oe(o) {
|
|
|
535
535
|
V.position.set(0, -15, 2), t.add(V);
|
|
536
536
|
const W = new me(16777215, 4473924, 0.8);
|
|
537
537
|
t.add(W);
|
|
538
|
-
const Y = new
|
|
538
|
+
const Y = new Yt(16777215, 1, 50);
|
|
539
539
|
Y.position.set(15, 15, 15), t.add(Y);
|
|
540
|
-
const st = new
|
|
540
|
+
const st = new Yt(16777215, 0.5, 50);
|
|
541
541
|
st.position.set(-15, -15, 15), t.add(st);
|
|
542
542
|
}, s = () => {
|
|
543
543
|
g = requestAnimationFrame(s), a && a.update(), i && t && e && i.render(t, e), u && u.render();
|
|
@@ -709,7 +709,7 @@ function Ie(o, t) {
|
|
|
709
709
|
opacity: 0.3,
|
|
710
710
|
side: _e,
|
|
711
711
|
depthWrite: !1
|
|
712
|
-
}), G = new
|
|
712
|
+
}), G = new Xt(f, X);
|
|
713
713
|
return G.position.copy(w), G.rotation.copy(F), G;
|
|
714
714
|
}, I = () => {
|
|
715
715
|
if (R(), p(), i.value === "none")
|
|
@@ -776,7 +776,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
776
776
|
), (i, a) => {
|
|
777
777
|
var u, g, n;
|
|
778
778
|
return $(), Q("div", Fe, [
|
|
779
|
-
($(),
|
|
779
|
+
($(), Zt(ge, {
|
|
780
780
|
itemData: (u = e.value) == null ? void 0 : u.compData,
|
|
781
781
|
key: (g = e.value) == null ? void 0 : g.id,
|
|
782
782
|
index: (n = e.value) == null ? void 0 : n.id,
|
|
@@ -860,7 +860,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
860
860
|
},
|
|
861
861
|
{ immediate: !0 }
|
|
862
862
|
), (p, D) => {
|
|
863
|
-
const v =
|
|
863
|
+
const v = Ht("el-tree");
|
|
864
864
|
return $(), Q("div", Ue, [
|
|
865
865
|
A(v, {
|
|
866
866
|
data: a.value,
|
|
@@ -928,7 +928,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
928
928
|
}), c.traverse((P) => {
|
|
929
929
|
var d;
|
|
930
930
|
console.log(2322, P), P.name === "Pipe_Link" && !y && ((d = P.children) == null || d.forEach((L) => {
|
|
931
|
-
console.log(2323, L), L
|
|
931
|
+
console.log(2323, L), L && !y && (y = L);
|
|
932
932
|
}));
|
|
933
933
|
}), y ? (console.log(2324, y), u.value = y, h.sort((P, d) => P.name.localeCompare(d.name))) : !1;
|
|
934
934
|
}, w = (c, y) => {
|
|
@@ -1090,7 +1090,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1090
1090
|
}, Dt = () => {
|
|
1091
1091
|
a.value && (cancelAnimationFrame(a.value), a.value = null);
|
|
1092
1092
|
};
|
|
1093
|
-
return
|
|
1093
|
+
return Kt(() => {
|
|
1094
1094
|
Et();
|
|
1095
1095
|
}), Gt(() => {
|
|
1096
1096
|
Dt(), V();
|
|
@@ -1134,7 +1134,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1134
1134
|
])))
|
|
1135
1135
|
]));
|
|
1136
1136
|
}
|
|
1137
|
-
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-
|
|
1137
|
+
}, ls = /* @__PURE__ */ mt(ns, [["__scopeId", "data-v-9fbcb301"]]), rs = ["xlink:href"], cs = /* @__PURE__ */ qt({
|
|
1138
1138
|
__name: "svgIcon",
|
|
1139
1139
|
props: {
|
|
1140
1140
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1158,12 +1158,12 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1158
1158
|
};
|
|
1159
1159
|
});
|
|
1160
1160
|
return (u, g) => ($(), Q("div", {
|
|
1161
|
-
class:
|
|
1162
|
-
style:
|
|
1161
|
+
class: Ot(["container", { active: u.active }]),
|
|
1162
|
+
style: Lt(e.value)
|
|
1163
1163
|
}, [
|
|
1164
1164
|
($(), Q("svg", {
|
|
1165
|
-
class:
|
|
1166
|
-
style:
|
|
1165
|
+
class: Ot(["svg-icon", [u.$attrs.class, u.spin && "svg-icon-spin"]]),
|
|
1166
|
+
style: Lt(a.value),
|
|
1167
1167
|
"aria-hidden": "true"
|
|
1168
1168
|
}, [
|
|
1169
1169
|
b("use", { "xlink:href": i.value }, null, 8, rs)
|
|
@@ -1217,8 +1217,8 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1217
1217
|
if (!S || !r) return;
|
|
1218
1218
|
r.enabled = !0;
|
|
1219
1219
|
const Z = (ot) => ot < 0.5 ? 4 * ot * ot * ot : 1 - Math.pow(-2 * ot + 2, 3) / 2, lt = S.position.clone(), at = r.target.clone(), rt = 1500, q = Date.now(), E = () => {
|
|
1220
|
-
const ot = Date.now() - q,
|
|
1221
|
-
S.position.lerpVectors(lt, f.value,
|
|
1220
|
+
const ot = Date.now() - q, zt = Math.min(ot / rt, 1), Rt = Z(zt);
|
|
1221
|
+
S.position.lerpVectors(lt, f.value, Rt), r.target.lerpVectors(at, w.value, Rt), zt < 1 ? requestAnimationFrame(E) : j.value = !1;
|
|
1222
1222
|
};
|
|
1223
1223
|
E();
|
|
1224
1224
|
}, h = async () => g ? Promise.resolve() : new Promise((S) => {
|
|
@@ -1239,13 +1239,13 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1239
1239
|
}, tt = (S) => {
|
|
1240
1240
|
p.value = !0, D.value = S;
|
|
1241
1241
|
}, B = () => {
|
|
1242
|
-
i("getAnimationData"),
|
|
1242
|
+
i("getAnimationData"), jt(() => {
|
|
1243
1243
|
var S;
|
|
1244
1244
|
(S = v.value) == null || S.startAnimation();
|
|
1245
1245
|
});
|
|
1246
1246
|
};
|
|
1247
|
-
return
|
|
1248
|
-
await
|
|
1247
|
+
return Kt(async () => {
|
|
1248
|
+
await jt();
|
|
1249
1249
|
try {
|
|
1250
1250
|
F(), u = N().scene, g = !0, window.addEventListener("resize", X);
|
|
1251
1251
|
} catch (S) {
|
|
@@ -1258,7 +1258,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1258
1258
|
loadModelByDefaultPath: L
|
|
1259
1259
|
}), (S, r) => {
|
|
1260
1260
|
var lt, at, rt, q;
|
|
1261
|
-
const Z =
|
|
1261
|
+
const Z = Ht("el-scrollbar");
|
|
1262
1262
|
return $(), Q("div", hs, [
|
|
1263
1263
|
b("div", {
|
|
1264
1264
|
ref_key: "threejsContainer",
|
|
@@ -1415,8 +1415,8 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1415
1415
|
}, " X ")
|
|
1416
1416
|
]),
|
|
1417
1417
|
A(Z, { "max-height": "650px" }, {
|
|
1418
|
-
default:
|
|
1419
|
-
R.value === "场景树" ? ($(),
|
|
1418
|
+
default: It(() => [
|
|
1419
|
+
R.value === "场景树" ? ($(), Zt(He, {
|
|
1420
1420
|
key: 0,
|
|
1421
1421
|
model: H(c)
|
|
1422
1422
|
}, null, 8, ["model"])) : bt("", !0),
|
|
@@ -1487,7 +1487,7 @@ const Fe = { class: "panel-content" }, Ne = {
|
|
|
1487
1487
|
}, " X ")
|
|
1488
1488
|
]),
|
|
1489
1489
|
A(Z, { "max-height": "650px" }, {
|
|
1490
|
-
default:
|
|
1490
|
+
default: It(() => [
|
|
1491
1491
|
ct(A(ls, {
|
|
1492
1492
|
ref_key: "jointRef",
|
|
1493
1493
|
ref: v,
|