ss-component-new 1.2.92 → 1.2.94

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.
Files changed (108) hide show
  1. package/dist/{MTLLoader-B5xRp-vz.js → MTLLoader-BqMu0YKt.js} +1 -1
  2. package/dist/{MTLLoader-D80GV1WB.cjs → MTLLoader-zRjWtCnL.cjs} +1 -1
  3. package/dist/{OrbitControls-Dh9PyFO4.js → OrbitControls-CkSV-7e2.js} +1 -1
  4. package/dist/{OrbitControls-CqIpswqa.cjs → OrbitControls-uNfFrSzp.cjs} +1 -1
  5. package/dist/{animationData-BtND2VWy.cjs → animationData-BXJymBf1.cjs} +1 -1
  6. package/dist/{animationData-DZ0i7k1j.js → animationData-CC_EC9j-.js} +3 -3
  7. package/dist/{array-Ct6rQOAk.js → array-Cn-xxeGh.js} +1 -1
  8. package/dist/{array-BQH8ILpd.cjs → array-Dg-eQLeS.cjs} +1 -1
  9. package/dist/{dataUtil-DrslFFRT.cjs → dataUtil-BFP1At6d.cjs} +1 -1
  10. package/dist/{dataUtil-BS-wt9Xk.js → dataUtil-C4lMM2nY.js} +1 -1
  11. package/dist/{iconfont-0T5xTLj8.cjs → iconfont-BRM_rpi8.cjs} +1 -1
  12. package/dist/{iconfont-DN8mra_i.js → iconfont-CCGqXI2r.js} +2 -2
  13. package/dist/{index-DVMvlM3X.cjs → index--F1U6vAJ.cjs} +1 -1
  14. package/dist/{index-Q33CutvH.js → index-260Qu36O.js} +5 -5
  15. package/dist/{index-C_DIwBxS.cjs → index-2LVJybjB.cjs} +1 -1
  16. package/dist/{index-CfHIgB5C.js → index-3t_HapIu.js} +2 -2
  17. package/dist/{index-DJ14vVkb.js → index-6MBk7YsU.js} +2 -2
  18. package/dist/{index-BKaTMDZC.js → index-B-pYf4fC.js} +5 -5
  19. package/dist/index-BKYwhVDU.js +12164 -0
  20. package/dist/{index-BGvxk4QX.cjs → index-BL51CN92.cjs} +1 -1
  21. package/dist/{index-CZLI4UKD.js → index-BNWYMxbm.js} +1 -1
  22. package/dist/{index-CuchbMC7.cjs → index-BOsFRR22.cjs} +1 -1
  23. package/dist/{index-1gXFTnuu.js → index-BQgBL4mp.js} +19 -19
  24. package/dist/index-BRNs8_K6.cjs +1 -0
  25. package/dist/{index-CylLhQJV.cjs → index-BU95sZ0Y.cjs} +1 -1
  26. package/dist/{index-BooqzjWY.cjs → index-BWfzhlIb.cjs} +1 -1
  27. package/dist/{index-Dgdu_Hp_.js → index-BayQ6HRi.js} +1 -1
  28. package/dist/{index-NMPHjxEr.cjs → index-BcIzliCn.cjs} +1 -1
  29. package/dist/{index-CQ7UrLDv.js → index-BcJ5yKyA.js} +7 -7
  30. package/dist/{index-DkEISMpK.js → index-Bg0aEQlB.js} +1 -1
  31. package/dist/{index-D4EyLxA0.cjs → index-BjjK_8u-.cjs} +1 -1
  32. package/dist/{index-BtKhX2oM.js → index-Bl3fYYAV.js} +5 -5
  33. package/dist/{index-m_VPPkQD.cjs → index-C1Y17JEG.cjs} +1 -1
  34. package/dist/{index-B_KvjL9P.cjs → index-C64dGSqi.cjs} +1 -1
  35. package/dist/{index-DSmsp4fK.cjs → index-C8N3F3ec.cjs} +1 -1
  36. package/dist/{index-BvxyAOvM.js → index-CDNt_0sV.js} +2 -2
  37. package/dist/{index-BwaM5xSn.cjs → index-CSZdFHsD.cjs} +1 -1
  38. package/dist/{index-C1IhJdLY.cjs → index-CTh_Ncuz.cjs} +1 -1
  39. package/dist/{index-BeEVAZ15.cjs → index-CVAhcUed.cjs} +1 -1
  40. package/dist/{index-BdwtuRne.cjs → index-Cbmn26EX.cjs} +1 -1
  41. package/dist/{index-BprBzYZ5.cjs → index-CjspLKZN.cjs} +1 -1
  42. package/dist/{index-CRe-_A5B.cjs → index-Cus62ZeK.cjs} +1 -1
  43. package/dist/{index-CMb4s6NV.js → index-D0NuMuh5.js} +1 -1
  44. package/dist/{index-CZsCZbCY.js → index-D78TpO0w.js} +2 -2
  45. package/dist/{index-C7HjGMoA.js → index-D7s3P2jl.js} +3 -3
  46. package/dist/{index-CV7OZAqo.js → index-DEX2MMzx.js} +1 -1
  47. package/dist/{index-DQTbLJJt.js → index-DI0PUVaR.js} +2 -2
  48. package/dist/{index-91lUH3Vt.cjs → index-DMwTF1Hl.cjs} +1 -1
  49. package/dist/{index-bz_QKqhV.cjs → index-DNJpT0_O.cjs} +1 -1
  50. package/dist/{index-YxS-TBi2.js → index-DQ5DjIVG.js} +3 -3
  51. package/dist/{index-BjFqn1jw.js → index-DQFvXEIV.js} +2 -2
  52. package/dist/{index-CiNYm1fC.js → index-DQOvMRe3.js} +2 -2
  53. package/dist/{index-D_6peWlG.cjs → index-DY8hmk1Q.cjs} +1 -1
  54. package/dist/{index-CewrcECw.js → index-DbJoeUF-.js} +1 -1
  55. package/dist/{index-DZQ1Y80J.js → index-Df60duTb.js} +1 -1
  56. package/dist/{index-fN7eaisA.cjs → index-DlnbkEM7.cjs} +1 -1
  57. package/dist/{index-fbsH9PEh.js → index-Dm46N078.js} +1 -1
  58. package/dist/{index-C7Ks0zLC.js → index-FKHrqiVz.js} +7 -7
  59. package/dist/{index-DW_lU8F7.cjs → index-IemfeHbH.cjs} +1 -1
  60. package/dist/{index-C07slqLJ.js → index-SrN23_le.js} +4 -4
  61. package/dist/{index-BWhMaL3V.js → index-TGJkSdz2.js} +2 -2
  62. package/dist/{index-DwsI_FxR.js → index-c4KXPOVQ.js} +11 -11
  63. package/dist/{index-DavM6N4X.cjs → index-dme4eW3i.cjs} +1 -1
  64. package/dist/{index-Z2dyIgOs.cjs → index-eQzqwKhP.cjs} +1 -1
  65. package/dist/{index-BUYZ6Pzj.cjs → index-etoQsMTc.cjs} +1 -1
  66. package/dist/{index-CpYf3edW.cjs → index-fGeOwHSq.cjs} +1 -1
  67. package/dist/{index-C1aAW06_.js → index-h1B7tCqK.js} +350 -350
  68. package/dist/{index-CtOo2IDL.cjs → index-nSK480UF.cjs} +1 -1
  69. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-qrHH3IDA.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CUBR2vja.js} +11 -11
  70. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CjVqxeCk.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CYt_iRxB.cjs} +1 -1
  71. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs} +59 -59
  72. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js} +1648 -1643
  73. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-9r-1e4S8.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-CVndK9Z1.cjs} +1 -1
  74. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-IuoTm-WE.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-pPec6lo_.js} +5 -5
  75. package/dist/{index.vue_vue_type_style_index_1_lang-kYz8t0xw.js → index.vue_vue_type_style_index_1_lang-Bjoq8geZ.js} +852 -815
  76. package/dist/{index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs → index.vue_vue_type_style_index_1_lang-DBVG4Icj.cjs} +15 -15
  77. package/dist/{index.vue_vue_type_style_index_1_lang-DR71_XjN.cjs → index.vue_vue_type_style_index_1_lang-DSolTjJR.cjs} +1 -1
  78. package/dist/{index.vue_vue_type_style_index_1_lang-CDl_PU-6.js → index.vue_vue_type_style_index_1_lang-DeN-1hjz.js} +4 -4
  79. package/dist/{main-BxTLrfxf.cjs → main-BiNhUZSd.cjs} +1 -1
  80. package/dist/{main-D_3GSDl9.js → main-rwu2YuKn.js} +4 -4
  81. package/dist/obj/model.mtl +42 -0
  82. package/dist/obj/model.obj +26110 -0
  83. package/dist/ss-component.cjs +1 -1
  84. package/dist/ss-component.css +1 -1
  85. package/dist/ss-component.js +10 -10
  86. package/dist/ss-component2.cjs +1 -1
  87. package/dist/ss-component2.js +11 -11
  88. package/dist/{threeModel-BKLggDE-.js → threeModel-B9va_TpV.js} +4 -4
  89. package/dist/{threeModel-D4-2rEpM.cjs → threeModel-CxKhN45R.cjs} +1 -1
  90. package/dist/{threePreview-oszvdj-G.js → threePreview-C_TwTZy-.js} +3 -3
  91. package/dist/{threePreview-QIurmOdU.cjs → threePreview-DDtKTkbQ.cjs} +1 -1
  92. package/dist/{threeSceneView-CaHI2V82.cjs → threeSceneView-Bkm_GCcO.cjs} +1 -1
  93. package/dist/{threeSceneView-BR1l9yTW.js → threeSceneView-D5zDhJoR.js} +10 -10
  94. package/dist/{threeSceneViewForCPMPIP-wZTvUhLm.js → threeSceneViewForCPMPIP-8I4MXfwL.js} +9 -9
  95. package/dist/{threeSceneViewForCPMPIP-DbvRq5YC.cjs → threeSceneViewForCPMPIP-BXDzBuqf.cjs} +1 -1
  96. package/dist/{threeTrackPathView-CAK5om32.js → threeTrackPathView-QDp-h2uJ.js} +4 -4
  97. package/dist/{threeTrackPathView-CF9ierHN.cjs → threeTrackPathView-UDhsLLJ8.cjs} +1 -1
  98. package/dist/{threeViewerHost-iajMfGA9.cjs → threeViewerHost-C1cS3BQx.cjs} +2 -2
  99. package/dist/{threeViewerHost-CeTJmyoE.js → threeViewerHost-Clyh4deQ.js} +3 -3
  100. package/dist/{urdfTree-DIyCunQo.js → urdfTree-CfBupHPQ.js} +1 -1
  101. package/dist/{urdfTree-CWwnorES.cjs → urdfTree-DTIOLiOJ.cjs} +1 -1
  102. package/dist/{workpieceTreePanel-YfDCHyA3.cjs → workpieceTreePanel-BDkiRWjc.cjs} +1 -1
  103. package/dist/{workpieceTreePanel-DC0GHh3g.js → workpieceTreePanel-IMs7wLsr.js} +5 -5
  104. package/package.json +1 -1
  105. package/public/obj/model.mtl +42 -0
  106. package/public/obj/model.obj +26110 -0
  107. package/dist/index-BYoEVm0h.cjs +0 -1
  108. package/dist/index-a_TWt7Sj.js +0 -12178
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("./workpieceTreePanel-YfDCHyA3.cjs"),de=require("./iconfont-0T5xTLj8.cjs"),A=require("./index-C8qRkCgn.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs");require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-D_6peWlG.cjs");require("./index.vue_vue_type_style_index_1_lang-DR71_XjN.cjs");require("./index-D4EyLxA0.cjs");const Ce=require("./animationData-BtND2VWy.cjs"),ne=require("./urdfTree-CWwnorES.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-DrslFFRT.cjs"),$=require("./svgIcon-CUM54R6L.cjs"),Z=.001,H=a.MathUtils.degToRad,Ne=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Te(y=.005,v=64){const g=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),l=new a.TubeGeometry(g,v,y,16,!1),h=Ne;return new a.Mesh(l,h)}const ke=y=>y.reduce((v,g)=>{let l=0;const h=g.Y??0,V=g.C??0,u=g.R??0;return h>0&&(l+=h),V>0&&u>0&&(l+=u*H(V)),v+l},0),Me=y=>{const v=[],g=y.Y??0,l=y.B??0,h=y.C??0,V=y.R??0,u={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!g&&!h)return v;if(v.push(u.pos.clone()),l!==0){const C=new a.Matrix4().makeRotationAxis(u.localY,H(l));u.localX.applyMatrix4(C),u.localZ.applyMatrix4(C)}if(g>0&&(u.pos.add(u.localY.clone().multiplyScalar(g*Z)),v.push(u.pos.clone())),h>0&&V>0){const C=H(h),c=V*Z,_=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),s=Math.max(16,Math.ceil(h/5));for(let p=1;p<=s;p++){const n=C*p/s,d=new a.Matrix4().makeRotationAxis(u.localZ,n),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),x=_.clone().add(b);v.push(x)}}return v};function Se(y,v){const g=new a.Group;g.name="CompletePipe";const l={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,V=1;for(let u=0;u<y.length;u++){const C=y[u],c=C.Y??0,_=C.B??0,s=C.C??0,p=C.R??0;if(_!==0){const n=new a.Matrix4().makeRotationAxis(l.localY,H(_));l.localX.applyMatrix4(n),l.localZ.applyMatrix4(n)}if(c>0){const n=l.pos.clone();l.pos.add(l.localY.clone().multiplyScalar(c*Z));const d=l.pos.clone(),r=Pe(n,d,v*Z);r.userData={segmentType:"straight",segmentIndex:h,frameIndex:u,length:c,frame:{Y:c,B:_,C:s,R:p}},r.name=`直段_${h}`,g.add(r);const b=n.clone();De(g,V,b,v*Z),h++}if(s>0&&p>0){const n=H(s),d=p*Z,r=[];r.push(l.pos.clone());const b=l.pos.clone().add(l.localX.clone().multiplyScalar(-d)),x=Math.max(16,Math.ceil(s/5));for(let S=1;S<=x;S++){const T=n*S/x,k=new a.Matrix4().makeRotationAxis(l.localZ,T),E=l.localX.clone().multiplyScalar(d).applyMatrix4(k),w=b.clone().add(E);r.push(w)}const f=Re(r,v*Z);f.userData={segmentType:"bend",segmentIndex:h,frameIndex:u,angle:s,radius:p,centerPoint:b.toArray(),frame:{Y:c,B:_,C:s,R:p}},f.name=`弯段_${h}`,g.add(f),Math.floor(r.length/2),r[0],l.pos=r[r.length-1].clone();const M=new a.Matrix4().makeRotationAxis(l.localZ,n);l.localY.applyMatrix4(M),l.localX.applyMatrix4(M),h++,V++}}return g}function De(y,v,g,l){const h=new a.Vector3(0,l*2,l*5),V=g.clone().add(h),u=[g,V],C=new a.BufferGeometry().setFromPoints(u),c=new a.LineDashedMaterial({color:16711680,dashSize:l*.5,gapSize:l*.3,linewidth:1}),_=new a.Line(C,c);_.computeLineDistances(),y.add(_);const s=document.createElement("canvas"),p=s.getContext("2d");s.width=128,s.height=128,p.clearRect(0,0,128,128),p.fillStyle="#FF0000",p.font="bold 80px Arial",p.textAlign="center",p.textBaseline="middle",p.fillText(v.toString(),64,64);const n=new a.CanvasTexture(s),d=new a.SpriteMaterial({map:n,transparent:!0,depthTest:!1,depthWrite:!1}),r=new a.Sprite(d),b=l*3;r.scale.set(b,b,1),r.position.copy(V),r.name=`Label_${v}`,r.userData={labelNumber:v},y.add(r)}function Pe(y,v,g){const l=new a.LineCurve3(y,v),h=new a.TubeGeometry(l,2,g,18,!1);return new a.Mesh(h,Ne)}function Re(y,v){const g=new a.CatmullRomCurve3(y,!1,"catmullrom",.01),l=new a.TubeGeometry(g,Math.max(16,y.length*2),v,18,!1);return new a.Mesh(l,Ne)}function _e(y,v,g,l,h,V=0){let u=v.slice(0,h+1);const C=v[h+1];if(C&&V>0){const r={...C,B:(C.B??0)*V,C:(C.C??0)*V};u.push(r)}const c=ke(u),_=Math.max(0,g-c),s=[];s.push(new a.Vector3(0,0,0));const p=new a.Vector3(0,_*Z,0);_>0&&s.push(p);let n={pos:p.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const d=[];for(let r=u.length-1;r>=0;r--){const b=u[r],x=Me(b);if(x.length>0){const f=x.map(k=>{const D=k.clone(),E=new a.Matrix4;return E.makeBasis(n.localX,n.localY,n.localZ),D.applyMatrix4(E),D.add(n.pos)});d.push(f);const M=f[f.length-1];n.pos=M.clone();const S=b.B??0,T=b.C??0;if(S!==0){const k=new a.Matrix4().makeRotationAxis(n.localY,H(S));n.localX.applyMatrix4(k),n.localZ.applyMatrix4(k)}if(T>0){const k=H(T),D=new a.Matrix4().makeRotationAxis(n.localZ,k);n.localY.applyMatrix4(D),n.localX.applyMatrix4(D)}}}for(const r of d)r.length>1&&s.push(...r.slice(1));s.length<2&&s.push(new a.Vector3(0,.001,0));try{const r=new a.CatmullRomCurve3(s,!1,"catmullrom",.01),b=new a.TubeGeometry(r,Math.max(2,s.length*4),l*Z,18,!1);y.geometry.dispose(),y.geometry=b}catch(r){console.error("管件更新失败",r)}}function xe(y,v,g,l=0){let h=y.slice(0,g+1);const V=y[g+1];if(V&&l>0){const n={...V,B:(V.B??0)*l,C:(V.C??0)*l};h.push(n)}const u=ke(h),C=Math.max(0,v-u),c=[];c.push(new a.Vector3(0,0,0));const _=new a.Vector3(0,C*Z,0);C>0&&c.push(_);let s={pos:_.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let n=h.length-1;n>=0;n--){const d=h[n],r=Me(d);if(r.length>0){const b=r.map(S=>{const T=S.clone(),k=new a.Matrix4;return k.makeBasis(s.localX,s.localY,s.localZ),T.applyMatrix4(k),T.add(s.pos)});p.push(b);const x=b[b.length-1];s.pos=x.clone();const f=d.B??0,M=d.C??0;if(f!==0){const S=new a.Matrix4().makeRotationAxis(s.localY,H(f));s.localX.applyMatrix4(S),s.localZ.applyMatrix4(S)}if(M>0){const S=H(M),T=new a.Matrix4().makeRotationAxis(s.localZ,S);s.localY.applyMatrix4(T),s.localX.applyMatrix4(T)}}}for(const n of p)n.length>1&&c.push(...n.slice(1));return c.length<2&&c.push(new a.Vector3(0,.001,0)),c}function Ee(y,v,g,l,h,V,u,C=0,c=0){const _=h-c,s=xe(l,_,u,C);let n=xe(g,c,u,C);n.forEach(r=>r.y=-r.y),n.reverse();const d=[...n,...s];try{const r=new a.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new a.TubeGeometry(r,Math.max(2,d.length*4),V*Z,18,!1);v.geometry.dispose(),y.geometry.dispose(),v.parent&&v.parent.remove(v),y.geometry=b}catch(r){console.error("管件更新失败",r)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},ze={class:"control-row"},Fe={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ue={class:"progress-bar"},Ie={class:"dialog-footer"},Ge=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(y,{expose:v,emit:g}){const l=y,h=g,V=e.ref(),u=e.ref();e.watch(()=>l.threeData,t=>{const o=t==null?void 0:t.data;u.value=o==null?void 0:o.type},{immediate:!0});const C=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};u.value===X.robotMode.SINGLE&&(o=await Ce.fetchSingleRobotAnimationData()),u.value===X.robotMode.DOUBLE&&(o=await Ce.fetchDoubleRobotAnimationData());const{initialPipeLength:i=0,pipeRadius:m=0,clampLength:N=0,animationData:Y}=o;T.value=i,k.value=m,D.value=N,V.value=Y;const O=A.cloneDeep(V.value),K=ce(z.value),q=(O==null?void 0:O["输出(动画数据)"])||[];c.value=q.length?q:[K]},c=e.ref([]),_=e.ref(!1),s=e.ref(""),p=e.ref(!1),n=e.ref(0),d=e.ref(0),r=e.ref(1e3);let b=!1;const x=e.ref(null),f=e.shallowRef(null),M=e.shallowRef(null),S=e.shallowRef(null),T=e.ref(0),k=e.ref(12.5),D=e.ref(30),E=e.ref([]),w=e.ref(null),U=e.computed(()=>l.model?ne.getNonFixedJoints(l.model).map(i=>i.name):[]),j=e.ref(["Y","B","C","R"]),z=e.computed(()=>[...U.value,...j.value]),F=e.computed(()=>z.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("./workpieceTreePanel-BDkiRWjc.cjs"),de=require("./iconfont-BRM_rpi8.cjs"),A=require("./index-C8qRkCgn.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs");require("./index.vue_vue_type_style_index_1_lang-DBVG4Icj.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-DY8hmk1Q.cjs");require("./index.vue_vue_type_style_index_1_lang-DSolTjJR.cjs");require("./index-BjjK_8u-.cjs");const Ce=require("./animationData-BXJymBf1.cjs"),ne=require("./urdfTree-DTIOLiOJ.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-BFP1At6d.cjs"),$=require("./svgIcon-CUM54R6L.cjs"),Z=.001,H=a.MathUtils.degToRad,Ne=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Te(y=.005,v=64){const g=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),l=new a.TubeGeometry(g,v,y,16,!1),h=Ne;return new a.Mesh(l,h)}const ke=y=>y.reduce((v,g)=>{let l=0;const h=g.Y??0,V=g.C??0,u=g.R??0;return h>0&&(l+=h),V>0&&u>0&&(l+=u*H(V)),v+l},0),Me=y=>{const v=[],g=y.Y??0,l=y.B??0,h=y.C??0,V=y.R??0,u={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!g&&!h)return v;if(v.push(u.pos.clone()),l!==0){const C=new a.Matrix4().makeRotationAxis(u.localY,H(l));u.localX.applyMatrix4(C),u.localZ.applyMatrix4(C)}if(g>0&&(u.pos.add(u.localY.clone().multiplyScalar(g*Z)),v.push(u.pos.clone())),h>0&&V>0){const C=H(h),c=V*Z,_=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),s=Math.max(16,Math.ceil(h/5));for(let p=1;p<=s;p++){const n=C*p/s,d=new a.Matrix4().makeRotationAxis(u.localZ,n),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),x=_.clone().add(b);v.push(x)}}return v};function Se(y,v){const g=new a.Group;g.name="CompletePipe";const l={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,V=1;for(let u=0;u<y.length;u++){const C=y[u],c=C.Y??0,_=C.B??0,s=C.C??0,p=C.R??0;if(_!==0){const n=new a.Matrix4().makeRotationAxis(l.localY,H(_));l.localX.applyMatrix4(n),l.localZ.applyMatrix4(n)}if(c>0){const n=l.pos.clone();l.pos.add(l.localY.clone().multiplyScalar(c*Z));const d=l.pos.clone(),r=Pe(n,d,v*Z);r.userData={segmentType:"straight",segmentIndex:h,frameIndex:u,length:c,frame:{Y:c,B:_,C:s,R:p}},r.name=`直段_${h}`,g.add(r);const b=n.clone();De(g,V,b,v*Z),h++}if(s>0&&p>0){const n=H(s),d=p*Z,r=[];r.push(l.pos.clone());const b=l.pos.clone().add(l.localX.clone().multiplyScalar(-d)),x=Math.max(16,Math.ceil(s/5));for(let S=1;S<=x;S++){const T=n*S/x,k=new a.Matrix4().makeRotationAxis(l.localZ,T),E=l.localX.clone().multiplyScalar(d).applyMatrix4(k),w=b.clone().add(E);r.push(w)}const f=Re(r,v*Z);f.userData={segmentType:"bend",segmentIndex:h,frameIndex:u,angle:s,radius:p,centerPoint:b.toArray(),frame:{Y:c,B:_,C:s,R:p}},f.name=`弯段_${h}`,g.add(f),Math.floor(r.length/2),r[0],l.pos=r[r.length-1].clone();const M=new a.Matrix4().makeRotationAxis(l.localZ,n);l.localY.applyMatrix4(M),l.localX.applyMatrix4(M),h++,V++}}return g}function De(y,v,g,l){const h=new a.Vector3(0,l*2,l*5),V=g.clone().add(h),u=[g,V],C=new a.BufferGeometry().setFromPoints(u),c=new a.LineDashedMaterial({color:16711680,dashSize:l*.5,gapSize:l*.3,linewidth:1}),_=new a.Line(C,c);_.computeLineDistances(),y.add(_);const s=document.createElement("canvas"),p=s.getContext("2d");s.width=128,s.height=128,p.clearRect(0,0,128,128),p.fillStyle="#FF0000",p.font="bold 80px Arial",p.textAlign="center",p.textBaseline="middle",p.fillText(v.toString(),64,64);const n=new a.CanvasTexture(s),d=new a.SpriteMaterial({map:n,transparent:!0,depthTest:!1,depthWrite:!1}),r=new a.Sprite(d),b=l*3;r.scale.set(b,b,1),r.position.copy(V),r.name=`Label_${v}`,r.userData={labelNumber:v},y.add(r)}function Pe(y,v,g){const l=new a.LineCurve3(y,v),h=new a.TubeGeometry(l,2,g,18,!1);return new a.Mesh(h,Ne)}function Re(y,v){const g=new a.CatmullRomCurve3(y,!1,"catmullrom",.01),l=new a.TubeGeometry(g,Math.max(16,y.length*2),v,18,!1);return new a.Mesh(l,Ne)}function _e(y,v,g,l,h,V=0){let u=v.slice(0,h+1);const C=v[h+1];if(C&&V>0){const r={...C,B:(C.B??0)*V,C:(C.C??0)*V};u.push(r)}const c=ke(u),_=Math.max(0,g-c),s=[];s.push(new a.Vector3(0,0,0));const p=new a.Vector3(0,_*Z,0);_>0&&s.push(p);let n={pos:p.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const d=[];for(let r=u.length-1;r>=0;r--){const b=u[r],x=Me(b);if(x.length>0){const f=x.map(k=>{const D=k.clone(),E=new a.Matrix4;return E.makeBasis(n.localX,n.localY,n.localZ),D.applyMatrix4(E),D.add(n.pos)});d.push(f);const M=f[f.length-1];n.pos=M.clone();const S=b.B??0,T=b.C??0;if(S!==0){const k=new a.Matrix4().makeRotationAxis(n.localY,H(S));n.localX.applyMatrix4(k),n.localZ.applyMatrix4(k)}if(T>0){const k=H(T),D=new a.Matrix4().makeRotationAxis(n.localZ,k);n.localY.applyMatrix4(D),n.localX.applyMatrix4(D)}}}for(const r of d)r.length>1&&s.push(...r.slice(1));s.length<2&&s.push(new a.Vector3(0,.001,0));try{const r=new a.CatmullRomCurve3(s,!1,"catmullrom",.01),b=new a.TubeGeometry(r,Math.max(2,s.length*4),l*Z,18,!1);y.geometry.dispose(),y.geometry=b}catch(r){console.error("管件更新失败",r)}}function xe(y,v,g,l=0){let h=y.slice(0,g+1);const V=y[g+1];if(V&&l>0){const n={...V,B:(V.B??0)*l,C:(V.C??0)*l};h.push(n)}const u=ke(h),C=Math.max(0,v-u),c=[];c.push(new a.Vector3(0,0,0));const _=new a.Vector3(0,C*Z,0);C>0&&c.push(_);let s={pos:_.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let n=h.length-1;n>=0;n--){const d=h[n],r=Me(d);if(r.length>0){const b=r.map(S=>{const T=S.clone(),k=new a.Matrix4;return k.makeBasis(s.localX,s.localY,s.localZ),T.applyMatrix4(k),T.add(s.pos)});p.push(b);const x=b[b.length-1];s.pos=x.clone();const f=d.B??0,M=d.C??0;if(f!==0){const S=new a.Matrix4().makeRotationAxis(s.localY,H(f));s.localX.applyMatrix4(S),s.localZ.applyMatrix4(S)}if(M>0){const S=H(M),T=new a.Matrix4().makeRotationAxis(s.localZ,S);s.localY.applyMatrix4(T),s.localX.applyMatrix4(T)}}}for(const n of p)n.length>1&&c.push(...n.slice(1));return c.length<2&&c.push(new a.Vector3(0,.001,0)),c}function Ee(y,v,g,l,h,V,u,C=0,c=0){const _=h-c,s=xe(l,_,u,C);let n=xe(g,c,u,C);n.forEach(r=>r.y=-r.y),n.reverse();const d=[...n,...s];try{const r=new a.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new a.TubeGeometry(r,Math.max(2,d.length*4),V*Z,18,!1);v.geometry.dispose(),y.geometry.dispose(),v.parent&&v.parent.remove(v),y.geometry=b}catch(r){console.error("管件更新失败",r)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},ze={class:"control-row"},Fe={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ue={class:"progress-bar"},Ie={class:"dialog-footer"},Ge=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(y,{expose:v,emit:g}){const l=y,h=g,V=e.ref(),u=e.ref();e.watch(()=>l.threeData,t=>{const o=t==null?void 0:t.data;u.value=o==null?void 0:o.type},{immediate:!0});const C=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};u.value===X.robotMode.SINGLE&&(o=await Ce.fetchSingleRobotAnimationData()),u.value===X.robotMode.DOUBLE&&(o=await Ce.fetchDoubleRobotAnimationData());const{initialPipeLength:i=0,pipeRadius:m=0,clampLength:N=0,animationData:Y}=o;T.value=i,k.value=m,D.value=N,V.value=Y;const O=A.cloneDeep(V.value),K=ce(z.value),q=(O==null?void 0:O["输出(动画数据)"])||[];c.value=q.length?q:[K]},c=e.ref([]),_=e.ref(!1),s=e.ref(""),p=e.ref(!1),n=e.ref(0),d=e.ref(0),r=e.ref(1e3);let b=!1;const x=e.ref(null),f=e.shallowRef(null),M=e.shallowRef(null),S=e.shallowRef(null),T=e.ref(0),k=e.ref(12.5),D=e.ref(30),E=e.ref([]),w=e.ref(null),U=e.computed(()=>l.model?ne.getNonFixedJoints(l.model).map(i=>i.name):[]),j=e.ref(["Y","B","C","R"]),z=e.computed(()=>[...U.value,...j.value]),F=e.computed(()=>z.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${z.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),J=()=>c.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),I=()=>{const t=[],o=[];return c.value.forEach(i=>{const{Y1:m,B1:N,C1:Y,R1:O,Y2:K,B2:q,C2:ie,R2:B}=i;t.push({Y:parseFloat(m)||0,B:parseFloat(N)||0,C:parseFloat(Y)||0,R:parseFloat(O)||0}),o.push({Y:parseFloat(K)||0,B:parseFloat(q)||0,C:parseFloat(ie)||0,R:parseFloat(B)||0})}),{posPipeYbcr:t,negPipeYbcr:o}},L=(t=0,o=0)=>{if(f.value&&M.value){const i=I();Ee(f.value,M.value,i.posPipeYbcr,i.negPipeYbcr,T.value,k.value,t,o,D.value)}else if(f.value){const i=J();_e(f.value,i,T.value,k.value,t,o)}},W=t=>{if(t<0||t>=c.value.length){console.error(`帧索引 ${t} 超出范围`);return}const o=c.value[t];if(console.log(`应用第 ${t} 帧数据 ${o}`),n.value=t,x.value){const i={};U.value.forEach(m=>{const N=parseFloat(o[m]);isNaN(N)||(i[m]=N)}),x.value.setJointAngles(i)}L(t,0)},P=async()=>{if(c.value.length===0){A.ElMessage.error("无法播放动画:无数据");return}if(!p.value){p.value=!0,b=!1,c.value.length-1===n.value&&(n.value=0);try{for(let t=n.value+1;t<c.value.length&&!b;t++){n.value=t;const o=c.value[t],i={};x.value&&U.value.forEach(m=>{const N=parseFloat(o[m]);isNaN(N)||(i[m]=N)}),x.value?await x.value.animateToState(i,r.value,m=>{d.value=(t+m)/c.value.length*100,L(t-1,m)}):(await new Promise(m=>setTimeout(m,r.value)),d.value=(t+1)/c.value.length*100)}b||A.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),A.ElMessage.error("动画播放出错")}finally{p.value=!1,d.value=0}}},R=()=>{b=!0,p.value=!1,d.value=0,A.ElMessage.info("动画已停止")},ae=()=>{n.value=0},G=()=>{if(f.value&&M.value){const t=I();Ee(f.value,M.value,t.posPipeYbcr,t.negPipeYbcr,T.value,k.value,-1,0,D.value)}else if(f.value){const t=J();_e(f.value,t,T.value,k.value,-1,0)}},oe=()=>{x.value&&x.value.resetToZero(),G(),ae(),A.ElMessage.success("机器人和管件已重置")},pe=t=>`第 ${t+1} 帧`,me=t=>{p.value&&R(),W(t)},ve=()=>{p.value&&R(),!(n.value+1>=c.value.length)&&W(n.value+1)},fe=()=>{p.value&&R(),n.value!==0&&W(n.value-1)},se=()=>{S.value&&(S.value.visible=!0),f.value&&f.value.parent&&f.value.parent.remove(f.value),S.value=null,f.value=null,M.value=null},ce=t=>t==null?void 0:t.reduce((o,i)=>(o[i]="0",o),{});e.watch(z,(t,o)=>{if(JSON.stringify(t)!==JSON.stringify(o))if(t.length>0){const i=ce(t);c.value=[i]}else c.value=[]},{immediate:!0});const re=e.ref(0),ge=t=>{re.value=t},te=(t,o)=>{if(!t||!o)return;const i=ne.getTargetJoint(t,o),m=Te();m.visible=!1,i==null||i.add(m)},le=t=>{x.value=new X.URDFRobotController(t),E.value=ne.getAllLinkName(t),w.value="Pipe_Joint"},he=()=>{x.value=null,E.value=[],w.value=null},Ve=t=>{le(t),te(t,w.value),ge(re.value+1),oe()};e.watch(()=>l.model,t=>{if(se(),t){Ve(t);return}he()},{immediate:!0});const ue=t=>{var i,m;const o=new a.Mesh(t.geometry.clone(),t.material);return o.name="managed_pipe_clone",(m=(i=t==null?void 0:t.parent)==null?void 0:i.add)==null||m.call(i,o),o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o};e.watch([w,D,T,re],([t,o])=>{if(se(),l.model&&t){const i=ne.getMeshFromJoint(l.model,t);if(console.log(i,"meshToReplace"),i&&i.parent){S.value=i,i.visible=!1;const m=ue(i);if(u.value===X.robotMode.SINGLE&&(m.position.y-=o*.001),f.value=m,u.value===X.robotMode.DOUBLE){const N=ue(i);M.value=N}L(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const ye=async()=>{if(z.value.length===0){A.ElMessage.warning("没有可导出的表头");return}const t=z.value.join(" ");try{await navigator.clipboard.writeText(t),A.ElMessage.success("表头已成功复制到剪贴板!")}catch(o){console.error("复制失败:",o),A.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!s.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const t=s.value.trim().split(`
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as Oe, ref as b, watch as se, shallowRef as me, computed as ye, onUnmounted as Qe, resolveComponent as j, createElementBlock as we, openBlock as te, createElementVNode as o, createVNode as l, withCtx as D, createBlock as _e, createCommentVNode as be, unref as V, toDisplayString as de, onMounted as We, onBeforeUnmount as Ie, Fragment as et, renderList as tt, nextTick as lt, withDirectives as q, vShow as re, renderSlot as xe, isRef as De, vModelRadio as Te } from "vue";
2
- import { r as Re, U as ot, s as Ee, u as nt, a as at, W as st } from "./workpieceTreePanel-DC0GHh3g.js";
3
- import { u as Ke, a as it, b as rt } from "./iconfont-DN8mra_i.js";
2
+ import { r as Re, U as ot, s as Ee, u as nt, a as at, W as st } from "./workpieceTreePanel-IMs7wLsr.js";
3
+ import { u as Ke, a as it, b as rt } from "./iconfont-CCGqXI2r.js";
4
4
  import { ag as ut, c as ct, E as O, aW as pt, aw as dt } from "./index-BUYYl2Pc.js";
