ss-component-new 1.3.113 → 1.3.114

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 (112) hide show
  1. package/dist/{MTLLoader-BviVUPWi.cjs → MTLLoader-DcIQb_s3.cjs} +1 -1
  2. package/dist/{MTLLoader-y4B1LPuT.js → MTLLoader-iRxhJhIF.js} +34 -34
  3. package/dist/{OrbitControls-Cqppy3wb.cjs → OrbitControls-9REskSZo.cjs} +1 -1
  4. package/dist/{OrbitControls-390k2OM3.js → OrbitControls-PQJZejy_.js} +1 -1
  5. package/dist/{URDFLoader-C2tFq0lk.cjs → URDFLoader-BuABv8Tv.cjs} +1 -1
  6. package/dist/{URDFLoader-BlbEAIgR.js → URDFLoader-Buak6sTX.js} +222 -222
  7. package/dist/{animationData-DfDLy_M4.js → animationData-DJhhkfHw.js} +18 -18
  8. package/dist/{animationData-B1Jlpr7b.cjs → animationData-DiCszzEt.cjs} +1 -1
  9. package/dist/{array-DLBDgy0c.js → array-Be4dCwU5.js} +5 -5
  10. package/dist/{array-ymebeoXj.cjs → array-BsWbhqqH.cjs} +1 -1
  11. package/dist/{iconfont-cBX7rs7k.cjs → iconfont-CTi1EROO.cjs} +1 -1
  12. package/dist/{iconfont-BYa5tDrN.js → iconfont-Dkz3EhnP.js} +37 -37
  13. package/dist/{index-JJBPRJiI.cjs → index-1ATQxYGc.cjs} +1 -1
  14. package/dist/{index-UytjSmc1.cjs → index-69FRQH94.cjs} +1 -1
  15. package/dist/{index-4p0yEeUu.js → index-B2WIMplB.js} +1 -1
  16. package/dist/{index--hQDmx_x.js → index-B2pcDjLn.js} +2 -2
  17. package/dist/{index-pE8_wnGy.cjs → index-B9sLkbkE.cjs} +1 -1
  18. package/dist/{index-DdCyGfF9.cjs → index-BBrdsI9W.cjs} +1 -1
  19. package/dist/{index-DJoiySWn.cjs → index-BEpwtI2Q.cjs} +1 -1
  20. package/dist/{index-BXZlLwr6.cjs → index-Bd8mah99.cjs} +1 -1
  21. package/dist/{index-CXtLJs5O.js → index-BhJTGJWX.js} +27 -25
  22. package/dist/{index-C2yeqxnB.js → index-BhPhyI8f.js} +3 -3
  23. package/dist/{index-bbJ9Y_oO.js → index-BhU0rWGt.js} +3 -3
  24. package/dist/index-BhsUBoCD.cjs +1 -0
  25. package/dist/{index-DpirbR20.js → index-Bjm0BPhX.js} +12 -12
  26. package/dist/{index-BmlomuGZ.cjs → index-Bk8qPn0a.cjs} +1 -1
  27. package/dist/{index-BfNg0B2v.js → index-BsoWrBpk.js} +33 -33
  28. package/dist/{index-DpIzJvIr.cjs → index-BuaAY6T_.cjs} +1 -1
  29. package/dist/{index-DaX27S_0.js → index-BugYnyXc.js} +31 -31
  30. package/dist/{index-DMzBNabY.js → index-Bz_ZsUz_.js} +1 -1
  31. package/dist/{index-D6UEkdRE.cjs → index-C1HjpqRi.cjs} +1 -1
  32. package/dist/{index-CXkaTWVT.js → index-C3LqP4qY.js} +2 -2
  33. package/dist/{index-DovAfsVt.js → index-C4NqB81x.js} +2 -2
  34. package/dist/{index-D0e2ki27.js → index-CMMIt7u5.js} +63 -64
  35. package/dist/{index-DLK6UU4l.cjs → index-C_CGGyPH.cjs} +1 -1
  36. package/dist/{index-CYXsxIou.js → index-CdOlTQZV.js} +1 -1
  37. package/dist/{index-CVwsrCrZ.cjs → index-CdzQfZvY.cjs} +12 -12
  38. package/dist/{index-CaV5K0t4.js → index-Cn5h5u4P.js} +2408 -2005
  39. package/dist/{index-Cg30L32X.cjs → index-CpZcO0Vv.cjs} +3 -3
  40. package/dist/{index-BxmhgJuz.js → index-Cw0eFU8n.js} +1 -1
  41. package/dist/{index-CXlemLjY.js → index-D8c3Spt0.js} +1 -1
  42. package/dist/{index-Drd5_tIE.js → index-DHrzZlzn.js} +2 -2
  43. package/dist/{index-CEiscADV.cjs → index-DVhZbYfk.cjs} +1 -1
  44. package/dist/{index-CJiEoadC.js → index-Dar27fP9.js} +5 -5
  45. package/dist/index-DavcqNxP.cjs +1 -0
  46. package/dist/{index-DczQgLYk.cjs → index-DbAWw4as.cjs} +5 -5
  47. package/dist/{index-C6_KNp1M.cjs → index-DbnQZ22f.cjs} +1 -1
  48. package/dist/{index-CIoHy7Dg.js → index-Ddn_i6kt.js} +3 -3
  49. package/dist/index-DgBjwajW.js +456 -0
  50. package/dist/{index-SeEbZNcJ.cjs → index-DhFQdrUj.cjs} +1 -1
  51. package/dist/index-DiowIVZT.cjs +36 -0
  52. package/dist/{index-YwMY3Aya.js → index-DkgsdCot.js} +7 -7
  53. package/dist/{index-NdxRkX7O.js → index-Do9OpnU6.js} +316 -316
  54. package/dist/{index-DONt1we8.js → index-DpdFnDS3.js} +128 -78
  55. package/dist/{index-mabPGJUl.js → index-DqljyATQ.js} +1924 -1902
  56. package/dist/{index-B9g8IV0C.cjs → index-Dxxg-n__.cjs} +1 -1
  57. package/dist/{index-B22a33l9.js → index-DzSpBcvn.js} +1 -1
  58. package/dist/{index-BjAtlMRE.cjs → index-OS-qw-PB.cjs} +1 -1
  59. package/dist/{index-BVURmufk.js → index-RJF35C5O.js} +7 -7
  60. package/dist/index-SJHk-hwy.cjs +1 -0
  61. package/dist/index-TspEOSLc.cjs +1 -0
  62. package/dist/{index-DnJB2OQC.cjs → index-d198q36G.cjs} +1 -1
  63. package/dist/{index-CVySIgt4.cjs → index-eOampyhu.cjs} +1 -1
  64. package/dist/index-h4MsH7WN.cjs +1 -0
  65. package/dist/{index-DBdrmcqM.cjs → index-hSBc9pHD.cjs} +1 -1
  66. package/dist/index-kP2LUcSw.cjs +1 -0
  67. package/dist/{index-BIOl9xBh.js → index-p6bofhog.js} +2 -2
  68. package/dist/{index-D39f9FDD.cjs → index-rgLAMPYl.cjs} +1 -1
  69. package/dist/{index-8TMkI46d.js → index-tXc9-Dpz.js} +5 -5
  70. package/dist/{index-Cu75UXH1.js → index-wT_u7Sip.js} +2 -2
  71. package/dist/{index.vue_vue_type_style_index_0_scoped_92c12abe_lang-zw0_MXm-.js → index.vue_vue_type_style_index_0_scoped_92c12abe_lang-Cp7jnXuw.js} +19045 -19450
  72. package/dist/{index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CvIVRrBm.cjs → index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CuQjU1nB.cjs} +397 -397
  73. package/dist/{index.vue_vue_type_style_index_1_lang-B2vRPxHe.cjs → index.vue_vue_type_style_index_1_lang-AEdMqNIL.cjs} +2 -2
  74. package/dist/{index.vue_vue_type_style_index_1_lang-B88Ne666.js → index.vue_vue_type_style_index_1_lang-DzaXkSeA.js} +134 -134
  75. package/dist/{main-b1OREkjD.js → main-BuHWLsd1.js} +4 -4
  76. package/dist/{main-ChE0Sl1V.cjs → main-CvEytDJd.cjs} +1 -1
  77. package/dist/{menuIndex-QovY60sY.cjs → menuIndex-7DwfwtqQ.cjs} +1 -1
  78. package/dist/{menuIndex-BlBV6RY8.js → menuIndex-BpEQqtCU.js} +1 -1
  79. package/dist/ss-component.cjs +1 -1
  80. package/dist/ss-component.css +1 -1
  81. package/dist/ss-component.js +10 -10
  82. package/dist/ss-component2.cjs +1 -1
  83. package/dist/ss-component2.js +12 -12
  84. package/dist/{threeModel-BTiM-_yY.cjs → threeModel-BBPdmBqX.cjs} +1 -1
  85. package/dist/{threeModel-CUViA1pV.js → threeModel-qPRHxt0O.js} +62 -62
  86. package/dist/{threePreview-fEcukbqP.js → threePreview-BNspl3PQ.js} +102 -102
  87. package/dist/{threePreview-DiDVwpOj.cjs → threePreview-BQfgRzYJ.cjs} +1 -1
  88. package/dist/{threeSceneView-CxhlNkvh.cjs → threeSceneView-BTG6qz5g.cjs} +1 -1
  89. package/dist/{threeSceneView-BsxoPqAA.js → threeSceneView-Dkw-3Lex.js} +133 -133
  90. package/dist/{threeSceneViewForCPMPIP-CCTwBiPg.js → threeSceneViewForCPMPIP-BUGbgcyW.js} +8 -8
  91. package/dist/{threeSceneViewForCPMPIP-Bq9A66VO.cjs → threeSceneViewForCPMPIP-DZtGuJLA.cjs} +1 -1
  92. package/dist/{threeTrackPathView-D7zto1f1.cjs → threeTrackPathView-BMRciFya.cjs} +1 -1
  93. package/dist/{threeTrackPathView-DbqptnRu.js → threeTrackPathView-D5aLq-PQ.js} +94 -94
  94. package/dist/{threeViewerHost-B9vgyTcM.js → threeViewerHost-B5ajpfKi.js} +17 -17
  95. package/dist/{threeViewerHost-Dhc4vxhv.cjs → threeViewerHost-DZgqSUXb.cjs} +1 -1
  96. package/dist/{urdfTree-CfUfqc73.cjs → urdfTree-CXoYn4F5.cjs} +1 -1
  97. package/dist/{urdfTree-B9gafrR3.js → urdfTree-DVRrRAEg.js} +1 -1
  98. package/dist/{workpieceTreePanel-DzEBifIL.cjs → workpieceTreePanel--Lz2aEfm.cjs} +1 -1
  99. package/dist/{workpieceTreePanel-CoUx6lll.js → workpieceTreePanel-myjwdWI9.js} +81 -81
  100. package/package.json +1 -1
  101. package/dist/index-8ddlDjHL.js +0 -455
  102. package/dist/index-BLGT4-wX.cjs +0 -1
  103. package/dist/index-CTGhzBZx.cjs +0 -1
  104. package/dist/index-D7Ao1GyZ.cjs +0 -1
  105. package/dist/index-DUqjjluX.cjs +0 -1
  106. package/dist/index-NtRUaVwS.cjs +0 -1
  107. package/dist/index-aMvM6ti6.cjs +0 -1
  108. package/dist/index-kutaq0AT.cjs +0 -36
  109. package/dist/obj/model.mtl +0 -42
  110. package/dist/obj/model.obj +0 -26110
  111. package/public/obj/model.mtl +0 -42
  112. package/public/obj/model.obj +0 -26110
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as ge, ref as r, computed as k, watch as X, onUnmounted as De, resolveComponent as G, createElementBlock as x, openBlock as g, createElementVNode as n, createCommentVNode as U, createVNode as s, toDisplayString as L, Fragment as Be, renderList as Je, withCtx as le, shallowRef as te, onMounted as Me, nextTick as me, onBeforeUnmount as Ee, withDirectives as I, vShow as W, unref as z, renderSlot as ve, createBlock as de } from "vue";
2
- import { s as pe } from "./threeViewerHost-B9vgyTcM.js";
3
- import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-BYa5tDrN.js";
4
- import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-CoUx6lll.js";
5
- import { c as Ke } from "./index-CaV5K0t4.js";
2
+ import { s as pe } from "./threeViewerHost-B5ajpfKi.js";
3
+ import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-Dkz3EhnP.js";
4
+ import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-myjwdWI9.js";
5
+ import { c as Ke } from "./index-Cn5h5u4P.js";
6
6
  import { E as _ } from "./index-WLdc1goT.js";
