ss-component-new 1.2.19 → 1.2.21

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 (94) hide show
  1. package/dist/{animationData-DHZB79in.js → animationData-BgVD7m_Z.js} +4 -4
  2. package/dist/{animationData-CM-r9wyr.cjs → animationData-CMbPkqzG.cjs} +1 -1
  3. package/dist/{array-DtLHXuRQ.cjs → array-CFSAyjws.cjs} +1 -1
  4. package/dist/{array-lSB-nT70.js → array-DPyu0w54.js} +2 -2
  5. package/dist/{index-BdpUfLri.cjs → index-10VrsYdM.cjs} +1 -1
  6. package/dist/{index-BA5XOzgo.js → index-B0IAWN2b.js} +6 -6
  7. package/dist/{index-CQF_xosZ.cjs → index-B1GAMEgu.cjs} +1 -1
  8. package/dist/{index-Cwgs7EkD.js → index-B1XSRq6_.js} +1 -1
  9. package/dist/index-B3GHAekq.cjs +1 -0
  10. package/dist/{index-qagc_PIZ.js → index-B3VR9DS9.js} +127 -127
  11. package/dist/{index-CYp77kPp.js → index-B42dCx1W.js} +35 -35
  12. package/dist/{index-BXBJvXWT.js → index-BHMxqTVw.js} +1 -1
  13. package/dist/{index-BZPwTn-e.js → index-BISAvhZU.js} +3 -3
  14. package/dist/{index-B66Gznvh.cjs → index-BIvF4-_X.cjs} +1 -1
  15. package/dist/{index-DLovX_qy.js → index-BIxz3VQK.js} +11 -11
  16. package/dist/{index-CDLzfr4U.js → index-BKM1OHVI.js} +2 -2
  17. package/dist/{index-CYe2gI66.cjs → index-BKPxS6l5.cjs} +1 -1
  18. package/dist/{index-CCZA5OMk.js → index-BKd-eN-X.js} +45 -45
  19. package/dist/{index-d7fMw53g.cjs → index-BSzMEymQ.cjs} +1 -1
  20. package/dist/{index-C0lRDd5G.cjs → index-BVORb8w5.cjs} +1 -1
  21. package/dist/{index-CJ18eFLi.cjs → index-BaEflW9q.cjs} +1 -1
  22. package/dist/{index-C461j30b.js → index-Bgje9P6C.js} +1 -1
  23. package/dist/{index-CKvtRDgL.cjs → index-Bm44NMcZ.cjs} +1 -1
  24. package/dist/{index-DoJxkMbN.js → index-BnP-OVLZ.js} +19 -19
  25. package/dist/{index-CUm-3IJT.cjs → index-BoBLST3L.cjs} +1 -1
  26. package/dist/{index-Cp9R4hVX.cjs → index-Bpa1jsWq.cjs} +1 -1
  27. package/dist/{index-DW-CHCUy.js → index-BsorG9sX.js} +3 -3
  28. package/dist/{index-CohL-xT-.js → index-Byuw-d13.js} +2 -2
  29. package/dist/{index-DWyHMwpG.js → index-CETOzEkF.js} +6 -6
  30. package/dist/{index-BwjuTBrR.js → index-CFrBvay9.js} +1 -1
  31. package/dist/{index-ClF5mrVY.cjs → index-CPVt8Wrk.cjs} +1 -1
  32. package/dist/{index-BkRpCoTx.cjs → index-CTVVACAH.cjs} +1 -1
  33. package/dist/{index-ct6Uwcq4.cjs → index-CahUIEFl.cjs} +1 -1
  34. package/dist/{index--LhAkpOq.cjs → index-CbslhDEf.cjs} +1 -1
  35. package/dist/{index-Dw4KeMlJ.cjs → index-Cu7pB5GB.cjs} +1 -1
  36. package/dist/{index-Cf79bLZO.js → index-Cu_QyXxB.js} +2 -2
  37. package/dist/{index-DcmGr3J0.cjs → index-CyqP7oeY.cjs} +1 -1
  38. package/dist/{index-BKgbkArH.cjs → index-CyzuptEh.cjs} +1 -1
  39. package/dist/{index-n6maO8qu.js → index-D0fqSkIt.js} +2 -2
  40. package/dist/{index-BfNqdIOP.js → index-D3w8CFxz.js} +4 -4
  41. package/dist/{index-Cqd0F9a9.js → index-DAkKNbYV.js} +12 -12
  42. package/dist/{index-DhqF2CA-.js → index-DRGXzdw7.js} +2 -2
  43. package/dist/{index-CijoI-9f.js → index-DZgwOX56.js} +6 -6
  44. package/dist/{index-DFXZiHSV.cjs → index-DaOTArXF.cjs} +1 -1
  45. package/dist/{index-9YqHJG26.js → index-DhcAF24X.js} +8 -8
  46. package/dist/{index-BovzU-BN.js → index-DmmUjSu_.js} +4 -4
  47. package/dist/{index-BWHJGJ1e.cjs → index-Do4CoXhH.cjs} +1 -1
  48. package/dist/{index-CAkJ-S5C.cjs → index-DpmVXC_Q.cjs} +1 -1
  49. package/dist/{index-C26I2eIi.cjs → index-DubsCmcm.cjs} +1 -1
  50. package/dist/{index-CAAtUOzM.cjs → index-DwkFRUcM.cjs} +1 -1
  51. package/dist/{index-CvSBsAV7.cjs → index-FGO3o5gd.cjs} +1 -1
  52. package/dist/{index-CutRp0mU.js → index-IplqGB4d.js} +6 -6
  53. package/dist/{index-Ckc2csf3.js → index-Z-Tg_cZ7.js} +2 -2
  54. package/dist/{index-CY02zKVE.cjs → index-bL_GpYsf.cjs} +1 -1
  55. package/dist/{index-CqnPwWag.js → index-lzrjiUS5.js} +2 -2
  56. package/dist/{index-Cd58A7uv.cjs → index-rhNfaMfG.cjs} +1 -1
  57. package/dist/{index-B19xwKx1.js → index-sUsojzpW.js} +1 -1
  58. package/dist/{index-CwVl7hYK.js → index-w38DtIEl.js} +6 -6
  59. package/dist/{index-BdioXHog.js → index-x1q2XfBL.js} +12 -12
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CqTDROhf.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Be4dFvUC.js} +2 -2
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DMNlG9dC.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CIRzfvAn.cjs} +1 -1
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DZZXEjAk.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-6zdxGopn.js} +13 -13
  63. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CM9szr9Y.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-97ZyXl6J.cjs} +1 -1
  64. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DCpKvb-8.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-BgIXU87c.js} +11641 -11513
  65. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-CY0MiFwy.cjs +56 -0
  66. package/dist/{index.vue_vue_type_style_index_1_lang-CecxMizO.cjs → index.vue_vue_type_style_index_1_lang-29vzgcAi.cjs} +1 -1
  67. package/dist/{index.vue_vue_type_style_index_1_lang-BswQV5Lr.js → index.vue_vue_type_style_index_1_lang-CtkjAjQ8.js} +3 -3
  68. package/dist/index.vue_vue_type_style_index_1_lang-DUZFMfkl.js +8310 -0
  69. package/dist/index.vue_vue_type_style_index_1_lang-ckXQqCiT.cjs +32 -0
  70. package/dist/{isString-BNK38WbE.js → isString-BrYdkZh8.js} +1 -1
  71. package/dist/{main-oZpjzC8J.cjs → main-Bt-9WV5Z.cjs} +1 -1
  72. package/dist/{main-DD4ds9VF.js → main-DNN-2mgC.js} +5 -5
  73. package/dist/ss-component.cjs +1 -1
  74. package/dist/ss-component.css +1 -1
  75. package/dist/ss-component.js +11 -11
  76. package/dist/ss-component2.cjs +1 -1
  77. package/dist/ss-component2.js +12 -12
  78. package/dist/{threeLatheView-Bp0kjo_V.js → threeLatheView-DuqX5kKf.js} +2 -2
  79. package/dist/{threeModel-CFk-bjEz.cjs → threeModel-14TQ7qah.cjs} +1 -1
  80. package/dist/{threeModel-od894OgJ.js → threeModel-KPFJkl4n.js} +3 -3
  81. package/dist/{threePreview-DFFjm93P.js → threePreview-B7C8gY5w.js} +1 -1
  82. package/dist/{threeSceneView-DKa3NvXL.cjs → threeSceneView-Bb-MdEV9.cjs} +1 -1
  83. package/dist/{threeSceneView-J9yJnd-8.js → threeSceneView-SrIIrGLz.js} +8 -8
  84. package/dist/{threeSceneViewForCPMPIP-C9RBmFtK.js → threeSceneViewForCPMPIP-CN_9lSRm.js} +25 -25
  85. package/dist/{threeSceneViewForCPMPIP-cGJ49EX2.cjs → threeSceneViewForCPMPIP-Da6YyhFH.cjs} +1 -1
  86. package/dist/{threeViewerHost-Cpea-3lX.js → threeViewerHost-BwiicdtA.js} +10 -10
  87. package/dist/{threeViewerHost-DqllErXG.cjs → threeViewerHost-U-AzJqIN.cjs} +1 -1
  88. package/dist/{useRayCaster-B2SPBFYC.js → useRayCaster-Bx73bXeL.js} +1 -1
  89. package/dist/{useRayCaster-CjOF8Be7.cjs → useRayCaster-CnW80o7b.cjs} +1 -1
  90. package/package.json +1 -1
  91. package/dist/index-BRbH6lIH.cjs +0 -1
  92. package/dist/index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-_Oz7xRLf.cjs +0 -56
  93. package/dist/index.vue_vue_type_style_index_1_lang-CT_2jezv.cjs +0 -32
  94. package/dist/index.vue_vue_type_style_index_1_lang-DMXip4Xp.js +0 -8260