5
- import { t as Ve, T as Ce, V as $, r as Q, s as mt, u as vt, k as Me, v as ft, L as gt, w as ht, x as bt, y as yt, z as wt, F as _t, I as Ct, p as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
6
- import "./index.vue_vue_type_style_index_1_lang-kYz8t0xw.js";
5
+ import { t as Ve, T as Ce, V as $, r as Q, s as mt, u as vt, k as Me, v as ft, L as gt, w as ht, x as bt, y as yt, z as wt, F as _t, I as Ct, p as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js";
6
+ import "./index.vue_vue_type_style_index_1_lang-Bjoq8geZ.js";
7
7
  import "./index-BHtNKL1L.js";
8
- import { _ as ue, s as Pt } from "./index-DkEISMpK.js";
9
- import "./index.vue_vue_type_style_index_1_lang-CDl_PU-6.js";
10
- import "./index-C7Ks0zLC.js";
11
- import { f as xt, a as Dt } from "./animationData-DZ0i7k1j.js";
12
- import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-DIyCunQo.js";
8
+ import { _ as ue, s as Pt } from "./index-Bg0aEQlB.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-DeN-1hjz.js";
10
+ import "./index-FKHrqiVz.js";
11
+ import { f as xt, a as Dt } from "./animationData-CC_EC9j-.js";
12
+ import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-CfBupHPQ.js";
13
13
  import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
- import { g as $t, a as je, d as zt, c as Ft, e as Yt, b as Lt } from "./dataUtil-BS-wt9Xk.js";
14
+ import { g as $t, a as je, d as zt, c as Ft, e as Yt, b as Lt } from "./dataUtil-C4lMM2nY.js";
15
15
  import { T as U } from "./svgIcon-D-_fXUBL.js";
16
16
  const H = 1e-3, ae = mt.degToRad, Ge = new ft({
17
17
  // 灰色
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as _e, ref as u, computed as w, watch as K, onUnmounted as We, resolveComponent as W, createElementBlock as A, openBlock as z, createElementVNode as t, createCommentVNode as M, createVNode as i, toDisplayString as U, Fragment as Ye, renderList as Ze, withCtx as ae, inject as ke, shallowRef as ie, onMounted as qe, nextTick as Qe, onBeforeUnmount as et, withDirectives as $, vShow as H, unref as v, renderSlot as ue, createBlock as Pe, isRef as re, vModelRadio as de } from "vue";
2
- import { aw as tt } from "./index.vue_vue_type_style_index_1_lang-kYz8t0xw.js";
3
- import { U as lt, s as we, u as at, a as nt, W as ot } from "./workpieceTreePanel-DC0GHh3g.js";
4
- import { u as st, a as it, b as ut } from "./iconfont-DN8mra_i.js";
2
+ import { aw as tt } from "./index.vue_vue_type_style_index_1_lang-Bjoq8geZ.js";
3
+ import { U as lt, s as we, u as at, a as nt, W as ot } from "./workpieceTreePanel-IMs7wLsr.js";
4
+ import { u as st, a as it, b as ut } from "./iconfont-CCGqXI2r.js";
5
5
  import { c as rt, E as P } from "./index-BUYYl2Pc.js";
6
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
7
- import { _ as me } from "./index-DkEISMpK.js";
8
- import { g as dt, b as vt, U as ct, J as pt, d as mt } from "./urdfTree-DIyCunQo.js";
6
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js";
7
+ import { _ as me } from "./index-Bg0aEQlB.js";
8
+ import { g as dt, b as vt, U as ct, J as pt, d as mt } from "./urdfTree-CfBupHPQ.js";
9
9
  import { _ as xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
10
10
  import { T as k } from "./svgIcon-D-_fXUBL.js";
11
- import { i as ft } from "./animationData-DZ0i7k1j.js";
12
- import { O as gt } from "./MTLLoader-B5xRp-vz.js";
13
- import { L as bt, j as ht } from "./index-a_TWt7Sj.js";
11
+ import { i as ft } from "./animationData-CC_EC9j-.js";
12
+ import { O as gt } from "./MTLLoader-BqMu0YKt.js";
13
+ import { L as bt, j as ht } from "./index-BKYwhVDU.js";
14
14
  const yt = { class: "panel-content" }, kt = { class: "action-bar" }, Pt = {
15
15
  key: 0,
16
16
  class: "animation-controls"
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Me=require("./index.vue_vue_type_style_index_1_lang-DnfCrXiN.cjs"),U=require("./workpieceTreePanel-YfDCHyA3.cjs"),Q=require("./iconfont-0T5xTLj8.cjs"),f=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs");const ee=require("./index-D_6peWlG.cjs"),H=require("./urdfTree-CWwnorES.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),N=require("./svgIcon-CUM54R6L.cjs"),Be=require("./animationData-BtND2VWy.cjs"),ze=require("./MTLLoader-D80GV1WB.cjs"),se=require("./index-BYoEVm0h.cjs"),$e={class:"panel-content"},Le={class:"action-bar"},Re={key:0,class:"animation-controls"},Ue={class:"control-row"},je={class:"control-row"},Ae={class:"frame-info"},Ie={class:"control-row"},Oe={key:1,class:"empty-state"},Fe={class:"dialog-footer"},qe=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(T,{expose:j}){const w=T,o=e.ref([]),C=e.ref(!1),_=e.ref(""),i=e.ref("stopped"),d=e.ref(0),D=e.ref(0),L=e.ref(10),g=e.ref(null);let m=0;const A=e.ref([]),I=e.computed(()=>w.model?H.getNonFixedJoints(w.model).map(r=>r.name):[]),M=e.computed(()=>[...I.value]),X=e.computed(()=>M.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Me=require("./index.vue_vue_type_style_index_1_lang-DBVG4Icj.cjs"),U=require("./workpieceTreePanel-BDkiRWjc.cjs"),Q=require("./iconfont-BRM_rpi8.cjs"),f=require("./index-C8qRkCgn.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs");const ee=require("./index-DY8hmk1Q.cjs"),H=require("./urdfTree-DTIOLiOJ.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),N=require("./svgIcon-CUM54R6L.cjs"),Be=require("./animationData-BXJymBf1.cjs"),ze=require("./MTLLoader-zRjWtCnL.cjs"),se=require("./index-BRNs8_K6.cjs"),$e={class:"panel-content"},Le={class:"action-bar"},Re={key:0,class:"animation-controls"},Ue={class:"control-row"},je={class:"control-row"},Ae={class:"frame-info"},Ie={class:"control-row"},Oe={key:1,class:"empty-state"},Fe={class:"dialog-footer"},qe=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(T,{expose:j}){const w=T,o=e.ref([]),C=e.ref(!1),_=e.ref(""),i=e.ref("stopped"),d=e.ref(0),D=e.ref(0),L=e.ref(10),g=e.ref(null);let m=0;const A=e.ref([]),I=e.computed(()=>w.model?H.getNonFixedJoints(w.model).map(r=>r.name):[]),M=e.computed(()=>[...I.value]),X=e.computed(()=>M.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${M.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),B=e.computed(()=>o.value[d.value]||{});e.watch(()=>w.model,s=>{s?(g.value=new U.URDFRobotController(s),A.value=H.getAllLinkName(s),d.value=0):(g.value=null,A.value=[])},{immediate:!0});const z=s=>{if(s<0||s>=o.value.length){console.error(`帧索引 ${s} 超出范围`);return}const n=o.value[s];if(g.value){const r={};I.value.forEach(V=>{const v=parseFloat(n[V]);isNaN(v)||(r[V]=v)}),g.value.setJointAngles(r)}d.value=s,D.value=o.value.length>1?s/(o.value.length-1)*100:100},W=async s=>{try{for(let n=d.value;n<o.value.length;n++){if(s!==m)return;const r=o.value[n],V={};if(g.value)I.value.forEach(v=>{const p=parseFloat(r[v]);isNaN(p)||(V[v]=p)}),await g.value.animateToState(V,L.value,v=>{s===m&&(D.value=(n+v)/o.value.length*100)});else{if(await new Promise(v=>setTimeout(v,L.value)),s!==m)return;D.value=(n+1)/o.value.length*100}d.value=n}s===m&&(f.ElMessage.success("动画播放完成"),i.value="stopped",D.value=100)}catch(n){console.error("动画播放出错:",n),f.ElMessage.error("动画播放出错"),i.value="stopped"}},R=()=>{if(o.value.length===0){f.ElMessage.error("无动画数据");return}i.value==="stopped"&&(d.value=0,z(0)),i.value="playing",m++,W(m),f.ElMessage.info("动画播放中")},O=()=>{i.value==="playing"&&(m++,i.value="paused",f.ElMessage.info("动画已暂停"))},F=()=>{m++,i.value="stopped",d.value=0,D.value=0,z(0),f.ElMessage.info("动画已停止并重置")},P=()=>{i.value==="playing"?O():R()},y=s=>{m++,i.value="paused",z(s)},$=()=>{if(!_.value.trim()){f.ElMessage.warning("导入内容不能为空");return}const s=_.value.trim().split(`
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as ke, computed as R, ref as E, resolveComponent as q, createElementBlock as ae, openBlock as Y, createElementVNode as m, createVNode as y, withCtx as ce, toDisplayString as K, shallowRef as Q, watch as lt, onMounted as ct, onBeforeUnmount as ut, withDirectives as j, createCommentVNode as ve, unref as x, renderSlot as Ae, createBlock as dt, isRef as ee, vModelRadio as te, vShow as ne } from "vue";
2
- import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-DN8mra_i.js";
3
- import { C as ue, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as re, aL as Fe, Y as Oe, aM as le, aN as J, aO as bt, r as _t, s as Ie, t as St, w as Ct, a5 as zt, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DEgtwZwW.js";
4
- import { r as Et } from "./threeViewerHost-CeTJmyoE.js";
2
+ import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-CCGqXI2r.js";
3
+ import { C as ue, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as re, aL as Fe, Y as Oe, aM as le, aN as J, aO as bt, r as _t, s as Ie, t as St, w as Ct, a5 as zt, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js";
4
+ import { r as Et } from "./threeViewerHost-Clyh4deQ.js";
5
5
  import { E as Z } from "./index-BUYYl2Pc.js";
6
- import { U as Mt, J as Lt } from "./urdfTree-DIyCunQo.js";
6
+ import { U as Mt, J as Lt } from "./urdfTree-CfBupHPQ.js";
7
7
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  import { T as U } from "./svgIcon-D-_fXUBL.js";
9
9
  import { i as Tt } from "./isString-BATKat46.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-0T5xTLj8.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-QzgaFA5S.cjs"),Be=require("./threeViewerHost-iajMfGA9.cjs"),W=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-CWwnorES.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function De(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),De(i,r,o)}const Ie={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const w=n.value[g];l.value=g,de(o.knife,w,o.cloud)},m=async()=>{if(n.value.length===0){W.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(w=>setTimeout(w,a.value)),h(g);p||W.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),W.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,W.ElMessage.info("动画已停止")},E=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,w)=>{const _=t.resolveComponent("el-input-number"),C=t.resolveComponent("el-form-item"),A=t.resolveComponent("el-form"),X=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(A,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(C,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(_,{modelValue:a.value,"onUpdate:modelValue":w[0]||(w[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[w[2]||(w[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[w[3]||(w[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(X,{modelValue:l.value,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:E,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,G=new c.Vector3;class fe 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],i=[-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(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,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 i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,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 i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)G.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(G)),G.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(G));this.boundingSphere.radius=Math.sqrt(n),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:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-BRM_rpi8.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs"),Be=require("./threeViewerHost-C1cS3BQx.cjs"),W=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-DTIOLiOJ.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function De(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),De(i,r,o)}const Ie={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const w=n.value[g];l.value=g,de(o.knife,w,o.cloud)},m=async()=>{if(n.value.length===0){W.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(w=>setTimeout(w,a.value)),h(g);p||W.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),W.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,W.ElMessage.info("动画已停止")},E=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,w)=>{const _=t.resolveComponent("el-input-number"),C=t.resolveComponent("el-form-item"),A=t.resolveComponent("el-form"),X=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(A,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(C,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(_,{modelValue:a.value,"onUpdate:modelValue":w[0]||(w[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[w[2]||(w[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[w[3]||(w[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(X,{modelValue:l.value,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:E,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,G=new c.Vector3;class fe 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],i=[-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(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,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 i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,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 i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)G.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(G)),G.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(G));this.boundingSphere.radius=Math.sqrt(n),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>