ss-component-new 1.2.85 → 1.2.87
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/{MTLLoader-DX8U25Z1.js → MTLLoader-DkSNLhC7.js} +1 -1
- package/dist/{MTLLoader-XWaijvjW.cjs → MTLLoader-J3dtRBIA.cjs} +1 -1
- package/dist/{OrbitControls-BoibflsJ.js → OrbitControls-CIInWJog.js} +1 -1
- package/dist/{OrbitControls-5sc4QVTb.cjs → OrbitControls-D7ENpunL.cjs} +1 -1
- package/dist/{URDFLoader-DRuMHEEY.js → URDFLoader-KWmrVx3h.js} +2 -2
- package/dist/{URDFLoader-DRsgdo2h.cjs → URDFLoader-ZNkXTFDG.cjs} +1 -1
- package/dist/{animationData-CQMP2Ry7.cjs → animationData-9UtaGYaZ.cjs} +1 -1
- package/dist/{animationData-Dcqbb7R7.js → animationData-AtWrsTvx.js} +1 -1
- package/dist/{array-CxvkAZo4.js → array-CATO5Q6T.js} +1 -1
- package/dist/{array-CsHTx87c.cjs → array-DfNjR0Qy.cjs} +1 -1
- package/dist/{iconfont-pGGINDaV.js → iconfont-CUOKY8wo.js} +2 -2
- package/dist/{iconfont-ufNSJ4gS.cjs → iconfont-U_cmKvyB.cjs} +1 -1
- package/dist/{index-CNjPIOkS.js → index-0IFTdOV8.js} +4 -4
- package/dist/{index-BTyVbfKd.cjs → index-B0lL5Vdy.cjs} +1 -1
- package/dist/{index-DujL6LbU.cjs → index-B52lJ3Ug.cjs} +1 -1
- package/dist/{index-DuFT4qcP.js → index-B69WOtXS.js} +16 -16
- package/dist/{index-5VP_0_pi.js → index-BOX5TGPv.js} +1 -1
- package/dist/{index-B-Ej5IDW.js → index-BPyk3UIE.js} +8 -8
- package/dist/{index-CGrundmL.cjs → index-BSnfRMZW.cjs} +1 -1
- package/dist/{index-DLxfEoby.js → index-BTR-xG0v.js} +1 -1
- package/dist/{index-CWXuROYc.js → index-Be9ofpB5.js} +1 -1
- package/dist/{index-BbLk6uGT.cjs → index-BecXuN38.cjs} +1 -1
- package/dist/{index-C-qlninE.js → index-ByrRF4uT.js} +3 -3
- package/dist/{index-DaODLF_y.cjs → index-C4h-dVEe.cjs} +1 -1
- package/dist/{index-ihmYWPUh.cjs → index-CAlMVMU_.cjs} +1 -1
- package/dist/{index-rkfjo_Gm.cjs → index-CB2c5ESn.cjs} +1 -1
- package/dist/{index-BReH9GpA.js → index-CDW9opLV.js} +4 -4
- package/dist/{index-C4Xg2c1m.js → index-CMsqZu-f.js} +1 -1
- package/dist/{index-i0NBWOoH.js → index-CN-NFjlN.js} +2 -2
- package/dist/{index-BxANp3fw.cjs → index-CffEdIhY.cjs} +1 -1
- package/dist/{index-CPaYwx5E.js → index-CluLZeK5.js} +2 -2
- package/dist/{index-exLt4yWh.js → index-CxVSFkzd.js} +1 -1
- package/dist/{index-AuhjxS2n.js → index-Cz2PyWsi.js} +4 -4
- package/dist/{index-DIdbFs9X.js → index-D38I7nZo.js} +1 -1
- package/dist/index-DCYFKE13.cjs +1 -0
- package/dist/{index-Wx_-zVEz.cjs → index-DHW5e_u_.cjs} +1 -1
- package/dist/{index-Cj17H0fw.cjs → index-DKeLuZIo.cjs} +1 -1
- package/dist/index-DMZt8ROM.js +2878 -0
- package/dist/{index-DVGqxAo1.cjs → index-DRL2SPEo.cjs} +1 -1
- package/dist/{index-J8TtNgq3.cjs → index-DTuRU8za.cjs} +1 -1
- package/dist/{index-BrbfK-gl.cjs → index-Dd3ofxbk.cjs} +1 -1
- package/dist/{index-BCr2tuwq.js → index-Ds0IFjwu.js} +1 -1
- package/dist/{index-BPq4kmwU.js → index-DtCpetgB.js} +1 -1
- package/dist/{index-DZxw71DQ.cjs → index-Dv5U7UHo.cjs} +1 -1
- package/dist/{index-VIc9HRPP.js → index-DzqEIEfs.js} +1 -1
- package/dist/{index-WI99pZuH.cjs → index-I9nYBweF.cjs} +1 -1
- package/dist/{index-7um03liv.cjs → index-Otnitd83.cjs} +1 -1
- package/dist/{index-1rJKDlxZ.cjs → index-UH73jPSH.cjs} +1 -1
- package/dist/{index-TL4pAA-u.js → index-kP_CVzzK.js} +1 -1
- package/dist/{index-BiNYM61q.js → index-m5CO_eOy.js} +7 -7
- package/dist/{index-ZQwYery3.cjs → index-o4iJ58d0.cjs} +1 -1
- package/dist/{index-Bs4AjJ09.js → index-rC2K3Bzj.js} +1 -1
- package/dist/{index-kG_zc7AB.cjs → index-sZDWq1eU.cjs} +1 -1
- package/dist/{index-Sx_xn72K.js → index-sawDaaXq.js} +3 -3
- package/dist/{index-BZyBjkTm.cjs → index-u7d75s7T.cjs} +1 -1
- package/dist/{index-B_vmEsjH.cjs → index-vB3AblAt.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BKBrtzw6.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BcCwZRas.js} +7488 -7453
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B3yzycJI.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DlpiRV_h.cjs} +11 -11
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C0v0KFdG.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs} +149 -149
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CoE66bK1.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js} +10032 -10016
- package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-aohz5G9I.js → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-8v2JVeca.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Cf3tVnf3.cjs → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-AgWRuXVC.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-DmlfCkWq.cjs → index.vue_vue_type_style_index_1_lang-C1z71r3A.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-BlJX3s3k.js → index.vue_vue_type_style_index_1_lang-DqwucUxZ.js} +3 -3
- package/dist/{main-RiReisGA.js → main-CHjImz22.js} +3 -3
- package/dist/{main-C8AwB8hx.cjs → main-kIoRHR7Y.cjs} +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 +10 -10
- package/dist/{threeModel-8KR0tSK_.js → threeModel-B7dMmL7L.js} +4 -4
- package/dist/{threeModel-D8uQOcZJ.cjs → threeModel-DhMeqTnZ.cjs} +1 -1
- package/dist/{threePreview-T8g8N9vx.js → threePreview-C7hIZVal.js} +3 -3
- package/dist/{threePreview-B0fRdL1U.cjs → threePreview-CloRtEyk.cjs} +1 -1
- package/dist/{threeSceneView-Cij2WoyK.cjs → threeSceneView-0NHz_iE7.cjs} +1 -1
- package/dist/{threeSceneView-B3-E-dSj.js → threeSceneView-DfL2muQG.js} +8 -8
- package/dist/{threeSceneViewForCPMPIP-D3SzrmQ1.cjs → threeSceneViewForCPMPIP-DKqP4yRh.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-B5dq9RkB.js → threeSceneViewForCPMPIP-DOcbIW0k.js} +7 -7
- package/dist/{threeTrackPathView-CfNlwHLQ.cjs → threeTrackPathView-BADN-C5w.cjs} +1 -1
- package/dist/{threeTrackPathView-C-AVXDKd.js → threeTrackPathView-BBGLRj2K.js} +3 -3
- package/dist/{threeViewerHost-CrjrxJI5.js → threeViewerHost-Cvy-AzyZ.js} +2 -2
- package/dist/{threeViewerHost-xe_Xn9SW.cjs → threeViewerHost-DmUYNEfj.cjs} +1 -1
- package/dist/{urdfTree-CWxkEb_j.js → urdfTree-CeIoAIYI.js} +1 -1
- package/dist/{urdfTree-p76qhqlU.cjs → urdfTree-Cf5fPKfb.cjs} +1 -1
- package/dist/{workpieceTreePanel-CzVWLxJ2.js → workpieceTreePanel-Bjf8fR7u.js} +4 -4
- package/dist/{workpieceTreePanel-BZ-a61Q8.cjs → workpieceTreePanel-CDnC5lGB.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-DUun0LWK.cjs +0 -1
- package/dist/index-vrk6oShs.js +0 -2878
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-DmUYNEfj.cjs"),pe=require("./iconfont-U_cmKvyB.cjs"),ve=require("./workpieceTreePanel-CDnC5lGB.cjs"),D=require("./index-C8qRkCgn.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index.vue_vue_type_style_index_1_lang-C1z71r3A.cjs");require("./index-CLJYSvkY.cjs");require("./index-DeBHVrj0.cjs");const fe=require("./animationData-9UtaGYaZ.cjs"),ie=require("./urdfTree-Cf5fPKfb.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Me=require("./index-DRL2SPEo.cjs"),R=require("./svgIcon-CUM54R6L.cjs"),G=.001,W=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Ee(g=.005,m=64){const d=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),s=new n.TubeGeometry(d,m,g,16,!1),p=ye;return new n.Mesh(s,p)}const xe=g=>g.reduce((m,d)=>{let s=0;const p=d.Y??0,b=d.C??0,r=d.R??0;return p>0&&(s+=p),b>0&&r>0&&(s+=r*W(b)),m+s},0),ke=g=>{const m=[],d=g.Y??0,s=g.B??0,p=g.C??0,b=g.R??0,r={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!d&&!p)return m;if(m.push(r.pos.clone()),s!==0){const h=new n.Matrix4().makeRotationAxis(r.localY,W(s));r.localX.applyMatrix4(h),r.localZ.applyMatrix4(h)}if(d>0&&(r.pos.add(r.localY.clone().multiplyScalar(d*G)),m.push(r.pos.clone())),p>0&&b>0){const h=W(p),v=b*G,w=r.pos.clone().add(r.localX.clone().multiplyScalar(-v)),a=Math.max(16,Math.ceil(p/5));for(let y=1;y<=a;y++){const u=h*y/a,_=new n.Matrix4().makeRotationAxis(r.localZ,u),c=r.localX.clone().multiplyScalar(v).applyMatrix4(_),x=w.clone().add(c);m.push(x)}}return m};function Te(g,m){const d=new n.Group;d.name="CompletePipe";const s={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let p=0,b=1;for(let r=0;r<g.length;r++){const h=g[r],v=h.Y??0,w=h.B??0,a=h.C??0,y=h.R??0;if(w!==0){const u=new n.Matrix4().makeRotationAxis(s.localY,W(w));s.localX.applyMatrix4(u),s.localZ.applyMatrix4(u)}if(v>0){const u=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(v*G));const _=s.pos.clone(),i=Pe(u,_,m*G);i.userData={segmentType:"straight",segmentIndex:p,frameIndex:r,length:v,frame:{Y:v,B:w,C:a,R:y}},i.name=`直段_${p}`,d.add(i);const c=u.clone();Se(d,b,c,m*G),p++}if(a>0&&y>0){const u=W(a),_=y*G,i=[];i.push(s.pos.clone());const c=s.pos.clone().add(s.localX.clone().multiplyScalar(-_)),x=Math.max(16,Math.ceil(a/5));for(let f=1;f<=x;f++){const k=u*f/x,B=new n.Matrix4().makeRotationAxis(s.localZ,k),L=s.localX.clone().multiplyScalar(_).applyMatrix4(B),q=c.clone().add(L);i.push(q)}const E=De(i,m*G);E.userData={segmentType:"bend",segmentIndex:p,frameIndex:r,angle:a,radius:y,centerPoint:c.toArray(),frame:{Y:v,B:w,C:a,R:y}},E.name=`弯段_${p}`,d.add(E),Math.floor(i.length/2),i[0],s.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(s.localZ,u);s.localY.applyMatrix4(T),s.localX.applyMatrix4(T),p++,b++}}return d}function Se(g,m,d,s){const p=new n.Vector3(0,s*2,s*5),b=d.clone().add(p),r=[d,b],h=new n.BufferGeometry().setFromPoints(r),v=new n.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),w=new n.Line(h,v);w.computeLineDistances(),g.add(w);const a=document.createElement("canvas"),y=a.getContext("2d");a.width=128,a.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(m.toString(),64,64);const u=new n.CanvasTexture(a),_=new n.SpriteMaterial({map:u,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(_),c=s*3;i.scale.set(c,c,1),i.position.copy(b),i.name=`Label_${m}`,i.userData={labelNumber:m},g.add(i)}function Pe(g,m,d){const s=new n.LineCurve3(g,m),p=new n.TubeGeometry(s,2,d,18,!1);return new n.Mesh(p,ye)}function De(g,m){const d=new n.CatmullRomCurve3(g,!1,"catmullrom",.01),s=new n.TubeGeometry(d,Math.max(16,g.length*2),m,18,!1);return new n.Mesh(s,ye)}function _e(g,m,d,s,p,b=0){let r=m.slice(0,p+1);const h=m[p+1];if(h&&b>0){const i={...h,B:(h.B??0)*b,C:(h.C??0)*b};r.push(i)}const v=xe(r),w=Math.max(0,d-v),a=[];a.push(new n.Vector3(0,0,0));const y=new n.Vector3(0,w*G,0);w>0&&a.push(y);let u={pos:y.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const _=[];for(let i=r.length-1;i>=0;i--){const c=r[i],x=ke(c);if(x.length>0){const E=x.map(B=>{const A=B.clone(),L=new n.Matrix4;return L.makeBasis(u.localX,u.localY,u.localZ),A.applyMatrix4(L),A.add(u.pos)});_.push(E);const T=E[E.length-1];u.pos=T.clone();const f=c.B??0,k=c.C??0;if(f!==0){const B=new n.Matrix4().makeRotationAxis(u.localY,W(f));u.localX.applyMatrix4(B),u.localZ.applyMatrix4(B)}if(k>0){const B=W(k),A=new n.Matrix4().makeRotationAxis(u.localZ,B);u.localY.applyMatrix4(A),u.localX.applyMatrix4(A)}}}for(const i of _)i.length>1&&a.push(...i.slice(1));a.length<2&&a.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(a,!1,"catmullrom",.01),c=new n.TubeGeometry(i,Math.max(2,a.length*4),s*G,18,!1);g.geometry.dispose(),g.geometry=c}catch(i){console.error("管件更新失败",i)}}function Ce(g,m,d,s=0){let p=g.slice(0,d+1);const b=g[d+1];if(b&&s>0){const u={...b,B:(b.B??0)*s,C:(b.C??0)*s};p.push(u)}const r=xe(p),h=Math.max(0,m-r),v=[];v.push(new n.Vector3(0,0,0));const w=new n.Vector3(0,h*G,0);h>0&&v.push(w);let a={pos:w.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const y=[];for(let u=p.length-1;u>=0;u--){const _=p[u],i=ke(_);if(i.length>0){const c=i.map(f=>{const k=f.clone(),B=new n.Matrix4;return B.makeBasis(a.localX,a.localY,a.localZ),k.applyMatrix4(B),k.add(a.pos)});y.push(c);const x=c[c.length-1];a.pos=x.clone();const E=_.B??0,T=_.C??0;if(E!==0){const f=new n.Matrix4().makeRotationAxis(a.localY,W(E));a.localX.applyMatrix4(f),a.localZ.applyMatrix4(f)}if(T>0){const f=W(T),k=new n.Matrix4().makeRotationAxis(a.localZ,f);a.localY.applyMatrix4(k),a.localX.applyMatrix4(k)}}}for(const u of y)u.length>1&&v.push(...u.slice(1));return v.length<2&&v.push(new n.Vector3(0,.001,0)),v}function Ne(g,m,d,s,p,b,r,h=0,v=0){const w=p-v,a=Ce(s,w,r,h);let u=Ce(d,v,r,h);u.forEach(i=>i.y=-i.y),u.reverse();const _=[...u,...a];try{const i=new n.CatmullRomCurve3(_,!1,"catmullrom",.01),c=new n.TubeGeometry(i,Math.max(2,_.length*4),b*G,18,!1);m.geometry.dispose(),g.geometry.dispose(),m.parent&&m.parent.remove(m),g.geometry=c}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(g,{expose:m}){const d=g,s=e.ref(),p=e.ref();e.watch(()=>d.threeData,o=>{const t=o==null?void 0:o.data;p.value=t==null?void 0:t.type},{immediate:!0});const b=async()=>{let o={};p.value===ne.robotMode.SINGLE&&(o=await fe.fetchSingleRobotAnimationData()),p.value===ne.robotMode.DOUBLE&&(o=await fe.fetchDoubleRobotAnimationData());const{initialPipeLength:t=0,pipeRadius:l=0,clampLength:V=0,animationData:C}=o;T.value=t,f.value=l,k.value=V,s.value=C;const $=D.cloneDeep(s.value),J=re(Y.value),X=($==null?void 0:$["输出(动画数据)"])||[];r.value=X.length?X:[J]},r=e.ref([]),h=e.ref(!1),v=e.ref(""),w=e.ref(!1),a=e.ref(0),y=e.ref(0),u=e.ref(1e3);let _=!1;const i=e.ref(null),c=e.shallowRef(null),x=e.shallowRef(null),E=e.shallowRef(null),T=e.ref(0),f=e.ref(12.5),k=e.ref(30),B=e.ref([]),A=e.ref(null),L=e.computed(()=>d.model?ie.getNonFixedJoints(d.model).map(l=>l.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),ae=()=>r.value.map(o=>({Y:parseFloat(o.Y)||0,B:parseFloat(o.B)||0,C:parseFloat(o.C)||0,R:parseFloat(o.R)||0})),K=()=>{const o=[],t=[];return r.value.forEach(l=>{const{Y1:V,B1:C,C1:$,R1:J,Y2:X,B2:oe,C2:de,R2:P}=l;o.push({Y:parseFloat(V)||0,B:parseFloat(C)||0,C:parseFloat($)||0,R:parseFloat(J)||0}),t.push({Y:parseFloat(X)||0,B:parseFloat(oe)||0,C:parseFloat(de)||0,R:parseFloat(P)||0})}),{posPipeYbcr:o,negPipeYbcr:t}},M=(o=0,t=0)=>{if(c.value&&x.value){const l=K();Ne(c.value,x.value,l.posPipeYbcr,l.negPipeYbcr,T.value,f.value,o,t,k.value)}else if(c.value){const l=ae();_e(c.value,l,T.value,f.value,o,t)}},N=o=>{if(o<0||o>=r.value.length){console.error(`帧索引 ${o} 超出范围`);return}const t=r.value[o];if(console.log(`应用第 ${o} 帧数据 ${t}`),a.value=o,i.value){const l={};L.value.forEach(V=>{const C=parseFloat(t[V]);isNaN(C)||(l[V]=C)}),i.value.setJointAngles(l)}M(o,0)},U=async()=>{if(r.value.length===0){D.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,r.value.length-1===a.value&&(a.value=0);try{for(let o=a.value+1;o<r.value.length&&!_;o++){a.value=o;const t=r.value[o],l={};i.value&&L.value.forEach(V=>{const C=parseFloat(t[V]);isNaN(C)||(l[V]=C)}),i.value?await i.value.animateToState(l,u.value,V=>{y.value=(o+V)/r.value.length*100,M(o-1,V)}):(await new Promise(V=>setTimeout(V,u.value)),y.value=(o+1)/r.value.length*100)}_||D.ElMessage.success("动画播放完成")}catch(o){console.error("动画播放出错:",o),D.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,D.ElMessage.info("动画已停止")},I=()=>{a.value=0},z=()=>{if(c.value&&x.value){const o=K();Ne(c.value,x.value,o.posPipeYbcr,o.negPipeYbcr,T.value,f.value,-1,0,k.value)}else if(c.value){const o=ae();_e(c.value,o,T.value,f.value,-1,0)}},Z=()=>{i.value&&i.value.resetToZero(),z(),I(),D.ElMessage.success("机器人和管件已重置")},O=o=>`第 ${o+1} 帧`,j=o=>{w.value&&F(),N(o)},Q=()=>{w.value&&F(),!(a.value+1>=r.value.length)&&N(a.value+1)},S=()=>{w.value&&F(),a.value!==0&&N(a.value-1)},H=()=>{E.value&&(E.value.visible=!0),c.value&&c.value.parent&&c.value.parent.remove(c.value),E.value=null,c.value=null,x.value=null},re=o=>o==null?void 0:o.reduce((t,l)=>(t[l]="0",t),{});e.watch(Y,(o,t)=>{if(JSON.stringify(o)!==JSON.stringify(t))if(o.length>0){const l=re(o);r.value=[l]}else r.value=[]},{immediate:!0});const ee=e.ref(0),ue=o=>{ee.value=o},he=(o,t)=>{if(!o||!t)return;const l=ie.getTargetJoint(o,t),V=Ee();V.visible=!1,l==null||l.add(V)},ge=o=>{i.value=new ve.URDFRobotController(o),B.value=ie.getAllLinkName(o),A.value="Pipe_Joint"},te=()=>{i.value=null,B.value=[],A.value=null},se=o=>{ge(o),he(o,A.value),ue(ee.value+1),Z()};e.watch(()=>d.model,o=>{if(H(),o){se(o);return}te()},{immediate:!0});const me=o=>{var l,V;const t=new n.Mesh(o.geometry.clone(),o.material);return t.name="managed_pipe_clone",(V=(l=o==null?void 0:o.parent)==null?void 0:l.add)==null||V.call(l,t),t.position.copy(o.position),t.rotation.copy(o.rotation),t.scale.copy(o.scale),t};e.watch([A,k,T,ee],([o,t])=>{if(H(),d.model&&o){const l=ie.getMeshFromJoint(d.model,o);if(console.log(l,"meshToReplace"),l&&l.parent){E.value=l,l.visible=!1;const V=me(l);if(p.value===ne.robotMode.SINGLE&&(V.position.y-=t*.001),c.value=V,p.value===ne.robotMode.DOUBLE){const C=me(l);x.value=C}M(0,0)}else o&&console.warn(`在 link '${o}' 中未找到可替换的网格或其没有父级。`)}});const Ve=async()=>{if(Y.value.length===0){D.ElMessage.warning("没有可导出的表头");return}const o=Y.value.join(" ");try{await navigator.clipboard.writeText(o),D.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),D.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!v.value.trim()){D.ElMessage.warning("导入内容不能为空");return}const o=v.value.trim().split(`
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { defineComponent as Be, ref as g, watch as ne, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as B, createElementBlock as De, openBlock as q, createElementVNode as r, createVNode as l, withCtx as R, createBlock as ye, createCommentVNode as ke, unref as X, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as He, renderList as Ke, nextTick as Qe, withDirectives as pe, vShow as de, renderSlot as Me } from "vue";
|
|
2
|
-
import { r as Te, s as Le } from "./threeViewerHost-
|
|
3
|
-
import { u as Je, a as qe, b as et, C as tt } from "./iconfont-
|
|
4
|
-
import { U as lt, u as ot, a as at, W as nt } from "./workpieceTreePanel-
|
|
2
|
+
import { r as Te, s as Le } from "./threeViewerHost-Cvy-AzyZ.js";
|
|
3
|
+
import { u as Je, a as qe, b as et, C as tt } from "./iconfont-CUOKY8wo.js";
|
|
4
|
+
import { U as lt, u as ot, a as at, W as nt } from "./workpieceTreePanel-Bjf8fR7u.js";
|
|
5
5
|
import { ag as st, c as it, E, aW as rt, aw as ut } from "./index-BgE_6FYY.js";
|
|
6
|
-
import { ak as Ve, al as xe, X as D, ai as H, aj as ct, aH as pt, a9 as Se, aI as dt, aJ as mt, aK as vt, aL as ft, aM as gt, aN as ht, aO as bt, aP as yt, af as _t, aQ as Ye, aR as wt, aS as Ct, aT as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
6
|
+
import { ak as Ve, al as xe, X as D, ai as H, aj as ct, aH as pt, a9 as Se, aI as dt, aJ as mt, aK as vt, aL as ft, aM as gt, aN as ht, aO as bt, aP as yt, af as _t, aQ as Ye, aR as wt, aS as Ct, aT as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
7
7
|
import "./index-BHtNKL1L.js";
|
|
8
8
|
import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
9
|
-
import "./index.vue_vue_type_style_index_1_lang-
|
|
9
|
+
import "./index.vue_vue_type_style_index_1_lang-DqwucUxZ.js";
|
|
10
10
|
import "./index-Bmtw8a5p.js";
|
|
11
11
|
import "./index-D_qR3hDI.js";
|
|
12
|
-
import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-
|
|
13
|
-
import { g as Tt, a as Dt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-
|
|
12
|
+
import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-AtWrsTvx.js";
|
|
13
|
+
import { g as Tt, a as Dt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-CeIoAIYI.js";
|
|
14
14
|
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
|
-
import { s as Ft } from "./index-
|
|
15
|
+
import { s as Ft } from "./index-DzqEIEfs.js";
|
|
16
16
|
import { T as z } from "./svgIcon-D-_fXUBL.js";
|
|
17
17
|
const I = 1e-3, oe = ct.degToRad, Ee = new dt({
|
|
18
18
|
// 灰色
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Q=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Q=require("./threeViewerHost-DmUYNEfj.cjs"),q=require("./iconfont-U_cmKvyB.cjs"),J=require("./workpieceTreePanel-CDnC5lGB.cjs"),f=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs");const ee=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-Cf5fPKfb.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),h=require("./svgIcon-CUM54R6L.cjs"),ye=require("./animationData-9UtaGYaZ.cjs"),ke=require("./MTLLoader-J3dtRBIA.cjs"),Ee={class:"panel-content"},Ce={key:0,class:"animation-controls"},_e={class:"control-row"},we={class:"control-row"},Se={class:"frame-info"},Pe={class:"control-row"},Te={key:1,class:"empty-state"},Be={class:"dialog-footer"},xe=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(T,{expose:d}){const k=T,s=e.ref([]),_=e.ref(!1),B=e.ref(""),v=e.ref("stopped"),g=e.ref(0),w=e.ref(0),b=e.ref(10),i=e.ref(null);let u=0;const V=e.ref([]),N=e.computed(()=>k.model?U.getNonFixedJoints(k.model).map(m=>m.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${S.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),M=e.computed(()=>s.value[g.value]||{});e.watch(()=>k.model,o=>{o?(i.value=new J.URDFRobotController(o),V.value=U.getAllLinkName(o),g.value=0):(i.value=null,V.value=[])},{immediate:!0});const z=o=>{if(o<0||o>=s.value.length){console.error(`帧索引 ${o} 超出范围`);return}const n=s.value[o];if(i.value){const m={};N.value.forEach(y=>{const r=parseFloat(n[y]);isNaN(r)||(m[y]=r)}),i.value.setJointAngles(m)}g.value=o,w.value=s.value.length>1?o/(s.value.length-1)*100:100},L=async o=>{try{for(let n=g.value;n<s.value.length;n++){if(o!==u)return;const m=s.value[n],y={};if(i.value)N.value.forEach(r=>{const p=parseFloat(m[r]);isNaN(p)||(y[r]=p)}),await i.value.animateToState(y,b.value,r=>{o===u&&(w.value=(n+r)/s.value.length*100)});else{if(await new Promise(r=>setTimeout(r,b.value)),o!==u)return;w.value=(n+1)/s.value.length*100}g.value=n}o===u&&(f.ElMessage.success("动画播放完成"),v.value="stopped",w.value=100)}catch(n){console.error("动画播放出错:",n),f.ElMessage.error("动画播放出错"),v.value="stopped"}},x=()=>{if(s.value.length===0){f.ElMessage.error("无动画数据");return}v.value==="stopped"&&(g.value=0,z(0)),v.value="playing",u++,L(u),f.ElMessage.info("动画播放中")},$=()=>{v.value==="playing"&&(u++,v.value="paused",f.ElMessage.info("动画已暂停"))},R=()=>{u++,v.value="stopped",g.value=0,w.value=0,z(0),f.ElMessage.info("动画已停止并重置")},F=()=>{v.value==="playing"?$():x()},D=o=>{u++,v.value="paused",z(o)},G=()=>{if(!B.value.trim()){f.ElMessage.warning("导入内容不能为空");return}const o=B.value.trim().split(`
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent as fe, ref as r, computed as k, watch as X, onUnmounted as Fe, resolveComponent as G, createElementBlock as U, openBlock as g, createElementVNode as n, createCommentVNode as L, createVNode as s, toDisplayString as j, Fragment as Ne, renderList as Oe, withCtx as le, shallowRef as te, onMounted as Re, nextTick as De, onBeforeUnmount as Be, withDirectives as I, vShow as W, unref as $, renderSlot as ce, createBlock as de } from "vue";
|
|
2
|
-
import { s as ve } from "./threeViewerHost-
|
|
3
|
-
import { u as Ee, a as Je, b as Me, C as Ge } from "./iconfont-
|
|
4
|
-
import { U as He, u as Ie, a as We, W as Xe } from "./workpieceTreePanel-
|
|
2
|
+
import { s as ve } from "./threeViewerHost-Cvy-AzyZ.js";
|
|
3
|
+
import { u as Ee, a as Je, b as Me, C as Ge } from "./iconfont-CUOKY8wo.js";
|
|
4
|
+
import { U as He, u as Ie, a as We, W as Xe } from "./workpieceTreePanel-Bjf8fR7u.js";
|
|
5
5
|
import { c as Ye, E as _ } from "./index-BgE_6FYY.js";
|
|
6
|
-
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
6
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
7
7
|
import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
8
|
-
import { g as Ze, b as qe, U as Ke, J as Qe, d as et } from "./urdfTree-
|
|
8
|
+
import { g as Ze, b as qe, U as Ke, J as Qe, d as et } from "./urdfTree-CeIoAIYI.js";
|
|
9
9
|
import { _ as be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
import { T as y } from "./svgIcon-D-_fXUBL.js";
|
|
11
|
-
import { i as tt } from "./animationData-
|
|
12
|
-
import { O as lt } from "./MTLLoader-
|
|
11
|
+
import { i as tt } from "./animationData-AtWrsTvx.js";
|
|
12
|
+
import { O as lt } from "./MTLLoader-DkSNLhC7.js";
|
|
13
13
|
const nt = { class: "panel-content" }, at = {
|
|
14
14
|
key: 0,
|
|
15
15
|
class: "animation-controls"
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),P=require("./iconfont-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),P=require("./iconfont-U_cmKvyB.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs"),xe=require("./index-C8qRkCgn.cjs"),Z=require("./urdfTree-Cf5fPKfb.cjs"),g=require("./svgIcon-CUM54R6L.cjs"),Se=require("./isString--eJE54G5.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),J=new c.Box3,O=new c.Vector3;class ie extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],n=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(n,2))}applyMatrix4(e){const n=this.attributes.instanceStart,o=this.attributes.instanceEnd;return n!==void 0&&(n.applyMatrix4(e),o.applyMatrix4(e),n.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let n;e instanceof Float32Array?n=e:Array.isArray(e)&&(n=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(n,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const n=e.geometry;return this.setPositions(n.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;e!==void 0&&n!==void 0&&(this.boundingBox.setFromBufferAttribute(e),J.setFromBufferAttribute(n),this.boundingBox.union(J))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,n=this.attributes.instanceEnd;if(e!==void 0&&n!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let t=0;for(let r=0,l=e.count;r<l;r++)O.fromBufferAttribute(e,r),t=Math.max(t,o.distanceToSquared(O)),O.fromBufferAttribute(n,r),t=Math.max(t,o.distanceToSquared(O));this.boundingSphere.radius=Math.sqrt(t),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
|
|
2
2
|
#include <common>
|
|
3
3
|
#include <color_pars_vertex>
|
|
4
4
|
#include <fog_pars_vertex>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as He, ref as T, shallowRef as ue, computed as H, watch as Ne, onMounted as Ve, onBeforeUnmount as qe, resolveComponent as $e, createElementBlock as fe, openBlock as N, createElementVNode as g, withDirectives as Z, createCommentVNode as J, createVNode as h, unref as R, renderSlot as pe, toDisplayString as K, withCtx as me, createBlock as he, vShow as Q } from "vue";
|
|
2
|
-
import { u as Xe, a as Ye, b as Ze, C as Je, f as Ke, d as Qe } from "./iconfont-
|
|
3
|
-
import { bL as et, aW as ie, bM as se, bD as O, bN as tt, Y as oe, bK as Se, X as U, bO as nt, bP as X, bQ as ze, b8 as Ce, bR as Y, a9 as it, bS as W, bT as st, ai as ot, aj as _e, ak as rt, aK as at, aY as lt, aZ as ct, bU as dt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
2
|
+
import { u as Xe, a as Ye, b as Ze, C as Je, f as Ke, d as Qe } from "./iconfont-CUOKY8wo.js";
|
|
3
|
+
import { bL as et, aW as ie, bM as se, bD as O, bN as tt, Y as oe, bK as Se, X as U, bO as nt, bP as X, bQ as ze, b8 as Ce, bR as Y, a9 as it, bS as W, bT as st, ai as ot, aj as _e, ak as rt, aK as at, aY as lt, aZ as ct, bU as dt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
4
4
|
import { E as ut } from "./index-BgE_6FYY.js";
|
|
5
|
-
import { U as ft, J as pt } from "./urdfTree-
|
|
5
|
+
import { U as ft, J as pt } from "./urdfTree-CeIoAIYI.js";
|
|
6
6
|
import { T as v } from "./svgIcon-D-_fXUBL.js";
|
|
7
7
|
import { i as mt } from "./isString-Bb0EYAKj.js";
|
|
8
8
|
import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as U, defineAsyncComponent as S, computed as I, ref as N, watch as H, createElementBlock as V, openBlock as T, createElementVNode as K, createBlock as F, createCommentVNode as B, renderSlot as l, unref as m, withCtx as d } from "vue";
|
|
2
2
|
import { bS as W, p as D, s as A } from "./index-BgE_6FYY.js";
|
|
3
3
|
import { u as $ } from "./index-D_qR3hDI.js";
|
|
4
|
-
import { b as j, aF as M, aG as G } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
+
import { b as j, aF as M, aG as G } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
5
5
|
import { _ as L } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const se = {
|
|
7
7
|
SINGLE: "单机",
|
|
@@ -111,7 +111,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
111
111
|
height: { default: "100%" }
|
|
112
112
|
},
|
|
113
113
|
setup(E) {
|
|
114
|
-
const O = S(() => import("./threeSceneView-
|
|
114
|
+
const O = S(() => import("./threeSceneView-DfL2muQG.js")), y = S(() => import("./threePreview-C7hIZVal.js")), i = S(() => import("./threeTrackPathView-BBGLRj2K.js")), p = S(() => import("./threeSceneViewForCPMPIP-DOcbIW0k.js")), n = E, P = $(D), { platName: u } = A(P), { isUrdf: b, isTrackPathFile: g } = Y(), c = I(() => {
|
|
115
115
|
var t;
|
|
116
116
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
117
117
|
const { url: e } = s;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h=require("./index-C8qRkCgn.cjs"),B=require("./index-DeBHVrj0.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./index-C8qRkCgn.cjs"),B=require("./index-DeBHVrj0.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={SINGLE:"单机",DOUBLE:"双机"},V={ROBOT:1,PIPECOMPARSION:2},a={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},I=h.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function O(){const v=B.useMenuState(h.pinia),{platform:g}=h.storeToRefs(v),P=I(h.pinia),c=["uv","cyd"],d=["urdf"],r=["obj","stl"],T=[...c,...d,...r],u=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),m=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},p=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},f=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1};const o=l(t),i=c==null?void 0:c.find(k=>k===o);return{isCpt:i==="cpt",isCyd:i==="cyd",isUv:i==="uv"}},_=t=>{if(!t)return!1;const o=l(t);return d==null?void 0:d.includes(o)},b=t=>C()&&m(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:u,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:p,isThreeFile:m,isUseBackdrop:b,initTrackFileType:f,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let i=0;i<t.length;i++){const w=t[i],k=n(w);o.push(k)}return o}}}const N={class:"three-platform mv-inline"},A={class:"top-menu"},M={key:4,class:"loading"},H=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-0NHz_iE7.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-CloRtEyk.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-BADN-C5w.cjs"))),d=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-DKqP4yRh.cjs"))),r=v,T=B.useMenuState(h.pinia),{platName:u}=h.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=O(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),m=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),p=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return a.ROBOT_SCENE;case"track":return a.TRACK_PATH;case"cpmpip":return a.CPMPIP_SCENE;case"preview":return a.PREVIEW}return(u==null?void 0:u.value)===S.platNameConstants.CPMPIP&&y(m.value)?a.CPMPIP_SCENE:(u==null?void 0:u.value)===S.platNameConstants.ROBOT&&y(m.value)?a.ROBOT_SCENE:C(m.value)&&E.value?a.TRACK_PATH:a.PREVIEW}),f=e.ref([]),_=e.ref(!1);async function b(n){if(!n||!n.length){f.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));f.value=s}catch(s){console.error("文件下载时发生错误:",s),f.value=[]}finally{_.value=!1}}return e.watch(()=>r.files,async n=>{const s=n.map(t=>{const{url:o}=t;return o});await b(s??[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",A,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),p.value===e.unref(a).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,"file-blobs":f.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","threeData"])):p.value===e.unref(a).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileUrls:l.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileUrls","threeData","trackFileType"])):p.value===e.unref(a).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(d),{key:2,"file-blobs":f.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs","threeData"])):p.value===e.unref(a).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,"file-blobs":f.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["file-blobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",M," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),D=F._export_sfc(H,[["__scopeId","data-v-2562c7ef"]]),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=D;exports.robotMode=R;exports.sceneType=V;exports.threeViewerHost=$;exports.useThreeState=I;exports.useThreeSystem=O;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as I, ref as F, watch as M, onMounted as C, onUnmounted as E, createElementBlock as m, openBlock as f, Fragment as P, renderList as T, createElementVNode as c, createCommentVNode as U, toDisplayString as h, computed as L, resolveComponent as S, createVNode as A } from "vue";
|
|
2
|
-
import { a9 as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
2
|
+
import { a9 as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
3
3
|
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const D = (i, a) => {
|
|
5
5
|
if (!a)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const n=require("vue"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs"),x=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),J=(o,a)=>{if(!a)return null;const i=o.joints[a];return i||null},V=(o,a)=>{if(!a)return null;const i=J(o,a);if(!i)return null;let u=null;return i.traverse(c=>{c instanceof k.Mesh&&!u&&(u=c)}),u},F=(o,a)=>{if(!a)return null;const i=o.links[a];return i||null},L=(o,a)=>{if(!a)return null;const i=F(o,a);if(!i)return null;let u=null;return i.traverse(c=>{c instanceof k.Mesh&&!u&&(u=c)}),u},E=o=>{const a=o.joints;return Object.values(a)},M=o=>E(o).filter(u=>u.jointType!=="fixed"),N=o=>{const a=o.links;return Object.keys(a)},w={class:"panel-content"},B={key:0,class:"joints-list"},b={class:"joint-info-row"},I={class:"joint-left"},S={class:"joint-name"},C={class:"joint-range"},D={class:"joint-type"},P={key:0,class:"joint-control-row"},T={class:"slider-container"},U=["min","max","value","onInput"],A={class:"value-display"},R={class:"joint-value"},q={class:"unit"},O={key:1,class:"empty-state"},K=n.defineComponent({__name:"urdfJointPanel",props:{model:{}},setup(o,{expose:a}){const i=o,u=n.ref([]),c=n.ref(null),f=(r,e=!1)=>r==="revolute"?e?Math.PI:-Math.PI:r==="prismatic"?e?1:-1:0,h=r=>{if(!r||!r.joints)return console.warn("URDF模型无效或不包含关节信息"),[];const e=[];return E(r).forEach(l=>{var d,p;if(l.jointType==="fixed")return;let t={lower:((d=l.limit)==null?void 0:d.lower)??f(l.jointType,!1),upper:((p=l.limit)==null?void 0:p.upper)??f(l.jointType,!0)};l.jointType==="continuous"&&(t={lower:-10*Math.PI,upper:10*Math.PI}),e.push({name:l.name,type:l.jointType||"unknown",limit:t,currentValue:l.angle||0,urdfJoint:l})}),e},m=(r,e)=>{var d;const s=u.value.find(p=>p.name===r);if(!s)return;const l=parseFloat(e),t=Math.max(s.limit.lower,Math.min(s.limit.upper,l));s.currentValue=t,(d=i.model)!=null&&d.setJointValue?i.model.setJointValue(r,t):s.urdfJoint.setJointValue(t)},_=()=>{u.value.forEach(r=>{(r.type==="revolute"||r.type==="continuous"||r.type==="prismatic")&&m(r.name,0)})},g=()=>{i.model&&u.value.forEach(r=>{r.urdfJoint.angle!==void 0&&r.currentValue!==r.urdfJoint.angle&&(r.currentValue=r.urdfJoint.angle)})},v=()=>{const r=()=>{g(),c.value=requestAnimationFrame(r)};r()},y=()=>{c.value&&(cancelAnimationFrame(c.value),c.value=null)};return n.watch(()=>i.model,r=>{r?u.value=h(r):u.value=[]},{immediate:!0}),n.onMounted(()=>{v()}),n.onUnmounted(()=>{y()}),a({resetAllJoints:_}),(r,e)=>(n.openBlock(),n.createElementBlock("div",w,[u.value.length>0?(n.openBlock(),n.createElementBlock("div",B,[(n.openBlock(!0),n.createElementBlock(n.Fragment,null,n.renderList(u.value,s=>(n.openBlock(),n.createElementBlock("div",{key:s.name,class:"joint-item"},[n.createElementVNode("div",b,[n.createElementVNode("div",I,[n.createElementVNode("span",S,n.toDisplayString(s.name),1),n.createElementVNode("span",C," ["+n.toDisplayString(s.limit.lower.toFixed(2))+", "+n.toDisplayString(s.limit.upper.toFixed(2))+"] ",1)]),n.createElementVNode("span",D,n.toDisplayString(s.type),1)]),s.type==="revolute"||s.type==="prismatic"||s.type==="continuous"?(n.openBlock(),n.createElementBlock("div",P,[n.createElementVNode("div",T,[n.createElementVNode("input",{type:"range",min:s.limit.lower,max:s.limit.upper,step:"0.001",value:s.currentValue,onInput:l=>m(s.name,l.target.value),class:"joint-slider"},null,40,U)]),n.createElementVNode("div",A,[n.createElementVNode("span",R,n.toDisplayString(s.currentValue?Number(s.currentValue).toFixed(3):"0.000"),1),n.createElementVNode("span",q,n.toDisplayString(s.type==="prismatic"?"m":"rad"),1)])])):n.createCommentVNode("",!0)]))),128))])):(n.openBlock(),n.createElementBlock("div",O,e[0]||(e[0]=[n.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}}),$=x._export_sfc(K,[["__scopeId","data-v-750b831d"]]),H={class:"panel-content"},z="id",G={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:o=>["breadth","firstLevel"].includes(o)}},emits:["nodeClick"],setup(o,{emit:a}){const i=o,u=a,c=n.ref([]),f={children:"children",label:"label"},h=e=>{u("nodeClick",e)},m=(e,s=0)=>{const l=[];return Array.isArray(e)&&(e==null?void 0:e.length)>0&&e.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const d={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:s+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:m(t==null?void 0:t.children,s+1),path:t==null?void 0:t.name};l.push(d)}}),l},_=e=>e?[{name:e==null?void 0:e.name,label:e==null?void 0:e.name,show:!0,level:1,isPenultimate:!1,type:e==null?void 0:e.type,id:e==null?void 0:e.id,limit:(e==null?void 0:e.limit)??"",children:m(e==null?void 0:e.children,1)||[],path:e==null?void 0:e.name}]:[],g=(e,s)=>{const l=[],t=[...e];for(;t.length>0&&l.length<s;){const d=t.shift();d.children&&d.children.length>0&&(l.push(d.id),t.push(...d.children))}return l},v=(e,s)=>{const l=[];return e.forEach(t=>{if(t.children&&t.children.length>0){l.push(t.id);const d=t.children.filter(p=>p.children&&p.children.length>0).slice(0,s).map(p=>p.id);l.push(...d)}}),l.slice(0,s+1)},y=n.computed(()=>!c.value||c.value.length===0?[]:i.expandStrategy==="firstLevel"?v(c.value,i.maxExpandCount):g(c.value,i.maxExpandCount)),r=n.computed(()=>[{name:"场景",label:"场景",show:!0,level:1,isPenultimate:!1,type:"场景",id:"场景",children:i!=null&&i.model?_(i.model):[],path:"场景"}]);return n.watch(r,e=>{c.value=JSON.parse(JSON.stringify(e))},{immediate:!0}),(e,s)=>{const l=n.resolveComponent("el-tree");return n.openBlock(),n.createElementBlock("div",H,[n.createVNode(l,{data:c.value,props:f,"default-expanded-keys":y.value,"node-key":z,onNodeClick:h},null,8,["data","default-expanded-keys"])])}}},Q=x._export_sfc(G,[["__scopeId","data-v-cfde50c3"]]);exports.JointPanel=$;exports.UrdfTree=Q;exports.getAllLinkName=N;exports.getMeshFromJoint=V;exports.getMeshFromLink=L;exports.getNonFixedJoints=M;exports.getTargetJoint=J;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var ce = Object.defineProperty;
|
|
2
2
|
var de = (b, l, t) => l in b ? ce(b, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : b[l] = t;
|
|
3
3
|
var J = (b, l, t) => de(b, typeof l != "symbol" ? l + "" : l, t);
|
|
4
|
-
import { U as me } from "./URDFLoader-
|
|
5
|
-
import { S as ve, M as pe, O as fe } from "./MTLLoader-
|
|
6
|
-
import { bV as be, bW as re, aH as O, ae as we, a9 as he, bX as E, Y as _e, bY as ge, b8 as je, X as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
+
import { U as me } from "./URDFLoader-KWmrVx3h.js";
|
|
5
|
+
import { S as ve, M as pe, O as fe } from "./MTLLoader-DkSNLhC7.js";
|
|
6
|
+
import { bV as be, bW as re, aH as O, ae as we, a9 as he, bX as E, Y as _e, bY as ge, b8 as je, X as ye } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-UNe6-w-O.js";
|
|
7
7
|
import { ref as T, defineComponent as Le, computed as M, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as V, createVNode as U, createElementVNode as c, withCtx as F, createTextVNode as D, toDisplayString as C } from "vue";
|
|
8
|
-
import { c as Re, e as Ue, g as $e } from "./iconfont-
|
|
8
|
+
import { c as Re, e as Ue, g as $e } from "./iconfont-CUOKY8wo.js";
|
|
9
9
|
import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
10
10
|
const Se = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
|
|
11
11
|
function Me(b) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-DRsgdo2h.cjs"),S=require("./MTLLoader-XWaijvjW.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C0v0KFdG.cjs"),e=require("vue"),D=require("./iconfont-ufNSJ4gS.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(this,"movableJoints");this.robot=i,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(i=>i.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(i=>i.name)}setJointAngle(i,o){const l=this.robot.joints[i];if(!l||l.jointType==="fixed")return console.warn(`关节 ${i} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${i} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(i){Object.entries(i).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const i={};return this.movableJoints.forEach(o=>{i[o.name]=o.angle||0}),i}resetToZero(){this.movableJoints.forEach(i=>{i.setJointValue(0)})}getJointLimits(i){const o=this.robot.joints[i];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(i,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}easeInOutCubic(i){return i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2}async playSequence(i,o=1e3,l){for(let m=0;m<i.length;m++)await this.animateToState(i[m],o,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level:1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
|
|
1
|
+
"use strict";var ee=Object.defineProperty;var te=(b,i,o)=>i in b?ee(b,i,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[i]=o;var C=(b,i,o)=>te(b,typeof i!="symbol"?i+"":i,o);const oe=require("./URDFLoader-ZNkXTFDG.cjs"),S=require("./MTLLoader-J3dtRBIA.cjs"),N=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BMVxMU7L.cjs"),e=require("vue"),D=require("./iconfont-U_cmKvyB.cjs"),se=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),le="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function re(b){const{mtlUrl:i,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.MTLLoader(o);return l&&p.setResourcePath(l),p.load(i,m,r,_),p}function ie(b){const{objUrl:i,manager:o,materials:l,onLoad:m,onProgress:r,onError:_}=b,p=new S.OBJLoader(o);return l&&p.setMaterials(l),p.load(i,m,r,_),p}function ne(b){const{manager:i,baseFolderUrl:o,onFileProgress:l}=b,m=new oe.URDFLoader(i);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,_,p)=>{const g=(()=>{const h=r.split("?")[0].split("#")[0],c=h.lastIndexOf(".");return c>=0?h.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const h=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${h}${c}.mtl`,V=a=>{ie({objUrl:r,manager:_,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new N.Group)}})};re({mtlUrl:f,manager:_,resourcePath:h,onLoad:a=>{try{a.preload()}catch{}V(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),V(void 0)}});break}case"stl":{new S.STLLoader(_).load(r,c=>{const f=new N.MeshPhongMaterial({color:12303291,shininess:30}),V=new N.Mesh(c,f);V.castShadow=!0,V.receiveShadow=!0,p(V)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new N.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new N.Group)}},m}function ae(b,i,o,l){return{loadSceneFromFile:r=>new Promise((_,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,h=0,c=null;const f=new N.LoadingManager;f.onStart=(a,d,E)=>{g=E||0,h=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,E)=>{h=d,g=E;const R=`正在加载 ${d} / ${E} 个文件: ${N.getFilenameFromUrl(a)}`;l.value=R,d===E&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new N.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),_(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const V=(a,d,E)=>{const R=N.getFilenameFromUrl(a);let v;E&&E>0?v=`${R}(${N.formatBytes(d)} / ${N.formatBytes(E)})`:d&&d>0?v=`${R}(已下载 ${N.formatBytes(d)})`:v=`${R}`,l.value=`正在下载第 ${h+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ne({manager:f,baseFolderUrl:le,onFileProgress:V}).load(a,E=>{c=E},void 0,E=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,E),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ce(b,i,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),_=new N.Raycaster,p=new N.Vector2,g=new Map;function h(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new N.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,_.setFromCamera(p,m);const t=_.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,w=null;for(;s;){if(g.has(s.id)){w=g.get(s.id);break}s=s.parent}w&&c(w)}function V(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=i();m=u,h(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function E(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function R(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:V,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:E,updateRotation:R}}class de{constructor(i){C(this,"robot");C(this,"movableJoints");this.robot=i,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(i=>i.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(i=>i.name)}setJointAngle(i,o){const l=this.robot.joints[i];if(!l||l.jointType==="fixed")return console.warn(`关节 ${i} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${i} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(i){Object.entries(i).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const i={};return this.movableJoints.forEach(o=>{i[o.name]=o.angle||0}),i}resetToZero(){this.movableJoints.forEach(i=>{i.setJointValue(0)})}getJointLimits(i){const o=this.robot.joints[i];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(i,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(_=>{const p=()=>{const g=Date.now()-r,h=Math.min(g/o,1),c=this.easeInOutCubic(h),f={};Object.keys(i).forEach(V=>{const a=m[V]||0,d=i[V];f[V]=a+(d-a)*c}),this.setJointAngles(f),l&&l(h),h<1?requestAnimationFrame(p):_()};p()})}easeInOutCubic(i){return i<.5?4*i*i*i:1-Math.pow(-2*i+2,3)/2}async playSequence(i,o=1e3,l){for(let m=0;m<i.length;m++)await this.animateToState(i[m],o,r=>{l&&l(m,r)})}}const ue={class:"panel-content"},me={class:"obj"},pe={key:0,class:"obj-base"},ve=["title"],fe=["title"],be={key:1},we={class:"obj-position"},_e={class:"coord-item"},he={class:"coord-item"},Ve={class:"coord-item"},Ee={class:"obj-rotation"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"world"},Re={class:"coord-line"},je={class:"coord-text"},Ce={class:"world-position-item"},De={class:"world-position-item"},Se={class:"world-position-item"},Ue={class:"coord-line"},Fe={class:"coord-text"},$e={class:"world-rotation-item"},Me={class:"world-rotation-item"},xe={class:"world-rotation-item"},Je=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:i}){const o=b,l=i,m=e.ref([]),r=e.ref({}),_=(t,s=0)=>{const w=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(n=>{if(!(n!=null&&n.isMesh)){const y={name:n==null?void 0:n.name,label:(n==null?void 0:n.name)||(n==null?void 0:n.type),show:!0,level:s+1,isPenultimate:!1,type:n==null?void 0:n.type,id:n==null?void 0:n.id,limit:(n==null?void 0:n.limit)??"",children:_(n==null?void 0:n.children,s+1),path:n==null?void 0:n.name};w.push(y)}}),w},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level:1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:_(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const w=[],n=[...t];for(;n.length>0&&w.length<s;){const y=n.shift();y.children&&y.children.length>0&&(w.push(y.id),n.push(...y.children))}return w},h=(t,s)=>{const w=[];return t.forEach(n=>{if(n.children&&n.children.length>0){w.push(n.id);const y=n.children.filter(j=>j.children&&j.children.length>0).slice(0,s).map(j=>j.id);w.push(...y)}}),w.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?h(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,V=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},E=e.computed(()=>o!=null&&o.model?p(o.model):[]),R=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(E,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var j,U,F,$,M,x,J,O,k,T,P,z,B,A,q,I,W,G,X,Y,Z,K,H,Q;const w=e.resolveComponent("el-divider"),n=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",ue,[e.createVNode(w,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",me,[o.model?(e.openBlock(),e.createElementBlock("div",pe,[e.createElementVNode("div",{class:"obj-name",title:R.value},e.toDisplayString(R.value),9,ve),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,fe)])):(e.openBlock(),e.createElementBlock("div",be,"空")),e.createVNode(n,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(w,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",we,[e.createElementVNode("div",_e,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(j=r.value)==null?void 0:j.position)==null?void 0:U.x),onChange:s[0]||(s[0]=L=>V(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",he,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c(($=(F=r.value)==null?void 0:F.position)==null?void 0:$.y),onChange:s[1]||(s[1]=L=>V(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ve,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c((x=(M=r.value)==null?void 0:M.position)==null?void 0:x.z),onChange:s[2]||(s[2]=L=>V(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Ee,[e.createElementVNode("div",ge,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((O=(J=r.value)==null?void 0:J.rotation)==null?void 0:O.x),onChange:s[3]||(s[3]=L=>a(L,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((T=(k=r.value)==null?void 0:k.rotation)==null?void 0:T.y),onChange:s[4]||(s[4]=L=>a(L,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((z=(P=r.value)==null?void 0:P.rotation)==null?void 0:z.z),onChange:s[5]||(s[5]=L=>a(L,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(w,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",je,[e.createElementVNode("div",Ce,e.toDisplayString(c((A=(B=r.value)==null?void 0:B.worldPosition)==null?void 0:A.x))+", ",1),e.createElementVNode("div",De,e.toDisplayString(c((I=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:I.y))+", ",1),e.createElementVNode("div",Se,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",Ue,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",Fe,[e.createElementVNode("div",$e,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Me,e.toDisplayString(f((K=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:K.y))+"°, ",1),e.createElementVNode("div",xe,e.toDisplayString(f((Q=(H=r.value)==null?void 0:H.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Oe=se._export_sfc(Je,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=de;exports.WorkpieceTreePanel=Oe;exports.useRaycaster=ce;exports.useUrdfLoader=ae;
|