ss-component-new 1.3.519 → 1.3.520

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 (62) hide show
  1. package/dist/{index-CpRwzP5l.js → index-0mpbktSg.js} +3 -3
  2. package/dist/{index-DdV9wIEV.cjs → index-1mC2A21K.cjs} +1 -1
  3. package/dist/{index-ImwWdWlH.cjs → index-5Vjvm1OH.cjs} +1 -1
  4. package/dist/{index-BJflRJ9U.js → index-BEAESk_B.js} +2 -2
  5. package/dist/{index-CTfT0jS4.cjs → index-BLxVq9Aj.cjs} +1 -1
  6. package/dist/{index-CX-xhB8-.cjs → index-BQlPbXIW.cjs} +1 -1
  7. package/dist/{index-Bii_vGs4.cjs → index-BVDiEQB_.cjs} +1 -1
  8. package/dist/{index-1j1BF_NQ.cjs → index-BZvo-_7x.cjs} +1 -1
  9. package/dist/{index-CmdGIa1-.cjs → index-Ba8nH1mH.cjs} +1 -1
  10. package/dist/{index-CWqis7A8.js → index-BsV3w9bm.js} +5 -5
  11. package/dist/{index-FtyCsM8J.cjs → index-Bw90Lb3S.cjs} +1 -1
  12. package/dist/{index-CMRSEjTf.cjs → index-CBBfLdee.cjs} +1 -1
  13. package/dist/{index-CzLE4e08.cjs → index-CKWTbQGz.cjs} +1 -1
  14. package/dist/{index-lCOltxCV.js → index-COFtgp-U.js} +1 -1
  15. package/dist/{index-DFCbDRkV.js → index-ChDaYLee.js} +1 -1
  16. package/dist/{index-rMsfTW1X.cjs → index-CnpXAjkm.cjs} +1 -1
  17. package/dist/{index-Brjo_Q27.js → index-CtUmAmOv.js} +11 -11
  18. package/dist/{index-Cfa5ta3B.cjs → index-CxxRUJ-y.cjs} +1 -1
  19. package/dist/{index-BY66liLa.js → index-D0o8iHf1.js} +1 -1
  20. package/dist/{index-CncinBCe.js → index-D2hyyxEj.js} +3 -3
  21. package/dist/{index-B829T3zC.js → index-DHyYIvlT.js} +4 -4
  22. package/dist/{index-Bk9VGtRy.cjs → index-DNdU6yRf.cjs} +1 -1
  23. package/dist/{index-Ba_Azu4R.js → index-DewnnwQ6.js} +1 -1
  24. package/dist/{index-DX2TYn9C.js → index-DlKLQjxR.js} +1 -1
  25. package/dist/{index-dJX5-spW.cjs → index-DzO6_ExP.cjs} +1 -1
  26. package/dist/{index-Bf8JqO_9.js → index-GnVXGEHe.js} +2 -2
  27. package/dist/{index-BPKAk_F3.cjs → index-Ik04dFx5.cjs} +1 -1
  28. package/dist/{index-Cg_cV1sh.js → index-JwmJivXt.js} +1 -1
  29. package/dist/{index-Dm9lXfLU.cjs → index-K9qk0XCM.cjs} +1 -1
  30. package/dist/{index-Dnz1Fp17.js → index-Nby38CFo.js} +1 -1
  31. package/dist/{index-HPz4fiNC.cjs → index-hJzEeait.cjs} +1 -1
  32. package/dist/{index-CY84LR69.cjs → index-i4e0Esdp.cjs} +1 -1
  33. package/dist/{index-v9RPEHq4.js → index-nf2yds4w.js} +1 -1
  34. package/dist/{index-DTh2hfA5.js → index-pqmnzSvl.js} +2 -2
  35. package/dist/{index-RK0N00Vd.js → index-tFBhG3Jy.js} +1 -1
  36. package/dist/{index-D_DfTYUo.js → index-y_nzcmAA.js} +2 -2
  37. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-C_R7wen6.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DvAbrnzO.js} +4 -4
  38. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BEbojT7K.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-PPw515G5.cjs} +1 -1
  39. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DEUapuYe.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-BWPbPTf5.cjs} +1 -1
  40. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DIGHAGm0.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Bya9B4So.js} +2 -2
  41. package/dist/{index.vue_vue_type_style_index_1_lang-dAljglMe.js → index.vue_vue_type_style_index_1_lang-DNXtxqeO.js} +1 -1
  42. package/dist/{index.vue_vue_type_style_index_1_lang-0T3F_kRW.cjs → index.vue_vue_type_style_index_1_lang-DWHjSLCm.cjs} +1 -1
  43. package/dist/{main-aX6kRTuP.cjs → main-CieLGTYq.cjs} +1 -1
  44. package/dist/{main-Dup8MUNV.js → main-NNG4465a.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-D-udFFWH.cjs → threeModel-BP35gpwR.cjs} +1 -1
  51. package/dist/{threeModel-BtbZLp4G.js → threeModel-BT8m0gg1.js} +2 -2
  52. package/dist/{threeSceneView-Dd_b10YG.js → threeSceneView--Ojbq4tB.js} +2 -2
  53. package/dist/{threeSceneView-BT3-qVGH.cjs → threeSceneView-DcHBprrB.cjs} +1 -1
  54. package/dist/{threeSceneViewForCPMPIP-FlkNC7Wb.cjs → threeSceneViewForCPMPIP-B7ao487R.cjs} +1 -1
  55. package/dist/{threeSceneViewForCPMPIP-CZEeHC8X.js → threeSceneViewForCPMPIP-DNgKmqQx.js} +6 -6
  56. package/dist/{threeTrackPathView-DOppTPMk.js → threeTrackPathView-Bx3vX5GB.js} +1 -1
  57. package/dist/{threeTrackPathView-B8a0xDZ8.cjs → threeTrackPathView-HiflV1Wn.cjs} +1 -1
  58. package/dist/{threeViewerHost-CpZDl88r.js → threeViewerHost-CxfujoTY.js} +1 -1
  59. package/dist/{threeViewerHost-B3sZ8h3R.cjs → threeViewerHost-DAOkqnVr.cjs} +1 -1
  60. package/dist/{workpieceTreePanel-VS1yrDMb.cjs → workpieceTreePanel-B1H5Tkxg.cjs} +1 -1
  61. package/dist/{workpieceTreePanel-DUvzpwQQ.js → workpieceTreePanel-BcGXi93D.js} +2 -2
  62. package/package.json +1 -1
