ss-component-new 1.1.575 → 1.1.577

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.
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CNq0IT-6.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./menu-DYsWoy6Z.cjs"),de={type:"change"},he={type:"start"},fe={type:"end"},ne=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,X=2*Math.PI,T={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},re=1e-6;class ge extends o.Controls{constructor(t,i=null){super(t,i),this.state=T.NONE,this.target=new o.Vector3,this.cursor=new o.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.touches={ONE:o.TOUCH.ROTATE,TWO:o.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new o.Vector3,this._lastQuaternion=new o.Quaternion,this._lastTargetPosition=new o.Vector3,this._quat=new o.Quaternion().setFromUnitVectors(t.up,new o.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new o.Spherical,this._sphericalDelta=new o.Spherical,this._scale=1,this._panOffset=new o.Vector3,this._rotateStart=new o.Vector2,this._rotateEnd=new o.Vector2,this._rotateDelta=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._panDelta=new o.Vector2,this._dollyStart=new o.Vector2,this._dollyEnd=new o.Vector2,this._dollyDelta=new o.Vector2,this._dollyDirection=new o.Vector3,this._mouse=new o.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=ve.bind(this),this._onPointerDown=ye.bind(this),this._onPointerUp=be.bind(this),this._onContextMenu=Ve.bind(this),this._onMouseWheel=Pe.bind(this),this._onKeyDown=Me.bind(this),this._onTouchStart=xe.bind(this),this._onTouchMove=De.bind(this),this._onMouseDown=we.bind(this),this._onMouseMove=Ee.bind(this),this._interceptControlDown=Se.bind(this),this._interceptControlUp=ke.bind(this),this.domElement!==null&&this.connect(this.domElement),this.update()}connect(t){super.connect(t),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointercancel",this._onPointerUp),this.domElement.addEventListener("contextmenu",this._onContextMenu),this.domElement.addEventListener("wheel",this._onMouseWheel,{passive:!1}),this.domElement.getRootNode().addEventListener("keydown",this._interceptControlDown,{passive:!0,capture:!0}),this.domElement.style.touchAction="none"}disconnect(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.domElement.removeEventListener("pointercancel",this._onPointerUp),this.domElement.removeEventListener("wheel",this._onMouseWheel),this.domElement.removeEventListener("contextmenu",this._onContextMenu),this.stopListenToKeyEvents(),this.domElement.getRootNode().removeEventListener("keydown",this._interceptControlDown,{capture:!0}),this.domElement.style.touchAction="auto"}dispose(){this.disconnect()}getPolarAngle(){return this._spherical.phi}getAzimuthalAngle(){return this._spherical.theta}getDistance(){return this.object.position.distanceTo(this.target)}listenToKeyEvents(t){t.addEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=t}stopListenToKeyEvents(){this._domElementKeyEvents!==null&&(this._domElementKeyEvents.removeEventListener("keydown",this._onKeyDown),this._domElementKeyEvents=null)}saveState(){this.target0.copy(this.target),this.position0.copy(this.object.position),this.zoom0=this.object.zoom}reset(){this.target.copy(this.target0),this.object.position.copy(this.position0),this.object.zoom=this.zoom0,this.object.updateProjectionMatrix(),this.dispatchEvent(de),this.update(),this.state=T.NONE}update(t=null){const i=this.object.position;I.copy(i).sub(this.target),I.applyQuaternion(this._quat),this._spherical.setFromVector3(I),this.autoRotate&&this.state===T.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=X:s>Math.PI&&(s-=X),l<-Math.PI?l+=X:l>Math.PI&&(l-=X),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let _=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const y=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),_=y!=this._spherical.radius}if(I.setFromSpherical(this._spherical),I.applyQuaternion(this._quatInverse),i.copy(this.target).add(I),this.object.lookAt(this.target),this.enableDamping===!0?(this._sphericalDelta.theta*=1-this.dampingFactor,this._sphericalDelta.phi*=1-this.dampingFactor,this._panOffset.multiplyScalar(1-this.dampingFactor)):(this._sphericalDelta.set(0,0,0),this._panOffset.set(0,0,0)),this.zoomToCursor&&this._performCursorZoom){let y=null;if(this.object.isPerspectiveCamera){const r=I.length();y=this._clampDistance(r*this._scale);const E=r-y;this.object.position.addScaledVector(this._dollyDirection,E),this.object.updateMatrixWorld(),_=!!E}else if(this.object.isOrthographicCamera){const r=new o.Vector3(this._mouse.x,this._mouse.y,0);r.unproject(this.object);const E=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),_=E!==this.object.zoom;const x=new o.Vector3(this._mouse.x,this._mouse.y,0);x.unproject(this.object),this.object.position.sub(x).add(r),this.object.updateMatrixWorld(),y=I.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;y!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(y).add(this.object.position):(ne.origin.copy(this.object.position),ne.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ne.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ne.intersectPlane(pe,this.target))))}else if(this.object.isOrthographicCamera){const y=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),y!==this.object.zoom&&(this.object.updateProjectionMatrix(),_=!0)}return this._scale=1,this._performCursorZoom=!1,_||this._lastPosition.distanceToSquared(this.object.position)>re||8*(1-this._lastQuaternion.dot(this.object.quaternion))>re||this._lastTargetPosition.distanceToSquared(this.target)>re?(this.dispatchEvent(de),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?X/60*this.autoRotateSpeed*t:X/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){I.setFromMatrixColumn(i,0),I.multiplyScalar(-t),this._panOffset.add(I)}_panUp(t,i){this.screenSpacePanning===!0?I.setFromMatrixColumn(i,1):(I.setFromMatrixColumn(i,0),I.crossVectors(this.object.up,I)),I.multiplyScalar(t),this._panOffset.add(I)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;I.copy(l).sub(this.target);let _=I.length();_*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*_/s.clientHeight,this.object.matrix),this._panUp(2*i*_/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,_=i-s.top,y=s.width,r=s.height;this._mouse.x=l/y*2-1,this._mouse.y=-(_/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyStart.set(0,_)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),_=.5*(t.pageY+s.y);this._rotateEnd.set(l,_)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,_),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const y=(t.pageX+i.x)*.5,r=(t.pageY+i.y)*.5;this._updateZoomParameters(y,r)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId){this._pointers.splice(i,1);return}}_isTrackingPointer(t){for(let i=0;i<this._pointers.length;i++)if(this._pointers[i]==t.pointerId)return!0;return!1}_trackPointer(t){let i=this._pointerPositions[t.pointerId];i===void 0&&(i=new o.Vector2,this._pointerPositions[t.pointerId]=i),i.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const i=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[i]}_customWheelEvent(t){const i=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(i){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function ye(a){this.enabled!==!1&&(this._pointers.length===0&&(this.domElement.setPointerCapture(a.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.domElement.addEventListener("pointerup",this._onPointerUp)),!this._isTrackingPointer(a)&&(this._addPointer(a),a.pointerType==="touch"?this._onTouchStart(a):this._onMouseDown(a)))}function ve(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function be(a){switch(this._removePointer(a),this._pointers.length){case 0:this.domElement.releasePointerCapture(a.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.dispatchEvent(fe),this.state=T.NONE;break;case 1:const t=this._pointers[0],i=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:i.x,pageY:i.y});break}}function we(a){let t;switch(a.button){case 0:t=this.mouseButtons.LEFT;break;case 1:t=this.mouseButtons.MIDDLE;break;case 2:t=this.mouseButtons.RIGHT;break;default:t=-1}switch(t){case o.MOUSE.DOLLY:if(this.enableZoom===!1)return;this._handleMouseDownDolly(a),this.state=T.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=T.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=T.PAN}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function Ee(a){switch(this.state){case T.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case T.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case T.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Pe(a){this.enabled===!1||this.enableZoom===!1||this.state!==T.NONE||(a.preventDefault(),this.dispatchEvent(he),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(fe))}function Me(a){this.enabled!==!1&&this._handleKeyDown(a)}function xe(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case o.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=T.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=T.TOUCH_PAN;break;default:this.state=T.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=T.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=T.TOUCH_DOLLY_ROTATE;break;default:this.state=T.NONE}break;default:this.state=T.NONE}this.state!==T.NONE&&this.dispatchEvent(he)}function De(a){switch(this._trackPointer(a),this.state){case T.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case T.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case T.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case T.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=T.NONE}}function Ve(a){this.enabled!==!1&&a.preventDefault()}function Se(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ke(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Te(a){let t=null,i=null,s=null,l=null,_=null,y=null,r=null,E=null;const x=e.ref([]),z=e.ref(new o.Vector3),L=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const f=a.value;i=new o.PerspectiveCamera(75,f.clientWidth/f.clientHeight,.1,1e4),i.position.set(8,-8,6),i.up.set(0,0,1),i.lookAt(0,0,0),s=new o.WebGLRenderer({antialias:!0,alpha:!0}),s.setSize(f.clientWidth,f.clientHeight),s.localClippingEnabled=!0,s.shadowMap.enabled=!0,s.shadowMap.type=o.PCFSoftShadowMap,s.toneMapping=o.ACESFilmicToneMapping,s.toneMappingExposure=1,s.outputColorSpace=o.SRGBColorSpace,f.appendChild(s.domElement),l=new ge(i,s.domElement),l.enableDamping=!0,l.dampingFactor=.05,l.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.PAN,RIGHT:null},l.panSpeed=.7,_=new o.Xe(i,s,{container:f,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),_.attachControls(l),b(),n()},u=(f,h)=>{r&&(t.remove(r),r.dispose()),E&&(t.remove(E),E.geometry.dispose(),E.material.dispose());const S=Math.min(Math.max(Math.floor(f/20),30),40);r=new o.GridHelper(f,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(h),t.add(r);const Y=new o.PlaneGeometry(f,f),K=new o.ShadowMaterial({opacity:.3,color:0});E=new o.Mesh(Y,K),E.position.copy(h),E.position.z-=.01,E.receiveShadow=!0,t.add(E)},M=()=>{if(x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),Y=Math.max(h.x,h.y,h.z),K=Math.max(Y*8,50),A=new o.Vector3(S.x,S.y,f.min.z);u(K,A)},b=()=>{const f=new o.AmbientLight(4210752,.6);t.add(f);const h=new o.DirectionalLight(16777215,2);h.position.set(10,10,8),h.castShadow=!0,h.shadow.mapSize.width=4096,h.shadow.mapSize.height=4096,h.shadow.camera.near=.5,h.shadow.camera.far=50,h.shadow.camera.left=-50,h.shadow.camera.right=50,h.shadow.camera.top=50,h.shadow.camera.bottom=-50,t.add(h);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const Y=new o.DirectionalLight(16777215,.6);Y.position.set(0,-15,2),t.add(Y);const K=new o.HemisphereLight(16777215,4473924,.8);t.add(K);const A=new o.PointLight(16777215,1,50);A.position.set(15,15,15),t.add(A);const G=new o.PointLight(16777215,.5,50);G.position.set(-15,-15,15),t.add(G)},n=()=>{y=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),_&&_.render()},g=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{f[S]&&f[S].dispose&&f[S].dispose()}),f.dispose&&f.dispose()},w=f=>{f==null||f.traverse(h=>{h.geometry&&h.geometry.dispose(),h.material&&(Array.isArray(h.material)?h.material.forEach(S=>{g(S)}):g(h.material))})};return{currentModels:x,initialCameraPosition:z,initialTargetPosition:L,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!_)return;const f=a.value,h=f.clientWidth,S=f.clientHeight;i.aspect=h/S,i.updateProjectionMatrix(),s.setSize(h,S),_.update()},fitCameraToAllModels:()=>{if(!i||!l||x.value.length===0)return;const f=new o.Box3;x.value.forEach(G=>{f.expandByObject(G)});const h=f.getSize(new o.Vector3),S=f.getCenter(new o.Vector3),K=Math.max(h.x,h.y,h.z)*.8,A=new o.Vector3(S.x+K,S.y-K,S.z+K);i.position.copy(A),i.lookAt(S),l.target.copy(S),l.update(),z.value.copy(A),L.value.copy(S),M()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:_}),clearAllModels:()=>{if(!t)return;x.value.forEach(h=>{t.remove(h),w(h)});const f=[];t.children.forEach(h=>{!h.isLight&&!h.isCamera&&h.type!=="GridHelper"&&h!==E&&f.push(h)}),f.forEach(h=>{t.remove(h),w(h)}),x.value=[],M()},cleanup:()=>{y&&cancelAnimationFrame(y),r&&r.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),s&&s.dispose(),l&&l.dispose(),_&&_.dispose()},updateGridForModels:M}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,_=new o.Vector3,y=new o.Vector3,r=new o.Vector3,E=0,x=null;const z=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,L=n=>{const g=new o.Vector3,w=E*1.2,O=new o.Vector3(r.x+w,r.y,r.z),B=new o.Vector3(r.x,r.y+w,r.z),H=new o.Vector3(r.x,r.y-w,r.z);if(n<=.567){const F=n/.567*Math.PI*2;g.x=r.x+Math.cos(F)*w,g.z=r.z+Math.sin(F)*w,g.y=r.y}else if(n<=.724){const j=(n-.567)/.157,F=z(j);g.lerpVectors(O,B,F)}else if(n<=.881){const j=(n-.724)/.157,f=z(j)*Math.PI;g.x=r.x+Math.sin(f)*w,g.y=r.y+Math.cos(f)*w,g.z=r.z}else{const j=(n-.881)/.119,F=z(j);g.lerpVectors(H,_,F)}return g},C=()=>{const{camera:n,controls:g}=a();if(!n||!g)return;s||(s=Date.now());const w=Date.now()-s,O=Math.min(w/l,1);if(O>=1){M();return}const B=L(O);n.position.copy(B),n.lookAt(r),g.target.copy(r),x=requestAnimationFrame(C)},u=()=>{if(t.value.length===0)return;const{camera:n,controls:g}=a();if(!n||!g)return;_.copy(n.position),y.copy(g.target);const w=new o.Box3;t.value.forEach(h=>{w.expandByObject(h)});const O=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),E=Math.max(O.x,O.y,O.z)*1.2;const B=new o.Vector3(r.x+E*1.2,r.y,r.z);g.enabled=!1;const H=n.position.clone(),j=1e3,F=Date.now(),f=()=>{const h=Date.now()-F,S=Math.min(h/j,1),Y=z(S);n.position.lerpVectors(H,B,Y),n.lookAt(r),g.target.copy(r),S<1?requestAnimationFrame(f):(i.value=!0,s=null,C())};f()},M=()=>{i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{controls:n}=a();n&&(n.enabled=!0,n.target.copy(y))};return{isAnimating:i,toggleAnimation:()=>{if(i.value){i.value=!1,s=null,x&&(cancelAnimationFrame(x),x=null);const{camera:n,controls:g}=a();if(!n||!g)return;g.enabled=!0;const w=n.position.clone(),O=g.target.clone(),B=1500,H=Date.now(),j=()=>{const F=Date.now()-H,f=Math.min(F/B,1),h=z(f);n.position.lerpVectors(w,_,h),g.target.lerpVectors(O,y,h),f<1&&requestAnimationFrame(j)};j()}else u()},startAnimation:u,stopAnimation:M}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],_=[],y=new o.Box3,r=new o.Vector3;const E=()=>{l=[new o.Plane(new o.Vector3(1,0,0),0),new o.Plane(new o.Vector3(0,1,0),0),new o.Plane(new o.Vector3(0,0,1),0)]},x=()=>{y.makeEmpty(),t.value.forEach(b=>{y.expandByObject(b)}),r=y.getCenter(new o.Vector3)},z=b=>{const n=y.getSize(new o.Vector3);let g,w,O;b==="x"?(g=new o.PlaneGeometry(n.z*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,Math.PI/2,0)):b==="y"?(g=new o.PlaneGeometry(n.x*1.2,n.z*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(Math.PI/2,0,0)):b==="z"&&(g=new o.PlaneGeometry(n.x*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),O=new o.Euler(0,0,0));const B=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),H=new o.Mesh(g,B);return H.position.copy(w),H.rotation.copy(O),H},L=()=>{if(C(),u(),s.value==="none")return;x();let b=null;if(s.value==="x"?(l[0].constant=-r.x,b=l[0]):s.value==="y"?(l[1].constant=-r.y,b=l[1]):s.value==="z"&&(l[2].constant=-r.z,b=l[2]),b){t.value.forEach(g=>{g.traverse(w=>{w.isMesh&&w.material&&(Array.isArray(w.material)?w.material.forEach(O=>{O.clippingPlanes=[b]}):w.material.clippingPlanes=[b])})});const{scene:n}=a();if(n){const g=z(s.value);n.add(g),_.push(g)}}},C=()=>{t.value.forEach(b=>{b.traverse(n=>{n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(g=>{g.clippingPlanes=[]}):n.material.clippingPlanes=[])})})},u=()=>{const{scene:b}=a();b&&_.forEach(n=>{b.remove(n),n.geometry.dispose(),n.material.dispose()}),_=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(E(),t.value.length>0&&x()):(s.value="none",C(),u())},updateClippingPlanes:L,clearClippingPlanes:C,clearClippingMeshes:u}}const Ne={class:"panel-content"},Re={__name:"animationTable",props:{animationData:Object,model:Object},setup(a){const t=a;e.ref();const i=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var l;let s=((l=me.cloneDeep(t==null?void 0:t.animationData))==null?void 0:l.动画输出Content)??[];s&&(i.value=s)},{deep:!0,immediate:!0}),(s,l)=>{var _,y,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(_=i.value)==null?void 0:_.compData,key:(y=i.value)==null?void 0:y.id,index:(r=i.value)==null?void 0:r.id,showHeader:!1},null,8,["itemData","index"]))])}}},ze=oe._export_sfc(Re,[["__scopeId","data-v-02b89b4b"]]),Oe={class:"panel-content"},Le="id",je={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:a=>["breadth","firstLevel"].includes(a)}},emits:["nodeClick"],setup(a,{emit:t}){const i=a,s=t,l=e.ref([]),_={children:"children",label:"label"},y=u=>{s("nodeClick",u)},r=(u,M=0)=>{const b=[];return Array.isArray(u)&&(u==null?void 0:u.length)>0&&u.forEach(n=>{if(!(n!=null&&n.isMesh)&&((n==null?void 0:n.type)==="URDFJoint"||(n==null?void 0:n.type)==="URDFLink")){const g={name:n==null?void 0:n.name,label:n==null?void 0:n.name,show:!0,level:M+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:r(n==null?void 0:n.children,M+1),path:n==null?void 0:n.name};b.push(g)}}),b},E=u=>u?[{name:u==null?void 0:u.name,label:u==null?void 0:u.name,show:!0,level:1,isPenultimate:!1,type:u==null?void 0:u.type,id:u==null?void 0:u.id,limit:(u==null?void 0:u.limit)??"",children:r(u==null?void 0:u.children,1),path:u==null?void 0:u.name}]:[],x=(u,M)=>{const b=[],n=[...u];for(;n.length>0&&b.length<M;){const g=n.shift();g.children&&g.children.length>0&&(b.push(g.id),n.push(...g.children))}return b},z=(u,M)=>{const b=[];return u.forEach(n=>{if(n.children&&n.children.length>0){b.push(n.id);const g=n.children.filter(w=>w.children&&w.children.length>0).slice(0,M).map(w=>w.id);b.push(...g)}}),b.slice(0,M+1)},L=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?z(l.value,i.maxExpandCount):x(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?E(i.model):[]);return e.watch(C,u=>{l.value=JSON.parse(JSON.stringify(u))},{immediate:!0}),(u,M)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(b,{data:l.value,props:_,"default-expanded-keys":L.value,"node-key":Le,onNodeClick:y},null,8,["data","default-expanded-keys"])])}}},Ie=oe._export_sfc(je,[["__scopeId","data-v-290ff4e1"]]),Ue={class:"panel-content"},Be={key:0,class:"joints-list"},Fe={class:"joint-info-row"},Ye={class:"joint-left"},Ze={class:"joint-name"},He={class:"joint-range"},Ke={class:"joint-type"},Xe={key:0,class:"joint-control-row"},$e={class:"slider-container"},Ge=["min","max","value","onInput","disabled"],Je={class:"value-display"},qe={class:"joint-value"},We={class:"unit"},Qe={key:1,class:"empty-state"},se=.001,et=1e3,ce=60,tt={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const i=a;e.ref(!0);const s=e.ref([]),l=e.ref(null),_=e.ref(12.5),y=e.ref(),r=e.ref(1302),E=e.ref(!1),x=e.ref(!1),z=e.ref(0),L=e.ref(0),C=e.ref(null),u=o.MathUtils.degToRad,M=e.ref(1),b=()=>et/ce/M.value;let n=[];e.watch(()=>i.animationData,m=>{var d;let v=((d=me.cloneDeep(m))==null?void 0:d.动画输出)??[];v&&v.length>0&&(n=v,Y())},{deep:!0});const g=e.computed(()=>n.length>0),w=(m,v=!1)=>m==="revolute"?v?Math.PI:-Math.PI:m==="prismatic"?v?1:-1:0,O=m=>{if(!m||!m.joints)return console.warn("URDF模型没有关节信息"),[];let v;const d=[];return Object.keys(m.joints).forEach(P=>{const p=m.joints[P];if(p._jointType==="fixed")return;const N=p.limit?{lower:p.limit.lower??w(p._jointType,!1),upper:p.limit.upper??w(p._jointType,!0)}:{lower:w(p._jointType,!1),upper:w(p._jointType,!0)};d.push({name:P,type:p._jointType||"unknown",limit:N,currentValue:p.angle||0,urdfJoint:p})}),m.traverse(P=>{var p;P.name==="Pipe_Link"&&!v&&((p=P.children)==null||p.forEach(N=>{N&&!v&&(v=N)}))}),v?(y.value=v,d.sort((P,p)=>P.name.localeCompare(p.name))):!1},B=(m,v)=>{const d=s.value.find(p=>p.name===m);if(!d)return;const P=parseFloat(v);if(d.limit){const p=Math.max(d.limit.lower,Math.min(d.limit.upper,P));d.currentValue=p}else d.currentValue=P;i.model&&i.model.setJointValue?i.model.setJointValue(m,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},H=m=>m.reduce((v,d)=>{let P=0;const p=d.Y??0,N=d.C??0,D=d.R??0;return p>0&&(P+=p),N>0&&D>0&&(P+=D*u(N)),v+P},0),j=m=>{const v=[],d=m.Y??0,P=m.B??0,p=m.C??0,N=m.R??0,D={pos:new o.Vector3(0,0,0),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};if(!d&&!p)return v;if(v.push(D.pos.clone()),P!==0){const V=new o.Matrix4().makeRotationAxis(D.localY,u(P));D.localX.applyMatrix4(V),D.localZ.applyMatrix4(V)}if(d>0&&(D.pos.add(D.localY.clone().multiplyScalar(d*se)),v.push(D.pos.clone())),p>0&&N>0){const V=u(p),c=N*se,U=D.pos.clone().add(D.localX.clone().multiplyScalar(-c)),J=Math.max(16,Math.ceil(p/5));for(let $=1;$<=J;$++){const ee=V*$/J,Q=new o.Matrix4().makeRotationAxis(D.localZ,ee),Z=D.localX.clone().multiplyScalar(c).applyMatrix4(Q),q=U.clone().add(Z);v.push(q)}}return v},F=m=>{if(!y.value||!g.value)return;const v=n.slice(0,m+1),d=H(v),P=Math.max(0,r.value-d),p=[];p.push(new o.Vector3(0,0,0));const N=new o.Vector3(0,P*se,0);P>0&&p.push(N);let D={pos:N.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const V=[];for(let c=v.length-1;c>=0;c--){const U=v[c],J=j(U);if(J.length>0){const $=J.map(Z=>{const q=Z.clone(),te=new o.Matrix4;return te.makeBasis(D.localX,D.localY,D.localZ),q.applyMatrix4(te),q.add(D.pos)});V.push($);const ee=$[$.length-1];D.pos=ee.clone();const Q=U.B??0,k=U.C??0;if(Q!==0){const Z=new o.Matrix4().makeRotationAxis(D.localY,u(Q));D.localX.applyMatrix4(Z),D.localZ.applyMatrix4(Z)}if(k>0){const Z=u(k),q=new o.Matrix4().makeRotationAxis(D.localZ,Z);D.localY.applyMatrix4(q),D.localX.applyMatrix4(q)}}}for(const c of V)c.length>1&&p.push(...c.slice(1));p.length<2&&p.push(new o.Vector3(0,.001,0)),console.log(2321,p);try{const c=new o.CatmullRomCurve3(p,!1,"catmullrom",.01),U=new o.TubeGeometry(c,Math.max(2,p.length*4),_.value*se,18,!1);y.value.geometry.dispose(),y.value.geometry=U}catch(c){console.error("主管件更新失败",c)}},f=m=>{m&&Object.keys(m).forEach((v,d)=>{const P=m[v],p=s.value.find(N=>N.name===v);p&&(p.currentValue=P,i.model&&i.model.setJointValue?i.model.setJointValue(v,P):p.urdfJoint&&p.urdfJoint.setJointValue(P)),console.log(232,d),F(d)})},h=(m,v,d)=>m+(v-m)*d,S=(m,v,d)=>{if(!m||!v)return m||v;const P={};return Object.keys(m).forEach(p=>{const N=m[p],D=v[p];P[p]=h(N,D||N,d)}),P},Y=()=>{if(n.length===0){console.warn("没有动画数据");return}E.value=!0,x.value=!1;const m=()=>{if(!E.value||x.value)return;const v=L.value/ce,d=n[z.value],P=n[z.value+1];if(P){const p=S(d,P,v);f(p)}else f(d);if(L.value++,L.value>=ce&&(L.value=0,z.value++,z.value>=n.length-1)){A();return}C.value=setTimeout(m,b())};m()},K=()=>{x.value=!0,C.value&&(clearTimeout(C.value),C.value=null)},A=()=>{E.value=!1,x.value=!1,M.value=1,C.value&&(clearTimeout(C.value),C.value=null)};t({startAnimation:Y,pauseAnimation:K,stopAnimation:A,resetAll:()=>{A(),z.value=0,L.value=0,s.value.forEach(m=>{(m.type==="revolute"||m.type==="prismatic")&&B(m.name,0)})},fastForward:()=>{M.value<4&&(M.value=Math.min(4,M.value*2))},fastBackward:()=>{M.value>.25&&(M.value=Math.max(.25,M.value/2))}}),e.watch(()=>i.model,m=>{m?s.value=O(m):s.value=[]},{immediate:!0});const ae=()=>{!i.model||E.value&&!x.value||s.value.forEach(m=>{m.urdfJoint&&m.urdfJoint.angle!==void 0&&(m.currentValue=m.urdfJoint.angle)})},ie=()=>{const m=()=>{ae(),l.value=requestAnimationFrame(m)};m()},le=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{ie()}),e.onUnmounted(()=>{le(),A()}),(m,v)=>(e.openBlock(),e.createElementBlock("div",Ue,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Be,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,d=>{var P,p,N,D;return e.openBlock(),e.createElementBlock("div",{key:d.name,class:"joint-item"},[e.createElementVNode("div",Fe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",Ze,e.toDisplayString(d.name),1),e.createElementVNode("span",He," ["+e.toDisplayString(((P=d.limit)==null?void 0:P.lower.toFixed(2))??(d.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((p=d.limit)==null?void 0:p.upper.toFixed(2))??(d.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Ke,e.toDisplayString(d.type),1)]),d.type==="revolute"||d.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Xe,[e.createElementVNode("div",$e,[e.createElementVNode("input",{type:"range",min:((N=d.limit)==null?void 0:N.lower)??(d.type==="revolute"?-Math.PI:-1),max:((D=d.limit)==null?void 0:D.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:V=>B(d.name,V.target.value),class:"joint-slider",disabled:E.value&&!x.value},null,40,Ge)]),e.createElementVNode("div",Je,[e.createElementVNode("span",qe,e.toDisplayString(d.currentValue.toFixed(3)),1),e.createElementVNode("span",We,e.toDisplayString(d.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Qe,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},ot=oe._export_sfc(tt,[["__scopeId","data-v-9ee05a01"]]),it=["xlink:href"],nt=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(a){const t=a,i=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>{const{size:_}=t;let y=`${_}`;return y=`${y.replace("px","")}px`,{width:y,height:y}});return(_,y)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:_.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[_.$attrs.class,_.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),R=oe._export_sfc(nt,[["__scopeId","data-v-3150a90b"]]),st={class:"obj-viewer-container"},at={class:"buttonGroup-top"},lt={class:"buttonGroup-topLeft"},rt={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ht={class:"buttonGroup-bottom"},ut={class:"left-panel"},dt={class:"panel-header"},pt={key:1,class:"clipping-content"},mt={class:"radio-group"},ft={class:"radio-label"},_t={class:"radio-label"},gt={class:"radio-label"},yt={class:"radio-label"},vt={class:"right-panel"},bt={class:"panel-header"},wt={key:0,class:"loading-overlay"},Et={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(a,{expose:t,emit:i}){const s=i,l=a;let _=null,y=!1;const r=e.ref(null),E=e.ref(!1),x=e.ref("");e.ref(!1);const z=e.ref(!1),L=e.ref(!1),C=e.ref(""),u=e.ref(!1),M=e.ref(""),b=e.ref(),{currentModels:n,initialCameraPosition:g,initialTargetPosition:w,initThreeJS:O,handleResize:B,fitCameraToAllModels:H,getThreeJSObjects:j,clearAllModels:F,cleanup:f}=Te(r),{isAnimating:h,toggleAnimation:S,stopAnimation:Y}=Ce(j,n),{isClipping:K,activeClippingAxis:A,toggleClipping:G,updateClippingPlanes:W}=Ae(j,n),{addModelsFromUrls:ue,loadModelByDefaultPath:ae,urdfModel:ie}=o.useModelLoader(j,n,E,x,F),le=()=>{if(z.value||n.value.length===0)return;z.value=!0,h.value&&Y();const{camera:V,controls:c}=j();if(!V||!c)return;c.enabled=!0;const U=Z=>Z<.5?4*Z*Z*Z:1-Math.pow(-2*Z+2,3)/2,J=V.position.clone(),$=c.target.clone(),ee=1500,Q=Date.now(),k=()=>{const Z=Date.now()-Q,q=Math.min(Z/ee,1),te=U(q);V.position.lerpVectors(J,g.value,te),c.target.lerpVectors($,w.value,te),q<1?requestAnimationFrame(k):z.value=!1};k()},m=async()=>y?Promise.resolve():new Promise(V=>{const c=()=>{y?V():requestAnimationFrame(c)};c()}),v=async(V,c)=>{try{await m(),h.value&&Y(),K.value&&G();const U=await c(V);return H(),U}catch(U){throw console.error("加载模型失败:",U),U}},d=async V=>v(V,ue),P=async V=>v(V,ae),p=V=>{L.value=!0,C.value=V,V==="剖面视图"&&!K.value&&G()},N=V=>{u.value=!0,M.value=V},D=()=>{s("getAnimationData"),e.nextTick(()=>{var V;(V=b.value)==null||V.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{O(),_=j().scene,y=!0,window.addEventListener("resize",B)}catch(V){console.error("Three.js初始化失败:",V)}}),e.onBeforeUnmount(()=>{y=!1,C.value="",M.value="",window.removeEventListener("resize",B),h.value&&Y(),f()}),t({addModelsFromUrls:d,loadModelByDefaultPath:P}),(V,c)=>{var J,$,ee,Q;const U=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",st,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",at,[e.createVNode(R,{name:"guanjianjiexi",size:"34"}),e.createVNode(R,{name:"guanjiekongzhi",size:"34"}),e.createVNode(R,{name:"gongyishengcheng",size:"34"}),e.createVNode(R,{name:"buchangshezhi",size:"34"}),e.createVNode(R,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",lt,[e.createVNode(R,{name:"viewReset",size:"24",onClick:le,title:"重置"}),e.createVNode(R,{name:"fangda",size:"24",title:"放大"}),e.createVNode(R,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(R,{name:"lookAround",size:"24",onClick:e.unref(S),title:e.unref(h)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(R,{name:"jiegoushu",size:"24",onClick:c[0]||(c[0]=k=>p("场景树")),active:L.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(R,{name:"clipping",size:"24",onClick:c[1]||(c[1]=k=>p("剖面视图")),active:L.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[2]||(c[2]=k=>p("场景树3"))}),e.createVNode(R,{name:"donghuafangzhen",size:"24",onClick:c[3]||(c[3]=k=>p("场景4"))})]),e.createElementVNode("div",ct,[e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"guanjiekongzhi",size:"24",onClick:c[4]||(c[4]=k=>N("关节控制")),active:u.value&&M.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(R,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:c[5]||(c[5]=k=>N("动画仿真")),active:u.value&&M.value==="动画仿真"},null,8,["active"]),e.createVNode(R,{name:"donghuafangzhen",size:"24"}),e.createVNode(R,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ht,[e.createVNode(R,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(J=b.value)==null?void 0:J.fastBackward},null,8,["onClick"]),e.createVNode(R,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:D}),e.createVNode(R,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:($=b.value)==null?void 0:$.fastForward},null,8,["onClick"]),e.createVNode(R,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(ee=b.value)==null?void 0:ee.pauseAnimation},null,8,["onClick"]),e.createVNode(R,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(Q=b.value)==null?void 0:Q.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",ut,[e.createElementVNode("div",dt,[e.createElementVNode("span",null,e.toDisplayString(C.value),1),e.createElementVNode("span",{class:"close",onClick:c[6]||(c[6]=k=>L.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(ie)},null,8,["model"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("label",ft,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":c[7]||(c[7]=k=>e.isRef(A)?A.value=k:null),onChange:c[8]||(c[8]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[16]||(c[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",_t,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":c[9]||(c[9]=k=>e.isRef(A)?A.value=k:null),onChange:c[10]||(c[10]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[17]||(c[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",gt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":c[11]||(c[11]=k=>e.isRef(A)?A.value=k:null),onChange:c[12]||(c[12]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[18]||(c[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":c[13]||(c[13]=k=>e.isRef(A)?A.value=k:null),onChange:c[14]||(c[14]=(...k)=>e.unref(W)&&e.unref(W)(...k))},null,544),[[e.vModelRadio,e.unref(A)]]),c[19]||(c[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(M.value),1),e.createElementVNode("span",{class:"close",onClick:c[15]||(c[15]=k=>u.value=!1)}," X ")]),e.createVNode(U,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ot,{ref_key:"jointRef",ref:b,model:e.unref(ie),scene:e.unref(_),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,M.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,M.value==="动画仿真"]])]),_:1})],512),[[e.vShow,u.value]]),E.value?(e.openBlock(),e.createElementBlock("div",wt,[c[20]||(c[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},Pt=oe._export_sfc(Et,[["__scopeId","data-v-14112288"]]);exports.default=Pt;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ss-component-new",
3
3
  "private": false,
4
- "version": "1.1.575",
4
+ "version": "1.1.577",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-CNq0IT-6.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./menu-DYsWoy6Z.cjs"),de={type:"change"},he={type:"start"},fe={type:"end"},ne=new o.Ray,pe=new o.Plane,_e=Math.cos(70*o.MathUtils.DEG2RAD),I=new o.Vector3,X=2*Math.PI,k={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},re=1e-6;class ge extends o.Controls{constructor(t,i=null){super(t,i),this.state=k.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=k.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===k.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,l=this.maxAzimuthAngle;isFinite(s)&&isFinite(l)&&(s<-Math.PI?s+=X:s>Math.PI&&(s-=X),l<-Math.PI?l+=X:l>Math.PI&&(l-=X),s<=l?this._spherical.theta=Math.max(s,Math.min(l,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+l)/2?Math.max(s,this._spherical.theta):Math.min(l,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let _=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const v=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),_=v!=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 v=null;if(this.object.isPerspectiveCamera){const r=I.length();v=this._clampDistance(r*this._scale);const P=r-v;this.object.position.addScaledVector(this._dollyDirection,P),this.object.updateMatrixWorld(),_=!!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!==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(),v=I.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;v!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(v).add(this.object.position):(ne.origin.copy(this.object.position),ne.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ne.direction))<_e?this.object.lookAt(this.target):(pe.setFromNormalAndCoplanarPoint(this.object.up,this.target),ne.intersectPlane(pe,this.target))))}else if(this.object.isOrthographicCamera){const v=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),v!==this.object.zoom&&(this.object.updateProjectionMatrix(),_=!0)}return this._scale=1,this._performCursorZoom=!1,_||this._lastPosition.distanceToSquared(this.object.position)>re||8*(1-this._lastQuaternion.dot(this.object.quaternion))>re||this._lastTargetPosition.distanceToSquared(this.target)>re?(this.dispatchEvent(de),this._lastPosition.copy(this.object.position),this._lastQuaternion.copy(this.object.quaternion),this._lastTargetPosition.copy(this.target),!0):!1}_getAutoRotationAngle(t){return t!==null?X/60*this.autoRotateSpeed*t:X/60/60*this.autoRotateSpeed}_getZoomScale(t){const i=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*i)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,i){I.setFromMatrixColumn(i,0),I.multiplyScalar(-t),this._panOffset.add(I)}_panUp(t,i){this.screenSpacePanning===!0?I.setFromMatrixColumn(i,1):(I.setFromMatrixColumn(i,0),I.crossVectors(this.object.up,I)),I.multiplyScalar(t),this._panOffset.add(I)}_pan(t,i){const s=this.domElement;if(this.object.isPerspectiveCamera){const l=this.object.position;I.copy(l).sub(this.target);let _=I.length();_*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*_/s.clientHeight,this.object.matrix),this._panUp(2*i*_/s.clientHeight,this.object.matrix)}else this.object.isOrthographicCamera?(this._panLeft(t*(this.object.right-this.object.left)/this.object.zoom/s.clientWidth,this.object.matrix),this._panUp(i*(this.object.top-this.object.bottom)/this.object.zoom/s.clientHeight,this.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),this.enablePan=!1)}_dollyOut(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale/=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_dollyIn(t){this.object.isPerspectiveCamera||this.object.isOrthographicCamera?this._scale*=t:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),this.enableZoom=!1)}_updateZoomParameters(t,i){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),l=t-s.left,_=i-s.top,v=s.width,r=s.height;this._mouse.x=l/v*2-1,this._mouse.y=-(_/r)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd),this.update()}_handleMouseMoveDolly(t){this._dollyEnd.set(t.clientX,t.clientY),this._dollyDelta.subVectors(this._dollyEnd,this._dollyStart),this._dollyDelta.y>0?this._dollyOut(this._getZoomScale(this._dollyDelta.y)):this._dollyDelta.y<0&&this._dollyIn(this._getZoomScale(this._dollyDelta.y)),this._dollyStart.copy(this._dollyEnd),this.update()}_handleMouseMovePan(t){this._panEnd.set(t.clientX,t.clientY),this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd),this.update()}_handleMouseWheel(t){this._updateZoomParameters(t.clientX,t.clientY),t.deltaY<0?this._dollyIn(this._getZoomScale(t.deltaY)):t.deltaY>0&&this._dollyOut(this._getZoomScale(t.deltaY)),this.update()}_handleKeyDown(t){let i=!1;switch(t.code){case this.keys.UP:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,this.keyPanSpeed),i=!0;break;case this.keys.BOTTOM:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateUp(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(0,-this.keyPanSpeed),i=!0;break;case this.keys.LEFT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(this.keyPanSpeed,0),i=!0;break;case this.keys.RIGHT:t.ctrlKey||t.metaKey||t.shiftKey?this.enableRotate&&this._rotateLeft(-X*this.keyRotateSpeed/this.domElement.clientHeight):this.enablePan&&this._pan(-this.keyPanSpeed,0),i=!0;break}i&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._rotateStart.set(s,l)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panStart.set(s,l)}}_handleTouchStartDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyStart.set(0,_)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),l=.5*(t.pageX+s.x),_=.5*(t.pageY+s.y);this._rotateEnd.set(l,_)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const i=this.domElement;this._rotateLeft(X*this._rotateDelta.x/i.clientHeight),this._rotateUp(X*this._rotateDelta.y/i.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const i=this._getSecondPointerPosition(t),s=.5*(t.pageX+i.x),l=.5*(t.pageY+i.y);this._panEnd.set(s,l)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const i=this._getSecondPointerPosition(t),s=t.pageX-i.x,l=t.pageY-i.y,_=Math.sqrt(s*s+l*l);this._dollyEnd.set(0,_),this._dollyDelta.set(0,Math.pow(this._dollyEnd.y/this._dollyStart.y,this.zoomSpeed)),this._dollyOut(this._dollyDelta.y),this._dollyStart.copy(this._dollyEnd);const v=(t.pageX+i.x)*.5,r=(t.pageY+i.y)*.5;this._updateZoomParameters(v,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=k.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=k.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=k.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=k.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=k.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=k.PAN}break;default:this.state=k.NONE}this.state!==k.NONE&&this.dispatchEvent(he)}function Ee(a){switch(this.state){case k.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case k.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case k.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Pe(a){this.enabled===!1||this.enableZoom===!1||this.state!==k.NONE||(a.preventDefault(),this.dispatchEvent(he),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(fe))}function Me(a){this.enabled!==!1&&this._handleKeyDown(a)}function xe(a){switch(this._trackPointer(a),this._pointers.length){case 1:switch(this.touches.ONE){case o.TOUCH.ROTATE:if(this.enableRotate===!1)return;this._handleTouchStartRotate(a),this.state=k.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=k.TOUCH_PAN;break;default:this.state=k.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=k.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=k.TOUCH_DOLLY_ROTATE;break;default:this.state=k.NONE}break;default:this.state=k.NONE}this.state!==k.NONE&&this.dispatchEvent(he)}function De(a){switch(this._trackPointer(a),this.state){case k.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case k.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case k.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case k.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=k.NONE}}function Ve(a){this.enabled!==!1&&a.preventDefault()}function Se(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ke(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Te(a){let t=null,i=null,s=null,l=null,_=null,v=null,r=null,P=null;const V=e.ref([]),z=e.ref(new o.Vector3),L=e.ref(new o.Vector3),C=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const g=a.value;i=new o.PerspectiveCamera(75,g.clientWidth/g.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(g.clientWidth,g.clientHeight),s.localClippingEnabled=!0,s.shadowMap.enabled=!0,s.shadowMap.type=o.PCFSoftShadowMap,s.toneMapping=o.ACESFilmicToneMapping,s.toneMappingExposure=1,s.outputColorSpace=o.SRGBColorSpace,g.appendChild(s.domElement),l=new ge(i,s.domElement),l.enableDamping=!0,l.dampingFactor=.05,l.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.PAN,RIGHT:null},l.panSpeed=.7,_=new o.Xe(i,s,{container:g,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),_.attachControls(l),y(),n()},c=(g,u)=>{r&&(t.remove(r),r.dispose()),P&&(t.remove(P),P.geometry.dispose(),P.material.dispose());const S=Math.min(Math.max(Math.floor(g/20),30),40);r=new o.GridHelper(g,S,13421772,14540253),r.rotateX(Math.PI/2),r.position.copy(u),t.add(r);const Y=new o.PlaneGeometry(g,g),U=new o.ShadowMaterial({opacity:.3,color:0});P=new o.Mesh(Y,U),P.position.copy(u),P.position.z-=.01,P.receiveShadow=!0,t.add(P)},T=()=>{if(V.value.length===0)return;const g=new o.Box3;V.value.forEach(J=>{g.expandByObject(J)});const u=g.getSize(new o.Vector3),S=g.getCenter(new o.Vector3),Y=Math.max(u.x,u.y,u.z),U=Math.max(Y*8,50),O=new o.Vector3(S.x,S.y,g.min.z);c(U,O)},y=()=>{const g=new o.AmbientLight(4210752,.6);t.add(g);const u=new o.DirectionalLight(16777215,2);u.position.set(10,10,8),u.castShadow=!0,u.shadow.mapSize.width=4096,u.shadow.mapSize.height=4096,u.shadow.camera.near=.5,u.shadow.camera.far=50,u.shadow.camera.left=-50,u.shadow.camera.right=50,u.shadow.camera.top=50,u.shadow.camera.bottom=-50,t.add(u);const S=new o.DirectionalLight(16777215,.8);S.position.set(-8,-8,6),t.add(S);const Y=new o.DirectionalLight(16777215,.6);Y.position.set(0,-15,2),t.add(Y);const U=new o.HemisphereLight(16777215,4473924,.8);t.add(U);const O=new o.PointLight(16777215,1,50);O.position.set(15,15,15),t.add(O);const J=new o.PointLight(16777215,.5,50);J.position.set(-15,-15,15),t.add(J)},n=()=>{v=requestAnimationFrame(n),l&&l.update(),s&&t&&i&&s.render(t,i),_&&_.render()},m=g=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(S=>{g[S]&&g[S].dispose&&g[S].dispose()}),g.dispose&&g.dispose()},w=g=>{g==null||g.traverse(u=>{u.geometry&&u.geometry.dispose(),u.material&&(Array.isArray(u.material)?u.material.forEach(S=>{m(S)}):m(u.material))})};return{currentModels:V,initialCameraPosition:z,initialTargetPosition:L,initThreeJS:C,handleResize:()=>{if(!a.value||!i||!s||!_)return;const g=a.value,u=g.clientWidth,S=g.clientHeight;i.aspect=u/S,i.updateProjectionMatrix(),s.setSize(u,S),_.update()},fitCameraToAllModels:()=>{if(!i||!l||V.value.length===0)return;const g=new o.Box3;V.value.forEach(J=>{g.expandByObject(J)});const u=g.getSize(new o.Vector3),S=g.getCenter(new o.Vector3),U=Math.max(u.x,u.y,u.z)*.8,O=new o.Vector3(S.x+U,S.y-U,S.z+U);i.position.copy(O),i.lookAt(S),l.target.copy(S),l.update(),z.value.copy(O),L.value.copy(S),T()},getThreeJSObjects:()=>({scene:t,camera:i,renderer:s,controls:l,gizmo:_}),clearAllModels:()=>{if(!t)return;V.value.forEach(u=>{t.remove(u),w(u)});const g=[];t.children.forEach(u=>{!u.isLight&&!u.isCamera&&u.type!=="GridHelper"&&u!==P&&g.push(u)}),g.forEach(u=>{t.remove(u),w(u)}),V.value=[],T()},cleanup:()=>{v&&cancelAnimationFrame(v),r&&r.dispose(),P&&(P.geometry.dispose(),P.material.dispose()),s&&s.dispose(),l&&l.dispose(),_&&_.dispose()},updateGridForModels:T}}function Ce(a,t){const i=e.ref(!1);let s=null,l=12700,_=new o.Vector3,v=new o.Vector3,r=new o.Vector3,P=0,V=null;const z=n=>n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2,L=n=>{const m=new o.Vector3,w=P*1.2,R=new o.Vector3(r.x+w,r.y,r.z),F=new o.Vector3(r.x,r.y+w,r.z),K=new o.Vector3(r.x,r.y-w,r.z);if(n<=.567){const B=n/.567*Math.PI*2;m.x=r.x+Math.cos(B)*w,m.z=r.z+Math.sin(B)*w,m.y=r.y}else if(n<=.724){const j=(n-.567)/.157,B=z(j);m.lerpVectors(R,F,B)}else if(n<=.881){const j=(n-.724)/.157,g=z(j)*Math.PI;m.x=r.x+Math.sin(g)*w,m.y=r.y+Math.cos(g)*w,m.z=r.z}else{const j=(n-.881)/.119,B=z(j);m.lerpVectors(K,_,B)}return m},C=()=>{const{camera:n,controls:m}=a();if(!n||!m)return;s||(s=Date.now());const w=Date.now()-s,R=Math.min(w/l,1);if(R>=1){T();return}const F=L(R);n.position.copy(F),n.lookAt(r),m.target.copy(r),V=requestAnimationFrame(C)},c=()=>{if(t.value.length===0)return;const{camera:n,controls:m}=a();if(!n||!m)return;_.copy(n.position),v.copy(m.target);const w=new o.Box3;t.value.forEach(u=>{w.expandByObject(u)});const R=w.getSize(new o.Vector3);r=w.getCenter(new o.Vector3),P=Math.max(R.x,R.y,R.z)*1.2;const F=new o.Vector3(r.x+P*1.2,r.y,r.z);m.enabled=!1;const K=n.position.clone(),j=1e3,B=Date.now(),g=()=>{const u=Date.now()-B,S=Math.min(u/j,1),Y=z(S);n.position.lerpVectors(K,F,Y),n.lookAt(r),m.target.copy(r),S<1?requestAnimationFrame(g):(i.value=!0,s=null,C())};g()},T=()=>{i.value=!1,s=null,V&&(cancelAnimationFrame(V),V=null);const{controls:n}=a();n&&(n.enabled=!0,n.target.copy(v))};return{isAnimating:i,toggleAnimation:()=>{if(i.value){i.value=!1,s=null,V&&(cancelAnimationFrame(V),V=null);const{camera:n,controls:m}=a();if(!n||!m)return;m.enabled=!0;const w=n.position.clone(),R=m.target.clone(),F=1500,K=Date.now(),j=()=>{const B=Date.now()-K,g=Math.min(B/F,1),u=z(g);n.position.lerpVectors(w,_,u),m.target.lerpVectors(R,v,u),g<1&&requestAnimationFrame(j)};j()}else c()},startAnimation:c,stopAnimation:T}}function Ae(a,t){const i=e.ref(!1),s=e.ref("none");let l=[],_=[],v=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=()=>{v.makeEmpty(),t.value.forEach(y=>{v.expandByObject(y)}),r=v.getCenter(new o.Vector3)},z=y=>{const n=v.getSize(new o.Vector3);let m,w,R;y==="x"?(m=new o.PlaneGeometry(n.z*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),R=new o.Euler(0,Math.PI/2,0)):y==="y"?(m=new o.PlaneGeometry(n.x*1.2,n.z*1.2),w=new o.Vector3(r.x,r.y,r.z),R=new o.Euler(Math.PI/2,0,0)):y==="z"&&(m=new o.PlaneGeometry(n.x*1.2,n.y*1.2),w=new o.Vector3(r.x,r.y,r.z),R=new o.Euler(0,0,0));const F=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),K=new o.Mesh(m,F);return K.position.copy(w),K.rotation.copy(R),K},L=()=>{if(C(),c(),s.value==="none")return;V();let y=null;if(s.value==="x"?(l[0].constant=-r.x,y=l[0]):s.value==="y"?(l[1].constant=-r.y,y=l[1]):s.value==="z"&&(l[2].constant=-r.z,y=l[2]),y){t.value.forEach(m=>{m.traverse(w=>{w.isMesh&&w.material&&(Array.isArray(w.material)?w.material.forEach(R=>{R.clippingPlanes=[y]}):w.material.clippingPlanes=[y])})});const{scene:n}=a();if(n){const m=z(s.value);n.add(m),_.push(m)}}},C=()=>{t.value.forEach(y=>{y.traverse(n=>{n.isMesh&&n.material&&(Array.isArray(n.material)?n.material.forEach(m=>{m.clippingPlanes=[]}):n.material.clippingPlanes=[])})})},c=()=>{const{scene:y}=a();y&&_.forEach(n=>{y.remove(n),n.geometry.dispose(),n.material.dispose()}),_=[]};return{isClipping:i,activeClippingAxis:s,toggleClipping:()=>{i.value=!i.value,i.value?(P(),t.value.length>0&&V()):(s.value="none",C(),c())},updateClippingPlanes:L,clearClippingPlanes:C,clearClippingMeshes:c}}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 _,v,r;return e.openBlock(),e.createElementBlock("div",Ne,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(_=i.value)==null?void 0:_.compData,key:(v=i.value)==null?void 0:v.id,index:(r=i.value)==null?void 0:r.id,showHeader:!1},null,8,["itemData","index"]))])}}},ze=oe._export_sfc(Re,[["__scopeId","data-v-02b89b4b"]]),Oe={class:"panel-content"},Le="id",je={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:a=>["breadth","firstLevel"].includes(a)}},emits:["nodeClick"],setup(a,{emit:t}){const i=a,s=t,l=e.ref([]),_={children:"children",label:"label"},v=c=>{s("nodeClick",c)},r=(c,T=0)=>{const y=[];return Array.isArray(c)&&(c==null?void 0:c.length)>0&&c.forEach(n=>{if(!(n!=null&&n.isMesh)&&((n==null?void 0:n.type)==="URDFJoint"||(n==null?void 0:n.type)==="URDFLink")){const m={name:n==null?void 0:n.name,label:n==null?void 0:n.name,show:!0,level:T+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,T+1),path:n==null?void 0:n.name};y.push(m)}}),y},P=c=>c?[{name:c==null?void 0:c.name,label:c==null?void 0:c.name,show:!0,level:1,isPenultimate:!1,type:c==null?void 0:c.type,id:c==null?void 0:c.id,limit:(c==null?void 0:c.limit)??"",children:r(c==null?void 0:c.children,1),path:c==null?void 0:c.name}]:[],V=(c,T)=>{const y=[],n=[...c];for(;n.length>0&&y.length<T;){const m=n.shift();m.children&&m.children.length>0&&(y.push(m.id),n.push(...m.children))}return y},z=(c,T)=>{const y=[];return c.forEach(n=>{if(n.children&&n.children.length>0){y.push(n.id);const m=n.children.filter(w=>w.children&&w.children.length>0).slice(0,T).map(w=>w.id);y.push(...m)}}),y.slice(0,T+1)},L=e.computed(()=>!l.value||l.value.length===0?[]:i.expandStrategy==="firstLevel"?z(l.value,i.maxExpandCount):V(l.value,i.maxExpandCount)),C=e.computed(()=>i!=null&&i.model?P(i.model):[]);return e.watch(C,c=>{l.value=JSON.parse(JSON.stringify(c))},{immediate:!0}),(c,T)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Oe,[e.createVNode(y,{data:l.value,props:_,"default-expanded-keys":L.value,"node-key":Le,onNodeClick:v},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"},se=.001,et=1e3,ce=60,tt={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const i=a;e.ref(!0);const s=e.ref([]),l=e.ref(null),_=e.ref(1),v=e.ref(),r=e.ref(729.2),P=e.ref(!1),V=e.ref(!1),z=e.ref(0),L=e.ref(0),C=e.ref(null),c=e.ref(1),T=()=>et/ce/c.value;let y=[];e.watch(()=>i.animationData,p=>{var d;let b=((d=me.cloneDeep(p))==null?void 0:d.动画输出)??[];b&&b.length>0&&(y=b,S())},{deep:!0});const n=e.computed(()=>y.length>0),m=(p,b=!1)=>p==="revolute"?b?Math.PI:-Math.PI:p==="prismatic"?b?1:-1:0,w=p=>{if(!p||!p.joints)return console.warn("URDF模型没有关节信息"),[];let b;const d=[];return Object.keys(p.joints).forEach(M=>{const f=p.joints[M];if(f._jointType==="fixed")return;const A=f.limit?{lower:f.limit.lower??m(f._jointType,!1),upper:f.limit.upper??m(f._jointType,!0)}:{lower:m(f._jointType,!1),upper:m(f._jointType,!0)};d.push({name:M,type:f._jointType||"unknown",limit:A,currentValue:f.angle||0,urdfJoint:f})}),p.traverse(M=>{var f;M.name==="Pipe_Link"&&!b&&((f=M.children)==null||f.forEach(A=>{A&&!b&&(b=A)}))}),b?(v.value=b,d.sort((M,f)=>M.name.localeCompare(f.name))):!1},R=(p,b)=>{const d=s.value.find(f=>f.name===p);if(!d)return;const M=parseFloat(b);if(d.limit){const f=Math.max(d.limit.lower,Math.min(d.limit.upper,M));d.currentValue=f}else d.currentValue=M;i.model&&i.model.setJointValue?i.model.setJointValue(p,d.currentValue):d.urdfJoint&&d.urdfJoint.setJointValue(d.currentValue)},F=p=>p.reduce((b,d)=>{let M=0;const f=d.Y??0,A=d.C??0,D=d.R??0;return f>0&&(M+=f),A>0&&D>0&&(M+=D*deg2rad(A)),b+M},0),K=p=>{const b=[],d=p.Y??0,M=p.B??0,f=p.C??0,A=p.R??0,D={pos:new o.Vector3(0,0,0),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};if(!d&&!f)return b;if(b.push(D.pos.clone()),M!==0){const G=new o.Matrix4().makeRotationAxis(D.localY,deg2rad(M));D.localX.applyMatrix4(G),D.localZ.applyMatrix4(G)}if(d>0&&(D.pos.add(D.localY.clone().multiplyScalar(d*se)),b.push(D.pos.clone())),f>0&&A>0){const G=deg2rad(f),E=A*se,h=D.pos.clone().add(D.localX.clone().multiplyScalar(-E)),Z=Math.max(16,Math.ceil(f/5));for(let $=1;$<=Z;$++){const Q=G*$/Z,W=new o.Matrix4().makeRotationAxis(D.localZ,Q),x=D.localX.clone().multiplyScalar(E).applyMatrix4(W),H=h.clone().add(x);b.push(H)}}return b},j=p=>{if(!v.value||!n.value)return;const b=y.slice(0,p+1),d=F(b),M=Math.max(0,r.value-d),f=[];f.push(new o.Vector3(0,0,0));const A=new o.Vector3(0,M*se,0);M>0&&f.push(A);let D={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 E=b.length-1;E>=0;E--){const h=b[E],Z=K(h);if(Z.length>0){const $=Z.map(x=>{const H=x.clone(),te=new o.Matrix4;return te.makeBasis(D.localX,D.localY,D.localZ),H.applyMatrix4(te),H.add(D.pos)});G.push($);const Q=$[$.length-1];D.pos=Q.clone();const W=h.B??0,ee=h.C??0;if(W!==0){const x=new o.Matrix4().makeRotationAxis(D.localY,deg2rad(W));D.localX.applyMatrix4(x),D.localZ.applyMatrix4(x)}if(ee>0){const x=deg2rad(ee),H=new o.Matrix4().makeRotationAxis(D.localZ,x);D.localY.applyMatrix4(H),D.localX.applyMatrix4(H)}}}for(const E of G)E.length>1&&f.push(...E.slice(1));f.length<2&&f.push(new o.Vector3(0,.001,0)),console.log(2321,f);try{const E=new o.CatmullRomCurve3(f,!1,"catmullrom",.01),h=new o.TubeGeometry(E,Math.max(2,f.length*4),_.value*se,18,!1);v.value.geometry.dispose(),v.value.geometry=h}catch(E){console.error("主管件更新失败",E)}},B=p=>{p&&Object.keys(p).forEach((b,d)=>{const M=p[b],f=s.value.find(A=>A.name===b);f&&(f.currentValue=M,i.model&&i.model.setJointValue?i.model.setJointValue(b,M):f.urdfJoint&&f.urdfJoint.setJointValue(M)),console.log(232,d),j(d)})},g=(p,b,d)=>p+(b-p)*d,u=(p,b,d)=>{if(!p||!b)return p||b;const M={};return Object.keys(p).forEach(f=>{const A=p[f],D=b[f];M[f]=g(A,D||A,d)}),M},S=()=>{if(y.length===0){console.warn("没有动画数据");return}P.value=!0,V.value=!1;const p=()=>{if(!P.value||V.value)return;const b=L.value/ce,d=y[z.value],M=y[z.value+1];if(M){const f=u(d,M,b);B(f)}else B(d);if(L.value++,L.value>=ce&&(L.value=0,z.value++,z.value>=y.length-1)){U();return}C.value=setTimeout(p,T())};p()},Y=()=>{V.value=!0,C.value&&(clearTimeout(C.value),C.value=null)},U=()=>{P.value=!1,V.value=!1,c.value=1,C.value&&(clearTimeout(C.value),C.value=null)};t({startAnimation:S,pauseAnimation:Y,stopAnimation:U,resetAll:()=>{U(),z.value=0,L.value=0,s.value.forEach(p=>{(p.type==="revolute"||p.type==="prismatic")&&R(p.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,p=>{p?s.value=w(p):s.value=[]},{immediate:!0});const ae=()=>{!i.model||P.value&&!V.value||s.value.forEach(p=>{p.urdfJoint&&p.urdfJoint.angle!==void 0&&(p.currentValue=p.urdfJoint.angle)})},le=()=>{const p=()=>{ae(),l.value=requestAnimationFrame(p)};p()},ie=()=>{l.value&&(cancelAnimationFrame(l.value),l.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ie(),U()}),(p,b)=>(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 M,f,A,D;return e.openBlock(),e.createElementBlock("div",{key:d.name,class:"joint-item"},[e.createElementVNode("div",Fe,[e.createElementVNode("div",Ye,[e.createElementVNode("span",Ze,e.toDisplayString(d.name),1),e.createElementVNode("span",He," ["+e.toDisplayString(((M=d.limit)==null?void 0:M.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:((D=d.limit)==null?void 0:D.upper)??(d.type==="revolute"?Math.PI:1),step:.01,value:d.currentValue,onInput:G=>R(d.name,G.target.value),class:"joint-slider",disabled:P.value&&!V.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,b[0]||(b[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},ot=oe._export_sfc(tt,[["__scopeId","data-v-4be83c6c"]]),it=["xlink:href"],nt=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(a){const t=a,i=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),l=e.computed(()=>{const{size:_}=t;let v=`${_}`;return v=`${v.replace("px","")}px`,{width:v,height:v}});return(_,v)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:_.active}]),style:e.normalizeStyle(i.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[_.$attrs.class,_.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(l.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,it)],6))],6))}}),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 _=null,v=!1;const r=e.ref(null),P=e.ref(!1),V=e.ref("");e.ref(!1);const z=e.ref(!1),L=e.ref(!1),C=e.ref(""),c=e.ref(!1),T=e.ref(""),y=e.ref(),{currentModels:n,initialCameraPosition:m,initialTargetPosition:w,initThreeJS:R,handleResize:F,fitCameraToAllModels:K,getThreeJSObjects:j,clearAllModels:B,cleanup:g}=Te(r),{isAnimating:u,toggleAnimation:S,stopAnimation:Y}=Ce(j,n),{isClipping:U,activeClippingAxis:O,toggleClipping:J,updateClippingPlanes:q}=Ae(j,n),{addModelsFromUrls:ae,loadModelByDefaultPath:le,urdfModel:ie}=o.useModelLoader(j,n,P,V,B),p=()=>{if(z.value||n.value.length===0)return;z.value=!0,u.value&&Y();const{camera:E,controls:h}=j();if(!E||!h)return;h.enabled=!0;const Z=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,$=E.position.clone(),Q=h.target.clone(),W=1500,ee=Date.now(),x=()=>{const H=Date.now()-ee,te=Math.min(H/W,1),ue=Z(te);E.position.lerpVectors($,m.value,ue),h.target.lerpVectors(Q,w.value,ue),te<1?requestAnimationFrame(x):z.value=!1};x()},b=async()=>v?Promise.resolve():new Promise(E=>{const h=()=>{v?E():requestAnimationFrame(h)};h()}),d=async(E,h)=>{try{await b(),u.value&&Y(),U.value&&J();const Z=await h(E);return K(),Z}catch(Z){throw console.error("加载模型失败:",Z),Z}},M=async E=>d(E,ae),f=async E=>d(E,le),A=E=>{L.value=!0,C.value=E,E==="剖面视图"&&!U.value&&J()},D=E=>{c.value=!0,T.value=E},G=()=>{s("getAnimationData"),e.nextTick(()=>{var E;(E=y.value)==null||E.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{R(),_=j().scene,v=!0,window.addEventListener("resize",F)}catch(E){console.error("Three.js初始化失败:",E)}}),e.onBeforeUnmount(()=>{v=!1,C.value="",T.value="",window.removeEventListener("resize",F),u.value&&Y(),g()}),t({addModelsFromUrls:M,loadModelByDefaultPath:f}),(E,h)=>{var $,Q,W,ee;const Z=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:p,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(u)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",rt,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:h[0]||(h[0]=x=>A("场景树")),active:L.value&&C.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:h[1]||(h[1]=x=>A("剖面视图")),active:L.value&&C.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[2]||(h[2]=x=>A("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:h[3]||(h[3]=x=>A("场景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=>D("关节控制")),active:c.value&&T.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"DongHuaFangZhen",size:"24",title:"动画仿真",onClick:h[5]||(h[5]=x=>D("动画仿真")),active:c.value&&T.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:($=y.value)==null?void 0:$.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:G}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(Q=y.value)==null?void 0:Q.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=y.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(ee=y.value)==null?void 0:ee.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=>L.value=!1)}," X ")]),e.createVNode(Z,{"max-height":"650px"},{default:e.withCtx(()=>[C.value==="场景树"?(e.openBlock(),e.createBlock(Ie,{key:0,model:e.unref(ie)},null,8,["model"])):e.createCommentVNode("",!0),C.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("label",ft,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":h[7]||(h[7]=x=>e.isRef(O)?O.value=x:null),onChange:h[8]||(h[8]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(O)]]),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(O)?O.value=x:null),onChange:h[10]||(h[10]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(O)]]),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(O)?O.value=x:null),onChange:h[12]||(h[12]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(O)]]),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(O)?O.value=x:null),onChange:h[14]||(h[14]=(...x)=>e.unref(q)&&e.unref(q)(...x))},null,544),[[e.vModelRadio,e.unref(O)]]),h[19]||(h[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,L.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",bt,[e.createElementVNode("span",null,e.toDisplayString(T.value),1),e.createElementVNode("span",{class:"close",onClick:h[15]||(h[15]=x=>c.value=!1)}," X ")]),e.createVNode(Z,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ot,{ref_key:"jointRef",ref:y,model:e.unref(ie),scene:e.unref(_),animationData:l==null?void 0:l.animationData},null,8,["model","scene","animationData"]),[[e.vShow,T.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{animationData:l==null?void 0:l.animationData},null,8,["animationData"]),[[e.vShow,T.value==="动画仿真"]])]),_:1})],512),[[e.vShow,c.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;