ss-component-new 1.2.293 → 1.2.294

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{index-BAq93WKX.js → index-79I_iorC.js} +1 -1
  2. package/dist/{index-CpL1Uk9-.js → index-9Nz7Dg2Z.js} +1 -1
  3. package/dist/{index-GIMYBiAi.js → index-BD9p0Xlt.js} +2 -2
  4. package/dist/{index-CGrpZM50.cjs → index-BkSFOSV8.cjs} +1 -1
  5. package/dist/{index-BxvOuGZG.js → index-ByJJvmV6.js} +3 -3
  6. package/dist/{index-JlvlYTHe.js → index-C0igWyW4.js} +11 -11
  7. package/dist/{index-Csxi45h0.cjs → index-C5SNPyky.cjs} +1 -1
  8. package/dist/{index-B-Cz8ARl.cjs → index-C98tDP8u.cjs} +1 -1
  9. package/dist/{index-DCzUTKC1.cjs → index-CGoPD35H.cjs} +1 -1
  10. package/dist/{index-BsW97zdK.js → index-CHxAiQtk.js} +2 -2
  11. package/dist/{index-CChZqnru.js → index-CZSaHDnf.js} +1 -1
  12. package/dist/{index-aK3MJy5p.js → index-CZm0g4PU.js} +1 -1
  13. package/dist/{index-Dr74gjYl.js → index-CkSlNi8L.js} +1 -1
  14. package/dist/{index-fVeL_sC0.js → index-CmRzCos6.js} +3 -3
  15. package/dist/{index-B1aPw9hh.js → index-CmcomRyN.js} +1 -1
  16. package/dist/{index-CI3ZsowT.cjs → index-CslSvatz.cjs} +1 -1
  17. package/dist/{index-CygKeXW1.cjs → index-Cvo0V0hW.cjs} +1 -1
  18. package/dist/{index-h4UBVLhT.cjs → index-CvykFWHw.cjs} +1 -1
  19. package/dist/{index-DIpPNHxA.cjs → index-D12kMfBu.cjs} +1 -1
  20. package/dist/{index-DFJiYWw6.js → index-D5O3A6Fx.js} +1 -1
  21. package/dist/{index-COShLfYh.js → index-DBYidyLi.js} +1 -1
  22. package/dist/{index-8lsM3hlp.js → index-DKofIQfe.js} +1 -1
  23. package/dist/{index-DfIzGySu.cjs → index-DL8dLTof.cjs} +1 -1
  24. package/dist/{index-Dh2R6zRa.cjs → index-DQqCL4ju.cjs} +1 -1
  25. package/dist/{index-BMASBifz.js → index-DU8A2Rcx.js} +2 -2
  26. package/dist/{index-BmUApsCd.js → index-Dq3HNSET.js} +3246 -3259
  27. package/dist/{index-CZBpHmja.cjs → index-DsOj_EOL.cjs} +1 -1
  28. package/dist/index-IvJ1OjwT.cjs +1 -0
  29. package/dist/{index-BM4YsCtJ.cjs → index-LT5l3lP1.cjs} +1 -1
  30. package/dist/{index-nO0Ti8QI.js → index-SnOaE90Y.js} +2 -2
  31. package/dist/{index-BEotMUwH.cjs → index-_2EYJgni.cjs} +1 -1
  32. package/dist/{index-bR2Xi-P4.cjs → index-_yqtp0Dh.cjs} +1 -1
  33. package/dist/{index-D_3O9k8j.cjs → index-gHB9TMLI.cjs} +1 -1
  34. package/dist/{index-DYeVAuyV.cjs → index-gW_IQxDq.cjs} +1 -1
  35. package/dist/{index-BEnvD5w7.js → index-w2CRXMRQ.js} +5 -5
  36. package/dist/{index-KkJeTpqx.cjs → index-xpsuJRYD.cjs} +1 -1
  37. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-ltQJCrgJ.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-B_3YixjC.cjs} +1 -1
  38. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BS2BJK4Z.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BqQN_vwd.js} +4 -4
  39. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CEet5r6v.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-DRUxrXlC.cjs} +1 -1
  40. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Bogj4lS1.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Dg0WsT5i.js} +2 -2
  41. package/dist/{index.vue_vue_type_style_index_1_lang-PC90A_B9.js → index.vue_vue_type_style_index_1_lang--VeL916J.js} +1 -1
  42. package/dist/{index.vue_vue_type_style_index_1_lang-lcFrDPIJ.cjs → index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs} +1 -1
  43. package/dist/{main-DeQGu5ph.js → main-BKAAdzBm.js} +2 -2
  44. package/dist/{main-Cc047r71.cjs → main-Dx_m6QdJ.cjs} +1 -1
  45. package/dist/ss-component.cjs +1 -1
  46. package/dist/ss-component.css +1 -1
  47. package/dist/ss-component.js +6 -6
  48. package/dist/ss-component2.cjs +1 -1
  49. package/dist/ss-component2.js +10 -10
  50. package/dist/{threeModel-DEsjaKjx.js → threeModel-WVUvmnEU.js} +2 -2
  51. package/dist/{threeModel-we3lRzb9.cjs → threeModel-euHdSZWK.cjs} +1 -1
  52. package/dist/{threeSceneView-Do6SINoQ.js → threeSceneView-BV580zYO.js} +2 -2
  53. package/dist/{threeSceneView-DT79fm74.cjs → threeSceneView-BYYPjbrf.cjs} +1 -1
  54. package/dist/{threeSceneViewForCPMPIP-CXKRYHuL.js → threeSceneViewForCPMPIP-BcL1uoBQ.js} +4 -4
  55. package/dist/{threeSceneViewForCPMPIP-CcjkJZEa.cjs → threeSceneViewForCPMPIP-CSKEFRk_.cjs} +1 -1
  56. package/dist/{threeTrackPathView-BmzWvKwW.js → threeTrackPathView-BpunMIGZ.js} +1 -1
  57. package/dist/{threeTrackPathView-CrA89IwO.cjs → threeTrackPathView-CGEH2zTP.cjs} +1 -1
  58. package/dist/{threeViewerHost-CqVCzjCu.cjs → threeViewerHost-BPu_LZha.cjs} +1 -1
  59. package/dist/{threeViewerHost-VbS8Lc22.js → threeViewerHost-CiYZBM4H.js} +1 -1
  60. package/dist/{workpieceTreePanel-BTAKPbFy.cjs → workpieceTreePanel-CbsK-tey.cjs} +1 -1
  61. package/dist/{workpieceTreePanel-CtgE68nN.js → workpieceTreePanel-CtLKTnWz.js} +2 -2
  62. package/package.json +1 -1
  63. package/dist/index-pMOq6QGz.cjs +0 -1
@@ -5,19 +5,19 @@ import { u } from "./index.vue_vue_type_style_index_1_lang-BKgS2iFu.js";
5
5
  import "./index-CA0SFykF.js";
6
6
  import C from "./ss-component2.js";
7
7
  import { t as g, c as T, b as d } from "./index-CAPx0_D4.js";
8
- const n = o(() => import("./main-DeQGu5ph.js"));
8
+ const n = o(() => import("./main-BKAAdzBm.js"));
9
9
  n.install = (t) => {
10
10
  t.component("ssComponent", n);
11
11
  };
12
- const s = o(() => import("./index-aK3MJy5p.js").then((t) => t.k));
12
+ const s = o(() => import("./index-CZm0g4PU.js").then((t) => t.k));
13
13
  s.install = (t) => {
14
14
  t.component("ssTab", s);
15
15
  };
16
- const r = o(() => import("./index-GIMYBiAi.js"));
16
+ const r = o(() => import("./index-BD9p0Xlt.js"));
17
17
  r.install = (t) => {
18
18
  t.component("ssMenu", r);
19
19
  };
20
- const m = o(() => import("./index-BEnvD5w7.js"));
20
+ const m = o(() => import("./index-w2CRXMRQ.js"));
21
21
  m.install = (t) => {
22
22
  t.component("ssMenuComponent", m);
23
23
  };
@@ -33,11 +33,11 @@ const a = o(() => import("./index-B0OE5_Ny.js").then((t) => t.i));
33
33
  a.install = (t) => {
34
34
  t.component("ssAvatar", a);
35
35
  };
36
- const l = o(() => import("./threeModel-DEsjaKjx.js"));
36
+ const l = o(() => import("./threeModel-WVUvmnEU.js"));
37
37
  l.install = (t) => {
38
38
  t.component("ssThree", l);
39
39
  };
40
- const p = o(() => import("./threeViewerHost-VbS8Lc22.js").then((t) => t.t));
40
+ const p = o(() => import("./threeViewerHost-CiYZBM4H.js").then((t) => t.t));
41
41
  p.install = (t) => {
42
42
  t.component("threeViewerHost", p);
43
43
  };
@@ -1 +1 @@
1
- "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-A1rieWA1.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DWKwaPfH.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-CygKeXW1.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-DIpPNHxA.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-Csxi45h0.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-BM4YsCtJ.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-DfIzGySu.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-h4UBVLhT.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-B-Cz8ARl.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-D_3O9k8j.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-DYeVAuyV.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-CGrpZM50.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
1
+ "use strict";const n=require("vue-router"),t=[{path:"/tenant",name:"Tenant",component:async()=>Promise.resolve().then(()=>require("./index-A1rieWA1.cjs"))},{path:"/login",name:"Login",component:async()=>Promise.resolve().then(()=>require("./index-DWKwaPfH.cjs"))},{path:"/",name:"Model",component:async()=>Promise.resolve().then(()=>require("./index-Cvo0V0hW.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-D12kMfBu.cjs"))},{path:"平台管理/主菜单管理",name:"MainMenu",component:async()=>Promise.resolve().then(()=>require("./index-C5SNPyky.cjs"))},{path:"系统管理/个人中心",name:"PersonalCenter",component:async()=>Promise.resolve().then(()=>require("./index-LT5l3lP1.cjs"))},{path:"系统管理/职位管理",name:"Post",component:async()=>Promise.resolve().then(()=>require("./index-DL8dLTof.cjs"))},{path:"系统管理/用户管理",name:"User",component:async()=>Promise.resolve().then(()=>require("./index-CvykFWHw.cjs"))},{path:"系统管理/角色管理",name:"Role",component:async()=>Promise.resolve().then(()=>require("./index-C98tDP8u.cjs"))},{path:"系统管理/部门管理",name:"Dept",component:async()=>Promise.resolve().then(()=>require("./index-gHB9TMLI.cjs"))},{path:"系统维护/登录日志",name:"LoginLog",component:async()=>Promise.resolve().then(()=>require("./index-gW_IQxDq.cjs"))},{path:"系统维护/操作日志",name:"OperateLog",component:async()=>Promise.resolve().then(()=>require("./index-BkSFOSV8.cjs"))}]}],o=n.createRouter({history:n.createWebHashHistory(),routes:t});o.beforeEach((r,s,e)=>{!sessionStorage.getItem("loginToken")&&r.path!=="/login"?e("/login"):e()});module.exports=o;
@@ -13,7 +13,7 @@ const a = [
13
13
  {
14
14
  path: "/",
15
15
  name: "Model",
16
- component: async () => import("./index-JlvlYTHe.js"),
16
+ component: async () => import("./index-C0igWyW4.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-BxvOuGZG.js")
34
+ component: async () => import("./index-ByJJvmV6.js")
35
35
  },
36
36
  {
37
37
  path: "平台管理/主菜单管理",
38
38
  name: "MainMenu",
39
- component: async () => import("./index-CpL1Uk9-.js")
39
+ component: async () => import("./index-9Nz7Dg2Z.js")
40
40
  },
41
41
  {
42
42
  path: "系统管理/个人中心",
43
43
  name: "PersonalCenter",
44
- component: async () => import("./index-nO0Ti8QI.js")
44
+ component: async () => import("./index-SnOaE90Y.js")
45
45
  },
46
46
  {
47
47
  path: "系统管理/职位管理",
48
48
  name: "Post",
49
- component: async () => import("./index-COShLfYh.js")
49
+ component: async () => import("./index-DBYidyLi.js")
50
50
  },
51
51
  {
52
52
  path: "系统管理/用户管理",
53
53
  name: "User",
54
- component: async () => import("./index-CChZqnru.js")
54
+ component: async () => import("./index-CZSaHDnf.js")
55
55
  },
56
56
  {
57
57
  path: "系统管理/角色管理",
58
58
  name: "Role",
59
- component: async () => import("./index-B1aPw9hh.js")
59
+ component: async () => import("./index-CmcomRyN.js")
60
60
  },
61
61
  {
62
62
  path: "系统管理/部门管理",
63
63
  name: "Dept",
64
- component: async () => import("./index-Dr74gjYl.js")
64
+ component: async () => import("./index-CkSlNi8L.js")
65
65
  },
66
66
  {
67
67
  path: "系统维护/登录日志",
68
68
  name: "LoginLog",
69
- component: async () => import("./index-8lsM3hlp.js")
69
+ component: async () => import("./index-DKofIQfe.js")
70
70
  },
71
71
  {
72
72
  path: "系统维护/操作日志",
73
73
  name: "OperateLog",
74
- component: async () => import("./index-BAq93WKX.js")
74
+ component: async () => import("./index-79I_iorC.js")
75
75
  }
76
76
  // {
77
77
  // path: 'priority',
@@ -1,8 +1,8 @@
1
1
  import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Ie, computed as le, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as k, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
2
2
  import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, n as Qe, A as et, o as tt, M as Le, X as nt, G as at, p as Me, q as ot, r as De, s as st, D as ze, H as it, t as Re, u as Oe, v as Ue, w as ke, E as _e, x as pe, y as lt, z as rt, T as ct } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js";
3
3
  import { O as ut } from "./OrbitControls-Csw6mD-P.js";
4
- import { s as pt } from "./index-fVeL_sC0.js";
5
- import { u as dt } from "./index.vue_vue_type_style_index_1_lang-PC90A_B9.js";
4
+ import { s as pt } from "./index-CmRzCos6.js";
5
+ import { u as dt } from "./index.vue_vue_type_style_index_1_lang--VeL916J.js";
6
6
  import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
7
7
  import { c as Ge, E as Ve } from "./index-CA0SFykF.js";
