ss-component-new 1.2.97 → 1.2.98

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 (88) hide show
  1. package/dist/{MTLLoader-DnouUI-8.js → MTLLoader-CCS24gLm.js} +1 -1
  2. package/dist/{MTLLoader-zZDM0NQh.cjs → MTLLoader-DlcJK6vT.cjs} +1 -1
  3. package/dist/{OrbitControls-B85G8nPk.cjs → OrbitControls-BLs9AYBY.cjs} +1 -1
  4. package/dist/{OrbitControls-DFhYzlF3.js → OrbitControls-KkyEKP5M.js} +1 -1
  5. package/dist/{animationData-DfKVkFbz.js → animationData-Btgynl98.js} +1 -1
  6. package/dist/{animationData-DxBvEqB1.cjs → animationData-CCImpyvS.cjs} +1 -1
  7. package/dist/{iconfont-WOKNi2xx.js → iconfont-B8CQB3CO.js} +2 -2
  8. package/dist/{iconfont-C7kE-QbU.cjs → iconfont-BXzhYF5A.cjs} +1 -1
  9. package/dist/{index-DgZVeYqH.js → index--JyaPE1g.js} +1 -1
  10. package/dist/{index-DHZMd8iK.cjs → index-1TxthiQw.cjs} +1 -1
  11. package/dist/{index-CLOUp_4j.cjs → index-2wJBzGa-.cjs} +1 -1
  12. package/dist/{index-D0hovh9R.cjs → index-6sDAnob5.cjs} +1 -1
  13. package/dist/{index-_PP-dSm3.cjs → index-7ZZHuv4d.cjs} +1 -1
  14. package/dist/{index-Cr5if46q.js → index-B4YN6ElV.js} +1 -1
  15. package/dist/{index-Cnk_4Zz5.cjs → index-B8XDW6Ly.cjs} +1 -1
  16. package/dist/{index-BFzMf0GC.js → index-BCNDy7LZ.js} +1 -1
  17. package/dist/{index-DSPjcpWK.cjs → index-BMSOMrGq.cjs} +1 -1
  18. package/dist/{index-Cppt0AsF.cjs → index-B_WRw_3s.cjs} +1 -1
  19. package/dist/{index-D_igus4A.cjs → index-BaXxrBtb.cjs} +1 -1
  20. package/dist/{index-DeOwZgqL.js → index-Bk8CKDbz.js} +4 -4
  21. package/dist/{index-BXv3aZ7v.js → index-BkPXyAKD.js} +1 -1
  22. package/dist/{index-D_RGoDln.js → index-C9U9aO2Y.js} +3 -3
  23. package/dist/{index-BI7g3c_u.js → index-CAAOZFSQ.js} +13 -13
  24. package/dist/{index-hhS08X8b.js → index-CLddyFrz.js} +3 -3
  25. package/dist/{index-kLDMroPk.js → index-CUAM_spJ.js} +1 -1
  26. package/dist/{index-CZPnP0uy.cjs → index-CWJuJJYp.cjs} +1 -1
  27. package/dist/{index-BDxPlbe2.cjs → index-CYmbZuJq.cjs} +1 -1
  28. package/dist/{index-CQRJ3pLh.cjs → index-C_rjTaFu.cjs} +1 -1
  29. package/dist/{index-DHjtOySN.js → index-Cmlus98m.js} +2 -2
  30. package/dist/{index-331j518H.cjs → index-CnBVZu9x.cjs} +1 -1
  31. package/dist/{index-CqI3frdZ.js → index-Cz7uQ_eD.js} +6 -6
  32. package/dist/{index-D6u590uA.cjs → index-DMTBVsgY.cjs} +1 -1
  33. package/dist/{index-DrzK0O_g.cjs → index-DRjN9mko.cjs} +1 -1
  34. package/dist/{index-C-dlFxRJ.cjs → index-DThE5nRZ.cjs} +1 -1
  35. package/dist/{index-BYk9Fb6p.js → index-DXrBVvWh.js} +3 -3
  36. package/dist/{index-DRfVnLTN.js → index-DZf4BLpR.js} +6 -6
  37. package/dist/{index-DHBoRe9V.cjs → index-DcxUbnrO.cjs} +1 -1
  38. package/dist/{index-Bhha7SY3.js → index-DdQjdsrn.js} +1 -1
  39. package/dist/{index-BODyH6MD.js → index-Dggo7EaF.js} +1 -1
  40. package/dist/{index-DbDM-XfB.cjs → index-DvQRFx9T.cjs} +1 -1
  41. package/dist/{index-CPAXrzNY.cjs → index-FnJX1FLR.cjs} +1 -1
  42. package/dist/{index-iZ9BRKg5.js → index-JQ_SaJ0O.js} +1 -1
  43. package/dist/{index-B_zjoT4m.js → index-blVMOcaF.js} +2 -2
  44. package/dist/{index-DJ6qg2Mo.js → index-hbpC0O70.js} +3 -3
  45. package/dist/{index-S1LIIzCa.cjs → index-k579sq5M.cjs} +1 -1
  46. package/dist/{index-6sZXjGGz.cjs → index-nSLXu4eq.cjs} +1 -1
  47. package/dist/{index-B-AhHUV1.js → index-tUUpniUl.js} +1 -1
  48. package/dist/{index-CeGM8aBH.js → index-uWijQ8Cy.js} +2 -2
  49. package/dist/{index-iErxMZBi.cjs → index-yWC1EX2L.cjs} +1 -1
  50. package/dist/{index-BoTiP0aV.js → index-zsvDrZxo.js} +1 -1
  51. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DSlAeFA3.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BKdUW522.cjs} +1 -1
  52. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-ERjMISIK.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DPDuWtDv.js} +6 -6
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3GcG1eTD.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CmofVWvn.js} +1642 -1647
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dzyqt2Z-.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Y4oIHCVM.cjs} +58 -58
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-mJB_yl_P.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-D0zznqn6.js} +3 -3
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DODc2KPN.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-YB8ip9Xh.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_1_lang-BRFs_L5R.cjs → index.vue_vue_type_style_index_1_lang-BB0IwRdP.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_1_lang-BH0DRFVE.js → index.vue_vue_type_style_index_1_lang-CT8c_mLo.js} +3 -3
  59. package/dist/{main-B541MQH8.cjs → main-BOuiQUiL.cjs} +1 -1
  60. package/dist/{main-Z5UMyCj6.js → main-CbZLyXuF.js} +2 -2
  61. package/dist/ss-component.cjs +1 -1
  62. package/dist/ss-component.css +1 -1
  63. package/dist/ss-component.js +9 -9
  64. package/dist/ss-component2.cjs +1 -1
  65. package/dist/ss-component2.js +10 -10
  66. package/dist/{threeModel-BcjGbIJZ.js → threeModel-BJ6MrCa-.js} +4 -4
  67. package/dist/{threeModel-tKq0hvaK.cjs → threeModel-i87HG3Ck.cjs} +1 -1
  68. package/dist/{threePreview-DD0br2ae.cjs → threePreview-B3v9SadK.cjs} +1 -1
  69. package/dist/{threePreview-BnPMGQ2H.js → threePreview-D3wObBZq.js} +309 -305
  70. package/dist/{threeSceneView-BUD002PP.js → threeSceneView-DDpjEIgl.js} +7 -7
  71. package/dist/{threeSceneView-DVUTlm6F.cjs → threeSceneView-DQpyKixe.cjs} +2 -2
  72. package/dist/{threeSceneViewForCPMPIP-D4RC4BAo.js → threeSceneViewForCPMPIP-DV_aOUU5.js} +202 -198
  73. package/dist/threeSceneViewForCPMPIP-iaIkud0j.cjs +5 -0
  74. package/dist/{threeTrackPathView-DDCEu3Gx.js → threeTrackPathView-D6aAG4g8.js} +375 -359
  75. package/dist/threeTrackPathView-nPb7Tgdd.cjs +370 -0
  76. package/dist/{threeViewerHost-Sda_AoRw.cjs → threeViewerHost-I50ZyvKF.cjs} +2 -2
  77. package/dist/{threeViewerHost-BVeUteVd.js → threeViewerHost-XR9tepbY.js} +2 -2
  78. package/dist/{urdfTree-Br9VYqKp.cjs → urdfTree-B19ebCHj.cjs} +1 -1
  79. package/dist/{urdfTree-DaWvX-6R.js → urdfTree-CjxhpnRl.js} +1 -1
  80. package/dist/{workpieceTreePanel-Z3aVdOWB.cjs → workpieceTreePanel-0L7tkycK.cjs} +1 -1
  81. package/dist/{workpieceTreePanel-BdRaFNRp.js → workpieceTreePanel-DAnMGvlX.js} +5 -5
  82. package/package.json +1 -1
  83. package/dist/obj/model.mtl +0 -42
  84. package/dist/obj/model.obj +0 -26110
  85. package/dist/threeSceneViewForCPMPIP-BYYbyqD7.cjs +0 -5
  86. package/dist/threeTrackPathView-BvUihuyk.cjs +0 -370
  87. package/public/obj/model.mtl +0 -42
  88. package/public/obj/model.obj +0 -26110