7
- import "./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-zw0_MXm-.js";
7
+ import "./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-Cp7jnXuw.js";
8
8
  import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
9
- import { g as Qe, b as et, U as tt, J as lt, d as nt } from "./urdfTree-B9gafrR3.js";
9
+ import { g as Qe, b as et, U as tt, J as lt, d as nt } from "./urdfTree-DVRrRAEg.js";
10
10
  import { _ as he } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  import { T as y } from "./svgIcon-4u4PW7Is.js";
12
- import { i as at } from "./animationData-DfDLy_M4.js";
13
- import { O as ot } from "./MTLLoader-y4B1LPuT.js";
12
+ import { i as at } from "./animationData-DJhhkfHw.js";
13
+ import { O as ot } from "./MTLLoader-iRxhJhIF.js";
14
14
  const st = { class: "panel-content" }, it = {
15
15
  key: 0,
16
16
  class: "animation-controls"
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-Dhc4vxhv.cjs"),q=require("./iconfont-cBX7rs7k.cjs"),J=require("./workpieceTreePanel-DzEBifIL.cjs"),Ce=require("./index-kutaq0AT.cjs"),h=require("./index-Dc6Q0f3F.cjs");require("./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CvIVRrBm.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-CfUfqc73.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CDPAgQbj.cjs"),_e=require("./animationData-B1Jlpr7b.cjs"),we=require("./MTLLoader-BviVUPWi.cjs"),Se={class:"panel-content"},Pe={key:0,class:"animation-controls"},Te={class:"control-row"},Be={class:"control-row"},xe={class:"frame-info"},ze={class:"control-row"},De={key:1,class:"empty-state"},Le={class:"dialog-footer"},je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),f=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-DZgqSUXb.cjs"),q=require("./iconfont-CTi1EROO.cjs"),J=require("./workpieceTreePanel--Lz2aEfm.cjs"),Ce=require("./index-DiowIVZT.cjs"),h=require("./index-Dc6Q0f3F.cjs");require("./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CuQjU1nB.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-CXoYn4F5.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CDPAgQbj.cjs"),_e=require("./animationData-DiCszzEt.cjs"),we=require("./MTLLoader-DcIQb_s3.cjs"),Se={class:"panel-content"},Pe={key:0,class:"animation-controls"},Te={class:"control-row"},Be={class:"control-row"},xe={class:"frame-info"},ze={class:"control-row"},De={key:1,class:"empty-state"},Le={class:"dialog-footer"},je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),f=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
2
2
  ${S.value.join(" ")}
3
3
  0 0 0 ...