8
8
  import { m as de } from "./robotUtil-DGZFmHa1.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),pe=require("./OrbitControls-R243A2UI.cjs"),me=require("./index-CI3ZsowT.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-lcFrDPIJ.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-_esgRFP3.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=null,c=null,C=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const f=z.value;u=new n.PerspectiveCamera(75,f.clientWidth/f.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(f.clientWidth,f.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,f.appendChild(d.domElement),h=new pe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:f,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),m(),_()},t=(f,l)=>{c&&(g.remove(c),c.dispose()),C&&(g.remove(C),C.geometry.dispose(),C.material.dispose());const E=Math.min(Math.max(Math.floor(f/20),30),40);c=new n.GridHelper(f,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(f,f),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,g.add(C)},p=()=>{if(b.value.length===0)return;const f=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)f.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);f.union(Z.box),l=!0}else f.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=f.getSize(new n.Vector3),B=f.getCenter(new n.Vector3),O=Math.max(E.x,E.y,E.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,f.min.z);t(j,q)},m=()=>{const f=new n.AmbientLight(4210752,.6);g.add(f);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const E=new n.DirectionalLight(16777215,.8);E.position.set(-8,-8,6),g.add(E);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},_=()=>{P=requestAnimationFrame(_),h&&h.update();const f=performance.now(),l=f-S;l<D||(S=f-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{f[E]&&f[E].dispose&&f[E].dispose()}),f.dispose&&f.dispose()},A=f=>{f==null||f.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(E=>{I(E)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const f=z.value,l=f.clientWidth,E=f.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:f=>{if(!u||!h||b.value.length===0)return;const l=new n.Box3;let E=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),E=!0;else if(Z.userData.modelId&&f.has(Z.userData.modelId)){const ee=f.get(Z.userData.modelId);l.union(ee.box),E=!0}else l.expandByObject(Z),E=!0}),!E){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;b.value.forEach(l=>{g.remove(l),A(l)});const f=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&f.push(l)}),f.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,m=C*1.2,_=new n.Vector3(c.x+m,c.y,c.z),I=new n.Vector3(c.x,c.y+m,c.z),A=new n.Vector3(c.x,c.y-m,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*m,p.z=c.z+Math.sin($)*m,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(_,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*m,p.y=c.y+Math.cos(J)*m,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const m=Date.now()-d,_=Math.min(m/h,1);if(_>=1){k();return}const I=S(_);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const m=new n.Box3;g.value.forEach(G=>{m.expandByObject(G)});const _=m.getSize(new n.Vector3);c=m.getCenter(new n.Vector3),C=Math.max(_.x,_.y,_.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),f=D(Y);t.position.lerpVectors(A,I,f),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const m=t.position.clone(),_=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(m,x,G),p.target.lerpVectors(_,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],P=new n.Box3,c=new n.Vector3;const C=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,m,_;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(m),A.rotation.copy(_),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(m=>{(m.isMesh&&m.material||m.isLine&&m.material||m.isPoints&&m.material)&&(Array.isArray(m.material)?m.material.forEach(_=>{_.clippingPlanes=[y]}):m.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{g.value.forEach(y=>{y.traverse(t=>{(t.isMesh&&t.material||t.isLine&&t.material||t.isPoints&&t.material)&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),g.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=re.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},_e={class:"joint-name"},Ce={class:"joint-range"},be={class:"joint-type"},Ee={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let m=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(m=v)},{deep:!0}),e.computed(()=>m.length>0);const _=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae.mm2m,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??_(s._jointType,!1),upper:s.limit.upper??_(s._jointType,!0)}:{lower:_(s._jointType,!1),upper:_(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae.mm2m)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae.mm2m,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=m.slice(0,o+1);const V=m[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae.mm2m,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae.mm2m,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},f=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=f(a,w||a,i)}),V},E=()=>{if(m.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=m.length-1){const s=m[m.length-1];Y(s,m.length-1,1),j();return}const v=r.value/ue,i=m[o],V=m[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:E,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",_e,e.toDisplayString(i.name),1),e.createElementVNode("span",Ce," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-d48ad0d8"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(m=>m.children&&m.children.length>0).slice(0,k).map(m=>m.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(b,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-6b1132f4"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const P=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:m,handleResize:_,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:f,activeClippingAxis:l,toggleClipping:E,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),f.value&&E();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!f.value&&E()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{m(),h=A().scene,x=!0,window.addEventListener("resize",_)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",_),J.value&&Y(),$()}),g({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),pe=require("./OrbitControls-R243A2UI.cjs"),me=require("./index-CslSvatz.cjs"),fe=require("./index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs"),oe=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),re=require("./index-CEwxrYB-.cjs"),ae=require("./robotUtil-_esgRFP3.cjs");function ve(z){let g=null,u=null,d=null,h=null,x=null,P=null,c=null,C=null;const D=1e3/30;let S=0;const b=e.ref([]),r=e.ref(new n.Vector3),k=e.ref(new n.Vector3),y=()=>{if(!z.value)return;g=new n.Scene,g.background=new n.Color(15790320);const f=z.value;u=new n.PerspectiveCamera(75,f.clientWidth/f.clientHeight,.1,1e4),u.position.set(8,-8,6),u.up.set(0,0,1),u.lookAt(0,0,0),d=new n.WebGLRenderer({antialias:!0,alpha:!0}),d.setSize(f.clientWidth,f.clientHeight),d.localClippingEnabled=!0,d.shadowMap.enabled=!0,d.shadowMap.type=n.PCFSoftShadowMap,d.toneMapping=n.ACESFilmicToneMapping,d.toneMappingExposure=1,d.outputColorSpace=n.SRGBColorSpace,f.appendChild(d.domElement),h=new pe.OrbitControls(u,d.domElement),h.enableDamping=!0,h.dampingFactor=.05,h.mouseButtons={LEFT:null,MIDDLE:n.MOUSE.PAN,RIGHT:n.MOUSE.ROTATE},h.panSpeed=.7,x=new n.Xe(u,d,{container:f,type:"cube",placement:"top-right",offset:{top:10,right:10},background:{color:"#D1D1D1",opacity:1},front:{label:"Top"},bottom:{label:"Front"},left:{label:"Left"},right:{label:"Right"},top:{label:"Back"},back:{label:"Bottom"}}),x.attachControls(h),m(),_()},t=(f,l)=>{c&&(g.remove(c),c.dispose()),C&&(g.remove(C),C.geometry.dispose(),C.material.dispose());const E=Math.min(Math.max(Math.floor(f/20),30),40);c=new n.GridHelper(f,E,13421772,14540253),c.rotateX(Math.PI/2),c.position.copy(l),g.add(c);const B=new n.PlaneGeometry(f,f),O=new n.ShadowMaterial({opacity:.3,color:0});C=new n.Mesh(B,O),C.position.copy(l),C.position.z-=.01,C.receiveShadow=!0,g.add(C)},p=()=>{if(b.value.length===0)return;const f=new n.Box3;let l=!1;if(b.value.forEach(X=>{if(X.userData.boundingBox)f.union(X.userData.boundingBox),l=!0;else if(X.userData.modelId&&modelBoundingBoxes.has(X.userData.modelId)){const Z=modelBoundingBoxes.get(X.userData.modelId);f.union(Z.box),l=!0}else f.expandByObject(X),l=!0}),!l){console.warn("无法计算包围盒,网格更新失败");return}const E=f.getSize(new n.Vector3),B=f.getCenter(new n.Vector3),O=Math.max(E.x,E.y,E.z),j=Math.max(O*8,50),q=new n.Vector3(B.x,B.y,f.min.z);t(j,q)},m=()=>{const f=new n.AmbientLight(4210752,.6);g.add(f);const l=new n.DirectionalLight(16777215,2);l.position.set(10,10,8),l.castShadow=!0,l.shadow.mapSize.width=4096,l.shadow.mapSize.height=4096,l.shadow.camera.near=.5,l.shadow.camera.far=50,l.shadow.camera.left=-50,l.shadow.camera.right=50,l.shadow.camera.top=50,l.shadow.camera.bottom=-50,g.add(l);const E=new n.DirectionalLight(16777215,.8);E.position.set(-8,-8,6),g.add(E);const B=new n.DirectionalLight(16777215,.6);B.position.set(0,-15,2),g.add(B);const O=new n.HemisphereLight(16777215,4473924,.8);g.add(O);const j=new n.PointLight(16777215,1,50);j.position.set(15,15,15),g.add(j);const q=new n.PointLight(16777215,.5,50);q.position.set(-15,-15,15),g.add(q)},_=()=>{P=requestAnimationFrame(_),h&&h.update();const f=performance.now(),l=f-S;l<D||(S=f-l%D,d&&g&&u&&d.render(g,u),x&&x.render())},I=f=>{["map","normalMap","bumpMap","roughnessMap","metalnessMap","emissiveMap","specularMap","envMap","lightMap","aoMap","displacementMap"].forEach(E=>{f[E]&&f[E].dispose&&f[E].dispose()}),f.dispose&&f.dispose()},A=f=>{f==null||f.traverse(l=>{l.geometry&&l.geometry.dispose(),l.material&&(Array.isArray(l.material)?l.material.forEach(E=>{I(E)}):I(l.material))})};return{currentModels:b,initialCameraPosition:r,initialTargetPosition:k,initThreeJS:y,handleResize:()=>{if(!z.value||!u||!d||!x)return;const f=z.value,l=f.clientWidth,E=f.clientHeight;u.aspect=l/E,u.updateProjectionMatrix(),d.setSize(l,E),x.update()},fitCameraToAllModels:f=>{if(!u||!h||b.value.length===0)return;const l=new n.Box3;let E=!1;if(b.value.forEach(Z=>{if(Z.userData.boundingBox)l.union(Z.userData.boundingBox),E=!0;else if(Z.userData.modelId&&f.has(Z.userData.modelId)){const ee=f.get(Z.userData.modelId);l.union(ee.box),E=!0}else l.expandByObject(Z),E=!0}),!E){console.warn("无法计算包围盒");return}const B=l.getSize(new n.Vector3),O=l.getCenter(new n.Vector3),q=Math.max(B.x,B.y,B.z)*.8,X=new n.Vector3(O.x+q,O.y-q,O.z+q);u.position.copy(X),u.lookAt(O),h.target.copy(O),h.update(),r.value.copy(X),k.value.copy(O),p()},getThreeJSObjects:()=>({scene:g,camera:u,renderer:d,controls:h,gizmo:x}),clearAllModels:()=>{if(!g)return;b.value.forEach(l=>{g.remove(l),A(l)});const f=[];g.children.forEach(l=>{!l.isLight&&!l.isCamera&&l.type!=="GridHelper"&&l!==C&&f.push(l)}),f.forEach(l=>{g.remove(l),A(l)}),b.value=[],p()},cleanup:()=>{P&&cancelAnimationFrame(P),c&&c.dispose(),C&&(C.geometry.dispose(),C.material.dispose()),d&&d.dispose(),h&&h.dispose(),x&&x.dispose()},updateGridForModels:p}}function ge(z,g){const u=e.ref(!1);let d=null,h=12700,x=new n.Vector3,P=new n.Vector3,c=new n.Vector3,C=0,F=null;const D=t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,S=t=>{const p=new n.Vector3,m=C*1.2,_=new n.Vector3(c.x+m,c.y,c.z),I=new n.Vector3(c.x,c.y+m,c.z),A=new n.Vector3(c.x,c.y-m,c.z);if(t<=.567){const $=t/.567*Math.PI*2;p.x=c.x+Math.cos($)*m,p.z=c.z+Math.sin($)*m,p.y=c.y}else if(t<=.724){const L=(t-.567)/.157,$=D(L);p.lerpVectors(_,I,$)}else if(t<=.881){const L=(t-.724)/.157,J=D(L)*Math.PI;p.x=c.x+Math.sin(J)*m,p.y=c.y+Math.cos(J)*m,p.z=c.z}else{const L=(t-.881)/.119,$=D(L);p.lerpVectors(A,x,$)}return p},b=()=>{const{camera:t,controls:p}=z();if(!t||!p)return;d||(d=Date.now());const m=Date.now()-d,_=Math.min(m/h,1);if(_>=1){k();return}const I=S(_);t.position.copy(I),t.lookAt(c),p.target.copy(c),F=requestAnimationFrame(b)},r=()=>{if(g.value.length===0)return;const{camera:t,controls:p}=z();if(!t||!p)return;x.copy(t.position),P.copy(p.target);const m=new n.Box3;g.value.forEach(G=>{m.expandByObject(G)});const _=m.getSize(new n.Vector3);c=m.getCenter(new n.Vector3),C=Math.max(_.x,_.y,_.z)*1.2;const I=new n.Vector3(c.x+C*1.2,c.y,c.z);p.enabled=!1;const A=t.position.clone(),L=1e3,$=Date.now(),J=()=>{const G=Date.now()-$,Y=Math.min(G/L,1),f=D(Y);t.position.lerpVectors(A,I,f),t.lookAt(c),p.target.copy(c),Y<1?requestAnimationFrame(J):(u.value=!0,d=null,b())};J()},k=()=>{u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{controls:t}=z();t&&(t.enabled=!0,t.target.copy(P))};return{isAnimating:u,toggleAnimation:()=>{if(u.value){u.value=!1,d=null,F&&(cancelAnimationFrame(F),F=null);const{camera:t,controls:p}=z();if(!t||!p)return;p.enabled=!0;const m=t.position.clone(),_=p.target.clone(),I=1500,A=Date.now(),L=()=>{const $=Date.now()-A,J=Math.min($/I,1),G=D(J);t.position.lerpVectors(m,x,G),p.target.lerpVectors(_,P,G),J<1&&requestAnimationFrame(L)};L()}else r()},startAnimation:r,stopAnimation:k}}function he(z,g){const u=e.ref(!1),d=e.ref("none");let h=[],x=[],P=new n.Box3,c=new n.Vector3;const C=()=>{h=[new n.Plane(new n.Vector3(1,0,0),0),new n.Plane(new n.Vector3(0,1,0),0),new n.Plane(new n.Vector3(0,0,1),0)]},F=()=>{P.makeEmpty(),g.value.forEach(y=>{P.expandByObject(y)}),c=P.getCenter(new n.Vector3)},D=y=>{const t=P.getSize(new n.Vector3);let p,m,_;y==="x"?(p=new n.PlaneGeometry(t.z*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,Math.PI/2,0)):y==="y"?(p=new n.PlaneGeometry(t.x*1.2,t.z*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(Math.PI/2,0,0)):y==="z"&&(p=new n.PlaneGeometry(t.x*1.2,t.y*1.2),m=new n.Vector3(c.x,c.y,c.z),_=new n.Euler(0,0,0));const I=new n.MeshPhongMaterial({color:8900331,transparent:!0,opacity:.3,side:n.DoubleSide,depthWrite:!1}),A=new n.Mesh(p,I);return A.position.copy(m),A.rotation.copy(_),A},S=()=>{if(b(),r(),d.value==="none")return;F();let y=null;if(d.value==="x"?(h[0].constant=-c.x,y=h[0]):d.value==="y"?(h[1].constant=-c.y,y=h[1]):d.value==="z"&&(h[2].constant=-c.z,y=h[2]),y){g.value.forEach(p=>{p.traverse(m=>{(m.isMesh&&m.material||m.isLine&&m.material||m.isPoints&&m.material)&&(Array.isArray(m.material)?m.material.forEach(_=>{_.clippingPlanes=[y]}):m.material.clippingPlanes=[y])})});const{scene:t}=z();if(t){const p=D(d.value);t.add(p),x.push(p)}}},b=()=>{g.value.forEach(y=>{y.traverse(t=>{(t.isMesh&&t.material||t.isLine&&t.material||t.isPoints&&t.material)&&(Array.isArray(t.material)?t.material.forEach(p=>{p.clippingPlanes=[]}):t.material.clippingPlanes=[])})})},r=()=>{const{scene:y}=z();y&&x.forEach(t=>{y.remove(t),t.geometry.dispose(),t.material.dispose()}),x=[]};return{isClipping:u,activeClippingAxis:d,toggleClipping:()=>{u.value=!u.value,u.value?(C(),g.value.length>0&&F()):(d.value="none",b(),r())},updateClippingPlanes:S,clearClippingPlanes:b,clearClippingMeshes:r}}const ye={class:"panel-content"},we={__name:"animationPanel",props:{animationData:Object,model:Object},setup(z){const g=z;e.ref();const u=e.ref();return e.watch(()=>[g==null?void 0:g.animationData],()=>{var h;let d=((h=re.cloneDeep(g==null?void 0:g.animationData))==null?void 0:h["输出(动画数据)Content"])??[];d&&(u.value=d)},{deep:!0,immediate:!0}),(d,h)=>{var x,P,c;return e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(),e.createBlock(me.ssTable,{itemData:(x=u.value)==null?void 0:x.compData,key:(P=u.value)==null?void 0:P.id,index:(c=u.value)==null?void 0:c.id,showHeader:!1},null,8,["itemData","index"]))])}}},xe=oe._export_sfc(we,[["__scopeId","data-v-2387536e"]]),Ve={class:"panel-content"},Me={key:0,class:"joints-list"},ke={class:"joint-info-row"},Pe={class:"joint-left"},_e={class:"joint-name"},Ce={class:"joint-range"},be={class:"joint-type"},Ee={key:0,class:"joint-control-row"},ze={class:"slider-container"},De=["min","max","value","onInput","disabled"],Ne={class:"value-display"},Se={class:"joint-value"},Be={class:"unit"},Ae={key:1,class:"empty-state"},Re=1e3,ue=60,Fe={__name:"jointPanel",props:{model:Object,scene:Object,animationData:Object},setup(z,{expose:g}){const u=z;e.ref(!0);const d=e.ref([]),h=e.ref(null),x=e.ref(null),P=e.ref(12.5),c=e.ref(),C=e.ref(1302),F=e.ref(30),D=e.ref(!1),S=e.ref(!1),b=e.ref(0),r=e.ref(0),k=e.ref(null),y=n.MathUtils.degToRad,t=e.ref(1),p=()=>Re/ue/t.value;let m=[];e.watch(()=>u.animationData,o=>{var i;C.value=o.extra.管长,P.value=o.extra.外径/2;let v=((i=re.cloneDeep(o))==null?void 0:i["输出(动画数据)"])??[];v&&v.length>0&&(m=v)},{deep:!0}),e.computed(()=>m.length>0);const _=(o,v=!1)=>o==="revolute"?v?Math.PI:-Math.PI:o==="prismatic"?v?1:-1:0,I=()=>{if(!h.value)return re.ElMessage.error("未加载 URDF"),!1;let o=null;return h.value.traverse(v=>{o||v.name==="Pipe_Link"&&v.traverse(i=>{i instanceof n.Mesh&&!o&&(o=i)})}),o?(o.position.y-=F.value*ae.mm2m,c.value=o,o.material=new n.MeshPhongMaterial({color:11184810,shininess:80,side:n.DoubleSide}),!0):(re.ElMessage.error('在 "Pipe_Link" 内未找到任何 Mesh'),!1)},A=o=>{if(!o||!o.joints)return console.warn("URDF模型没有关节信息"),[];let v=null;if(o.traverse(V=>{V.name==="Pipe_Link"&&!v&&(v=V)}),v)c.value=v;else return console.warn("未找到管子模型"),[];const i=[];return Object.keys(o.joints).forEach(V=>{const s=o.joints[V];if(s._jointType==="fixed")return;const a=s.limit?{lower:s.limit.lower??_(s._jointType,!1),upper:s.limit.upper??_(s._jointType,!0)}:{lower:_(s._jointType,!1),upper:_(s._jointType,!0)};i.push({name:V,type:s._jointType||"unknown",limit:a,currentValue:s.angle||0,urdfJoint:s})}),i.sort((V,s)=>V.name.localeCompare(s.name))},L=(o,v)=>{const i=d.value.find(s=>s.name===o);if(!i)return;const V=parseFloat(v);if(i.limit){const s=Math.max(i.limit.lower,Math.min(i.limit.upper,V));i.currentValue=s}else i.currentValue=V;u.model&&u.model.setJointValue?u.model.setJointValue(o,i.currentValue):i.urdfJoint&&i.urdfJoint.setJointValue(i.currentValue)},$=o=>o.reduce((v,i)=>{let V=0;const s=i.Y??0,a=i.C??0,w=i.R??0;return s>0&&(V+=s),a>0&&w>0&&(V+=w*y(a)),v+V},0),J=o=>{const v=[],i=o.Y??0,V=o.B??0,s=o.C??0,a=o.R??0,w={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!i&&!s)return v;if(v.push(w.pos.clone()),V!==0){const U=new n.Matrix4().makeRotationAxis(w.localY,y(V));w.localX.applyMatrix4(U),w.localZ.applyMatrix4(U)}if(i>0&&(w.pos.add(w.localY.clone().multiplyScalar(i*ae.mm2m)),v.push(w.pos.clone())),s>0&&a>0){const U=y(s),T=a*ae.mm2m,W=w.pos.clone().add(w.localX.clone().multiplyScalar(-T)),R=Math.max(16,Math.ceil(s/5));for(let M=1;M<=R;M++){const H=U*M/R,K=new n.Matrix4().makeRotationAxis(w.localZ,H),se=w.localX.clone().multiplyScalar(T).applyMatrix4(K),ie=W.clone().add(se);v.push(ie)}}return v},G=(o,v=0)=>{let i=m.slice(0,o+1);const V=m[o+1];if(V&&v>0){const R={...V,B:(V.B??0)*v,C:(V.C??0)*v};i.push(R)}const s=$(i),a=Math.max(0,C.value-s),w=[];w.push(new n.Vector3(0,0,0));const U=new n.Vector3(0,a*ae.mm2m,0);a>0&&w.push(U);let T={pos:U.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const W=[];for(let R=i.length-1;R>=0;R--){const M=i[R],H=J(M);if(H.length>0){const K=H.map(Q=>{const ne=Q.clone(),de=new n.Matrix4;return de.makeBasis(T.localX,T.localY,T.localZ),ne.applyMatrix4(de),ne.add(T.pos)});W.push(K);const te=K[K.length-1];T.pos=te.clone();const se=M.B??0,ie=M.C??0;if(se!==0){const Q=new n.Matrix4().makeRotationAxis(T.localY,y(se));T.localX.applyMatrix4(Q),T.localZ.applyMatrix4(Q)}if(ie>0){const Q=y(ie),ne=new n.Matrix4().makeRotationAxis(T.localZ,Q);T.localY.applyMatrix4(ne),T.localX.applyMatrix4(ne)}}}for(const R of W)R.length>1&&w.push(...R.slice(1));w.length<2&&w.push(new n.Vector3(0,.001,0));try{const R=new n.CatmullRomCurve3(w,!1,"catmullrom",.01),M=new n.TubeGeometry(R,Math.max(2,w.length*4),P.value*ae.mm2m,18,!1);c.value.geometry.dispose(),c.value.geometry=M}catch(R){console.error("管件更新失败",R)}},Y=(o,v,i=1)=>{o&&(Object.keys(o).forEach(V=>{const s=o[V],a=d.value.find(w=>w.name===V);a&&(a.currentValue=s,u.model&&u.model.setJointValue?u.model.setJointValue(V,s):a.urdfJoint&&a.urdfJoint.setJointValue(s))}),G(v,i))},f=(o,v,i)=>o+(v-o)*i,l=(o,v,i)=>{if(!o||!v)return o||v;const V={};return Object.keys(o).forEach(s=>{const a=o[s],w=v[s];V[s]=f(a,w||a,i)}),V},E=()=>{if(m.length===0){console.warn("没有动画数据");return}I(),D.value=!0,S.value=!1,b.value=0,r.value=0,B()},B=()=>{if(!D.value||S.value)return;const o=b.value;if(o>=m.length-1){const s=m[m.length-1];Y(s,m.length-1,1),j();return}const v=r.value/ue,i=m[o],V=m[o+1];if(V){const s=l(i,V,v);Y(s,o,v)}else Y(i,o);r.value++,r.value>ue&&(r.value=0,b.value++),k.value=setTimeout(B,p())},O=()=>{S.value=!0,k.value&&(clearTimeout(k.value),k.value=null)},j=()=>{D.value=!1,S.value=!1,t.value=1,k.value&&(clearTimeout(k.value),k.value=null)};g({startAnimation:E,pauseAnimation:O,stopAnimation:j,resetAll:()=>{j(),b.value=0,r.value=0,d.value.forEach(o=>{(o.type==="revolute"||o.type==="prismatic")&&L(o.name,0)}),G(-1,0)},fastForward:()=>{t.value<4&&(t.value=Math.min(4,t.value*2))},fastBackward:()=>{t.value>.25&&(t.value=Math.max(.25,t.value/2))}}),e.watch(()=>u.model,o=>{o?(h.value=o,d.value=A(o)):d.value=[]},{immediate:!0});const ee=()=>{!u.model||D.value&&!S.value||d.value.forEach(o=>{o.urdfJoint&&o.urdfJoint.angle!==void 0&&(o.currentValue=o.urdfJoint.angle)})},le=()=>{const o=()=>{ee(),x.value=requestAnimationFrame(o)};o()},ce=()=>{x.value&&(cancelAnimationFrame(x.value),x.value=null)};return e.onMounted(()=>{le()}),e.onUnmounted(()=>{ce(),j()}),(o,v)=>(e.openBlock(),e.createElementBlock("div",Ve,[d.value.length>0?(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,i=>{var V,s,a,w;return e.openBlock(),e.createElementBlock("div",{key:i.name,class:"joint-item"},[e.createElementVNode("div",ke,[e.createElementVNode("div",Pe,[e.createElementVNode("span",_e,e.toDisplayString(i.name),1),e.createElementVNode("span",Ce," ["+e.toDisplayString(((V=i.limit)==null?void 0:V.lower.toFixed(2))??(i.type==="revolute"?"-3.14":"-1.00"))+", "+e.toDisplayString(((s=i.limit)==null?void 0:s.upper.toFixed(2))??(i.type==="revolute"?"3.14":"1.00"))+"] ",1)]),e.createElementVNode("span",be,e.toDisplayString(i.type),1)]),i.type==="revolute"||i.type==="prismatic"?(e.openBlock(),e.createElementBlock("div",Ee,[e.createElementVNode("div",ze,[e.createElementVNode("input",{type:"range",min:((a=i.limit)==null?void 0:a.lower)??(i.type==="revolute"?-Math.PI:-1),max:((w=i.limit)==null?void 0:w.upper)??(i.type==="revolute"?Math.PI:1),step:.01,value:i.currentValue,onInput:U=>L(i.name,U.target.value),class:"joint-slider",disabled:D.value&&!S.value},null,40,De)]),e.createElementVNode("div",Ne,[e.createElementVNode("span",Se,e.toDisplayString(i.currentValue?Number(i.currentValue).toFixed(3):"0.000"),1),e.createElementVNode("span",Be,e.toDisplayString(i.type==="revolute"?"rad":"m"),1)])])):e.createCommentVNode("",!0)])}),128))])):(e.openBlock(),e.createElementBlock("div",Ae,v[0]||(v[0]=[e.createElementVNode("p",null,"未检测到可控制的关节",-1)])))]))}},Te=oe._export_sfc(Fe,[["__scopeId","data-v-d48ad0d8"]]),Le={class:"panel-content"},Ie="id",$e={__name:"urdfTree",props:{model:Object,maxExpandCount:{type:Number,default:10},expandStrategy:{type:String,default:"breadth",validator:z=>["breadth","firstLevel"].includes(z)}},emits:["nodeClick"],setup(z,{emit:g}){const u=z,d=g,h=e.ref([]),x={children:"children",label:"label"},P=r=>{d("nodeClick",r)},c=(r,k=0)=>{const y=[];return Array.isArray(r)&&(r==null?void 0:r.length)>0&&r.forEach(t=>{if(!(t!=null&&t.isMesh)&&((t==null?void 0:t.type)==="URDFJoint"||(t==null?void 0:t.type)==="URDFLink")){const p={name:t==null?void 0:t.name,label:t==null?void 0:t.name,show:!0,level:k+1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:c(t==null?void 0:t.children,k+1),path:t==null?void 0:t.name};y.push(p)}}),y},C=r=>r?[{name:r==null?void 0:r.name,label:r==null?void 0:r.name,show:!0,level:1,isPenultimate:!1,type:r==null?void 0:r.type,id:r==null?void 0:r.id,limit:(r==null?void 0:r.limit)??"",children:c(r==null?void 0:r.children,1),path:r==null?void 0:r.name}]:[],F=(r,k)=>{const y=[],t=[...r];for(;t.length>0&&y.length<k;){const p=t.shift();p.children&&p.children.length>0&&(y.push(p.id),t.push(...p.children))}return y},D=(r,k)=>{const y=[];return r.forEach(t=>{if(t.children&&t.children.length>0){y.push(t.id);const p=t.children.filter(m=>m.children&&m.children.length>0).slice(0,k).map(m=>m.id);y.push(...p)}}),y.slice(0,k+1)},S=e.computed(()=>!h.value||h.value.length===0?[]:u.expandStrategy==="firstLevel"?D(h.value,u.maxExpandCount):F(h.value,u.maxExpandCount)),b=e.computed(()=>u!=null&&u.model?C(u.model):[]);return e.watch(b,r=>{h.value=JSON.parse(JSON.stringify(r))},{immediate:!0}),(r,k)=>{const y=e.resolveComponent("el-tree");return e.openBlock(),e.createElementBlock("div",Le,[e.createVNode(y,{data:h.value,props:x,"default-expanded-keys":S.value,"node-key":Ie,onNodeClick:P},null,8,["data","default-expanded-keys"])])}}},Je=oe._export_sfc($e,[["__scopeId","data-v-290ff4e1"]]),Oe=["xlink:href"],Ue=e.defineComponent({__name:"svgIcon",props:{backgroundColor:{default:"#f0f0f0"},prefix:{default:"icon"},name:{},size:{default:16},spin:{type:Boolean,default:!1},active:{type:Boolean,default:!1}},setup(z){const g=z,u=e.computed(()=>({backgroundColor:g.backgroundColor})),d=e.computed(()=>`#${g.prefix}-${g.name}`),h=e.computed(()=>{const{size:x}=g;let P=`${x}`;return P=`${P.replace("px","")}px`,{width:P,height:P}});return(x,P)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["container",{active:x.active}]),style:e.normalizeStyle(u.value)},[(e.openBlock(),e.createElementBlock("svg",{class:e.normalizeClass(["svg-icon",[x.$attrs.class,x.spin&&"svg-icon-spin"]]),style:e.normalizeStyle(h.value),"aria-hidden":"true"},[e.createElementVNode("use",{"xlink:href":d.value},null,8,Oe)],6))],6))}}),N=oe._export_sfc(Ue,[["__scopeId","data-v-6b1132f4"]]),Ge={class:"obj-viewer-container"},je={class:"buttonGroup-top"},qe={class:"buttonGroup-topLeft"},Xe={class:"buttonGroup-left"},He={class:"buttonGroup-right"},Ye={class:"buttonGroup-bottom"},Ze={class:"left-panel"},We={class:"panel-header"},Ke={key:1,class:"clipping-content"},Qe={class:"radio-group"},et={class:"radio-label"},tt={class:"radio-label"},nt={class:"radio-label"},at={class:"radio-label"},ot={class:"right-panel"},lt={class:"panel-header"},st={key:0,class:"loading-overlay"},it={__name:"threeModel",props:{animationData:{type:Object,default:()=>{}}},emits:["getAnimationData"],setup(z,{expose:g,emit:u}){const d=u;let h=null,x=!1;const P=e.ref(null),c=e.ref(!1),C=e.ref("");e.ref(!1);const F=e.ref(!1),D=e.ref(!1),S=e.ref(""),b=e.ref(!1),r=e.ref(""),k=e.ref(),{currentModels:y,initialCameraPosition:t,initialTargetPosition:p,initThreeJS:m,handleResize:_,fitCameraToAllModels:I,getThreeJSObjects:A,clearAllModels:L,cleanup:$}=ve(P),{isAnimating:J,toggleAnimation:G,stopAnimation:Y}=ge(A,y),{isClipping:f,activeClippingAxis:l,toggleClipping:E,updateClippingPlanes:B}=he(A,y),{addModelsFromUrls:O,loadModelByDefaultPath:j,urdfModel:q,modelBoundingBoxes:X}=fe.useModelLoader(A,y,c,C,L),Z=()=>{if(F.value||y.value.length===0)return;F.value=!0,J.value&&Y();const{camera:s,controls:a}=A();if(!s||!a)return;a.enabled=!0;const w=H=>H<.5?4*H*H*H:1-Math.pow(-2*H+2,3)/2,U=s.position.clone(),T=a.target.clone(),W=1500,R=Date.now(),M=()=>{const H=Date.now()-R,K=Math.min(H/W,1),te=w(K);s.position.lerpVectors(U,t.value,te),a.target.lerpVectors(T,p.value,te),K<1?requestAnimationFrame(M):F.value=!1};M()},ee=async()=>x?Promise.resolve():new Promise(s=>{const a=()=>{x?s():requestAnimationFrame(a)};a()}),le=async(s,a)=>{try{await ee(),J.value&&Y(),f.value&&E();const w=await a(s);return I(X),w}catch(w){throw console.error("加载模型失败:",w),w}},ce=async s=>le(s,O),o=async s=>le(s,j),v=s=>{D.value=!0,S.value=s,s==="剖面视图"&&!f.value&&E()},i=s=>{b.value=!0,r.value=s,s==="动画仿真"&&d("getAnimationData")},V=()=>{e.nextTick(()=>{var s;(s=k.value)==null||s.startAnimation()})};return e.onMounted(async()=>{await e.nextTick();try{m(),h=A().scene,x=!0,window.addEventListener("resize",_)}catch(s){console.error("Three.js初始化失败:",s)}}),e.onBeforeUnmount(()=>{x=!1,S.value="",r.value="",window.removeEventListener("resize",_),J.value&&Y(),$()}),g({addModelsFromUrls:ce,loadModelByDefaultPath:o}),(s,a)=>{var U,T,W,R;const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Ge,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:P,class:"threejs-container"},null,512),e.createElementVNode("div",je,[e.createVNode(N,{name:"guanjianjiexi",size:"34"}),e.createVNode(N,{name:"guanjiekongzhi",size:"34"}),e.createVNode(N,{name:"gongyishengcheng",size:"34"}),e.createVNode(N,{name:"buchangshezhi",size:"34"}),e.createVNode(N,{name:"shuchujiagongchengxu",size:"34"})]),e.createElementVNode("div",qe,[e.createVNode(N,{name:"viewReset",size:"24",onClick:Z,title:"重置"}),e.createVNode(N,{name:"fangda",size:"24",title:"放大"}),e.createVNode(N,{name:"suoxiao",size:"24",title:"缩小"}),e.createVNode(N,{name:"lookAround",size:"24",onClick:e.unref(G),title:e.unref(J)?"停止动画":"动画视图"},null,8,["onClick","title"])]),e.createElementVNode("div",Xe,[e.createVNode(N,{name:"jiegoushu",size:"24",onClick:a[0]||(a[0]=M=>v("场景树")),active:D.value&&S.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(N,{name:"clipping",size:"24",onClick:a[1]||(a[1]=M=>v("剖面视图")),active:D.value&&S.value==="剖面视图",title:"剖面视图"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[2]||(a[2]=M=>v("场景树3"))}),e.createVNode(N,{name:"donghuafangzhen",size:"24",onClick:a[3]||(a[3]=M=>v("场景4"))})]),e.createElementVNode("div",He,[e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"guanjiekongzhi",size:"24",onClick:a[4]||(a[4]=M=>i("关节控制")),active:b.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:a[5]||(a[5]=M=>i("动画仿真")),active:b.value&&r.value==="动画仿真"},null,8,["active"]),e.createVNode(N,{name:"donghuafangzhen",size:"24"}),e.createVNode(N,{name:"donghuafangzhen",size:"24"})]),e.createElementVNode("div",Ye,[e.createVNode(N,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:(U=k.value)==null?void 0:U.fastBackward},null,8,["onClick"]),e.createVNode(N,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:V}),e.createVNode(N,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:(T=k.value)==null?void 0:T.fastForward},null,8,["onClick"]),e.createVNode(N,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:(W=k.value)==null?void 0:W.pauseAnimation},null,8,["onClick"]),e.createVNode(N,{name:"zhongzhi",size:"24",backgroundColor:"#ffffff",title:"停止",onClick:(R=k.value)==null?void 0:R.resetAll},null,8,["onClick"])]),e.withDirectives(e.createElementVNode("div",Ze,[e.createElementVNode("div",We,[e.createElementVNode("span",null,e.toDisplayString(S.value),1),e.createElementVNode("span",{class:"close",onClick:a[6]||(a[6]=M=>D.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[S.value==="场景树"?(e.openBlock(),e.createBlock(Je,{key:0,model:e.unref(q)},null,8,["model"])):e.createCommentVNode("",!0),S.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("div",Qe,[e.createElementVNode("label",et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":a[7]||(a[7]=M=>e.isRef(l)?l.value=M:null),onChange:a[8]||(a[8]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[16]||(a[16]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",tt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":a[9]||(a[9]=M=>e.isRef(l)?l.value=M:null),onChange:a[10]||(a[10]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[17]||(a[17]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",nt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":a[11]||(a[11]=M=>e.isRef(l)?l.value=M:null),onChange:a[12]||(a[12]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[18]||(a[18]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":a[13]||(a[13]=M=>e.isRef(l)?l.value=M:null),onChange:a[14]||(a[14]=(...M)=>e.unref(B)&&e.unref(B)(...M))},null,544),[[e.vModelRadio,e.unref(l)]]),a[19]||(a[19]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})],512),[[e.vShow,D.value]]),e.withDirectives(e.createElementVNode("div",ot,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:a[15]||(a[15]=M=>b.value=!1)}," X ")]),e.createVNode(w,{"max-height":"650px"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(Te,{ref_key:"jointRef",ref:k,model:e.unref(q),scene:e.unref(h),animationData:z.animationData},null,8,["model","scene","animationData"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{animationData:z.animationData},null,8,["animationData"]),[[e.vShow,r.value==="动画仿真"]])]),_:1})],512),[[e.vShow,b.value]]),c.value?(e.openBlock(),e.createElementBlock("div",st,[a[20]||(a[20]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(C.value),1)])):e.createCommentVNode("",!0)])}}},rt=oe._export_sfc(it,[["__scopeId","data-v-7bc47bb3"]]);exports.default=rt;
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as Ee, ref as b, watch as se, shallowRef as ve, computed as _e, onUnmounted as et, resolveComponent as j, createElementBlock as we, openBlock as le, createElementVNode as n, createVNode as o, withCtx as T, createBlock as Ce, createCommentVNode as ye, unref as S, toDisplayString as me, nextTick as Ie, onMounted as We, onBeforeUnmount as Ke, Fragment as tt, renderList as lt, withDirectives as W, vShow as re, renderSlot as De, isRef as Re, vModelRadio as Te } from "vue";
2
- import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-CtgE68nN.js";
2
+ import { r as Me, U as ot, s as Oe, u as at, a as nt, W as st } from "./workpieceTreePanel-CtLKTnWz.js";
3
3
  import { u as Qe, a as it, b as rt } from "./iconfont-CGucCJqY.js";
4
4
  import { a9 as ut, c as ct, E, aM as pt, ao as dt } from "./index-CA0SFykF.js";
5
5
  import { z as Ve, T as ke, V as z, x as Q, y as mt, F as vt, r as Se, I as ft, L as gt, J as ht, K as bt, N as yt, O as _t, Q as wt, R as Ct, v as kt, g as Pt, a as je, d as xt, c as Dt, e as Rt, b as Tt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js";
6
6
  import "./index.vue_vue_type_style_index_1_lang-BKgS2iFu.js";
7
7
  import { _ as ue, s as Mt } from "./index-CM4PTcFN.js";
8
8
  import "./index-BHtNKL1L.js";
9
- import "./index.vue_vue_type_style_index_1_lang-PC90A_B9.js";
9
+ import "./index.vue_vue_type_style_index_1_lang--VeL916J.js";
10
10
  import { m as K, g as Vt, a as St, b as At, c as $t } from "./robotUtil-DGZFmHa1.js";
11
11
  import "./index-CTZaaoq9.js";
12
12
  import { f as Ft, a as zt } from "./animationData-BNWYvI2q.js";
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-BTAKPbFy.cjs"),ue=require("./iconfont-BELvOiht.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs");require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs");const Q=require("./index-Dmi6R0kU.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-lcFrDPIJ.cjs");const Y=require("./robotUtil-_esgRFP3.cjs");require("./index-DrVAEV9j.cjs");const we=require("./animationData-j8m9iee2.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-BjckM2-i.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ie($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),s=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>a.model?Y.getNonFixedJoints(a.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),O=require("./workpieceTreePanel-CbsK-tey.cjs"),ue=require("./iconfont-BELvOiht.cjs"),A=require("./index-CEwxrYB-.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs");require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs");const Q=require("./index-Dmi6R0kU.cjs");require("./index-BpPyaNFa.cjs");require("./index.vue_vue_type_style_index_1_lang-C-HS1nJI.cjs");const Y=require("./robotUtil-_esgRFP3.cjs");require("./index-DrVAEV9j.cjs");const we=require("./animationData-j8m9iee2.cjs"),be=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Ne=require("./urdfTree-BjckM2-i.cjs"),F=require("./svgIcon-BH_8oaav.cjs"),K=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Me(V=.005,p=64){const f=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(f,p,V,16,!1),g=ye;return new n.Mesh(a,g)}const Ee=V=>V.reduce((p,f)=>{let a=0;const g=f.Y??0,h=f.C??0,u=f.R??0;return g>0&&(a+=g),h>0&&u>0&&(a+=u*K(h)),p+a},0),ke=V=>{const p=[],f=V.Y??0,a=V.B??0,g=V.C??0,h=V.R??0,u={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!f&&!g)return p;if(p.push(u.pos.clone()),a!==0){const _=new n.Matrix4().makeRotationAxis(u.localY,K(a));u.localX.applyMatrix4(_),u.localZ.applyMatrix4(_)}if(f>0&&(u.pos.add(u.localY.clone().multiplyScalar(f*Y.mm2m)),p.push(u.pos.clone())),g>0&&h>0){const _=K(g),c=h*Y.mm2m,x=u.pos.clone().add(u.localX.clone().multiplyScalar(-c)),r=Math.max(16,Math.ceil(g/5));for(let m=1;m<=r;m++){const s=_*m/r,d=new n.Matrix4().makeRotationAxis(u.localZ,s),b=u.localX.clone().multiplyScalar(c).applyMatrix4(d),k=x.clone().add(b);p.push(k)}}return p};function Te(V,p){const f=new n.Group;f.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let g=0,h=1;for(let u=0;u<V.length;u++){const _=V[u],c=_.Y??0,x=_.B??0,r=_.C??0,m=_.R??0;if(x!==0){const s=new n.Matrix4().makeRotationAxis(a.localY,K(x));a.localX.applyMatrix4(s),a.localZ.applyMatrix4(s)}if(c>0){const s=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(c*Y.mm2m));const d=a.pos.clone(),i=De(s,d,p*Y.mm2m);i.userData={segmentType:"straight",segmentIndex:g,frameIndex:u,length:c,frame:{Y:c,B:x,C:r,R:m}},i.name=`直段_${g}`,f.add(i);const b=s.clone();Se(f,h,b,p*Y.mm2m),g++}if(r>0&&m>0){const s=K(r),d=m*Y.mm2m,i=[];i.push(a.pos.clone());const b=a.pos.clone().add(a.localX.clone().multiplyScalar(-d)),k=Math.max(16,Math.ceil(r/5));for(let P=1;P<=k;P++){const S=s*P/k,D=new n.Matrix4().makeRotationAxis(a.localZ,S),L=a.localX.clone().multiplyScalar(d).applyMatrix4(D),M=b.clone().add(L);i.push(M)}const v=Pe(i,p*Y.mm2m);v.userData={segmentType:"bend",segmentIndex:g,frameIndex:u,angle:r,radius:m,centerPoint:b.toArray(),frame:{Y:c,B:x,C:r,R:m}},v.name=`弯段_${g}`,f.add(v),Math.floor(i.length/2),i[0],a.pos=i[i.length-1].clone();const T=new n.Matrix4().makeRotationAxis(a.localZ,s);a.localY.applyMatrix4(T),a.localX.applyMatrix4(T),g++,h++}}return f}function Se(V,p,f,a){const g=new n.Vector3(0,a*2,a*5),h=f.clone().add(g),u=[f,h],_=new n.BufferGeometry().setFromPoints(u),c=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),x=new n.Line(_,c);x.computeLineDistances(),V.add(x);const r=document.createElement("canvas"),m=r.getContext("2d");r.width=128,r.height=128,m.clearRect(0,0,128,128),m.fillStyle="#FF0000",m.font="bold 80px Arial",m.textAlign="center",m.textBaseline="middle",m.fillText(p.toString(),64,64);const s=new n.CanvasTexture(r),d=new n.SpriteMaterial({map:s,transparent:!0,depthTest:!1,depthWrite:!1}),i=new n.Sprite(d),b=a*3;i.scale.set(b,b,1),i.position.copy(h),i.name=`Label_${p}`,i.userData={labelNumber:p},V.add(i)}function De(V,p,f){const a=new n.LineCurve3(V,p),g=new n.TubeGeometry(a,2,f,18,!1);return new n.Mesh(g,ye)}function Pe(V,p){const f=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(f,Math.max(16,V.length*2),p,18,!1);return new n.Mesh(a,ye)}function Ce(V,p,f,a,g,h=0){let u=p.slice(0,g+1);const _=p[g+1];if(_&&h>0){const i={..._,B:(_.B??0)*h,C:(_.C??0)*h};u.push(i)}const c=Ee(u),x=Math.max(0,f-c),r=[];r.push(new n.Vector3(0,0,0));const m=new n.Vector3(0,x*Y.mm2m,0);x>0&&r.push(m);let s={pos:m.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const d=[];for(let i=u.length-1;i>=0;i--){const b=u[i],k=ke(b);if(k.length>0){const v=k.map(D=>{const R=D.clone(),L=new n.Matrix4;return L.makeBasis(s.localX,s.localY,s.localZ),R.applyMatrix4(L),R.add(s.pos)});d.push(v);const T=v[v.length-1];s.pos=T.clone();const P=b.B??0,S=b.C??0;if(P!==0){const D=new n.Matrix4().makeRotationAxis(s.localY,K(P));s.localX.applyMatrix4(D),s.localZ.applyMatrix4(D)}if(S>0){const D=K(S),R=new n.Matrix4().makeRotationAxis(s.localZ,D);s.localY.applyMatrix4(R),s.localX.applyMatrix4(R)}}}for(const i of d)i.length>1&&r.push(...i.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const i=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,r.length*4),a*Y.mm2m,18,!1);V.geometry.dispose(),V.geometry=b}catch(i){console.error("管件更新失败",i)}}function _e(V,p,f,a=0){let g=V.slice(0,f+1);const h=V[f+1];if(h&&a>0){const s={...h,B:(h.B??0)*a,C:(h.C??0)*a};g.push(s)}const u=Ee(g),_=Math.max(0,p-u),c=[];c.push(new n.Vector3(0,0,0));const x=new n.Vector3(0,_*Y.mm2m,0);_>0&&c.push(x);let r={pos:x.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const m=[];for(let s=g.length-1;s>=0;s--){const d=g[s],i=ke(d);if(i.length>0){const b=i.map(P=>{const S=P.clone(),D=new n.Matrix4;return D.makeBasis(r.localX,r.localY,r.localZ),S.applyMatrix4(D),S.add(r.pos)});m.push(b);const k=b[b.length-1];r.pos=k.clone();const v=d.B??0,T=d.C??0;if(v!==0){const P=new n.Matrix4().makeRotationAxis(r.localY,K(v));r.localX.applyMatrix4(P),r.localZ.applyMatrix4(P)}if(T>0){const P=K(T),S=new n.Matrix4().makeRotationAxis(r.localZ,P);r.localY.applyMatrix4(S),r.localX.applyMatrix4(S)}}}for(const s of m)s.length>1&&c.push(...s.slice(1));return c.length<2&&c.push(new n.Vector3(0,.001,0)),c}function xe(V,p,f,a,g,h,u,_=0,c=0){const x=g-c,r=_e(a,x,u,_);let s=_e(f,c,u,_);s.forEach(i=>i.y=-i.y),s.reverse();const d=[...s,...r];try{const i=new n.CatmullRomCurve3(d,!1,"catmullrom",.01),b=new n.TubeGeometry(i,Math.max(2,d.length*4),h*Y.mm2m,18,!1);p.geometry.dispose(),V.geometry.dispose(),p.parent&&p.parent.remove(p),V.geometry=b}catch(i){console.error("管件更新失败",i)}}const Re={class:"panel-content"},Be={class:"action-bar"},Ae={class:"animation-controls"},$e={class:"control-row"},Fe={class:"control-row"},ze={class:"frame-info"},Ye={class:"control-row"},Le={class:"progress-bar"},Ue={class:"dialog-footer"},Ie=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},emits:["getThreeData"],setup(V,{expose:p,emit:f}){const a=V,g=f,h=e.ref(),u=e.ref();e.watch(()=>a.threeData,l=>{const t=l==null?void 0:l.data;u.value=t==null?void 0:t.type},{immediate:!0});const _=async()=>{if(!sessionStorage.getItem("systemKey")){g("getThreeData");return}let t={};u.value===O.robotMode.SINGLE&&(t=await we.fetchSingleRobotAnimationData()),u.value===O.robotMode.DOUBLE&&(t=await we.fetchDoubleRobotAnimationData());const{initialPipeLength:o=0,pipeRadius:y=0,clampLength:N=0,animationData:E}=t;S.value=o,D.value=y,R.value=N,h.value=E;const j=A.cloneDeep(h.value),W=ie($.value),J=(j==null?void 0:j["输出(动画数据)"])||[];c.value=J.length?J:[W]},c=e.ref([]),x=e.ref(!1),r=e.ref(""),m=e.ref(!1),s=e.ref(0),d=e.ref(0),i=e.ref(1e3);let b=!1;const k=e.ref(null),v=e.shallowRef(null),T=e.shallowRef(null),P=e.shallowRef(null),S=e.ref(0),D=e.ref(12.5),R=e.ref(30),L=e.ref([]),M=e.ref(null),C=e.computed(()=>a.model?Y.getNonFixedJoints(a.model).map(o=>o.name):[]),X=e.ref(["Y","B","C","R"]),$=e.computed(()=>[...C.value,...X.value]),Z=e.computed(()=>$.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${$.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),z=()=>c.value.map(l=>({Y:parseFloat(l.Y)||0,B:parseFloat(l.B)||0,C:parseFloat(l.C)||0,R:parseFloat(l.R)||0})),q=()=>{const l=[],t=[];return c.value.forEach(o=>{const{Y1:y,B1:N,C1:E,R1:j,Y2:W,B2:J,C2:re,R2:B}=o;l.push({Y:parseFloat(y)||0,B:parseFloat(N)||0,C:parseFloat(E)||0,R:parseFloat(j)||0}),t.push({Y:parseFloat(W)||0,B:parseFloat(J)||0,C:parseFloat(re)||0,R:parseFloat(B)||0})}),{posPipeYbcr:l,negPipeYbcr:t}},I=(l=0,t=0)=>{if(v.value&&T.value){const o=q();xe(v.value,T.value,o.posPipeYbcr,o.negPipeYbcr,S.value,D.value,l,t,R.value)}else if(v.value){const o=z();Ce(v.value,o,S.value,D.value,l,t)}},U=l=>{if(l<0||l>=c.value.length){console.error(`帧索引 ${l} 超出范围`);return}const t=c.value[l];if(console.log(`应用第 ${l} 帧数据 ${t}`),s.value=l,k.value){const o={};C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value.setJointAngles(o)}I(l,0)},H=async()=>{if(c.value.length===0){A.ElMessage.error("无法播放动画:无数据");return}if(!m.value){m.value=!0,b=!1,c.value.length-1===s.value&&(s.value=0);try{for(let l=s.value+1;l<c.value.length&&!b;l++){s.value=l;const t=c.value[l],o={};k.value&&C.value.forEach(y=>{const N=parseFloat(t[y]);isNaN(N)||(o[y]=N)}),k.value?await k.value.animateToState(o,i.value,y=>{d.value=(l+y)/c.value.length*100,I(l-1,y)}):(await new Promise(y=>setTimeout(y,i.value)),d.value=(l+1)/c.value.length*100)}b||A.ElMessage.success("动画播放完成")}catch(l){console.error("动画播放出错:",l),A.ElMessage.error("动画播放出错")}finally{m.value=!1,d.value=0}}},w=()=>{b=!0,m.value=!1,d.value=0,A.ElMessage.info("动画已停止")},te=()=>{s.value=0},G=()=>{if(v.value&&T.value){const l=q();xe(v.value,T.value,l.posPipeYbcr,l.negPipeYbcr,S.value,D.value,-1,0,R.value)}else if(v.value){const l=z();Ce(v.value,l,S.value,D.value,-1,0)}},oe=()=>{k.value&&k.value.resetToZero(),G(),te(),A.ElMessage.success("机器人和管件已重置")},ne=l=>`第 ${l+1} 帧`,de=l=>{m.value&&w(),U(l)},me=()=>{m.value&&w(),!(s.value+1>=c.value.length)&&U(s.value+1)},pe=()=>{m.value&&w(),s.value!==0&&U(s.value-1)},ae=()=>{P.value&&(P.value.visible=!0),v.value&&v.value.parent&&v.value.parent.remove(v.value),P.value=null,v.value=null,T.value=null},ie=l=>l==null?void 0:l.reduce((t,o)=>(t[o]="0",t),{});e.watch($,(l,t)=>{if(JSON.stringify(l)!==JSON.stringify(t))if(l.length>0){const o=ie(l);c.value=[o]}else c.value=[]},{immediate:!0});const se=e.ref(0),ve=l=>{se.value=l},ee=(l,t)=>{if(!l||!t)return;const o=Y.getTargetJoint(l,t),y=Me();y.visible=!1,o==null||o.add(y)},le=l=>{k.value=new O.URDFRobotController(l),L.value=Y.getAllLinkName(l),M.value="Pipe_Joint"},fe=()=>{k.value=null,L.value=[],M.value=null},ge=l=>{le(l),ee(l,M.value),ve(se.value+1),oe()};e.watch(()=>a.model,l=>{if(ae(),l){ge(l);return}fe()},{immediate:!0});const ce=l=>{var o,y;const t=new n.Mesh(l.geometry.clone(),l.material);return t.name="managed_pipe_clone",(y=(o=l==null?void 0:l.parent)==null?void 0:o.add)==null||y.call(o,t),t.position.copy(l.position),t.rotation.copy(l.rotation),t.scale.copy(l.scale),t};e.watch([M,R,S,se],([l,t])=>{if(ae(),a.model&&l){const o=Y.getMeshFromJoint(a.model,l);if(console.log(o,"meshToReplace"),o&&o.parent){P.value=o,o.visible=!1;const y=ce(o);if(u.value===O.robotMode.SINGLE&&(y.position.y-=t*.001),v.value=y,u.value===O.robotMode.DOUBLE){const N=ce(o);T.value=N}I(0,0)}else l&&console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`)}});const he=async()=>{if($.value.length===0){A.ElMessage.warning("没有可导出的表头");return}const l=$.value.join(" ");try{await navigator.clipboard.writeText(l),A.ElMessage.success("表头已成功复制到剪贴板!")}catch(t){console.error("复制失败:",t),A.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},Ve=()=>{if(!r.value.trim()){A.ElMessage.warning("导入内容不能为空");return}const l=r.value.trim().split(`
@@ -1,17 +1,17 @@
1
1
  import { defineComponent as fe, ref as m, watch as H, createElementBlock as G, openBlock as F, createStaticVNode as ot, createVNode as d, unref as v, withCtx as le, createElementVNode as a, normalizeClass as Pe, toDisplayString as y, nextTick as pe, computed as P, onBeforeUnmount as ze, resolveComponent as q, inject as xe, shallowRef as te, onMounted as it, withDirectives as $, createCommentVNode as Y, vShow as ae, renderSlot as me, createBlock as we, isRef as re, vModelRadio as ue } from "vue";
2
2
  import { aD as rt } from "./index.vue_vue_type_style_index_1_lang-BKgS2iFu.js";
3
- import { s as Ce, u as ut, a as ct, U as dt, W as vt } from "./workpieceTreePanel-CtgE68nN.js";
3
+ import { s as Ce, u as ut, a as ct, U as dt, W as vt } from "./workpieceTreePanel-CtLKTnWz.js";
4
4
  import { d as mt, u as pt, a as ft, b as bt } from "./iconfont-CGucCJqY.js";
5
5
  import { E as ce } from "./index-CA0SFykF.js";
6
6
  import { s as ht, b as _t, l as gt } from "./pointTrack-BRZj2fRP.js";
7
7
  import { _ as be } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
- import { b as yt, c as xt } from "./threeViewerHost-VbS8Lc22.js";
8
+ import { b as yt, c as xt } from "./threeViewerHost-CiYZBM4H.js";
9
9
  import { d as wt, e as Ct, f as kt } from "./robotUtil-DGZFmHa1.js";
10
10
  import { V as Pt, y as ke } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js";
11
11
  import { U as zt, J as At } from "./urdfTree-CoHIn4kK.js";
12
- import { a as Vt } from "./index-aK3MJy5p.js";
12
+ import { a as Vt } from "./index-CZm0g4PU.js";
13
13
  import { T as k } from "./svgIcon-OBhwktPM.js";
14
- import { K as Tt, j as Dt } from "./index-BmUApsCd.js";
14
+ import { K as Tt, j as Dt } from "./index-Dq3HNSET.js";
15
15
  const Ut = { class: "table-container" }, jt = ["title"], Mt = ["title"], $t = ["title"], Ft = ["title"], Nt = ["title"], Bt = ["title"], St = /* @__PURE__ */ fe({
16
16
  __name: "virtualScroller",
17
17
  props: {
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),qe=require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs"),O=require("./workpieceTreePanel-BTAKPbFy.cjs"),Z=require("./iconfont-BELvOiht.cjs"),Y=require("./index-CEwxrYB-.cjs"),te=require("./pointTrack-05CcPzgf.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=require("./threeViewerHost-CqVCzjCu.cjs"),ee=require("./robotUtil-_esgRFP3.cjs"),Q=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),ie=require("./urdfTree-BjckM2-i.cjs"),Le=require("./index-CZBpHmja.cjs"),V=require("./svgIcon-BH_8oaav.cjs"),re=require("./index-pMOq6QGz.cjs"),Ge={class:"table-container"},Je=["title"],Xe=["title"],We=["title"],Ze=["title"],Ye=["title"],He=["title"],Ke=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(m){const l=m,_=e.ref();function p(s){e.nextTick(()=>{var c;const r=l.list.findIndex(y=>y.id===s);r>-1&&((c=_.value)==null||c.scrollToItem(r,"center"))})}return e.watch(()=>l.currentId,p,{immediate:!0}),(s,r)=>(e.openBlock(),e.createElementBlock("div",Ge,[r[0]||(r[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(te.script$2),{class:"scroller",ref_key:"scrollerRef",ref:_,items:s.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:c,index:y})=>{var f,w,M,$,F,b,S,k,D,R;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:c.id===s.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:y+1},e.toDisplayString(y+1),9,Je),e.createElementVNode("div",{class:"cell",title:(f=c.x)==null?void 0:f.toFixed(5)},e.toDisplayString((w=c.x)==null?void 0:w.toFixed(5)),9,Xe),e.createElementVNode("div",{class:"cell",title:(M=c.y)==null?void 0:M.toFixed(5)},e.toDisplayString(($=c.y)==null?void 0:$.toFixed(5)),9,We),e.createElementVNode("div",{class:"cell",title:(F=c.z)==null?void 0:F.toFixed(5)},e.toDisplayString((b=c.z)==null?void 0:b.toFixed(5)),9,Ze),e.createElementVNode("div",{class:"cell",title:(S=c.b_axis)==null?void 0:S.toFixed(5)},e.toDisplayString((k=c.b_axis)==null?void 0:k.toFixed(5)),9,Ye),e.createElementVNode("div",{class:"cell",title:(D=c.c_axis)==null?void 0:D.toFixed(5)},e.toDisplayString((R=c.c_axis)==null?void 0:R.toFixed(5)),9,He)],2)]}),_:1},8,["items"])]))}}),Qe=ne._export_sfc(Ke,[["__scopeId","data-v-b02c9b80"]]);function et(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function tt(m){const l=te.getPointGeometry(m);return l&&(l.material.sizeAttenuation=!1),l}async function nt(m){return await ce.downloadFile(m)}async function at(m){return await ce.readCsv(m)}async function ot(m){const l=await nt(m);return(await at(l)).map(s=>{const r=et();return r.x_axis=s.X_Axis,r.y_axis=s.Y_Axis,r.z_axis=s.Z_Axis,r.b_axis=s.B_Axis,r.c_axis=s.C_Axis,r.x=s.X,r.y=s.Y,r.z=s.Z,r})}const lt={class:"panel-content"},st={class:"animation-controls"},it={class:"control-row"},rt={class:"control-row"},ct={class:"frame-info"},ut={class:"control-row"},dt={class:"scroller-row"},vt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(m,{expose:l,emit:_}){const p=m,s=e.computed(()=>(p.animationData||[]).map((o,u)=>({...o,id:u}))),r=e.ref(!1),c=e.ref(0),y=e.ref(100);let f=!1;const w={bladeAxis:"叶片模型位置"},M=e.ref(null),$=a=>{if(a<0||a>=s.value.length)return null;const o=ee.getObjectWorldMatrix(p.robot,w.bladeAxis);if(!o)return null;const u=s.value[a];return new Q.Vector3(u.x,u.y,u.z).applyMatrix4(o)},F=(a,o)=>{a&&a.setJointValues(o)},b=(a,o,u,h,E)=>{const q={B_Axis:Q.MathUtils.degToRad(h),C_Axis:Q.MathUtils.degToRad(E),X_Axis:a,Y_Axis:o,Z_Axis:u};F(p.robot,q)},S=()=>{const a=p.scene;if(!a)return;const o=[];a.traverse(u=>{u.name==="TrajectoryPoints"&&o.push(u)}),o.forEach(u=>{a.remove(u),Z.disposeObj(u)})},k=a=>{const o=[];for(let u=0;u<=a;u++){const h=$(u);h&&o.push(h.x,h.y,h.z)}return o},D=a=>{const o=tt(a);if(o)return o.name="TrajectoryPoints",M.value=o,o},R=a=>{S();const o=k(a),u=D(o);p.scene&&u&&p.scene.add(u)},z=a=>`第 ${a+1} 帧`,A=a=>{if(a<0||a>=s.value.length){console.error(`帧索引 ${a} 超出范围`);return}const o=s.value[a];c.value=a,b(o.x_axis,o.y_axis,o.z_axis,o.b_axis,o.c_axis);const u=p.scene;u&&u.updateMatrixWorld(!0),R(a)},G=async()=>{if(s.value.length===0){Y.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,f=!1,s.value.length-1===c.value&&(c.value=0);try{for(let a=c.value+1;a<s.value.length&&!f;a++)await new Promise(o=>setTimeout(o,y.value)),A(a);f||Y.ElMessage.success("动画播放完成")}catch(a){console.error("动画播放出错:",a)}finally{r.value=!1}}},C=async()=>{r.value&&(f=!0,await new Promise(a=>{const o=e.watch(()=>r.value,u=>{o(),a()})}))},T=async a=>{r.value&&await C(),A(a)},U=async()=>{r.value&&await C(),!(c.value+1>=s.value.length)&&A(c.value+1)},N=async()=>{r.value&&await C(),c.value!==0&&A(c.value-1)},x=()=>{c.value=0},j=async()=>{await C(),S(),x()};return e.onBeforeUnmount(()=>{j()}),l({playAnimation:G,stopAnimation:C,forwardFrame:U,backwardFrame:N,resetAnimationFrame:x,reset:j}),(a,o)=>{const u=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),q=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",st,[e.createElementVNode("div",it,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(h,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:y.value,"onUpdate:modelValue":o[0]||(o[0]=I=>y.value=I),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",rt,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",ct,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",ut,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(q,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=I=>c.value=I),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":z,onInput:T,disabled:s.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",dt,[e.createVNode(Qe,{class:"scroller",list:s.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),mt=ne._export_sfc(vt,[["__scopeId","data-v-228866a6"]]),pt=async m=>{const l=await te.loadObjByUrl(m);return l==null||l.traverse(_=>{_.isMesh&&_.geometry.computeVertexNormals()}),l},ft={class:"obj-viewer-container"},ht={key:0,class:"machine-casing"},bt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},_t={class:"buttonGroup-right"},Vt={class:"left-panel"},yt={class:"panel-header"},Nt={class:"panel-body"},xt={key:1,class:"clipping-content"},wt={class:"radio-group"},kt={class:"radio-label"},Ct={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},St={class:"right-panel"},Dt={class:"panel-header"},Tt={class:"panel-body"},Bt={key:1,class:"loading-overlay"},Mt={key:2,class:"brand"},zt={class:"brand-item"},At={class:"item-value"},Ut={class:"brand-item"},jt={class:"item-value"},$t={class:"brand-item"},Ft={class:"item-value"},Rt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(m){const l=m,_=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),s=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.machine}),r=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.产品型号}),c=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.编号}),y=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.厂家}),f=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.workpieceInfo}),w=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.knife}),M=e.ref([]),$=async n=>{!n||!n.isExtra||(await F(n),_==null||_(n==null?void 0:n.pageName),p==null||p(!0))},F=re.debounce(async n=>{await re.onPageBack();const{mainKey:t,baseMenuPath:i}=n||{};qe.copyAdd(i,t)},500);e.watch(()=>[r.value,f.value,w.value],()=>{var P,d,le,se;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};r.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:r.value,label:r.value,baseMenuPath:"设备库/机床"});const i={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};f.value&&i.children.push({isExtra:!0,type:(P=f.value)==null?void 0:P.type,pageName:"工件",mainKey:(d=f.value)==null?void 0:d.name,label:(le=f.value)==null?void 0:le.name,baseMenuPath:`工件库/${(se=f.value)==null?void 0:se.type}`});const W={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};w.value&&W.children.push({isExtra:!0,pageName:"刀具",mainKey:w.value,label:w.value,baseMenuPath:"设备库/刀具"}),n.push(t,i,W),M.value=n},{immediate:!0});const b=e.ref(!1),S=e.ref([]),k=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.csvUrl});e.watch(()=>k.value,async()=>{if(console.log("three data",l==null?void 0:l.threeData),console.log("csvUrl",k.value),k.value){b.value=!0;const n=await ot(k.value);S.value=n,b.value=!1}},{immediate:!0});const D=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.bladeObjUrl}),R=e.ref(O.sceneType.ROBOT),z=e.ref(null),A=e.ref(!1),G=e.ref(""),C=e.ref(!1),T=e.ref(""),U=e.ref(!1),N=e.ref(""),x=e.shallowRef(null),j=e.ref(null),a=e.ref("叶片模型"),o=e.shallowRef(null),u=e.shallowRef(null),h=e.ref(!0),E=e.shallowRef(null),q=e.computed(()=>!!E.value),I=e.shallowRef(null),v=e.ref(),{currentModels:J,resetView:ue,initThreeJS:de,handleResize:ve,getThreeJSObjects:L,cleanup:me,setModels:ae,axesHelperVisible:pe,toggleAxesVisibility:fe,zoomIn:he,zoomOut:be}=Z.useThreeJS(z),{loadSceneFromFile:ge}=O.useUrdfLoader(L,J,A,G),{isAnimating:oe,toggleAnimation:_e,stopAnimation:Ve}=Z.useAnimation(L,J),{isClipping:ye,activeClippingAxis:g,toggleClipping:Ne,updateClippingPlanes:B}=Z.useClipping(L,J),{initRaycaster:xe,selectedObject3D:we,setSelectedObjVisible:ke,updatePosition:Ce,updateRotation:Ee,dispose:Pe}=O.useRaycaster(z,L,J),Se=()=>{fe()},De=e.computed(()=>R.value===O.sceneType.ROBOT),Te=n=>{C.value=!0,T.value=n,n==="剖面视图"&&!ye.value&&Ne()},H=n=>{U.value=!0,N.value=n},Be=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.playAnimation()},Me=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.stopAnimation()},ze=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.forwardFrame()},Ae=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.backwardFrame()},K=()=>{var n;(n=v==null?void 0:v.value)==null||n.reset()},Ue=()=>{K(),ue(),j.value&&j.value.resetToZero()},je=n=>{if(!n){E.value=null,h.value=!1;return}const t=ee.getTargetLink(n,"Base1");E.value=t,h.value=!!(t!=null&&t.visible)},$e=n=>{h.value=n,E.value.visible=n},Fe=(n,t)=>ee.getMeshFromLink(n,t),Re=async n=>{const t=Fe(n,a.value);if(u.value=t,console.log("bladeObjUrl",D.value),t&&t.parent&&D.value){const i=await pt(D.value);i.name="blade_clone",t.parent.add(i),i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),t.visible=!1,o.value=i}else a.value&&console.warn(`在 Blade '${a.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>l.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ge(t).then(i=>{x.value=i,i&&Re(i)}).catch(i=>{console.error("加载URDF文件时发生错误:",i),Y.ElMessage.error("加载urdf模型失败"),x.value=null})}else x.value=null},{immediate:!0,deep:!0}),e.watch(x,n=>{K(),n?(ae([n]),j.value=new O.URDFRobotController(n)):(ae([]),j.value=null),je(n),xe()});let X=null;const Ie=()=>{de(),e.nextTick(()=>{z.value&&(X=new ResizeObserver(ve),X.observe(z.value))});const n=L();I.value=n.scene},Oe=()=>{T.value="",N.value="",X&&X.disconnect(),oe.value&&Ve(),K(),me(),Pe()};return e.onMounted(async()=>{await e.nextTick();try{Ie()}catch(n){console.error("Three.js 初始化失败:",n),Y.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Oe()}),(n,t)=>{const i=e.resolveComponent("el-scrollbar"),W=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",ft,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:z,class:"threejs-container"},null,512),[[e.vShow,De.value]]),q.value?(e.openBlock(),e.createElementBlock("div",ht,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Le._sfc_main$1,{value:h.value,onChange:$e,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",bt,[e.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Ue,title:"重置"}),e.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(he)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(be)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(_e),title:e.unref(oe)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(pe),onClick:Se,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",gt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:Te},void 0,!0)]),e.createElementVNode("div",_t,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:H},void 0,!0),e.createVNode(V.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=P=>H("机床控制")),active:U.value&&N.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=P=>H("轨迹路径")),active:U.value&&N.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":b.value}])},[e.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ae}),e.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Be}),e.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ze}),e.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Me})],2),e.withDirectives(e.createElementVNode("div",Vt,[e.createElementVNode("div",yt,[e.createElementVNode("span",null,e.toDisplayString(T.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=P=>C.value=!1)}," X ")]),e.createElementVNode("div",Nt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var P;return[T.value==="场景树"?(e.openBlock(),e.createBlock(ie.UrdfTree,{key:0,model:x.value,extraNodes:M.value,onNodeClick:$},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),T.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",wt,[e.createElementVNode("label",kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(g)?g.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Ct,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(g)?g.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(g)?g.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(g)?g.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),T.value==="工件树"?(e.openBlock(),e.createBlock(O.WorkpieceTreePanel,{key:2,model:(P=e.unref(we))==null?void 0:P.obj,onVisibleChange:e.unref(ke),onUpdatePosition:e.unref(Ce),onUpdateRotation:e.unref(Ee)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",St,[e.createElementVNode("div",Dt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=P=>U.value=!1)}," X ")]),e.createElementVNode("div",Tt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ie.JointPanel,{model:x.value},null,8,["model"]),[[e.vShow,N.value==="机床控制"]]),e.withDirectives(e.createVNode(mt,{robot:x.value,scene:I.value,animationData:S.value,ref_key:"bladeTrackPanelRef",ref:v},null,8,["robot","scene","animationData"]),[[e.vShow,N.value==="轨迹路径"&&!b.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:N.value},void 0,!0)]),_:3})])],512),[[e.vShow,U.value]]),A.value?(e.openBlock(),e.createElementBlock("div",Bt,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(G.value),1)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Mt,[e.createElementVNode("div",zt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",At,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Ut,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",jt,e.toDisplayString(r.value),1)]),e.createElementVNode("div",$t,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createVNode(W,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),It=ne._export_sfc(Rt,[["__scopeId","data-v-2a433236"]]);exports.default=It;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),qe=require("./index.vue_vue_type_style_index_1_lang-coQLbheN.cjs"),O=require("./workpieceTreePanel-CbsK-tey.cjs"),Z=require("./iconfont-BELvOiht.cjs"),Y=require("./index-CEwxrYB-.cjs"),te=require("./pointTrack-05CcPzgf.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ce=require("./threeViewerHost-BPu_LZha.cjs"),ee=require("./robotUtil-_esgRFP3.cjs"),Q=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),ie=require("./urdfTree-BjckM2-i.cjs"),Le=require("./index-DsOj_EOL.cjs"),V=require("./svgIcon-BH_8oaav.cjs"),re=require("./index-IvJ1OjwT.cjs"),Ge={class:"table-container"},Je=["title"],Xe=["title"],We=["title"],Ze=["title"],Ye=["title"],He=["title"],Ke=e.defineComponent({__name:"virtualScroller",props:{list:{},currentId:{}},setup(m){const l=m,_=e.ref();function p(s){e.nextTick(()=>{var c;const r=l.list.findIndex(y=>y.id===s);r>-1&&((c=_.value)==null||c.scrollToItem(r,"center"))})}return e.watch(()=>l.currentId,p,{immediate:!0}),(s,r)=>(e.openBlock(),e.createElementBlock("div",Ge,[r[0]||(r[0]=e.createStaticVNode('<div class="table-header" data-v-b02c9b80><div class="header-cell line-number-col" data-v-b02c9b80>行号</div><div class="header-cell" data-v-b02c9b80>X</div><div class="header-cell" data-v-b02c9b80>Y</div><div class="header-cell" data-v-b02c9b80>Z</div><div class="header-cell" data-v-b02c9b80>B轴</div><div class="header-cell" data-v-b02c9b80>C轴</div></div>',1)),e.createVNode(e.unref(te.script$2),{class:"scroller",ref_key:"scrollerRef",ref:_,items:s.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:c,index:y})=>{var f,w,M,$,F,b,S,k,D,R;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:c.id===s.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:y+1},e.toDisplayString(y+1),9,Je),e.createElementVNode("div",{class:"cell",title:(f=c.x)==null?void 0:f.toFixed(5)},e.toDisplayString((w=c.x)==null?void 0:w.toFixed(5)),9,Xe),e.createElementVNode("div",{class:"cell",title:(M=c.y)==null?void 0:M.toFixed(5)},e.toDisplayString(($=c.y)==null?void 0:$.toFixed(5)),9,We),e.createElementVNode("div",{class:"cell",title:(F=c.z)==null?void 0:F.toFixed(5)},e.toDisplayString((b=c.z)==null?void 0:b.toFixed(5)),9,Ze),e.createElementVNode("div",{class:"cell",title:(S=c.b_axis)==null?void 0:S.toFixed(5)},e.toDisplayString((k=c.b_axis)==null?void 0:k.toFixed(5)),9,Ye),e.createElementVNode("div",{class:"cell",title:(D=c.c_axis)==null?void 0:D.toFixed(5)},e.toDisplayString((R=c.c_axis)==null?void 0:R.toFixed(5)),9,He)],2)]}),_:1},8,["items"])]))}}),Qe=ne._export_sfc(Ke,[["__scopeId","data-v-b02c9b80"]]);function et(){return{x:0,y:0,z:0,b_axis:0,c_axis:0,x_axis:0,y_axis:0,z_axis:0}}function tt(m){const l=te.getPointGeometry(m);return l&&(l.material.sizeAttenuation=!1),l}async function nt(m){return await ce.downloadFile(m)}async function at(m){return await ce.readCsv(m)}async function ot(m){const l=await nt(m);return(await at(l)).map(s=>{const r=et();return r.x_axis=s.X_Axis,r.y_axis=s.Y_Axis,r.z_axis=s.Z_Axis,r.b_axis=s.B_Axis,r.c_axis=s.C_Axis,r.x=s.X,r.y=s.Y,r.z=s.Z,r})}const lt={class:"panel-content"},st={class:"animation-controls"},it={class:"control-row"},rt={class:"control-row"},ct={class:"frame-info"},ut={class:"control-row"},dt={class:"scroller-row"},vt=e.defineComponent({__name:"bladeTrackPanel",props:{scene:{},robot:{},animationData:{}},emits:["getThreeData"],setup(m,{expose:l,emit:_}){const p=m,s=e.computed(()=>(p.animationData||[]).map((o,u)=>({...o,id:u}))),r=e.ref(!1),c=e.ref(0),y=e.ref(100);let f=!1;const w={bladeAxis:"叶片模型位置"},M=e.ref(null),$=a=>{if(a<0||a>=s.value.length)return null;const o=ee.getObjectWorldMatrix(p.robot,w.bladeAxis);if(!o)return null;const u=s.value[a];return new Q.Vector3(u.x,u.y,u.z).applyMatrix4(o)},F=(a,o)=>{a&&a.setJointValues(o)},b=(a,o,u,h,E)=>{const q={B_Axis:Q.MathUtils.degToRad(h),C_Axis:Q.MathUtils.degToRad(E),X_Axis:a,Y_Axis:o,Z_Axis:u};F(p.robot,q)},S=()=>{const a=p.scene;if(!a)return;const o=[];a.traverse(u=>{u.name==="TrajectoryPoints"&&o.push(u)}),o.forEach(u=>{a.remove(u),Z.disposeObj(u)})},k=a=>{const o=[];for(let u=0;u<=a;u++){const h=$(u);h&&o.push(h.x,h.y,h.z)}return o},D=a=>{const o=tt(a);if(o)return o.name="TrajectoryPoints",M.value=o,o},R=a=>{S();const o=k(a),u=D(o);p.scene&&u&&p.scene.add(u)},z=a=>`第 ${a+1} 帧`,A=a=>{if(a<0||a>=s.value.length){console.error(`帧索引 ${a} 超出范围`);return}const o=s.value[a];c.value=a,b(o.x_axis,o.y_axis,o.z_axis,o.b_axis,o.c_axis);const u=p.scene;u&&u.updateMatrixWorld(!0),R(a)},G=async()=>{if(s.value.length===0){Y.ElMessage.warning("无法播放动画:缺失动画数据");return}if(!r.value){r.value=!0,f=!1,s.value.length-1===c.value&&(c.value=0);try{for(let a=c.value+1;a<s.value.length&&!f;a++)await new Promise(o=>setTimeout(o,y.value)),A(a);f||Y.ElMessage.success("动画播放完成")}catch(a){console.error("动画播放出错:",a)}finally{r.value=!1}}},C=async()=>{r.value&&(f=!0,await new Promise(a=>{const o=e.watch(()=>r.value,u=>{o(),a()})}))},T=async a=>{r.value&&await C(),A(a)},U=async()=>{r.value&&await C(),!(c.value+1>=s.value.length)&&A(c.value+1)},N=async()=>{r.value&&await C(),c.value!==0&&A(c.value-1)},x=()=>{c.value=0},j=async()=>{await C(),S(),x()};return e.onBeforeUnmount(()=>{j()}),l({playAnimation:G,stopAnimation:C,forwardFrame:U,backwardFrame:N,resetAnimationFrame:x,reset:j}),(a,o)=>{const u=e.resolveComponent("el-input-number"),h=e.resolveComponent("el-form-item"),E=e.resolveComponent("el-form"),q=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",lt,[e.createElementVNode("div",st,[e.createElementVNode("div",it,[e.createVNode(E,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(h,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(u,{modelValue:y.value,"onUpdate:modelValue":o[0]||(o[0]=I=>y.value=I),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",rt,[o[2]||(o[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",ct,e.toDisplayString(c.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",ut,[o[3]||(o[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(q,{class:"slider",modelValue:c.value,"onUpdate:modelValue":o[1]||(o[1]=I=>c.value=I),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":z,onInput:T,disabled:s.value.length===0},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",dt,[e.createVNode(Qe,{class:"scroller",list:s.value,"current-id":c.value},null,8,["list","current-id"])])])])}}}),mt=ne._export_sfc(vt,[["__scopeId","data-v-228866a6"]]),pt=async m=>{const l=await te.loadObjByUrl(m);return l==null||l.traverse(_=>{_.isMesh&&_.geometry.computeVertexNormals()}),l},ft={class:"obj-viewer-container"},ht={key:0,class:"machine-casing"},bt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},_t={class:"buttonGroup-right"},Vt={class:"left-panel"},yt={class:"panel-header"},Nt={class:"panel-body"},xt={key:1,class:"clipping-content"},wt={class:"radio-group"},kt={class:"radio-label"},Ct={class:"radio-label"},Et={class:"radio-label"},Pt={class:"radio-label"},St={class:"right-panel"},Dt={class:"panel-header"},Tt={class:"panel-body"},Bt={key:1,class:"loading-overlay"},Mt={key:2,class:"brand"},zt={class:"brand-item"},At={class:"item-value"},Ut={class:"brand-item"},jt={class:"item-value"},$t={class:"brand-item"},Ft={class:"item-value"},Rt=e.defineComponent({__name:"threeSceneViewForCPMPIP",props:{fileBlobs:{default:()=>[]},threeData:{}},setup(m){const l=m,_=e.inject("setManagementPageTitle"),p=e.inject("setManagementPageVisible"),s=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.machine}),r=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.产品型号}),c=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.编号}),y=e.computed(()=>{var t;return(t=s==null?void 0:s.value)==null?void 0:t.厂家}),f=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.workpieceInfo}),w=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.knife}),M=e.ref([]),$=async n=>{!n||!n.isExtra||(await F(n),_==null||_(n==null?void 0:n.pageName),p==null||p(!0))},F=re.debounce(async n=>{await re.onPageBack();const{mainKey:t,baseMenuPath:i}=n||{};qe.copyAdd(i,t)},500);e.watch(()=>[r.value,f.value,w.value],()=>{var P,d,le,se;const n=[],t={pageName:"机床",name:"机床",label:"机床",type:"机床",id:"机床",path:"机床",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};r.value&&t.children.push({isExtra:!0,pageName:"机床",mainKey:r.value,label:r.value,baseMenuPath:"设备库/机床"});const i={pageName:"工件",name:"工件",label:"工件",type:"工件",id:"工件",path:"工件",baseMenuPath:"设备库/机床",children:[],show:!0,isPenultimate:!1};f.value&&i.children.push({isExtra:!0,type:(P=f.value)==null?void 0:P.type,pageName:"工件",mainKey:(d=f.value)==null?void 0:d.name,label:(le=f.value)==null?void 0:le.name,baseMenuPath:`工件库/${(se=f.value)==null?void 0:se.type}`});const W={pageName:"刀具",name:"刀具",label:"刀具",type:"刀具",id:"刀具",path:"刀具",children:[],show:!0,isPenultimate:!1};w.value&&W.children.push({isExtra:!0,pageName:"刀具",mainKey:w.value,label:w.value,baseMenuPath:"设备库/刀具"}),n.push(t,i,W),M.value=n},{immediate:!0});const b=e.ref(!1),S=e.ref([]),k=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.csvUrl});e.watch(()=>k.value,async()=>{if(console.log("three data",l==null?void 0:l.threeData),console.log("csvUrl",k.value),k.value){b.value=!0;const n=await ot(k.value);S.value=n,b.value=!1}},{immediate:!0});const D=e.computed(()=>{var t,i;return(i=(t=l==null?void 0:l.threeData)==null?void 0:t.data)==null?void 0:i.bladeObjUrl}),R=e.ref(O.sceneType.ROBOT),z=e.ref(null),A=e.ref(!1),G=e.ref(""),C=e.ref(!1),T=e.ref(""),U=e.ref(!1),N=e.ref(""),x=e.shallowRef(null),j=e.ref(null),a=e.ref("叶片模型"),o=e.shallowRef(null),u=e.shallowRef(null),h=e.ref(!0),E=e.shallowRef(null),q=e.computed(()=>!!E.value),I=e.shallowRef(null),v=e.ref(),{currentModels:J,resetView:ue,initThreeJS:de,handleResize:ve,getThreeJSObjects:L,cleanup:me,setModels:ae,axesHelperVisible:pe,toggleAxesVisibility:fe,zoomIn:he,zoomOut:be}=Z.useThreeJS(z),{loadSceneFromFile:ge}=O.useUrdfLoader(L,J,A,G),{isAnimating:oe,toggleAnimation:_e,stopAnimation:Ve}=Z.useAnimation(L,J),{isClipping:ye,activeClippingAxis:g,toggleClipping:Ne,updateClippingPlanes:B}=Z.useClipping(L,J),{initRaycaster:xe,selectedObject3D:we,setSelectedObjVisible:ke,updatePosition:Ce,updateRotation:Ee,dispose:Pe}=O.useRaycaster(z,L,J),Se=()=>{fe()},De=e.computed(()=>R.value===O.sceneType.ROBOT),Te=n=>{C.value=!0,T.value=n,n==="剖面视图"&&!ye.value&&Ne()},H=n=>{U.value=!0,N.value=n},Be=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.playAnimation()},Me=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.stopAnimation()},ze=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.forwardFrame()},Ae=()=>{var n;b.value||(n=v==null?void 0:v.value)==null||n.backwardFrame()},K=()=>{var n;(n=v==null?void 0:v.value)==null||n.reset()},Ue=()=>{K(),ue(),j.value&&j.value.resetToZero()},je=n=>{if(!n){E.value=null,h.value=!1;return}const t=ee.getTargetLink(n,"Base1");E.value=t,h.value=!!(t!=null&&t.visible)},$e=n=>{h.value=n,E.value.visible=n},Fe=(n,t)=>ee.getMeshFromLink(n,t),Re=async n=>{const t=Fe(n,a.value);if(u.value=t,console.log("bladeObjUrl",D.value),t&&t.parent&&D.value){const i=await pt(D.value);i.name="blade_clone",t.parent.add(i),i.position.copy(t.position),i.rotation.copy(t.rotation),i.scale.copy(t.scale),t.visible=!1,o.value=i}else a.value&&console.warn(`在 Blade '${a.value}' 中未找到可替换的网格或其没有父级。`)};e.watch(()=>l.fileBlobs,n=>{if(n&&n.length>0){const t=n[0];if(!t.name.toLowerCase().endsWith(".urdf"))return;ge(t).then(i=>{x.value=i,i&&Re(i)}).catch(i=>{console.error("加载URDF文件时发生错误:",i),Y.ElMessage.error("加载urdf模型失败"),x.value=null})}else x.value=null},{immediate:!0,deep:!0}),e.watch(x,n=>{K(),n?(ae([n]),j.value=new O.URDFRobotController(n)):(ae([]),j.value=null),je(n),xe()});let X=null;const Ie=()=>{de(),e.nextTick(()=>{z.value&&(X=new ResizeObserver(ve),X.observe(z.value))});const n=L();I.value=n.scene},Oe=()=>{T.value="",N.value="",X&&X.disconnect(),oe.value&&Ve(),K(),me(),Pe()};return e.onMounted(async()=>{await e.nextTick();try{Ie()}catch(n){console.error("Three.js 初始化失败:",n),Y.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Oe()}),(n,t)=>{const i=e.resolveComponent("el-scrollbar"),W=e.resolveComponent("PipeAnalysisPanel");return e.openBlock(),e.createElementBlock("div",ft,[e.withDirectives(e.createElementVNode("div",{ref_key:"threejsContainer",ref:z,class:"threejs-container"},null,512),[[e.vShow,De.value]]),q.value?(e.openBlock(),e.createElementBlock("div",ht,[t[12]||(t[12]=e.createElementVNode("div",null,"机床外壳",-1)),e.createVNode(Le._sfc_main$1,{value:h.value,onChange:$e,"active-text":"",inactiveText:""},null,8,["value"])])):e.createCommentVNode("",!0),e.createElementVNode("div",bt,[e.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:Ue,title:"重置"}),e.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(he)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(be)},null,8,["onClick"]),e.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(_e),title:e.unref(oe)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(pe),onClick:Se,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",gt,[e.renderSlot(n.$slots,"button-left",{switchRightPanel:Te},void 0,!0)]),e.createElementVNode("div",_t,[e.renderSlot(n.$slots,"button-right",{switchRightPanel:H},void 0,!0),e.createVNode(V.ThreeSvgIcon,{name:"jichuangxuanze",size:"24",onClick:t[0]||(t[0]=P=>H("机床控制")),active:U.value&&N.value==="机床控制",title:"机床控制"},null,8,["active"]),e.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:t[1]||(t[1]=P=>H("轨迹路径")),active:U.value&&N.value==="轨迹路径"},null,8,["active"])]),e.createElementVNode("div",{class:e.normalizeClass(["buttonGroup-bottom",{"animation-disabled":b.value}])},[e.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ae}),e.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:Be}),e.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ze}),e.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Me})],2),e.withDirectives(e.createElementVNode("div",Vt,[e.createElementVNode("div",yt,[e.createElementVNode("span",null,e.toDisplayString(T.value),1),e.createElementVNode("span",{class:"close",onClick:t[2]||(t[2]=P=>C.value=!1)}," X ")]),e.createElementVNode("div",Nt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>{var P;return[T.value==="场景树"?(e.openBlock(),e.createBlock(ie.UrdfTree,{key:0,model:x.value,extraNodes:M.value,onNodeClick:$},null,8,["model","extraNodes"])):e.createCommentVNode("",!0),T.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",xt,[e.createElementVNode("div",wt,[e.createElementVNode("label",kt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":t[3]||(t[3]=d=>e.isRef(g)?g.value=d:null),onChange:t[4]||(t[4]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[13]||(t[13]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",Ct,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":t[5]||(t[5]=d=>e.isRef(g)?g.value=d:null),onChange:t[6]||(t[6]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[14]||(t[14]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",Et,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":t[7]||(t[7]=d=>e.isRef(g)?g.value=d:null),onChange:t[8]||(t[8]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[15]||(t[15]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",Pt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":t[9]||(t[9]=d=>e.isRef(g)?g.value=d:null),onChange:t[10]||(t[10]=(...d)=>e.unref(B)&&e.unref(B)(...d))},null,544),[[e.vModelRadio,e.unref(g)]]),t[16]||(t[16]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0),T.value==="工件树"?(e.openBlock(),e.createBlock(O.WorkpieceTreePanel,{key:2,model:(P=e.unref(we))==null?void 0:P.obj,onVisibleChange:e.unref(ke),onUpdatePosition:e.unref(Ce),onUpdateRotation:e.unref(Ee)},null,8,["model","onVisibleChange","onUpdatePosition","onUpdateRotation"])):e.createCommentVNode("",!0)]}),_:1})])],512),[[e.vShow,C.value]]),e.withDirectives(e.createElementVNode("div",St,[e.createElementVNode("div",Dt,[e.createElementVNode("span",null,e.toDisplayString(N.value),1),e.createElementVNode("span",{class:"close",onClick:t[11]||(t[11]=P=>U.value=!1)}," X ")]),e.createElementVNode("div",Tt,[e.createVNode(i,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(ie.JointPanel,{model:x.value},null,8,["model"]),[[e.vShow,N.value==="机床控制"]]),e.withDirectives(e.createVNode(mt,{robot:x.value,scene:I.value,animationData:S.value,ref_key:"bladeTrackPanelRef",ref:v},null,8,["robot","scene","animationData"]),[[e.vShow,N.value==="轨迹路径"&&!b.value]]),e.renderSlot(n.$slots,"right-panel",{rightPanelType:N.value},void 0,!0)]),_:3})])],512),[[e.vShow,U.value]]),A.value?(e.openBlock(),e.createElementBlock("div",Bt,[t[17]||(t[17]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(G.value),1)])):e.createCommentVNode("",!0),r.value?(e.openBlock(),e.createElementBlock("div",Mt,[e.createElementVNode("div",zt,[t[18]||(t[18]=e.createElementVNode("div",{class:"item-label"},"厂家:",-1)),e.createElementVNode("div",At,e.toDisplayString(y.value),1)]),e.createElementVNode("div",Ut,[t[19]||(t[19]=e.createElementVNode("div",{class:"item-label"},"型号:",-1)),e.createElementVNode("div",jt,e.toDisplayString(r.value),1)]),e.createElementVNode("div",$t,[t[20]||(t[20]=e.createElementVNode("div",{class:"item-label"},"编号:",-1)),e.createElementVNode("div",Ft,e.toDisplayString(c.value),1)])])):e.createCommentVNode("",!0),e.createVNode(W,{ref:"pipeAnalysisPanelRef"},null,512)])}}}),It=ne._export_sfc(Rt,[["__scopeId","data-v-2a433236"]]);exports.default=It;
@@ -1,7 +1,7 @@
1
1
  import { ref as g, computed as P, defineComponent as de, watch as ve, createElementBlock as J, openBlock as U, createStaticVNode as Ye, createVNode as d, unref as u, withCtx as X, createElementVNode as l, normalizeClass as Ze, toDisplayString as A, nextTick as xe, resolveComponent as R, shallowRef as B, onMounted as He, onBeforeUnmount as We, withDirectives as I, createCommentVNode as M, createBlock as ce, renderSlot as _e, isRef as Z, vModelRadio as H, vShow as W } from "vue";
2
2
  import { u as qe, a as Qe, b as et, f as tt, d as ue } from "./iconfont-CGucCJqY.js";
3
3
  import { C as ee, V as he, N as lt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B8FQIQZU.js";
4
- import { r as nt } from "./threeViewerHost-VbS8Lc22.js";
4
+ import { r as nt } from "./threeViewerHost-CiYZBM4H.js";
5
5
  import { E as Q } from "./index-CA0SFykF.js";
6
6
  import { U as at, J as ot } from "./urdfTree-CoHIn4kK.js";
7
7
  import { s as st, l as it, g as rt, d as Ce, a as Te, c as ct } from "./pointTrack-BRZj2fRP.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),I=require("./iconfont-BELvOiht.cjs"),D=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),Ee=require("./threeViewerHost-CqVCzjCu.cjs"),R=require("./index-CEwxrYB-.cjs"),le=require("./urdfTree-BjckM2-i.cjs"),T=require("./pointTrack-05CcPzgf.cjs"),Y=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),k=require("./svgIcon-BH_8oaav.cjs"),xe=require("./isString-Cvx5mmsS.cjs"),j={POINT:"point",LINE:"line"};function Se(){const u=e.ref(j.LINE),p=l=>{u.value=l},N=e.computed(()=>u.value===j.POINT),d=e.computed(()=>u.value===j.LINE);return{trackType:u,setTrackType:p,isPoint:N,isLine:d,trackTypeConstants:j}}const Ie={class:"table-container"},De=["title"],ze=["title"],Pe=["title"],$e=["title"],Ae=e.defineComponent({__name:"trackScroller",props:{list:{},currentId:{}},setup(u){const p=u,N=e.ref();function d(l){e.nextTick(()=>{var i;const f=p.list.findIndex(n=>n.id===l);f>-1&&((i=N.value)==null||i.scrollToItem(f,"center"))})}return e.watch(()=>p.currentId,d,{immediate:!0}),(l,f)=>(e.openBlock(),e.createElementBlock("div",Ie,[f[0]||(f[0]=e.createStaticVNode('<div class="table-header" data-v-c4baa40f><div class="header-cell line-number-col" data-v-c4baa40f>行号</div><div class="header-cell" data-v-c4baa40f>X</div><div class="header-cell" data-v-c4baa40f>Y</div><div class="header-cell" data-v-c4baa40f>Z</div></div>',1)),e.createVNode(e.unref(T.script$2),{class:"scroller",ref_key:"scrollerRef",ref:N,items:l.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:i,index:n})=>{var m,a,y,r,E,h;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:i.id===l.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:n+1},e.toDisplayString(n+1),9,De),e.createElementVNode("div",{class:"cell",title:(m=i.x)==null?void 0:m.toFixed(5)},e.toDisplayString((a=i.x)==null?void 0:a.toFixed(5)),9,ze),e.createElementVNode("div",{class:"cell",title:(y=i.y)==null?void 0:y.toFixed(5)},e.toDisplayString((r=i.y)==null?void 0:r.toFixed(5)),9,Pe),e.createElementVNode("div",{class:"cell",title:(E=i.z)==null?void 0:E.toFixed(5)},e.toDisplayString((h=i.z)==null?void 0:h.toFixed(5)),9,$e)],2)]}),_:1},8,["items"])]))}}),Fe=Y._export_sfc(Ae,[["__scopeId","data-v-c4baa40f"]]);async function Be(u){return await T.loadObjByUrl(u)}function Le(u,p){u.position.copy(p)}function Ue(u,p,N=new D.Color(16711680)){const d=new D.Vector3;p.getWorldPosition(d);const l=u.geometry.attributes.position,f=u.geometry.attributes.color,i=new D.Color(2003455);let n=1/0,m=-1;for(let a=0;a<l.count;a++){const r=new D.Vector3().fromBufferAttribute(l,a).distanceTo(d);r<n&&(n=r,m=a)}for(let a=0;a<f.count;a++)i.toArray(f.array,a*3);if(m!==-1){const a=N.toArray(),y=m*3+2;for(let r=0;r<y;r=r+3)f.array[r]=a[0],f.array[r+1]=a[1],f.array[r+2]=a[2]}f.needsUpdate=!0}function ae(u,p,N,d=new D.Color(16711680)){Le(u,p),Ue(N,u,d)}const je={class:"panel-content"},Re={class:"animation-controls"},Oe={class:"control-row"},Me={class:"control-row"},qe={class:"frame-info"},Ke={class:"control-row slider-row"},Xe={class:"scroller-row"},Ge=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(u,{expose:p,emit:N}){const d=u,l=e.computed(()=>d.vectors),f=e.computed(()=>{const s=l.value||[];return s==null?void 0:s.map((z,A)=>{const{x:P,y:F,z:x}=z;return{id:A,x:P,y:F,z:x}})}),i=e.ref(!1),n=e.ref(0),m=e.ref(100);let a=!1;const y=s=>`第 ${s+1} 帧`,r=s=>{if(s<0||s>=l.value.length){console.error(`帧索引 ${s} 超出范围`);return}const v=l.value[s];n.value=s,ae(d.knife,v,d.cloud)},E=async()=>{if(l.value.length===0){R.ElMessage.error("无法播放动画:无数据");return}if(!i.value){i.value=!0,a=!1,l.value.length-1===n.value&&(n.value=0);try{for(let s=n.value+1;s<l.value.length&&!a;s++)await new Promise(v=>setTimeout(v,m.value)),r(s);a||R.ElMessage.success("动画播放完成")}catch(s){console.error("动画播放出错:",s)}finally{i.value=!1}}},h=async()=>{i.value&&(a=!0,await new Promise(s=>{const v=e.watch(()=>i.value,z=>{v(),s()})}),R.ElMessage.info("动画已停止"))},L=async s=>{i.value&&await h(),r(s)},O=async()=>{i.value&&await h(),!(n.value+1>=l.value.length)&&r(n.value+1)},M=async()=>{i.value&&await h(),n.value!==0&&r(n.value-1)},g=()=>{n.value=0};return p({playAnimation:E,stopAnimation:h,forwardFrame:O,backwardFrame:M,resetAnimationFrame:g,reset:async()=>{await h(),g()}}),(s,v)=>{const z=e.resolveComponent("el-input-number"),A=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),F=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Oe,[e.createVNode(P,{"label-width":"80px",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(A,{label:"帧间隔:",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:m.value,"onUpdate:modelValue":v[0]||(v[0]=x=>m.value=x),min:0,max:5e3,step:10,style:{width:"100%"},size:"small"},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",Me,[v[2]||(v[2]=e.createElementVNode("label",{class:"row-label"},"当前帧:",-1)),e.createElementVNode("span",qe,e.toDisplayString(n.value+1)+" / "+e.toDisplayString(l.value.length),1)]),e.createElementVNode("div",Ke,[v[3]||(v[3]=e.createElementVNode("label",{class:"row-label"},"动画进度:",-1)),e.createVNode(F,{modelValue:n.value,"onUpdate:modelValue":v[1]||(v[1]=x=>n.value=x),min:0,max:l.value.length>0?l.value.length-1:0,step:1,"format-tooltip":y,onInput:L,disabled:l.value.length===0,style:{flex:"1","margin-left":"5px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Xe,[e.createVNode(Fe,{class:"scroller",list:f.value,"current-id":n.value},null,8,["list","current-id"])])])])}}}),He=Y._export_sfc(Ge,[["__scopeId","data-v-af71163f"]]),Je={class:"obj-viewer-container"},Ye={class:"buttonGroup-topLeft"},Ze={class:"buttonGroup-left"},We={class:"buttonGroup-right"},Qe={class:"buttonGroup-bottom"},et={class:"left-panel"},tt={class:"panel-header"},ot={class:"panel-body"},nt={key:1,class:"clipping-content"},lt={class:"radio-group"},at={class:"radio-label"},rt={class:"radio-label"},st={class:"radio-label"},it={class:"radio-label"},ct={class:"right-panel"},ut={class:"panel-header"},dt={class:"panel-body"},vt={key:0,class:"loading-overlay"},ft=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(u,{emit:p}){const N=p,d=u,l=e.ref(null),f=e.ref(!1),i=e.ref(""),n=e.ref(),m=e.ref(!1),a=e.ref(""),y=e.ref(!1),r=e.ref(""),E=e.shallowRef(null),h=e.shallowRef(null),{currentModels:L,initThreeJS:O,handleResize:M,getThreeJSObjects:g,cleanup:Z,axesHelperVisible:s,toggleAxesVisibility:v,zoomIn:z,zoomOut:A}=I.useThreeJS(l),{isAnimating:P,toggleAnimation:F,stopAnimation:x}=I.useAnimation(g,L),{isClipping:re,activeClippingAxis:V,toggleClipping:se,updateClippingPlanes:C}=I.useClipping(g,L),{isPoint:W,isLine:Q,setTrackType:ie,trackTypeConstants:ee}=Se(),ce=()=>{v()},ue=t=>{m.value=!0,a.value=t,t==="剖面视图"&&!re.value&&se()},q=t=>{y.value=!0,r.value=t,t==="动画仿真"&&N("getAnimationData")},de=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.playAnimation())},K=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.stopAnimation())},ve=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.forwardFrame())},fe=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.backwardFrame())},X=e.ref([]),B=e.ref([]),pe=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isUv}),me=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isCyd}),ge=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isCpt}),b=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isNc}),G=e.computed(()=>{const t=d.fileBlobs||[];return t==null?void 0:t[0]}),_=e.shallowRef(),$=e.shallowRef(),te=e.computed(()=>$.value||_.value),S=e.shallowRef(),ye=()=>{const{scene:t}=g();_.value&&t&&(I.disposeObj(_.value,t),_.value=null),$.value&&t&&(I.disposeObj($.value,t),$.value=null)},he=()=>{const{scene:t}=g();S.value&&t&&(I.disposeObj(S.value,t),S.value=null)},oe=()=>{ye(),he()},ke=t=>{const{scene:o}=g(),w=new D.Line(t.geometry.clone(),t.material);return w.name="轨迹路径克隆体",w.position.copy(t.position),w.rotation.copy(t.rotation),w.scale.copy(t.scale),o==null||o.add(w),w},Ve=t=>{if(W.value){_.value=T.drawPoints(g,t),$.value=null;return}if(Q.value){_.value=T.drawLine(g,t),$.value=ke(_.value);return}},we=async t=>{const o=URL.createObjectURL(t),w=await Ee.readFileText(o);if(URL.revokeObjectURL(o),xe.isString(w)){const c=await T.getPoints(w,d.trackFileType)||[];X.value=c;const J=X.value;b.value&&Ve(J),pe.value&&(_.value=T.drawLine(g,J)),(me.value||ge.value)&&(_.value=T.drawPoints(g,J)),I.frameCameraToObject3D(g,_.value)}},ne=async t=>{ie(t),await H(G.value)},Ne=async()=>{const t=await Be("http://222.92.178.198:55002/CPMPIP/Cut/球头铣刀.obj");return t.scale.set(20,20,20),t.rotation.set(45,0,0,"XYZ"),t.visible=!1,t},_e=async()=>{var t,o;if(S.value=await Ne(),B.value=T.convertPointsToVector3(X.value),B.value&&B.value.length){ae(S.value,B.value[0],te.value,new D.Color(16711680)),(o=(t=h.value)==null?void 0:t.add)==null||o.call(t,S.value);return}},be=async()=>{var t;await((t=n==null?void 0:n.value)==null?void 0:t.reset()),await H(G.value)},H=async t=>{oe(),K(),await we(t),b.value&&_e()};e.watch(()=>G.value,async t=>{t&&await H(t)},{immediate:!0,deep:!0});let U=null;const Ce=()=>{O(),e.nextTick(()=>{l.value&&(U=new ResizeObserver(M),U.observe(l.value))});const t=g();h.value=t.scene,h.value&&(h.value.name="CPMPIP")},Te=()=>{U&&U.disconnect(),P.value&&x(),K(),oe(),Z()};return e.onMounted(async()=>{try{Ce()}catch(t){console.error("Three.js 初始化失败:",t),R.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Te()}),(t,o)=>{const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",Ye,[e.createVNode(k.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:be,title:"重置"}),e.createVNode(k.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(z)},null,8,["onClick"]),e.createVNode(k.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(A)},null,8,["onClick"]),e.createVNode(k.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(F),title:e.unref(P)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(k.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(s),onClick:ce,title:"显隐坐标轴"},null,8,["active"]),b.value?(e.openBlock(),e.createBlock(k.ThreeSvgIcon,{key:0,name:"dianyun",size:"24",active:e.unref(W),onClick:o[0]||(o[0]=c=>ne(e.unref(ee).POINT)),title:"点云"},null,8,["active"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(k.ThreeSvgIcon,{key:1,name:"luoxuanxian",size:"24",active:e.unref(Q),onClick:o[1]||(o[1]=c=>ne(e.unref(ee).LINE)),title:"线体"},null,8,["active"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ze,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:ue},void 0,!0)]),e.createElementVNode("div",We,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(k.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:o[2]||(o[2]=c=>q("关节控制")),active:y.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(k.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:o[3]||(o[3]=c=>q("动画仿真")),active:y.value&&r.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",Qe,[e.createVNode(k.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:fe}),e.createVNode(k.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(k.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(k.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:K})]),e.withDirectives(e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",null,e.toDisplayString(a.value),1),e.createElementVNode("span",{class:"close",onClick:o[4]||(o[4]=c=>m.value=!1)}," X ")]),e.createElementVNode("div",ot,[e.createVNode(w,{height:"100%"},{default:e.withCtx(()=>[a.value==="场景树"?(e.openBlock(),e.createBlock(le.UrdfTree,{key:0,model:E.value},null,8,["model"])):e.createCommentVNode("",!0),a.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":o[5]||(o[5]=c=>e.isRef(V)?V.value=c:null),onChange:o[6]||(o[6]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[14]||(o[14]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",rt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":o[7]||(o[7]=c=>e.isRef(V)?V.value=c:null),onChange:o[8]||(o[8]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[15]||(o[15]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",st,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":o[9]||(o[9]=c=>e.isRef(V)?V.value=c:null),onChange:o[10]||(o[10]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[16]||(o[16]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",it,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":o[11]||(o[11]=c=>e.isRef(V)?V.value=c:null),onChange:o[12]||(o[12]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[17]||(o[17]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,m.value]]),e.withDirectives(e.createElementVNode("div",ct,[e.createElementVNode("div",ut,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:o[13]||(o[13]=c=>y.value=!1)}," X ")]),e.createElementVNode("div",dt,[e.createVNode(w,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(le.JointPanel,{model:E.value},null,8,["model"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(He,{ref_key:"animationPanelRef",ref:n,cloud:te.value,knife:S.value,vectors:B.value},null,8,["cloud","knife","vectors"]),[[e.vShow,r.value==="动画仿真"&&b.value]])]),_:1})])],512),[[e.vShow,y.value]]),f.value?(e.openBlock(),e.createElementBlock("div",vt,[o[18]||(o[18]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(i.value),1)])):e.createCommentVNode("",!0)])}}}),pt=Y._export_sfc(ft,[["__scopeId","data-v-df98cfab"]]);exports.default=pt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),I=require("./iconfont-BELvOiht.cjs"),D=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BAniHexV.cjs"),Ee=require("./threeViewerHost-BPu_LZha.cjs"),R=require("./index-CEwxrYB-.cjs"),le=require("./urdfTree-BjckM2-i.cjs"),T=require("./pointTrack-05CcPzgf.cjs"),Y=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),k=require("./svgIcon-BH_8oaav.cjs"),xe=require("./isString-Cvx5mmsS.cjs"),j={POINT:"point",LINE:"line"};function Se(){const u=e.ref(j.LINE),p=l=>{u.value=l},N=e.computed(()=>u.value===j.POINT),d=e.computed(()=>u.value===j.LINE);return{trackType:u,setTrackType:p,isPoint:N,isLine:d,trackTypeConstants:j}}const Ie={class:"table-container"},De=["title"],ze=["title"],Pe=["title"],$e=["title"],Ae=e.defineComponent({__name:"trackScroller",props:{list:{},currentId:{}},setup(u){const p=u,N=e.ref();function d(l){e.nextTick(()=>{var i;const f=p.list.findIndex(n=>n.id===l);f>-1&&((i=N.value)==null||i.scrollToItem(f,"center"))})}return e.watch(()=>p.currentId,d,{immediate:!0}),(l,f)=>(e.openBlock(),e.createElementBlock("div",Ie,[f[0]||(f[0]=e.createStaticVNode('<div class="table-header" data-v-c4baa40f><div class="header-cell line-number-col" data-v-c4baa40f>行号</div><div class="header-cell" data-v-c4baa40f>X</div><div class="header-cell" data-v-c4baa40f>Y</div><div class="header-cell" data-v-c4baa40f>Z</div></div>',1)),e.createVNode(e.unref(T.script$2),{class:"scroller",ref_key:"scrollerRef",ref:N,items:l.list,"item-size":32,"items-limit":1/0,"key-field":"id"},{default:e.withCtx(({item:i,index:n})=>{var m,a,y,r,E,h;return[e.createElementVNode("div",{class:e.normalizeClass({row:!0,active:i.id===l.currentId})},[e.createElementVNode("div",{class:"cell line-number-col",title:n+1},e.toDisplayString(n+1),9,De),e.createElementVNode("div",{class:"cell",title:(m=i.x)==null?void 0:m.toFixed(5)},e.toDisplayString((a=i.x)==null?void 0:a.toFixed(5)),9,ze),e.createElementVNode("div",{class:"cell",title:(y=i.y)==null?void 0:y.toFixed(5)},e.toDisplayString((r=i.y)==null?void 0:r.toFixed(5)),9,Pe),e.createElementVNode("div",{class:"cell",title:(E=i.z)==null?void 0:E.toFixed(5)},e.toDisplayString((h=i.z)==null?void 0:h.toFixed(5)),9,$e)],2)]}),_:1},8,["items"])]))}}),Fe=Y._export_sfc(Ae,[["__scopeId","data-v-c4baa40f"]]);async function Be(u){return await T.loadObjByUrl(u)}function Le(u,p){u.position.copy(p)}function Ue(u,p,N=new D.Color(16711680)){const d=new D.Vector3;p.getWorldPosition(d);const l=u.geometry.attributes.position,f=u.geometry.attributes.color,i=new D.Color(2003455);let n=1/0,m=-1;for(let a=0;a<l.count;a++){const r=new D.Vector3().fromBufferAttribute(l,a).distanceTo(d);r<n&&(n=r,m=a)}for(let a=0;a<f.count;a++)i.toArray(f.array,a*3);if(m!==-1){const a=N.toArray(),y=m*3+2;for(let r=0;r<y;r=r+3)f.array[r]=a[0],f.array[r+1]=a[1],f.array[r+2]=a[2]}f.needsUpdate=!0}function ae(u,p,N,d=new D.Color(16711680)){Le(u,p),Ue(N,u,d)}const je={class:"panel-content"},Re={class:"animation-controls"},Oe={class:"control-row"},Me={class:"control-row"},qe={class:"frame-info"},Ke={class:"control-row slider-row"},Xe={class:"scroller-row"},Ge=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(u,{expose:p,emit:N}){const d=u,l=e.computed(()=>d.vectors),f=e.computed(()=>{const s=l.value||[];return s==null?void 0:s.map((z,A)=>{const{x:P,y:F,z:x}=z;return{id:A,x:P,y:F,z:x}})}),i=e.ref(!1),n=e.ref(0),m=e.ref(100);let a=!1;const y=s=>`第 ${s+1} 帧`,r=s=>{if(s<0||s>=l.value.length){console.error(`帧索引 ${s} 超出范围`);return}const v=l.value[s];n.value=s,ae(d.knife,v,d.cloud)},E=async()=>{if(l.value.length===0){R.ElMessage.error("无法播放动画:无数据");return}if(!i.value){i.value=!0,a=!1,l.value.length-1===n.value&&(n.value=0);try{for(let s=n.value+1;s<l.value.length&&!a;s++)await new Promise(v=>setTimeout(v,m.value)),r(s);a||R.ElMessage.success("动画播放完成")}catch(s){console.error("动画播放出错:",s)}finally{i.value=!1}}},h=async()=>{i.value&&(a=!0,await new Promise(s=>{const v=e.watch(()=>i.value,z=>{v(),s()})}),R.ElMessage.info("动画已停止"))},L=async s=>{i.value&&await h(),r(s)},O=async()=>{i.value&&await h(),!(n.value+1>=l.value.length)&&r(n.value+1)},M=async()=>{i.value&&await h(),n.value!==0&&r(n.value-1)},g=()=>{n.value=0};return p({playAnimation:E,stopAnimation:h,forwardFrame:O,backwardFrame:M,resetAnimationFrame:g,reset:async()=>{await h(),g()}}),(s,v)=>{const z=e.resolveComponent("el-input-number"),A=e.resolveComponent("el-form-item"),P=e.resolveComponent("el-form"),F=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",je,[e.createElementVNode("div",Re,[e.createElementVNode("div",Oe,[e.createVNode(P,{"label-width":"80px",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(A,{label:"帧间隔:",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:m.value,"onUpdate:modelValue":v[0]||(v[0]=x=>m.value=x),min:0,max:5e3,step:10,style:{width:"100%"},size:"small"},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",Me,[v[2]||(v[2]=e.createElementVNode("label",{class:"row-label"},"当前帧:",-1)),e.createElementVNode("span",qe,e.toDisplayString(n.value+1)+" / "+e.toDisplayString(l.value.length),1)]),e.createElementVNode("div",Ke,[v[3]||(v[3]=e.createElementVNode("label",{class:"row-label"},"动画进度:",-1)),e.createVNode(F,{modelValue:n.value,"onUpdate:modelValue":v[1]||(v[1]=x=>n.value=x),min:0,max:l.value.length>0?l.value.length-1:0,step:1,"format-tooltip":y,onInput:L,disabled:l.value.length===0,style:{flex:"1","margin-left":"5px"}},null,8,["modelValue","max","disabled"])]),e.createElementVNode("div",Xe,[e.createVNode(Fe,{class:"scroller",list:f.value,"current-id":n.value},null,8,["list","current-id"])])])])}}}),He=Y._export_sfc(Ge,[["__scopeId","data-v-af71163f"]]),Je={class:"obj-viewer-container"},Ye={class:"buttonGroup-topLeft"},Ze={class:"buttonGroup-left"},We={class:"buttonGroup-right"},Qe={class:"buttonGroup-bottom"},et={class:"left-panel"},tt={class:"panel-header"},ot={class:"panel-body"},nt={key:1,class:"clipping-content"},lt={class:"radio-group"},at={class:"radio-label"},rt={class:"radio-label"},st={class:"radio-label"},it={class:"radio-label"},ct={class:"right-panel"},ut={class:"panel-header"},dt={class:"panel-body"},vt={key:0,class:"loading-overlay"},ft=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(u,{emit:p}){const N=p,d=u,l=e.ref(null),f=e.ref(!1),i=e.ref(""),n=e.ref(),m=e.ref(!1),a=e.ref(""),y=e.ref(!1),r=e.ref(""),E=e.shallowRef(null),h=e.shallowRef(null),{currentModels:L,initThreeJS:O,handleResize:M,getThreeJSObjects:g,cleanup:Z,axesHelperVisible:s,toggleAxesVisibility:v,zoomIn:z,zoomOut:A}=I.useThreeJS(l),{isAnimating:P,toggleAnimation:F,stopAnimation:x}=I.useAnimation(g,L),{isClipping:re,activeClippingAxis:V,toggleClipping:se,updateClippingPlanes:C}=I.useClipping(g,L),{isPoint:W,isLine:Q,setTrackType:ie,trackTypeConstants:ee}=Se(),ce=()=>{v()},ue=t=>{m.value=!0,a.value=t,t==="剖面视图"&&!re.value&&se()},q=t=>{y.value=!0,r.value=t,t==="动画仿真"&&N("getAnimationData")},de=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.playAnimation())},K=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.stopAnimation())},ve=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.forwardFrame())},fe=()=>{var t;b.value&&((t=n==null?void 0:n.value)==null||t.backwardFrame())},X=e.ref([]),B=e.ref([]),pe=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isUv}),me=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isCyd}),ge=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isCpt}),b=e.computed(()=>{var o;return(o=d.trackFileType)==null?void 0:o.isNc}),G=e.computed(()=>{const t=d.fileBlobs||[];return t==null?void 0:t[0]}),_=e.shallowRef(),$=e.shallowRef(),te=e.computed(()=>$.value||_.value),S=e.shallowRef(),ye=()=>{const{scene:t}=g();_.value&&t&&(I.disposeObj(_.value,t),_.value=null),$.value&&t&&(I.disposeObj($.value,t),$.value=null)},he=()=>{const{scene:t}=g();S.value&&t&&(I.disposeObj(S.value,t),S.value=null)},oe=()=>{ye(),he()},ke=t=>{const{scene:o}=g(),w=new D.Line(t.geometry.clone(),t.material);return w.name="轨迹路径克隆体",w.position.copy(t.position),w.rotation.copy(t.rotation),w.scale.copy(t.scale),o==null||o.add(w),w},Ve=t=>{if(W.value){_.value=T.drawPoints(g,t),$.value=null;return}if(Q.value){_.value=T.drawLine(g,t),$.value=ke(_.value);return}},we=async t=>{const o=URL.createObjectURL(t),w=await Ee.readFileText(o);if(URL.revokeObjectURL(o),xe.isString(w)){const c=await T.getPoints(w,d.trackFileType)||[];X.value=c;const J=X.value;b.value&&Ve(J),pe.value&&(_.value=T.drawLine(g,J)),(me.value||ge.value)&&(_.value=T.drawPoints(g,J)),I.frameCameraToObject3D(g,_.value)}},ne=async t=>{ie(t),await H(G.value)},Ne=async()=>{const t=await Be("http://222.92.178.198:55002/CPMPIP/Cut/球头铣刀.obj");return t.scale.set(20,20,20),t.rotation.set(45,0,0,"XYZ"),t.visible=!1,t},_e=async()=>{var t,o;if(S.value=await Ne(),B.value=T.convertPointsToVector3(X.value),B.value&&B.value.length){ae(S.value,B.value[0],te.value,new D.Color(16711680)),(o=(t=h.value)==null?void 0:t.add)==null||o.call(t,S.value);return}},be=async()=>{var t;await((t=n==null?void 0:n.value)==null?void 0:t.reset()),await H(G.value)},H=async t=>{oe(),K(),await we(t),b.value&&_e()};e.watch(()=>G.value,async t=>{t&&await H(t)},{immediate:!0,deep:!0});let U=null;const Ce=()=>{O(),e.nextTick(()=>{l.value&&(U=new ResizeObserver(M),U.observe(l.value))});const t=g();h.value=t.scene,h.value&&(h.value.name="CPMPIP")},Te=()=>{U&&U.disconnect(),P.value&&x(),K(),oe(),Z()};return e.onMounted(async()=>{try{Ce()}catch(t){console.error("Three.js 初始化失败:",t),R.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{Te()}),(t,o)=>{const w=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Je,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",Ye,[e.createVNode(k.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:be,title:"重置"}),e.createVNode(k.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(z)},null,8,["onClick"]),e.createVNode(k.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(A)},null,8,["onClick"]),e.createVNode(k.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(F),title:e.unref(P)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(k.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(s),onClick:ce,title:"显隐坐标轴"},null,8,["active"]),b.value?(e.openBlock(),e.createBlock(k.ThreeSvgIcon,{key:0,name:"dianyun",size:"24",active:e.unref(W),onClick:o[0]||(o[0]=c=>ne(e.unref(ee).POINT)),title:"点云"},null,8,["active"])):e.createCommentVNode("",!0),b.value?(e.openBlock(),e.createBlock(k.ThreeSvgIcon,{key:1,name:"luoxuanxian",size:"24",active:e.unref(Q),onClick:o[1]||(o[1]=c=>ne(e.unref(ee).LINE)),title:"线体"},null,8,["active"])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ze,[e.renderSlot(t.$slots,"button-left",{switchRightPanel:ue},void 0,!0)]),e.createElementVNode("div",We,[e.renderSlot(t.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(k.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:o[2]||(o[2]=c=>q("关节控制")),active:y.value&&r.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(k.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:o[3]||(o[3]=c=>q("动画仿真")),active:y.value&&r.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",Qe,[e.createVNode(k.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:fe}),e.createVNode(k.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(k.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(k.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:K})]),e.withDirectives(e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.createElementVNode("span",null,e.toDisplayString(a.value),1),e.createElementVNode("span",{class:"close",onClick:o[4]||(o[4]=c=>m.value=!1)}," X ")]),e.createElementVNode("div",ot,[e.createVNode(w,{height:"100%"},{default:e.withCtx(()=>[a.value==="场景树"?(e.openBlock(),e.createBlock(le.UrdfTree,{key:0,model:E.value},null,8,["model"])):e.createCommentVNode("",!0),a.value==="剖面视图"?(e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("div",lt,[e.createElementVNode("label",at,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":o[5]||(o[5]=c=>e.isRef(V)?V.value=c:null),onChange:o[6]||(o[6]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[14]||(o[14]=e.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),e.createElementVNode("label",rt,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":o[7]||(o[7]=c=>e.isRef(V)?V.value=c:null),onChange:o[8]||(o[8]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[15]||(o[15]=e.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),e.createElementVNode("label",st,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":o[9]||(o[9]=c=>e.isRef(V)?V.value=c:null),onChange:o[10]||(o[10]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[16]||(o[16]=e.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),e.createElementVNode("label",it,[e.withDirectives(e.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":o[11]||(o[11]=c=>e.isRef(V)?V.value=c:null),onChange:o[12]||(o[12]=(...c)=>e.unref(C)&&e.unref(C)(...c))},null,544),[[e.vModelRadio,e.unref(V)]]),o[17]||(o[17]=e.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,m.value]]),e.withDirectives(e.createElementVNode("div",ct,[e.createElementVNode("div",ut,[e.createElementVNode("span",null,e.toDisplayString(r.value),1),e.createElementVNode("span",{class:"close",onClick:o[13]||(o[13]=c=>y.value=!1)}," X ")]),e.createElementVNode("div",dt,[e.createVNode(w,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(le.JointPanel,{model:E.value},null,8,["model"]),[[e.vShow,r.value==="关节控制"]]),e.withDirectives(e.createVNode(He,{ref_key:"animationPanelRef",ref:n,cloud:te.value,knife:S.value,vectors:B.value},null,8,["cloud","knife","vectors"]),[[e.vShow,r.value==="动画仿真"&&b.value]])]),_:1})])],512),[[e.vShow,y.value]]),f.value?(e.openBlock(),e.createElementBlock("div",vt,[o[18]||(o[18]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(i.value),1)])):e.createCommentVNode("",!0)])}}}),pt=Y._export_sfc(ft,[["__scopeId","data-v-df98cfab"]]);exports.default=pt;