@@ -1,15 +1,15 @@
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-BdRaFNRp.js";
3
- import { u as Ke, a as it, b as rt } from "./iconfont-WOKNi2xx.js";
2
+ import { r as Re, U as ot, s as Ee, u as nt, a as at, W as st } from "./workpieceTreePanel-DAnMGvlX.js";
3
+ import { u as Ke, a as it, b as rt } from "./iconfont-B8CQB3CO.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-3GcG1eTD.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-CmofVWvn.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-Cg1p_3ne.js";
7
7
  import "./index-BHtNKL1L.js";
8
8
  import { _ as ue, s as Pt } from "./index-DRizRbU3.js";
9
- import "./index.vue_vue_type_style_index_1_lang-BH0DRFVE.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-CT8c_mLo.js";
10
10
  import "./index-CV2JWX-7.js";
11
- import { f as xt, a as Dt } from "./animationData-DfKVkFbz.js";
12
- import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-DaWvX-6R.js";
11
+ import { f as xt, a as Dt } from "./animationData-Btgynl98.js";
12
+ import { g as Tt, a as Rt, b as Vt, c as Mt, U as St, J as At } from "./urdfTree-CjxhpnRl.js";
13
13
  import { _ as Xe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  import { g as $t, a as je, d as zt, c as Ft, e as Yt, b as Lt } from "./dataUtil-DQX9rTvE.js";
15
15
  import { T as U } from "./svgIcon-D-_fXUBL.js";
@@ -676,7 +676,7 @@ ${E.value.join(" ")}
676
676
  ]);
677
677
  };
678
678
  }