4
4
  1 2 3 ...`:"请先加载模型。"),$=e.computed(()=>s.value[f.value]||{});e.watch(()=>y.model,o=>{o?(u.value=new J.URDFRobotController(o),V.value=U.getAllLinkName(o),f.value=0):(u.value=null,V.value=[])},{immediate:!0});const D=o=>{if(o<0||o>=s.value.length){console.error(`帧索引 ${o} 超出范围`);return}const n=s.value[o];if(u.value){const p={};N.value.forEach(k=>{const r=parseFloat(n[k]);isNaN(r)||(p[k]=r)}),u.value.setJointAngles(p)}f.value=o,w.value=s.value.length>1?o/(s.value.length-1)*100:100},L=async o=>{try{for(let n=f.value;n<s.value.length;n++){if(o!==c)return;const p=s.value[n],k={};if(u.value)N.value.forEach(r=>{const d=parseFloat(p[r]);isNaN(d)||(k[r]=d)}),await u.value.animateToState(k,b.value,r=>{o===c&&(w.value=(n+r)/s.value.length*100)});else{if(await new Promise(r=>setTimeout(r,b.value)),o!==c)return;w.value=(n+1)/s.value.length*100}f.value=n}o===c&&(h.ElMessage.success("动画播放完成"),i.value="stopped",w.value=100)}catch(n){console.error("动画播放出错:",n),h.ElMessage.error("动画播放出错"),i.value="stopped"}},B=()=>{if(s.value.length===0){h.ElMessage.error("无动画数据");return}i.value==="stopped"&&(f.value=0,D(0)),i.value="playing",c++,L(c),h.ElMessage.info("动画播放中")},M=()=>{i.value==="playing"&&(c++,i.value="paused",h.ElMessage.info("动画已暂停"))},R=()=>{c++,i.value="stopped",f.value=0,w.value=0,D(0),h.ElMessage.info("动画已停止并重置")},G=()=>{i.value==="playing"?M():B()},x=o=>{c++,i.value="paused",D(o)},X=()=>{if(!T.value.trim()){h.ElMessage.warning("导入内容不能为空");return}const o=T.value.trim().split(`
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-cBX7rs7k.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CvIVRrBm.cjs");require("./index-kutaq0AT.cjs");const K=require("./urdfTree-CfUfqc73.cjs"),I=require("./index-Dc6Q0f3F.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-DhPkQDQg.cjs");function ye(t=.5,o=4){const r=new p.Mesh(new p.ConeGeometry(t,o,32),new p.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),s=r.geometry.parameters.height;return r.geometry.translate(0,-s/2,0),r.rotation.set(-90,0,0,"XYZ"),r}function Ce(t,o){t.position.copy(o)}function we(t,o,r=new p.Color(16711680)){const s=new p.Vector3;o.getWorldPosition(s);const a=t.geometry.attributes.position,n=t.geometry.attributes.color,l=new p.Color(55551);let c=1/0,f=-1;for(let u=0;u<a.count;u++){const v=new p.Vector3().fromBufferAttribute(a,u).distanceTo(s);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)l.toArray(n.array,u*3);if(f!==-1){const u=r.toArray(),m=f*3+2;for(let v=0;v<m;v=v+3)n.array[v]=u[0],n.array[v+1]=u[1],n.array[v+2]=u[2]}n.needsUpdate=!0}function S(t,o,r,s=new p.Color(16711680)){Ce(t,o),we(r,t,s)}const ke={class:"panel-content"},_e={class:"animation-controls"},be={class:"control-row"},Ve={class:"control-row"},Ne={class:"frame-info"},Te={class:"control-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(t,{expose:o,emit:r}){const s=t,a=e.computed(()=>s.vectors),n=e.ref(!1),l=e.ref(0),c=e.ref(100);let f=!1;const u=g=>`第 ${g+1} 帧`,m=g=>{if(g<0||g>=a.value.length){console.error(`帧索引 ${g} 超出范围`);return}const y=a.value[g];l.value=g,S(s.knife,y,s.cloud)},v=async()=>{if(a.value.length===0){I.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,a.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<a.value.length&&!f;g++)await new Promise(y=>setTimeout(y,c.value)),m(g);f||I.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,I.ElMessage.info("动画已停止")},N=g=>{n.value&&C(),m(g)},_=()=>{n.value&&C(),!(l.value+1>=a.value.length)&&m(l.value+1)},b=()=>{n.value&&C(),l.value!==0&&m(l.value-1)},h=()=>{l.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:_,backwardFrame:b,resetAnimationFrame:h,reset:async()=>{await C(),h()}}),(g,y)=>{const L=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),$=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",be,[e.createVNode(D,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(B,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(L,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=z=>c.value=z),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",Ve,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode($,{modelValue:l.value,"onUpdate:modelValue":y[1]||(y[1]=z=>l.value=z),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),xe=R._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function ze(t){const o=[];return t.forEach(r=>{const[s,a,n]=r.trim().split(/\s+/);o.push(+s,+a,+n)}),o}function U(t,o,r){switch(t){case"X":o.x=+r||0;break;case"Y":o.y=+r||0;break;case"Z":o.z=+r||0;break}}function Ae(t){const o=[],r=["X","Y","Z"];return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=r.find(v=>v===u);if(m){l&&U(l,a,c),c="",l=m;continue}c=c+u}U(l,a,c),o.push(a.x,a.y,a.z)}),o}const Pe=t=>t==null?void 0:t.filter(r=>r.includes("=")),Me=t=>t.replace(/,/g,""),Fe=t=>t==null?void 0:t.map(r=>Me(r)),Ie=t=>{const o=Pe(t);return Fe(o)};function Ue(t){const o=Ie(t),r=[];return o.forEach(s=>{var v,C,N,_,b,h;let[a,n,l,c]=s.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),l=(C=l==null?void 0:l.trim)==null?void 0:C.call(l),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(_=n==null?void 0:n.split)==null?void 0:_.call(n,"="),[,u]=(b=l==null?void 0:l.split)==null?void 0:b.call(l,"="),[,m]=(h=c==null?void 0:c.split)==null?void 0:h.call(c,"=");r.push(+f,+u,+m)}),r}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function $e(t){return Le(t)||Be(t)||De(t)}function je(t){const o=[],r=new Set(["X","Y","Z"]);return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f];if(u==="T")break;const m=r.has(u)?u:null,v=$e(u);if(m||!v){l&&U(l,a,c),l=m,c="";continue}c=c+u}l&&U(l,a,c),o.push(a.x,a.y,a.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var a,n;const o=(a=t==null?void 0:t.trim())==null?void 0:a.split(/\r?\n/);if(qe(t))return Ue(o);const r=o==null?void 0:o[0],s=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\s+/);if((s==null?void 0:s.length)>=3)return ze(o);if((s==null?void 0:s.length)===1)return Ae(o)}async function Ye(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Ze(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Oe(t){let o=t.trim().split(/\r?\n/);return o=o.filter(s=>{const a=s.startsWith("X")||s.startsWith("Y")||s.startsWith("Z"),n=s.startsWith("G")&&(s.includes("X")||s.includes("Y")||s.includes("Z")),l=s.startsWith("N")&&(s.includes("X")||s.includes("Y")||s.includes("Z"));return a||n||l}),je(o)}async function Ge(t,o){const{isCyd:r,isUv:s,isCpt:a,isNc:n}=o;return s?Xe(t):r?Ze(t):a?Ye(t):n?Oe(t):[]}function Ke(t){const o=[];for(let r=0;r<t.length;r+=3)o.push(new p.Vector3(t[r],t[r+1],t[r+2]));return o}function Re(t){const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new p.LineBasicMaterial({color:55551,linewidth:3});return new p.Line(o,r)}function Se(t,o){if(!o||o.length<3)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=Re(o);return l.name="轨迹路径",r.add(l),l}function We(t,o,r,s=4,a=50){let n=1/0,l=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let h=0;h<t.length;h+=3){const A=t[h],g=t[h+1],y=t[h+2];n=Math.min(n,A),l=Math.max(l,A),c=Math.min(c,g),f=Math.max(f,g),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((l-n)**2+(f-c)**2+(m-u)**2)*.05,N=p.MathUtils.degToRad(o.fov),_=2*Math.tan(N/2)*a,b=C/_*r.domElement.height*(s/4);return Math.min(.4,b)}function He(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)r[n]=0,r[n+1]=.847,r[n+2]=1;o.setAttribute("color",new p.BufferAttribute(r,3));const s=new p.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),a=new p.Points(o,s);return s.needsUpdate=!0,a}function Je(t,o){if(!o)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=He(o);if(!l)return;l.name="轨迹路径",r.add(l);const c=We(o,s,a,.1,50);return l.material.size=c,l}const Qe={class:"obj-viewer-container"},et={class:"buttonGroup-topLeft"},tt={class:"buttonGroup-left"},nt={class:"buttonGroup-right"},ot={class:"buttonGroup-bottom"},rt={class:"left-panel"},lt={class:"panel-header"},st={class:"panel-body"},it={class:"right-panel"},at={class:"panel-header"},ct={class:"panel-body"},ut={key:0,class:"loading-overlay"},dt=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(t){const o=t,r=e.ref(null),s=e.ref(!1),a=e.ref(""),n=e.ref(),l=e.ref(!1),c=e.ref(""),f=e.ref(!1),u=e.ref(""),m=e.shallowRef(null),v=e.shallowRef(null),{currentModels:C,resetView:N,initThreeJS:_,handleResize:b,getThreeJSObjects:h,cleanup:A,setModels:g,setAndFitModels:y,axesHelperVisible:L,toggleAxesVisibility:B,zoomIn:D,zoomOut:$}=x.useThreeJS(r),{isAnimating:z,toggleAnimation:W,startAnimation:vt,stopAnimation:H}=x.useAnimation(h,C),{isClipping:J,activeClippingAxis:Y,toggleClipping:Q,updateClippingPlanes:ee}=x.useClipping(h,C),te=()=>{B()},ne=i=>{Y.value=i,ee()},j=i=>{l.value=!0,c.value=i,i==="剖面视图"&&!J.value&&Q()},q=i=>{f.value=!0,u.value=i},X=e.ref([]),P=e.ref([]),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),re=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),le=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCpt}),T=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isNc}),Z=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let k=e.shallowRef(),E=e.shallowRef();const se=()=>{const{scene:i}=h();k.value&&i&&(x.disposeObj(k.value,i),k.value=null)},ie=()=>{const{scene:i}=h();E.value&&i&&(x.disposeObj(E.value,i),E.value=null)},O=()=>{se(),ie()},ae=async i=>{const d=URL.createObjectURL(i),M=await p.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(M)){X.value=await Ge(M,o.trackFileType)||[];const V=X.value;oe.value&&(k.value=Se(h,V)),(re.value||le.value||T.value)&&(k.value=Je(h,V))}},ce=async()=>{var i,d;E.value=ye(),P.value=Ke(X.value),P.value&&P.value.length&&(S(E.value,P.value[0],k.value,new p.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},G=async i=>{O(),await ae(i),k.value&&x.frameCameraToObject3D(h,k.value),T.value&&ce()};e.watch(()=>Z.value,async i=>{i&&await G(i)},{immediate:!0,deep:!0});const ue=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await G(Z.value)},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},me=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},pe=()=>{_(),e.nextTick(()=>{r.value&&(F=new ResizeObserver(b),F.observe(r.value))});const i=h();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},he=()=>{F&&F.disconnect(),z.value&&H(),O(),A()};let F=null;return e.onMounted(async()=>{try{pe()}catch(i){console.error("Three.js 初始化失败:",i),I.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{he()}),(i,d)=>{const M=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ue,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref($)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(W),title:e.unref(z)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"button-left",{switchRightPanel:j},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:d[0]||(d[0]=V=>j("场景树")),active:l.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=V=>j("剖面视图")),active:l.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=V=>q("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=V=>q("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:me}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:fe})]),e.withDirectives(e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(c.value),1),e.createElementVNode("span",{class:"close",onClick:d[4]||(d[4]=V=>l.value=!1)}," X ")]),e.createElementVNode("div",st,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(K.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(x.ClippingPanel,{key:1,value:e.unref(Y),onChange:ne},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,l.value]]),e.withDirectives(e.createElementVNode("div",it,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=V=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(K.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(k),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ut,[d[6]||(d[6]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0)])}}}),ft=R._export_sfc(dt,[["__scopeId","data-v-7178b621"]]);exports.default=ft;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-CTi1EROO.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-CuQjU1nB.cjs");require("./index-DiowIVZT.cjs");const K=require("./urdfTree-CXoYn4F5.cjs"),I=require("./index-Dc6Q0f3F.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-DhPkQDQg.cjs");function ye(t=.5,o=4){const r=new p.Mesh(new p.ConeGeometry(t,o,32),new p.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),s=r.geometry.parameters.height;return r.geometry.translate(0,-s/2,0),r.rotation.set(-90,0,0,"XYZ"),r}function Ce(t,o){t.position.copy(o)}function we(t,o,r=new p.Color(16711680)){const s=new p.Vector3;o.getWorldPosition(s);const a=t.geometry.attributes.position,n=t.geometry.attributes.color,l=new p.Color(55551);let c=1/0,f=-1;for(let u=0;u<a.count;u++){const v=new p.Vector3().fromBufferAttribute(a,u).distanceTo(s);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)l.toArray(n.array,u*3);if(f!==-1){const u=r.toArray(),m=f*3+2;for(let v=0;v<m;v=v+3)n.array[v]=u[0],n.array[v+1]=u[1],n.array[v+2]=u[2]}n.needsUpdate=!0}function S(t,o,r,s=new p.Color(16711680)){Ce(t,o),we(r,t,s)}const ke={class:"panel-content"},_e={class:"animation-controls"},be={class:"control-row"},Ve={class:"control-row"},Ne={class:"frame-info"},Te={class:"control-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(t,{expose:o,emit:r}){const s=t,a=e.computed(()=>s.vectors),n=e.ref(!1),l=e.ref(0),c=e.ref(100);let f=!1;const u=g=>`第 ${g+1} 帧`,m=g=>{if(g<0||g>=a.value.length){console.error(`帧索引 ${g} 超出范围`);return}const y=a.value[g];l.value=g,S(s.knife,y,s.cloud)},v=async()=>{if(a.value.length===0){I.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,a.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<a.value.length&&!f;g++)await new Promise(y=>setTimeout(y,c.value)),m(g);f||I.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,I.ElMessage.info("动画已停止")},N=g=>{n.value&&C(),m(g)},_=()=>{n.value&&C(),!(l.value+1>=a.value.length)&&m(l.value+1)},b=()=>{n.value&&C(),l.value!==0&&m(l.value-1)},h=()=>{l.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:_,backwardFrame:b,resetAnimationFrame:h,reset:async()=>{await C(),h()}}),(g,y)=>{const L=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),$=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",be,[e.createVNode(D,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(B,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(L,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=z=>c.value=z),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",Ve,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode($,{modelValue:l.value,"onUpdate:modelValue":y[1]||(y[1]=z=>l.value=z),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),xe=R._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function ze(t){const o=[];return t.forEach(r=>{const[s,a,n]=r.trim().split(/\s+/);o.push(+s,+a,+n)}),o}function U(t,o,r){switch(t){case"X":o.x=+r||0;break;case"Y":o.y=+r||0;break;case"Z":o.z=+r||0;break}}function Ae(t){const o=[],r=["X","Y","Z"];return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=r.find(v=>v===u);if(m){l&&U(l,a,c),c="",l=m;continue}c=c+u}U(l,a,c),o.push(a.x,a.y,a.z)}),o}const Pe=t=>t==null?void 0:t.filter(r=>r.includes("=")),Me=t=>t.replace(/,/g,""),Fe=t=>t==null?void 0:t.map(r=>Me(r)),Ie=t=>{const o=Pe(t);return Fe(o)};function Ue(t){const o=Ie(t),r=[];return o.forEach(s=>{var v,C,N,_,b,h;let[a,n,l,c]=s.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),l=(C=l==null?void 0:l.trim)==null?void 0:C.call(l),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(_=n==null?void 0:n.split)==null?void 0:_.call(n,"="),[,u]=(b=l==null?void 0:l.split)==null?void 0:b.call(l,"="),[,m]=(h=c==null?void 0:c.split)==null?void 0:h.call(c,"=");r.push(+f,+u,+m)}),r}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function $e(t){return Le(t)||Be(t)||De(t)}function je(t){const o=[],r=new Set(["X","Y","Z"]);return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f];if(u==="T")break;const m=r.has(u)?u:null,v=$e(u);if(m||!v){l&&U(l,a,c),l=m,c="";continue}c=c+u}l&&U(l,a,c),o.push(a.x,a.y,a.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var a,n;const o=(a=t==null?void 0:t.trim())==null?void 0:a.split(/\r?\n/);if(qe(t))return Ue(o);const r=o==null?void 0:o[0],s=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\s+/);if((s==null?void 0:s.length)>=3)return ze(o);if((s==null?void 0:s.length)===1)return Ae(o)}async function Ye(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Ze(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Oe(t){let o=t.trim().split(/\r?\n/);return o=o.filter(s=>{const a=s.startsWith("X")||s.startsWith("Y")||s.startsWith("Z"),n=s.startsWith("G")&&(s.includes("X")||s.includes("Y")||s.includes("Z")),l=s.startsWith("N")&&(s.includes("X")||s.includes("Y")||s.includes("Z"));return a||n||l}),je(o)}async function Ge(t,o){const{isCyd:r,isUv:s,isCpt:a,isNc:n}=o;return s?Xe(t):r?Ze(t):a?Ye(t):n?Oe(t):[]}function Ke(t){const o=[];for(let r=0;r<t.length;r+=3)o.push(new p.Vector3(t[r],t[r+1],t[r+2]));return o}function Re(t){const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new p.LineBasicMaterial({color:55551,linewidth:3});return new p.Line(o,r)}function Se(t,o){if(!o||o.length<3)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=Re(o);return l.name="轨迹路径",r.add(l),l}function We(t,o,r,s=4,a=50){let n=1/0,l=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let h=0;h<t.length;h+=3){const A=t[h],g=t[h+1],y=t[h+2];n=Math.min(n,A),l=Math.max(l,A),c=Math.min(c,g),f=Math.max(f,g),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((l-n)**2+(f-c)**2+(m-u)**2)*.05,N=p.MathUtils.degToRad(o.fov),_=2*Math.tan(N/2)*a,b=C/_*r.domElement.height*(s/4);return Math.min(.4,b)}function He(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)r[n]=0,r[n+1]=.847,r[n+2]=1;o.setAttribute("color",new p.BufferAttribute(r,3));const s=new p.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),a=new p.Points(o,s);return s.needsUpdate=!0,a}function Je(t,o){if(!o)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=He(o);if(!l)return;l.name="轨迹路径",r.add(l);const c=We(o,s,a,.1,50);return l.material.size=c,l}const Qe={class:"obj-viewer-container"},et={class:"buttonGroup-topLeft"},tt={class:"buttonGroup-left"},nt={class:"buttonGroup-right"},ot={class:"buttonGroup-bottom"},rt={class:"left-panel"},lt={class:"panel-header"},st={class:"panel-body"},it={class:"right-panel"},at={class:"panel-header"},ct={class:"panel-body"},ut={key:0,class:"loading-overlay"},dt=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(t){const o=t,r=e.ref(null),s=e.ref(!1),a=e.ref(""),n=e.ref(),l=e.ref(!1),c=e.ref(""),f=e.ref(!1),u=e.ref(""),m=e.shallowRef(null),v=e.shallowRef(null),{currentModels:C,resetView:N,initThreeJS:_,handleResize:b,getThreeJSObjects:h,cleanup:A,setModels:g,setAndFitModels:y,axesHelperVisible:L,toggleAxesVisibility:B,zoomIn:D,zoomOut:$}=x.useThreeJS(r),{isAnimating:z,toggleAnimation:W,startAnimation:vt,stopAnimation:H}=x.useAnimation(h,C),{isClipping:J,activeClippingAxis:Y,toggleClipping:Q,updateClippingPlanes:ee}=x.useClipping(h,C),te=()=>{B()},ne=i=>{Y.value=i,ee()},j=i=>{l.value=!0,c.value=i,i==="剖面视图"&&!J.value&&Q()},q=i=>{f.value=!0,u.value=i},X=e.ref([]),P=e.ref([]),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),re=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),le=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCpt}),T=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isNc}),Z=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let k=e.shallowRef(),E=e.shallowRef();const se=()=>{const{scene:i}=h();k.value&&i&&(x.disposeObj(k.value,i),k.value=null)},ie=()=>{const{scene:i}=h();E.value&&i&&(x.disposeObj(E.value,i),E.value=null)},O=()=>{se(),ie()},ae=async i=>{const d=URL.createObjectURL(i),M=await p.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(M)){X.value=await Ge(M,o.trackFileType)||[];const V=X.value;oe.value&&(k.value=Se(h,V)),(re.value||le.value||T.value)&&(k.value=Je(h,V))}},ce=async()=>{var i,d;E.value=ye(),P.value=Ke(X.value),P.value&&P.value.length&&(S(E.value,P.value[0],k.value,new p.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},G=async i=>{O(),await ae(i),k.value&&x.frameCameraToObject3D(h,k.value),T.value&&ce()};e.watch(()=>Z.value,async i=>{i&&await G(i)},{immediate:!0,deep:!0});const ue=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await G(Z.value)},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},me=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},pe=()=>{_(),e.nextTick(()=>{r.value&&(F=new ResizeObserver(b),F.observe(r.value))});const i=h();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},he=()=>{F&&F.disconnect(),z.value&&H(),O(),A()};let F=null;return e.onMounted(async()=>{try{pe()}catch(i){console.error("Three.js 初始化失败:",i),I.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{he()}),(i,d)=>{const M=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ue,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref($)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(W),title:e.unref(z)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"button-left",{switchRightPanel:j},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:d[0]||(d[0]=V=>j("场景树")),active:l.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=V=>j("剖面视图")),active:l.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=V=>q("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=V=>q("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:me}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:fe})]),e.withDirectives(e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(c.value),1),e.createElementVNode("span",{class:"close",onClick:d[4]||(d[4]=V=>l.value=!1)}," X ")]),e.createElementVNode("div",st,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(K.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(x.ClippingPanel,{key:1,value:e.unref(Y),onChange:ne},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,l.value]]),e.withDirectives(e.createElementVNode("div",it,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=V=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(K.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(k),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ut,[d[6]||(d[6]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0)])}}}),ft=R._export_sfc(dt,[["__scopeId","data-v-7178b621"]]);exports.default=ft;
@@ -1,16 +1,16 @@
1
- import { defineComponent as ce, computed as U, ref as k, resolveComponent as E, createElementBlock as ee, openBlock as X, createElementVNode as d, createVNode as p, withCtx as I, toDisplayString as j, shallowRef as N, watch as Ee, onMounted as Xe, onBeforeUnmount as je, withDirectives as Y, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as Z, nextTick as De } from "vue";
2
- import { u as Ne, a as Ye, b as Ze, C as Be, f as Ie, d as re } from "./iconfont-BYa5tDrN.js";
3
- import { J as O, T as Oe, bC as Ge, ay as qe, V as te, aA as ue, aN as fe, aT as Ke, aC as We, aS as Je, aP as Re, aQ as He, a4 as Qe, bD as Se } from "./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-zw0_MXm-.js";
4
- import "./index-CaV5K0t4.js";
5
- import { U as et, J as tt } from "./urdfTree-B9gafrR3.js";
6
- import { E as B } from "./index-WLdc1goT.js";
1
+ import { defineComponent as ce, computed as M, ref as k, resolveComponent as E, createElementBlock as ee, openBlock as X, createElementVNode as d, createVNode as p, withCtx as B, toDisplayString as j, shallowRef as D, watch as Ee, onMounted as Xe, onBeforeUnmount as je, withDirectives as N, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as Z, nextTick as Ye } from "vue";
2
+ import { u as De, a as Ne, b as Ze, C as Ie, f as Be, d as re } from "./iconfont-Dkz3EhnP.js";
3
+ import { C as O, L as Oe, bu as qe, aq as Ge, V as te, as as ue, aF as fe, aL as Ke, au as We, aK as Je, aH as He, aI as Re, $ as Qe, bv as Se } from "./index.vue_vue_type_style_index_0_scoped_92c12abe_lang-Cp7jnXuw.js";
4
+ import "./index-Cn5h5u4P.js";
5
+ import { U as et, J as tt } from "./urdfTree-DVRrRAEg.js";
6
+ import { E as I } from "./index-WLdc1goT.js";
7
7
  import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  import { T as w } from "./svgIcon-4u4PW7Is.js";
