ss-component-new 1.2.191 → 1.2.192

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 (63) hide show
  1. package/dist/{index-Cxc1PVXd.cjs → index-1ODHK9Cd.cjs} +1 -1
  2. package/dist/{index-D1ueogxS.cjs → index-B23XP8Sd.cjs} +1 -1
  3. package/dist/{index-BirQQ3lc.cjs → index-B3s6qd3M.cjs} +1 -1
  4. package/dist/{index-D65YDXKW.js → index-B5LJ6FGn.js} +1 -1
  5. package/dist/{index-rZ7014Sk.js → index-BEj44QUg.js} +1 -1
  6. package/dist/{index-C70zIE55.js → index-BLWD7etg.js} +1 -1
  7. package/dist/{index-CMIPZKPf.js → index-BQdex7jO.js} +1 -1
  8. package/dist/{index-BXqKOxuS.js → index-BZrGQ9o1.js} +3 -3
  9. package/dist/{index-C2JrWyll.js → index-BcBjGzet.js} +3 -3
  10. package/dist/{index-CBrhRCO-.js → index-BcZW8n6c.js} +1 -1
  11. package/dist/{index-CWYagSpt.cjs → index-BguIX2P4.cjs} +1 -1
  12. package/dist/{index-RnSoY-22.cjs → index-Bm50ZZuq.cjs} +1 -1
  13. package/dist/{index-BymuSJDI.js → index-BowckPW8.js} +1 -1
  14. package/dist/{index-B-NCl3gS.cjs → index-Bq-dJJvd.cjs} +1 -1
  15. package/dist/{index-BxzBPUPM.js → index-C5vtEDy4.js} +2 -2
  16. package/dist/{index-pE7as_kK.cjs → index-C6aP1eIU.cjs} +1 -1
  17. package/dist/{index-DJG_XEjD.js → index-CLrQ3JMC.js} +2 -2
  18. package/dist/{index-BX8rwlid.js → index-CMpTpds8.js} +4 -4
  19. package/dist/{index-DJK5gz0F.js → index-CWGLA4xe.js} +1 -1
  20. package/dist/{index-cEI9vLYk.cjs → index-Csi6xtxp.cjs} +1 -1
  21. package/dist/{index-CfrhAsQz.cjs → index-CwX0OwiF.cjs} +1 -1
  22. package/dist/{index-ClXBdclA.js → index-CxMRlSKH.js} +1 -1
  23. package/dist/{index-3YRDwSPj.cjs → index-D2ZwX2kR.cjs} +1 -1
  24. package/dist/{index-Dn1Qel0o.cjs → index-D4T0v2f_.cjs} +1 -1
  25. package/dist/{index-DVgUQo5m.cjs → index-DNy_qVvw.cjs} +1 -1
  26. package/dist/{index-uqjKMDh5.js → index-DoqduP20.js} +11 -11
  27. package/dist/{index-CG3mcSTj.cjs → index-Dv-xHM7h.cjs} +1 -1
  28. package/dist/{index-BJoXWCIX.js → index-DvuQ6n5o.js} +2 -2
  29. package/dist/{index-BuL5m2Nq.js → index-Dz5O73IZ.js} +5 -5
  30. package/dist/{index-ipWINep3.cjs → index-Llg0-BL5.cjs} +1 -1
  31. package/dist/{index-CPcvHs6z.cjs → index-NG0JZKkn.cjs} +1 -1
  32. package/dist/{index-zTq3bNpY.js → index-Un7xS2Nb.js} +2 -2
  33. package/dist/{index-CvNZtYfg.cjs → index-VLwmyIOb.cjs} +1 -1
  34. package/dist/{index-CgRDUt8V.cjs → index-hYa8rJWO.cjs} +1 -1
  35. package/dist/{index-cH3mCnr4.js → index-iuq5na-k.js} +1 -1
  36. package/dist/{index-D-Yo1xz-.cjs → index-r_n9bpW_.cjs} +1 -1
  37. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-Bsm0qkYt.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BU_MX7_0.cjs} +1 -1
  38. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D6b-8gl4.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DlOjCfkj.js} +4 -4
  39. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-BCaM-Lqa.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-BEFZSjlw.cjs} +1 -1
  40. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CQS0SuIY.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-BnVkqouB.js} +2 -2
  41. package/dist/{index.vue_vue_type_style_index_1_lang-BFSnWFIG.js → index.vue_vue_type_style_index_1_lang-Cgm8Cuer.js} +1 -1
  42. package/dist/{index.vue_vue_type_style_index_1_lang-Clj-_LIm.cjs → index.vue_vue_type_style_index_1_lang-DXs-lrLT.cjs} +1 -1
  43. package/dist/{main-Ce1JDbwN.cjs → main-CK7a4eej.cjs} +1 -1
  44. package/dist/{main-SkCnXTUx.js → main-eQ2yMiP4.js} +2 -2
  45. package/dist/ss-component.cjs +1 -1
  46. package/dist/ss-component.css +1 -1
  47. package/dist/ss-component.js +6 -6
  48. package/dist/ss-component2.cjs +1 -1
  49. package/dist/ss-component2.js +10 -10
  50. package/dist/{threeModel-X2Nc978i.cjs → threeModel-BQWHG33C.cjs} +1 -1
  51. package/dist/{threeModel-Byuhg7mk.js → threeModel-BsE51SUL.js} +2 -2
  52. package/dist/{threeSceneView-CYij3StZ.cjs → threeSceneView-B-TXh0v2.cjs} +1 -1
  53. package/dist/{threeSceneView-6zjO4BPx.js → threeSceneView-D4ii8mhH.js} +2 -2
  54. package/dist/{threeSceneViewForCPMPIP-D4udu9q8.js → threeSceneViewForCPMPIP-D_Z1UGet.js} +3 -3
  55. package/dist/{threeSceneViewForCPMPIP-UVqs5Mfj.cjs → threeSceneViewForCPMPIP-uSbrD0_x.cjs} +1 -1
  56. package/dist/threeTrackPathView-B_CJ1S5Z.cjs +1 -0
  57. package/dist/{threeTrackPathView-DuiJbPwP.js → threeTrackPathView-DNh-AvDU.js} +80 -79
  58. package/dist/{threeViewerHost-BoBcYLbp.js → threeViewerHost-B3D4LzMe.js} +1 -1
  59. package/dist/{threeViewerHost-B2o6xcaT.cjs → threeViewerHost-DyPs12hY.cjs} +1 -1
  60. package/dist/{workpieceTreePanel-B55jmeoM.cjs → workpieceTreePanel-BLf_clDa.cjs} +1 -1
  61. package/dist/{workpieceTreePanel-1eij5wwB.js → workpieceTreePanel-BiQ4O4B7.js} +2 -2
  62. package/package.json +1 -1
  63. package/dist/threeTrackPathView-CvJHDcL3.cjs +0 -1
@@ -5,19 +5,19 @@ import { u as C } from "./index.vue_vue_type_style_index_1_lang-mHz69z2I.js";
5
5
  import "./index-CA0SFykF.js";
6
6
  import u from "./ss-component2.js";
7
7
  import { t as g, c as T, b as P } from "./index-CAPx0_D4.js";