679
- }), Qt = /* @__PURE__ */ Xe(Ht, [["__scopeId", "data-v-ca681456"]]), el = async () => {
679
+ }), Qt = /* @__PURE__ */ Xe(Ht, [["__scopeId", "data-v-34ca745a"]]), el = async () => {
680
680
  const f = await $t(["工件库", "弯管"]), g = je("工件列表", f), n = zt(g);
681
681
  return n == null ? void 0 : n.map((y) => ({
682
682
  name: y,
@@ -1,5 +1,5 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("./workpieceTreePanel-Z3aVdOWB.cjs"),de=require("./iconfont-C7kE-QbU.cjs"),A=require("./index-C8qRkCgn.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dzyqt2Z-.cjs");require("./index.vue_vue_type_style_index_1_lang-B8_elAaU.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-DhufphmT.cjs");require("./index.vue_vue_type_style_index_1_lang-BRFs_L5R.cjs");require("./index-a6bC3A9D.cjs");const Ce=require("./animationData-DxBvEqB1.cjs"),ne=require("./urdfTree-Br9VYqKp.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-B4sGo38_.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-0L7tkycK.cjs"),de=require("./iconfont-BXzhYF5A.cjs"),A=require("./index-C8qRkCgn.cjs"),a=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Y4oIHCVM.cjs");require("./index.vue_vue_type_style_index_1_lang-B8_elAaU.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-DhufphmT.cjs");require("./index.vue_vue_type_style_index_1_lang-BB0IwRdP.cjs");require("./index-a6bC3A9D.cjs");const Ce=require("./animationData-CCImpyvS.cjs"),ne=require("./urdfTree-B19ebCHj.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ee=require("./dataUtil-B4sGo38_.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(`
5
- `).filter(Y=>Y.trim()!=="");if(t.length<2){A.ElMessage.error("导入数据至少需要包含表头行和一行数据");return}const o=t[0].split(" ").map(Y=>Y.trim()),i={};if(o.forEach((Y,O)=>{z.value.includes(Y)&&(i[O]=Y)}),Object.keys(i).length===0){A.ElMessage.error("没有找到匹配的表头,请检查表头名称是否正确");return}const N=t.slice(1).map(Y=>{const O=Y.split(" "),K={};return z.value.forEach(q=>{K[q]="0"}),Object.entries(i).forEach(([q,ie])=>{const B=O[parseInt(q)];B!==void 0&&B.trim()!==""&&(K[ie]=B.trim())}),K});N.length>0?(c.value=N,A.ElMessage.success(`成功导入 ${N.length} 行数据!`),_.value=!1,s.value=""):A.ElMessage.error("未能解析到有效数据,请检查格式。")};return e.onUnmounted(()=>{se(),b=!0}),v({playAnimation:P,stopAnimation:R,forwardFrame:ve,backwardFrame:fe}),(t,o)=>{const i=e.resolveComponent("el-icon"),m=e.resolveComponent("el-input-number"),N=e.resolveComponent("el-form-item"),Y=e.resolveComponent("el-form"),O=e.resolveComponent("el-slider"),K=e.resolveComponent("el-progress"),q=e.resolveComponent("el-input"),ie=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Ae,[e.createVNode(Q._sfc_main,{onClick:C,modelValue:"获取数据"}),e.createVNode(Q._sfc_main,{onClick:ye,disabled:z.value.length===0,modelValue:"导出表头"},null,8,["disabled"]),e.createVNode(Q._sfc_main,{modelValue:"播放",onClick:P,disabled:c.value.length===0||p.value,buttonType:"primary"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createBlock(i,{key:0,class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(e.unref(A.loading_default))]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["disabled"]),e.createVNode(Q._sfc_main,{onClick:R,modelValue:"停止",buttonType:"danger"}),e.createVNode(Q._sfc_main,{onClick:oe,modelValue:"重置",buttonType:"primary"})]),e.createElementVNode("div",$e,[e.createElementVNode("div",ze,[e.createVNode(Y,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(N,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=B=>r.value=B),min:100,max:5e3,step:100,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"管件总长 (mm):",prop:"initialPipeLength"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:T.value,"onUpdate:modelValue":o[1]||(o[1]=B=>T.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"管件半径 (mm):",prop:"pipeRadius"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:k.value,"onUpdate:modelValue":o[2]||(o[2]=B=>k.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"夹持长度 (mm):",prop:"clampLength"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:D.value,"onUpdate:modelValue":o[3]||(o[3]=B=>D.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),o[10]||(o[10]=e.createElementVNode("div",{class:"control-row"},[e.createElementVNode("label",null,"管件 Mesh:")],-1)),e.createElementVNode("div",Fe,[o[8]||(o[8]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ye,e.toDisplayString(n.value+1)+" / "+e.toDisplayString(c.value.length),1)]),e.createElementVNode("div",Le,[o[9]||(o[9]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(O,{modelValue:n.value,"onUpdate:modelValue":o[4]||(o[4]=B=>n.value=B),min:0,max:c.value.length>0?c.value.length-1:0,step:1,"format-tooltip":pe,onInput:me,disabled:c.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Ue,[e.createVNode(K,{percentage:d.value,"show-text":!1,"stroke-width":6},null,8,["percentage"])])]),e.createVNode(ie,{modelValue:_.value,"onUpdate:modelValue":o[7]||(o[7]=B=>_.value=B),title:"导入数据",width:"500px"},{footer:e.withCtx(()=>[e.createElementVNode("span",Ie,[e.createVNode(Q._sfc_main,{modelValue:"取消",onClick:o[6]||(o[6]=B=>_.value=!1)}),e.createVNode(Q._sfc_main,{modelValue:"确认导入",onClick:be,type:"primary"})])]),default:e.withCtx(()=>[o[11]||(o[11]=e.createElementVNode("p",{class:"import-instructions"}," 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ",-1)),e.createVNode(q,{modelValue:s.value,"onUpdate:modelValue":o[5]||(o[5]=B=>s.value=B),type:"textarea",rows:10,placeholder:F.value},null,8,["modelValue","placeholder"])]),_:1,__:[11]},8,["modelValue"])])}}}),je=we._export_sfc(Ge,[["__scopeId","data-v-ca681456"]]),Oe=async()=>{const y=["工件库","弯管"],v=await ee.getMenuData(y),g=ee.getTargetGroup("工件列表",v),l=ee.getMainKeysFromGroup(g);return l==null?void 0:l.map(V=>({name:V,mainKey:V}))},Xe=async y=>{const v=["工件库","弯管"],g=await ee.getDetailData(v,y),l=ee.getTargetGroup("弯管基础参数",g),h=ee.getTargetGroup("弯管特征尺寸",g),V={outerDiameter:0,ybcrList:[]},u=ee.getFormData(l),C=ee.getTableData(h);return V.outerDiameter=(u==null?void 0:u.外径)||0,V.ybcrList=C||[],V},Ze={class:"pipe-analysis-dialog-header"},qe={class:"header-right"},Je={class:"pipe-analysis-dialog-body"},We={class:"panel-left"},Ke={class:"pipe-analysis-input"},He={class:"input-params"},Qe={class:"pipe-analysis-output"},et={class:"ouput-params"},tt=e.defineComponent({__name:"pipeAnalysisPanel",emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(y,{expose:v,emit:g}){const l=e.ref(null),h=e.shallowRef(null),{initThreeJS:V,handleResize:u,cleanup:C,clearAllModels:c,addModelAndFit:_}=de.useThreeJS(l);e.ref(null);const s=e.ref({file:null,pipe:""});e.ref(null),e.ref(!1);const p=e.ref([]),n=E=>{p.value=E};e.ref("ybcr");const d=e.ref({form:{},list:[],reverse:!1}),r=E=>{const{length:w,outerDiameter:U,innerDiameter:j,thickness:z,ybcrList:F}=E||{};d.value.form={length:w,outerDiameter:U,innerDiameter:j,thickness:z},d.value.list=F},b=()=>{const{form:E,list:w}=d.value,{outerDiameter:U}=E,j=U/2,z=w==null?void 0:w.map(J=>{const{y:I,b:L,c:W,r:P,Y:R,B:ae,C:G,R:oe}=J;return R?{Y:R,B:ae,C:G,R:oe}:{Y:I,B:L,C:W,R:P}});c();const F=Se(z,j);_(F)},x=e.ref(!1),f=()=>{const E=x.value;x.value=!E},M=e.ref(!1),S=()=>{M.value=!1},T=()=>{M.value=!0},k=async()=>{const E=await Oe();n(E)},D=async E=>{const w=await Xe(E);r(w)};return e.watch(()=>d,()=>{b()},{deep:!0}),e.watch(()=>l,()=>{try{if(h.value)return;V(),window.addEventListener("resize",u)}catch(E){console.error("Three.js 初始化失败:",E),A.ElMessage.error("渲染引擎初始化失败!")}},{deep:!0}),e.onMounted(async()=>{k()}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",u),C()}),v({openDialog:T}),(E,w)=>{const U=e.resolveComponent("el-icon"),j=e.resolveComponent("el-option"),z=e.resolveComponent("el-select"),F=e.resolveComponent("el-form-item"),J=e.resolveComponent("el-form"),I=e.resolveComponent("el-input"),L=e.resolveComponent("el-table-column"),W=e.resolveComponent("el-table");return e.openBlock(),e.createBlock(Q.ssDialog,{class:"pipe-analysis-dialog",visible:M.value,onBeforeDestroy:E.onDestroy,showClose:!1,fullScreen:x.value},{header:e.withCtx(()=>[e.createElementVNode("div",Ze,[w[6]||(w[6]=e.createElementVNode("div",{class:"header-left",title:"管件解析"}," 管件解析 ",-1)),e.createElementVNode("div",qe,[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(A.full_screen_default),{onClick:f})]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(A.close_default),{onClick:S})]),_:1})])])]),default:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createElementVNode("div",We,[e.createElementVNode("div",Ke,[w[7]||(w[7]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输入")],-1)),e.createElementVNode("div",He,[e.createVNode(J,{model:s.value,"label-width":"auto","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(F,{label:"弯管"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:s.value.pipe,"onUpdate:modelValue":w[0]||(w[0]=P=>s.value.pipe=P),placeholder:"请选择弯管",onChange:D},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,P=>(e.openBlock(),e.createBlock(j,{label:P.name,value:P.mainKey},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),e.createElementVNode("div",Qe,[e.createVNode(F,{label:"加工方向"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:d.value.reverse,"onUpdate:modelValue":w[1]||(w[1]=P=>d.value.reverse=P),placeholder:"请选择加工方向"},{default:e.withCtx(()=>[e.createVNode(j,{label:"正向",value:!1}),e.createVNode(j,{label:"反向",value:!0})]),_:1},8,["modelValue"])]),_:1}),w[8]||(w[8]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输出(弯管基础参数)")],-1)),e.createElementVNode("div",et,[e.createVNode(J,{model:d.value.form,"label-width":"auto","label-position":"top",inline:!0},{default:e.withCtx(()=>[e.createVNode(F,{label:"管长"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.length,"onUpdate:modelValue":w[2]||(w[2]=P=>d.value.form.length=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"外径"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.outerDiameter,"onUpdate:modelValue":w[3]||(w[3]=P=>d.value.form.outerDiameter=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"内径"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.innerDiameter,"onUpdate:modelValue":w[4]||(w[4]=P=>d.value.form.innerDiameter=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"壁厚"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.thickness,"onUpdate:modelValue":w[5]||(w[5]=P=>d.value.form.thickness=P)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),e.createVNode(W,{ref:"singleTableRef",data:d.value.list,"highlight-current-rowstyle":"width: 100%"},{default:e.withCtx(()=>[e.createVNode(L,{type:"index",width:"50"}),e.createVNode(L,{property:"y",label:"Y"}),e.createVNode(L,{property:"b",label:"B"}),e.createVNode(L,{property:"c",label:"C"}),e.createVNode(L,{property:"r",label:"R"})]),_:1},8,["data"])])])]),e.createElementVNode("div",{class:"panel-right",ref_key:"threejsContainer",ref:l},null,512)])]),_:1},8,["visible","onBeforeDestroy","fullScreen"])}}}),ot=we._export_sfc(tt,[["__scopeId","data-v-61e834a4"]]),lt={class:"obj-viewer-container"},nt={class:"pipe-comparison"},at={ref:"pipe1",class:"pipe-container"},st={ref:"pipe2",class:"pipe-container"},rt={class:"buttonGroup-topLeft"},it={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ut={class:"buttonGroup-bottom"},dt={class:"top-panel"},pt={class:"panel-header"},mt={class:"panel-body"},vt={class:"left-panel"},ft={class:"panel-header"},gt={class:"panel-body"},ht={key:1,class:"clipping-content"},Vt={class:"radio-group"},yt={class:"radio-label"},bt={class:"radio-label"},wt={class:"radio-label"},Nt={class:"radio-label"},Ct={class:"right-panel"},_t={class:"panel-header"},xt={class:"panel-body"},Et={key:0,class:"loading-overlay"},kt=e.defineComponent({__name:"threeSceneView",props:{fileBlobs:{default:()=>[]},animationData:{default:()=>({})},threeData:{}},emits:["getAnimationData","getThreeData"],setup(y,{emit:v}){const g=v,l=y,h=e.ref(X.sceneType.ROBOT),V=e.ref(null),u=e.ref(),C=e.ref(!1),c=e.ref(""),_=e.ref(!1),s=e.ref(""),p=e.ref(!1),n=e.ref(""),d=e.ref(!1),r=e.ref(""),b=e.shallowRef(null),x=e.shallowRef(null),f=e.ref(),{currentModels:M,resetView:S,initThreeJS:T,handleResize:k,getThreeJSObjects:D,cleanup:E,setModels:w,axesHelperVisible:U,toggleAxesVisibility:j,zoomIn:z,zoomOut:F}=de.useThreeJS(V),{loadSceneFromFile:J}=X.useUrdfLoader(D,M,C,c),{isAnimating:I,toggleAnimation:L,stopAnimation:W}=de.useAnimation(D,M),{isClipping:P,activeClippingAxis:R,toggleClipping:ae,updateClippingPlanes:G}=de.useClipping(D,M),{initRaycaster:oe,selectedObject3D:pe,setSelectedObjVisible:me,updatePosition:ve,updateRotation:fe,dispose:se}=X.useRaycaster(V,D,M),ce=()=>{j()},re=e.computed(()=>h.value===X.sceneType.ROBOT),ge=e.computed(()=>h.value===X.sceneType.PIPECOMPARSION),te=t=>{_.value=!0,s.value=t,t==="剖面视图"&&!P.value&&ae()},le=t=>{p.value=!0,n.value=t,t==="动画仿真"&&g("getAnimationData")},he=()=>{g("getThreeData")},Ve=()=>{var t;(t=f==null?void 0:f.value)==null||t.playAnimation()},ue=()=>{var t;(t=f==null?void 0:f.value)==null||t.stopAnimation()},ye=()=>{var t;(t=f==null?void 0:f.value)==null||t.forwardFrame()},be=()=>{var t;(t=f==null?void 0:f.value)==null||t.backwardFrame()};return e.watch(()=>l.fileBlobs,t=>{if(t&&t.length>0){const o=t[0];if(!o.name.toLowerCase().endsWith(".urdf"))return;J(o).then(i=>{b.value=i}).catch(i=>{console.error("加载URDF文件时发生错误:",i),A.ElMessage.error("加载urdf模型失败"),b.value=null})}else b.value=null},{immediate:!0,deep:!0}),e.watch(b,t=>{w(t?[t]:[]),oe()}),e.onMounted(async()=>{await e.nextTick();try{T(),window.addEventListener("resize",k);const t=D();x.value=t.scene}catch(t){console.error("Three.js 初始化失败:",t),A.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{s.value="",n.value="",window.removeEventListener("resize",k),I.value&&W(),E(),se()}),(t,o)=>{const i=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",lt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:V,class:"threejs-container"},null,512),[[e.vShow,re.value]]),e.withDirectives(e.createElementVNode("div",nt,[e.createElementVNode("div",at,null,512),e.createElementVNode("div",st,null,512)],512),[[e.vShow,ge.value]]),e.createElementVNode("div",rt,[e.createVNode($.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:e.unref(S),title:"重置"},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(z)},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(F)},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(L),title:e.unref(I)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode($.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(U),onClick:ce,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",it,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:te},void 0,!0),e.createVNode($.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:o[0]||(o[0]=m=>te("场景树")),active:_.value&&s.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"clipping",size:"24",onClick:o[1]||(o[1]=m=>te("剖面视图")),active:_.value&&s.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"zhaozi",size:"24",onClick:o[2]||(o[2]=m=>te("工件树")),active:_.value&&s.value==="工件树",title:"工件 "},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:o[3]||(o[3]=m=>te("场景4"))})]),e.createElementVNode("div",ct,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:le},void 0,!0),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode($.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:o[4]||(o[4]=m=>le("关节控制")),active:p.value&&n.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:o[5]||(o[5]=m=>le("动画仿真")),active:p.value&&n.value==="动画仿真"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:o[6]||(o[6]=m=>le("urdf动画")),active:p.value&&n.value==="urdf动画"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ut,[e.createVNode($.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:be}),e.createVNode($.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Ve}),e.createVNode($.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ye}),e.createVNode($.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:ue})]),e.withDirectives(e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:o[7]||(o[7]=m=>d.value=!1)}," X ")]),e.createElementVNode("div",mt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"top-panel",{topPanelType:r.value},void 0,!0)]),_:3})])],512),[[e.vShow,d.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",ft,[e.createElementVNode("span",null,e.toDisplayString(s.value),1),e.createElementVNode("span",{class:"close",onClick:o[8]||(o[8]=m=>_.value=!1)}," X ")]),e.createElementVNode("div",gt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var m;return[s.value==="场景树"?(e.openBlock(),e.createBlock(ne.UrdfTree,{key:0,model:b.value},null,8,["model"])):e.createCommentVNode("",!0),s.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",Vt,[e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":o[9]||(o[9]=N=>e.isRef(R)?R.value=N:null),onChange:o[10]||(o[10]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[18]||(o[18]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":o[11]||(o[11]=N=>e.isRef(R)?R.value=N:null),onChange:o[12]||(o[12]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[19]||(o[19]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":o[13]||(o[13]=N=>e.isRef(R)?R.value=N:null),onChange:o[14]||(o[14]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[20]||(o[20]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":o[15]||(o[15]=N=>e.isRef(R)?R.value=N:null),onChange:o[16]||(o[16]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[21]||(o[21]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),s.value==="工件树"?(e.openBlock(),e.createBlock(X.WorkpieceTreePanel,{key:2,model:(m=e.unref(pe))==null?void 0:m.obj,onVisibleChange:e.unref(me),onUpdatePosition:e.unref(ve),onUpdateRotation:e.unref(fe)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,_.value]]),e.withDirectives(e.createElementVNode("div",Ct,[e.createElementVNode("div",_t,[e.createElementVNode("span",null,e.toDisplayString(n.value),1),e.createElementVNode("span",{class:"close",onClick:o[17]||(o[17]=m=>p.value=!1)}," X ")]),e.createElementVNode("div",xt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ne.JointPanel,{model:b.value},null,8,["model"]),[[e.vShow,n.value==="关节控制"]]),e.withDirectives(e.createVNode(je,{ref_key:"animationPanelRef",ref:f,model:b.value,onGetThreeData:he,threeData:l.threeData},null,8,["model","threeData"]),[[e.vShow,n.value==="动画仿真"]]),e.renderSlot(t.$slots,"right-panel",{rightPanelType:n.value},void 0,!0)]),_:3})])],512),[[e.vShow,p.value]]),C.value?(e.openBlock(),e.createElementBlock("div",Et,[o[22]||(o[22]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0),e.createVNode(ot,{ref_key:"pipeAnalysisPanelRef",ref:u},null,512)])}}}),Mt=we._export_sfc(kt,[["__scopeId","data-v-6edeedc9"]]);exports.default=Mt;
5
+ `).filter(Y=>Y.trim()!=="");if(t.length<2){A.ElMessage.error("导入数据至少需要包含表头行和一行数据");return}const o=t[0].split(" ").map(Y=>Y.trim()),i={};if(o.forEach((Y,O)=>{z.value.includes(Y)&&(i[O]=Y)}),Object.keys(i).length===0){A.ElMessage.error("没有找到匹配的表头,请检查表头名称是否正确");return}const N=t.slice(1).map(Y=>{const O=Y.split(" "),K={};return z.value.forEach(q=>{K[q]="0"}),Object.entries(i).forEach(([q,ie])=>{const B=O[parseInt(q)];B!==void 0&&B.trim()!==""&&(K[ie]=B.trim())}),K});N.length>0?(c.value=N,A.ElMessage.success(`成功导入 ${N.length} 行数据!`),_.value=!1,s.value=""):A.ElMessage.error("未能解析到有效数据,请检查格式。")};return e.onUnmounted(()=>{se(),b=!0}),v({playAnimation:P,stopAnimation:R,forwardFrame:ve,backwardFrame:fe}),(t,o)=>{const i=e.resolveComponent("el-icon"),m=e.resolveComponent("el-input-number"),N=e.resolveComponent("el-form-item"),Y=e.resolveComponent("el-form"),O=e.resolveComponent("el-slider"),K=e.resolveComponent("el-progress"),q=e.resolveComponent("el-input"),ie=e.resolveComponent("el-dialog");return e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",Ae,[e.createVNode(Q._sfc_main,{onClick:C,modelValue:"获取数据"}),e.createVNode(Q._sfc_main,{onClick:ye,disabled:z.value.length===0,modelValue:"导出表头"},null,8,["disabled"]),e.createVNode(Q._sfc_main,{modelValue:"播放",onClick:P,disabled:c.value.length===0||p.value,buttonType:"primary"},{default:e.withCtx(()=>[p.value?(e.openBlock(),e.createBlock(i,{key:0,class:"is-loading"},{default:e.withCtx(()=>[e.createVNode(e.unref(A.loading_default))]),_:1})):e.createCommentVNode("",!0)]),_:1},8,["disabled"]),e.createVNode(Q._sfc_main,{onClick:R,modelValue:"停止",buttonType:"danger"}),e.createVNode(Q._sfc_main,{onClick:oe,modelValue:"重置",buttonType:"primary"})]),e.createElementVNode("div",$e,[e.createElementVNode("div",ze,[e.createVNode(Y,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(N,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:r.value,"onUpdate:modelValue":o[0]||(o[0]=B=>r.value=B),min:100,max:5e3,step:100,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"管件总长 (mm):",prop:"initialPipeLength"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:T.value,"onUpdate:modelValue":o[1]||(o[1]=B=>T.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"管件半径 (mm):",prop:"pipeRadius"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:k.value,"onUpdate:modelValue":o[2]||(o[2]=B=>k.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1}),e.createVNode(N,{label:"夹持长度 (mm):",prop:"clampLength"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:D.value,"onUpdate:modelValue":o[3]||(o[3]=B=>D.value=B),min:0,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),o[10]||(o[10]=e.createElementVNode("div",{class:"control-row"},[e.createElementVNode("label",null,"管件 Mesh:")],-1)),e.createElementVNode("div",Fe,[o[8]||(o[8]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ye,e.toDisplayString(n.value+1)+" / "+e.toDisplayString(c.value.length),1)]),e.createElementVNode("div",Le,[o[9]||(o[9]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(O,{modelValue:n.value,"onUpdate:modelValue":o[4]||(o[4]=B=>n.value=B),min:0,max:c.value.length>0?c.value.length-1:0,step:1,"format-tooltip":pe,onInput:me,disabled:c.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Ue,[e.createVNode(K,{percentage:d.value,"show-text":!1,"stroke-width":6},null,8,["percentage"])])]),e.createVNode(ie,{modelValue:_.value,"onUpdate:modelValue":o[7]||(o[7]=B=>_.value=B),title:"导入数据",width:"500px"},{footer:e.withCtx(()=>[e.createElementVNode("span",Ie,[e.createVNode(Q._sfc_main,{modelValue:"取消",onClick:o[6]||(o[6]=B=>_.value=!1)}),e.createVNode(Q._sfc_main,{modelValue:"确认导入",onClick:be,type:"primary"})])]),default:e.withCtx(()=>[o[11]||(o[11]=e.createElementVNode("p",{class:"import-instructions"}," 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ",-1)),e.createVNode(q,{modelValue:s.value,"onUpdate:modelValue":o[5]||(o[5]=B=>s.value=B),type:"textarea",rows:10,placeholder:F.value},null,8,["modelValue","placeholder"])]),_:1,__:[11]},8,["modelValue"])])}}}),je=we._export_sfc(Ge,[["__scopeId","data-v-34ca745a"]]),Oe=async()=>{const y=["工件库","弯管"],v=await ee.getMenuData(y),g=ee.getTargetGroup("工件列表",v),l=ee.getMainKeysFromGroup(g);return l==null?void 0:l.map(V=>({name:V,mainKey:V}))},Xe=async y=>{const v=["工件库","弯管"],g=await ee.getDetailData(v,y),l=ee.getTargetGroup("弯管基础参数",g),h=ee.getTargetGroup("弯管特征尺寸",g),V={outerDiameter:0,ybcrList:[]},u=ee.getFormData(l),C=ee.getTableData(h);return V.outerDiameter=(u==null?void 0:u.外径)||0,V.ybcrList=C||[],V},Ze={class:"pipe-analysis-dialog-header"},qe={class:"header-right"},Je={class:"pipe-analysis-dialog-body"},We={class:"panel-left"},Ke={class:"pipe-analysis-input"},He={class:"input-params"},Qe={class:"pipe-analysis-output"},et={class:"ouput-params"},tt=e.defineComponent({__name:"pipeAnalysisPanel",emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(y,{expose:v,emit:g}){const l=e.ref(null),h=e.shallowRef(null),{initThreeJS:V,handleResize:u,cleanup:C,clearAllModels:c,addModelAndFit:_}=de.useThreeJS(l);e.ref(null);const s=e.ref({file:null,pipe:""});e.ref(null),e.ref(!1);const p=e.ref([]),n=E=>{p.value=E};e.ref("ybcr");const d=e.ref({form:{},list:[],reverse:!1}),r=E=>{const{length:w,outerDiameter:U,innerDiameter:j,thickness:z,ybcrList:F}=E||{};d.value.form={length:w,outerDiameter:U,innerDiameter:j,thickness:z},d.value.list=F},b=()=>{const{form:E,list:w}=d.value,{outerDiameter:U}=E,j=U/2,z=w==null?void 0:w.map(J=>{const{y:I,b:L,c:W,r:P,Y:R,B:ae,C:G,R:oe}=J;return R?{Y:R,B:ae,C:G,R:oe}:{Y:I,B:L,C:W,R:P}});c();const F=Se(z,j);_(F)},x=e.ref(!1),f=()=>{const E=x.value;x.value=!E},M=e.ref(!1),S=()=>{M.value=!1},T=()=>{M.value=!0},k=async()=>{const E=await Oe();n(E)},D=async E=>{const w=await Xe(E);r(w)};return e.watch(()=>d,()=>{b()},{deep:!0}),e.watch(()=>l,()=>{try{if(h.value)return;V(),window.addEventListener("resize",u)}catch(E){console.error("Three.js 初始化失败:",E),A.ElMessage.error("渲染引擎初始化失败!")}},{deep:!0}),e.onMounted(async()=>{k()}),e.onBeforeUnmount(()=>{window.removeEventListener("resize",u),C()}),v({openDialog:T}),(E,w)=>{const U=e.resolveComponent("el-icon"),j=e.resolveComponent("el-option"),z=e.resolveComponent("el-select"),F=e.resolveComponent("el-form-item"),J=e.resolveComponent("el-form"),I=e.resolveComponent("el-input"),L=e.resolveComponent("el-table-column"),W=e.resolveComponent("el-table");return e.openBlock(),e.createBlock(Q.ssDialog,{class:"pipe-analysis-dialog",visible:M.value,onBeforeDestroy:E.onDestroy,showClose:!1,fullScreen:x.value},{header:e.withCtx(()=>[e.createElementVNode("div",Ze,[w[6]||(w[6]=e.createElementVNode("div",{class:"header-left",title:"管件解析"}," 管件解析 ",-1)),e.createElementVNode("div",qe,[e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(A.full_screen_default),{onClick:f})]),_:1}),e.createVNode(U,null,{default:e.withCtx(()=>[e.createVNode(e.unref(A.close_default),{onClick:S})]),_:1})])])]),default:e.withCtx(()=>[e.createElementVNode("div",Je,[e.createElementVNode("div",We,[e.createElementVNode("div",Ke,[w[7]||(w[7]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输入")],-1)),e.createElementVNode("div",He,[e.createVNode(J,{model:s.value,"label-width":"auto","label-position":"top"},{default:e.withCtx(()=>[e.createVNode(F,{label:"弯管"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:s.value.pipe,"onUpdate:modelValue":w[0]||(w[0]=P=>s.value.pipe=P),placeholder:"请选择弯管",onChange:D},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,P=>(e.openBlock(),e.createBlock(j,{label:P.name,value:P.mainKey},null,8,["label","value"]))),256))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])]),e.createElementVNode("div",Qe,[e.createVNode(F,{label:"加工方向"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:d.value.reverse,"onUpdate:modelValue":w[1]||(w[1]=P=>d.value.reverse=P),placeholder:"请选择加工方向"},{default:e.withCtx(()=>[e.createVNode(j,{label:"正向",value:!1}),e.createVNode(j,{label:"反向",value:!0})]),_:1},8,["modelValue"])]),_:1}),w[8]||(w[8]=e.createElementVNode("span",{class:"item-view-group"},[e.createElementVNode("span",{class:"group-name-wrap"},"输出(弯管基础参数)")],-1)),e.createElementVNode("div",et,[e.createVNode(J,{model:d.value.form,"label-width":"auto","label-position":"top",inline:!0},{default:e.withCtx(()=>[e.createVNode(F,{label:"管长"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.length,"onUpdate:modelValue":w[2]||(w[2]=P=>d.value.form.length=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"外径"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.outerDiameter,"onUpdate:modelValue":w[3]||(w[3]=P=>d.value.form.outerDiameter=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"内径"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.innerDiameter,"onUpdate:modelValue":w[4]||(w[4]=P=>d.value.form.innerDiameter=P)},null,8,["modelValue"])]),_:1}),e.createVNode(F,{label:"壁厚"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:d.value.form.thickness,"onUpdate:modelValue":w[5]||(w[5]=P=>d.value.form.thickness=P)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"]),e.createVNode(W,{ref:"singleTableRef",data:d.value.list,"highlight-current-rowstyle":"width: 100%"},{default:e.withCtx(()=>[e.createVNode(L,{type:"index",width:"50"}),e.createVNode(L,{property:"y",label:"Y"}),e.createVNode(L,{property:"b",label:"B"}),e.createVNode(L,{property:"c",label:"C"}),e.createVNode(L,{property:"r",label:"R"})]),_:1},8,["data"])])])]),e.createElementVNode("div",{class:"panel-right",ref_key:"threejsContainer",ref:l},null,512)])]),_:1},8,["visible","onBeforeDestroy","fullScreen"])}}}),ot=we._export_sfc(tt,[["__scopeId","data-v-61e834a4"]]),lt={class:"obj-viewer-container"},nt={class:"pipe-comparison"},at={ref:"pipe1",class:"pipe-container"},st={ref:"pipe2",class:"pipe-container"},rt={class:"buttonGroup-topLeft"},it={class:"buttonGroup-left"},ct={class:"buttonGroup-right"},ut={class:"buttonGroup-bottom"},dt={class:"top-panel"},pt={class:"panel-header"},mt={class:"panel-body"},vt={class:"left-panel"},ft={class:"panel-header"},gt={class:"panel-body"},ht={key:1,class:"clipping-content"},Vt={class:"radio-group"},yt={class:"radio-label"},bt={class:"radio-label"},wt={class:"radio-label"},Nt={class:"radio-label"},Ct={class:"right-panel"},_t={class:"panel-header"},xt={class:"panel-body"},Et={key:0,class:"loading-overlay"},kt=e.defineComponent({__name:"threeSceneView",props:{fileBlobs:{default:()=>[]},animationData:{default:()=>({})},threeData:{}},emits:["getAnimationData","getThreeData"],setup(y,{emit:v}){const g=v,l=y,h=e.ref(X.sceneType.ROBOT),V=e.ref(null),u=e.ref(),C=e.ref(!1),c=e.ref(""),_=e.ref(!1),s=e.ref(""),p=e.ref(!1),n=e.ref(""),d=e.ref(!1),r=e.ref(""),b=e.shallowRef(null),x=e.shallowRef(null),f=e.ref(),{currentModels:M,resetView:S,initThreeJS:T,handleResize:k,getThreeJSObjects:D,cleanup:E,setModels:w,axesHelperVisible:U,toggleAxesVisibility:j,zoomIn:z,zoomOut:F}=de.useThreeJS(V),{loadSceneFromFile:J}=X.useUrdfLoader(D,M,C,c),{isAnimating:I,toggleAnimation:L,stopAnimation:W}=de.useAnimation(D,M),{isClipping:P,activeClippingAxis:R,toggleClipping:ae,updateClippingPlanes:G}=de.useClipping(D,M),{initRaycaster:oe,selectedObject3D:pe,setSelectedObjVisible:me,updatePosition:ve,updateRotation:fe,dispose:se}=X.useRaycaster(V,D,M),ce=()=>{j()},re=e.computed(()=>h.value===X.sceneType.ROBOT),ge=e.computed(()=>h.value===X.sceneType.PIPECOMPARSION),te=t=>{_.value=!0,s.value=t,t==="剖面视图"&&!P.value&&ae()},le=t=>{p.value=!0,n.value=t,t==="动画仿真"&&g("getAnimationData")},he=()=>{g("getThreeData")},Ve=()=>{var t;(t=f==null?void 0:f.value)==null||t.playAnimation()},ue=()=>{var t;(t=f==null?void 0:f.value)==null||t.stopAnimation()},ye=()=>{var t;(t=f==null?void 0:f.value)==null||t.forwardFrame()},be=()=>{var t;(t=f==null?void 0:f.value)==null||t.backwardFrame()};return e.watch(()=>l.fileBlobs,t=>{if(t&&t.length>0){const o=t[0];if(!o.name.toLowerCase().endsWith(".urdf"))return;J(o).then(i=>{b.value=i}).catch(i=>{console.error("加载URDF文件时发生错误:",i),A.ElMessage.error("加载urdf模型失败"),b.value=null})}else b.value=null},{immediate:!0,deep:!0}),e.watch(b,t=>{w(t?[t]:[]),oe()}),e.onMounted(async()=>{await e.nextTick();try{T(),window.addEventListener("resize",k);const t=D();x.value=t.scene}catch(t){console.error("Three.js 初始化失败:",t),A.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{s.value="",n.value="",window.removeEventListener("resize",k),I.value&&W(),E(),se()}),(t,o)=>{const i=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",lt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:V,class:"threejs-container"},null,512),[[e.vShow,re.value]]),e.withDirectives(e.createElementVNode("div",nt,[e.createElementVNode("div",at,null,512),e.createElementVNode("div",st,null,512)],512),[[e.vShow,ge.value]]),e.createElementVNode("div",rt,[e.createVNode($.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:e.unref(S),title:"重置"},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(z)},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(F)},null,8,["onClick"]),e.createVNode($.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(L),title:e.unref(I)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode($.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(U),onClick:ce,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",it,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:te},void 0,!0),e.createVNode($.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:o[0]||(o[0]=m=>te("场景树")),active:_.value&&s.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"clipping",size:"24",onClick:o[1]||(o[1]=m=>te("剖面视图")),active:_.value&&s.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"zhaozi",size:"24",onClick:o[2]||(o[2]=m=>te("工件树")),active:_.value&&s.value==="工件树",title:"工件 "},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:o[3]||(o[3]=m=>te("场景4"))})]),e.createElementVNode("div",ct,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:le},void 0,!0),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"}),e.createVNode($.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:o[4]||(o[4]=m=>le("关节控制")),active:p.value&&n.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:o[5]||(o[5]=m=>le("动画仿真")),active:p.value&&n.value==="动画仿真"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"urdf动画",onClick:o[6]||(o[6]=m=>le("urdf动画")),active:p.value&&n.value==="urdf动画"},null,8,["active"]),e.createVNode($.ThreeSvgIcon,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",ut,[e.createVNode($.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:be}),e.createVNode($.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Ve}),e.createVNode($.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ye}),e.createVNode($.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:ue})]),e.withDirectives(e.createElementVNode("div",dt,[e.createElementVNode("div",pt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:o[7]||(o[7]=m=>d.value=!1)}," X ")]),e.createElementVNode("div",mt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"top-panel",{topPanelType:r.value},void 0,!0)]),_:3})])],512),[[e.vShow,d.value]]),e.withDirectives(e.createElementVNode("div",vt,[e.createElementVNode("div",ft,[e.createElementVNode("span",null,e.toDisplayString(s.value),1),e.createElementVNode("span",{class:"close",onClick:o[8]||(o[8]=m=>_.value=!1)}," X ")]),e.createElementVNode("div",gt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var m;return[s.value==="场景树"?(e.openBlock(),e.createBlock(ne.UrdfTree,{key:0,model:b.value},null,8,["model"])):e.createCommentVNode("",!0),s.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",ht,[e.createElementVNode("div",Vt,[e.createElementVNode("label",yt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":o[9]||(o[9]=N=>e.isRef(R)?R.value=N:null),onChange:o[10]||(o[10]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[18]||(o[18]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":o[11]||(o[11]=N=>e.isRef(R)?R.value=N:null),onChange:o[12]||(o[12]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[19]||(o[19]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",wt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":o[13]||(o[13]=N=>e.isRef(R)?R.value=N:null),onChange:o[14]||(o[14]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[20]||(o[20]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":o[15]||(o[15]=N=>e.isRef(R)?R.value=N:null),onChange:o[16]||(o[16]=(...N)=>e.unref(G)&&e.unref(G)(...N))},null,544),[[e.vModelRadio,e.unref(R)]]),o[21]||(o[21]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),s.value==="工件树"?(e.openBlock(),e.createBlock(X.WorkpieceTreePanel,{key:2,model:(m=e.unref(pe))==null?void 0:m.obj,onVisibleChange:e.unref(me),onUpdatePosition:e.unref(ve),onUpdateRotation:e.unref(fe)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,_.value]]),e.withDirectives(e.createElementVNode("div",Ct,[e.createElementVNode("div",_t,[e.createElementVNode("span",null,e.toDisplayString(n.value),1),e.createElementVNode("span",{class:"close",onClick:o[17]||(o[17]=m=>p.value=!1)}," X ")]),e.createElementVNode("div",xt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ne.JointPanel,{model:b.value},null,8,["model"]),[[e.vShow,n.value==="关节控制"]]),e.withDirectives(e.createVNode(je,{ref_key:"animationPanelRef",ref:f,model:b.value,onGetThreeData:he,threeData:l.threeData},null,8,["model","threeData"]),[[e.vShow,n.value==="动画仿真"]]),e.renderSlot(t.$slots,"right-panel",{rightPanelType:n.value},void 0,!0)]),_:3})])],512),[[e.vShow,p.value]]),C.value?(e.openBlock(),e.createElementBlock("div",Et,[o[22]||(o[22]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(c.value),1)])):e.createCommentVNode("",!0),e.createVNode(ot,{ref_key:"pipeAnalysisPanelRef",ref:u},null,512)])}}}),Mt=we._export_sfc(kt,[["__scopeId","data-v-6edeedc9"]]);exports.default=Mt;