9
9
  import { i as nt } from "./isString-ttnU1Wjg.js";
10
10
  function ot(e = 0.5, n = 4) {
11
11
  const o = new Oe(
12
- new Ge(e, n, 32),
13
- new qe({
12
+ new qe(e, n, 32),
13
+ new Ge({
14
14
  color: "#919191ff",
15
15
  // 再提一档灰度
16
16
  metalness: 0.3,
@@ -52,7 +52,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
52
52
  },
53
53
  emits: ["getThreeData"],
54
54
  setup(e, { expose: n, emit: o }) {
55
- const a = e, l = U(() => a.vectors), t = k(!1), s = k(0), r = k(100);
55
+ const a = e, l = M(() => a.vectors), t = k(!1), s = k(0), r = k(100);
56
56
  let f = !1;
57
57
  const c = (g) => `第 ${g + 1} 帧`, m = (g) => {
58
58
  if (g < 0 || g >= l.value.length) {
@@ -63,7 +63,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
63
63
  s.value = g, de(a.knife, y, a.cloud);
64
64
  }, v = async () => {
65
65
  if (l.value.length === 0) {
66
- B.error("无法播放动画:无数据");
66
+ I.error("无法播放动画:无数据");
67
67
  return;
68
68
  }
69
69
  if (!t.value) {
@@ -71,7 +71,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
71
71
  try {
72
72
  for (let g = s.value + 1; g < l.value.length && !f; g++)
73
73
  await new Promise((y) => setTimeout(y, r.value)), m(g);
74
- f || B.success("动画播放完成");
74
+ f || I.success("动画播放完成");
75
75
  } catch (g) {
76
76
  console.error("动画播放出错:", g);
77
77
  } finally {
@@ -79,7 +79,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
79
79
  }
80
80
  }
81
81
  }, C = () => {
82
- f = !0, t.value = !1, B.info("动画已停止");
82
+ f = !0, t.value = !1, I.info("动画已停止");
83
83
  }, P = (g) => {
84
84
  t.value && C(), m(g);
85
85
  }, _ = () => {
@@ -92,7 +92,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
92
92
  return n({ playAnimation: v, stopAnimation: C, forwardFrame: _, backwardFrame: T, resetAnimationFrame: h, reset: async () => {
93
93
  await C(), h();
94
94
  } }), (g, y) => {
95
- const q = E("el-input-number"), K = E("el-form-item"), W = E("el-form"), J = E("el-slider");
95
+ const G = E("el-input-number"), K = E("el-form-item"), W = E("el-form"), J = E("el-slider");
96
96
  return X(), ee("div", it, [
97
97
  d("div", lt, [
98
98
  d("div", rt, [
@@ -100,15 +100,15 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
100
100
  "label-width": "auto",
101
101
  style: { width: "100%" }
102
102
  }, {
103
- default: I(() => [
103
+ default: B(() => [
104
104
  p(K, {
105
105
  label: "帧间隔 (ms):",
106
106
  prop: "frameDuration"
107
107
  }, {
108
- default: I(() => [
109
- p(q, {
108
+ default: B(() => [
109
+ p(G, {
110
110
  modelValue: r.value,
111
- "onUpdate:modelValue": y[0] || (y[0] = (M) => r.value = M),
111
+ "onUpdate:modelValue": y[0] || (y[0] = (L) => r.value = L),
112
112
  min: 0,
113
113
  max: 5e3,
114
114
  step: 10,
@@ -129,7 +129,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
129
129
  y[3] || (y[3] = d("label", null, "动画进度:", -1)),
130
130
  p(J, {
131
131
  modelValue: s.value,
132
- "onUpdate:modelValue": y[1] || (y[1] = (M) => s.value = M),
132
+ "onUpdate:modelValue": y[1] || (y[1] = (L) => s.value = L),
133
133
  min: 0,
134
134
  max: l.value.length > 0 ? l.value.length - 1 : 0,
135
135
  step: 1,
@@ -151,7 +151,7 @@ function mt(e) {
151
151
  n.push(+a, +l, +t);
152
152
  }), n;
153
153
  }
154
- function G(e, n, o) {
154
+ function q(e, n, o) {
155
155
  switch (e) {
156
156
  case "X":
157
157
  n.x = +o || 0;
@@ -178,12 +178,12 @@ function pt(e) {
178
178
  for (let f = 0; f < (t == null ? void 0 : t.length); f++) {
179
179
  const c = t[f], m = o.find((v) => v === c);
180
180
  if (m) {
181
- s && G(s, l, r), r = "", s = m;
181
+ s && q(s, l, r), r = "", s = m;
182
182
  continue;
183
183
  }
184
184
  r = r + c;
185
185
  }
186
- G(s, l, r), n.push(l.x, l.y, l.z);
186
+ q(s, l, r), n.push(l.x, l.y, l.z);
187
187
  }), n;
188
188
  }
189
189
  const ht = (e) => e == null ? void 0 : e.filter((o) => o.includes("=")), gt = (e) => e.replace(/,/g, ""), yt = (e) => e == null ? void 0 : e.map((o) => gt(o)), Ct = (e) => {
@@ -221,12 +221,12 @@ function zt(e) {
221
221
  break;
222
222
  const m = o.has(c) ? c : null, v = Tt(c);
223
223
  if (m || !v) {
224
- s && G(s, l, r), s = m, r = "";
224
+ s && q(s, l, r), s = m, r = "";
225
225
  continue;
226
226
  }
227
227
  r = r + c;
228
228
  }
229
- s && G(s, l, r), n.push(l.x, l.y, l.z);
229
+ s && q(s, l, r), n.push(l.x, l.y, l.z);
230
230
  }), n;
231
231
  }
232
232
  function At(e) {
@@ -263,24 +263,24 @@ async function Ft(e) {
263
263
  o.push(+t, +s, +r);
264
264
  }), o;
265
265
  }
266
- async function Mt(e) {
266
+ async function Lt(e) {
267
267
  let n = e.trim().split(/\r?\n/);
268
268
  return n = n.filter((a) => {
269
269
  const l = a.startsWith("X") || a.startsWith("Y") || a.startsWith("Z"), t = a.startsWith("G") && (a.includes("X") || a.includes("Y") || a.includes("Z")), s = a.startsWith("N") && (a.includes("X") || a.includes("Y") || a.includes("Z"));
270
270
  return l || t || s;
271
271
  }), zt(n);
272
272
  }
273
- async function Ut(e, n) {
273
+ async function Mt(e, n) {
274
274
  const { isCyd: o, isUv: a, isCpt: l, isNc: t } = n;
275
- return a ? Pt(e) : o ? Ft(e) : l ? xt(e) : t ? Mt(e) : [];
275
+ return a ? Pt(e) : o ? Ft(e) : l ? xt(e) : t ? Lt(e) : [];
276
276
  }
277
- function Lt(e) {
277
+ function Ut(e) {
278
278
  const n = [];
279
279
  for (let o = 0; o < e.length; o += 3)
280
280
  n.push(new te(e[o], e[o + 1], e[o + 2]));
281
281
  return n;
282
282
  }
283
- function Vt(e) {
283
+ function $t(e) {
284
284
  const n = new ue();
285
285
  n.setAttribute("position", new fe(e, 3));
286
286
  const o = new Ke({
@@ -289,20 +289,20 @@ function Vt(e) {
289
289
  });
290
290
  return new We(n, o);
291
291
  }
292
- function $t(e, n) {
292
+ function Vt(e, n) {
293
293
  if (!n || n.length < 3)
294
294
  return;
295
295
  const { scene: o, camera: a, renderer: l, controls: t } = e();
296
296
  if (!o || !a || !l || !t)
297
297
  return;
298
- const s = Vt(n);
298
+ const s = $t(n);
299
299
  return s.name = "轨迹路径", o.add(s), s;
300
300
  }
301
301
  function Et(e, n, o, a = 4, l = 50) {
302
302
  let t = 1 / 0, s = -1 / 0, r = 1 / 0, f = -1 / 0, c = 1 / 0, m = -1 / 0;
303
303
  for (let h = 0; h < e.length; h += 3) {
304
- const L = e[h], g = e[h + 1], y = e[h + 2];
305
- t = Math.min(t, L), s = Math.max(s, L), r = Math.min(r, g), f = Math.max(f, g), c = Math.min(c, y), m = Math.max(m, y);
304
+ const U = e[h], g = e[h + 1], y = e[h + 2];
305
+ t = Math.min(t, U), s = Math.max(s, U), r = Math.min(r, g), f = Math.max(f, g), c = Math.min(c, y), m = Math.max(m, y);
306
306
  }
307
307
  const C = Math.sqrt((s - t) ** 2 + (f - r) ** 2 + (m - c) ** 2) * 0.05, P = Qe.degToRad(n.fov), _ = 2 * Math.tan(P / 2) * l, T = C / _ * o.domElement.height * (a / 4);
308
308
  return Math.min(0.4, T);
@@ -316,12 +316,12 @@ function Xt(e) {
316
316
  for (let t = 0; t < e.length; t += 3)
317
317
  o[t] = 0, o[t + 1] = 0.847, o[t + 2] = 1;
318
318
  n.setAttribute("color", new Je(o, 3));
319
- const a = new Re({
319
+ const a = new He({
320
320
  vertexColors: !0,
321
321
  size: 0.4,
322
322
  // 像素世界单位
323
323
  sizeAttenuation: !0
324
- }), l = new He(n, a);
324
+ }), l = new Re(n, a);
325
325
  return a.needsUpdate = !0, l;
326
326
  }
327
327
  function jt(e, n) {
@@ -337,10 +337,10 @@ function jt(e, n) {
337
337
  const r = Et(n, a, l, 0.1, 50);
338
338
  return s.material.size = r, s;
339
339
  }
340
- const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft" }, Yt = { class: "buttonGroup-left" }, Zt = { class: "buttonGroup-right" }, Bt = { class: "buttonGroup-bottom" }, It = { class: "left-panel" }, Ot = { class: "panel-header" }, Gt = { class: "panel-body" }, qt = { class: "right-panel" }, Kt = { class: "panel-header" }, Wt = { class: "panel-body" }, Jt = {
340
+ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft" }, Nt = { class: "buttonGroup-left" }, Zt = { class: "buttonGroup-right" }, It = { class: "buttonGroup-bottom" }, Bt = { class: "left-panel" }, Ot = { class: "panel-header" }, qt = { class: "panel-body" }, Gt = { class: "right-panel" }, Kt = { class: "panel-header" }, Wt = { class: "panel-body" }, Jt = {
341
341
  key: 0,
342
342
  class: "loading-overlay"
343
- }, Rt = /* @__PURE__ */ ce({
343
+ }, Ht = /* @__PURE__ */ ce({
344
344
  __name: "threeTrackPathView",
345
345
  props: {
346
346
  fileBlobs: {},
@@ -348,44 +348,44 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
348
348
  trackFileType: {}
349
349
  },
350
350
  setup(e) {
351
- const n = e, o = k(null), a = k(!1), l = k(""), t = k(), s = k(!1), r = k(""), f = k(!1), c = k(""), m = N(null), v = N(null), {
351
+ const n = e, o = k(null), a = k(!1), l = k(""), t = k(), s = k(!1), r = k(""), f = k(!1), c = k(""), m = D(null), v = D(null), {
352
352
  currentModels: C,
353
353
  resetView: P,
354
354
  initThreeJS: _,
355
355
  handleResize: T,
356
356
  getThreeJSObjects: h,
357
- cleanup: L,
357
+ cleanup: U,
358
358
  setModels: g,
359
359
  setAndFitModels: y,
360
- axesHelperVisible: q,
360
+ axesHelperVisible: G,
361
361
  toggleAxesVisibility: K,
362
362
  zoomIn: W,
363
363
  zoomOut: J
364
- } = Ne(o), { isAnimating: M, toggleAnimation: me, startAnimation: Ht, stopAnimation: pe } = Ye(h, C), { isClipping: he, activeClippingAxis: ne, toggleClipping: ge, updateClippingPlanes: ye } = Ze(h, C), Ce = () => {
364
+ } = De(o), { isAnimating: L, toggleAnimation: me, startAnimation: Rt, stopAnimation: pe } = Ne(h, C), { isClipping: he, activeClippingAxis: ne, toggleClipping: ge, updateClippingPlanes: ye } = Ze(h, C), Ce = () => {
365
365
  K();
366
366
  }, we = (i) => {
367
367
  ne.value = i, ye();
368
- }, R = (i) => {
369
- s.value = !0, r.value = i, i === "剖面视图" && !he.value && ge();
370
368
  }, H = (i) => {
369
+ s.value = !0, r.value = i, i === "剖面视图" && !he.value && ge();
370
+ }, R = (i) => {
371
371
  f.value = !0, c.value = i;
372
- }, Q = k([]), V = k([]), ke = U(() => {
372
+ }, Q = k([]), $ = k([]), ke = M(() => {
373
373
  var u;
374
374
  return (u = n.trackFileType) == null ? void 0 : u.isUv;
375
- }), be = U(() => {
375
+ }), be = M(() => {
376
376
  var u;
377
377
  return (u = n.trackFileType) == null ? void 0 : u.isCyd;
378
- }), _e = U(() => {
378
+ }), _e = M(() => {
379
379
  var u;
380
380
  return (u = n.trackFileType) == null ? void 0 : u.isCpt;
381
- }), x = U(() => {
381
+ }), x = M(() => {
382
382
  var u;
383
383
  return (u = n.trackFileType) == null ? void 0 : u.isNc;
384
- }), oe = U(() => {
384
+ }), oe = M(() => {
385
385
  const i = n.fileBlobs || [];
386
386
  return i == null ? void 0 : i[0];
387
387
  });
388
- let b = N(), F = N();
388
+ let b = D(), F = D();
389
389
  const Te = () => {
390
390
  const { scene: i } = h();
391
391
  b.value && i && (re(b.value, i), b.value = null);
@@ -395,17 +395,17 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
395
395
  }, se = () => {
396
396
  Te(), ze();
397
397
  }, Ae = async (i) => {
398
- const u = URL.createObjectURL(i), $ = await Se(u);
399
- if (URL.revokeObjectURL(u), nt($)) {
400
- Q.value = await Ut($, n.trackFileType) || [];
398
+ const u = URL.createObjectURL(i), V = await Se(u);
399
+ if (URL.revokeObjectURL(u), nt(V)) {
400
+ Q.value = await Mt(V, n.trackFileType) || [];
401
401
  const z = Q.value;
402
- ke.value && (b.value = $t(h, z)), (be.value || _e.value || x.value) && (b.value = jt(h, z));
402
+ ke.value && (b.value = Vt(h, z)), (be.value || _e.value || x.value) && (b.value = jt(h, z));
403
403
  }
404
404
  }, Pe = async () => {
405
405
  var i, u;
406
- F.value = ot(), V.value = Lt(Q.value), V.value && V.value.length && (de(F.value, V.value[0], b.value, new O(16711680)), (u = (i = v.value) == null ? void 0 : i.add) == null || u.call(i, F.value));
406
+ F.value = ot(), $.value = Ut(Q.value), $.value && $.value.length && (de(F.value, $.value[0], b.value, new O(16711680)), (u = (i = v.value) == null ? void 0 : i.add) == null || u.call(i, F.value));
407
407
  }, ae = async (i) => {
408
- se(), await Ae(i), b.value && Ie(h, b.value), x.value && Pe();
408
+ se(), await Ae(i), b.value && Be(h, b.value), x.value && Pe();
409
409
  };
410
410
  Ee(() => oe.value, async (i) => {
411
411
  i && await ae(i);
@@ -419,42 +419,42 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
419
419
  }, Fe = () => {
420
420
  var i;
421
421
  x.value && ((i = t == null ? void 0 : t.value) == null || i.playAnimation());
422
- }, Me = () => {
422
+ }, Le = () => {
423
423
  var i;
424
424
  x.value && ((i = t == null ? void 0 : t.value) == null || i.stopAnimation());
425
- }, Ue = () => {
425
+ }, Me = () => {
426
426
  var i;
427
427
  x.value && ((i = t == null ? void 0 : t.value) == null || i.forwardFrame());
428
- }, Le = () => {
428
+ }, Ue = () => {
429
429
  var i;
430
430
  x.value && ((i = t == null ? void 0 : t.value) == null || i.backwardFrame());
431
- }, Ve = () => {
432
- _(), De(() => {
433
- o.value && (D = new ResizeObserver(T), D.observe(o.value));
431
+ }, $e = () => {
432
+ _(), Ye(() => {
433
+ o.value && (Y = new ResizeObserver(T), Y.observe(o.value));
434
434
  });
435
435
  const i = h();
436
436
  v.value = i.scene, v.value && (v.value.name = "CPMPIP");
437
- }, $e = () => {
438
- D && D.disconnect(), M.value && pe(), se(), L();
437
+ }, Ve = () => {
438
+ Y && Y.disconnect(), L.value && pe(), se(), U();
439
439
  };
440
- let D = null;
440
+ let Y = null;
441
441
  return Xe(async () => {
442
442
  try {
443
- Ve();
443
+ $e();
444
444
  } catch (i) {
445
- console.error("Three.js 初始化失败:", i), B.error("渲染引擎初始化失败!");
445
+ console.error("Three.js 初始化失败:", i), I.error("渲染引擎初始化失败!");
446
446
  }
447
447
  }), je(() => {
448
- $e();
448
+ Ve();
449
449
  }), (i, u) => {
450
- const $ = E("el-scrollbar");
451
- return X(), ee("div", Dt, [
450
+ const V = E("el-scrollbar");
451
+ return X(), ee("div", Yt, [
452
452
  d("div", {
453
453
  ref_key: "threejsContainer",
454
454
  ref: o,
455
455
  class: "threejs-container"
456
456
  }, null, 512),
457
- d("div", Nt, [
457
+ d("div", Dt, [
458
458
  p(w, {
459
459
  name: "viewReset",
460
460
  size: "24",
@@ -477,39 +477,39 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
477
477
  name: "lookAround",
478
478
  size: "24",
479
479
  onClick: A(me),
480
- title: A(M) ? "停止动画" : "动画视图"
480
+ title: A(L) ? "停止动画" : "动画视图"
481
481
  }, null, 8, ["onClick", "title"]),
482
482
  p(w, {
483
483
  name: "zuobiaoxi",
484
484
  size: "24",
485
- active: A(q),
485
+ active: A(G),
486
486
  onClick: Ce,
487
487
  title: "显隐坐标轴"
488
488
  }, null, 8, ["active"])
489
489
  ]),
490
- d("div", Yt, [
491
- ie(i.$slots, "button-left", { switchRightPanel: R }, void 0, !0),
490
+ d("div", Nt, [
491
+ ie(i.$slots, "button-left", { switchRightPanel: H }, void 0, !0),
492
492
  p(w, {
493
493
  name: "jiegoushu",
494
494
  size: "24",
495
- onClick: u[0] || (u[0] = (z) => R("场景树")),
495
+ onClick: u[0] || (u[0] = (z) => H("场景树")),
496
496
  active: s.value && r.value === "场景树",
497
497
  title: "场景树"
498
498
  }, null, 8, ["active"]),
499
499
  p(w, {
500
500
  name: "clipping",
501
501
  size: "24",
502
- onClick: u[1] || (u[1] = (z) => R("剖面视图")),
502
+ onClick: u[1] || (u[1] = (z) => H("剖面视图")),
503
503
  active: s.value && r.value === "剖面视图",
504
504
  title: "剖面视图"
505
505
  }, null, 8, ["active"])
506
506
  ]),
507
507
  d("div", Zt, [
508
- ie(i.$slots, "button-right", { switchRightPanel: H }, void 0, !0),
508
+ ie(i.$slots, "button-right", { switchRightPanel: R }, void 0, !0),
509
509
  p(w, {
510
510
  name: "guanjiekongzhi",
511
511
  size: "24",
512
- onClick: u[2] || (u[2] = (z) => H("关节控制")),
512
+ onClick: u[2] || (u[2] = (z) => R("关节控制")),
513
513
  active: f.value && c.value === "关节控制",
514
514
  title: "关节控制"
515
515
  }, null, 8, ["active"]),
@@ -517,17 +517,17 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
517
517
  name: "donghuafangzhen",
518
518
  size: "24",
519
519
  title: "动画仿真",
520
- onClick: u[3] || (u[3] = (z) => H("动画仿真")),
520
+ onClick: u[3] || (u[3] = (z) => R("动画仿真")),
521
521
  active: f.value && c.value === "动画仿真"
522
522
  }, null, 8, ["active"])
523
523
  ]),
524
- d("div", Bt, [
524
+ d("div", It, [
525
525
  p(w, {
526
526
  name: "kuaitui",
527
527
  size: "24",
528
528
  backgroundColor: "#ffffff",
529
529
  title: "快退",
530
- onClick: Le
530
+ onClick: Ue
531
531
  }),
532
532
  p(w, {
533
533
  name: "bofang",
@@ -541,17 +541,17 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
541
541
  size: "24",
542
542
  backgroundColor: "#ffffff",
543
543
  title: "快进",
544
- onClick: Ue
544
+ onClick: Me
545
545
  }),
546
546
  p(w, {
547
547
  name: "zanting",
548
548
  size: "24",
549
549
  backgroundColor: "#ffffff",
550
550
  title: "暂停",
551
- onClick: Me
551
+ onClick: Le
552
552
  })
553
553
  ]),
554
- Y(d("div", It, [
554
+ N(d("div", Bt, [
555
555
  d("div", Ot, [
556
556
  d("span", null, j(r.value), 1),
557
557
  d("span", {
@@ -559,14 +559,14 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
559
559
  onClick: u[4] || (u[4] = (z) => s.value = !1)
560
560
  }, " X ")
561
561
  ]),
562
- d("div", Gt, [
563
- p($, { height: "100%" }, {
564
- default: I(() => [
562
+ d("div", qt, [
563
+ p(V, { height: "100%" }, {
564
+ default: B(() => [
565
565
  r.value === "场景树" ? (X(), le(et, {
566
566
  key: 0,
567
567
  model: m.value
568
568
  }, null, 8, ["model"])) : S("", !0),
569
- r.value === "剖面视图" ? (X(), le(Be, {
569
+ r.value === "剖面视图" ? (X(), le(Ie, {
570
570
  key: 1,
571
571
  value: A(ne),
572
572
  onChange: we
@@ -578,7 +578,7 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
578
578
  ], 512), [
579
579
  [Z, s.value]
580
580
  ]),
581
- Y(d("div", qt, [
581
+ N(d("div", Gt, [
582
582
  d("div", Kt, [
583
583
  d("span", null, j(c.value), 1),
584
584
  d("span", {
@@ -587,17 +587,17 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
587
587
  }, " X ")
588
588
  ]),
589
589
  d("div", Wt, [
590
- p($, { height: "100%" }, {
591
- default: I(() => [
592
- Y(p(tt, { model: m.value }, null, 8, ["model"]), [
590
+ p(V, { height: "100%" }, {
591
+ default: B(() => [
592
+ N(p(tt, { model: m.value }, null, 8, ["model"]), [
593
593
  [Z, c.value === "关节控制"]
594
594
  ]),
595
- Y(p(dt, {
595
+ N(p(dt, {
596
596
  ref_key: "animationPanelRef",
597
597
  ref: t,
598
598
  cloud: A(b),
599
599
  knife: A(F),
600
- vectors: V.value
600
+ vectors: $.value
601
601
  }, null, 8, ["cloud", "knife", "vectors"]), [
602
602
  [Z, c.value === "动画仿真" && x.value]
603
603
  ])
@@ -615,7 +615,7 @@ const Dt = { class: "obj-viewer-container" }, Nt = { class: "buttonGroup-topLeft
615
615
  ]);
616
616
  };
617
617
  }
618
- }), rn = /* @__PURE__ */ ve(Rt, [["__scopeId", "data-v-7178b621"]]);
618
+ }), rn = /* @__PURE__ */ ve(Ht, [["__scopeId", "data-v-7178b621"]]);
619
619
  export {
620
620
  rn as default
621
621
  };