@@ -1,27 +1,27 @@
1
1
  import { defineAsyncComponent as o } from "vue";
2
2
  import { S as I } from "./index-BHtNKL1L.js";
3
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CqTDROhf.js";
4
- import { u as C } from "./index.vue_vue_type_style_index_1_lang-DMXip4Xp.js";
5
- import "./index-CYp77kPp.js";
3
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Be4dFvUC.js";
4
+ import { u as C } from "./index.vue_vue_type_style_index_1_lang-DUZFMfkl.js";
5
+ import "./index-B42dCx1W.js";
6
6
  import u from "./ss-component2.js";
7
7
  import { t as g, c as T, b as P } from "./index-C2usxP_Q.js";
8
- const n = o(() => import("./main-DD4ds9VF.js"));
8
+ const n = o(() => import("./main-DNN-2mgC.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-CwVl7hYK.js").then((t) => t.k));
12
+ const s = o(() => import("./index-w38DtIEl.js").then((t) => t.k));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-B19xwKx1.js"));
16
+ const r = o(() => import("./index-sUsojzpW.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-DLovX_qy.js"));
20
+ const m = o(() => import("./index-BIxz3VQK.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
24
- const i = o(() => import("./index-Cf79bLZO.js"));
24
+ const i = o(() => import("./index-Cu_QyXxB.js"));
25
25
  i.install = (t) => {
26
26
  t.component("ssCanvas", i);
27
27
  };
@@ -29,15 +29,15 @@ const c = o(() => import("./index-DiRBJiMW.js"));
29
29
  c.install = (t) => {
30
30
  t.component("ssFold", c);
31
31
  };
32
- const a = o(() => import("./index-n6maO8qu.js").then((t) => t.i));
32
+ const a = o(() => import("./index-D0fqSkIt.js").then((t) => t.i));
33
33
  a.install = (t) => {
34
34
  t.component("ssAvatar", a);
35
35
  };
36
- const l = o(() => import("./threeModel-od894OgJ.js"));
36
+ const l = o(() => import("./threeModel-KPFJkl4n.js"));
37
37
  l.install = (t) => {
38
38
  t.component("ssThree", l);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-Cpea-3lX.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-BwiicdtA.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-CxnH4vfV.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-Cd58A7uv.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CAAtUOzM.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-B66Gznvh.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-CYe2gI66.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-CY02zKVE.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index--LhAkpOq.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-BdpUfLri.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-CUm-3IJT.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-BKgbkArH.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-BWHJGJ1e.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-CAkJ-S5C.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-CxnH4vfV.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-rhNfaMfG.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-DwkFRUcM.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-BIvF4-_X.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-BKPxS6l5.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-bL_GpYsf.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-CbslhDEf.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-10VrsYdM.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-BoBLST3L.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-CyzuptEh.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-Do4CoXhH.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-DpmVXC_Q.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;
@@ -3,17 +3,17 @@ const a = [
3
3
  {
4
4
  path: "/tenant",
5
5
  name: "Tenant",
6
- component: async () => import("./index-C461j30b.js")
6
+ component: async () => import("./index-Bgje9P6C.js")
7
7
  },
8
8
  {
9
9
  path: "/login",
10
10
  name: "Login",
11
- component: async () => import("./index-DW-CHCUy.js")
11
+ component: async () => import("./index-BsorG9sX.js")
12
12
  },
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-DoJxkMbN.js"),
16
+ component: async () => import("./index-BnP-OVLZ.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-CijoI-9f.js")
34
+ component: async () => import("./index-DZgwOX56.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-BfNqdIOP.js")
39
+ component: async () => import("./index-D3w8CFxz.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-BA5XOzgo.js")
44
+ component: async () => import("./index-B0IAWN2b.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-9YqHJG26.js")
49
+ component: async () => import("./index-DhcAF24X.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-BZPwTn-e.js")
54
+ component: async () => import("./index-BISAvhZU.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-DWyHMwpG.js")
59
+ component: async () => import("./index-CETOzEkF.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-BdioXHog.js")
64
+ component: async () => import("./index-x1q2XfBL.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-Ckc2csf3.js")
69
+ component: async () => import("./index-Z-Tg_cZ7.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-DhqF2CA-.js")
74
+ component: async () => import("./index-DRGXzdw7.js")
75
75
  }
76
76
  // {
77
77
  // path: 'priority',
@@ -2,8 +2,8 @@ import { defineComponent as ae, ref as b, shallowRef as N, computed as re, watch
2
2
  import { u as ve, a as ge, b as pe, S as c } from "./iconfont-pt17sMx3.js";
3
3
  import { U as he, J as ze } from "./urdfTree-BuTtRGdl.js";
4
4
  import { B as Ce, V as _, p as ye, ax as xe, a9 as be, ah as ke, l as we } from "./three-viewport-gizmo-CkQ98n-T.js";
5
- import { i as Pe } from "./isString-BNK38WbE.js";
6
- import { E as Me } from "./index-CYp77kPp.js";
5
+ import { i as Pe } from "./isString-BrYdkZh8.js";
6
+ import { E as Me } from "./index-B42dCx1W.js";
7
7
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  function Ae(o) {
9
9
  const n = [];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-BRbH6lIH.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-CecxMizO.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-1z9RrjZc.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=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;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},C=()=>{P=requestAnimationFrame(C),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){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),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=E*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(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 f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{g=[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(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(E(),h.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 h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{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"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={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"},ae=.001,Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.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,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??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(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 G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=y(s),T=a*ae,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=G*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},U=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.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,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))}),U(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,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)}),U(-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?(g.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",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+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",_e,[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:G=>L(i.name,G.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-035ae936"]]),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:h}){const u=z,d=h,g=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},E=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.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:g.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"],Ge=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 h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;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(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={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:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,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,G=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(G,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[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(U),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:(G=k.value)==null?void 0:G.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(g),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(E.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("./three-viewport-gizmo-BV37JzRa.cjs"),pe=require("./OrbitControls-Co_9huz0.cjs"),me=require("./index-B3GHAekq.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-29vzgcAi.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-1z9RrjZc.cjs");function ve(z){let h=null,u=null,d=null,g=null,x=null,P=null,c=null,E=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;h=new n.Scene,h.background=new n.Color(15790320);const m=z.value;u=new n.PerspectiveCamera(75,m.clientWidth/m.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(m.clientWidth,m.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,m.appendChild(d.domElement),g=new pe.OrbitControls(u,d.domElement),g.enableDamping=!0,g.dampingFactor=.05,g.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},g.panSpeed=.7,x=new n.Xe(u,d,{container:m,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(g),f(),C()},t=(m,l)=>{c&&(h.remove(c),c.dispose()),E&&(h.remove(E),E.geometry.dispose(),E.material.dispose());const _=Math.min(Math.max(Math.floor(m/20),30),40);c=new n.GridHelper(m,_,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),h.add(c);const B=new n.PlaneGeometry(m,m),O=new n.ShadowMaterial({opacity:.3,color:0});E=new n.Mesh(B,O),E.position.copy(l),E.position.z-=.01,E.receiveShadow=!0,h.add(E)},p=()=>{if(b.value.length===0)return;const m=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)m.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);m.union(Z.box),l=!0}else m.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const _=m.getSize(new n.Vector3),B=m.getCenter(new n.Vector3),O=Math.max(_.x,_.y,_.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,m.min.z);t(j,q)},f=()=>{const m=new n.AmbientLight(4210752,.6);h.add(m);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,h.add(l);const _=new n.DirectionalLight(16777215,.8);_.position.set(-8,-8,6),h.add(_);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),h.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);h.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),h.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),h.add(q)},C=()=>{P=requestAnimationFrame(C),g&&g.update();const m=performance.now(),l=m-S;l<D||(S=m-l%D,d&&h&&u&&d.render(h,u),x&&x.render())},I=m=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(_=>{m[_]&&m[_].dispose&&m[_].dispose()}),m.dispose&&m.dispose()},A=m=>{m==null||m.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(_=>{I(_)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const m=z.value,l=m.clientWidth,_=m.clientHeight;u.aspect=l/_,u.updateProjectionMatrix(),d.setSize(l,_),x.update()},fitCameraToAllModels:m=>{if(!u||!g||b.value.length===0)return;const l=new n.Box3;let _=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),_=!0;else if(Z.userData.modelId&&m.has(Z.userData.modelId)){const ee=m.get(Z.userData.modelId);l.union(ee.box),_=!0}else l.expandByObject(Z),_=!0}),!_){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),g.target.copy(O),g.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:h,camera:u,renderer:d,controls:g,gizmo:x}),clearAllModels:()=>{if(!h)return;b.value.forEach(l=>{h.remove(l),A(l)});const m=[];h.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==E&&m.push(l)}),m.forEach(l=>{h.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),E&&(E.geometry.dispose(),E.material.dispose()),d&&d.dispose(),g&&g.dispose(),x&&x.dispose()},updateGridForModels:p}}function he(z,h){const u=e.ref(!1);let d=null,g=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,E=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,f=E*1.2,C=new n.Vector3(c.x+f,c.y,c.z),I=new n.Vector3(c.x,c.y+f,c.z),A=new n.Vector3(c.x,c.y-f,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*f,p.z=c.z+Math.sin($)*f,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(C,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*f,p.y=c.y+Math.cos(J)*f,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const f=Date.now()-d,C=Math.min(f/g,1);if(C>=1){k();return}const I=S(C);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(h.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const f=new n.Box3;h.value.forEach(U=>{f.expandByObject(U)});const C=f.getSize(new n.Vector3);c=f.getCenter(new n.Vector3),E=Math.max(C.x,C.y,C.z)*1.2;const I=new n.Vector3(c.x+E*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const U=Date.now()-$,Y=Math.min(U/L,1),m=D(Y);t.position.lerpVectors(A,I,m),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(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 f=t.position.clone(),C=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),U=D(J);t.position.lerpVectors(f,x,U),p.target.lerpVectors(C,P,U),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function ge(z,h){const u=e.ref(!1),d=e.ref("none");let g=[],x=[],P=new n.Box3,c=new n.Vector3;const E=()=>{g=[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(),h.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,f,C;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),f=new n.Vector3(c.x,c.y,c.z),C=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(f),A.rotation.copy(C),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(g[0].constant=-c.x,y=g[0]):d.value==="y"?(g[1].constant=-c.y,y=g[1]):d.value==="z"&&(g[2].constant=-c.z,y=g[2]),y){h.value.forEach(p=>{p.traverse(f=>{f.isMesh&&f.material&&(Array.isArray(f.material)?f.material.forEach(C=>{C.clippingPlanes=[y]}):f.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{h.value.forEach(y=>{y.traverse(t=>{t.isMesh&&t.material&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(E(),h.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 h=z;e.ref();const u=e.ref();return e.watch(()=>[h==null?void 0:h.animationData],()=>{var g;let d=((g=re.cloneDeep(h==null?void 0:h.animationData))==null?void 0:g["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,g)=>{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"},Ce={class:"joint-name"},Ee={class:"joint-range"},be={class:"joint-type"},_e={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"},ae=.001,Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:h}){const u=z;e.ref(!0);const d=e.ref([]),g=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),E=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let f=[];e.watch(()=>u.animationData,o=>{var i;E.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(f=v)},{deep:!0}),e.computed(()=>f.length>0);const C=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!g.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return g.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,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??C(s._jointType,!1),upper:s.limit.upper??C(s._jointType,!0)}:{lower:C(s._jointType,!1),upper:C(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 G=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(G),w.localZ.applyMatrix4(G)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae)),v.push(w.pos.clone())),s>0&&a>0){const G=y(s),T=a*ae,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=G*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},U=(o,v=0)=>{let i=f.slice(0,o+1);const V=f[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,E.value-s),w=[];w.push(new n.Vector3(0,0,0));const G=new n.Vector3(0,a*ae,0);a>0&&w.push(G);let T={pos:G.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,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))}),U(v,i))},m=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=m(a,w||a,i)}),V},_=()=>{if(f.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=f.length-1){const s=f[f.length-1];Y(s,f.length-1,1),j();return}const v=r.value/ue,i=f[o],V=f[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};h({startAnimation:_,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)}),U(-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?(g.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",Ce,e.toDisplayString(i.name),1),e.createElementVNode("span",Ee," ["+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",_e,[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:G=>L(i.name,G.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-035ae936"]]),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:h}){const u=z,d=h,g=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},E=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(f=>f.children&&f.children.length>0).slice(0,k).map(f=>f.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!g.value||g.value.length===0?[]:u.expandStrategy==="firstLevel"?D(g.value,u.maxExpandCount):F(g.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?E(u.model):[]);return e.watch(b,r=>{g.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:g.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"],Ge=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 h=z,u=e.computed(()=>({backgroundColor:h.backgroundColor})),d=e.computed(()=>`#${h.prefix}-${h.name}`),g=e.computed(()=>{const{size:x}=h;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(g.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ge,[["__scopeId","data-v-3150a90b"]]),Ue={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:h,emit:u}){const d=u;let g=null,x=!1;const P=e.ref(null),c=e.ref(!1),E=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:f,handleResize:C,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:U,stopAnimation:Y}=he(A,y),{isClipping:m,activeClippingAxis:l,toggleClipping:_,updateClippingPlanes:B}=ge(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,E,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,G=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(G,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),m.value&&_();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!m.value&&_()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{f(),g=A().scene,x=!0,window.addEventListener("resize",C)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",C),J.value&&Y(),$()}),h({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var G,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ue,[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(U),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:(G=k.value)==null?void 0:G.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(g),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(E.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
@@ -1,10 +1,10 @@
1
1
  import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
2
2
  import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, a as Qe, A as et, b as tt, M as Re, X as nt, G as at, c as Me, d as ot, e as De, f as st, D as ke, H as lt, g as Ve, h as Oe, i as Ue, j as ze, E as _e, k as de, l as it, m as rt, T as ct } from "./three-viewport-gizmo-CkQ98n-T.js";
3
3
  import { O as ut } from "./OrbitControls-C0QRmW6_.js";
4
- import { s as dt } from "./index-qagc_PIZ.js";
5
- import { u as pt } from "./index.vue_vue_type_style_index_1_lang-BswQV5Lr.js";
4
+ import { s as dt } from "./index-B3VR9DS9.js";
5
+ import { u as pt } from "./index.vue_vue_type_style_index_1_lang-CtkjAjQ8.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
- import { c as Ge, E as Ie } from "./index-CYp77kPp.js";
7
+ import { c as Ge, E as Ie } from "./index-B42dCx1W.js";
8
8
  function mt(E) {
9
9
  let f = null, r = null, c = null, v = null, w = null, k = null, i = null, A = null;
10
10
  const F = 1e3 / 30;
@@ -2,7 +2,7 @@ import { ref as K, shallowRef as je, defineComponent as Be, watch as Z, onMounte
2
2
  import { u as Ye, a as $e, b as Je, S as j } from "./iconfont-pt17sMx3.js";
3
3
  import { M as Qe, O as Ze, S as en } from "./STLLoader-CiUjaQtA.js";
4
4
  import { v as nn, w as ce, x as ye, y as tn, z as W, F as be, I as O, J as Se, C as G, K as F, b as Y, N as sn, g as rn, D as on, k as Q, V as B, O as an, Q as Ne, R as cn, U as Ie, Y as ln, Z as un, _ as te, $ as dn, a0 as Ce, a1 as fn, a2 as hn, a3 as pn, a4 as le, a5 as Oe, a6 as ue, a7 as mn, a8 as gn, a9 as Tn, aa as se, ab as xn, o as ve, i as Rn, ac as q, ad as En, p as An, ae as Ln, e as ke, af as _n, r as Mn, ag as wn, ah as yn, n as re, P as bn, l as Sn, ai as Nn, aj as In, ak as Cn, al as On, am as vn, an as Fe, ao as kn, ap as me, aq as ge, ar as Te, as as xe, at as Re, au as Fn, av as Pn, B as Pe, aw as Dn, h as Hn } from "./three-viewport-gizmo-CkQ98n-T.js";
5
- import { E as Ee } from "./index-CYp77kPp.js";
5
+ import { E as Ee } from "./index-B42dCx1W.js";
6
6
  import { _ as Un } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  function Ae(d, n) {
8
8
  if (n === nn)
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),J=require("./useRayCaster-CjOF8Be7.cjs"),S=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DMNlG9dC.cjs");const T=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-CT_2jezv.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-ClF5mrVY.cjs");require("./index.vue_vue_type_style_index_1_lang-CecxMizO.cjs");const a=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-Cp9R4hVX.cjs");const Ne=require("./animationData-CM-r9wyr.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=require("./urdfTree-CCktg0FK.cjs"),q=.001,oe=a.MathUtils.degToRad,Ce=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Re(V=.005,v=64){const w=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),s=new a.TubeGeometry(w,v,V,16,!1),h=Ce;return new a.Mesh(s,h)}const Se=V=>V.reduce((v,w)=>{let s=0;const h=w.Y??0,E=w.C??0,d=w.R??0;return h>0&&(s+=h),E>0&&d>0&&(s+=d*oe(E)),v+s},0),ke=V=>{const v=[],w=V.Y??0,s=V.B??0,h=V.C??0,E=V.R??0,d={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!w&&!h)return v;if(v.push(d.pos.clone()),s!==0){const _=new a.Matrix4().makeRotationAxis(d.localY,oe(s));d.localX.applyMatrix4(_),d.localZ.applyMatrix4(_)}if(w>0&&(d.pos.add(d.localY.clone().multiplyScalar(w*q)),v.push(d.pos.clone())),h>0&&E>0){const _=oe(h),x=E*q,u=d.pos.clone().add(d.localX.clone().multiplyScalar(-x)),i=Math.max(16,Math.ceil(h/5));for(let f=1;f<=i;f++){const l=_*f/i,p=new a.Matrix4().makeRotationAxis(d.localZ,l),y=d.localX.clone().multiplyScalar(x).applyMatrix4(p),C=u.clone().add(y);v.push(C)}}return v};function De(V,v){const w=new a.Group;w.name="CompletePipe";const s={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,E=1;for(let d=0;d<V.length;d++){const _=V[d],x=_.Y??0,u=_.B??0,i=_.C??0,f=_.R??0;if(u!==0){const l=new a.Matrix4().makeRotationAxis(s.localY,oe(u));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(x>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(x*q));const p=s.pos.clone(),c=Te(l,p,v*q);c.userData={segmentType:"straight",segmentIndex:h,frameIndex:d,length:x,frame:{Y:x,B:u,C:i,R:f}},c.name=`直段_${h}`,w.add(c);const y=l.clone();Pe(w,E,y,v*q),h++}if(i>0&&f>0){const l=oe(i),p=f*q,c=[];c.push(s.pos.clone());const y=s.pos.clone().add(s.localX.clone().multiplyScalar(-p)),C=Math.max(16,Math.ceil(i/5));for(let R=1;R<=C;R++){const F=l*R/C,k=new a.Matrix4().makeRotationAxis(s.localZ,F),L=s.localX.clone().multiplyScalar(p).applyMatrix4(k),W=y.clone().add(L);c.push(W)}const b=$e(c,v*q);b.userData={segmentType:"bend",segmentIndex:h,frameIndex:d,angle:i,radius:f,centerPoint:y.toArray(),frame:{Y:x,B:u,C:i,R:f}},b.name=`弯段_${h}`,w.add(b),Math.floor(c.length/2),c[0],s.pos=c[c.length-1].clone();const M=new a.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(M),s.localX.applyMatrix4(M),h++,E++}}return w}function Pe(V,v,w,s){const h=new a.Vector3(0,s*2,s*5),E=w.clone().add(h),d=[w,E],_=new a.BufferGeometry().setFromPoints(d),x=new a.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),u=new a.Line(_,x);u.computeLineDistances(),V.add(u);const i=document.createElement("canvas"),f=i.getContext("2d");i.width=128,i.height=128,f.clearRect(0,0,128,128),f.fillStyle="#FF0000",f.font="bold 80px Arial",f.textAlign="center",f.textBaseline="middle",f.fillText(v.toString(),64,64);const l=new a.CanvasTexture(i),p=new a.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),c=new a.Sprite(p),y=s*3;c.scale.set(y,y,1),c.position.copy(E),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Te(V,v,w){const s=new a.LineCurve3(V,v),h=new a.TubeGeometry(s,2,w,18,!1);return new a.Mesh(h,Ce)}function $e(V,v){const w=new a.CatmullRomCurve3(V,!1,"catmullrom",.01),s=new a.TubeGeometry(w,Math.max(16,V.length*2),v,18,!1);return new a.Mesh(s,Ce)}function Ee(V,v,w,s,h,E=0){let d=v.slice(0,h+1);const _=v[h+1];if(_&&E>0){const c={..._,B:(_.B??0)*E,C:(_.C??0)*E};d.push(c)}const x=Se(d),u=Math.max(0,w-x),i=[];i.push(new a.Vector3(0,0,0));const f=new a.Vector3(0,u*q,0);u>0&&i.push(f);let l={pos:f.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let c=d.length-1;c>=0;c--){const y=d[c],C=ke(y);if(C.length>0){const b=C.map(k=>{const D=k.clone(),L=new a.Matrix4;return L.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(L),D.add(l.pos)});p.push(b);const M=b[b.length-1];l.pos=M.clone();const R=y.B??0,F=y.C??0;if(R!==0){const k=new a.Matrix4().makeRotationAxis(l.localY,oe(R));l.localX.applyMatrix4(k),l.localZ.applyMatrix4(k)}if(F>0){const k=oe(F),D=new a.Matrix4().makeRotationAxis(l.localZ,k);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const c of p)c.length>1&&i.push(...c.slice(1));i.length<2&&i.push(new a.Vector3(0,.001,0));try{const c=new a.CatmullRomCurve3(i,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,i.length*4),s*q,18,!1);V.geometry.dispose(),V.geometry=y}catch(c){console.error("管件更新失败",c)}}function xe(V,v,w,s=0){let h=V.slice(0,w+1);const E=V[w+1];if(E&&s>0){const l={...E,B:(E.B??0)*s,C:(E.C??0)*s};h.push(l)}const d=Se(h),_=Math.max(0,v-d),x=[];x.push(new a.Vector3(0,0,0));const u=new a.Vector3(0,_*q,0);_>0&&x.push(u);let i={pos:u.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const f=[];for(let l=h.length-1;l>=0;l--){const p=h[l],c=ke(p);if(c.length>0){const y=c.map(R=>{const F=R.clone(),k=new a.Matrix4;return k.makeBasis(i.localX,i.localY,i.localZ),F.applyMatrix4(k),F.add(i.pos)});f.push(y);const C=y[y.length-1];i.pos=C.clone();const b=p.B??0,M=p.C??0;if(b!==0){const R=new a.Matrix4().makeRotationAxis(i.localY,oe(b));i.localX.applyMatrix4(R),i.localZ.applyMatrix4(R)}if(M>0){const R=oe(M),F=new a.Matrix4().makeRotationAxis(i.localZ,R);i.localY.applyMatrix4(F),i.localX.applyMatrix4(F)}}}for(const l of f)l.length>1&&x.push(...l.slice(1));return x.length<2&&x.push(new a.Vector3(0,.001,0)),x}function Me(V,v,w,s,h,E,d,_=0,x=0){const u=h-x,i=xe(s,u,d,_);let l=xe(w,x,d,_);l.forEach(c=>c.y=-c.y),l.reverse();const p=[...l,...i];try{const c=new a.CatmullRomCurve3(p,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,p.length*4),E*q,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=y}catch(c){console.error("管件更新失败",c)}}const ze={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},Fe={class:"control-row"},Ye={class:"control-row"},Ie={class:"frame-info"},Le={class:"control-row"},je={class:"progress-bar"},Ue={class:"dialog-footer"},Oe=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:v,emit:w}){const s=V,h=w,E=e.ref(),d=e.ref(),_=e.ref();e.watch(()=>s.threeData,t=>{const o=t==null?void 0:t.data;_.value=o==null?void 0:o.type},{immediate:!0});const x=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};_.value===J.robotMode.SINGLE&&(o=await Ne.fetchSingleRobotAnimationData()),_.value===J.robotMode.DOUBLE&&(o=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:n=0,pipeRadius:N=0,clampLength:B=0,animationData:U}=o;k.value=n,D.value=N,L.value=B,E.value=U;const O=T.cloneDeep(E.value),ee=re(A.value),K=(O==null?void 0:O["输出(动画数据)"])||[];u.value=K.length?K:[ee];let ne=(O==null?void 0:O["输出(动画数据)Content"])??[];ne&&(d.value=ne)},u=e.ref([]),i=e.ref(!1),f=e.ref(""),l=e.ref(!1),p=e.ref(0),c=e.ref(0),y=e.ref(1e3);let C=!1;const b=e.ref(null),M=e.shallowRef(null),R=e.shallowRef(null),F=e.shallowRef(null),k=e.ref(0),D=e.ref(12.5),L=e.ref(30),W=e.ref([]),P=e.ref(null),g=e.computed(()=>s.model?Object.values(s.model.joints).filter(t=>t.jointType!=="fixed").map(t=>t.name):[]),I=e.ref(["Y","B","C","R"]),A=e.computed(()=>[...g.value,...I.value]),j=e.computed(()=>A.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),J=require("./useRayCaster-CnW80o7b.cjs"),S=require("./iconfont-t5epssvu.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CIRzfvAn.cjs");const T=require("./index-1z9RrjZc.cjs");require("./index.vue_vue_type_style_index_1_lang-ckXQqCiT.cjs");require("./index-BpPyaNFa.cjs");const te=require("./index-CPVt8Wrk.cjs");require("./index.vue_vue_type_style_index_1_lang-29vzgcAi.cjs");const a=require("./three-viewport-gizmo-BV37JzRa.cjs");require("./index-Bpa1jsWq.cjs");const Ne=require("./animationData-CMbPkqzG.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),_e=require("./urdfTree-CCktg0FK.cjs"),q=.001,oe=a.MathUtils.degToRad,Ce=new a.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:a.DoubleSide});function Re(V=.005,v=64){const w=new a.CatmullRomCurve3([new a.Vector3(0,0,0),new a.Vector3(0,0,0)]),s=new a.TubeGeometry(w,v,V,16,!1),h=Ce;return new a.Mesh(s,h)}const Se=V=>V.reduce((v,w)=>{let s=0;const h=w.Y??0,E=w.C??0,d=w.R??0;return h>0&&(s+=h),E>0&&d>0&&(s+=d*oe(E)),v+s},0),ke=V=>{const v=[],w=V.Y??0,s=V.B??0,h=V.C??0,E=V.R??0,d={pos:new a.Vector3(0,0,0),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};if(!w&&!h)return v;if(v.push(d.pos.clone()),s!==0){const _=new a.Matrix4().makeRotationAxis(d.localY,oe(s));d.localX.applyMatrix4(_),d.localZ.applyMatrix4(_)}if(w>0&&(d.pos.add(d.localY.clone().multiplyScalar(w*q)),v.push(d.pos.clone())),h>0&&E>0){const _=oe(h),x=E*q,u=d.pos.clone().add(d.localX.clone().multiplyScalar(-x)),i=Math.max(16,Math.ceil(h/5));for(let f=1;f<=i;f++){const l=_*f/i,p=new a.Matrix4().makeRotationAxis(d.localZ,l),y=d.localX.clone().multiplyScalar(x).applyMatrix4(p),C=u.clone().add(y);v.push(C)}}return v};function De(V,v){const w=new a.Group;w.name="CompletePipe";const s={pos:new a.Vector3(0,0,0),localX:new a.Vector3(1,0,0),localY:new a.Vector3(0,1,0),localZ:new a.Vector3(0,0,1)};let h=0,E=1;for(let d=0;d<V.length;d++){const _=V[d],x=_.Y??0,u=_.B??0,i=_.C??0,f=_.R??0;if(u!==0){const l=new a.Matrix4().makeRotationAxis(s.localY,oe(u));s.localX.applyMatrix4(l),s.localZ.applyMatrix4(l)}if(x>0){const l=s.pos.clone();s.pos.add(s.localY.clone().multiplyScalar(x*q));const p=s.pos.clone(),c=Te(l,p,v*q);c.userData={segmentType:"straight",segmentIndex:h,frameIndex:d,length:x,frame:{Y:x,B:u,C:i,R:f}},c.name=`直段_${h}`,w.add(c);const y=l.clone();Pe(w,E,y,v*q),h++}if(i>0&&f>0){const l=oe(i),p=f*q,c=[];c.push(s.pos.clone());const y=s.pos.clone().add(s.localX.clone().multiplyScalar(-p)),C=Math.max(16,Math.ceil(i/5));for(let R=1;R<=C;R++){const F=l*R/C,k=new a.Matrix4().makeRotationAxis(s.localZ,F),L=s.localX.clone().multiplyScalar(p).applyMatrix4(k),W=y.clone().add(L);c.push(W)}const b=$e(c,v*q);b.userData={segmentType:"bend",segmentIndex:h,frameIndex:d,angle:i,radius:f,centerPoint:y.toArray(),frame:{Y:x,B:u,C:i,R:f}},b.name=`弯段_${h}`,w.add(b),Math.floor(c.length/2),c[0],s.pos=c[c.length-1].clone();const M=new a.Matrix4().makeRotationAxis(s.localZ,l);s.localY.applyMatrix4(M),s.localX.applyMatrix4(M),h++,E++}}return w}function Pe(V,v,w,s){const h=new a.Vector3(0,s*2,s*5),E=w.clone().add(h),d=[w,E],_=new a.BufferGeometry().setFromPoints(d),x=new a.LineDashedMaterial({color:16711680,dashSize:s*.5,gapSize:s*.3,linewidth:1}),u=new a.Line(_,x);u.computeLineDistances(),V.add(u);const i=document.createElement("canvas"),f=i.getContext("2d");i.width=128,i.height=128,f.clearRect(0,0,128,128),f.fillStyle="#FF0000",f.font="bold 80px Arial",f.textAlign="center",f.textBaseline="middle",f.fillText(v.toString(),64,64);const l=new a.CanvasTexture(i),p=new a.SpriteMaterial({map:l,transparent:!0,depthTest:!1,depthWrite:!1}),c=new a.Sprite(p),y=s*3;c.scale.set(y,y,1),c.position.copy(E),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function Te(V,v,w){const s=new a.LineCurve3(V,v),h=new a.TubeGeometry(s,2,w,18,!1);return new a.Mesh(h,Ce)}function $e(V,v){const w=new a.CatmullRomCurve3(V,!1,"catmullrom",.01),s=new a.TubeGeometry(w,Math.max(16,V.length*2),v,18,!1);return new a.Mesh(s,Ce)}function Ee(V,v,w,s,h,E=0){let d=v.slice(0,h+1);const _=v[h+1];if(_&&E>0){const c={..._,B:(_.B??0)*E,C:(_.C??0)*E};d.push(c)}const x=Se(d),u=Math.max(0,w-x),i=[];i.push(new a.Vector3(0,0,0));const f=new a.Vector3(0,u*q,0);u>0&&i.push(f);let l={pos:f.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const p=[];for(let c=d.length-1;c>=0;c--){const y=d[c],C=ke(y);if(C.length>0){const b=C.map(k=>{const D=k.clone(),L=new a.Matrix4;return L.makeBasis(l.localX,l.localY,l.localZ),D.applyMatrix4(L),D.add(l.pos)});p.push(b);const M=b[b.length-1];l.pos=M.clone();const R=y.B??0,F=y.C??0;if(R!==0){const k=new a.Matrix4().makeRotationAxis(l.localY,oe(R));l.localX.applyMatrix4(k),l.localZ.applyMatrix4(k)}if(F>0){const k=oe(F),D=new a.Matrix4().makeRotationAxis(l.localZ,k);l.localY.applyMatrix4(D),l.localX.applyMatrix4(D)}}}for(const c of p)c.length>1&&i.push(...c.slice(1));i.length<2&&i.push(new a.Vector3(0,.001,0));try{const c=new a.CatmullRomCurve3(i,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,i.length*4),s*q,18,!1);V.geometry.dispose(),V.geometry=y}catch(c){console.error("管件更新失败",c)}}function xe(V,v,w,s=0){let h=V.slice(0,w+1);const E=V[w+1];if(E&&s>0){const l={...E,B:(E.B??0)*s,C:(E.C??0)*s};h.push(l)}const d=Se(h),_=Math.max(0,v-d),x=[];x.push(new a.Vector3(0,0,0));const u=new a.Vector3(0,_*q,0);_>0&&x.push(u);let i={pos:u.clone(),localY:new a.Vector3(0,1,0),localX:new a.Vector3(1,0,0),localZ:new a.Vector3(0,0,1)};const f=[];for(let l=h.length-1;l>=0;l--){const p=h[l],c=ke(p);if(c.length>0){const y=c.map(R=>{const F=R.clone(),k=new a.Matrix4;return k.makeBasis(i.localX,i.localY,i.localZ),F.applyMatrix4(k),F.add(i.pos)});f.push(y);const C=y[y.length-1];i.pos=C.clone();const b=p.B??0,M=p.C??0;if(b!==0){const R=new a.Matrix4().makeRotationAxis(i.localY,oe(b));i.localX.applyMatrix4(R),i.localZ.applyMatrix4(R)}if(M>0){const R=oe(M),F=new a.Matrix4().makeRotationAxis(i.localZ,R);i.localY.applyMatrix4(F),i.localX.applyMatrix4(F)}}}for(const l of f)l.length>1&&x.push(...l.slice(1));return x.length<2&&x.push(new a.Vector3(0,.001,0)),x}function Me(V,v,w,s,h,E,d,_=0,x=0){const u=h-x,i=xe(s,u,d,_);let l=xe(w,x,d,_);l.forEach(c=>c.y=-c.y),l.reverse();const p=[...l,...i];try{const c=new a.CatmullRomCurve3(p,!1,"catmullrom",.01),y=new a.TubeGeometry(c,Math.max(2,p.length*4),E*q,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=y}catch(c){console.error("管件更新失败",c)}}const ze={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},Fe={class:"control-row"},Ye={class:"control-row"},Ie={class:"frame-info"},Le={class:"control-row"},je={class:"progress-bar"},Ue={class:"dialog-footer"},Oe=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:v,emit:w}){const s=V,h=w,E=e.ref(),d=e.ref(),_=e.ref();e.watch(()=>s.threeData,t=>{const o=t==null?void 0:t.data;_.value=o==null?void 0:o.type},{immediate:!0});const x=async()=>{if(!sessionStorage.getItem("systemKey")){h("getThreeData");return}let o={};_.value===J.robotMode.SINGLE&&(o=await Ne.fetchSingleRobotAnimationData()),_.value===J.robotMode.DOUBLE&&(o=await Ne.fetchDoubleRobotAnimationData());const{initialPipeLength:n=0,pipeRadius:N=0,clampLength:B=0,animationData:U}=o;k.value=n,D.value=N,L.value=B,E.value=U;const O=T.cloneDeep(E.value),ee=re(A.value),K=(O==null?void 0:O["输出(动画数据)"])||[];u.value=K.length?K:[ee];let ne=(O==null?void 0:O["输出(动画数据)Content"])??[];ne&&(d.value=ne)},u=e.ref([]),i=e.ref(!1),f=e.ref(""),l=e.ref(!1),p=e.ref(0),c=e.ref(0),y=e.ref(1e3);let C=!1;const b=e.ref(null),M=e.shallowRef(null),R=e.shallowRef(null),F=e.shallowRef(null),k=e.ref(0),D=e.ref(12.5),L=e.ref(30),W=e.ref([]),P=e.ref(null),g=e.computed(()=>s.model?Object.values(s.model.joints).filter(t=>t.jointType!=="fixed").map(t=>t.name):[]),I=e.ref(["Y","B","C","R"]),A=e.computed(()=>[...g.value,...I.value]),j=e.computed(()=>A.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${A.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),X=()=>u.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),H=()=>{const t=[],o=[];return u.value.forEach(n=>{const{Y1:N,B1:B,C1:U,R1:O,Y2:ee,B2:K,C2:ne,R2:Y}=n;t.push({Y:parseFloat(N)||0,B:parseFloat(B)||0,C:parseFloat(U)||0,R:parseFloat(O)||0}),o.push({Y:parseFloat(ee)||0,B:parseFloat(K)||0,C:parseFloat(ne)||0,R:parseFloat(Y)||0})}),{posPipeYbcr:t,negPipeYbcr:o}},Q=(t=0,o=0)=>{if(M.value&&R.value){const n=H();Me(M.value,R.value,n.posPipeYbcr,n.negPipeYbcr,k.value,D.value,t,o,L.value)}else if(M.value){const n=X();Ee(M.value,n,k.value,D.value,t,o)}},G=t=>{if(t<0||t>=u.value.length){console.error(`帧索引 ${t} 超出范围`);return}const o=u.value[t];if(console.log(`应用第 ${t} 帧数据 ${o}`),p.value=t,b.value){const n={};g.value.forEach(N=>{const B=parseFloat(o[N]);isNaN(B)||(n[N]=B)}),b.value.setJointAngles(n)}Q(t,0)},$=async()=>{if(u.value.length===0){T.ElMessage.error("无法播放动画:无数据");return}if(!l.value){l.value=!0,C=!1,u.value.length-1===p.value&&(p.value=0);try{for(let t=p.value+1;t<u.value.length&&!C;t++){p.value=t;const o=u.value[t],n={};b.value&&g.value.forEach(N=>{const B=parseFloat(o[N]);isNaN(B)||(n[N]=B)}),b.value?await b.value.animateToState(n,y.value,N=>{c.value=(t+N)/u.value.length*100,Q(t-1,N)}):(await new Promise(N=>setTimeout(N,y.value)),c.value=(t+1)/u.value.length*100)}C||T.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),T.ElMessage.error("动画播放出错")}finally{l.value=!1,c.value=0}}},Z=()=>{C=!0,l.value=!1,c.value=0,T.ElMessage.info("动画已停止")},z=()=>{p.value=0},ue=()=>{if(M.value&&R.value){const t=H();Me(M.value,R.value,t.posPipeYbcr,t.negPipeYbcr,k.value,D.value,-1,0,L.value)}else if(M.value){const t=X();Ee(M.value,t,k.value,D.value,-1,0)}},ie=()=>{b.value&&b.value.resetToZero(),ue(),z(),T.ElMessage.success("机器人和管件已重置")},de=t=>`第 ${t+1} 帧`,pe=t=>{l.value&&Z(),G(t)},me=()=>{l.value&&Z(),!(p.value+1>=u.value.length)&&G(p.value+1)},ve=()=>{l.value&&Z(),p.value!==0&&G(p.value-1)},fe=(t,o)=>{if(!o)return null;const n=t.joints[o];if(!n)return console.warn(`在模型中未找到名为 '${o}' 的 Joint`),null;let N=null;return n.traverse(B=>{B instanceof a.Mesh&&!N&&(N=B)}),N||console.warn(`在 Joint '${o}' 中未找到可用的 Mesh 对象`),N},ge=(t,o)=>{if(!o)return null;const n=t.joints[o];return n||(console.warn(`在模型中未找到名为 '${o}' 的 Joint`),console.log("可用的链接:",Object.keys(t.links)),null)},se=()=>{F.value&&(F.value.visible=!0),M.value&&M.value.parent&&M.value.parent.remove(M.value),F.value=null,M.value=null,R.value=null},re=t=>t==null?void 0:t.reduce((o,n)=>(o[n]="0",o),{});e.watch(A,(t,o)=>{if(JSON.stringify(t)!==JSON.stringify(o))if(t.length>0){const n=re(t);u.value=[n]}else u.value=[]},{immediate:!0});const le=e.ref(0),ae=t=>{le.value=t},he=(t,o)=>{if(!t||!o)return;const n=ge(t,o),N=Re();N.visible=!1,n==null||n.add(N)},Ve=t=>{b.value=new J.URDFRobotController(t),W.value=Object.keys(t.links),P.value="Pipe_Joint"},ye=()=>{b.value=null,W.value=[],P.value=null},be=t=>{Ve(t),he(t,P.value),ae(le.value+1),ie()};e.watch(()=>s.model,t=>{if(se(),t){be(t);return}ye()},{immediate:!0});const ce=t=>{var n,N;const o=new a.Mesh(t.geometry.clone(),t.material);return o.name="managed_pipe_clone",(N=(n=t==null?void 0:t.parent)==null?void 0:n.add)==null||N.call(n,o),o.position.copy(t.position),o.rotation.copy(t.rotation),o.scale.copy(t.scale),o};e.watch([P,L,k,le],([t,o])=>{if(se(),s.model&&t){const n=fe(s.model,t);if(console.log(n,"meshToReplace"),n&&n.parent){F.value=n,n.visible=!1;const N=ce(n);if(_.value===J.robotMode.SINGLE&&(N.position.y-=o*.001),M.value=N,_.value===J.robotMode.DOUBLE){const B=ce(n);R.value=B}Q(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const m=async()=>{if(A.value.length===0){T.ElMessage.warning("没有可导出的表头");return}const t=A.value.join(" ");try{await navigator.clipboard.writeText(t),T.ElMessage.success("表头已成功复制到剪贴板!")}catch(o){console.error("复制失败:",o),T.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},r=()=>{if(!f.value.trim()){T.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
@@ -1,15 +1,15 @@
1
1
  import { defineComponent as Ze, ref as f, watch as de, shallowRef as he, computed as we, onUnmounted as et, resolveComponent as Z, createElementBlock as Ce, openBlock as ie, createElementVNode as o, createVNode as l, withCtx as V, createBlock as De, createCommentVNode as ge, unref as S, toDisplayString as ve, onBeforeUnmount as Ke, createTextVNode as tt, onMounted as lt, nextTick as ot, withDirectives as Q, vShow as me, renderSlot as _e, isRef as Re, vModelRadio as Me } from "vue";
2
- import { r as Ve, U as nt, s as Xe, u as at, a as st, W as it } from "./useRayCaster-B2SPBFYC.js";
2
+ import { r as Ve, U as nt, s as Xe, u as at, a as st, W as it } from "./useRayCaster-Bx73bXeL.js";
3
3
  import { u as qe, a as rt, b as ut, S as F } from "./iconfont-pt17sMx3.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CqTDROhf.js";
5
- import { a9 as ct, c as pt, E as X, a as dt, aM as mt, ao as vt } from "./index-CYp77kPp.js";
6
- import "./index.vue_vue_type_style_index_1_lang-DMXip4Xp.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Be4dFvUC.js";
5
+ import { a9 as ct, c as pt, E as X, a as dt, aM as mt, ao as vt } from "./index-B42dCx1W.js";
6
+ import "./index.vue_vue_type_style_index_1_lang-DUZFMfkl.js";
7
7
  import "./index-BHtNKL1L.js";
8
- import { _ as pe, s as ft } from "./index-Cwgs7EkD.js";
9
- import "./index.vue_vue_type_style_index_1_lang-BswQV5Lr.js";
8
+ import { _ as pe, s as ft } from "./index-B1XSRq6_.js";
9
+ import "./index.vue_vue_type_style_index_1_lang-CtkjAjQ8.js";
10
10
  import { m as Se, T as Pe, V as j, k as te, l as gt, n as ht, e as ke, o as bt, L as yt, p as _t, q as wt, r as Ct, s as kt, t as Pt, u as xt, i as Tt } from "./three-viewport-gizmo-CkQ98n-T.js";
11
- import "./index-CohL-xT-.js";
12
- import { f as Rt, a as Mt } from "./animationData-DHZB79in.js";
11
+ import "./index-Byuw-d13.js";
12
+ import { f as Rt, a as Mt } from "./animationData-BgVD7m_Z.js";
13
13
  import { _ as Je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
14
  import { U as Vt, J as Dt } from "./urdfTree-BuTtRGdl.js";
15
15
  const ee = 1e-3, re = gt.degToRad, Ge = new bt({
@@ -1,15 +1,15 @@
1
- import { defineComponent as ze, ref as u, computed as T, watch as H, onUnmounted as at, resolveComponent as K, createElementBlock as O, openBlock as j, createElementVNode as l, createCommentVNode as I, createVNode as i, toDisplayString as R, Fragment as nt, renderList as ot, withCtx as ne, inject as ve, shallowRef as pe, onMounted as st, nextTick as it, onBeforeUnmount as ut, withDirectives as x, vShow as F, renderSlot as ae, unref as d, createBlock as $e, isRef as me, vModelRadio as fe } from "vue";
2
- import { c as rt, E as y, p as be, s as ye, u as ct } from "./index-CYp77kPp.js";
3
- import { j as dt, a as vt, u as pt, aG as mt } from "./index.vue_vue_type_style_index_1_lang-DMXip4Xp.js";
4
- import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-B2SPBFYC.js";
1
+ import { defineComponent as ze, ref as u, computed as T, watch as X, onUnmounted as at, resolveComponent as K, createElementBlock as O, openBlock as j, createElementVNode as l, createCommentVNode as I, createVNode as i, toDisplayString as R, Fragment as nt, renderList as ot, withCtx as ne, inject as ve, shallowRef as pe, onMounted as st, nextTick as it, onBeforeUnmount as ut, withDirectives as x, vShow as F, renderSlot as ae, unref as d, createBlock as $e, isRef as me, vModelRadio as fe } from "vue";
2
+ import { c as rt, E as y, p as be, s as ye, u as ct } from "./index-B42dCx1W.js";
3
+ import { j as dt, a as vt, u as pt, aH as mt } from "./index.vue_vue_type_style_index_1_lang-DUZFMfkl.js";
4
+ import { U as ft, s as ke, u as gt, a as ht, W as bt } from "./useRayCaster-Bx73bXeL.js";
5
5
  import { u as yt, a as kt, b as Pt, S as h } from "./iconfont-pt17sMx3.js";
6
- import { _ as Pe } from "./index-Cwgs7EkD.js";
7
- import "./index.vue_vue_type_style_index_1_lang-BswQV5Lr.js";
6
+ import { _ as Pe } from "./index-B1XSRq6_.js";
7
+ import "./index.vue_vue_type_style_index_1_lang-CtkjAjQ8.js";
8
8
  import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
9
  import { U as Ct, J as wt } from "./urdfTree-BuTtRGdl.js";
10
- import { i as _t } from "./animationData-DHZB79in.js";
10
+ import { i as _t } from "./animationData-BgVD7m_Z.js";
11
11
  import { O as xt } from "./STLLoader-CiUjaQtA.js";
12
- import { t as Tt, h as $t } from "./index-Cqd0F9a9.js";
12
+ import { t as Tt, h as $t } from "./index-DAkKNbYV.js";
13
13
  import { e as jt } from "./three-viewport-gizmo-CkQ98n-T.js";
14
14
  const zt = { class: "panel-content" }, Ut = { class: "action-bar" }, Vt = {
15
15
  key: 0,
@@ -31,7 +31,7 @@ const zt = { class: "panel-content" }, Ut = { class: "action-bar" }, Vt = {
31
31
  ${B.value.join(" ")}
32
32
  0 0 0 ...
33
33
  1 2 3 ...` : "请先加载模型。"), V = T(() => o.value[C.value] || {});
34
- H(() => z.model, (s) => {
34
+ X(() => z.model, (s) => {
35
35
  s ? (w.value = new ft(s), U.value = Object.keys(s.links), C.value = 0) : (w.value = null, U.value = []);
36
36
  }, { immediate: !0 });
37
37
  const S = (s) => {
@@ -84,7 +84,7 @@ ${B.value.join(" ")}
84
84
  k.value === "playing" && (g++, k.value = "paused", y.info("动画已暂停"));
85
85
  }, Z = () => {
86
86
  g++, k.value = "stopped", C.value = 0, N.value = 0, S(0), y.info("动画已停止并重置");
87
- }, X = () => {
87
+ }, H = () => {
88
88
  k.value === "playing" ? ue() : ie();
89
89
  }, q = (s) => {
90
90
  g++, k.value = "paused", S(s);
@@ -117,14 +117,14 @@ ${B.value.join(" ")}
117
117
  });
118
118
  c.length > 0 ? (o.value = c, y.success(`成功导入 ${c.length} 行数据!`), M.value = !1, J.value = "", Z()) : y.error("未能解析到有效数据,请检查格式。");
119
119
  };
120
- H(() => z.xyzbcList, () => {
120
+ X(() => z.xyzbcList, () => {
121
121
  z.xyzbcList && (o.value = rt(z.xyzbcList));
122
122
  }, {
123
123
  immediate: !0
124
124
  });
125
125
  const Q = (s) => `第 ${s + 1} 帧`;
126
126
  return oe({
127
- handlePlayPause: X,
127
+ handlePlayPause: H,
128
128
  playAnimation: ie,
129
129
  pauseAnimation: ue,
130
130
  stopAnimation: Z
@@ -222,7 +222,7 @@ ${B.value.join(" ")}
222
222
  }, It = {
223
223
  ref: "pipe2",
224
224
  class: "pipe-container"
225
- }, Jt = { class: "buttonGroup-top" }, Gt = { class: "buttonGroup-topLeft" }, Xt = { class: "buttonGroup-left" }, Ht = { class: "buttonGroup-right" }, Kt = { class: "buttonGroup-bottom" }, Wt = { class: "top-panel" }, Yt = { class: "panel-header" }, Zt = { class: "panel-body" }, qt = { class: "left-panel" }, Qt = { class: "panel-header" }, el = { class: "panel-body" }, tl = {
225
+ }, Jt = { class: "buttonGroup-top" }, Gt = { class: "buttonGroup-topLeft" }, Ht = { class: "buttonGroup-left" }, Xt = { class: "buttonGroup-right" }, Kt = { class: "buttonGroup-bottom" }, Wt = { class: "top-panel" }, Yt = { class: "panel-header" }, Zt = { class: "panel-body" }, qt = { class: "left-panel" }, Qt = { class: "panel-header" }, el = { class: "panel-body" }, tl = {
226
226
  key: 1,
227
227
  class: "clipping-content"
228
228
  }, ll = { class: "radio-group" }, al = { class: "radio-label" }, nl = { class: "radio-label" }, ol = { class: "radio-label" }, sl = { class: "radio-label" }, il = { class: "right-panel" }, ul = { class: "panel-header" }, rl = { class: "panel-body" }, cl = {
@@ -258,7 +258,7 @@ ${B.value.join(" ")}
258
258
  const { mainKey: e, baseMenuPath: n } = t || {};
259
259
  mt(n, e);
260
260
  }, 500);
261
- H(
261
+ X(
262
262
  () => [G.value, V.value, S.value],
263
263
  () => {
264
264
  var D, b, m, Te;
@@ -324,13 +324,13 @@ ${B.value.join(" ")}
324
324
  immediate: !0
325
325
  }
326
326
  );
327
- const Z = u([]), X = T(() => {
327
+ const Z = u([]), H = T(() => {
328
328
  var e, n;
329
329
  return (n = (e = o == null ? void 0 : o.threeData) == null ? void 0 : e.data) == null ? void 0 : n.csvUrl;
330
330
  });
331
- H(() => X.value, async () => {
332
- if (console.log("three data", o == null ? void 0 : o.threeData), console.log("csvUrl", X.value), X.value) {
333
- const t = await _t(X.value);
331
+ X(() => H.value, async () => {
332
+ if (console.log("three data", o == null ? void 0 : o.threeData), console.log("csvUrl", H.value), H.value) {
333
+ const t = await _t(H.value);
334
334
  Z.value = t;
335
335
  }
336
336
  }, {
@@ -354,7 +354,7 @@ ${B.value.join(" ")}
354
354
  de,
355
355
  s,
356
356
  a
357
- ), { isAnimating: xe, toggleAnimation: Me, stopAnimation: Ne } = kt(le, de), { isClipping: Ee, activeClippingAxis: P, toggleClipping: Be, updateClippingPlanes: A } = Pt(le, de), { initRaycaster: Fe, selectedObject3D: Ie, setSelectedObjVisible: Je, updatePosition: Ge, updateRotation: Xe, dispose: He } = gt(Q, le, de), Ke = () => {
357
+ ), { isAnimating: xe, toggleAnimation: Me, stopAnimation: Ne } = kt(le, de), { isClipping: Ee, activeClippingAxis: P, toggleClipping: Be, updateClippingPlanes: A } = Pt(le, de), { initRaycaster: Fe, selectedObject3D: Ie, setSelectedObjVisible: Je, updatePosition: Ge, updateRotation: He, dispose: Xe } = gt(Q, le, de), Ke = () => {
358
358
  Oe();
359
359
  }, We = T(() => re.value === ke.ROBOT), Ye = T(() => re.value === ke.PIPECOMPARSION), Ze = (t) => {
360
360
  $.value = t, v.value = !0;
@@ -389,7 +389,7 @@ ${B.value.join(" ")}
389
389
  } else
390
390
  ee.value && console.warn(`在 Blade '${ee.value}' 中未找到可替换的网格或其没有父级。`);
391
391
  };
392
- return H(() => o.fileBlobs, (t) => {
392
+ return X(() => o.fileBlobs, (t) => {
393
393
  if (t && t.length > 0) {
394
394
  const e = t[0];
395
395
  if (!e.name.toLowerCase().endsWith(".urdf"))
@@ -404,7 +404,7 @@ ${B.value.join(" ")}
404
404
  }, {
405
405
  immediate: !0,
406
406
  deep: !0
407
- }), H(_, (t) => {
407
+ }), X(_, (t) => {
408
408
  _e(t ? [t] : []), Fe();
409
409
  }), st(async () => {
410
410
  await it();
@@ -416,7 +416,7 @@ ${B.value.join(" ")}
416
416
  console.error("Three.js 初始化失败:", t), y.error("渲染引擎初始化失败!");
417
417
  }
418
418
  }), ut(() => {
419
- p.value = "", r.value = "", window.removeEventListener("resize", we), xe.value && Ne(), Ae(), He();
419
+ p.value = "", r.value = "", window.removeEventListener("resize", we), xe.value && Ne(), Ae(), Xe();
420
420
  }), (t, e) => {
421
421
  var D;
422
422
  const n = K("el-scrollbar"), L = K("PipeAnalysisPanel");
@@ -469,7 +469,7 @@ ${B.value.join(" ")}
469
469
  title: "显隐坐标轴"
470
470
  }, null, 8, ["active"])
471
471
  ]),
472
- l("div", Xt, [
472
+ l("div", Ht, [
473
473
  i(h, {
474
474
  name: "jiegoushu",
475
475
  size: "24",
@@ -491,7 +491,7 @@ ${B.value.join(" ")}
491
491
  active: f.value && p.value === "工件树"
492
492
  }, null, 8, ["active"])
493
493
  ]),
494
- l("div", Ht, [
494
+ l("div", Xt, [
495
495
  ae(t.$slots, "button-right", { switchRightPanel: he }, void 0, !0),
496
496
  i(h, {
497
497
  name: "yemian",
@@ -637,7 +637,7 @@ ${B.value.join(" ")}
637
637
  model: (b = d(Ie)) == null ? void 0 : b.obj,
638
638
  onVisibleChange: d(Je),
639
639
  onUpdatePosition: d(Ge),
640
- onUpdateRotation: d(Xe)
640
+ onUpdateRotation: d(He)
641
641
  }, null, 8, ["model", "onVisibleChange", "onUpdatePosition", "onUpdateRotation"])) : I("", !0)
642
642
  ];
643
643
  }),
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-1z9RrjZc.cjs"),Q=require("./index.vue_vue_type_style_index_1_lang-CT_2jezv.cjs"),R=require("./useRayCaster-CjOF8Be7.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-ClF5mrVY.cjs");require("./index.vue_vue_type_style_index_1_lang-CecxMizO.cjs");const de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Le=require("./animationData-CM-r9wyr.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),ue=require("./index-Dw4KeMlJ.cjs"),Ae=require("./three-viewport-gizmo-BV37JzRa.cjs"),Oe={class:"panel-content"},Ie={class:"action-bar"},qe={key:0,class:"animation-controls"},Fe={class:"control-row"},Ge={class:"control-row"},Je={class:"frame-info"},He={class:"control-row"},Xe={key:1,class:"empty-state"},Ke={class:"dialog-footer"},We=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(L,{expose:J}){const w=L,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),U=e.ref(10),N=e.ref(null);let f=0;const k=e.ref([]),M=e.computed(()=>w.model?Object.values(w.model.joints).filter(s=>s.jointType!=="fixed").map(s=>s.name):[]),j=e.computed(()=>[...M.value]),z=e.computed(()=>j.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),u=require("./index-1z9RrjZc.cjs"),Q=require("./index.vue_vue_type_style_index_1_lang-ckXQqCiT.cjs"),R=require("./useRayCaster-CnW80o7b.cjs"),m=require("./iconfont-t5epssvu.cjs"),ne=require("./index-CPVt8Wrk.cjs");require("./index.vue_vue_type_style_index_1_lang-29vzgcAi.cjs");const de=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./urdfTree-CCktg0FK.cjs"),Le=require("./animationData-CMbPkqzG.cjs"),Ue=require("./STLLoader-RU7KqloS.cjs"),ue=require("./index-Cu7pB5GB.cjs"),Ae=require("./three-viewport-gizmo-BV37JzRa.cjs"),Oe={class:"panel-content"},Ie={class:"action-bar"},qe={key:0,class:"animation-controls"},Fe={class:"control-row"},Ge={class:"control-row"},Je={class:"frame-info"},He={class:"control-row"},Xe={key:1,class:"empty-state"},Ke={class:"dialog-footer"},We=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(L,{expose:J}){const w=L,a=e.ref([]),D=e.ref(!1),$=e.ref(""),h=e.ref("stopped"),b=e.ref(0),T=e.ref(0),U=e.ref(10),N=e.ref(null);let f=0;const k=e.ref([]),M=e.computed(()=>w.model?Object.values(w.model.joints).filter(s=>s.jointType!=="fixed").map(s=>s.name):[]),j=e.computed(()=>[...M.value]),z=e.computed(()=>j.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${j.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),C=e.computed(()=>a.value[b.value]||{});e.watch(()=>w.model,s=>{s?(N.value=new R.URDFRobotController(s),k.value=Object.keys(s.links),b.value=0):(N.value=null,k.value=[])},{immediate:!0});const S=s=>{if(s<0||s>=a.value.length){console.error(`帧索引 ${s} 超出范围`);return}const l=a.value[s];if(N.value){const p={};M.value.forEach(d=>{const r=parseFloat(l[d]);isNaN(r)||(p[d]=r)}),N.value.setJointAngles(p)}b.value=s,T.value=a.value.length>1?s/(a.value.length-1)*100:100},H=async s=>{try{for(let l=b.value;l<a.value.length;l++){if(s!==f)return;const p=a.value[l],d={};if(N.value)M.value.forEach(r=>{const i=parseFloat(p[r]);isNaN(i)||(d[r]=i)}),await N.value.animateToState(d,U.value,r=>{s===f&&(T.value=(l+r)/a.value.length*100)});else{if(await new Promise(r=>setTimeout(r,U.value)),s!==f)return;T.value=(l+1)/a.value.length*100}b.value=l}s===f&&(u.ElMessage.success("动画播放完成"),h.value="stopped",T.value=100)}catch(l){console.error("动画播放出错:",l),u.ElMessage.error("动画播放出错"),h.value="stopped"}},X=()=>{if(a.value.length===0){u.ElMessage.error("无动画数据");return}h.value==="stopped"&&(b.value=0,S(0)),h.value="playing",f++,H(f),u.ElMessage.info("动画播放中")},K=()=>{h.value==="playing"&&(f++,h.value="paused",u.ElMessage.info("动画已暂停"))},A=()=>{f++,h.value="stopped",b.value=0,T.value=0,S(0),u.ElMessage.info("动画已停止并重置")},B=()=>{h.value==="playing"?K():X()},O=s=>{f++,h.value="paused",S(s)},W=()=>{if(!$.value.trim()){u.ElMessage.warning("导入内容不能为空");return}const s=$.value.trim().split(`