8
- const n = o(() => import("./main-SkCnXTUx.js"));
8
+ const n = o(() => import("./main-eQ2yMiP4.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-CMIPZKPf.js").then((t) => t.k));
12
+ const s = o(() => import("./index-BQdex7jO.js").then((t) => t.k));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-zTq3bNpY.js"));
16
+ const r = o(() => import("./index-Un7xS2Nb.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-BuL5m2Nq.js"));
20
+ const m = o(() => import("./index-Dz5O73IZ.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
@@ -33,11 +33,11 @@ const a = o(() => import("./index-C0cHsnRQ.js").then((t) => t.i));
33
33
  a.install = (t) => {
34
34
  t.component("ssAvatar", a);
35
35
  };
36
- const l = o(() => import("./threeModel-Byuhg7mk.js"));
36
+ const l = o(() => import("./threeModel-BsE51SUL.js"));
37
37
  l.install = (t) => {
38
38
  t.component("ssThree", l);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-BoBcYLbp.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-B3D4LzMe.js").then((t) => t.t));
41
41
  p.install = (t) => {
42
42
  t.component("threeViewerHost", p);
43
43
  };
@@ -1 +1 @@
1
- "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-A1rieWA1.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-BfBkrIpR.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-ipWINep3.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-Dn1Qel0o.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CWYagSpt.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-DVgUQo5m.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-D-Yo1xz-.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-RnSoY-22.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CfrhAsQz.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-Cxc1PVXd.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-3YRDwSPj.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-CvNZtYfg.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
1
+ "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-A1rieWA1.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-BfBkrIpR.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-Llg0-BL5.cjs")),children:[{path:"系统配置/站内信",name:"Message",component:async()=>Promise.resolve().then(()=>require("./index-DPIg2S6M.cjs"))},{path:"系统配置/自动生成",name:"Automatic",component:async()=>Promise.resolve().then(()=>require("./index-B2BAJXIH.cjs"))},{path:"平台管理/菜单管理",name:"Menu",component:async()=>Promise.resolve().then(()=>require("./index-D4T0v2f_.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-BguIX2P4.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-DNy_qVvw.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-r_n9bpW_.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-Bm50ZZuq.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CwX0OwiF.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-1ODHK9Cd.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-D2ZwX2kR.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-VLwmyIOb.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
@@ -13,7 +13,7 @@ const a = [
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-uqjKMDh5.js"),
16
+ component: async () => import("./index-DoqduP20.js"),
17
17
  // component: async ()=>import('@/components/views/model/component/main.vue'),
18
18
  // component: async ()=>import('@/components/views/canvas/index.vue'),
19
19
  // component: async ()=>import('@/components/views/test/index.vue'),
@@ -31,47 +31,47 @@ const a = [
31
31
  {
32
32
  path: "平台管理/菜单管理",
33
33
  name: "Menu",
34
- component: async () => import("./index-C2JrWyll.js")
34
+ component: async () => import("./index-BcBjGzet.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-CBrhRCO-.js")
39
+ component: async () => import("./index-BcZW8n6c.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-BJoXWCIX.js")
44
+ component: async () => import("./index-DvuQ6n5o.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-D65YDXKW.js")
49
+ component: async () => import("./index-B5LJ6FGn.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-cH3mCnr4.js")
54
+ component: async () => import("./index-iuq5na-k.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-BymuSJDI.js")
59
+ component: async () => import("./index-BowckPW8.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-ClXBdclA.js")
64
+ component: async () => import("./index-CxMRlSKH.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-DJK5gz0F.js")
69
+ component: async () => import("./index-CWGLA4xe.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-rZ7014Sk.js")
74
+ component: async () => import("./index-BEj44QUg.js")
75
75
  }
76
76
  // {
77
77
  // path: 'priority',
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs"),pe=require("./OrbitControls-DVmHTrnJ.cjs"),me=require("./index-CPcvHs6z.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-Clj-_LIm.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-BC48-1Tl.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,_=null,c=null,C=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),h=new pe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),f(),P()},t=(m,l)=>{c&&(g.remove(c),c.dispose()),C&&(g.remove(C),C.geometry.dispose(),C.material.dispose());const E=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,g.add(C)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(E.x,E.y,E.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);g.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const E=new n.DirectionalLight(16777215,.8);E.position.set(-8,-8,6),g.add(E);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},P=()=>{_=requestAnimationFrame(P),h&&h.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{m[E]&&m[E].dispose&&m[E].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(E=>{I(E)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,E=m.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:m=>{if(!u||!h||b.value.length===0)return;const l=new n.Box3;let E=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),E=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),E=!0}else l.expandByObject(Z),E=!0}),!E){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;b.value.forEach(l=>{g.remove(l),A(l)});const m=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&m.push(l)}),m.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{_&&cancelAnimationFrame(_),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,_=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=C*1.2,P=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(P,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,P=Math.min(f/h,1);if(P>=1){k();return}const I=S(P);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),_.copy(p.target);const f=new n.Box3;g.value.forEach(G=>{f.expandByObject(G)});const P=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),C=Math.max(P.x,P.y,P.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(_))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),P=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(P,_,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],_=new n.Box3,c=new n.Vector3;const C=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{_.makeEmpty(),g.value.forEach(y=>{_.expandByObject(y)}),c=_.getCenter(new n.Vector3)},D=y=>{const t=_.getSize(new n.Vector3);let p,f,P;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(P),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(P=>{P.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{g.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),g.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=re.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,_,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(_=u.value)==null?void 0:_.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},_e={class:"joint-left"},Pe={class:"joint-name"},Ce={class:"joint-range"},be={class:"joint-type"},Ee={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),_=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,_.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const P=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae.mm2m,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??P(s._jointType,!1),upper:s.limit.upper??P(s._jointType,!0)}:{lower:P(s._jointType,!1),upper:P(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae.mm2m)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae.mm2m,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae.mm2m,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),_.value*ae.mm2m,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},E=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:E,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("span",Pe,e.toDisplayString(i.name),1),e.createElementVNode("span",Ce," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-d48ad0d8"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},_=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(b,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:_},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let _=`${x}`;return _=`${_.replace("px","")}px`,{width:_,height:_}});return(x,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-3150a90b"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const _=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:P,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(_),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:E,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&E();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&E()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),h=A().scene,x=!0,window.addEventListener("resize",P)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",P),J.value&&Y(),$()}),g({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:_,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs"),pe=require("./OrbitControls-DVmHTrnJ.cjs"),me=require("./index-NG0JZKkn.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-DXs-lrLT.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-BC48-1Tl.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,_=null,c=null,C=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),h=new pe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),f(),P()},t=(m,l)=>{c&&(g.remove(c),c.dispose()),C&&(g.remove(C),C.geometry.dispose(),C.material.dispose());const E=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,g.add(C)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(E.x,E.y,E.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);g.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const E=new n.DirectionalLight(16777215,.8);E.position.set(-8,-8,6),g.add(E);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},P=()=>{_=requestAnimationFrame(P),h&&h.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{m[E]&&m[E].dispose&&m[E].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(E=>{I(E)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,E=m.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:m=>{if(!u||!h||b.value.length===0)return;const l=new n.Box3;let E=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),E=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),E=!0}else l.expandByObject(Z),E=!0}),!E){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;b.value.forEach(l=>{g.remove(l),A(l)});const m=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&m.push(l)}),m.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{_&&cancelAnimationFrame(_),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,_=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=C*1.2,P=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(P,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,P=Math.min(f/h,1);if(P>=1){k();return}const I=S(P);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),_.copy(p.target);const f=new n.Box3;g.value.forEach(G=>{f.expandByObject(G)});const P=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),C=Math.max(P.x,P.y,P.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(_))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const f=t.position.clone(),P=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(f,x,G),p.target.lerpVectors(P,_,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],_=new n.Box3,c=new n.Vector3;const C=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{_.makeEmpty(),g.value.forEach(y=>{_.expandByObject(y)}),c=_.getCenter(new n.Vector3)},D=y=>{const t=_.getSize(new n.Vector3);let p,f,P;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),P=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(P),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(P=>{P.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{g.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),g.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=re.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,_,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(_=u.value)==null?void 0:_.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},_e={class:"joint-left"},Pe={class:"joint-name"},Ce={class:"joint-range"},be={class:"joint-type"},Ee={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),_=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,_.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const P=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae.mm2m,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??P(s._jointType,!1),upper:s.limit.upper??P(s._jointType,!0)}:{lower:P(s._jointType,!1),upper:P(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae.mm2m)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae.mm2m,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae.mm2m,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),_.value*ae.mm2m,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},E=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:E,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("span",Pe,e.toDisplayString(i.name),1),e.createElementVNode("span",Ce," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-d48ad0d8"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},_=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(b,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:_},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let _=`${x}`;return _=`${_.replace("px","")}px`,{width:_,height:_}});return(x,_)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-3150a90b"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const _=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:P,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(_),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:E,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&E();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&E()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),h=A().scene,x=!0,window.addEventListener("resize",P)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",P),J.value&&Y(),$()}),g({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:_,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
@@ -1,8 +1,8 @@
1
1
  import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
2
2
  import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, e as Qe, A as et, f as tt, M as Re, X as nt, G as at, h as Me, j as ot, k as De, l as st, D as ke, H as lt, n as Ve, o as Oe, p as Ue, q as ze, E as _e, r as de, s as it, t as rt, T as ct } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-dK7WSb7x.js";
3
3
  import { O as ut } from "./OrbitControls-DOx8_JPa.js";
4
- import { s as dt } from "./index-BXqKOxuS.js";
5
- import { u as pt } from "./index.vue_vue_type_style_index_1_lang-BFSnWFIG.js";
4
+ import { s as dt } from "./index-BZrGQ9o1.js";
5
+ import { u as pt } from "./index.vue_vue_type_style_index_1_lang-Cgm8Cuer.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { c as Ge, E as Ie } from "./index-CA0SFykF.js";
8
8
  import { m as pe } from "./robotUtil-BBWei-8I.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-B55jmeoM.cjs"),de=require("./iconfont-Dt1tG-V3.cjs"),A=require("./index-CEwxrYB-.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs");require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-BAjzyphl.cjs");require("./index.vue_vue_type_style_index_1_lang-Clj-_LIm.cjs");const Y=require("./robotUtil-BC48-1Tl.cjs");require("./index-C4UuTGqh.cjs");const Ne=require("./animationData-CaZgUauJ.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ce=require("./urdfTree-DY8slOyJ.cjs"),ee=require("./dataUtil-DdKPfmZ6.cjs"),F=require("./svgIcon-CUM54R6L.cjs"),K=s.MathUtils.degToRad,we=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Te(V=.005,p=64){const f=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(f,p,V,16,!1),g=we;return new s.Mesh(n,g)}const ke=V=>V.reduce((p,f)=>{let n=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(n+=g),h>0&&u>0&&(n+=u*K(h)),p+n},0),Me=V=>{const p=[],f=V.Y??0,n=V.B??0,g=V.C??0,h=V.R??0,u={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),n!==0){const _=new s.Matrix4().makeRotationAxis(u.localY,K(n));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const a=_*m/r,d=new s.Matrix4().makeRotationAxis(u.localZ,a),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Se(V,p){const f=new s.Group;f.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const a=new s.Matrix4().makeRotationAxis(n.localY,K(x));n.localX.applyMatrix4(a),n.localZ.applyMatrix4(a)}if(c>0){const a=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(c*Y.mm2m));const d=n.pos.clone(),i=Pe(a,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=a.clone();De(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const a=K(r),d=m*Y.mm2m,i=[];i.push(n.pos.clone());const b=n.pos.clone().add(n.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=a*P/k,D=new s.Matrix4().makeRotationAxis(n.localZ,S),L=n.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Re(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],n.pos=i[i.length-1].clone();const T=new s.Matrix4().makeRotationAxis(n.localZ,a);n.localY.applyMatrix4(T),n.localX.applyMatrix4(T),g++,h++}}return f}function De(V,p,f,n){const g=new s.Vector3(0,n*2,n*5),h=f.clone().add(g),u=[f,h],_=new s.BufferGeometry().setFromPoints(u),c=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),x=new s.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const a=new s.CanvasTexture(r),d=new s.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),i=new s.Sprite(d),b=n*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function Pe(V,p,f){const n=new s.LineCurve3(V,p),g=new s.TubeGeometry(n,2,f,18,!1);return new s.Mesh(g,we)}function Re(V,p){const f=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new s.Mesh(n,we)}function _e(V,p,f,n,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=ke(u),x=Math.max(0,f-c),r=[];r.push(new s.Vector3(0,0,0));const m=new s.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let a={pos:m.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=Me(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new s.Matrix4;return L.makeBasis(a.localX,a.localY,a.localZ),R.applyMatrix4(L),R.add(a.pos)});d.push(v);const T=v[v.length-1];a.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new s.Matrix4().makeRotationAxis(a.localY,K(P));a.localX.applyMatrix4(D),a.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new s.Matrix4().makeRotationAxis(a.localZ,D);a.localY.applyMatrix4(R),a.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new s.Vector3(0,.001,0));try{const i=new s.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,r.length*4),n*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function xe(V,p,f,n=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&n>0){const a={...h,B:(h.B??0)*n,C:(h.C??0)*n};g.push(a)}const u=ke(g),_=Math.max(0,p-u),c=[];c.push(new s.Vector3(0,0,0));const x=new s.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const m=[];for(let a=g.length-1;a>=0;a--){const d=g[a],i=Me(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new s.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new s.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new s.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const a of m)a.length>1&&c.push(...a.slice(1));return c.length<2&&c.push(new s.Vector3(0,.001,0)),c}function Ee(V,p,f,n,g,h,u,_=0,c=0){const x=g-c,r=xe(n,x,u,_);let a=xe(f,c,u,_);a.forEach(i=>i.y=-i.y),a.reverse();const d=[...a,...r];try{const i=new s.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},Fe={class:"control-row"},ze={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(V,{expose:p,emit:f}){const n=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>n.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await Ne.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ce($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),a=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>n.model?Y.getNonFixedJoints(n.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-BLf_clDa.cjs"),de=require("./iconfont-Dt1tG-V3.cjs"),A=require("./index-CEwxrYB-.cjs"),s=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs");require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs");require("./index-BpPyaNFa.cjs");const Q=require("./index-BAjzyphl.cjs");require("./index.vue_vue_type_style_index_1_lang-DXs-lrLT.cjs");const Y=require("./robotUtil-BC48-1Tl.cjs");require("./index-C4UuTGqh.cjs");const Ne=require("./animationData-CaZgUauJ.cjs"),ye=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ce=require("./urdfTree-DY8slOyJ.cjs"),ee=require("./dataUtil-DdKPfmZ6.cjs"),F=require("./svgIcon-CUM54R6L.cjs"),K=s.MathUtils.degToRad,we=new s.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:s.DoubleSide});function Te(V=.005,p=64){const f=new s.CatmullRomCurve3([new s.Vector3(0,0,0),new s.Vector3(0,0,0)]),n=new s.TubeGeometry(f,p,V,16,!1),g=we;return new s.Mesh(n,g)}const ke=V=>V.reduce((p,f)=>{let n=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(n+=g),h>0&&u>0&&(n+=u*K(h)),p+n},0),Me=V=>{const p=[],f=V.Y??0,n=V.B??0,g=V.C??0,h=V.R??0,u={pos:new s.Vector3(0,0,0),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),n!==0){const _=new s.Matrix4().makeRotationAxis(u.localY,K(n));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const a=_*m/r,d=new s.Matrix4().makeRotationAxis(u.localZ,a),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Se(V,p){const f=new s.Group;f.name="CompletePipe";const n={pos:new s.Vector3(0,0,0),localX:new s.Vector3(1,0,0),localY:new s.Vector3(0,1,0),localZ:new s.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const a=new s.Matrix4().makeRotationAxis(n.localY,K(x));n.localX.applyMatrix4(a),n.localZ.applyMatrix4(a)}if(c>0){const a=n.pos.clone();n.pos.add(n.localY.clone().multiplyScalar(c*Y.mm2m));const d=n.pos.clone(),i=Pe(a,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=a.clone();De(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const a=K(r),d=m*Y.mm2m,i=[];i.push(n.pos.clone());const b=n.pos.clone().add(n.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=a*P/k,D=new s.Matrix4().makeRotationAxis(n.localZ,S),L=n.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Re(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],n.pos=i[i.length-1].clone();const T=new s.Matrix4().makeRotationAxis(n.localZ,a);n.localY.applyMatrix4(T),n.localX.applyMatrix4(T),g++,h++}}return f}function De(V,p,f,n){const g=new s.Vector3(0,n*2,n*5),h=f.clone().add(g),u=[f,h],_=new s.BufferGeometry().setFromPoints(u),c=new s.LineDashedMaterial({color:16711680,dashSize:n*.5,gapSize:n*.3,linewidth:1}),x=new s.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const a=new s.CanvasTexture(r),d=new s.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),i=new s.Sprite(d),b=n*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function Pe(V,p,f){const n=new s.LineCurve3(V,p),g=new s.TubeGeometry(n,2,f,18,!1);return new s.Mesh(g,we)}function Re(V,p){const f=new s.CatmullRomCurve3(V,!1,"catmullrom",.01),n=new s.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new s.Mesh(n,we)}function _e(V,p,f,n,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=ke(u),x=Math.max(0,f-c),r=[];r.push(new s.Vector3(0,0,0));const m=new s.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let a={pos:m.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=Me(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new s.Matrix4;return L.makeBasis(a.localX,a.localY,a.localZ),R.applyMatrix4(L),R.add(a.pos)});d.push(v);const T=v[v.length-1];a.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new s.Matrix4().makeRotationAxis(a.localY,K(P));a.localX.applyMatrix4(D),a.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new s.Matrix4().makeRotationAxis(a.localZ,D);a.localY.applyMatrix4(R),a.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new s.Vector3(0,.001,0));try{const i=new s.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,r.length*4),n*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function xe(V,p,f,n=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&n>0){const a={...h,B:(h.B??0)*n,C:(h.C??0)*n};g.push(a)}const u=ke(g),_=Math.max(0,p-u),c=[];c.push(new s.Vector3(0,0,0));const x=new s.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new s.Vector3(0,1,0),localX:new s.Vector3(1,0,0),localZ:new s.Vector3(0,0,1)};const m=[];for(let a=g.length-1;a>=0;a--){const d=g[a],i=Me(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new s.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new s.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new s.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const a of m)a.length>1&&c.push(...a.slice(1));return c.length<2&&c.push(new s.Vector3(0,.001,0)),c}function Ee(V,p,f,n,g,h,u,_=0,c=0){const x=g-c,r=xe(n,x,u,_);let a=xe(f,c,u,_);a.forEach(i=>i.y=-i.y),a.reverse();const d=[...a,...r];try{const i=new s.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new s.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},Fe={class:"control-row"},ze={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(V,{expose:p,emit:f}){const n=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>n.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await Ne.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ce($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),a=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>n.model?Y.getNonFixedJoints(n.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${$.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),z=()=>c.value.map(l=>({Y:parseFloat(l.Y)||0,B:parseFloat(l.B)||0,C:parseFloat(l.C)||0,R:parseFloat(l.R)||0})),q=()=>{const l=[],t=[];return c.value.forEach(o=>{const{Y1:y,B1:N,C1:E,R1:j,Y2:W,B2:J,C2:ie,R2:B}=o;l.push({Y:parseFloat(y)||0,B:parseFloat(N)||0,C:parseFloat(E)||0,R:parseFloat(j)||0}),t.push({Y:parseFloat(W)||0,B:parseFloat(J)||0,C:parseFloat(ie)||0,R:parseFloat(B)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},I=(l=0,t=0)=>{if(v.value&&T.value){const o=q();Ee(v.value,T.value,o.posPipeYbcr,o.negPipeYbcr,S.value,D.value,l,t,R.value)}else if(v.value){const o=z();_e(v.value,o,S.value,D.value,l,t)}},U=l=>{if(l<0||l>=c.value.length){console.error(`帧索引 ${l} 超出范围`);return}const t=c.value[l];if(console.log(`应用第 ${l} 帧数据 ${t}`),a.value=l,k.value){const o={};C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value.setJointAngles(o)}I(l,0)},H=async()=>{if(c.value.length===0){A.ElMessage.error("无法播放动画:无数据");return}if(!m.value){m.value=!0,b=!1,c.value.length-1===a.value&&(a.value=0);try{for(let l=a.value+1;l<c.value.length&&!b;l++){a.value=l;const t=c.value[l],o={};k.value&&C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value?await k.value.animateToState(o,i.value,y=>{d.value=(l+y)/c.value.length*100,I(l-1,y)}):(await new Promise(y=>setTimeout(y,i.value)),d.value=(l+1)/c.value.length*100)}b||A.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l),A.ElMessage.error("动画播放出错")}finally{m.value=!1,d.value=0}}},w=()=>{b=!0,m.value=!1,d.value=0,A.ElMessage.info("动画已停止")},oe=()=>{a.value=0},G=()=>{if(v.value&&T.value){const l=q();Ee(v.value,T.value,l.posPipeYbcr,l.negPipeYbcr,S.value,D.value,-1,0,R.value)}else if(v.value){const l=z();_e(v.value,l,S.value,D.value,-1,0)}},le=()=>{k.value&&k.value.resetToZero(),G(),oe(),A.ElMessage.success("机器人和管件已重置")},ae=l=>`第 ${l+1} 帧`,me=l=>{m.value&&w(),U(l)},pe=()=>{m.value&&w(),!(a.value+1>=c.value.length)&&U(a.value+1)},ve=()=>{m.value&&w(),a.value!==0&&U(a.value-1)},se=()=>{P.value&&(P.value.visible=!0),v.value&&v.value.parent&&v.value.parent.remove(v.value),P.value=null,v.value=null,T.value=null},ce=l=>l==null?void 0:l.reduce((t,o)=>(t[o]="0",t),{});e.watch($,(l,t)=>{if(JSON.stringify(l)!==JSON.stringify(t))if(l.length>0){const o=ce(l);c.value=[o]}else c.value=[]},{immediate:!0});const re=e.ref(0),fe=l=>{re.value=l},te=(l,t)=>{if(!l||!t)return;const o=Y.getTargetJoint(l,t),y=Te();y.visible=!1,o==null||o.add(y)},ne=l=>{k.value=new O.URDFRobotController(l),L.value=Y.getAllLinkName(l),M.value="Pipe_Joint"},ge=()=>{k.value=null,L.value=[],M.value=null},he=l=>{ne(l),te(l,M.value),fe(re.value+1),le()};e.watch(()=>n.model,l=>{if(se(),l){he(l);return}ge()},{immediate:!0});const ue=l=>{var o,y;const t=new s.Mesh(l.geometry.clone(),l.material);return t.name="managed_pipe_clone",(y=(o=l==null?void 0:l.parent)==null?void 0:o.add)==null||y.call(o,t),t.position.copy(l.position),t.rotation.copy(l.rotation),t.scale.copy(l.scale),t};e.watch([M,R,S,re],([l,t])=>{if(se(),n.model&&l){const o=Y.getMeshFromJoint(n.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=ue(o);if(u.value===O.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,u.value===O.robotMode.DOUBLE){const N=ue(o);T.value=N}I(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const Ve=async()=>{if($.value.length===0){A.ElMessage.warning("没有可导出的表头");return}const l=$.value.join(" ");try{await navigator.clipboard.writeText(l),A.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),A.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!r.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as Ee, ref as b, watch as se, shallowRef as ve, computed as _e, onUnmounted as et, resolveComponent as O, createElementBlock as we, openBlock as le, createElementVNode as n, createVNode as o, withCtx as T, createBlock as Ce, createCommentVNode as ye, unref as S, toDisplayString as me, nextTick as Ie, onMounted as We, onBeforeUnmount as Ke, Fragment as tt, renderList as lt, withDirectives as W, vShow as re, renderSlot as De, isRef as Re, vModelRadio as Te } from "vue";
2
- import { r as Me, U as ot, s as je, u as at, a as nt, W as st } from "./workpieceTreePanel-1eij5wwB.js";
2
+ import { r as Me, U as ot, s as je, u as at, a as nt, W as st } from "./workpieceTreePanel-BiQ4O4B7.js";
3
3
  import { u as qe, a as it, b as rt } from "./iconfont-BWe7Nfzi.js";
4
4
  import { a9 as ut, c as ct, E, aM as pt, ao as dt } from "./index-CA0SFykF.js";
5
5
  import { t as Ve, T as ke, V as z, r as q, s as mt, u as vt, k as Se, v as ft, L as gt, w as ht, x as bt, y as yt, z as _t, F as wt, I as Ct, p as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-dK7WSb7x.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-mHz69z2I.js";
7
7
  import "./index-BHtNKL1L.js";
8
8
  import { _ as ue, s as Pt } from "./index-CQpoN-3d.js";
9
- import "./index.vue_vue_type_style_index_1_lang-BFSnWFIG.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-Cgm8Cuer.js";
10
10
  import { m as K, g as xt, a as Dt, b as Rt, c as Tt } from "./robotUtil-BBWei-8I.js";
11
11
  import "./index-1nURBe5J.js";
12
12
  import { f as Mt, a as Vt } from "./animationData-DhYJn422.js";
@@ -1,17 +1,17 @@
1
1
  import { nextTick as oe, pushScopeId as pt, popScopeId as yt, withScopeId as bt, createBlock as ie, openBlock as j, markRaw as gt, shallowReactive as _t, resolveComponent as q, resolveDirective as wt, withDirectives as K, createElementBlock as X, normalizeClass as ge, createCommentVNode as Z, createVNode as w, renderSlot as Q, resolveDynamicComponent as Oe, normalizeStyle as St, withCtx as ee, Fragment as zt, renderList as xt, mergeProps as $t, toHandlers as kt, defineComponent as xe, ref as O, watch as te, unref as x, createElementVNode as d, toDisplayString as R, computed as J, onBeforeUnmount as Ne, inject as Ve, shallowRef as ue, onMounted as It, vShow as ne, isRef as ce, vModelRadio as de } from "vue";
2
2
  import { aD as Tt } from "./index.vue_vue_type_style_index_1_lang-mHz69z2I.js";
3
- import { s as Ae, u as Ct, a as Pt, U as Ot, W as Vt } from "./workpieceTreePanel-1eij5wwB.js";
3
+ import { s as Ae, u as Ct, a as Pt, U as Ot, W as Vt } from "./workpieceTreePanel-BiQ4O4B7.js";
4
4
  import { d as At, u as Mt, a as jt, b as Dt } from "./iconfont-BWe7Nfzi.js";
5
5
  import { E as he } from "./index-CA0SFykF.js";
6
6
  import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- import { b as Nt, c as Rt } from "./threeViewerHost-BoBcYLbp.js";
7
+ import { b as Nt, c as Rt } from "./threeViewerHost-B3D4LzMe.js";
8
8
  import { b as Ft } from "./pointTrack-OW2YnqMW.js";
9
9
  import { d as Ut, e as Lt } from "./robotUtil-BBWei-8I.js";
10
10
  import { V as Bt, s as Me } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-dK7WSb7x.js";
11
11
  import { U as Et, J as Ht } from "./urdfTree-D61izB0a.js";
12
12
  import { T as N } from "./svgIcon-D-_fXUBL.js";
13
13
  import { O as Wt } from "./PCDLoader-C8b_2UPa.js";
14
- import { K as Kt, j as Jt } from "./index-BX8rwlid.js";
14
+ import { K as Kt, j as Jt } from "./index-CMpTpds8.js";
15
15
  const Xt = async (e) => await new Wt().loadAsync(e);
16
16
  function Gt() {
17
17
  var e = window.navigator.userAgent, t = e.indexOf("MSIE ");
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ye=require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs"),L=require("./workpieceTreePanel-B55jmeoM.cjs"),X=require("./iconfont-Dt1tG-V3.cjs"),Y=require("./index-CEwxrYB-.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=require("./threeViewerHost-B2o6xcaT.cjs"),Ze=require("./pointTrack-BSTAE8yf.cjs"),be=require("./robotUtil-BC48-1Tl.cjs"),te=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs"),me=require("./urdfTree-DY8slOyJ.cjs"),P=require("./svgIcon-CUM54R6L.cjs"),Qe=require("./PCDLoader-BEqF0xND.cjs"),he=require("./index-B-NCl3gS.cjs"),et=async t=>await new Qe.OBJLoader().loadAsync(t);function tt(){var t=window.navigator.userAgent,i=t.indexOf("MSIE ");if(i>0)return parseInt(t.substring(i+5,t.indexOf(".",i)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var o=t.indexOf("Edge/");return o>0?parseInt(t.substring(o+5,t.indexOf(".",o)),10):-1}let G;function ne(){ne.init||(ne.init=!0,G=tt()!==-1)}var Z={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ne(),e.nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",G&&this.$el.appendChild(t),t.data="about:blank",G||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!G&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const it=e.withScopeId("data-v-b329ee4c");e.pushScopeId("data-v-b329ee4c");const nt={class:"resize-observer",tabindex:"-1"};e.popScopeId();const ot=it((t,i,n,r,o,u)=>(e.openBlock(),e.createBlock("div",nt)));Z.render=ot;Z.__scopeId="data-v-b329ee4c";Z.__file="src/components/ResizeObserver.vue";function J(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?J=function(i){return typeof i}:J=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},J(t)}function st(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function rt(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lt(t,i,n){return i&&rt(t.prototype,i),t}function ve(t){return at(t)||ct(t)||ut(t)||dt()}function at(t){if(Array.isArray(t))return oe(t)}function ct(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ut(t,i){if(t){if(typeof t=="string")return oe(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(t,i)}}function oe(t,i){(i==null||i>t.length)&&(i=t.length);for(var n=0,r=new Array(i);n<i;n++)r[n]=t[n];return r}function dt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),Ye=require("./index.vue_vue_type_style_index_1_lang-CrR96PnG.cjs"),L=require("./workpieceTreePanel-BLf_clDa.cjs"),X=require("./iconfont-Dt1tG-V3.cjs"),Y=require("./index-CEwxrYB-.cjs"),le=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=require("./threeViewerHost-DyPs12hY.cjs"),Ze=require("./pointTrack-BSTAE8yf.cjs"),be=require("./robotUtil-BC48-1Tl.cjs"),te=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs"),me=require("./urdfTree-DY8slOyJ.cjs"),P=require("./svgIcon-CUM54R6L.cjs"),Qe=require("./PCDLoader-BEqF0xND.cjs"),he=require("./index-Bq-dJJvd.cjs"),et=async t=>await new Qe.OBJLoader().loadAsync(t);function tt(){var t=window.navigator.userAgent,i=t.indexOf("MSIE ");if(i>0)return parseInt(t.substring(i+5,t.indexOf(".",i)),10);var n=t.indexOf("Trident/");if(n>0){var r=t.indexOf("rv:");return parseInt(t.substring(r+3,t.indexOf(".",r)),10)}var o=t.indexOf("Edge/");return o>0?parseInt(t.substring(o+5,t.indexOf(".",o)),10):-1}let G;function ne(){ne.init||(ne.init=!0,G=tt()!==-1)}var Z={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},emits:["notify"],mounted(){ne(),e.nextTick(()=>{this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitOnMount&&this.emitSize()});const t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",G&&this.$el.appendChild(t),t.data="about:blank",G||this.$el.appendChild(t)},beforeUnmount(){this.removeResizeHandlers()},methods:{compareAndNotify(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers(){this._resizeObject&&this._resizeObject.onload&&(!G&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};const it=e.withScopeId("data-v-b329ee4c");e.pushScopeId("data-v-b329ee4c");const nt={class:"resize-observer",tabindex:"-1"};e.popScopeId();const ot=it((t,i,n,r,o,u)=>(e.openBlock(),e.createBlock("div",nt)));Z.render=ot;Z.__scopeId="data-v-b329ee4c";Z.__file="src/components/ResizeObserver.vue";function J(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?J=function(i){return typeof i}:J=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},J(t)}function st(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}function rt(t,i){for(var n=0;n<i.length;n++){var r=i[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function lt(t,i,n){return i&&rt(t.prototype,i),t}function ve(t){return at(t)||ct(t)||ut(t)||dt()}function at(t){if(Array.isArray(t))return oe(t)}function ct(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function ut(t,i){if(t){if(typeof t=="string")return oe(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return oe(t,i)}}function oe(t,i){(i==null||i>t.length)&&(i=t.length);for(var n=0,r=new Array(i);n<i;n++)r[n]=t[n];return r}function dt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ft(t){var i;return typeof t=="function"?i={callback:t}:i=t,i}function mt(t,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r,o,u,a=function(f){for(var b=arguments.length,S=new Array(b>1?b-1:0),I=1;I<b;I++)S[I-1]=arguments[I];if(u=S,!(r&&f===o)){var $=n.leading;typeof $=="function"&&($=$(f,o)),(!r||f!==o)&&$&&t.apply(void 0,[f].concat(ve(u))),o=f,clearTimeout(r),r=setTimeout(function(){t.apply(void 0,[f].concat(ve(u))),r=0},i)}};return a._clear=function(){clearTimeout(r),r=null},a}function ge(t,i){if(t===i)return!0;if(J(t)==="object"){for(var n in t)if(!ge(t[n],i[n]))return!1;return!0}return!1}var ht=function(){function t(i,n,r){st(this,t),this.el=i,this.observer=null,this.frozen=!1,this.createObserver(n,r)}return lt(t,[{key:"createObserver",value:function(n,r){var o=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=ft(n),this.callback=function(p,f){o.options.callback(p,f),p&&o.options.once&&(o.frozen=!0,o.destroyObserver())},this.callback&&this.options.throttle){var u=this.options.throttleOptions||{},a=u.leading;this.callback=mt(this.callback,this.options.throttle,{leading:function(f){return a==="both"||a==="visible"&&f||a==="hidden"&&!f}})}this.oldResult=void 0,this.observer=new IntersectionObserver(function(p){var f=p[0];if(p.length>1){var b=p.find(function(I){return I.isIntersecting});b&&(f=b)}if(o.callback){var S=f.isIntersecting&&f.intersectionRatio>=o.threshold;if(S===o.oldResult)return;o.oldResult=S,o.callback(S,f)}},this.options.intersection),e.nextTick(function(){o.observer&&o.observer.observe(o.el)})}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&typeof this.options.intersection.threshold=="number"?this.options.intersection.threshold:0}}]),t}();function _e(t,i,n){var r=i.value;if(r)if(typeof IntersectionObserver>"u")console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var o=new ht(t,r,n);t._vue_visibilityState=o}}function vt(t,i,n){var r=i.value,o=i.oldValue;if(!ge(r,o)){var u=t._vue_visibilityState;if(!r){we(t);return}u?u.createObserver(r,n):_e(t,{value:r},n)}}function we(t){var i=t._vue_visibilityState;i&&(i.destroyObserver(),delete t._vue_visibilityState)}var pt={beforeMount:_e,updated:vt,unmounted:we},yt={itemsLimit:1e3},bt=/(auto|scroll)/;function Se(t,i){return t.parentNode===null?i:Se(t.parentNode,i.concat([t]))}var ie=function(i,n){return getComputedStyle(i,null).getPropertyValue(n)},gt=function(i){return ie(i,"overflow")+ie(i,"overflow-y")+ie(i,"overflow-x")},_t=function(i){return bt.test(gt(i))};function pe(t){if(t instanceof HTMLElement||t instanceof SVGElement){for(var i=Se(t.parentNode,[]),n=0;n<i.length;n+=1)if(_t(i[n]))return i[n];return document.scrollingElement||document.documentElement}}function se(t){"@babel/helpers - typeof";return se=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},se(t)}var wt={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(i){return["vertical","horizontal"].includes(i)}},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"}};function St(){return this.items.length&&se(this.items[0])!=="object"}var re=!1;if(typeof window<"u"){re=!1;try{var Vt=Object.defineProperty({},"passive",{get:function(){re=!0}});window.addEventListener("test",null,Vt)}catch{}}let xt=0;var ae={name:"RecycleScroller",components:{ResizeObserver:Z},directives:{ObserveVisibility:pt},props:{...wt,itemSize:{type:Number,default:null},gridItems:{type:Number,default:void 0},itemSecondarySize:{type:Number,default:void 0},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},updateInterval:{type:Number,default:0},skipHover:{type:Boolean,default:!1},listTag:{type:String,default:"div"},itemTag:{type:String,default:"div"},listClass:{type:[String,Object,Array],default:""},itemClass:{type:[String,Object,Array],default:""}},emits:["resize","visible","hidden","update","scroll-start","scroll-end"],data(){return{pool:[],totalSize:0,ready:!1,hoverKey:null}},computed:{sizes(){if(this.itemSize===null){const t={"-1":{accumulator:0}},i=this.items,n=this.sizeField,r=this.minItemSize;let o=1e4,u=0,a;for(let p=0,f=i.length;p<f;p++)a=i[p][n]||r,a<o&&(o=a),u+=a,t[p]={accumulator:u,size:a};return this.$_computedMinItemSize=o,t}return[]},simpleArray:St,itemIndexByKey(){const{keyField:t,items:i}=this,n={};for(let r=0,o=i.length;r<o;r++)n[i[r][t]]=r;return n}},watch:{items(){this.updateVisibleItems(!0)},pageMode(){this.applyPageMode(),this.updateVisibleItems(!1)},sizes:{handler(){this.updateVisibleItems(!1)},deep:!0},gridItems(){this.updateVisibleItems(!0)},itemSecondarySize(){this.updateVisibleItems(!0)}},created(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1)),this.gridItems&&!this.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems")},mounted(){this.applyPageMode(),this.$nextTick(()=>{this.$_prerender=!1,this.updateVisibleItems(!0),this.ready=!0})},activated(){const t=this.$_lastUpdateScrollPosition;typeof t=="number"&&this.$nextTick(()=>{this.scrollToPosition(t)})},beforeUnmount(){this.removeListeners()},methods:{addView(t,i,n,r,o){const u=e.markRaw({id:xt++,index:i,used:!0,key:r,type:o}),a=e.shallowReactive({item:n,position:0,nr:u});return t.push(a),a},unuseView(t,i=!1){const n=this.$_unusedViews,r=t.nr.type;let o=n.get(r);o||(o=[],n.set(r,o)),o.push(t),i||(t.nr.used=!1,t.position=-9999)},handleResize(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll(t){if(!this.$_scrollDirty){if(this.$_scrollDirty=!0,this.$_updateTimeout)return;const i=()=>requestAnimationFrame(()=>{this.$_scrollDirty=!1;const{continuous:n}=this.updateVisibleItems(!1,!0);n||(clearTimeout(this.$_refreshTimout),this.$_refreshTimout=setTimeout(this.handleScroll,this.updateInterval+100))});i(),this.updateInterval&&(this.$_updateTimeout=setTimeout(()=>{this.$_updateTimeout=0,this.$_scrollDirty&&i()},this.updateInterval))}},handleVisibilityChange(t,i){this.ready&&(t||i.boundingClientRect.width!==0||i.boundingClientRect.height!==0?(this.$emit("visible"),requestAnimationFrame(()=>{this.updateVisibleItems(!1)})):this.$emit("hidden"))},updateVisibleItems(t,i=!1){const n=this.itemSize,r=this.gridItems||1,o=this.itemSecondarySize||n,u=this.$_computedMinItemSize,a=this.typeField,p=this.simpleArray?null:this.keyField,f=this.items,b=f.length,S=this.sizes,I=this.$_views,$=this.$_unusedViews,M=this.pool,O=this.itemIndexByKey;let w,_,T,E,x;if(!b)w=_=E=x=T=0;else if(this.$_prerender)w=E=0,_=x=Math.min(this.prerender,f.length),T=null;else{const v=this.getScroll();if(i){let m=v.start-this.$_lastUpdateScrollPosition;if(m<0&&(m=-m),n===null&&m<u||m<n)return{continuous:!0}}this.$_lastUpdateScrollPosition=v.start;const d=this.buffer;v.start-=d,v.end+=d;let c=0;if(this.$refs.before&&(c=this.$refs.before.scrollHeight,v.start-=c),this.$refs.after){const m=this.$refs.after.scrollHeight;v.end+=m}if(n===null){let m,g=0,B=b-1,z=~~(b/2),U;do U=z,m=S[z].accumulator,m<v.start?g=z:z<b-1&&S[z+1].accumulator>v.start&&(B=z),z=~~((g+B)/2);while(z!==U);for(z<0&&(z=0),w=z,T=S[b-1].accumulator,_=z;_<b&&S[_].accumulator<v.end;_++);for(_===-1?_=f.length-1:(_++,_>b&&(_=b)),E=w;E<b&&c+S[E].accumulator<v.start;E++);for(x=E;x<b&&c+S[x].accumulator<v.end;x++);}else{w=~~(v.start/n*r);const m=w%r;w-=m,_=Math.ceil(v.end/n*r),E=Math.max(0,Math.floor((v.start-c)/n*r)),x=Math.floor((v.end-c)/n*r),w<0&&(w=0),_>b&&(_=b),E<0&&(E=0),x>b&&(x=b),T=Math.ceil(b/r)*n}}_-w>yt.itemsLimit&&this.itemsLimitError(),this.totalSize=T;let h;const V=w<=this.$_endIndex&&_>=this.$_startIndex;if(V)for(let v=0,d=M.length;v<d;v++)h=M[v],h.nr.used&&(t&&(h.nr.index=O[h.item[p]]),(h.nr.index==null||h.nr.index<w||h.nr.index>=_)&&this.unuseView(h));const j=V?null:new Map;let N,k,D;for(let v=w;v<_;v++){N=f[v];const d=p?N[p]:N;if(d==null)throw new Error(`Key is ${d} on item (keyField is '${p}')`);if(h=I.get(d),!n&&!S[v].size){h&&this.unuseView(h);continue}k=N[a];let c=$.get(k),m=!1;if(!h)V?c&&c.length?h=c.pop():h=this.addView(M,v,N,d,k):(D=j.get(k)||0,(!c||D>=c.length)&&(h=this.addView(M,v,N,d,k),this.unuseView(h,!0),c=$.get(k)),h=c[D],j.set(k,D+1)),I.delete(h.nr.key),h.nr.used=!0,h.nr.index=v,h.nr.key=d,h.nr.type=k,I.set(d,h),m=!0;else if(!h.nr.used&&(h.nr.used=!0,m=!0,c)){const g=c.indexOf(h);g!==-1&&c.splice(g,1)}h.item=N,m&&(v===f.length-1&&this.$emit("scroll-end"),v===0&&this.$emit("scroll-start")),n===null?(h.position=S[v-1].accumulator,h.offset=0):(h.position=Math.floor(v/r)*n,h.offset=v%r*o)}return this.$_startIndex=w,this.$_endIndex=_,this.emitUpdate&&this.$emit("update",w,_,E,x),clearTimeout(this.$_sortTimer),this.$_sortTimer=setTimeout(this.sortViews,this.updateInterval+300),{continuous:V}},getListenerTarget(){let t=pe(this.$el);return window.document&&(t===window.document.documentElement||t===window.document.body)&&(t=window),t},getScroll(){const{$el:t,direction:i}=this,n=i==="vertical";let r;if(this.pageMode){const o=t.getBoundingClientRect(),u=n?o.height:o.width;let a=-(n?o.top:o.left),p=n?window.innerHeight:window.innerWidth;a<0&&(p+=a,a=0),a+p>u&&(p=u-a),r={start:a,end:a+p}}else n?r={start:t.scrollTop,end:t.scrollTop+t.clientHeight}:r={start:t.scrollLeft,end:t.scrollLeft+t.clientWidth};return r},applyPageMode(){this.pageMode?this.addListeners():this.removeListeners()},addListeners(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,re?{passive:!0}:!1),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem(t){let i;const n=this.gridItems||1;this.itemSize===null?i=t>0?this.sizes[t-1].accumulator:0:i=Math.floor(t/n)*this.itemSize,this.scrollToPosition(i)},scrollToPosition(t){const i=this.direction==="vertical"?{scroll:"scrollTop",start:"top"}:{scroll:"scrollLeft",start:"left"};let n,r,o;if(this.pageMode){const u=pe(this.$el),a=u.tagName==="HTML"?0:u[i.scroll],p=u.getBoundingClientRect(),b=this.$el.getBoundingClientRect()[i.start]-p[i.start];n=u,r=i.scroll,o=t+a+b}else n=this.$el,r=i.scroll,o=t;n[r]=o},itemsLimitError(){throw setTimeout(()=>{console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",this.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")},sortViews(){this.pool.sort((t,i)=>t.nr.index-i.nr.index)}}};const Nt={key:0,ref:"before",class:"vue-recycle-scroller__slot"},kt={key:1,ref:"after",class:"vue-recycle-scroller__slot"};function zt(t,i,n,r,o,u){const a=e.resolveComponent("ResizeObserver"),p=e.resolveDirective("observe-visibility");return e.withDirectives((e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["vue-recycle-scroller",{ready:o.ready,"page-mode":n.pageMode,[`direction-${t.direction}`]:!0}]),onScrollPassive:i[0]||(i[0]=(...f)=>u.handleScroll&&u.handleScroll(...f))},[t.$slots.before?(e.openBlock(),e.createElementBlock("div",Nt,[e.renderSlot(t.$slots,"before")],512)):e.createCommentVNode("v-if",!0),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.listTag),{ref:"wrapper",style:e.normalizeStyle({[t.direction==="vertical"?"minHeight":"minWidth"]:o.totalSize+"px"}),class:e.normalizeClass(["vue-recycle-scroller__item-wrapper",n.listClass])},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.pool,f=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.itemTag),e.mergeProps({key:f.nr.id,style:o.ready?{transform:`translate${t.direction==="vertical"?"Y":"X"}(${f.position}px) translate${t.direction==="vertical"?"X":"Y"}(${f.offset}px)`,width:n.gridItems?`${t.direction==="vertical"&&n.itemSecondarySize||n.itemSize}px`:void 0,height:n.gridItems?`${t.direction==="horizontal"&&n.itemSecondarySize||n.itemSize}px`:void 0}:null,class:["vue-recycle-scroller__item-view",[n.itemClass,{hover:!n.skipHover&&o.hoverKey===f.nr.key}]]},e.toHandlers(n.skipHover?{}:{mouseenter:()=>{o.hoverKey=f.nr.key},mouseleave:()=>{o.hoverKey=null}})),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default",{item:f.item,index:f.nr.index,active:f.nr.used})]),_:2},1040,["style","class"]))),128)),e.renderSlot(t.$slots,"empty")]),_:3},8,["style","class"])),t.$slots.after?(e.openBlock(),e.createElementBlock("div",kt,[e.renderSlot(t.$slots,"after")],512)):e.createCommentVNode("v-if",!0),e.createVNode(a,{onNotify:u.handleResize},null,8,["onNotify"])],34)),[[p,u.handleVisibilityChange]])}ae.render=zt;ae.__file="src/components/RecycleScroller.vue";const Ct=["title"],It=["title"],Tt=["title"],Et=["title"],$t=["title"],Pt=["title"],Mt=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(t){const i=t,n=e.ref();function r(o){e.nextTick(()=>{var a;const u=i.list.findIndex(p=>p.id===o);u>-1&&((a=n.value)==null||a.scrollToItem(u,"center"))})}return e.watch(()=>i.currentId,r,{immediate:!0}),(o,u)=>(e.openBlock(),e.createBlock(e.unref(ae),{class:"scroller",ref_key:"scrollerRef",ref:n,items:o.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:a,index:p})=>{var f,b,S,I,$,M,O,w,_,T;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:a.id===o.currentId})},[e.createElementVNode("div",{class:"line-number",title:p+1}," 行号:"+e.toDisplayString(p+1),9,Ct),e.createElementVNode("div",{title:(f=a.x)==null?void 0:f.toFixed(5)}," X:"+e.toDisplayString((b=a.x)==null?void 0:b.toFixed(5)),9,It),e.createElementVNode("div",{title:(S=a.y)==null?void 0:S.toFixed(5)}," Y:"+e.toDisplayString((I=a.y)==null?void 0:I.toFixed(5)),9,Tt),e.createElementVNode("div",{title:($=a.z)==null?void 0:$.toFixed(5)}," Z:"+e.toDisplayString((M=a.z)==null?void 0:M.toFixed(5)),9,Et),e.createElementVNode("div",{title:(O=a.b_axis)==null?void 0:O.toFixed(5)}," B轴:"+e.toDisplayString((w=a.b_axis)==null?void 0:w.toFixed(5)),9,$t),e.createElementVNode("div",{title:(_=a.c_axis)==null?void 0:_.toFixed(5)}," C轴:"+e.toDisplayString((T=a.c_axis)==null?void 0:T.toFixed(5)),9,Pt)],2)]}),_:1},8,["items"]))}}),Ot=le._export_sfc(Mt,[["__scopeId","data-v-8e680d0f"]]);function Dt(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function Bt(t){const i=Ze.getPointGeometry(t);return i&&(i.material.sizeAttenuation=!1),i}async function At(t){return await ye.downloadFile(t)}async function Rt(t){return await ye.readCsv(t)}async function jt(t){const i=await At(t);return(await Rt(i)).map(o=>{const u=Dt();return u.x_axis=o.X_Axis,u.y_axis=o.Y_Axis,u.z_axis=o.Z_Axis,u.b_axis=o.B_Axis,u.c_axis=o.C_Axis,u.x=o.X,u.y=o.Y,u.z=o.Z,u})}const Ut={class:"panel-content"},Ft={class:"animation-controls"},Lt={class:"control-row"},Ht={class:"control-row"},qt={class:"frame-info"},Wt={class:"control-row"},Kt={class:"scroller-row"},Xt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(t,{expose:i,emit:n}){const r=t,o=e.computed(()=>(r.animationData||[]).map((c,m)=>({...c,id:m}))),u=e.ref(!1),a=e.ref(0),p=e.ref(100);let f=!1;const b={bladeAxis:"叶片模型位置"},S=e.ref(null),I=d=>{if(d<0||d>=o.value.length)return null;const c=be.getObjectWorldMatrix(r.robot,b.bladeAxis);if(!c)return null;const m=o.value[d];return new te.Vector3(m.x,m.y,m.z).applyMatrix4(c)},$=(d,c)=>{d&&d.setJointValues(c)},M=(d,c,m,g,B)=>{const z={B_Axis:te.MathUtils.degToRad(g),C_Axis:te.MathUtils.degToRad(B),X_Axis:d,Y_Axis:c,Z_Axis:m};$(r.robot,z)},O=()=>{const d=r.scene;if(!d)return;const c=[];d.traverse(m=>{m.name==="TrajectoryPoints"&&c.push(m)}),c.forEach(m=>{d.remove(m),X.disposeObj(m)})},w=d=>{const c=[];for(let m=0;m<=d;m++){const g=I(m);g&&c.push(g.x,g.y,g.z)}return c},_=d=>{const c=Bt(d);if(c)return c.name="TrajectoryPoints",S.value=c,c},T=d=>{O();const c=w(d),m=_(c);r.scene&&m&&r.scene.add(m)},E=d=>`第 ${d+1} 帧`,x=d=>{if(d<0||d>=o.value.length){console.error(`帧索引 ${d} 超出范围`);return}const c=o.value[d];a.value=d,M(c.x_axis,c.y_axis,c.z_axis,c.b_axis,c.c_axis);const m=r.scene;m&&m.updateMatrixWorld(!0),T(d)},h=async()=>{if(o.value.length===0){Y.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!u.value){u.value=!0,f=!1,o.value.length-1===a.value&&(a.value=0);try{for(let d=a.value+1;d<o.value.length&&!f;d++)await new Promise(c=>setTimeout(c,p.value)),x(d);f||Y.ElMessage.success("动画播放完成")}catch(d){console.error("动画播放出错:",d)}finally{u.value=!1}}},V=async()=>{u.value&&(f=!0,await new Promise(d=>{const c=e.watch(()=>u.value,m=>{c(),d()})}))},j=async d=>{u.value&&await V(),x(d)},N=async()=>{u.value&&await V(),!(a.value+1>=o.value.length)&&x(a.value+1)},k=async()=>{u.value&&await V(),a.value!==0&&x(a.value-1)},D=()=>{a.value=0},v=async()=>{await V(),O(),D()};return e.onBeforeUnmount(()=>{v()}),i({playAnimation:h,stopAnimation:V,forwardFrame:N,backwardFrame:k,resetAnimationFrame:D,reset:v}),(d,c)=>{const m=e.resolveComponent("el-input-number"),g=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),z=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",Ut,[e.createElementVNode("div",Ft,[e.createElementVNode("div",Lt,[e.createVNode(B,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(g,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(m,{modelValue:p.value,"onUpdate:modelValue":c[0]||(c[0]=U=>p.value=U),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",Ht,[c[2]||(c[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",qt,e.toDisplayString(a.value+1)+" / "+e.toDisplayString(o.value.length),1)]),e.createElementVNode("div",Wt,[c[3]||(c[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(z,{class:"slider",modelValue:a.value,"onUpdate:modelValue":c[1]||(c[1]=U=>a.value=U),min:0,max:o.value.length>0?o.value.length-1:0,step:1,"format-tooltip":E,onInput:j,disabled:o.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Kt,[e.createVNode(Ot,{class:"scroller",list:o.value,"current-id":a.value},null,8,["list","current-id"])])])])}}}),Gt=le._export_sfc(Xt,[["__scopeId","data-v-6d08edd9"]]),Jt=async t=>await et(t),Yt={class:"obj-viewer-container"},Zt={class:"buttonGroup-topLeft"},Qt={class:"buttonGroup-left"},ei={class:"buttonGroup-right"},ti={class:"buttonGroup-bottom"},ii={class:"left-panel"},ni={class:"panel-header"},oi={class:"panel-body"},si={key:1,class:"clipping-content"},ri={class:"radio-group"},li={class:"radio-label"},ai={class:"radio-label"},ci={class:"radio-label"},ui={class:"radio-label"},di={class:"right-panel"},fi={class:"panel-header"},mi={class:"panel-body"},hi={key:0,class:"loading-overlay"},vi={key:1,class:"brand"},pi={class:"brand-item"},yi={class:"item-value"},bi={class:"brand-item"},gi={class:"item-value"},_i={class:"brand-item"},wi={class:"item-value"},Si=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(t){const i=t,n=e.inject("setManagementPageTitle"),r=e.inject("setManagementPageVisible"),o=e.computed(()=>{var s,y;return(y=(s=i==null?void 0:i.threeData)==null?void 0:s.data)==null?void 0:y.machine}),u=e.computed(()=>{var s;return(s=o==null?void 0:o.value)==null?void 0:s.产品型号}),a=e.computed(()=>{var s;return(s=o==null?void 0:o.value)==null?void 0:s.编号}),p=e.computed(()=>{var s;return(s=o==null?void 0:o.value)==null?void 0:s.厂家}),f=e.computed(()=>{var s,y;return(y=(s=i==null?void 0:i.threeData)==null?void 0:s.data)==null?void 0:y.workpieceInfo}),b=e.computed(()=>{var s,y;return(y=(s=i==null?void 0:i.threeData)==null?void 0:s.data)==null?void 0:y.knife}),S=e.ref([]),I=async l=>{!l||!l.isExtra||(await $(l),n==null||n(l==null?void 0:l.pageName),r==null||r(!0))},$=he.debounce(async l=>{await he.onPageBack();const{mainKey:s,baseMenuPath:y}=l||{};Ye.copyAdd(y,s)},500);e.watch(()=>[u.value,f.value,b.value],()=>{var R,C,de,fe;const l=[],s={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};u.value&&s.children.push({isExtra:!0,pageName:"机床",mainKey:u.value,label:u.value,baseMenuPath:"设备库/机床"});const y={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};f.value&&y.children.push({isExtra:!0,type:(R=f.value)==null?void 0:R.type,pageName:"工件",mainKey:(C=f.value)==null?void 0:C.name,label:(de=f.value)==null?void 0:de.name,baseMenuPath:`工件库/${(fe=f.value)==null?void 0:fe.type}`});const K={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};b.value&&K.children.push({isExtra:!0,pageName:"刀具",mainKey:b.value,label:b.value,baseMenuPath:"设备库/刀具"}),l.push(s,y,K),S.value=l},{immediate:!0});const M=e.ref([]),O=e.computed(()=>{var s,y;return(y=(s=i==null?void 0:i.threeData)==null?void 0:s.data)==null?void 0:y.csvUrl});e.watch(()=>O.value,async()=>{if(console.log("three data",i==null?void 0:i.threeData),console.log("csvUrl",O.value),O.value){const l=await jt(O.value);M.value=l}},{immediate:!0});const w=e.computed(()=>{var s,y;return(y=(s=i==null?void 0:i.threeData)==null?void 0:s.data)==null?void 0:y.bladeObjUrl}),_=e.ref(L.sceneType.ROBOT),T=e.ref(null),E=e.ref(!1),x=e.ref(""),h=e.ref(!1),V=e.ref(""),j=e.ref(!1),N=e.ref(""),k=e.shallowRef(null),D=e.ref(null),v=e.ref("叶片模型"),d=e.shallowRef(null),c=e.shallowRef(null),m=e.shallowRef(null),g=e.ref(),{currentModels:B,resetView:z,initThreeJS:U,handleResize:Ve,getThreeJSObjects:H,cleanup:xe,setModels:ce,axesHelperVisible:Ne,toggleAxesVisibility:ke,zoomIn:ze,zoomOut:Ce}=X.useThreeJS(T),{loadSceneFromFile:Ie}=L.useUrdfLoader(H,B,E,x),{isAnimating:ue,toggleAnimation:Te,stopAnimation:Ee}=X.useAnimation(H,B),{isClipping:$e,activeClippingAxis:A,toggleClipping:Pe,updateClippingPlanes:F}=X.useClipping(H,B),{initRaycaster:Me,selectedObject3D:Oe,setSelectedObjVisible:De,updatePosition:Be,updateRotation:Ae,dispose:Re}=L.useRaycaster(T,H,B),je=()=>{ke()},Ue=e.computed(()=>_.value===L.sceneType.ROBOT),q=l=>{h.value=!0,V.value=l,l==="剖面视图"&&!$e.value&&Pe()},Q=l=>{j.value=!0,N.value=l},Fe=()=>{var l;(l=g==null?void 0:g.value)==null||l.playAnimation()},Le=()=>{var l;(l=g==null?void 0:g.value)==null||l.stopAnimation()},He=()=>{var l;(l=g==null?void 0:g.value)==null||l.forwardFrame()},qe=()=>{var l;(l=g==null?void 0:g.value)==null||l.backwardFrame()},ee=()=>{var l;(l=g==null?void 0:g.value)==null||l.reset()},We=()=>{ee(),z(),D.value&&D.value.resetToZero()},Ke=(l,s)=>be.getMeshFromLink(l,s),Xe=async l=>{const s=Ke(l,v.value);if(c.value=s,console.log("bladeObjUrl",w.value),s&&s.parent&&w.value){const y=await Jt(w.value);y.name="blade_clone",s.parent.add(y),y.position.copy(s.position),y.rotation.copy(s.rotation),y.scale.copy(s.scale),s.visible=!1,d.value=y}else v.value&&console.warn(`在 Blade '${v.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>i.fileBlobs,l=>{if(l&&l.length>0){const s=l[0];if(!s.name.toLowerCase().endsWith(".urdf"))return;Ie(s).then(y=>{k.value=y,y&&Xe(y)}).catch(y=>{console.error("加载URDF文件时发生错误:",y),Y.ElMessage.error("加载urdf模型失败"),k.value=null})}else k.value=null},{immediate:!0,deep:!0}),e.watch(k,l=>{ee(),l?(ce([l]),D.value=new L.URDFRobotController(l)):(ce([]),D.value=null),Me()});let W=null;const Ge=()=>{U(),e.nextTick(()=>{T.value&&(W=new ResizeObserver(Ve),W.observe(T.value))});const l=H();m.value=l.scene},Je=()=>{V.value="",N.value="",W&&W.disconnect(),ue.value&&Ee(),ee(),xe(),Re()};return e.onMounted(async()=>{await e.nextTick();try{Ge()}catch(l){console.error("Three.js 初始化失败:",l),Y.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Je()}),(l,s)=>{const y=e.resolveComponent("el-scrollbar"),K=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",Yt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:T,class:"threejs-container"},null,512),[[e.vShow,Ue.value]]),e.createElementVNode("div",Zt,[e.createVNode(P.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:We,title:"重置"}),e.createVNode(P.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(ze)},null,8,["onClick"]),e.createVNode(P.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(Ce)},null,8,["onClick"]),e.createVNode(P.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(Te),title:e.unref(ue)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(P.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(Ne),onClick:je,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",Qt,[e.renderSlot(l.$slots,"button-left",{switchRightPanel:q},void 0,!0),e.createVNode(P.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:s[0]||(s[0]=R=>q("场景树")),active:h.value&&V.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(P.ThreeSvgIcon,{name:"clipping",size:"24",onClick:s[1]||(s[1]=R=>q("剖面视图")),active:h.value&&V.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(P.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",onClick:s[2]||(s[2]=R=>q("工件树")),active:h.value&&V.value==="工件树"},null,8,["active"])]),e.createElementVNode("div",ei,[e.renderSlot(l.$slots,"button-right",{switchRightPanel:Q},void 0,!0),e.createVNode(P.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:s[3]||(s[3]=R=>Q("机床控制")),active:j.value&&N.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(P.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:s[4]||(s[4]=R=>Q("轨迹路径")),active:j.value&&N.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",ti,[e.createVNode(P.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:qe}),e.createVNode(P.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Fe}),e.createVNode(P.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:He}),e.createVNode(P.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Le})]),e.withDirectives(e.createElementVNode("div",ii,[e.createElementVNode("div",ni,[e.createElementVNode("span",null,e.toDisplayString(V.value),1),e.createElementVNode("span",{class:"close",onClick:s[5]||(s[5]=R=>h.value=!1)}," X ")]),e.createElementVNode("div",oi,[e.createVNode(y,{height:"100%"},{default:e.withCtx(()=>{var R;return[V.value==="场景树"?(e.openBlock(),e.createBlock(me.UrdfTree,{key:0,model:k.value,extraNodes:S.value,onNodeClick:I},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),V.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",si,[e.createElementVNode("div",ri,[e.createElementVNode("label",li,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":s[6]||(s[6]=C=>e.isRef(A)?A.value=C:null),onChange:s[7]||(s[7]=(...C)=>e.unref(F)&&e.unref(F)(...C))},null,544),[[e.vModelRadio,e.unref(A)]]),s[15]||(s[15]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",ai,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":s[8]||(s[8]=C=>e.isRef(A)?A.value=C:null),onChange:s[9]||(s[9]=(...C)=>e.unref(F)&&e.unref(F)(...C))},null,544),[[e.vModelRadio,e.unref(A)]]),s[16]||(s[16]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",ci,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":s[10]||(s[10]=C=>e.isRef(A)?A.value=C:null),onChange:s[11]||(s[11]=(...C)=>e.unref(F)&&e.unref(F)(...C))},null,544),[[e.vModelRadio,e.unref(A)]]),s[17]||(s[17]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",ui,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":s[12]||(s[12]=C=>e.isRef(A)?A.value=C:null),onChange:s[13]||(s[13]=(...C)=>e.unref(F)&&e.unref(F)(...C))},null,544),[[e.vModelRadio,e.unref(A)]]),s[18]||(s[18]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),V.value==="工件树"?(e.openBlock(),e.createBlock(L.WorkpieceTreePanel,{key:2,model:(R=e.unref(Oe))==null?void 0:R.obj,onVisibleChange:e.unref(De),onUpdatePosition:e.unref(Be),onUpdateRotation:e.unref(Ae)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,h.value]]),e.withDirectives(e.createElementVNode("div",di,[e.createElementVNode("div",fi,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:s[14]||(s[14]=R=>j.value=!1)}," X ")]),e.createElementVNode("div",mi,[e.createVNode(y,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(me.JointPanel,{model:k.value},null,8,["model"]),[[e.vShow,N.value==="机床控制"]]),e.withDirectives(e.createVNode(Gt,{robot:k.value,scene:m.value,animationData:M.value,ref_key:"bladeTrackPanelRef",ref:g},null,8,["robot","scene","animationData"]),[[e.vShow,N.value==="轨迹路径"]]),e.renderSlot(l.$slots,"right-panel",{rightPanelType:N.value},void 0,!0)]),_:3})])],512),[[e.vShow,j.value]]),E.value?(e.openBlock(),e.createElementBlock("div",hi,[s[19]||(s[19]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(x.value),1)])):e.createCommentVNode("",!0),u.value?(e.openBlock(),e.createElementBlock("div",vi,[e.createElementVNode("div",pi,[s[20]||(s[20]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",yi,e.toDisplayString(p.value),1)]),e.createElementVNode("div",bi,[s[21]||(s[21]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",gi,e.toDisplayString(u.value),1)]),e.createElementVNode("div",_i,[s[22]||(s[22]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",wi,e.toDisplayString(a.value),1)])])):e.createCommentVNode("",!0),e.createVNode(K,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),Vi=le._export_sfc(Si,[["__scopeId","data-v-765cd801"]]);exports.default=Vi;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),S=require("./iconfont-Dt1tG-V3.cjs"),k=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DwX8qItu.cjs"),ge=require("./threeViewerHost-DyPs12hY.cjs"),j=require("./index-CEwxrYB-.cjs"),X=require("./urdfTree-DY8slOyJ.cjs"),W=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CUM54R6L.cjs"),$=require("./pointTrack-BSTAE8yf.cjs"),he=require("./isString-Cvx5mmsS.cjs");function Ve(m=.5,V=4){const w=new k.Mesh(new k.ConeGeometry(m,V,32),new k.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),c=w.geometry.parameters.height;return w.geometry.translate(0,-c/2,0),w.rotation.set(-90,0,0,"XYZ"),w}function we(m,V){m.position.copy(V)}function ye(m,V,w=new k.Color(16711680)){const c=new k.Vector3;V.getWorldPosition(c);const s=m.geometry.attributes.position,u=m.geometry.attributes.color,d=new k.Color(2003455);let n=1/0,f=-1;for(let a=0;a<s.count;a++){const i=new k.Vector3().fromBufferAttribute(s,a).distanceTo(c);i<n&&(n=i,f=a)}for(let a=0;a<u.count;a++)d.toArray(u.array,a*3);if(f!==-1){const a=w.toArray(),p=f*3+2;for(let i=0;i<p;i=i+3)u.array[i]=a[0],u.array[i+1]=a[1],u.array[i+2]=a[2]}u.needsUpdate=!0}function Y(m,V,w,c=new k.Color(16711680)){we(m,V),ye(w,m,c)}const ke={class:"panel-content"},Ne={class:"animation-controls"},Ce={class:"control-row"},be={class:"control-row"},_e={class:"frame-info"},Te={class:"control-row slider-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(m,{expose:V,emit:w}){const c=m,s=e.computed(()=>c.vectors),u=e.ref(!1),d=e.ref(0),n=e.ref(100);let f=!1;const a=r=>`第 ${r+1} 帧`,p=r=>{if(r<0||r>=s.value.length){console.error(`帧索引 ${r} 超出范围`);return}const v=s.value[r];d.value=r,Y(c.knife,v,c.cloud)},i=async()=>{if(s.value.length===0){j.ElMessage.error("无法播放动画:无数据");return}if(!u.value){u.value=!0,f=!1,s.value.length-1===d.value&&(d.value=0);try{for(let r=d.value+1;r<s.value.length&&!f;r++)await new Promise(v=>setTimeout(v,n.value)),p(r);f||j.ElMessage.success("动画播放完成")}catch(r){console.error("动画播放出错:",r)}finally{u.value=!1}}},N=async()=>{u.value&&(f=!0,await new Promise(r=>{const v=e.watch(()=>u.value,I=>{v(),r()})}),j.ElMessage.info("动画已停止"))},E=async r=>{u.value&&await N(),p(r)},A=async()=>{u.value&&await N(),!(d.value+1>=s.value.length)&&p(d.value+1)},M=async()=>{u.value&&await N(),d.value!==0&&p(d.value-1)},P=()=>{d.value=0};return V({playAnimation:i,stopAnimation:N,forwardFrame:A,backwardFrame:M,resetAnimationFrame:P,reset:async()=>{await N(),P()}}),(r,v)=>{const I=e.resolveComponent("el-input-number"),R=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),U=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ce,[e.createVNode(B,{"label-width":"80px",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(R,{label:"帧间隔:",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(I,{modelValue:n.value,"onUpdate:modelValue":v[0]||(v[0]=x=>n.value=x),min:0,max:5e3,step:10,style:{width:"100%"},size:"small"},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",be,[v[2]||(v[2]=e.createElementVNode("label",{class:"row-label"},"当前帧:",-1)),e.createElementVNode("span",_e,e.toDisplayString(d.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",Te,[v[3]||(v[3]=e.createElementVNode("label",{class:"row-label"},"动画进度:",-1)),e.createVNode(U,{modelValue:d.value,"onUpdate:modelValue":v[1]||(v[1]=x=>d.value=x),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":a,onInput:E,disabled:s.value.length===0,style:{flex:"1","margin-left":"5px"}},null,8,["modelValue","max","disabled"])])])])}}}),Se=W._export_sfc(Ee,[["__scopeId","data-v-2e06d60d"]]),xe={class:"obj-viewer-container"},De={class:"buttonGroup-topLeft"},ze={class:"buttonGroup-left"},Ae={class:"buttonGroup-right"},Pe={class:"buttonGroup-bottom"},Ie={class:"left-panel"},Ue={class:"panel-header"},Fe={class:"panel-body"},$e={key:1,class:"clipping-content"},je={class:"radio-group"},Me={class:"radio-label"},Re={class:"radio-label"},Be={class:"radio-label"},qe={class:"radio-label"},Oe={class:"right-panel"},Le={class:"panel-header"},Ke={class:"panel-body"},Ge={key:0,class:"loading-overlay"},He=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(m,{emit:V}){const w=V,c=m,s=e.ref(null),u=e.ref(!1),d=e.ref(""),n=e.ref(),f=e.ref(!1),a=e.ref(""),p=e.ref(!1),i=e.ref(""),N=e.shallowRef(null),E=e.shallowRef(null),{currentModels:A,initThreeJS:M,handleResize:P,getThreeJSObjects:y,cleanup:r,axesHelperVisible:v,toggleAxesVisibility:I,zoomIn:R,zoomOut:B}=S.useThreeJS(s),{isAnimating:U,toggleAnimation:x,stopAnimation:Z}=S.useAnimation(y,A),{isClipping:Q,activeClippingAxis:h,toggleClipping:ee,updateClippingPlanes:C}=S.useClipping(y,A),te=()=>{I()},q=o=>{f.value=!0,a.value=o,o==="剖面视图"&&!Q.value&&ee()},O=o=>{p.value=!0,i.value=o,o==="动画仿真"&&w("getAnimationData")},L=e.ref([]),D=e.ref([]),oe=e.computed(()=>{var t;return(t=c.trackFileType)==null?void 0:t.isUv}),ne=e.computed(()=>{var t;return(t=c.trackFileType)==null?void 0:t.isCyd}),le=e.computed(()=>{var t;return(t=c.trackFileType)==null?void 0:t.isCpt}),_=e.computed(()=>{var t;return(t=c.trackFileType)==null?void 0:t.isNc}),K=e.computed(()=>{const o=c.fileBlobs||[];return o==null?void 0:o[0]});let b=e.shallowRef(),T=e.shallowRef();const ae=()=>{const{scene:o}=y();b.value&&o&&(S.disposeObj(b.value,o),b.value=null)},re=()=>{const{scene:o}=y();T.value&&o&&(S.disposeObj(T.value,o),T.value=null)},G=()=>{ae(),re()},se=async o=>{const t=URL.createObjectURL(o),z=await ge.readFileText(t);if(URL.revokeObjectURL(t),he.isString(z)){const l=await $.getPoints(z,c.trackFileType)||[];L.value=l;const J=L.value;oe.value&&(b.value=$.drawLine(y,J)),(ne.value||le.value||_.value)&&(b.value=$.drawPoints(y,J)),S.frameCameraToObject3D(y,b.value)}},ie=async()=>{var o,t;T.value=Ve(),D.value=$.convertPointsToVector3(L.value),D.value&&D.value.length&&(Y(T.value,D.value[0],b.value,new k.Color(16711680)),(t=(o=E.value)==null?void 0:o.add)==null||t.call(o,T.value))},ce=async()=>{var o;await((o=n==null?void 0:n.value)==null?void 0:o.reset()),await H(K.value)},H=async o=>{G(),await se(o),_.value&&ie()};e.watch(()=>K.value,async o=>{o&&await H(o)},{immediate:!0,deep:!0});const ue=()=>{var o;_.value&&((o=n==null?void 0:n.value)==null||o.playAnimation())},de=()=>{var o;_.value&&((o=n==null?void 0:n.value)==null||o.stopAnimation())},ve=()=>{var o;_.value&&((o=n==null?void 0:n.value)==null||o.forwardFrame())},fe=()=>{var o;_.value&&((o=n==null?void 0:n.value)==null||o.backwardFrame())};let F=null;const me=()=>{M(),e.nextTick(()=>{s.value&&(F=new ResizeObserver(P),F.observe(s.value))});const o=y();E.value=o.scene,E.value&&(E.value.name="CPMPIP")},pe=()=>{F&&F.disconnect(),U.value&&Z(),G(),r()};return e.onMounted(async()=>{try{me()}catch(o){console.error("Three.js 初始化失败:",o),j.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{pe()}),(o,t)=>{const z=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:s,class:"threejs-container"},null,512),e.createElementVNode("div",De,[e.createVNode(g.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ce,title:"重置"}),e.createVNode(g.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(R)},null,8,["onClick"]),e.createVNode(g.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(B)},null,8,["onClick"]),e.createVNode(g.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(x),title:e.unref(U)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(g.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(v),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",ze,[e.renderSlot(o.$slots,"button-left",{switchRightPanel:q},void 0,!0),e.createVNode(g.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:t[0]||(t[0]=l=>q("场景树")),active:f.value&&a.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(g.ThreeSvgIcon,{name:"clipping",size:"24",onClick:t[1]||(t[1]=l=>q("剖面视图")),active:f.value&&a.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",Ae,[e.renderSlot(o.$slots,"button-right",{switchRightPanel:O},void 0,!0),e.createVNode(g.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:t[2]||(t[2]=l=>O("关节控制")),active:p.value&&i.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(g.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[3]||(t[3]=l=>O("动画仿真")),active:p.value&&i.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",Pe,[e.createVNode(g.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:fe}),e.createVNode(g.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ue}),e.createVNode(g.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(g.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:de})]),e.withDirectives(e.createElementVNode("div",Ie,[e.createElementVNode("div",Ue,[e.createElementVNode("span",null,e.toDisplayString(a.value),1),e.createElementVNode("span",{class:"close",onClick:t[4]||(t[4]=l=>f.value=!1)}," X ")]),e.createElementVNode("div",Fe,[e.createVNode(z,{height:"100%"},{default:e.withCtx(()=>[a.value==="场景树"?(e.openBlock(),e.createBlock(X.UrdfTree,{key:0,model:N.value},null,8,["model"])):e.createCommentVNode("",!0),a.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",$e,[e.createElementVNode("div",je,[e.createElementVNode("label",Me,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[5]||(t[5]=l=>e.isRef(h)?h.value=l:null),onChange:t[6]||(t[6]=(...l)=>e.unref(C)&&e.unref(C)(...l))},null,544),[[e.vModelRadio,e.unref(h)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Re,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[7]||(t[7]=l=>e.isRef(h)?h.value=l:null),onChange:t[8]||(t[8]=(...l)=>e.unref(C)&&e.unref(C)(...l))},null,544),[[e.vModelRadio,e.unref(h)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Be,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[9]||(t[9]=l=>e.isRef(h)?h.value=l:null),onChange:t[10]||(t[10]=(...l)=>e.unref(C)&&e.unref(C)(...l))},null,544),[[e.vModelRadio,e.unref(h)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",qe,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[11]||(t[11]=l=>e.isRef(h)?h.value=l:null),onChange:t[12]||(t[12]=(...l)=>e.unref(C)&&e.unref(C)(...l))},null,544),[[e.vModelRadio,e.unref(h)]]),t[17]||(t[17]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,f.value]]),e.withDirectives(e.createElementVNode("div",Oe,[e.createElementVNode("div",Le,[e.createElementVNode("span",null,e.toDisplayString(i.value),1),e.createElementVNode("span",{class:"close",onClick:t[13]||(t[13]=l=>p.value=!1)}," X ")]),e.createElementVNode("div",Ke,[e.createVNode(z,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(X.JointPanel,{model:N.value},null,8,["model"]),[[e.vShow,i.value==="关节控制"]]),e.withDirectives(e.createVNode(Se,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(b),knife:e.unref(T),vectors:D.value},null,8,["cloud","knife","vectors"]),[[e.vShow,i.value==="动画仿真"&&_.value]])]),_:1})])],512),[[e.vShow,p.value]]),u.value?(e.openBlock(),e.createElementBlock("div",Ge,[t[18]||(t[18]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(d.value),1)])):e.createCommentVNode("",!0)])}}}),Je=W._export_sfc(He,[["__scopeId","data-v-61931e01"]]);exports.default=Je;