ss-component-new 1.1.641 → 1.1.643
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/{array-VzXJcPjW.js → array-B8lWuPWk.js} +1 -1
- package/dist/{crypto-CRbcEKIz.cjs → crypto-DNSUM6-T.cjs} +11 -11
- package/dist/{crypto-BRyGpjGR.js → crypto-v3jAna0Y.js} +510 -383
- package/dist/index-B1zrlvmA.cjs +1 -0
- package/dist/{index-CmiV5XIf.cjs → index-B3Uwh6Xf.cjs} +1 -1
- package/dist/{index-C1wsQvWA.js → index-B3z_K4tN.js} +6 -6
- package/dist/{index-BSq1_igb.js → index-B98K3NQ_.js} +5 -5
- package/dist/{index-t5gEjDaU.cjs → index-BGU26U8N.cjs} +1 -1
- package/dist/index-BJOfcIfK.cjs +1 -0
- package/dist/{index-eFEWH0CT.cjs → index-BV7GMSHu.cjs} +1 -1
- package/dist/{index-CgBJhDgc.js → index-BXkdOTkd.js} +6 -6
- package/dist/index-BdSJGJAj.cjs +1 -0
- package/dist/index-BgOWcpJo.cjs +1 -0
- package/dist/index-BgjQ12lw.cjs +1 -0
- package/dist/index-Bjsc84L1.js +1357 -0
- package/dist/index-BtbXPos3.cjs +1 -0
- package/dist/index-C0YmHmRc.js +3295 -0
- package/dist/{index-B9JN6GiA.js → index-C90tv0Xl.js} +9 -10
- package/dist/index-CHDQYj9k.cjs +7 -0
- package/dist/{index-D-u3BBde.cjs → index-CUE8dRo3.cjs} +1 -1
- package/dist/{index-BdC8VdZV.js → index-Ce6cmWoK.js} +1 -1
- package/dist/{index-COe0AKmG.js → index-Cf8HSIB7.js} +9 -9
- package/dist/{index-DivndMew.js → index-CoO_L719.js} +1 -1
- package/dist/{index-Dtsb5A9W.cjs → index-Cq5FEQ8T.cjs} +1 -1
- package/dist/{index-bxA-k3D8.js → index-CstZeLoO.js} +4 -4
- package/dist/{index-BDUZPFuu.js → index-CzRn17aQ.js} +3 -3
- package/dist/{index-h3FJuBkM.js → index-D9rKJ22p.js} +24 -25
- package/dist/{index-BSItzZL7.cjs → index-DDZUeSoG.cjs} +1 -1
- package/dist/{index-BShB-8d9.js → index-DJq9wJbj.js} +6 -6
- package/dist/index-DYLTl0bA.cjs +4207 -0
- package/dist/{index-DIojadyo.js → index-DZOOs3JX.js} +5 -5
- package/dist/{index-DDkuhF7W.js → index-DaCmhrZN.js} +5 -5
- package/dist/{index-CZVc3Or_.cjs → index-DamR6g_M.cjs} +1 -1
- package/dist/{index-Crd7Dg0j.js → index-Dc9ujwGk.js} +1 -1
- package/dist/{index-BgVieMmq.js → index-DkuHB0rR.js} +6 -6
- package/dist/{index-PoFKTn5c.js → index-DnROsSAu.js} +1 -1
- package/dist/{index-DIEuoEuZ.js → index-Dv0m3N6o.js} +13688 -8591
- package/dist/{index-DKUyEy-O.cjs → index-H7RfjeN4.cjs} +1 -1
- package/dist/{index--7CXDWhp.js → index-S9mHFIiJ.js} +5 -6
- package/dist/{index-BMLnk4tK.js → index-TImrSuqA.js} +7 -7
- package/dist/{index-qJTvlSE4.cjs → index-Wq7SUf3w.cjs} +1 -1
- package/dist/{index-B3pzeaEn.cjs → index-XoLdZvmA.cjs} +1 -1
- package/dist/{index-BqT6FOpQ.cjs → index-j-6MQx0k.cjs} +1 -1
- package/dist/{index-CPIuib6Z.js → index-j_-9sdsj.js} +5 -5
- package/dist/{index--YE0I3eJ.cjs → index-yP9dxTXr.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-BSHKpL3U.cjs → index.vue_vue_type_script_setup_true_lang-DPRs_TEM.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-zFnpYkL9.js → index.vue_vue_type_script_setup_true_lang-DmZ8M3M2.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Ds2Sv3Xv.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CLRx6Pr7.js} +6287 -6287
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CsM4kD2l.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-G9Ly6LrV.cjs} +100 -100
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Cj4SDzVh.js → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Bx59UssX.js} +9761 -10107
- package/dist/{index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-CBmEjZ1W.cjs → index.vue_vue_type_style_index_0_scoped_248ffa0f_lang-Cx257lrG.cjs} +13 -13
- package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-BxhCfpJ1.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-CZw5zzDj.js → index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-DnzbmtTR.js} +8 -8
- package/dist/{main-CuzsZxGq.js → main-B3z7cAFc.js} +5 -5
- package/dist/{main-Cm90V52F.cjs → main-Bytk3eJi.cjs} +1 -1
- package/dist/{menu-wif0xsml.js → menu-EkyEcRhA.js} +16 -16
- package/dist/{modelComp-CJ4sMWBs.js → modelComp-DocJQ-pY.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +9 -9
- package/dist/{threeModel-B-xHjjGT.js → threeModel-8fmYfsGI.js} +62 -62
- package/dist/{threeModel-Bf9c_DS5.cjs → threeModel-DUi0i12h.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-1CHqDeCV.js +0 -1366
- package/dist/index-B4pwTIJ4.cjs +0 -1
- package/dist/index-BHxSsIXo.js +0 -2511
- package/dist/index-BK43_N9M.cjs +0 -1
- package/dist/index-B_G9Phpw.cjs +0 -1
- package/dist/index-BnN2rNsF.cjs +0 -1
- package/dist/index-CDe14QVc.cjs +0 -1
- package/dist/index-CLvHw6UB.cjs +0 -1
- package/dist/index-D8krRZ2d.cjs +0 -4207
- package/dist/index-DgSqC47C.cjs +0 -1
- package/dist/index-DiRkx0Jd.js +0 -4693
- package/dist/index-MSj62TUk.cjs +0 -7
- package/dist/index-xG5ojf2o.cjs +0 -1
- package/dist/index-zwRivr5J.js +0 -791
- package/dist/index.vue_vue_type_style_index_0_scoped_c8f6ea20_lang-CtgbucH4.cjs +0 -1
- package/dist/login-C7jVTvUQ.cjs +0 -1
- package/dist/login-wUTWXQ7u.js +0 -129
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-D8krRZ2d.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=require("./menu-CcabvNj6.cjs"),ye={type:"change"},_e={type:"start"},be={type:"end"},ue=new o.Ray,ve=new o.Plane,we=Math.cos(70*o.MathUtils.DEG2RAD),B=new o.Vector3,K=2*Math.PI,S={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},me=1e-6;class Ee extends o.Controls{constructor(t,n=null){super(t,n),this.state=S.NONE,this.target=new o.Vector3,this.cursor=new o.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.touches={ONE:o.TOUCH.ROTATE,TWO:o.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new o.Vector3,this._lastQuaternion=new o.Quaternion,this._lastTargetPosition=new o.Vector3,this._quat=new o.Quaternion().setFromUnitVectors(t.up,new o.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new o.Spherical,this._sphericalDelta=new o.Spherical,this._scale=1,this._panOffset=new o.Vector3,this._rotateStart=new o.Vector2,this._rotateEnd=new o.Vector2,this._rotateDelta=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._panDelta=new o.Vector2,this._dollyStart=new o.Vector2,this._dollyEnd=new o.Vector2,this._dollyDelta=new o.Vector2,this._dollyDirection=new o.Vector3,this._mouse=new o.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Me.bind(this),this._onPointerDown=Pe.bind(this),this._onPointerUp=xe.bind(this),this._onContextMenu=Ae.bind(this),this._onMouseWheel=Se.bind(this),this._onKeyDown=ke.bind(this),this._onTouchStart=Te.bind(this),this._onTouchMove=Ce.bind(this),this._onMouseDown=De.bind(this),this._onMouseMove=Ve.bind(this),this._interceptControlDown=Ne.bind(this),this._interceptControlUp=Re.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(ye),this.update(),this.state=S.NONE}update(t=null){const n=this.object.position;B.copy(n).sub(this.target),B.applyQuaternion(this._quat),this._spherical.setFromVector3(B),this.autoRotate&&this.state===S.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(s)&&isFinite(r)&&(s<-Math.PI?s+=K:s>Math.PI&&(s-=K),r<-Math.PI?r+=K:r>Math.PI&&(r-=K),s<=r?this._spherical.theta=Math.max(s,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+r)/2?Math.max(s,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let f=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const w=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),f=w!=this._spherical.radius}if(B.setFromSpherical(this._spherical),B.applyQuaternion(this._quatInverse),n.copy(this.target).add(B),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 w=null;if(this.object.isPerspectiveCamera){const c=B.length();w=this._clampDistance(c*this._scale);const x=c-w;this.object.position.addScaledVector(this._dollyDirection,x),this.object.updateMatrixWorld(),f=!!x}else if(this.object.isOrthographicCamera){const c=new o.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object);const x=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),f=x!==this.object.zoom;const z=new o.Vector3(this._mouse.x,this._mouse.y,0);z.unproject(this.object),this.object.position.sub(z).add(c),this.object.updateMatrixWorld(),w=B.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;w!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(w).add(this.object.position):(ue.origin.copy(this.object.position),ue.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ue.direction))<we?this.object.lookAt(this.target):(ve.setFromNormalAndCoplanarPoint(this.object.up,this.target),ue.intersectPlane(ve,this.target))))}else if(this.object.isOrthographicCamera){const w=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),w!==this.object.zoom&&(this.object.updateProjectionMatrix(),f=!0)}return this._scale=1,this._performCursorZoom=!1,f||this._lastPosition.distanceToSquared(this.object.position)>me||8*(1-this._lastQuaternion.dot(this.object.quaternion))>me||this._lastTargetPosition.distanceToSquared(this.target)>me?(this.dispatchEvent(ye),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 n=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,n){B.setFromMatrixColumn(n,0),B.multiplyScalar(-t),this._panOffset.add(B)}_panUp(t,n){this.screenSpacePanning===!0?B.setFromMatrixColumn(n,1):(B.setFromMatrixColumn(n,0),B.crossVectors(this.object.up,B)),B.multiplyScalar(t),this._panOffset.add(B)}_pan(t,n){const s=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;B.copy(r).sub(this.target);let f=B.length();f*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*f/s.clientHeight,this.object.matrix),this._panUp(2*n*f/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(n*(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,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),r=t-s.left,f=n-s.top,w=s.width,c=s.height;this._mouse.x=r/w*2-1,this._mouse.y=-(f/c)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(K*this._rotateDelta.x/n.clientHeight),this._rotateUp(K*this._rotateDelta.y/n.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 n=!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),n=!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),n=!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),n=!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),n=!0;break}n&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateStart.set(s,r)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panStart.set(s,r)}}_handleTouchStartDolly(t){const n=this._getSecondPointerPosition(t),s=t.pageX-n.x,r=t.pageY-n.y,f=Math.sqrt(s*s+r*r);this._dollyStart.set(0,f)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),r=.5*(t.pageX+s.x),f=.5*(t.pageY+s.y);this._rotateEnd.set(r,f)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(K*this._rotateDelta.x/n.clientHeight),this._rotateUp(K*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panEnd.set(s,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const n=this._getSecondPointerPosition(t),s=t.pageX-n.x,r=t.pageY-n.y,f=Math.sqrt(s*s+r*r);this._dollyEnd.set(0,f),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 w=(t.pageX+n.x)*.5,c=(t.pageY+n.y)*.5;this._updateZoomParameters(w,c)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==t.pointerId){this._pointers.splice(n,1);return}}_isTrackingPointer(t){for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==t.pointerId)return!0;return!1}_trackPointer(t){let n=this._pointerPositions[t.pointerId];n===void 0&&(n=new o.Vector2,this._pointerPositions[t.pointerId]=n),n.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const n=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[n]}_customWheelEvent(t){const n=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(n){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function Pe(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 Me(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function xe(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(be),this.state=S.NONE;break;case 1:const t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function De(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=S.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=S.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=S.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=S.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=S.PAN}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(_e)}function Ve(a){switch(this.state){case S.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case S.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case S.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Se(a){this.enabled===!1||this.enableZoom===!1||this.state!==S.NONE||(a.preventDefault(),this.dispatchEvent(_e),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(be))}function ke(a){this.enabled!==!1&&this._handleKeyDown(a)}function Te(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=S.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=S.TOUCH_PAN;break;default:this.state=S.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=S.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=S.TOUCH_DOLLY_ROTATE;break;default:this.state=S.NONE}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(_e)}function Ce(a){switch(this._trackPointer(a),this.state){case S.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case S.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case S.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case S.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=S.NONE}}function Ae(a){this.enabled!==!1&&a.preventDefault()}function Ne(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Re(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ze(a){let t=null,n=null,s=null,r=null,f=null,w=null,c=null,x=null;const C=1e3/30;let N=0;const k=e.ref([]),m=e.ref(new o.Vector3),D=e.ref(new o.Vector3),b=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const g=a.value;n=new o.PerspectiveCamera(75,g.clientWidth/g.clientHeight,.1,1e4),n.position.set(8,-8,6),n.up.set(0,0,1),n.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),r=new Ee(n,s.domElement),r.enableDamping=!0,r.dampingFactor=.05,r.mouseButtons={LEFT:null,MIDDLE:o.MOUSE.PAN,RIGHT:o.MOUSE.ROTATE},r.panSpeed=.7,f=new o.Xe(n,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"}}),f.attachControls(r),y(),V()},i=(g,u)=>{c&&(t.remove(c),c.dispose()),x&&(t.remove(x),x.geometry.dispose(),x.material.dispose());const T=Math.min(Math.max(Math.floor(g/20),30),40);c=new o.GridHelper(g,T,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(u),t.add(c);const R=new o.PlaneGeometry(g,g),Z=new o.ShadowMaterial({opacity:.3,color:0});x=new o.Mesh(R,Z),x.position.copy(u),x.position.z-=.01,x.receiveShadow=!0,t.add(x)},_=()=>{if(k.value.length===0)return;const g=new o.Box3;let u=!1;if(k.value.forEach(J=>{if(J.userData.boundingBox)g.union(J.userData.boundingBox),u=!0;else if(J.userData.modelId&&modelBoundingBoxes.has(J.userData.modelId)){const Q=modelBoundingBoxes.get(J.userData.modelId);g.union(Q.box),u=!0}else g.expandByObject(J),u=!0}),!u){console.warn("无法计算包围盒,网格更新失败");return}const T=g.getSize(new o.Vector3),R=g.getCenter(new o.Vector3),Z=Math.max(T.x,T.y,T.z),$=Math.max(Z*8,50),G=new o.Vector3(R.x,R.y,g.min.z);i($,G)},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 T=new o.DirectionalLight(16777215,.8);T.position.set(-8,-8,6),t.add(T);const R=new o.DirectionalLight(16777215,.6);R.position.set(0,-15,2),t.add(R);const Z=new o.HemisphereLight(16777215,4473924,.8);t.add(Z);const $=new o.PointLight(16777215,1,50);$.position.set(15,15,15),t.add($);const G=new o.PointLight(16777215,.5,50);G.position.set(-15,-15,15),t.add(G)},V=()=>{w=requestAnimationFrame(V),r&&r.update();const g=performance.now(),u=g-N;u<C||(N=g-u%C,s&&t&&n&&s.render(t,n),f&&f.render())},U=g=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(T=>{g[T]&&g[T].dispose&&g[T].dispose()}),g.dispose&&g.dispose()},O=g=>{g==null||g.traverse(u=>{u.geometry&&u.geometry.dispose(),u.material&&(Array.isArray(u.material)?u.material.forEach(T=>{U(T)}):U(u.material))})};return{currentModels:k,initialCameraPosition:m,initialTargetPosition:D,initThreeJS:b,handleResize:()=>{if(!a.value||!n||!s||!f)return;const g=a.value,u=g.clientWidth,T=g.clientHeight;n.aspect=u/T,n.updateProjectionMatrix(),s.setSize(u,T),f.update()},fitCameraToAllModels:g=>{if(!n||!r||k.value.length===0)return;const u=new o.Box3;let T=!1;if(k.value.forEach(Q=>{if(Q.userData.boundingBox)u.union(Q.userData.boundingBox),T=!0;else if(Q.userData.modelId&&g.has(Q.userData.modelId)){const ne=g.get(Q.userData.modelId);u.union(ne.box),T=!0}else u.expandByObject(Q),T=!0}),!T){console.warn("无法计算包围盒");return}const R=u.getSize(new o.Vector3),Z=u.getCenter(new o.Vector3),G=Math.max(R.x,R.y,R.z)*.8,J=new o.Vector3(Z.x+G,Z.y-G,Z.z+G);n.position.copy(J),n.lookAt(Z),r.target.copy(Z),r.update(),m.value.copy(J),D.value.copy(Z),_()},getThreeJSObjects:()=>({scene:t,camera:n,renderer:s,controls:r,gizmo:f}),clearAllModels:()=>{if(!t)return;k.value.forEach(u=>{t.remove(u),O(u)});const g=[];t.children.forEach(u=>{!u.isLight&&!u.isCamera&&u.type!=="GridHelper"&&u!==x&&g.push(u)}),g.forEach(u=>{t.remove(u),O(u)}),k.value=[],_()},cleanup:()=>{w&&cancelAnimationFrame(w),c&&c.dispose(),x&&(x.geometry.dispose(),x.material.dispose()),s&&s.dispose(),r&&r.dispose(),f&&f.dispose()},updateGridForModels:_}}function Oe(a,t){const n=e.ref(!1);let s=null,r=12700,f=new o.Vector3,w=new o.Vector3,c=new o.Vector3,x=0,z=null;const C=i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,N=i=>{const _=new o.Vector3,y=x*1.2,V=new o.Vector3(c.x+y,c.y,c.z),U=new o.Vector3(c.x,c.y+y,c.z),O=new o.Vector3(c.x,c.y-y,c.z);if(i<=.567){const F=i/.567*Math.PI*2;_.x=c.x+Math.cos(F)*y,_.z=c.z+Math.sin(F)*y,_.y=c.y}else if(i<=.724){const I=(i-.567)/.157,F=C(I);_.lerpVectors(V,U,F)}else if(i<=.881){const I=(i-.724)/.157,Y=C(I)*Math.PI;_.x=c.x+Math.sin(Y)*y,_.y=c.y+Math.cos(Y)*y,_.z=c.z}else{const I=(i-.881)/.119,F=C(I);_.lerpVectors(O,f,F)}return _},k=()=>{const{camera:i,controls:_}=a();if(!i||!_)return;s||(s=Date.now());const y=Date.now()-s,V=Math.min(y/r,1);if(V>=1){D();return}const U=N(V);i.position.copy(U),i.lookAt(c),_.target.copy(c),z=requestAnimationFrame(k)},m=()=>{if(t.value.length===0)return;const{camera:i,controls:_}=a();if(!i||!_)return;f.copy(i.position),w.copy(_.target);const y=new o.Box3;t.value.forEach(X=>{y.expandByObject(X)});const V=y.getSize(new o.Vector3);c=y.getCenter(new o.Vector3),x=Math.max(V.x,V.y,V.z)*1.2;const U=new o.Vector3(c.x+x*1.2,c.y,c.z);_.enabled=!1;const O=i.position.clone(),I=1e3,F=Date.now(),Y=()=>{const X=Date.now()-F,W=Math.min(X/I,1),g=C(W);i.position.lerpVectors(O,U,g),i.lookAt(c),_.target.copy(c),W<1?requestAnimationFrame(Y):(n.value=!0,s=null,k())};Y()},D=()=>{n.value=!1,s=null,z&&(cancelAnimationFrame(z),z=null);const{controls:i}=a();i&&(i.enabled=!0,i.target.copy(w))};return{isAnimating:n,toggleAnimation:()=>{if(n.value){n.value=!1,s=null,z&&(cancelAnimationFrame(z),z=null);const{camera:i,controls:_}=a();if(!i||!_)return;_.enabled=!0;const y=i.position.clone(),V=_.target.clone(),U=1500,O=Date.now(),I=()=>{const F=Date.now()-O,Y=Math.min(F/U,1),X=C(Y);i.position.lerpVectors(y,f,X),_.target.lerpVectors(V,w,X),Y<1&&requestAnimationFrame(I)};I()}else m()},startAnimation:m,stopAnimation:D}}function Le(a,t){const n=e.ref(!1),s=e.ref("none");let r=[],f=[],w=new o.Box3,c=new o.Vector3;const x=()=>{r=[new o.Plane(new o.Vector3(1,0,0),0),new o.Plane(new o.Vector3(0,1,0),0),new o.Plane(new o.Vector3(0,0,1),0)]},z=()=>{w.makeEmpty(),t.value.forEach(b=>{w.expandByObject(b)}),c=w.getCenter(new o.Vector3)},C=b=>{const i=w.getSize(new o.Vector3);let _,y,V;b==="x"?(_=new o.PlaneGeometry(i.z*1.2,i.y*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(0,Math.PI/2,0)):b==="y"?(_=new o.PlaneGeometry(i.x*1.2,i.z*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(Math.PI/2,0,0)):b==="z"&&(_=new o.PlaneGeometry(i.x*1.2,i.y*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(0,0,0));const U=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),O=new o.Mesh(_,U);return O.position.copy(y),O.rotation.copy(V),O},N=()=>{if(k(),m(),s.value==="none")return;z();let b=null;if(s.value==="x"?(r[0].constant=-c.x,b=r[0]):s.value==="y"?(r[1].constant=-c.y,b=r[1]):s.value==="z"&&(r[2].constant=-c.z,b=r[2]),b){t.value.forEach(_=>{_.traverse(y=>{y.isMesh&&y.material&&(Array.isArray(y.material)?y.material.forEach(V=>{V.clippingPlanes=[b]}):y.material.clippingPlanes=[b])})});const{scene:i}=a();if(i){const _=C(s.value);i.add(_),f.push(_)}}},k=()=>{t.value.forEach(b=>{b.traverse(i=>{i.isMesh&&i.material&&(Array.isArray(i.material)?i.material.forEach(_=>{_.clippingPlanes=[]}):i.material.clippingPlanes=[])})})},m=()=>{const{scene:b}=a();b&&f.forEach(i=>{b.remove(i),i.geometry.dispose(),i.material.dispose()}),f=[]};return{isClipping:n,activeClippingAxis:s,toggleClipping:()=>{n.value=!n.value,n.value?(x(),t.value.length>0&&z()):(s.value="none",k(),m())},updateClippingPlanes:N,clearClippingPlanes:k,clearClippingMeshes:m}}const je={class:"panel-content"},Be={__name:"animationPanel",props:{animationData:Object,model:Object},setup(a){const t=a;e.ref();const n=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var r;let s=((r=de.cloneDeep(t==null?void 0:t.animationData))==null?void 0:r.动画输出Content)??[];s&&(n.value=s)},{deep:!0,immediate:!0}),(s,r)=>{var f,w,c;return e.openBlock(),e.createElementBlock("div",je,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(f=n.value)==null?void 0:f.compData,key:(w=n.value)==null?void 0:w.id,index:(c=n.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},Ie=le._export_sfc(Be,[["__scopeId","data-v-1e90a659"]]),Ue={class:"panel-content"},Fe={key:0,class:"joints-list"},Ye={class:"joint-info-row"},Ze={class:"joint-left"},He={class:"joint-name"},Ke={class:"joint-range"},Xe={class:"joint-type"},$e={key:0,class:"joint-control-row"},Ge={class:"slider-container"},Je=["min","max","value","onInput","disabled"],qe={class:"value-display"},We={class:"joint-value"},Qe={class:"unit"},et={key:1,class:"empty-state"},ae=.001,tt=1e3,fe=60,ot={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const n=a;e.ref(!0);const s=e.ref([]),r=e.ref(null),f=e.ref(null),w=e.ref(12.5),c=e.ref(),x=e.ref(1302),z=e.ref(30),C=e.ref(!1),N=e.ref(!1),k=e.ref(0),m=e.ref(0),D=e.ref(null),b=o.MathUtils.degToRad,i=e.ref(1),_=()=>tt/fe/i.value;let y=[];e.watch(()=>n.animationData,h=>{var p;x.value=h.extra.管长,w.value=h.extra.外径/2;let v=((p=de.cloneDeep(h))==null?void 0:p.动画输出)??[];v&&v.length>0&&(y=v)},{deep:!0}),e.computed(()=>y.length>0);const V=(h,v=!1)=>h==="revolute"?v?Math.PI:-Math.PI:h==="prismatic"?v?1:-1:0,U=()=>{if(!r.value)return de.ElMessage.error("未加载 URDF"),!1;let h=null;return r.value.traverse(v=>{h||v.name==="Pipe_Link"&&v.traverse(p=>{p instanceof o.Mesh&&!h&&(h=p)})}),h?(h.position.y-=z.value*ae,c.value=h,h.material=new o.MeshPhongMaterial({color:11184810,shininess:80,side:o.DoubleSide}),!0):(de.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},O=h=>{if(!h||!h.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(h.traverse(P=>{P.name==="Pipe_Link"&&!v&&(v=P)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const p=[];return Object.keys(h.joints).forEach(P=>{const d=h.joints[P];if(d._jointType==="fixed")return;const l=d.limit?{lower:d.limit.lower??V(d._jointType,!1),upper:d.limit.upper??V(d._jointType,!0)}:{lower:V(d._jointType,!1),upper:V(d._jointType,!0)};p.push({name:P,type:d._jointType||"unknown",limit:l,currentValue:d.angle||0,urdfJoint:d})}),p.sort((P,d)=>P.name.localeCompare(d.name))},I=(h,v)=>{const p=s.value.find(d=>d.name===h);if(!p)return;const P=parseFloat(v);if(p.limit){const d=Math.max(p.limit.lower,Math.min(p.limit.upper,P));p.currentValue=d}else p.currentValue=P;n.model&&n.model.setJointValue?n.model.setJointValue(h,p.currentValue):p.urdfJoint&&p.urdfJoint.setJointValue(p.currentValue)},F=h=>h.reduce((v,p)=>{let P=0;const d=p.Y??0,l=p.C??0,E=p.R??0;return d>0&&(P+=d),l>0&&E>0&&(P+=E*b(l)),v+P},0),Y=h=>{const v=[],p=h.Y??0,P=h.B??0,d=h.C??0,l=h.R??0,E={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(!p&&!d)return v;if(v.push(E.pos.clone()),P!==0){const H=new o.Matrix4().makeRotationAxis(E.localY,b(P));E.localX.applyMatrix4(H),E.localZ.applyMatrix4(H)}if(p>0&&(E.pos.add(E.localY.clone().multiplyScalar(p*ae)),v.push(E.pos.clone())),d>0&&l>0){const H=b(d),j=l*ae,ee=E.pos.clone().add(E.localX.clone().multiplyScalar(-j)),L=Math.max(16,Math.ceil(d/5));for(let M=1;M<=L;M++){const q=H*M/L,te=new o.Matrix4().makeRotationAxis(E.localZ,q),ce=E.localX.clone().multiplyScalar(j).applyMatrix4(te),he=ee.clone().add(ce);v.push(he)}}return v},X=(h,v=0)=>{let p=y.slice(0,h+1);const P=y[h+1];if(P&&v>0){const L={...P,B:(P.B??0)*v,C:(P.C??0)*v};p.push(L)}const d=F(p),l=Math.max(0,x.value-d),E=[];E.push(new o.Vector3(0,0,0));const H=new o.Vector3(0,l*ae,0);l>0&&E.push(H);let j={pos:H.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const ee=[];for(let L=p.length-1;L>=0;L--){const M=p[L],q=Y(M);if(q.length>0){const te=q.map(oe=>{const se=oe.clone(),ge=new o.Matrix4;return ge.makeBasis(j.localX,j.localY,j.localZ),se.applyMatrix4(ge),se.add(j.pos)});ee.push(te);const ie=te[te.length-1];j.pos=ie.clone();const ce=M.B??0,he=M.C??0;if(ce!==0){const oe=new o.Matrix4().makeRotationAxis(j.localY,b(ce));j.localX.applyMatrix4(oe),j.localZ.applyMatrix4(oe)}if(he>0){const oe=b(he),se=new o.Matrix4().makeRotationAxis(j.localZ,oe);j.localY.applyMatrix4(se),j.localX.applyMatrix4(se)}}}for(const L of ee)L.length>1&&E.push(...L.slice(1));E.length<2&&E.push(new o.Vector3(0,.001,0));try{const L=new o.CatmullRomCurve3(E,!1,"catmullrom",.01),M=new o.TubeGeometry(L,Math.max(2,E.length*4),w.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(L){console.error("管件更新失败",L)}},W=(h,v,p=1)=>{h&&(Object.keys(h).forEach(P=>{const d=h[P],l=s.value.find(E=>E.name===P);l&&(l.currentValue=d,n.model&&n.model.setJointValue?n.model.setJointValue(P,d):l.urdfJoint&&l.urdfJoint.setJointValue(d))}),X(v,p))},g=(h,v,p)=>h+(v-h)*p,u=(h,v,p)=>{if(!h||!v)return h||v;const P={};return Object.keys(h).forEach(d=>{const l=h[d],E=v[d];P[d]=g(l,E||l,p)}),P},T=()=>{if(y.length===0){console.warn("没有动画数据");return}U(),C.value=!0,N.value=!1,k.value=0,m.value=0,R()},R=()=>{if(!C.value||N.value)return;const h=k.value;if(h>=y.length-1){const d=y[y.length-1];W(d,y.length-1,1),$();return}const v=m.value/fe,p=y[h],P=y[h+1];if(P){const d=u(p,P,v);W(d,h,v)}else W(p,h);m.value++,m.value>fe&&(m.value=0,k.value++),D.value=setTimeout(R,_())},Z=()=>{N.value=!0,D.value&&(clearTimeout(D.value),D.value=null)},$=()=>{C.value=!1,N.value=!1,i.value=1,D.value&&(clearTimeout(D.value),D.value=null)};t({startAnimation:T,pauseAnimation:Z,stopAnimation:$,resetAll:()=>{$(),k.value=0,m.value=0,s.value.forEach(h=>{(h.type==="revolute"||h.type==="prismatic")&&I(h.name,0)}),X(-1,0)},fastForward:()=>{i.value<4&&(i.value=Math.min(4,i.value*2))},fastBackward:()=>{i.value>.25&&(i.value=Math.max(.25,i.value/2))}}),e.watch(()=>n.model,h=>{h?(r.value=h,s.value=O(h)):s.value=[]},{immediate:!0});const ne=()=>{!n.model||C.value&&!N.value||s.value.forEach(h=>{h.urdfJoint&&h.urdfJoint.angle!==void 0&&(h.currentValue=h.urdfJoint.angle)})},re=()=>{const h=()=>{ne(),f.value=requestAnimationFrame(h)};h()},pe=()=>{f.value&&(cancelAnimationFrame(f.value),f.value=null)};return e.onMounted(()=>{re()}),e.onUnmounted(()=>{pe(),$()}),(h,v)=>(e.openBlock(),e.createElementBlock("div",Ue,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,p=>{var P,d,l,E;return e.openBlock(),e.createElementBlock("div",{key:p.name,class:"joint-item"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",He,e.toDisplayString(p.name),1),e.createElementVNode("span",Ke," ["+e.toDisplayString(((P=p.limit)==null?void 0:P.lower.toFixed(2))??(p.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((d=p.limit)==null?void 0:d.upper.toFixed(2))??(p.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Xe,e.toDisplayString(p.type),1)]),p.type==="revolute"||p.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("div",Ge,[e.createElementVNode("input",{type:"range",min:((l=p.limit)==null?void 0:l.lower)??(p.type==="revolute"?-Math.PI:-1),max:((E=p.limit)==null?void 0:E.upper)??(p.type==="revolute"?Math.PI:1),step:.01,value:p.currentValue,onInput:H=>I(p.name,H.target.value),class:"joint-slider",disabled:C.value&&!N.value},null,40,Je)]),e.createElementVNode("div",qe,[e.createElementVNode("span",We,e.toDisplayString(p.currentValue?Number(p.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Qe,e.toDisplayString(p.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",et,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},nt=le._export_sfc(ot,[["__scopeId","data-v-0bb82714"]]),it={class:"panel-content"},st="id",at={__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 n=a,s=t,r=e.ref([]),f={children:"children",label:"label"},w=m=>{s("nodeClick",m)},c=(m,D=0)=>{const b=[];return Array.isArray(m)&&(m==null?void 0:m.length)>0&&m.forEach(i=>{if(!(i!=null&&i.isMesh)&&((i==null?void 0:i.type)==="URDFJoint"||(i==null?void 0:i.type)==="URDFLink")){const _={name:i==null?void 0:i.name,label:i==null?void 0:i.name,show:!0,level:D+1,isPenultimate:!1,type:i==null?void 0:i.type,id:i==null?void 0:i.id,limit:(i==null?void 0:i.limit)??"",children:c(i==null?void 0:i.children,D+1),path:i==null?void 0:i.name};b.push(_)}}),b},x=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:c(m==null?void 0:m.children,1),path:m==null?void 0:m.name}]:[],z=(m,D)=>{const b=[],i=[...m];for(;i.length>0&&b.length<D;){const _=i.shift();_.children&&_.children.length>0&&(b.push(_.id),i.push(..._.children))}return b},C=(m,D)=>{const b=[];return m.forEach(i=>{if(i.children&&i.children.length>0){b.push(i.id);const _=i.children.filter(y=>y.children&&y.children.length>0).slice(0,D).map(y=>y.id);b.push(..._)}}),b.slice(0,D+1)},N=e.computed(()=>!r.value||r.value.length===0?[]:n.expandStrategy==="firstLevel"?C(r.value,n.maxExpandCount):z(r.value,n.maxExpandCount)),k=e.computed(()=>n!=null&&n.model?x(n.model):[]);return e.watch(k,m=>{r.value=JSON.parse(JSON.stringify(m))},{immediate:!0}),(m,D)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",it,[e.createVNode(b,{data:r.value,props:f,"default-expanded-keys":N.value,"node-key":st,onNodeClick:w},null,8,["data","default-expanded-keys"])])}}},lt=le._export_sfc(at,[["__scopeId","data-v-290ff4e1"]]),rt=["xlink:href"],ct=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,n=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),r=e.computed(()=>{const{size:f}=t;let w=`${f}`;return w=`${w.replace("px","")}px`,{width:w,height:w}});return(f,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:f.active}]),style:e.normalizeStyle(n.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[f.$attrs.class,f.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(r.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,rt)],6))],6))}}),A=le._export_sfc(ct,[["__scopeId","data-v-3150a90b"]]),ht={class:"obj-viewer-container"},ut={class:"buttonGroup-top"},dt={class:"buttonGroup-topLeft"},pt={class:"buttonGroup-left"},mt={class:"buttonGroup-right"},ft={class:"buttonGroup-bottom"},_t={class:"left-panel"},gt={class:"panel-header"},yt={key:1,class:"clipping-content"},vt={class:"radio-group"},bt={class:"radio-label"},wt={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},Mt={class:"right-panel"},xt={class:"panel-header"},Dt={key:0,class:"loading-overlay"},Vt={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(a,{expose:t,emit:n}){const s=n;let r=null,f=!1;const w=e.ref(null),c=e.ref(!1),x=e.ref("");e.ref(!1);const z=e.ref(!1),C=e.ref(!1),N=e.ref(""),k=e.ref(!1),m=e.ref(""),D=e.ref(),{currentModels:b,initialCameraPosition:i,initialTargetPosition:_,initThreeJS:y,handleResize:V,fitCameraToAllModels:U,getThreeJSObjects:O,clearAllModels:I,cleanup:F}=ze(w),{isAnimating:Y,toggleAnimation:X,stopAnimation:W}=Oe(O,b),{isClipping:g,activeClippingAxis:u,toggleClipping:T,updateClippingPlanes:R}=Le(O,b),{addModelsFromUrls:Z,loadModelByDefaultPath:$,urdfModel:G,modelBoundingBoxes:J}=o.useModelLoader(O,b,c,x,I),Q=()=>{if(z.value||b.value.length===0)return;z.value=!0,Y.value&&W();const{camera:d,controls:l}=O();if(!d||!l)return;l.enabled=!0;const E=q=>q<.5?4*q*q*q:1-Math.pow(-2*q+2,3)/2,H=d.position.clone(),j=l.target.clone(),ee=1500,L=Date.now(),M=()=>{const q=Date.now()-L,te=Math.min(q/ee,1),ie=E(te);d.position.lerpVectors(H,i.value,ie),l.target.lerpVectors(j,_.value,ie),te<1?requestAnimationFrame(M):z.value=!1};M()},ne=async()=>f?Promise.resolve():new Promise(d=>{const l=()=>{f?d():requestAnimationFrame(l)};l()}),re=async(d,l)=>{try{await ne(),Y.value&&W(),g.value&&T();const E=await l(d);return U(J),E}catch(E){throw console.error("加载模型失败:",E),E}},pe=async d=>re(d,Z),h=async d=>re(d,$),v=d=>{C.value=!0,N.value=d,d==="剖面视图"&&!g.value&&T()},p=d=>{k.value=!0,m.value=d,d==="动画仿真"&&s("getAnimationData")},P=()=>{e.nextTick(()=>{var d;(d=D.value)==null||d.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{y(),r=O().scene,f=!0,window.addEventListener("resize",V)}catch(d){console.error("Three.js初始化失败:",d)}}),e.onBeforeUnmount(()=>{f=!1,N.value="",m.value="",window.removeEventListener("resize",V),Y.value&&W(),F()}),t({addModelsFromUrls:pe,loadModelByDefaultPath:h}),(d,l)=>{var H,j,ee,L;const E=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:w,class:"threejs-container"},null,512),e.createElementVNode("div",ut,[e.createVNode(A,{name:"guanjianjiexi",size:"34"}),e.createVNode(A,{name:"guanjiekongzhi",size:"34"}),e.createVNode(A,{name:"gongyishengcheng",size:"34"}),e.createVNode(A,{name:"buchangshezhi",size:"34"}),e.createVNode(A,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",dt,[e.createVNode(A,{name:"viewReset",size:"24",onClick:Q,title:"重置"}),e.createVNode(A,{name:"fangda",size:"24",title:"放大"}),e.createVNode(A,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(A,{name:"lookAround",size:"24",onClick:e.unref(X),title:e.unref(Y)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",pt,[e.createVNode(A,{name:"jiegoushu",size:"24",onClick:l[0]||(l[0]=M=>v("场景树")),active:C.value&&N.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(A,{name:"clipping",size:"24",onClick:l[1]||(l[1]=M=>v("剖面视图")),active:C.value&&N.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:l[2]||(l[2]=M=>v("场景树3"))}),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:l[3]||(l[3]=M=>v("场景4"))})]),e.createElementVNode("div",mt,[e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"guanjiekongzhi",size:"24",onClick:l[4]||(l[4]=M=>p("关节控制")),active:k.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:l[5]||(l[5]=M=>p("动画仿真")),active:k.value&&m.value==="动画仿真"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ft,[e.createVNode(A,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(H=D.value)==null?void 0:H.fastBackward},null,8,["onClick"]),e.createVNode(A,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:P}),e.createVNode(A,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(j=D.value)==null?void 0:j.fastForward},null,8,["onClick"]),e.createVNode(A,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(ee=D.value)==null?void 0:ee.pauseAnimation},null,8,["onClick"]),e.createVNode(A,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(L=D.value)==null?void 0:L.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",_t,[e.createElementVNode("div",gt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:l[6]||(l[6]=M=>C.value=!1)}," X ")]),e.createVNode(E,{"max-height":"650px"},{default:e.withCtx(()=>[N.value==="场景树"?(e.openBlock(),e.createBlock(lt,{key:0,model:e.unref(G)},null,8,["model"])):e.createCommentVNode("",!0),N.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",vt,[e.createElementVNode("label",bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":l[7]||(l[7]=M=>e.isRef(u)?u.value=M:null),onChange:l[8]||(l[8]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[16]||(l[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":l[9]||(l[9]=M=>e.isRef(u)?u.value=M:null),onChange:l[10]||(l[10]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[17]||(l[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":l[11]||(l[11]=M=>e.isRef(u)?u.value=M:null),onChange:l[12]||(l[12]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[18]||(l[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":l[13]||(l[13]=M=>e.isRef(u)?u.value=M:null),onChange:l[14]||(l[14]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[19]||(l[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",Mt,[e.createElementVNode("div",xt,[e.createElementVNode("span",null,e.toDisplayString(m.value),1),e.createElementVNode("span",{class:"close",onClick:l[15]||(l[15]=M=>k.value=!1)}," X ")]),e.createVNode(E,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(nt,{ref_key:"jointRef",ref:D,model:e.unref(G),scene:e.unref(r),animationData:a.animationData},null,8,["model","scene","animationData"]),[[e.vShow,m.value==="关节控制"]]),e.withDirectives(e.createVNode(Ie,{animationData:a.animationData},null,8,["animationData"]),[[e.vShow,m.value==="动画仿真"]])]),_:1})],512),[[e.vShow,k.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Dt,[l[20]||(l[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},St=le._export_sfc(Vt,[["__scopeId","data-v-7bc47bb3"]]);exports.default=St;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("./index-DYLTl0bA.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),de=require("./menu-CcabvNj6.cjs"),ye={type:"change"},_e={type:"start"},be={type:"end"},ue=new o.Ray,ve=new o.Plane,we=Math.cos(70*o.MathUtils.DEG2RAD),B=new o.Vector3,K=2*Math.PI,S={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6},me=1e-6;class Ee extends o.Controls{constructor(t,n=null){super(t,n),this.state=S.NONE,this.target=new o.Vector3,this.cursor=new o.Vector3,this.minDistance=0,this.maxDistance=1/0,this.minZoom=0,this.maxZoom=1/0,this.minTargetRadius=0,this.maxTargetRadius=1/0,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.minAzimuthAngle=-1/0,this.maxAzimuthAngle=1/0,this.enableDamping=!1,this.dampingFactor=.05,this.enableZoom=!0,this.zoomSpeed=1,this.enableRotate=!0,this.rotateSpeed=1,this.keyRotateSpeed=1,this.enablePan=!0,this.panSpeed=1,this.screenSpacePanning=!0,this.keyPanSpeed=7,this.zoomToCursor=!1,this.autoRotate=!1,this.autoRotateSpeed=2,this.keys={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"},this.mouseButtons={LEFT:o.MOUSE.ROTATE,MIDDLE:o.MOUSE.DOLLY,RIGHT:o.MOUSE.PAN},this.touches={ONE:o.TOUCH.ROTATE,TWO:o.TOUCH.DOLLY_PAN},this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this._domElementKeyEvents=null,this._lastPosition=new o.Vector3,this._lastQuaternion=new o.Quaternion,this._lastTargetPosition=new o.Vector3,this._quat=new o.Quaternion().setFromUnitVectors(t.up,new o.Vector3(0,1,0)),this._quatInverse=this._quat.clone().invert(),this._spherical=new o.Spherical,this._sphericalDelta=new o.Spherical,this._scale=1,this._panOffset=new o.Vector3,this._rotateStart=new o.Vector2,this._rotateEnd=new o.Vector2,this._rotateDelta=new o.Vector2,this._panStart=new o.Vector2,this._panEnd=new o.Vector2,this._panDelta=new o.Vector2,this._dollyStart=new o.Vector2,this._dollyEnd=new o.Vector2,this._dollyDelta=new o.Vector2,this._dollyDirection=new o.Vector3,this._mouse=new o.Vector2,this._performCursorZoom=!1,this._pointers=[],this._pointerPositions={},this._controlActive=!1,this._onPointerMove=Me.bind(this),this._onPointerDown=Pe.bind(this),this._onPointerUp=xe.bind(this),this._onContextMenu=Ae.bind(this),this._onMouseWheel=Se.bind(this),this._onKeyDown=ke.bind(this),this._onTouchStart=Te.bind(this),this._onTouchMove=Ce.bind(this),this._onMouseDown=De.bind(this),this._onMouseMove=Ve.bind(this),this._interceptControlDown=Ne.bind(this),this._interceptControlUp=Re.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(ye),this.update(),this.state=S.NONE}update(t=null){const n=this.object.position;B.copy(n).sub(this.target),B.applyQuaternion(this._quat),this._spherical.setFromVector3(B),this.autoRotate&&this.state===S.NONE&&this._rotateLeft(this._getAutoRotationAngle(t)),this.enableDamping?(this._spherical.theta+=this._sphericalDelta.theta*this.dampingFactor,this._spherical.phi+=this._sphericalDelta.phi*this.dampingFactor):(this._spherical.theta+=this._sphericalDelta.theta,this._spherical.phi+=this._sphericalDelta.phi);let s=this.minAzimuthAngle,r=this.maxAzimuthAngle;isFinite(s)&&isFinite(r)&&(s<-Math.PI?s+=K:s>Math.PI&&(s-=K),r<-Math.PI?r+=K:r>Math.PI&&(r-=K),s<=r?this._spherical.theta=Math.max(s,Math.min(r,this._spherical.theta)):this._spherical.theta=this._spherical.theta>(s+r)/2?Math.max(s,this._spherical.theta):Math.min(r,this._spherical.theta)),this._spherical.phi=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._spherical.phi)),this._spherical.makeSafe(),this.enableDamping===!0?this.target.addScaledVector(this._panOffset,this.dampingFactor):this.target.add(this._panOffset),this.target.sub(this.cursor),this.target.clampLength(this.minTargetRadius,this.maxTargetRadius),this.target.add(this.cursor);let f=!1;if(this.zoomToCursor&&this._performCursorZoom||this.object.isOrthographicCamera)this._spherical.radius=this._clampDistance(this._spherical.radius);else{const w=this._spherical.radius;this._spherical.radius=this._clampDistance(this._spherical.radius*this._scale),f=w!=this._spherical.radius}if(B.setFromSpherical(this._spherical),B.applyQuaternion(this._quatInverse),n.copy(this.target).add(B),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 w=null;if(this.object.isPerspectiveCamera){const c=B.length();w=this._clampDistance(c*this._scale);const x=c-w;this.object.position.addScaledVector(this._dollyDirection,x),this.object.updateMatrixWorld(),f=!!x}else if(this.object.isOrthographicCamera){const c=new o.Vector3(this._mouse.x,this._mouse.y,0);c.unproject(this.object);const x=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),this.object.updateProjectionMatrix(),f=x!==this.object.zoom;const z=new o.Vector3(this._mouse.x,this._mouse.y,0);z.unproject(this.object),this.object.position.sub(z).add(c),this.object.updateMatrixWorld(),w=B.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),this.zoomToCursor=!1;w!==null&&(this.screenSpacePanning?this.target.set(0,0,-1).transformDirection(this.object.matrix).multiplyScalar(w).add(this.object.position):(ue.origin.copy(this.object.position),ue.direction.set(0,0,-1).transformDirection(this.object.matrix),Math.abs(this.object.up.dot(ue.direction))<we?this.object.lookAt(this.target):(ve.setFromNormalAndCoplanarPoint(this.object.up,this.target),ue.intersectPlane(ve,this.target))))}else if(this.object.isOrthographicCamera){const w=this.object.zoom;this.object.zoom=Math.max(this.minZoom,Math.min(this.maxZoom,this.object.zoom/this._scale)),w!==this.object.zoom&&(this.object.updateProjectionMatrix(),f=!0)}return this._scale=1,this._performCursorZoom=!1,f||this._lastPosition.distanceToSquared(this.object.position)>me||8*(1-this._lastQuaternion.dot(this.object.quaternion))>me||this._lastTargetPosition.distanceToSquared(this.target)>me?(this.dispatchEvent(ye),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 n=Math.abs(t*.01);return Math.pow(.95,this.zoomSpeed*n)}_rotateLeft(t){this._sphericalDelta.theta-=t}_rotateUp(t){this._sphericalDelta.phi-=t}_panLeft(t,n){B.setFromMatrixColumn(n,0),B.multiplyScalar(-t),this._panOffset.add(B)}_panUp(t,n){this.screenSpacePanning===!0?B.setFromMatrixColumn(n,1):(B.setFromMatrixColumn(n,0),B.crossVectors(this.object.up,B)),B.multiplyScalar(t),this._panOffset.add(B)}_pan(t,n){const s=this.domElement;if(this.object.isPerspectiveCamera){const r=this.object.position;B.copy(r).sub(this.target);let f=B.length();f*=Math.tan(this.object.fov/2*Math.PI/180),this._panLeft(2*t*f/s.clientHeight,this.object.matrix),this._panUp(2*n*f/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(n*(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,n){if(!this.zoomToCursor)return;this._performCursorZoom=!0;const s=this.domElement.getBoundingClientRect(),r=t-s.left,f=n-s.top,w=s.width,c=s.height;this._mouse.x=r/w*2-1,this._mouse.y=-(f/c)*2+1,this._dollyDirection.set(this._mouse.x,this._mouse.y,1).unproject(this.object).sub(this.object.position).normalize()}_clampDistance(t){return Math.max(this.minDistance,Math.min(this.maxDistance,t))}_handleMouseDownRotate(t){this._rotateStart.set(t.clientX,t.clientY)}_handleMouseDownDolly(t){this._updateZoomParameters(t.clientX,t.clientX),this._dollyStart.set(t.clientX,t.clientY)}_handleMouseDownPan(t){this._panStart.set(t.clientX,t.clientY)}_handleMouseMoveRotate(t){this._rotateEnd.set(t.clientX,t.clientY),this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(K*this._rotateDelta.x/n.clientHeight),this._rotateUp(K*this._rotateDelta.y/n.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 n=!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),n=!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),n=!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),n=!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),n=!0;break}n&&(t.preventDefault(),this.update())}_handleTouchStartRotate(t){if(this._pointers.length===1)this._rotateStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._rotateStart.set(s,r)}}_handleTouchStartPan(t){if(this._pointers.length===1)this._panStart.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panStart.set(s,r)}}_handleTouchStartDolly(t){const n=this._getSecondPointerPosition(t),s=t.pageX-n.x,r=t.pageY-n.y,f=Math.sqrt(s*s+r*r);this._dollyStart.set(0,f)}_handleTouchStartDollyPan(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enablePan&&this._handleTouchStartPan(t)}_handleTouchStartDollyRotate(t){this.enableZoom&&this._handleTouchStartDolly(t),this.enableRotate&&this._handleTouchStartRotate(t)}_handleTouchMoveRotate(t){if(this._pointers.length==1)this._rotateEnd.set(t.pageX,t.pageY);else{const s=this._getSecondPointerPosition(t),r=.5*(t.pageX+s.x),f=.5*(t.pageY+s.y);this._rotateEnd.set(r,f)}this._rotateDelta.subVectors(this._rotateEnd,this._rotateStart).multiplyScalar(this.rotateSpeed);const n=this.domElement;this._rotateLeft(K*this._rotateDelta.x/n.clientHeight),this._rotateUp(K*this._rotateDelta.y/n.clientHeight),this._rotateStart.copy(this._rotateEnd)}_handleTouchMovePan(t){if(this._pointers.length===1)this._panEnd.set(t.pageX,t.pageY);else{const n=this._getSecondPointerPosition(t),s=.5*(t.pageX+n.x),r=.5*(t.pageY+n.y);this._panEnd.set(s,r)}this._panDelta.subVectors(this._panEnd,this._panStart).multiplyScalar(this.panSpeed),this._pan(this._panDelta.x,this._panDelta.y),this._panStart.copy(this._panEnd)}_handleTouchMoveDolly(t){const n=this._getSecondPointerPosition(t),s=t.pageX-n.x,r=t.pageY-n.y,f=Math.sqrt(s*s+r*r);this._dollyEnd.set(0,f),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 w=(t.pageX+n.x)*.5,c=(t.pageY+n.y)*.5;this._updateZoomParameters(w,c)}_handleTouchMoveDollyPan(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enablePan&&this._handleTouchMovePan(t)}_handleTouchMoveDollyRotate(t){this.enableZoom&&this._handleTouchMoveDolly(t),this.enableRotate&&this._handleTouchMoveRotate(t)}_addPointer(t){this._pointers.push(t.pointerId)}_removePointer(t){delete this._pointerPositions[t.pointerId];for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==t.pointerId){this._pointers.splice(n,1);return}}_isTrackingPointer(t){for(let n=0;n<this._pointers.length;n++)if(this._pointers[n]==t.pointerId)return!0;return!1}_trackPointer(t){let n=this._pointerPositions[t.pointerId];n===void 0&&(n=new o.Vector2,this._pointerPositions[t.pointerId]=n),n.set(t.pageX,t.pageY)}_getSecondPointerPosition(t){const n=t.pointerId===this._pointers[0]?this._pointers[1]:this._pointers[0];return this._pointerPositions[n]}_customWheelEvent(t){const n=t.deltaMode,s={clientX:t.clientX,clientY:t.clientY,deltaY:t.deltaY};switch(n){case 1:s.deltaY*=16;break;case 2:s.deltaY*=100;break}return t.ctrlKey&&!this._controlActive&&(s.deltaY*=10),s}}function Pe(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 Me(a){this.enabled!==!1&&(a.pointerType==="touch"?this._onTouchMove(a):this._onMouseMove(a))}function xe(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(be),this.state=S.NONE;break;case 1:const t=this._pointers[0],n=this._pointerPositions[t];this._onTouchStart({pointerId:t,pageX:n.x,pageY:n.y});break}}function De(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=S.DOLLY;break;case o.MOUSE.ROTATE:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=S.PAN}else{if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=S.ROTATE}break;case o.MOUSE.PAN:if(a.ctrlKey||a.metaKey||a.shiftKey){if(this.enableRotate===!1)return;this._handleMouseDownRotate(a),this.state=S.ROTATE}else{if(this.enablePan===!1)return;this._handleMouseDownPan(a),this.state=S.PAN}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(_e)}function Ve(a){switch(this.state){case S.ROTATE:if(this.enableRotate===!1)return;this._handleMouseMoveRotate(a);break;case S.DOLLY:if(this.enableZoom===!1)return;this._handleMouseMoveDolly(a);break;case S.PAN:if(this.enablePan===!1)return;this._handleMouseMovePan(a);break}}function Se(a){this.enabled===!1||this.enableZoom===!1||this.state!==S.NONE||(a.preventDefault(),this.dispatchEvent(_e),this._handleMouseWheel(this._customWheelEvent(a)),this.dispatchEvent(be))}function ke(a){this.enabled!==!1&&this._handleKeyDown(a)}function Te(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=S.TOUCH_ROTATE;break;case o.TOUCH.PAN:if(this.enablePan===!1)return;this._handleTouchStartPan(a),this.state=S.TOUCH_PAN;break;default:this.state=S.NONE}break;case 2:switch(this.touches.TWO){case o.TOUCH.DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchStartDollyPan(a),this.state=S.TOUCH_DOLLY_PAN;break;case o.TOUCH.DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchStartDollyRotate(a),this.state=S.TOUCH_DOLLY_ROTATE;break;default:this.state=S.NONE}break;default:this.state=S.NONE}this.state!==S.NONE&&this.dispatchEvent(_e)}function Ce(a){switch(this._trackPointer(a),this.state){case S.TOUCH_ROTATE:if(this.enableRotate===!1)return;this._handleTouchMoveRotate(a),this.update();break;case S.TOUCH_PAN:if(this.enablePan===!1)return;this._handleTouchMovePan(a),this.update();break;case S.TOUCH_DOLLY_PAN:if(this.enableZoom===!1&&this.enablePan===!1)return;this._handleTouchMoveDollyPan(a),this.update();break;case S.TOUCH_DOLLY_ROTATE:if(this.enableZoom===!1&&this.enableRotate===!1)return;this._handleTouchMoveDollyRotate(a),this.update();break;default:this.state=S.NONE}}function Ae(a){this.enabled!==!1&&a.preventDefault()}function Ne(a){a.key==="Control"&&(this._controlActive=!0,this.domElement.getRootNode().addEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function Re(a){a.key==="Control"&&(this._controlActive=!1,this.domElement.getRootNode().removeEventListener("keyup",this._interceptControlUp,{passive:!0,capture:!0}))}function ze(a){let t=null,n=null,s=null,r=null,f=null,w=null,c=null,x=null;const C=1e3/30;let N=0;const k=e.ref([]),m=e.ref(new o.Vector3),D=e.ref(new o.Vector3),b=()=>{if(!a.value)return;t=new o.Scene,t.background=new o.Color(15790320);const g=a.value;n=new o.PerspectiveCamera(75,g.clientWidth/g.clientHeight,.1,1e4),n.position.set(8,-8,6),n.up.set(0,0,1),n.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),r=new Ee(n,s.domElement),r.enableDamping=!0,r.dampingFactor=.05,r.mouseButtons={LEFT:null,MIDDLE:o.MOUSE.PAN,RIGHT:o.MOUSE.ROTATE},r.panSpeed=.7,f=new o.Xe(n,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"}}),f.attachControls(r),y(),V()},i=(g,u)=>{c&&(t.remove(c),c.dispose()),x&&(t.remove(x),x.geometry.dispose(),x.material.dispose());const T=Math.min(Math.max(Math.floor(g/20),30),40);c=new o.GridHelper(g,T,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(u),t.add(c);const R=new o.PlaneGeometry(g,g),Z=new o.ShadowMaterial({opacity:.3,color:0});x=new o.Mesh(R,Z),x.position.copy(u),x.position.z-=.01,x.receiveShadow=!0,t.add(x)},_=()=>{if(k.value.length===0)return;const g=new o.Box3;let u=!1;if(k.value.forEach(J=>{if(J.userData.boundingBox)g.union(J.userData.boundingBox),u=!0;else if(J.userData.modelId&&modelBoundingBoxes.has(J.userData.modelId)){const Q=modelBoundingBoxes.get(J.userData.modelId);g.union(Q.box),u=!0}else g.expandByObject(J),u=!0}),!u){console.warn("无法计算包围盒,网格更新失败");return}const T=g.getSize(new o.Vector3),R=g.getCenter(new o.Vector3),Z=Math.max(T.x,T.y,T.z),$=Math.max(Z*8,50),G=new o.Vector3(R.x,R.y,g.min.z);i($,G)},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 T=new o.DirectionalLight(16777215,.8);T.position.set(-8,-8,6),t.add(T);const R=new o.DirectionalLight(16777215,.6);R.position.set(0,-15,2),t.add(R);const Z=new o.HemisphereLight(16777215,4473924,.8);t.add(Z);const $=new o.PointLight(16777215,1,50);$.position.set(15,15,15),t.add($);const G=new o.PointLight(16777215,.5,50);G.position.set(-15,-15,15),t.add(G)},V=()=>{w=requestAnimationFrame(V),r&&r.update();const g=performance.now(),u=g-N;u<C||(N=g-u%C,s&&t&&n&&s.render(t,n),f&&f.render())},U=g=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(T=>{g[T]&&g[T].dispose&&g[T].dispose()}),g.dispose&&g.dispose()},O=g=>{g==null||g.traverse(u=>{u.geometry&&u.geometry.dispose(),u.material&&(Array.isArray(u.material)?u.material.forEach(T=>{U(T)}):U(u.material))})};return{currentModels:k,initialCameraPosition:m,initialTargetPosition:D,initThreeJS:b,handleResize:()=>{if(!a.value||!n||!s||!f)return;const g=a.value,u=g.clientWidth,T=g.clientHeight;n.aspect=u/T,n.updateProjectionMatrix(),s.setSize(u,T),f.update()},fitCameraToAllModels:g=>{if(!n||!r||k.value.length===0)return;const u=new o.Box3;let T=!1;if(k.value.forEach(Q=>{if(Q.userData.boundingBox)u.union(Q.userData.boundingBox),T=!0;else if(Q.userData.modelId&&g.has(Q.userData.modelId)){const ne=g.get(Q.userData.modelId);u.union(ne.box),T=!0}else u.expandByObject(Q),T=!0}),!T){console.warn("无法计算包围盒");return}const R=u.getSize(new o.Vector3),Z=u.getCenter(new o.Vector3),G=Math.max(R.x,R.y,R.z)*.8,J=new o.Vector3(Z.x+G,Z.y-G,Z.z+G);n.position.copy(J),n.lookAt(Z),r.target.copy(Z),r.update(),m.value.copy(J),D.value.copy(Z),_()},getThreeJSObjects:()=>({scene:t,camera:n,renderer:s,controls:r,gizmo:f}),clearAllModels:()=>{if(!t)return;k.value.forEach(u=>{t.remove(u),O(u)});const g=[];t.children.forEach(u=>{!u.isLight&&!u.isCamera&&u.type!=="GridHelper"&&u!==x&&g.push(u)}),g.forEach(u=>{t.remove(u),O(u)}),k.value=[],_()},cleanup:()=>{w&&cancelAnimationFrame(w),c&&c.dispose(),x&&(x.geometry.dispose(),x.material.dispose()),s&&s.dispose(),r&&r.dispose(),f&&f.dispose()},updateGridForModels:_}}function Oe(a,t){const n=e.ref(!1);let s=null,r=12700,f=new o.Vector3,w=new o.Vector3,c=new o.Vector3,x=0,z=null;const C=i=>i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2,N=i=>{const _=new o.Vector3,y=x*1.2,V=new o.Vector3(c.x+y,c.y,c.z),U=new o.Vector3(c.x,c.y+y,c.z),O=new o.Vector3(c.x,c.y-y,c.z);if(i<=.567){const F=i/.567*Math.PI*2;_.x=c.x+Math.cos(F)*y,_.z=c.z+Math.sin(F)*y,_.y=c.y}else if(i<=.724){const I=(i-.567)/.157,F=C(I);_.lerpVectors(V,U,F)}else if(i<=.881){const I=(i-.724)/.157,Y=C(I)*Math.PI;_.x=c.x+Math.sin(Y)*y,_.y=c.y+Math.cos(Y)*y,_.z=c.z}else{const I=(i-.881)/.119,F=C(I);_.lerpVectors(O,f,F)}return _},k=()=>{const{camera:i,controls:_}=a();if(!i||!_)return;s||(s=Date.now());const y=Date.now()-s,V=Math.min(y/r,1);if(V>=1){D();return}const U=N(V);i.position.copy(U),i.lookAt(c),_.target.copy(c),z=requestAnimationFrame(k)},m=()=>{if(t.value.length===0)return;const{camera:i,controls:_}=a();if(!i||!_)return;f.copy(i.position),w.copy(_.target);const y=new o.Box3;t.value.forEach(X=>{y.expandByObject(X)});const V=y.getSize(new o.Vector3);c=y.getCenter(new o.Vector3),x=Math.max(V.x,V.y,V.z)*1.2;const U=new o.Vector3(c.x+x*1.2,c.y,c.z);_.enabled=!1;const O=i.position.clone(),I=1e3,F=Date.now(),Y=()=>{const X=Date.now()-F,W=Math.min(X/I,1),g=C(W);i.position.lerpVectors(O,U,g),i.lookAt(c),_.target.copy(c),W<1?requestAnimationFrame(Y):(n.value=!0,s=null,k())};Y()},D=()=>{n.value=!1,s=null,z&&(cancelAnimationFrame(z),z=null);const{controls:i}=a();i&&(i.enabled=!0,i.target.copy(w))};return{isAnimating:n,toggleAnimation:()=>{if(n.value){n.value=!1,s=null,z&&(cancelAnimationFrame(z),z=null);const{camera:i,controls:_}=a();if(!i||!_)return;_.enabled=!0;const y=i.position.clone(),V=_.target.clone(),U=1500,O=Date.now(),I=()=>{const F=Date.now()-O,Y=Math.min(F/U,1),X=C(Y);i.position.lerpVectors(y,f,X),_.target.lerpVectors(V,w,X),Y<1&&requestAnimationFrame(I)};I()}else m()},startAnimation:m,stopAnimation:D}}function Le(a,t){const n=e.ref(!1),s=e.ref("none");let r=[],f=[],w=new o.Box3,c=new o.Vector3;const x=()=>{r=[new o.Plane(new o.Vector3(1,0,0),0),new o.Plane(new o.Vector3(0,1,0),0),new o.Plane(new o.Vector3(0,0,1),0)]},z=()=>{w.makeEmpty(),t.value.forEach(b=>{w.expandByObject(b)}),c=w.getCenter(new o.Vector3)},C=b=>{const i=w.getSize(new o.Vector3);let _,y,V;b==="x"?(_=new o.PlaneGeometry(i.z*1.2,i.y*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(0,Math.PI/2,0)):b==="y"?(_=new o.PlaneGeometry(i.x*1.2,i.z*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(Math.PI/2,0,0)):b==="z"&&(_=new o.PlaneGeometry(i.x*1.2,i.y*1.2),y=new o.Vector3(c.x,c.y,c.z),V=new o.Euler(0,0,0));const U=new o.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:o.DoubleSide,depthWrite:!1}),O=new o.Mesh(_,U);return O.position.copy(y),O.rotation.copy(V),O},N=()=>{if(k(),m(),s.value==="none")return;z();let b=null;if(s.value==="x"?(r[0].constant=-c.x,b=r[0]):s.value==="y"?(r[1].constant=-c.y,b=r[1]):s.value==="z"&&(r[2].constant=-c.z,b=r[2]),b){t.value.forEach(_=>{_.traverse(y=>{y.isMesh&&y.material&&(Array.isArray(y.material)?y.material.forEach(V=>{V.clippingPlanes=[b]}):y.material.clippingPlanes=[b])})});const{scene:i}=a();if(i){const _=C(s.value);i.add(_),f.push(_)}}},k=()=>{t.value.forEach(b=>{b.traverse(i=>{i.isMesh&&i.material&&(Array.isArray(i.material)?i.material.forEach(_=>{_.clippingPlanes=[]}):i.material.clippingPlanes=[])})})},m=()=>{const{scene:b}=a();b&&f.forEach(i=>{b.remove(i),i.geometry.dispose(),i.material.dispose()}),f=[]};return{isClipping:n,activeClippingAxis:s,toggleClipping:()=>{n.value=!n.value,n.value?(x(),t.value.length>0&&z()):(s.value="none",k(),m())},updateClippingPlanes:N,clearClippingPlanes:k,clearClippingMeshes:m}}const je={class:"panel-content"},Be={__name:"animationPanel",props:{animationData:Object,model:Object},setup(a){const t=a;e.ref();const n=e.ref();return e.watch(()=>[t==null?void 0:t.animationData],()=>{var r;let s=((r=de.cloneDeep(t==null?void 0:t.animationData))==null?void 0:r.动画输出Content)??[];s&&(n.value=s)},{deep:!0,immediate:!0}),(s,r)=>{var f,w,c;return e.openBlock(),e.createElementBlock("div",je,[(e.openBlock(),e.createBlock(o.ssTable,{itemData:(f=n.value)==null?void 0:f.compData,key:(w=n.value)==null?void 0:w.id,index:(c=n.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},Ie=le._export_sfc(Be,[["__scopeId","data-v-1e90a659"]]),Ue={class:"panel-content"},Fe={key:0,class:"joints-list"},Ye={class:"joint-info-row"},Ze={class:"joint-left"},He={class:"joint-name"},Ke={class:"joint-range"},Xe={class:"joint-type"},$e={key:0,class:"joint-control-row"},Ge={class:"slider-container"},Je=["min","max","value","onInput","disabled"],qe={class:"value-display"},We={class:"joint-value"},Qe={class:"unit"},et={key:1,class:"empty-state"},ae=.001,tt=1e3,fe=60,ot={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(a,{expose:t}){const n=a;e.ref(!0);const s=e.ref([]),r=e.ref(null),f=e.ref(null),w=e.ref(12.5),c=e.ref(),x=e.ref(1302),z=e.ref(30),C=e.ref(!1),N=e.ref(!1),k=e.ref(0),m=e.ref(0),D=e.ref(null),b=o.MathUtils.degToRad,i=e.ref(1),_=()=>tt/fe/i.value;let y=[];e.watch(()=>n.animationData,h=>{var p;x.value=h.extra.管长,w.value=h.extra.外径/2;let v=((p=de.cloneDeep(h))==null?void 0:p.动画输出)??[];v&&v.length>0&&(y=v)},{deep:!0}),e.computed(()=>y.length>0);const V=(h,v=!1)=>h==="revolute"?v?Math.PI:-Math.PI:h==="prismatic"?v?1:-1:0,U=()=>{if(!r.value)return de.ElMessage.error("未加载 URDF"),!1;let h=null;return r.value.traverse(v=>{h||v.name==="Pipe_Link"&&v.traverse(p=>{p instanceof o.Mesh&&!h&&(h=p)})}),h?(h.position.y-=z.value*ae,c.value=h,h.material=new o.MeshPhongMaterial({color:11184810,shininess:80,side:o.DoubleSide}),!0):(de.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},O=h=>{if(!h||!h.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(h.traverse(P=>{P.name==="Pipe_Link"&&!v&&(v=P)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const p=[];return Object.keys(h.joints).forEach(P=>{const d=h.joints[P];if(d._jointType==="fixed")return;const l=d.limit?{lower:d.limit.lower??V(d._jointType,!1),upper:d.limit.upper??V(d._jointType,!0)}:{lower:V(d._jointType,!1),upper:V(d._jointType,!0)};p.push({name:P,type:d._jointType||"unknown",limit:l,currentValue:d.angle||0,urdfJoint:d})}),p.sort((P,d)=>P.name.localeCompare(d.name))},I=(h,v)=>{const p=s.value.find(d=>d.name===h);if(!p)return;const P=parseFloat(v);if(p.limit){const d=Math.max(p.limit.lower,Math.min(p.limit.upper,P));p.currentValue=d}else p.currentValue=P;n.model&&n.model.setJointValue?n.model.setJointValue(h,p.currentValue):p.urdfJoint&&p.urdfJoint.setJointValue(p.currentValue)},F=h=>h.reduce((v,p)=>{let P=0;const d=p.Y??0,l=p.C??0,E=p.R??0;return d>0&&(P+=d),l>0&&E>0&&(P+=E*b(l)),v+P},0),Y=h=>{const v=[],p=h.Y??0,P=h.B??0,d=h.C??0,l=h.R??0,E={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(!p&&!d)return v;if(v.push(E.pos.clone()),P!==0){const H=new o.Matrix4().makeRotationAxis(E.localY,b(P));E.localX.applyMatrix4(H),E.localZ.applyMatrix4(H)}if(p>0&&(E.pos.add(E.localY.clone().multiplyScalar(p*ae)),v.push(E.pos.clone())),d>0&&l>0){const H=b(d),j=l*ae,ee=E.pos.clone().add(E.localX.clone().multiplyScalar(-j)),L=Math.max(16,Math.ceil(d/5));for(let M=1;M<=L;M++){const q=H*M/L,te=new o.Matrix4().makeRotationAxis(E.localZ,q),ce=E.localX.clone().multiplyScalar(j).applyMatrix4(te),he=ee.clone().add(ce);v.push(he)}}return v},X=(h,v=0)=>{let p=y.slice(0,h+1);const P=y[h+1];if(P&&v>0){const L={...P,B:(P.B??0)*v,C:(P.C??0)*v};p.push(L)}const d=F(p),l=Math.max(0,x.value-d),E=[];E.push(new o.Vector3(0,0,0));const H=new o.Vector3(0,l*ae,0);l>0&&E.push(H);let j={pos:H.clone(),localY:new o.Vector3(0,1,0),localX:new o.Vector3(1,0,0),localZ:new o.Vector3(0,0,1)};const ee=[];for(let L=p.length-1;L>=0;L--){const M=p[L],q=Y(M);if(q.length>0){const te=q.map(oe=>{const se=oe.clone(),ge=new o.Matrix4;return ge.makeBasis(j.localX,j.localY,j.localZ),se.applyMatrix4(ge),se.add(j.pos)});ee.push(te);const ie=te[te.length-1];j.pos=ie.clone();const ce=M.B??0,he=M.C??0;if(ce!==0){const oe=new o.Matrix4().makeRotationAxis(j.localY,b(ce));j.localX.applyMatrix4(oe),j.localZ.applyMatrix4(oe)}if(he>0){const oe=b(he),se=new o.Matrix4().makeRotationAxis(j.localZ,oe);j.localY.applyMatrix4(se),j.localX.applyMatrix4(se)}}}for(const L of ee)L.length>1&&E.push(...L.slice(1));E.length<2&&E.push(new o.Vector3(0,.001,0));try{const L=new o.CatmullRomCurve3(E,!1,"catmullrom",.01),M=new o.TubeGeometry(L,Math.max(2,E.length*4),w.value*ae,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(L){console.error("管件更新失败",L)}},W=(h,v,p=1)=>{h&&(Object.keys(h).forEach(P=>{const d=h[P],l=s.value.find(E=>E.name===P);l&&(l.currentValue=d,n.model&&n.model.setJointValue?n.model.setJointValue(P,d):l.urdfJoint&&l.urdfJoint.setJointValue(d))}),X(v,p))},g=(h,v,p)=>h+(v-h)*p,u=(h,v,p)=>{if(!h||!v)return h||v;const P={};return Object.keys(h).forEach(d=>{const l=h[d],E=v[d];P[d]=g(l,E||l,p)}),P},T=()=>{if(y.length===0){console.warn("没有动画数据");return}U(),C.value=!0,N.value=!1,k.value=0,m.value=0,R()},R=()=>{if(!C.value||N.value)return;const h=k.value;if(h>=y.length-1){const d=y[y.length-1];W(d,y.length-1,1),$();return}const v=m.value/fe,p=y[h],P=y[h+1];if(P){const d=u(p,P,v);W(d,h,v)}else W(p,h);m.value++,m.value>fe&&(m.value=0,k.value++),D.value=setTimeout(R,_())},Z=()=>{N.value=!0,D.value&&(clearTimeout(D.value),D.value=null)},$=()=>{C.value=!1,N.value=!1,i.value=1,D.value&&(clearTimeout(D.value),D.value=null)};t({startAnimation:T,pauseAnimation:Z,stopAnimation:$,resetAll:()=>{$(),k.value=0,m.value=0,s.value.forEach(h=>{(h.type==="revolute"||h.type==="prismatic")&&I(h.name,0)}),X(-1,0)},fastForward:()=>{i.value<4&&(i.value=Math.min(4,i.value*2))},fastBackward:()=>{i.value>.25&&(i.value=Math.max(.25,i.value/2))}}),e.watch(()=>n.model,h=>{h?(r.value=h,s.value=O(h)):s.value=[]},{immediate:!0});const ne=()=>{!n.model||C.value&&!N.value||s.value.forEach(h=>{h.urdfJoint&&h.urdfJoint.angle!==void 0&&(h.currentValue=h.urdfJoint.angle)})},re=()=>{const h=()=>{ne(),f.value=requestAnimationFrame(h)};h()},pe=()=>{f.value&&(cancelAnimationFrame(f.value),f.value=null)};return e.onMounted(()=>{re()}),e.onUnmounted(()=>{pe(),$()}),(h,v)=>(e.openBlock(),e.createElementBlock("div",Ue,[s.value.length>0?(e.openBlock(),e.createElementBlock("div",Fe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.value,p=>{var P,d,l,E;return e.openBlock(),e.createElementBlock("div",{key:p.name,class:"joint-item"},[e.createElementVNode("div",Ye,[e.createElementVNode("div",Ze,[e.createElementVNode("span",He,e.toDisplayString(p.name),1),e.createElementVNode("span",Ke," ["+e.toDisplayString(((P=p.limit)==null?void 0:P.lower.toFixed(2))??(p.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((d=p.limit)==null?void 0:d.upper.toFixed(2))??(p.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",Xe,e.toDisplayString(p.type),1)]),p.type==="revolute"||p.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("div",Ge,[e.createElementVNode("input",{type:"range",min:((l=p.limit)==null?void 0:l.lower)??(p.type==="revolute"?-Math.PI:-1),max:((E=p.limit)==null?void 0:E.upper)??(p.type==="revolute"?Math.PI:1),step:.01,value:p.currentValue,onInput:H=>I(p.name,H.target.value),class:"joint-slider",disabled:C.value&&!N.value},null,40,Je)]),e.createElementVNode("div",qe,[e.createElementVNode("span",We,e.toDisplayString(p.currentValue?Number(p.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Qe,e.toDisplayString(p.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",et,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},nt=le._export_sfc(ot,[["__scopeId","data-v-0bb82714"]]),it={class:"panel-content"},st="id",at={__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 n=a,s=t,r=e.ref([]),f={children:"children",label:"label"},w=m=>{s("nodeClick",m)},c=(m,D=0)=>{const b=[];return Array.isArray(m)&&(m==null?void 0:m.length)>0&&m.forEach(i=>{if(!(i!=null&&i.isMesh)&&((i==null?void 0:i.type)==="URDFJoint"||(i==null?void 0:i.type)==="URDFLink")){const _={name:i==null?void 0:i.name,label:i==null?void 0:i.name,show:!0,level:D+1,isPenultimate:!1,type:i==null?void 0:i.type,id:i==null?void 0:i.id,limit:(i==null?void 0:i.limit)??"",children:c(i==null?void 0:i.children,D+1),path:i==null?void 0:i.name};b.push(_)}}),b},x=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:c(m==null?void 0:m.children,1),path:m==null?void 0:m.name}]:[],z=(m,D)=>{const b=[],i=[...m];for(;i.length>0&&b.length<D;){const _=i.shift();_.children&&_.children.length>0&&(b.push(_.id),i.push(..._.children))}return b},C=(m,D)=>{const b=[];return m.forEach(i=>{if(i.children&&i.children.length>0){b.push(i.id);const _=i.children.filter(y=>y.children&&y.children.length>0).slice(0,D).map(y=>y.id);b.push(..._)}}),b.slice(0,D+1)},N=e.computed(()=>!r.value||r.value.length===0?[]:n.expandStrategy==="firstLevel"?C(r.value,n.maxExpandCount):z(r.value,n.maxExpandCount)),k=e.computed(()=>n!=null&&n.model?x(n.model):[]);return e.watch(k,m=>{r.value=JSON.parse(JSON.stringify(m))},{immediate:!0}),(m,D)=>{const b=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",it,[e.createVNode(b,{data:r.value,props:f,"default-expanded-keys":N.value,"node-key":st,onNodeClick:w},null,8,["data","default-expanded-keys"])])}}},lt=le._export_sfc(at,[["__scopeId","data-v-290ff4e1"]]),rt=["xlink:href"],ct=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,n=e.computed(()=>({backgroundColor:t.backgroundColor})),s=e.computed(()=>`#${t.prefix}-${t.name}`),r=e.computed(()=>{const{size:f}=t;let w=`${f}`;return w=`${w.replace("px","")}px`,{width:w,height:w}});return(f,w)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:f.active}]),style:e.normalizeStyle(n.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[f.$attrs.class,f.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(r.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":s.value},null,8,rt)],6))],6))}}),A=le._export_sfc(ct,[["__scopeId","data-v-3150a90b"]]),ht={class:"obj-viewer-container"},ut={class:"buttonGroup-top"},dt={class:"buttonGroup-topLeft"},pt={class:"buttonGroup-left"},mt={class:"buttonGroup-right"},ft={class:"buttonGroup-bottom"},_t={class:"left-panel"},gt={class:"panel-header"},yt={key:1,class:"clipping-content"},vt={class:"radio-group"},bt={class:"radio-label"},wt={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},Mt={class:"right-panel"},xt={class:"panel-header"},Dt={key:0,class:"loading-overlay"},Vt={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(a,{expose:t,emit:n}){const s=n;let r=null,f=!1;const w=e.ref(null),c=e.ref(!1),x=e.ref("");e.ref(!1);const z=e.ref(!1),C=e.ref(!1),N=e.ref(""),k=e.ref(!1),m=e.ref(""),D=e.ref(),{currentModels:b,initialCameraPosition:i,initialTargetPosition:_,initThreeJS:y,handleResize:V,fitCameraToAllModels:U,getThreeJSObjects:O,clearAllModels:I,cleanup:F}=ze(w),{isAnimating:Y,toggleAnimation:X,stopAnimation:W}=Oe(O,b),{isClipping:g,activeClippingAxis:u,toggleClipping:T,updateClippingPlanes:R}=Le(O,b),{addModelsFromUrls:Z,loadModelByDefaultPath:$,urdfModel:G,modelBoundingBoxes:J}=o.useModelLoader(O,b,c,x,I),Q=()=>{if(z.value||b.value.length===0)return;z.value=!0,Y.value&&W();const{camera:d,controls:l}=O();if(!d||!l)return;l.enabled=!0;const E=q=>q<.5?4*q*q*q:1-Math.pow(-2*q+2,3)/2,H=d.position.clone(),j=l.target.clone(),ee=1500,L=Date.now(),M=()=>{const q=Date.now()-L,te=Math.min(q/ee,1),ie=E(te);d.position.lerpVectors(H,i.value,ie),l.target.lerpVectors(j,_.value,ie),te<1?requestAnimationFrame(M):z.value=!1};M()},ne=async()=>f?Promise.resolve():new Promise(d=>{const l=()=>{f?d():requestAnimationFrame(l)};l()}),re=async(d,l)=>{try{await ne(),Y.value&&W(),g.value&&T();const E=await l(d);return U(J),E}catch(E){throw console.error("加载模型失败:",E),E}},pe=async d=>re(d,Z),h=async d=>re(d,$),v=d=>{C.value=!0,N.value=d,d==="剖面视图"&&!g.value&&T()},p=d=>{k.value=!0,m.value=d,d==="动画仿真"&&s("getAnimationData")},P=()=>{e.nextTick(()=>{var d;(d=D.value)==null||d.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{y(),r=O().scene,f=!0,window.addEventListener("resize",V)}catch(d){console.error("Three.js初始化失败:",d)}}),e.onBeforeUnmount(()=>{f=!1,N.value="",m.value="",window.removeEventListener("resize",V),Y.value&&W(),F()}),t({addModelsFromUrls:pe,loadModelByDefaultPath:h}),(d,l)=>{var H,j,ee,L;const E=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:w,class:"threejs-container"},null,512),e.createElementVNode("div",ut,[e.createVNode(A,{name:"guanjianjiexi",size:"34"}),e.createVNode(A,{name:"guanjiekongzhi",size:"34"}),e.createVNode(A,{name:"gongyishengcheng",size:"34"}),e.createVNode(A,{name:"buchangshezhi",size:"34"}),e.createVNode(A,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",dt,[e.createVNode(A,{name:"viewReset",size:"24",onClick:Q,title:"重置"}),e.createVNode(A,{name:"fangda",size:"24",title:"放大"}),e.createVNode(A,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(A,{name:"lookAround",size:"24",onClick:e.unref(X),title:e.unref(Y)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",pt,[e.createVNode(A,{name:"jiegoushu",size:"24",onClick:l[0]||(l[0]=M=>v("场景树")),active:C.value&&N.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(A,{name:"clipping",size:"24",onClick:l[1]||(l[1]=M=>v("剖面视图")),active:C.value&&N.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:l[2]||(l[2]=M=>v("场景树3"))}),e.createVNode(A,{name:"donghuafangzhen",size:"24",onClick:l[3]||(l[3]=M=>v("场景4"))})]),e.createElementVNode("div",mt,[e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"guanjiekongzhi",size:"24",onClick:l[4]||(l[4]=M=>p("关节控制")),active:k.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:l[5]||(l[5]=M=>p("动画仿真")),active:k.value&&m.value==="动画仿真"},null,8,["active"]),e.createVNode(A,{name:"donghuafangzhen",size:"24"}),e.createVNode(A,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ft,[e.createVNode(A,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(H=D.value)==null?void 0:H.fastBackward},null,8,["onClick"]),e.createVNode(A,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:P}),e.createVNode(A,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(j=D.value)==null?void 0:j.fastForward},null,8,["onClick"]),e.createVNode(A,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(ee=D.value)==null?void 0:ee.pauseAnimation},null,8,["onClick"]),e.createVNode(A,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(L=D.value)==null?void 0:L.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",_t,[e.createElementVNode("div",gt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:l[6]||(l[6]=M=>C.value=!1)}," X ")]),e.createVNode(E,{"max-height":"650px"},{default:e.withCtx(()=>[N.value==="场景树"?(e.openBlock(),e.createBlock(lt,{key:0,model:e.unref(G)},null,8,["model"])):e.createCommentVNode("",!0),N.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",yt,[e.createElementVNode("div",vt,[e.createElementVNode("label",bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":l[7]||(l[7]=M=>e.isRef(u)?u.value=M:null),onChange:l[8]||(l[8]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[16]||(l[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":l[9]||(l[9]=M=>e.isRef(u)?u.value=M:null),onChange:l[10]||(l[10]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[17]||(l[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":l[11]||(l[11]=M=>e.isRef(u)?u.value=M:null),onChange:l[12]||(l[12]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[18]||(l[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":l[13]||(l[13]=M=>e.isRef(u)?u.value=M:null),onChange:l[14]||(l[14]=(...M)=>e.unref(R)&&e.unref(R)(...M))},null,544),[[e.vModelRadio,e.unref(u)]]),l[19]||(l[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",Mt,[e.createElementVNode("div",xt,[e.createElementVNode("span",null,e.toDisplayString(m.value),1),e.createElementVNode("span",{class:"close",onClick:l[15]||(l[15]=M=>k.value=!1)}," X ")]),e.createVNode(E,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(nt,{ref_key:"jointRef",ref:D,model:e.unref(G),scene:e.unref(r),animationData:a.animationData},null,8,["model","scene","animationData"]),[[e.vShow,m.value==="关节控制"]]),e.withDirectives(e.createVNode(Ie,{animationData:a.animationData},null,8,["animationData"]),[[e.vShow,m.value==="动画仿真"]])]),_:1})],512),[[e.vShow,k.value]]),c.value?(e.openBlock(),e.createElementBlock("div",Dt,[l[20]||(l[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0)])}}},St=le._export_sfc(Vt,[["__scopeId","data-v-7bc47bb3"]]);exports.default=St;
|