@@ -5,19 +5,19 @@ import { u as C } from "./index.vue_vue_type_style_index_1_lang-DauX0cbH.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-Dup8MUNV.js"));
8
+ const n = o(() => import("./main-NNG4465a.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-RK0N00Vd.js").then((t) => t.l));
12
+ const s = o(() => import("./index-tFBhG3Jy.js").then((t) => t.l));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-D_DfTYUo.js"));
16
+ const r = o(() => import("./index-y_nzcmAA.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-CWqis7A8.js"));
20
+ const m = o(() => import("./index-BsV3w9bm.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
@@ -33,11 +33,11 @@ const l = o(() => import("./index-BxQZaLcW.js").then((t) => t.i));
33
33
  l.install = (t) => {
34
34
  t.component("ssAvatar", l);
35
35
  };
36
- const a = o(() => import("./threeModel-BtbZLp4G.js"));
36
+ const a = o(() => import("./threeModel-BT8m0gg1.js"));
37
37
  a.install = (t) => {
38
38
  t.component("ssThree", a);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-CpZDl88r.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-CxfujoTY.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-DDeExIAa.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-ImwWdWlH.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-CY84LR69.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-Dm9lXfLU.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-Cfa5ta3B.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-FtyCsM8J.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-rMsfTW1X.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-Bk9VGtRy.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-CTfT0jS4.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-HPz4fiNC.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-1j1BF_NQ.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-DDeExIAa.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-5Vjvm1OH.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-i4e0Esdp.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-K9qk0XCM.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-CxxRUJ-y.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-Bw90Lb3S.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-CnpXAjkm.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-DNdU6yRf.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-BLxVq9Aj.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-hJzEeait.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-BZvo-_7x.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-Brjo_Q27.js"),
16
+ component: async () => import("./index-CtUmAmOv.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-CpRwzP5l.js")
34
+ component: async () => import("./index-0mpbktSg.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-v9RPEHq4.js")
39
+ component: async () => import("./index-nf2yds4w.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-BJflRJ9U.js")
44
+ component: async () => import("./index-BEAESk_B.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-lCOltxCV.js")
49
+ component: async () => import("./index-COFtgp-U.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-Dnz1Fp17.js")
54
+ component: async () => import("./index-Nby38CFo.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-BY66liLa.js")
59
+ component: async () => import("./index-D0o8iHf1.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-DX2TYn9C.js")
64
+ component: async () => import("./index-DlKLQjxR.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-Cg_cV1sh.js")
69
+ component: async () => import("./index-JwmJivXt.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-Ba_Azu4R.js")
74
+ component: async () => import("./index-DewnnwQ6.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-DJnHA5u9.cjs"),pe=require("./OrbitControls-V5fA3JpK.cjs"),me=require("./index-BPKAk_F3.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-0T3F_kRW.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-ClZKEUbY.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=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 f=z.value;u=new n.PerspectiveCamera(75,f.clientWidth/f.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(f.clientWidth,f.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,f.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:f,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),m(),_()},t=(f,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(f/20),30),40);c=new n.GridHelper(f,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(f,f),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 f=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)f.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);f.union(Z.box),l=!0}else f.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=f.getSize(new n.Vector3),B=f.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,f.min.z);t(j,q)},m=()=>{const f=new n.AmbientLight(4210752,.6);g.add(f);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(_),h&&h.update();const f=performance.now(),l=f-S;l<D||(S=f-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{f[E]&&f[E].dispose&&f[E].dispose()}),f.dispose&&f.dispose()},A=f=>{f==null||f.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 f=z.value,l=f.clientWidth,E=f.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:f=>{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&&f.has(Z.userData.modelId)){const ee=f.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 f=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&f.push(l)}),f.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),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,P=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,m=C*1.2,_=new n.Vector3(c.x+m,c.y,c.z),I=new n.Vector3(c.x,c.y+m,c.z),A=new n.Vector3(c.x,c.y-m,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*m,p.z=c.z+Math.sin($)*m,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(_,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*m,p.y=c.y+Math.cos(J)*m,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 m=Date.now()-d,_=Math.min(m/h,1);if(_>=1){k();return}const I=S(_);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),P.copy(p.target);const m=new n.Box3;g.value.forEach(G=>{m.expandByObject(G)});const _=m.getSize(new n.Vector3);c=m.getCenter(new n.Vector3),C=Math.max(_.x,_.y,_.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),f=D(Y);t.position.lerpVectors(A,I,f),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(P))};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 m=t.position.clone(),_=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(m,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=[],P=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=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,m,_;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=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(m),A.rotation.copy(_),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(m=>{(m.isMesh&&m.material||m.isLine&&m.material||m.isPoints&&m.material)&&(Array.isArray(m.material)?m.material.forEach(_=>{_.clippingPlanes=[y]}):m.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||t.isLine&&t.material||t.isPoints&&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,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.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"},Pe={class:"joint-left"},_e={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),P=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 m=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(m=v)},{deep:!0}),e.computed(()=>m.length>0);const _=(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??_(s._jointType,!1),upper:s.limit.upper??_(s._jointType,!0)}:{lower:_(s._jointType,!1),upper:_(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=m.slice(0,o+1);const V=m[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),P.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))},f=(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]=f(a,w||a,i)}),V},E=()=>{if(m.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>=m.length-1){const s=m[m.length-1];Y(s,m.length-1,1),j();return}const v=r.value/ue,i=m[o],V=m[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",Pe,[e.createElementVNode("span",_e,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"},P=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(m=>m.children&&m.children.length>0).slice(0,k).map(m=>m.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:P},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 P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(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-6b1132f4"]]),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 P=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:m,handleResize:_,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:f,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(),f.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==="剖面视图"&&!f.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{m(),h=A().scene,x=!0,window.addEventListener("resize",_)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",_),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:P,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-DJnHA5u9.cjs"),pe=require("./OrbitControls-V5fA3JpK.cjs"),me=require("./index-Ik04dFx5.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-DWHjSLCm.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-ClZKEUbY.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=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 f=z.value;u=new n.PerspectiveCamera(75,f.clientWidth/f.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(f.clientWidth,f.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,f.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:f,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),m(),_()},t=(f,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(f/20),30),40);c=new n.GridHelper(f,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(f,f),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 f=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)f.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);f.union(Z.box),l=!0}else f.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=f.getSize(new n.Vector3),B=f.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,f.min.z);t(j,q)},m=()=>{const f=new n.AmbientLight(4210752,.6);g.add(f);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(_),h&&h.update();const f=performance.now(),l=f-S;l<D||(S=f-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{f[E]&&f[E].dispose&&f[E].dispose()}),f.dispose&&f.dispose()},A=f=>{f==null||f.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 f=z.value,l=f.clientWidth,E=f.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:f=>{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&&f.has(Z.userData.modelId)){const ee=f.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 f=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&f.push(l)}),f.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),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,P=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,m=C*1.2,_=new n.Vector3(c.x+m,c.y,c.z),I=new n.Vector3(c.x,c.y+m,c.z),A=new n.Vector3(c.x,c.y-m,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*m,p.z=c.z+Math.sin($)*m,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(_,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*m,p.y=c.y+Math.cos(J)*m,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 m=Date.now()-d,_=Math.min(m/h,1);if(_>=1){k();return}const I=S(_);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),P.copy(p.target);const m=new n.Box3;g.value.forEach(G=>{m.expandByObject(G)});const _=m.getSize(new n.Vector3);c=m.getCenter(new n.Vector3),C=Math.max(_.x,_.y,_.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),f=D(Y);t.position.lerpVectors(A,I,f),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(P))};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 m=t.position.clone(),_=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(m,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=[],P=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=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,m,_;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=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(m),A.rotation.copy(_),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(m=>{(m.isMesh&&m.material||m.isLine&&m.material||m.isPoints&&m.material)&&(Array.isArray(m.material)?m.material.forEach(_=>{_.clippingPlanes=[y]}):m.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||t.isLine&&t.material||t.isPoints&&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,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.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"},Pe={class:"joint-left"},_e={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),P=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 m=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(m=v)},{deep:!0}),e.computed(()=>m.length>0);const _=(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??_(s._jointType,!1),upper:s.limit.upper??_(s._jointType,!0)}:{lower:_(s._jointType,!1),upper:_(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=m.slice(0,o+1);const V=m[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),P.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))},f=(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]=f(a,w||a,i)}),V},E=()=>{if(m.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>=m.length-1){const s=m[m.length-1];Y(s,m.length-1,1),j();return}const v=r.value/ue,i=m[o],V=m[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",Pe,[e.createElementVNode("span",_e,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"},P=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(m=>m.children&&m.children.length>0).slice(0,k).map(m=>m.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:P},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 P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(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-6b1132f4"]]),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 P=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:m,handleResize:_,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:f,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(),f.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==="剖面视图"&&!f.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{m(),h=A().scene,x=!0,window.addEventListener("resize",_)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",_),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:P,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 Ie, computed as le, 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 k, 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, n as Qe, A as et, o as tt, M as Le, X as nt, G as at, p as Me, q as ot, r as De, s as st, D as ze, H as it, t as Re, u as Oe, v as Ue, w as ke, E as _e, x as pe, y as lt, z as rt, T as ct } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CyYhhHap.js";
3
3
  import { O as ut } from "./OrbitControls-DajKoMiS.js";
4
- import { s as pt } from "./index-CncinBCe.js";
5
- import { u as dt } from "./index.vue_vue_type_style_index_1_lang-dAljglMe.js";
4
+ import { s as pt } from "./index-D2hyyxEj.js";
5
+ import { u as dt } from "./index.vue_vue_type_style_index_1_lang-DNXtxqeO.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { c as Ge, E as Ve } from "./index-CA0SFykF.js";
8
8
  import { m as de } from "./robotUtil-CCsq_KMK.js";
@@ -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 j, 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 Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-DUvzpwQQ.js";
2
+ import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-BcGXi93D.js";
3
3
  import { u as Qe, a as it, b as rt } from "./iconfont-C4wStSmY.js";
4
4
  import { a9 as ut, c as ct, E, aM as pt, ao as dt } from "./index-CA0SFykF.js";
5
5
  import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CyYhhHap.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-DauX0cbH.js";
7
7
  import { _ as ue, s as Mt } from "./index-BgO_thJz.js";
8
8
  import "./index-BHtNKL1L.js";
9
- import "./index.vue_vue_type_style_index_1_lang-dAljglMe.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-DNXtxqeO.js";
10
10
  import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-CCsq_KMK.js";
11
11
  import "./index-DlpjmZuC.js";
12
12
  import { f as Ft, a as zt } from "./animationData-D2IoXRf1.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-VS1yrDMb.cjs"),ue=require("./iconfont-BbYr4rkP.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DJnHA5u9.cjs");require("./index.vue_vue_type_style_index_1_lang-BVjtPl2M.cjs");const Q=require("./index-oH9f3nVB.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-0T3F_kRW.cjs");const Y=require("./robotUtil-ClZKEUbY.cjs");require("./index-BriUHLrI.cjs");const we=require("./animationData-CH8nobuU.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-CSNc4BjO.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={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(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));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 s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let 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 s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,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=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(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],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.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 s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,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=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.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 n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.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 Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.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 we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.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=ie($.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),s=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(()=>a.model?Y.getNonFixedJoints(a.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-B1H5Tkxg.cjs"),ue=require("./iconfont-BbYr4rkP.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DJnHA5u9.cjs");require("./index.vue_vue_type_style_index_1_lang-BVjtPl2M.cjs");const Q=require("./index-oH9f3nVB.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-DWHjSLCm.cjs");const Y=require("./robotUtil-ClZKEUbY.cjs");require("./index-BriUHLrI.cjs");const we=require("./animationData-CH8nobuU.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-CSNc4BjO.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={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(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));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 s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let 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 s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,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=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(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],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.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 s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,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=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.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 n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.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 Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.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 we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.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=ie($.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),s=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(()=>a.model?Y.getNonFixedJoints(a.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:re,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(re)||0,R:parseFloat(B)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},I=(l=0,t=0)=>{if(v.value&&T.value){const o=q();xe(v.value,T.value,o.posPipeYbcr,o.negPipeYbcr,S.value,D.value,l,t,R.value)}else if(v.value){const o=z();Ce(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}`),s.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===s.value&&(s.value=0);try{for(let l=s.value+1;l<c.value.length&&!b;l++){s.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("动画已停止")},te=()=>{s.value=0},G=()=>{if(v.value&&T.value){const l=q();xe(v.value,T.value,l.posPipeYbcr,l.negPipeYbcr,S.value,D.value,-1,0,R.value)}else if(v.value){const l=z();Ce(v.value,l,S.value,D.value,-1,0)}},oe=()=>{k.value&&k.value.resetToZero(),G(),te(),A.ElMessage.success("机器人和管件已重置")},ne=l=>`第 ${l+1} 帧`,de=l=>{m.value&&w(),U(l)},me=()=>{m.value&&w(),!(s.value+1>=c.value.length)&&U(s.value+1)},pe=()=>{m.value&&w(),s.value!==0&&U(s.value-1)},ae=()=>{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},ie=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=ie(l);c.value=[o]}else c.value=[]},{immediate:!0});const se=e.ref(0),ve=l=>{se.value=l},ee=(l,t)=>{if(!l||!t)return;const o=Y.getTargetJoint(l,t),y=Me();y.visible=!1,o==null||o.add(y)},le=l=>{k.value=new O.URDFRobotController(l),L.value=Y.getAllLinkName(l),M.value="Pipe_Joint"},fe=()=>{k.value=null,L.value=[],M.value=null},ge=l=>{le(l),ee(l,M.value),ve(se.value+1),oe()};e.watch(()=>a.model,l=>{if(ae(),l){ge(l);return}fe()},{immediate:!0});const ce=l=>{var o,y;const t=new n.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,se],([l,t])=>{if(ae(),a.model&&l){const o=Y.getMeshFromJoint(a.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=ce(o);if(u.value===O.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,u.value===O.robotMode.DOUBLE){const N=ce(o);T.value=N}I(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const he=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("复制失败,请检查浏览器权限或手动复制。")}},Ve=()=>{if(!r.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),re=require("./index.vue_vue_type_style_index_1_lang-BVjtPl2M.cjs"),j=require("./workpieceTreePanel-VS1yrDMb.cjs"),Y=require("./iconfont-BbYr4rkP.cjs"),q=require("./index-CEwxrYB-.cjs"),ve=require("./pointTrack-CMNkESX_.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./threeViewerHost-B3sZ8h3R.cjs"),F=require("./robotUtil-ClZKEUbY.cjs"),ce=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DJnHA5u9.cjs"),ue=require("./urdfTree-CSNc4BjO.cjs"),Ye=require("./index-CX-xhB8-.cjs"),w=require("./svgIcon-BH_8oaav.cjs"),Qe=require("./PCDLoader-B_6XtFOh.cjs"),de=require("./index-DdV9wIEV.cjs"),et=async h=>await new Qe.OBJLoader().loadAsync(h),tt={class:"table-container"},nt={class:"header-cell"},lt=["title"],ot=["title"],at=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(h){const a=h,V=e.ref(),g=e.ref([]);function p(r){e.nextTick(()=>{var b;const c=a.list.findIndex(v=>v.id===r);c>-1&&((b=V.value)==null||b.scrollToItem(c,"center"))})}return e.watch(()=>a==null?void 0:a.list,()=>{var c,b;let r=[];if(((c=a==null?void 0:a.list)==null?void 0:c.length)>0){let v=(b=a==null?void 0:a.list)==null?void 0:b[0];v=Object.keys(v),r=v==null?void 0:v.map(u=>(u!=null&&u.includes("_axis")&&(u=u==null?void 0:u.replaceAll("_axis","轴")),u=u==null?void 0:u.toUpperCase(),u)),r=r==null?void 0:r.filter(u=>u!=="ID"&&u!=="X轴"&&u!=="Y轴"&&u!=="Z轴")}g.value=r},{deep:!0,immediate:!0}),e.watch(()=>a.currentId,p,{immediate:!0}),(r,c)=>{var b;return e.openBlock(),e.createElementBlock("div",tt,[(e.openBlock(),e.createElementBlock("div",{class:"table-header",key:(b=g.value)==null?void 0:b.length},[c[0]||(c[0]=e.createElementVNode("div",{class:"header-cell line-number-col"},"行号",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,v=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",nt,e.toDisplayString(v),1)]))),256))])),e.createVNode(e.unref(ve.script$2),{class:"scroller",ref_key:"scrollerRef",ref:V,items:r.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:v,index:u})=>[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:v.id===r.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:u+1},e.toDisplayString(u+1),9,lt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,k=>{var x,S,z,B;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"cell",title:(S=v==null?void 0:v[(x=k==null?void 0:k.toLowerCase())==null?void 0:x.replaceAll("轴","_axis")])==null?void 0:S.toFixed(5)},e.toDisplayString((B=v==null?void 0:v[(z=k==null?void 0:k.toLowerCase())==null?void 0:z.replaceAll("轴","_axis")])==null?void 0:B.toFixed(5)),9,ot)])}),256))],2)]),_:1},8,["items"])])}}}),st=ne._export_sfc(at,[["__scopeId","data-v-390bde2d"]]);function it(h){const a=ve.getPointGeometry(h);return a&&(a.material.sizeAttenuation=!1),a}async function rt(h){return await me.downloadFile(h)}async function ct(h){return await me.readCsv(h)}async function ut(h){const a=await rt(h),V=await ct(a);let g={};return V!=null&&V[0]&&(g=V==null?void 0:V[0]),V.map(r=>{let c={};for(let b in g)c[b.toLowerCase()]=r==null?void 0:r[b];return c})}const dt={class:"panel-content"},vt={class:"animation-controls"},mt={class:"control-row"},ft={class:"control-row"},pt={class:"frame-info"},gt={class:"control-row"},ht={class:"scroller-row"},Vt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(h,{expose:a,emit:V}){const g=h,p=e.computed(()=>(g.animationData||[]).map((o,i)=>({...o,id:i}))),r=e.ref(!1),c=e.ref(0),b=e.ref(100);let v=!1;const u={bladeAxis:"叶片模型位置"},k=e.ref(null),x=l=>{if(l<0||l>=p.value.length)return null;const o=F.getObjectWorldMatrix(g.robot,u.bladeAxis);if(!o)return null;const i=p.value[l];return new ce.Vector3(i.x,i.y,i.z).applyMatrix4(o)},S=(l,o)=>{l&&l.setJointValues(o)},z=l=>{let o=Object.keys(l);o=o==null?void 0:o.filter(d=>d!=="id"&&d!=="x"&&d!=="y"&&d!=="z");let i={};o==null||o.forEach(d=>{var P;let m=(P=d==null?void 0:d.split("_"))==null?void 0:P[0];m=m==null?void 0:m.toUpperCase(),m=m+"_Axis",i[m]=m!=null&&m.includes("X")||m!=null&&m.includes("Y")||m!=null&&m.includes("Z")?l==null?void 0:l[d]:ce.MathUtils.degToRad(l==null?void 0:l[d])}),S(g.robot,i)},B=()=>{const l=g.scene;if(!l)return;const o=[];l.traverse(i=>{i.name==="TrajectoryPoints"&&o.push(i)}),o.forEach(i=>{l.remove(i),Y.disposeObj(i)})},C=l=>{const o=[];for(let i=0;i<=l;i++){const d=x(i);d&&o.push(d.x,d.y,d.z)}return o},I=l=>{const o=it(l);if(o)return o.name="TrajectoryPoints",k.value=o,o},A=l=>{B();const o=C(l),i=I(o);g.scene&&i&&g.scene.add(i)},J=l=>`第 ${l+1} 帧`,M=l=>{if(l<0||l>=p.value.length){console.error(`帧索引 ${l} 超出范围`);return}const o=p.value[l];c.value=l,z(o);const i=g.scene;i&&i.updateMatrixWorld(!0),A(l)},Q=async()=>{if(p.value.length===0){q.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,v=!1,p.value.length-1===c.value&&(c.value=0);try{for(let l=c.value+1;l<p.value.length&&!v;l++)await new Promise(o=>setTimeout(o,b.value)),M(l);v||q.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l)}finally{r.value=!1}}},E=async()=>{r.value&&(v=!0,await new Promise(l=>{const o=e.watch(()=>r.value,i=>{o(),l()})}))},ee=async l=>{r.value&&await E(),M(l)},U=async()=>{r.value&&await E(),!(c.value+1>=p.value.length)&&M(c.value+1)},G=async()=>{r.value&&await E(),c.value!==0&&M(c.value-1)},L=()=>{c.value=0},$=async()=>{await E(),B(),L()};return e.onBeforeUnmount(()=>{$()}),a({playAnimation:Q,stopAnimation:E,forwardFrame:U,backwardFrame:G,resetAnimationFrame:L,reset:$}),(l,o)=>{const i=e.resolveComponent("el-input-number"),d=e.resolveComponent("el-form-item"),m=e.resolveComponent("el-form"),P=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",vt,[e.createElementVNode("div",mt,[e.createVNode(m,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(d,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:b.value,"onUpdate:modelValue":o[0]||(o[0]=R=>b.value=R),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",ft,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",pt,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(p.value.length),1)]),e.createElementVNode("div",gt,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(P,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=R=>c.value=R),min:0,max:p.value.length>0?p.value.length-1:0,step:1,"format-tooltip":J,onInput:ee,disabled:p.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",ht,[e.createVNode(st,{class:"scroller",list:p.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),bt=ne._export_sfc(Vt,[["__scopeId","data-v-c81a5627"]]),Nt=async h=>{const a=await et(h);return a==null||a.traverse(V=>{V.isMesh&&V.geometry.computeVertexNormals()}),a},yt={class:"obj-viewer-container"},_t={key:0,class:"machine-casing"},wt={class:"buttonGroup-topLeft"},kt={class:"buttonGroup-left"},Ct={class:"buttonGroup-right"},Et={class:"left-panel"},xt={class:"panel-header"},Pt={class:"panel-body"},Tt={key:1,class:"clipping-content"},Dt={class:"radio-group"},St={class:"radio-label"},Bt={class:"radio-label"},Mt={class:"radio-label"},Ut={class:"radio-label"},zt={class:"right-panel"},At={class:"panel-header"},$t={class:"panel-body"},jt={key:1,class:"loading-overlay"},It={key:2,class:"brand"},Lt={class:"brand-item"},Rt={class:"item-value"},Ot={class:"brand-item"},Ft={class:"item-value"},qt={class:"brand-item"},Jt={class:"item-value"},Gt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(h){const a=h,V=re.useModelComp(q.pinia),g=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),r=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.machine}),c=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.产品型号}),b=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.编号}),v=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.厂家}),u=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.workpieceInfo}),k=e.computed(()=>{var n;return(n=u.value)==null?void 0:n.name}),x=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.knife}),S=e.ref([]),z=async n=>{!n||!n.isExtra||(await B(n),g==null||g(n==null?void 0:n.pageName),p==null||p(!0))},B=de.debounce(async n=>{await de.onPageBack();const{mainKey:t,baseMenuPath:s}=n||{};re.copyAdd(s,t)},500);e.watch(()=>[c.value,u.value,x.value],()=>{var _,f,se,ie;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};c.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:c.value,label:c.value,baseMenuPath:"设备库/机床"});const s={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/工件库",children:[],show:!0,isPenultimate:!1};u.value&&s.children.push({isExtra:!0,type:(_=u.value)==null?void 0:_.type,pageName:"工件",mainKey:(f=u.value)==null?void 0:f.name,label:(se=u.value)==null?void 0:se.name,baseMenuPath:`工件库/${(ie=u.value)==null?void 0:ie.type}`});const D={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};x.value&&D.children.push({isExtra:!0,pageName:"刀具",mainKey:x.value,label:x.value,baseMenuPath:"设备库/刀具"}),n.push(t,s,D),S.value=n},{immediate:!0});const C=e.ref(!1),I=e.ref([]),A=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.csvUrl});e.watch(()=>A.value,async()=>{if(console.log("three data",a==null?void 0:a.threeData),console.log("csvUrl",A.value),I.value=[],A.value){C.value=!0;const n=await ut(A.value);I.value=n,C.value=!1}},{immediate:!0});const J={"CJ-001":"CJ001榫头","CJ-002":"CJ002榫头","CJ-003":"CJ003榫头"},M=e.computed(()=>J[k.value]),Q=e.computed(()=>{var n;return((n=u.value)==null?void 0:n.type)==="航空发动机叶片"}),E=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.bladeObjUrl}),ee=e.ref(j.sceneType.ROBOT),U=e.ref(null),G=e.ref(!1),L=e.ref(""),$=e.ref(!1),l=e.ref(""),o=e.ref(!1),i=e.ref(""),d=e.shallowRef(null),m=e.ref(null),P=e.ref("叶片模型"),R=e.shallowRef(null),fe=e.shallowRef(null),W=e.ref(!0),X=e.shallowRef(null),pe=e.computed(()=>!!X.value),le=e.shallowRef(null),N=e.ref(),{currentModels:H,resetView:ge,initThreeJS:he,handleResize:Ve,getThreeJSObjects:O,cleanup:be,setModels:oe,axesHelperVisible:Ne,toggleAxesVisibility:ye,zoomIn:_e,zoomOut:we}=Y.useThreeJS(U),{loadSceneFromFile:ke}=j.useUrdfLoader(O,H,G,L),{isAnimating:ae,toggleAnimation:Ce,stopAnimation:Ee}=Y.useAnimation(O,H),{isClipping:xe,activeClippingAxis:y,toggleClipping:Pe,updateClippingPlanes:T}=Y.useClipping(O,H),{initRaycaster:Te,selectedObject3D:De,setSelectedObjVisible:Se,updatePosition:Be,updateRotation:Me,dispose:Ue}=j.useRaycaster(U,O,H),ze=()=>{ye()},Ae=e.computed(()=>ee.value===j.sceneType.ROBOT),$e=n=>{$.value=!0,l.value=n,n==="剖面视图"&&!xe.value&&Pe()},K=n=>{n==="智能工艺孪生"?V.setLoadingExeContent(!0):(o.value=!0,i.value=n)},je=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.playAnimation()},Ie=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.stopAnimation()},Le=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.forwardFrame()},Re=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.backwardFrame()},te=()=>{var n;(n=N==null?void 0:N.value)==null||n.reset()},Oe=()=>{te(),ge(),m.value&&m.value.resetToZero()},Fe=n=>{if(!n){X.value=null,W.value=!1;return}const t=F.getTargetLink(n,"Base1");X.value=t,W.value=!!(t!=null&&t.visible)},qe=n=>{W.value=n,X.value.visible=n},Je=(n,t)=>{if(M.value){const s=F.getTargetLink(n,M.value);s&&(s.visible=t)}},Ge=(n,t)=>{const s=Object.values(J);for(let D=0;D<s.length;D++){const _=s[D],f=F.getTargetLink(n,_);f&&(f.visible=t)}},We=n=>{n&&Ge(n,!1)},Xe=(n,t)=>F.getMeshFromLink(n,t),He=async n=>{const t=Xe(n,P.value);if(fe.value=t,console.log("bladeObjUrl",E.value),Q.value&&E.value&&t&&Je(n,!0),t&&t.parent&&E.value){const s=await Nt(E.value);s.name="blade_clone",t.parent.add(s),s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.set(.001,.001,.001),t.visible=!1,R.value=s}else P.value&&console.warn(`在 Blade '${P.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>a.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ke(t).then(s=>{d.value=s,We(s),s&&He(s)}).catch(s=>{console.error("加载URDF文件时发生错误:",s),q.ElMessage.error("加载urdf模型失败"),d.value=null})}else d.value=null},{immediate:!0,deep:!0}),e.watch(d,n=>{te(),n?(oe([n]),m.value=new j.URDFRobotController(n)):(oe([]),m.value=null),Fe(n),Te()});let Z=null;const Ke=()=>{he(),e.nextTick(()=>{U.value&&(Z=new ResizeObserver(Ve),Z.observe(U.value))});const n=O();le.value=n.scene},Ze=()=>{l.value="",i.value="",Z&&Z.disconnect(),ae.value&&Ee(),te(),be(),Ue()};return e.onMounted(async()=>{await e.nextTick();try{Ke()}catch(n){console.error("Three.js 初始化失败:",n),q.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Ze()}),(n,t)=>{const s=e.resolveComponent("el-scrollbar"),D=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",yt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:U,class:"threejs-container"},null,512),[[e.vShow,Ae.value]]),pe.value?(e.openBlock(),e.createElementBlock("div",_t,[t[13]||(t[13]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Ye._sfc_main$1,{value:W.value,onChange:qe,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",wt,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Oe,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(_e)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(we)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(Ce),title:e.unref(ae)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(Ne),onClick:ze,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",kt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:$e},void 0,!0)]),e.createElementVNode("div",Ct,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:K},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=_=>K("机床控制")),active:o.value&&i.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=_=>K("轨迹路径")),active:o.value&&i.value==="轨迹路径"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"智能工艺孪生",size:"24",title:"智能工艺孪生",onClick:t[2]||(t[2]=_=>K("智能工艺孪生")),active:o.value&&i.value==="智能工艺孪生"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":C.value}])},[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Re}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:je}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Le}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ie})],2),e.withDirectives(e.createElementVNode("div",Et,[e.createElementVNode("div",xt,[e.createElementVNode("span",null,e.toDisplayString(l.value),1),e.createElementVNode("span",{class:"close",onClick:t[3]||(t[3]=_=>$.value=!1)}," X ")]),e.createElementVNode("div",Pt,[e.createVNode(s,{height:"100%"},{default:e.withCtx(()=>{var _;return[l.value==="场景树"?(e.openBlock(),e.createBlock(ue.UrdfTree,{key:0,model:d.value,extraNodes:S.value,onNodeClick:z},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),l.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Tt,[e.createElementVNode("div",Dt,[e.createElementVNode("label",St,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[4]||(t[4]=f=>e.isRef(y)?y.value=f:null),onChange:t[5]||(t[5]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[6]||(t[6]=f=>e.isRef(y)?y.value=f:null),onChange:t[7]||(t[7]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Mt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[8]||(t[8]=f=>e.isRef(y)?y.value=f:null),onChange:t[9]||(t[9]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ut,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[10]||(t[10]=f=>e.isRef(y)?y.value=f:null),onChange:t[11]||(t[11]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[17]||(t[17]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),l.value==="工件树"?(e.openBlock(),e.createBlock(j.WorkpieceTreePanel,{key:2,model:(_=e.unref(De))==null?void 0:_.obj,onVisibleChange:e.unref(Se),onUpdatePosition:e.unref(Be),onUpdateRotation:e.unref(Me)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,$.value]]),e.withDirectives(e.createElementVNode("div",zt,[e.createElementVNode("div",At,[e.createElementVNode("span",null,e.toDisplayString(i.value),1),e.createElementVNode("span",{class:"close",onClick:t[12]||(t[12]=_=>o.value=!1)}," X ")]),e.createElementVNode("div",$t,[e.createVNode(s,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ue.JointPanel,{model:d.value},null,8,["model"]),[[e.vShow,i.value==="机床控制"]]),e.withDirectives(e.createVNode(bt,{robot:d.value,scene:le.value,animationData:I.value,ref_key:"bladeTrackPanelRef",ref:N},null,8,["robot","scene","animationData"]),[[e.vShow,i.value==="轨迹路径"&&!C.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:i.value},void 0,!0)]),_:3})])],512),[[e.vShow,o.value]]),G.value?(e.openBlock(),e.createElementBlock("div",jt,[t[18]||(t[18]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(L.value),1)])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Lt,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",Rt,e.toDisplayString(v.value),1)]),e.createElementVNode("div",Ot,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)]),e.createElementVNode("div",qt,[t[21]||(t[21]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Jt,e.toDisplayString(b.value),1)])])):e.createCommentVNode("",!0),e.createVNode(D,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),Wt=ne._export_sfc(Gt,[["__scopeId","data-v-8a080d31"]]);exports.default=Wt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),re=require("./index.vue_vue_type_style_index_1_lang-BVjtPl2M.cjs"),j=require("./workpieceTreePanel-B1H5Tkxg.cjs"),Y=require("./iconfont-BbYr4rkP.cjs"),q=require("./index-CEwxrYB-.cjs"),ve=require("./pointTrack-CMNkESX_.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),me=require("./threeViewerHost-DAOkqnVr.cjs"),F=require("./robotUtil-ClZKEUbY.cjs"),ce=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DJnHA5u9.cjs"),ue=require("./urdfTree-CSNc4BjO.cjs"),Ye=require("./index-BQlPbXIW.cjs"),w=require("./svgIcon-BH_8oaav.cjs"),Qe=require("./PCDLoader-B_6XtFOh.cjs"),de=require("./index-1mC2A21K.cjs"),et=async h=>await new Qe.OBJLoader().loadAsync(h),tt={class:"table-container"},nt={class:"header-cell"},lt=["title"],ot=["title"],at=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(h){const a=h,b=e.ref(),g=e.ref([]);function p(r){e.nextTick(()=>{var V;const c=a.list.findIndex(v=>v.id===r);c>-1&&((V=b.value)==null||V.scrollToItem(c,"center"))})}return e.watch(()=>a==null?void 0:a.list,()=>{var c,V;let r=[];if(((c=a==null?void 0:a.list)==null?void 0:c.length)>0){let v=(V=a==null?void 0:a.list)==null?void 0:V[0];v=Object.keys(v),r=v==null?void 0:v.map(u=>(u!=null&&u.includes("_axis")&&(u=u==null?void 0:u.replaceAll("_axis","轴")),u=u==null?void 0:u.toUpperCase(),u)),r=r==null?void 0:r.filter(u=>u!=="ID"&&u!=="X轴"&&u!=="Y轴"&&u!=="Z轴")}g.value=r},{deep:!0,immediate:!0}),e.watch(()=>a.currentId,p,{immediate:!0}),(r,c)=>{var V;return e.openBlock(),e.createElementBlock("div",tt,[(e.openBlock(),e.createElementBlock("div",{class:"table-header",key:(V=g.value)==null?void 0:V.length},[c[0]||(c[0]=e.createElementVNode("div",{class:"header-cell line-number-col"},"行号",-1)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,v=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",nt,e.toDisplayString(v),1)]))),256))])),e.createVNode(e.unref(ve.script$2),{class:"scroller",ref_key:"scrollerRef",ref:b,items:r.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:v,index:u})=>[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:v.id===r.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:u+1},e.toDisplayString(u+1),9,lt),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,k=>{var x,S,z,B;return e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",{class:"cell",title:(S=v==null?void 0:v[(x=k==null?void 0:k.toLowerCase())==null?void 0:x.replaceAll("轴","_axis")])==null?void 0:S.toFixed(5)},e.toDisplayString((B=v==null?void 0:v[(z=k==null?void 0:k.toLowerCase())==null?void 0:z.replaceAll("轴","_axis")])==null?void 0:B.toFixed(5)),9,ot)])}),256))],2)]),_:1},8,["items"])])}}}),st=ne._export_sfc(at,[["__scopeId","data-v-390bde2d"]]);function it(h){const a=ve.getPointGeometry(h);return a&&(a.material.sizeAttenuation=!1),a}async function rt(h){return await me.downloadFile(h)}async function ct(h){return await me.readCsv(h)}async function ut(h){const a=await rt(h),b=await ct(a);let g={};return b!=null&&b[0]&&(g=b==null?void 0:b[0]),b.map(r=>{let c={};for(let V in g)c[V.toLowerCase()]=r==null?void 0:r[V];return c})}const dt={class:"panel-content"},vt={class:"animation-controls"},mt={class:"control-row"},ft={class:"control-row"},pt={class:"frame-info"},gt={class:"control-row"},ht={class:"scroller-row"},bt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(h,{expose:a,emit:b}){const g=h,p=e.computed(()=>(g.animationData||[]).map((o,i)=>({...o,id:i}))),r=e.ref(!1),c=e.ref(0),V=e.ref(100);let v=!1;const u={bladeAxis:"叶片模型位置"},k=e.ref(null),x=l=>{if(l<0||l>=p.value.length)return null;const o=F.getObjectWorldMatrix(g.robot,u.bladeAxis);if(!o)return null;const i=p.value[l];return new ce.Vector3(i.x,i.y,i.z).applyMatrix4(o)},S=(l,o)=>{l&&l.setJointValues(o)},z=l=>{let o=Object.keys(l);o=o==null?void 0:o.filter(d=>d!=="id"&&d!=="x"&&d!=="y"&&d!=="z");let i={};o==null||o.forEach(d=>{var P;let m=(P=d==null?void 0:d.split("_"))==null?void 0:P[0];m=m==null?void 0:m.toUpperCase(),m=m+"_Axis",i[m]=m!=null&&m.includes("X")||m!=null&&m.includes("Y")||m!=null&&m.includes("Z")?l==null?void 0:l[d]:ce.MathUtils.degToRad(l==null?void 0:l[d])}),S(g.robot,i)},B=()=>{const l=g.scene;if(!l)return;const o=[];l.traverse(i=>{i.name==="TrajectoryPoints"&&o.push(i)}),o.forEach(i=>{l.remove(i),Y.disposeObj(i)})},C=l=>{const o=[];for(let i=0;i<=l;i++){const d=x(i);d&&o.push(d.x,d.y,d.z)}return o},I=l=>{const o=it(l);if(o)return o.name="TrajectoryPoints",k.value=o,o},A=l=>{B();const o=C(l),i=I(o);g.scene&&i&&g.scene.add(i)},J=l=>`第 ${l+1} 帧`,M=l=>{if(l<0||l>=p.value.length){console.error(`帧索引 ${l} 超出范围`);return}const o=p.value[l];c.value=l,z(o);const i=g.scene;i&&i.updateMatrixWorld(!0),A(l)},Q=async()=>{if(p.value.length===0){q.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,v=!1,p.value.length-1===c.value&&(c.value=0);try{for(let l=c.value+1;l<p.value.length&&!v;l++)await new Promise(o=>setTimeout(o,V.value)),M(l);v||q.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l)}finally{r.value=!1}}},E=async()=>{r.value&&(v=!0,await new Promise(l=>{const o=e.watch(()=>r.value,i=>{o(),l()})}))},ee=async l=>{r.value&&await E(),M(l)},U=async()=>{r.value&&await E(),!(c.value+1>=p.value.length)&&M(c.value+1)},G=async()=>{r.value&&await E(),c.value!==0&&M(c.value-1)},L=()=>{c.value=0},$=async()=>{await E(),B(),L()};return e.onBeforeUnmount(()=>{$()}),a({playAnimation:Q,stopAnimation:E,forwardFrame:U,backwardFrame:G,resetAnimationFrame:L,reset:$}),(l,o)=>{const i=e.resolveComponent("el-input-number"),d=e.resolveComponent("el-form-item"),m=e.resolveComponent("el-form"),P=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",dt,[e.createElementVNode("div",vt,[e.createElementVNode("div",mt,[e.createVNode(m,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(d,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(i,{modelValue:V.value,"onUpdate:modelValue":o[0]||(o[0]=R=>V.value=R),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",ft,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",pt,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(p.value.length),1)]),e.createElementVNode("div",gt,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(P,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=R=>c.value=R),min:0,max:p.value.length>0?p.value.length-1:0,step:1,"format-tooltip":J,onInput:ee,disabled:p.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",ht,[e.createVNode(st,{class:"scroller",list:p.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),Vt=ne._export_sfc(bt,[["__scopeId","data-v-c81a5627"]]),Nt=async h=>{const a=await et(h);return a==null||a.traverse(b=>{b.isMesh&&b.geometry.computeVertexNormals()}),a},yt={class:"obj-viewer-container"},_t={key:0,class:"machine-casing"},wt={class:"buttonGroup-topLeft"},kt={class:"buttonGroup-left"},Ct={class:"buttonGroup-right"},Et={class:"left-panel"},xt={class:"panel-header"},Pt={class:"panel-body"},Tt={key:1,class:"clipping-content"},Dt={class:"radio-group"},St={class:"radio-label"},Bt={class:"radio-label"},Mt={class:"radio-label"},Ut={class:"radio-label"},zt={class:"right-panel"},At={class:"panel-header"},$t={class:"panel-body"},jt={key:1,class:"loading-overlay"},It={key:2,class:"brand"},Lt={class:"brand-item"},Rt={class:"item-value"},Ot={class:"brand-item"},Ft={class:"item-value"},qt={class:"brand-item"},Jt={class:"item-value"},Gt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(h){const a=h,b=re.useModelComp(q.pinia),g=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),r=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.machine}),c=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.产品型号}),V=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.编号}),v=e.computed(()=>{var t;return(t=r==null?void 0:r.value)==null?void 0:t.厂家}),u=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.workpieceInfo}),k=e.computed(()=>{var n;return(n=u.value)==null?void 0:n.name}),x=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.knife}),S=e.ref([]),z=async n=>{!n||!n.isExtra||(await B(n),g==null||g(n==null?void 0:n.pageName),p==null||p(!0))},B=de.debounce(async n=>{await de.onPageBack();const{mainKey:t,baseMenuPath:s}=n||{};re.copyAdd(s,t)},500);e.watch(()=>[c.value,u.value,x.value],()=>{var _,f,se,ie;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};c.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:c.value,label:c.value,baseMenuPath:"设备库/机床"});const s={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/工件库",children:[],show:!0,isPenultimate:!1};u.value&&s.children.push({isExtra:!0,type:(_=u.value)==null?void 0:_.type,pageName:"工件",mainKey:(f=u.value)==null?void 0:f.name,label:(se=u.value)==null?void 0:se.name,baseMenuPath:`工件库/${(ie=u.value)==null?void 0:ie.type}`});const D={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};x.value&&D.children.push({isExtra:!0,pageName:"刀具",mainKey:x.value,label:x.value,baseMenuPath:"设备库/刀具"}),n.push(t,s,D),S.value=n},{immediate:!0});const C=e.ref(!1),I=e.ref([]),A=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.csvUrl});e.watch(()=>A.value,async()=>{if(console.log("three data",a==null?void 0:a.threeData),console.log("csvUrl",A.value),I.value=[],A.value){C.value=!0;const n=await ut(A.value);I.value=n,C.value=!1}},{immediate:!0});const J={"CJ-001":"CJ001榫头","CJ-002":"CJ002榫头","CJ-003":"CJ003榫头"},M=e.computed(()=>J[k.value]),Q=e.computed(()=>{var n;return((n=u.value)==null?void 0:n.type)==="航空发动机叶片"}),E=e.computed(()=>{var t,s;return(s=(t=a==null?void 0:a.threeData)==null?void 0:t.data)==null?void 0:s.bladeObjUrl}),ee=e.ref(j.sceneType.ROBOT),U=e.ref(null),G=e.ref(!1),L=e.ref(""),$=e.ref(!1),l=e.ref(""),o=e.ref(!1),i=e.ref(""),d=e.shallowRef(null),m=e.ref(null),P=e.ref("叶片模型"),R=e.shallowRef(null),fe=e.shallowRef(null),W=e.ref(!0),X=e.shallowRef(null),pe=e.computed(()=>!!X.value),le=e.shallowRef(null),N=e.ref(),{currentModels:H,resetView:ge,initThreeJS:he,handleResize:be,getThreeJSObjects:O,cleanup:Ve,setModels:oe,axesHelperVisible:Ne,toggleAxesVisibility:ye,zoomIn:_e,zoomOut:we}=Y.useThreeJS(U),{loadSceneFromFile:ke}=j.useUrdfLoader(O,H,G,L),{isAnimating:ae,toggleAnimation:Ce,stopAnimation:Ee}=Y.useAnimation(O,H),{isClipping:xe,activeClippingAxis:y,toggleClipping:Pe,updateClippingPlanes:T}=Y.useClipping(O,H),{initRaycaster:Te,selectedObject3D:De,setSelectedObjVisible:Se,updatePosition:Be,updateRotation:Me,dispose:Ue}=j.useRaycaster(U,O,H),ze=()=>{ye()},Ae=e.computed(()=>ee.value===j.sceneType.ROBOT),$e=n=>{$.value=!0,l.value=n,n==="剖面视图"&&!xe.value&&Pe()},K=n=>{n==="智能工艺孪生"?b.setLoadingExeContent(!0):(o.value=!0,i.value=n)},je=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.playAnimation()},Ie=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.stopAnimation()},Le=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.forwardFrame()},Re=()=>{var n;C.value||(n=N==null?void 0:N.value)==null||n.backwardFrame()},te=()=>{var n;(n=N==null?void 0:N.value)==null||n.reset()},Oe=()=>{te(),ge(),m.value&&m.value.resetToZero()},Fe=n=>{if(!n){X.value=null,W.value=!1;return}const t=F.getTargetLink(n,"Base1");X.value=t,W.value=!!(t!=null&&t.visible)},qe=n=>{W.value=n,X.value.visible=n},Je=(n,t)=>{if(M.value){const s=F.getTargetLink(n,M.value);s&&(s.visible=t)}},Ge=(n,t)=>{const s=Object.values(J);for(let D=0;D<s.length;D++){const _=s[D],f=F.getTargetLink(n,_);f&&(f.visible=t)}},We=n=>{n&&Ge(n,!1)},Xe=(n,t)=>F.getMeshFromLink(n,t),He=async n=>{const t=Xe(n,P.value);if(fe.value=t,console.log("bladeObjUrl",E.value),Q.value&&E.value&&t&&Je(n,!0),t&&t.parent&&E.value){const s=await Nt(E.value);s.name="blade_clone",t.parent.add(s),s.position.copy(t.position),s.rotation.copy(t.rotation),s.scale.copy(t.scale),t.visible=!1,R.value=s}else P.value&&console.warn(`在 Blade '${P.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>a.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ke(t).then(s=>{d.value=s,We(s),s&&He(s)}).catch(s=>{console.error("加载URDF文件时发生错误:",s),q.ElMessage.error("加载urdf模型失败"),d.value=null})}else d.value=null},{immediate:!0,deep:!0}),e.watch(d,n=>{te(),n?(oe([n]),m.value=new j.URDFRobotController(n)):(oe([]),m.value=null),Fe(n),Te()});let Z=null;const Ke=()=>{he(),e.nextTick(()=>{U.value&&(Z=new ResizeObserver(be),Z.observe(U.value))});const n=O();le.value=n.scene},Ze=()=>{l.value="",i.value="",Z&&Z.disconnect(),ae.value&&Ee(),te(),Ve(),Ue()};return e.onMounted(async()=>{await e.nextTick();try{Ke()}catch(n){console.error("Three.js 初始化失败:",n),q.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Ze()}),(n,t)=>{const s=e.resolveComponent("el-scrollbar"),D=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",yt,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:U,class:"threejs-container"},null,512),[[e.vShow,Ae.value]]),pe.value?(e.openBlock(),e.createElementBlock("div",_t,[t[13]||(t[13]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Ye._sfc_main$1,{value:W.value,onChange:qe,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",wt,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Oe,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(_e)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(we)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(Ce),title:e.unref(ae)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(Ne),onClick:ze,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",kt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:$e},void 0,!0)]),e.createElementVNode("div",Ct,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:K},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=_=>K("机床控制")),active:o.value&&i.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=_=>K("轨迹路径")),active:o.value&&i.value==="轨迹路径"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"智能工艺孪生",size:"24",title:"智能工艺孪生",onClick:t[2]||(t[2]=_=>K("智能工艺孪生")),active:o.value&&i.value==="智能工艺孪生"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":C.value}])},[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Re}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:je}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Le}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ie})],2),e.withDirectives(e.createElementVNode("div",Et,[e.createElementVNode("div",xt,[e.createElementVNode("span",null,e.toDisplayString(l.value),1),e.createElementVNode("span",{class:"close",onClick:t[3]||(t[3]=_=>$.value=!1)}," X ")]),e.createElementVNode("div",Pt,[e.createVNode(s,{height:"100%"},{default:e.withCtx(()=>{var _;return[l.value==="场景树"?(e.openBlock(),e.createBlock(ue.UrdfTree,{key:0,model:d.value,extraNodes:S.value,onNodeClick:z},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),l.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Tt,[e.createElementVNode("div",Dt,[e.createElementVNode("label",St,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[4]||(t[4]=f=>e.isRef(y)?y.value=f:null),onChange:t[5]||(t[5]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Bt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[6]||(t[6]=f=>e.isRef(y)?y.value=f:null),onChange:t[7]||(t[7]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Mt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[8]||(t[8]=f=>e.isRef(y)?y.value=f:null),onChange:t[9]||(t[9]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Ut,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[10]||(t[10]=f=>e.isRef(y)?y.value=f:null),onChange:t[11]||(t[11]=(...f)=>e.unref(T)&&e.unref(T)(...f))},null,544),[[e.vModelRadio,e.unref(y)]]),t[17]||(t[17]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),l.value==="工件树"?(e.openBlock(),e.createBlock(j.WorkpieceTreePanel,{key:2,model:(_=e.unref(De))==null?void 0:_.obj,onVisibleChange:e.unref(Se),onUpdatePosition:e.unref(Be),onUpdateRotation:e.unref(Me)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,$.value]]),e.withDirectives(e.createElementVNode("div",zt,[e.createElementVNode("div",At,[e.createElementVNode("span",null,e.toDisplayString(i.value),1),e.createElementVNode("span",{class:"close",onClick:t[12]||(t[12]=_=>o.value=!1)}," X ")]),e.createElementVNode("div",$t,[e.createVNode(s,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ue.JointPanel,{model:d.value},null,8,["model"]),[[e.vShow,i.value==="机床控制"]]),e.withDirectives(e.createVNode(Vt,{robot:d.value,scene:le.value,animationData:I.value,ref_key:"bladeTrackPanelRef",ref:N},null,8,["robot","scene","animationData"]),[[e.vShow,i.value==="轨迹路径"&&!C.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:i.value},void 0,!0)]),_:3})])],512),[[e.vShow,o.value]]),G.value?(e.openBlock(),e.createElementBlock("div",jt,[t[18]||(t[18]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(L.value),1)])):e.createCommentVNode("",!0),c.value?(e.openBlock(),e.createElementBlock("div",It,[e.createElementVNode("div",Lt,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",Rt,e.toDisplayString(v.value),1)]),e.createElementVNode("div",Ot,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)]),e.createElementVNode("div",qt,[t[21]||(t[21]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Jt,e.toDisplayString(V.value),1)])])):e.createCommentVNode("",!0),e.createVNode(D,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),Wt=ne._export_sfc(Gt,[["__scopeId","data-v-fea66db4"]]);exports.default=Wt;
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as he, ref as g, watch as J, createElementBlock as D, openBlock as x, createVNode as f, createElementVNode as a, Fragment as xe, renderList as Te, toDisplayString as N, unref as p, withCtx as te, normalizeClass as Ne, nextTick as ge, computed as P, onBeforeUnmount as Me, resolveComponent as X, inject as Ve, shallowRef as Q, onMounted as bt, withDirectives as j, createCommentVNode as K, vShow as ee, renderSlot as pe, createBlock as Ue, isRef as ue, vModelRadio as ce } from "vue";
2
2
  import { a as gt, aD as ht } from "./index.vue_vue_type_style_index_1_lang-DauX0cbH.js";
3
- import { s as De, u as yt, a as _t, U as wt, W as Ct } from "./workpieceTreePanel-DUvzpwQQ.js";
3
+ import { s as De, u as yt, a as _t, U as wt, W as Ct } from "./workpieceTreePanel-BcGXi93D.js";
4
4
  import { d as kt, u as Pt, a as xt, b as Tt } from "./iconfont-C4wStSmY.js";
5
5
  import { E as de, p as Vt } from "./index-CA0SFykF.js";
6
6
  import { s as Ut, b as Dt } from "./pointTrack-Vj4JDyjh.js";
7
7
  import { _ as ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- import { b as Nt, c as Mt } from "./threeViewerHost-CpZDl88r.js";
8
+ import { b as Nt, c as Mt } from "./threeViewerHost-CxfujoTY.js";
9
9
  import { d as At, e as be, f as zt } from "./robotUtil-CCsq_KMK.js";
10
10
  import { y as $t, V as jt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CyYhhHap.js";
11
11
  import { U as Ot, J as Ft } from "./urdfTree-CwxPLXuv.js";
12
- import { a as Lt } from "./index-RK0N00Vd.js";
12
+ import { a as Lt } from "./index-tFBhG3Jy.js";
13
13
  import { T as U } from "./svgIcon-OBhwktPM.js";
14
14
  import { O as Bt } from "./PCDLoader-DxchD5r8.js";
15
- import { K as St, j as Rt } from "./index-B829T3zC.js";
15
+ import { K as St, j as Rt } from "./index-DHyYIvlT.js";
16
16
  const It = async (_) => await new Bt().loadAsync(_), Jt = { class: "table-container" }, Et = { class: "header-cell" }, Gt = ["title"], Wt = ["title"], Kt = /* @__PURE__ */ he({
17
17
  __name: "virtualScroller",
18
18
  props: {
@@ -477,7 +477,7 @@ const Qt = { class: "panel-content" }, ea = { class: "animation-controls" }, ta
477
477
  const e = vt(t, O.value);
478
478
  if (Ae.value = e, console.log("bladeObjUrl", z.value), ve.value && z.value && e && ut(t, !0), e && e.parent && z.value) {
479
479
  const o = await ra(z.value);
480
- o.name = "blade_clone", e.parent.add(o), o.position.copy(e.position), o.rotation.copy(e.rotation), o.scale.set(1e-3, 1e-3, 1e-3), e.visible = !1, H.value = o;
480
+ o.name = "blade_clone", e.parent.add(o), o.position.copy(e.position), o.rotation.copy(e.rotation), o.scale.copy(e.scale), e.visible = !1, H.value = o;
481
481
  } else
482
482
  O.value && console.warn(`在 Blade '${O.value}' 中未找到可替换的网格或其没有父级。`);
483
483
  };
@@ -774,7 +774,7 @@ const Qt = { class: "panel-content" }, ea = { class: "animation-controls" }, ta
774
774
  ]);
775
775
  };
776
776
  }
777
- }), Ya = /* @__PURE__ */ ye($a, [["__scopeId", "data-v-8a080d31"]]);
777
+ }), Ya = /* @__PURE__ */ ye($a, [["__scopeId", "data-v-fea66db4"]]);
778
778
  export {
779
779
  Ya as default
780
780
  };
@@ -1,7 +1,7 @@
1
1
  import { ref as k, computed as $, defineComponent as de, watch as ve, createElementBlock as J, openBlock as V, createStaticVNode as He, createVNode as v, unref as u, withCtx as G, createElementVNode as l, normalizeClass as We, toDisplayString as F, nextTick as xe, resolveComponent as R, shallowRef as K, onMounted as Ye, onBeforeUnmount as Ze, withDirectives as I, createCommentVNode as B, createBlock as ce, renderSlot as he, isRef as W, vModelRadio as Y, vShow as Z } from "vue";
2
2
  import { u as qe, a as Qe, b as et, f as tt, d as ue } from "./iconfont-C4wStSmY.js";
3
3
  import { C as ee, aJ as lt, am as nt, r as at, V as _e, N as ot } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CyYhhHap.js";
4
- import { r as st } from "./threeViewerHost-CpZDl88r.js";
4
+ import { r as st } from "./threeViewerHost-CxfujoTY.js";
5
5
  import { E as Q } from "./index-CA0SFykF.js";
6
6
  import { U as it, J as rt } from "./urdfTree-CwxPLXuv.js";
7
7
  import { s as ct, g as ut, d as Ce, a as Te, c as dt } from "./pointTrack-Vj4JDyjh.js";