ss-component-new 1.2.94 → 1.2.95

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 (85) hide show
  1. package/dist/{MTLLoader-BqMu0YKt.js → MTLLoader-8qht74Q7.js} +1 -1
  2. package/dist/{MTLLoader-zRjWtCnL.cjs → MTLLoader-BmycYKH6.cjs} +1 -1
  3. package/dist/{OrbitControls-CkSV-7e2.js → OrbitControls-BjJ79rTx.js} +1 -1
  4. package/dist/{OrbitControls-uNfFrSzp.cjs → OrbitControls-Bzn7u6zE.cjs} +1 -1
  5. package/dist/{animationData-BXJymBf1.cjs → animationData-Bx4eWR_g.cjs} +1 -1
  6. package/dist/{animationData-CC_EC9j-.js → animationData-CQDxkaf8.js} +1 -1
  7. package/dist/{iconfont-BRM_rpi8.cjs → iconfont-CYyOVK2s.cjs} +1 -1
  8. package/dist/{iconfont-CCGqXI2r.js → iconfont-m9s2eWSa.js} +2 -2
  9. package/dist/{index-BNWYMxbm.js → index-1l1PVuvD.js} +1 -1
  10. package/dist/{index-Bl3fYYAV.js → index-9ZD8V6kl.js} +2 -2
  11. package/dist/{index-BKYwhVDU.js → index-B-Plyeh4.js} +6 -6
  12. package/dist/{index-C64dGSqi.cjs → index-BIoBDMY8.cjs} +1 -1
  13. package/dist/{index-D78TpO0w.js → index-BUjf2k-5.js} +2 -2
  14. package/dist/{index-260Qu36O.js → index-BZlNDUf3.js} +3 -3
  15. package/dist/{index-DI0PUVaR.js → index-BdjFLIVl.js} +1 -1
  16. package/dist/{index-BcJ5yKyA.js → index-BgUWl3Zu.js} +4 -4
  17. package/dist/{index-CjspLKZN.cjs → index-BgyeksTj.cjs} +1 -1
  18. package/dist/{index-BRNs8_K6.cjs → index-BvqgSoo0.cjs} +1 -1
  19. package/dist/{index-B-pYf4fC.js → index-C-YumVbf.js} +3 -3
  20. package/dist/{index-DbJoeUF-.js → index-C0g2wZa2.js} +1 -1
  21. package/dist/{index-CVAhcUed.cjs → index-C8dRWVYa.cjs} +1 -1
  22. package/dist/{index-Dm46N078.js → index-CIu1uGjo.js} +1 -1
  23. package/dist/{index-BQgBL4mp.js → index-CKH8tgtf.js} +13 -13
  24. package/dist/{index--F1U6vAJ.cjs → index-CP5OwgDj.cjs} +1 -1
  25. package/dist/{index-h1B7tCqK.js → index-CRLrdcaz.js} +3 -3
  26. package/dist/{index-SrN23_le.js → index-CXZD7ZqS.js} +2 -2
  27. package/dist/{index-BOsFRR22.cjs → index-CdroHcgB.cjs} +1 -1
  28. package/dist/{index-BU95sZ0Y.cjs → index-CqfXVkG_.cjs} +1 -1
  29. package/dist/{index-2LVJybjB.cjs → index-CwByh9ZP.cjs} +1 -1
  30. package/dist/{index-BL51CN92.cjs → index-CxXHtat8.cjs} +1 -1
  31. package/dist/{index-Cus62ZeK.cjs → index-CymErwj9.cjs} +1 -1
  32. package/dist/{index-eQzqwKhP.cjs → index-Cytb2XpO.cjs} +1 -1
  33. package/dist/{index-C1Y17JEG.cjs → index-D-7Puf0_.cjs} +1 -1
  34. package/dist/{index-C8N3F3ec.cjs → index-D450aSmc.cjs} +1 -1
  35. package/dist/{index-etoQsMTc.cjs → index-DEftTK7V.cjs} +1 -1
  36. package/dist/{index-BcIzliCn.cjs → index-DGqnGNR8.cjs} +1 -1
  37. package/dist/{index-3t_HapIu.js → index-DP1ngDkf.js} +1 -1
  38. package/dist/{index-c4KXPOVQ.js → index-DnJvIr_e.js} +6 -6
  39. package/dist/{index-DQOvMRe3.js → index-Dw6fiZyq.js} +1 -1
  40. package/dist/{index-fGeOwHSq.cjs → index-DzEn5obj.cjs} +1 -1
  41. package/dist/{index-D7s3P2jl.js → index-F-C5-x1o.js} +3 -3
  42. package/dist/{index-6MBk7YsU.js → index-Qc-s-Zm7.js} +1 -1
  43. package/dist/{index-nSK480UF.cjs → index-UBLKP4tK.cjs} +1 -1
  44. package/dist/{index-CDNt_0sV.js → index-_O8-0tTU.js} +1 -1
  45. package/dist/{index-DQFvXEIV.js → index-dJkjnoBT.js} +1 -1
  46. package/dist/{index-Cbmn26EX.cjs → index-j16y0mCJ.cjs} +1 -1
  47. package/dist/{index-BWfzhlIb.cjs → index-jwp9FUJG.cjs} +1 -1
  48. package/dist/{index-DQ5DjIVG.js → index-nvZihuIg.js} +1 -1
  49. package/dist/{index-DNJpT0_O.cjs → index-ssE7UMws.cjs} +1 -1
  50. package/dist/{index-IemfeHbH.cjs → index-uCKXm0Ml.cjs} +1 -1
  51. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CYt_iRxB.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DwtbPt8c.cjs} +1 -1
  52. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-CUBR2vja.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-WJTWjMIt.js} +6 -6
  53. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C2CSvQmH.cjs} +58 -58
  54. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DFR9Kcwi.js} +1642 -1647
  55. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-pPec6lo_.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-02N_VKFB.js} +3 -3
  56. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-CVndK9Z1.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-DZ8szdDo.cjs} +1 -1
  57. package/dist/{index.vue_vue_type_style_index_1_lang-DSolTjJR.cjs → index.vue_vue_type_style_index_1_lang-B0Uj0kxH.cjs} +1 -1
  58. package/dist/{index.vue_vue_type_style_index_1_lang-DeN-1hjz.js → index.vue_vue_type_style_index_1_lang-CIdKArLI.js} +3 -3
  59. package/dist/{main-rwu2YuKn.js → main-CYhFa6nS.js} +2 -2
  60. package/dist/{main-BiNhUZSd.cjs → main-_im25sGn.cjs} +1 -1
  61. package/dist/ss-component.cjs +1 -1
  62. package/dist/ss-component.js +9 -9
  63. package/dist/ss-component2.cjs +1 -1
  64. package/dist/ss-component2.js +10 -10
  65. package/dist/{threeModel-B9va_TpV.js → threeModel-BYpxhXBO.js} +4 -4
  66. package/dist/{threeModel-CxKhN45R.cjs → threeModel-DzvIhn6F.cjs} +1 -1
  67. package/dist/{threePreview-C_TwTZy-.js → threePreview-Bd5BpbCA.js} +3 -3
  68. package/dist/{threePreview-DDtKTkbQ.cjs → threePreview-CIuFqz2p.cjs} +1 -1
  69. package/dist/{threeSceneView-D5zDhJoR.js → threeSceneView-BhmqTLZA.js} +6 -6
  70. package/dist/{threeSceneView-Bkm_GCcO.cjs → threeSceneView-CAMJYdpr.cjs} +1 -1
  71. package/dist/{threeSceneViewForCPMPIP-8I4MXfwL.js → threeSceneViewForCPMPIP-C7cCpwwv.js} +7 -7
  72. package/dist/{threeSceneViewForCPMPIP-BXDzBuqf.cjs → threeSceneViewForCPMPIP-fwJ6mDCc.cjs} +1 -1
  73. package/dist/{threeTrackPathView-QDp-h2uJ.js → threeTrackPathView-BvbmDcVs.js} +8 -8
  74. package/dist/{threeTrackPathView-UDhsLLJ8.cjs → threeTrackPathView-C3n4B-Ye.cjs} +2 -2
  75. package/dist/{threeViewerHost-Clyh4deQ.js → threeViewerHost---qrarPK.js} +2 -2
  76. package/dist/{threeViewerHost-C1cS3BQx.cjs → threeViewerHost-BRpeReJJ.cjs} +2 -2
  77. package/dist/{urdfTree-DTIOLiOJ.cjs → urdfTree-CXBSDiJj.cjs} +1 -1
  78. package/dist/{urdfTree-CfBupHPQ.js → urdfTree-DxLmsFUL.js} +1 -1
  79. package/dist/{workpieceTreePanel-BDkiRWjc.cjs → workpieceTreePanel-D1WeZesv.cjs} +1 -1
  80. package/dist/{workpieceTreePanel-IMs7wLsr.js → workpieceTreePanel-DaCEJl86.js} +5 -5
  81. package/package.json +1 -1
  82. package/dist/obj/model.mtl +0 -42
  83. package/dist/obj/model.obj +0 -26110
  84. package/public/obj/model.mtl +0 -42
  85. package/public/obj/model.obj +0 -26110
@@ -1,9 +1,9 @@
1
1
  import { defineComponent as ke, computed as R, ref as E, resolveComponent as q, createElementBlock as ae, openBlock as Y, createElementVNode as m, createVNode as y, withCtx as ce, toDisplayString as K, shallowRef as Q, watch as lt, onMounted as ct, onBeforeUnmount as ut, withDirectives as j, createCommentVNode as ve, unref as x, renderSlot as Ae, createBlock as dt, isRef as ee, vModelRadio as te, vShow as ne } from "vue";
2
- import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-CCGqXI2r.js";
3
- import { C as ue, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as re, aL as Fe, Y as Oe, aM as le, aN as J, aO as bt, r as _t, s as Ie, t as St, w as Ct, a5 as zt, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js";
4
- import { r as Et } from "./threeViewerHost-Clyh4deQ.js";
2
+ import { u as ft, a as pt, b as mt, f as ht, d as Ue } from "./iconfont-m9s2eWSa.js";
3
+ import { C as ue, k as Be, aE as vt, v as gt, V as M, aF as yt, aG as xe, aH as be, av as H, aI as wt, B as _e, aD as De, aJ as xt, aK as re, aL as Fe, Y as Oe, aM as le, aN as J, aO as bt, r as _t, s as Ie, t as St, w as Ct, a5 as zt, ag as At, ao as Ut } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DFR9Kcwi.js";
4
+ import { r as Et } from "./threeViewerHost---qrarPK.js";
5
5
  import { E as Z } from "./index-BUYYl2Pc.js";
6
- import { U as Mt, J as Lt } from "./urdfTree-CfBupHPQ.js";
6
+ import { U as Mt, J as Lt } from "./urdfTree-DxLmsFUL.js";
7
7
  import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
8
  import { T as U } from "./svgIcon-D-_fXUBL.js";
9
9
  import { i as Tt } from "./isString-BATKat46.js";
@@ -1128,7 +1128,7 @@ function un(o, e, n, i = 4, t = 50) {
1128
1128
  s = Math.min(s, w), r = Math.max(r, w), a = Math.min(a, C), d = Math.max(d, C), u = Math.min(u, A), p = Math.max(p, A);
1129
1129
  }
1130
1130
  const h = Math.sqrt((r - s) ** 2 + (d - a) ** 2 + (p - u) ** 2) * 0.05, z = Ie.degToRad(e.fov), F = 2 * Math.tan(z / 2) * t, P = h / F * n.domElement.height * (i / 4);
1131
- return Math.max(1, P);
1131
+ return Math.min(0.4, P);
1132
1132
  }
1133
1133
  function dn(o) {
1134
1134
  if (o.length % 3 !== 0)
@@ -1141,9 +1141,9 @@ function dn(o) {
1141
1141
  e.setAttribute("color", new zt(n, 3));
1142
1142
  const i = new At({
1143
1143
  vertexColors: !0,
1144
- size: 1,
1144
+ size: 0.4,
1145
1145
  // 像素世界单位
1146
- sizeAttenuation: !1
1146
+ sizeAttenuation: !0
1147
1147
  }), t = new Ut(e, i);
1148
1148
  return i.needsUpdate = !0, t;
1149
1149
  }
@@ -1157,7 +1157,7 @@ function fn(o, e) {
1157
1157
  if (!r)
1158
1158
  return;
1159
1159
  r.name = "轨迹路径", n.add(r);
1160
- const a = un(e, i, t, 0.4, 50);
1160
+ const a = un(e, i, t, 0.1, 50);
1161
1161
  return r.material.size = a, r;
1162
1162
  }
1163
1163
  const pn = { class: "obj-viewer-container" }, mn = { class: "buttonGroup-topLeft" }, hn = { class: "buttonGroup-left" }, vn = { class: "buttonGroup-right" }, gn = { class: "buttonGroup-bottom" }, yn = { class: "left-panel" }, wn = { class: "panel-header" }, xn = { class: "panel-body" }, bn = {
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-BRM_rpi8.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B4a6duPj.cjs"),Be=require("./threeViewerHost-C1cS3BQx.cjs"),W=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-DTIOLiOJ.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function De(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),De(i,r,o)}const Ie={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const w=n.value[g];l.value=g,de(o.knife,w,o.cloud)},m=async()=>{if(n.value.length===0){W.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(w=>setTimeout(w,a.value)),h(g);p||W.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),W.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,W.ElMessage.info("动画已停止")},E=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,w)=>{const _=t.resolveComponent("el-input-number"),C=t.resolveComponent("el-form-item"),A=t.resolveComponent("el-form"),X=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(A,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(C,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(_,{modelValue:a.value,"onUpdate:modelValue":w[0]||(w[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[w[2]||(w[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[w[3]||(w[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(X,{modelValue:l.value,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:E,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,G=new c.Vector3;class fe extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)G.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(G)),G.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(G));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),O=require("./iconfont-CYyOVK2s.cjs"),c=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C2CSvQmH.cjs"),Be=require("./threeViewerHost-BRpeReJJ.cjs"),W=require("./index-C8qRkCgn.cjs"),oe=require("./urdfTree-CXBSDiJj.cjs"),ue=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),V=require("./svgIcon-CUM54R6L.cjs"),Le=require("./isString--eJE54G5.cjs");function ke(r=.5,e=4){const i=new c.Mesh(new c.ConeGeometry(r,e,32),new c.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),o=i.geometry.parameters.height;return i.geometry.translate(0,-o/2,0),i.rotation.set(-90,0,0,"XYZ"),i}function Pe(r,e){r.position.copy(e)}function De(r,e,i=new c.Color(16711680)){const o=new c.Vector3;e.getWorldPosition(o);const n=r.geometry.attributes.position,s=r.geometry.attributes.color,l=new c.Color(55551);let a=1/0,p=-1;for(let f=0;f<n.count;f++){const m=new c.Vector3().fromBufferAttribute(n,f).distanceTo(o);m<a&&(a=m,p=f)}for(let f=0;f<s.count;f++)l.toArray(s.array,f*3);if(p!==-1){const f=i.toArray(),h=p*3+2;for(let m=0;m<h;m=m+3)s.array[m]=f[0],s.array[m+1]=f[1],s.array[m+2]=f[2]}s.needsUpdate=!0}function de(r,e,i,o=new c.Color(16711680)){Pe(r,e),De(i,r,o)}const Ie={class:"panel-content"},Fe={class:"animation-controls"},Oe={class:"control-row"},je={class:"control-row"},Re={class:"frame-info"},We={class:"control-row"},Ge=t.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(r,{expose:e,emit:i}){const o=r,n=t.computed(()=>o.vectors),s=t.ref(!1),l=t.ref(0),a=t.ref(50);let p=!1;const f=g=>`第 ${g+1} 帧`,h=g=>{if(g<0||g>=n.value.length){console.error(`帧索引 ${g} 超出范围`);return}const w=n.value[g];l.value=g,de(o.knife,w,o.cloud)},m=async()=>{if(n.value.length===0){W.ElMessage.error("无法播放动画:无数据");return}if(!s.value){s.value=!0,p=!1,n.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<n.value.length&&!p;g++)await new Promise(w=>setTimeout(w,a.value)),h(g);p||W.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g),W.ElMessage.error("动画播放出错")}finally{s.value=!1}}},v=()=>{p=!0,s.value=!1,W.ElMessage.info("动画已停止")},E=g=>{s.value&&v(),h(g)};return e({playAnimation:m,stopAnimation:v,forwardFrame:()=>{s.value&&v(),!(l.value+1>=n.value.length)&&h(l.value+1)},backwardFrame:()=>{s.value&&v(),l.value!==0&&h(l.value-1)}}),(g,w)=>{const _=t.resolveComponent("el-input-number"),C=t.resolveComponent("el-form-item"),A=t.resolveComponent("el-form"),X=t.resolveComponent("el-slider");return t.openBlock(),t.createElementBlock("div",Ie,[t.createElementVNode("div",Fe,[t.createElementVNode("div",Oe,[t.createVNode(A,{"label-width":"auto",style:{width:"100%"}},{default:t.withCtx(()=>[t.createVNode(C,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:t.withCtx(()=>[t.createVNode(_,{modelValue:a.value,"onUpdate:modelValue":w[0]||(w[0]=F=>a.value=F),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),t.createElementVNode("div",je,[w[2]||(w[2]=t.createElementVNode("label",null,"当前帧:",-1)),t.createElementVNode("span",Re,t.toDisplayString(l.value+1)+" / "+t.toDisplayString(n.value.length),1)]),t.createElementVNode("div",We,[w[3]||(w[3]=t.createElementVNode("label",null,"动画进度:",-1)),t.createVNode(X,{modelValue:l.value,"onUpdate:modelValue":w[1]||(w[1]=F=>l.value=F),min:0,max:n.value.length>0?n.value.length-1:0,step:1,"format-tooltip":f,onInput:E,disabled:n.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),He=ue._export_sfc(Ge,[["__scopeId","data-v-93cde733"]]),re=new c.Box3,G=new c.Vector3;class fe extends c.InstancedBufferGeometry{constructor(){super(),this.isLineSegmentsGeometry=!0,this.type="LineSegmentsGeometry";const e=[-1,2,0,1,2,0,-1,1,0,1,1,0,-1,0,0,1,0,0,-1,-1,0,1,-1,0],i=[-1,2,1,2,-1,1,1,1,-1,-1,1,-1,-1,-2,1,-2],o=[0,2,1,2,3,1,2,4,3,4,5,3,4,6,5,6,7,5];this.setIndex(o),this.setAttribute("position",new c.Float32BufferAttribute(e,3)),this.setAttribute("uv",new c.Float32BufferAttribute(i,2))}applyMatrix4(e){const i=this.attributes.instanceStart,o=this.attributes.instanceEnd;return i!==void 0&&(i.applyMatrix4(e),o.applyMatrix4(e),i.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}setPositions(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceEnd",new c.InterleavedBufferAttribute(o,3,3)),this.instanceCount=this.attributes.instanceStart.count,this.computeBoundingBox(),this.computeBoundingSphere(),this}setColors(e){let i;e instanceof Float32Array?i=e:Array.isArray(e)&&(i=new Float32Array(e));const o=new c.InstancedInterleavedBuffer(i,6,1);return this.setAttribute("instanceColorStart",new c.InterleavedBufferAttribute(o,3,0)),this.setAttribute("instanceColorEnd",new c.InterleavedBufferAttribute(o,3,3)),this}fromWireframeGeometry(e){return this.setPositions(e.attributes.position.array),this}fromEdgesGeometry(e){return this.setPositions(e.attributes.position.array),this}fromMesh(e){return this.fromWireframeGeometry(new c.WireframeGeometry(e.geometry)),this}fromLineSegments(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new c.Box3);const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;e!==void 0&&i!==void 0&&(this.boundingBox.setFromBufferAttribute(e),re.setFromBufferAttribute(i),this.boundingBox.union(re))}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new c.Sphere),this.boundingBox===null&&this.computeBoundingBox();const e=this.attributes.instanceStart,i=this.attributes.instanceEnd;if(e!==void 0&&i!==void 0){const o=this.boundingSphere.center;this.boundingBox.getCenter(o);let n=0;for(let s=0,l=e.count;s<l;s++)G.fromBufferAttribute(e,s),n=Math.max(n,o.distanceToSquared(G)),G.fromBufferAttribute(i,s),n=Math.max(n,o.distanceToSquared(G));this.boundingSphere.radius=Math.sqrt(n),isNaN(this.boundingSphere.radius)&&console.error("THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.",this)}}toJSON(){}}c.UniformsLib.line={worldUnits:{value:1},linewidth:{value:1},resolution:{value:new c.Vector2(1,1)},dashOffset:{value:0},dashScale:{value:1},dashSize:{value:1},gapSize:{value:1}};c.ShaderLib.line={uniforms:c.UniformsUtils.merge([c.UniformsLib.common,c.UniformsLib.fog,c.UniformsLib.line]),vertexShader:`
2
2
  #include <common>
3
3
  #include <color_pars_vertex>
4
4
  #include <fog_pars_vertex>
@@ -367,4 +367,4 @@
367
367
  #include <premultiplied_alpha_fragment>
368
368
 
369
369
  }
370
- `};class te extends c.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const J=new c.Vector4,se=new c.Vector3,ae=new c.Vector3,x=new c.Vector4,b=new c.Vector4,N=new c.Vector4,Q=new c.Vector3,ee=new c.Matrix4,S=new c.Line3,le=new c.Vector3,H=new c.Box3,q=new c.Sphere,M=new c.Vector4;let T,I;function ce(r,e,i){return M.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),M.multiplyScalar(1/M.w),M.x=I/i.width,M.y=I/i.height,M.applyMatrix4(r.projectionMatrixInverse),M.multiplyScalar(1/M.w),Math.abs(Math.max(M.x,M.y))}function qe(r,e){const i=r.matrixWorld,o=r.geometry,n=o.attributes.instanceStart,s=o.attributes.instanceEnd,l=Math.min(o.instanceCount,n.count);for(let a=0,p=l;a<p;a++){S.start.fromBufferAttribute(n,a),S.end.fromBufferAttribute(s,a),S.applyMatrix4(i);const f=new c.Vector3,h=new c.Vector3;T.distanceSqToSegment(S.start,S.end,h,f),h.distanceTo(f)<I*.5&&e.push({point:h,pointOnLine:f,distance:T.origin.distanceTo(h),object:r,face:null,faceIndex:a,uv:null,uv1:null})}}function $e(r,e,i){const o=e.projectionMatrix,s=r.material.resolution,l=r.matrixWorld,a=r.geometry,p=a.attributes.instanceStart,f=a.attributes.instanceEnd,h=Math.min(a.instanceCount,p.count),m=-e.near;T.at(1,N),N.w=1,N.applyMatrix4(e.matrixWorldInverse),N.applyMatrix4(o),N.multiplyScalar(1/N.w),N.x*=s.x/2,N.y*=s.y/2,N.z=0,Q.copy(N),ee.multiplyMatrices(e.matrixWorldInverse,l);for(let v=0,E=h;v<E;v++){if(x.fromBufferAttribute(p,v),b.fromBufferAttribute(f,v),x.w=1,b.w=1,x.applyMatrix4(ee),b.applyMatrix4(ee),x.z>m&&b.z>m)continue;if(x.z>m){const C=x.z-b.z,A=(x.z-m)/C;x.lerp(b,A)}else if(b.z>m){const C=b.z-x.z,A=(b.z-m)/C;b.lerp(x,A)}x.applyMatrix4(o),b.applyMatrix4(o),x.multiplyScalar(1/x.w),b.multiplyScalar(1/b.w),x.x*=s.x/2,x.y*=s.y/2,b.x*=s.x/2,b.y*=s.y/2,S.start.copy(x),S.start.z=0,S.end.copy(b),S.end.z=0;const U=S.closestPointToPointParameter(Q,!0);S.at(U,le);const g=c.MathUtils.lerp(x.z,b.z,U),w=g>=-1&&g<=1,_=Q.distanceTo(le)<I*.5;if(w&&_){S.start.fromBufferAttribute(p,v),S.end.fromBufferAttribute(f,v),S.start.applyMatrix4(l),S.end.applyMatrix4(l);const C=new c.Vector3,A=new c.Vector3;T.distanceSqToSegment(S.start,S.end,A,C),i.push({point:A,pointOnLine:C,distance:T.origin.distanceTo(A),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}class Xe extends c.Mesh{constructor(e=new fe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,i=e.attributes.instanceStart,o=e.attributes.instanceEnd,n=new Float32Array(2*i.count);for(let l=0,a=0,p=i.count;l<p;l++,a+=2)se.fromBufferAttribute(i,l),ae.fromBufferAttribute(o,l),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+se.distanceTo(ae);const s=new c.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(s,1,1)),this}raycast(e,i){const o=this.material.worldUnits,n=e.camera;n===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;T=e.ray;const l=this.matrixWorld,a=this.geometry,p=this.material;I=p.linewidth+s,a.boundingSphere===null&&a.computeBoundingSphere(),q.copy(a.boundingSphere).applyMatrix4(l);let f;if(o)f=I*.5;else{const m=Math.max(n.near,q.distanceToPoint(T.origin));f=ce(n,m,p.resolution)}if(q.radius+=f,T.intersectsSphere(q)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),H.copy(a.boundingBox).applyMatrix4(l);let h;if(o)h=I*.5;else{const m=Math.max(n.near,H.distanceToPoint(T.origin));h=ce(n,m,p.resolution)}H.expandByScalar(h),T.intersectsBox(H)!==!1&&(o?qe(this,i):$e(this,n,i))}onBeforeRender(e){const i=this.material.uniforms;i&&i.resolution&&(e.getViewport(J),this.material.uniforms.resolution.value.set(J.z,J.w))}}class pe extends fe{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setPositions(o),this}setColors(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setColors(o),this}setFromPoints(e){const i=e.length-1,o=new Float32Array(6*i);for(let n=0;n<i;n++)o[6*n]=e[n].x,o[6*n+1]=e[n].y,o[6*n+2]=e[n].z||0,o[6*n+3]=e[n+1].x,o[6*n+4]=e[n+1].y,o[6*n+5]=e[n+1].z||0;return super.setPositions(o),this}fromLine(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}}class Ye extends Xe{constructor(e=new pe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLine2=!0,this.type="Line2"}}function Ze(r){const e=[];return r.forEach(i=>{const[o,n,s]=i.trim().split(/\s+/);e.push(+o,+n,+s)}),e}function $(r,e,i){switch(r){case"X":e.x=+i||0;break;case"Y":e.y=+i||0;break;case"Z":e.z=+i||0;break}}function Ke(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&$(l,n,a),a="",l=h;continue}a=a+f}$(l,n,a),e.push(n.x,n.y,n.z)}),e}const Je=r=>r==null?void 0:r.filter(i=>i.includes("=")),Qe=r=>r.replace(/,/g,""),et=r=>r==null?void 0:r.map(i=>Qe(i)),tt=r=>{const e=Je(r);return et(e)};function nt(r){const e=tt(r),i=[];return e.forEach(o=>{var m,v,E,B,U,g;let[n,s,l,a]=o.trim().split(/\s+/);s=(m=s==null?void 0:s.trim)==null?void 0:m.call(s),l=(v=l==null?void 0:l.trim)==null?void 0:v.call(l),a=(E=a==null?void 0:a.trim)==null?void 0:E.call(a);const[,p]=(B=s==null?void 0:s.split)==null?void 0:B.call(s,"="),[,f]=(U=l==null?void 0:l.split)==null?void 0:U.call(l,"="),[,h]=(g=a==null?void 0:a.split)==null?void 0:g.call(a,"=");i.push(+p,+f,+h)}),i}function it(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&$(l,n,a),a="",l=h;continue}a=a+f}$(l,n,a),e.push(n.x,n.y,n.z)}),e}function ot(r){return r==null?void 0:r.includes("=")}async function rt(r){var n,s;const e=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\r?\n/);if(ot(r))return nt(e);const i=e==null?void 0:e[0],o=(s=i==null?void 0:i.trim())==null?void 0:s.split(/\s+/);if((o==null?void 0:o.length)>=3)return Ze(e);if((o==null?void 0:o.length)===1)return Ke(e)}async function st(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function at(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function lt(r){let e=r.trim().split(/\r?\n/);return e=e.filter(o=>o.startsWith("X")),e=e.map(o=>{const s=o.indexOf("A");return o.slice(0,s)}),it(e)}async function ct(r,e){const{isCyd:i,isUv:o,isCpt:n,isNc:s}=e;return o?rt(r):i?at(r):n?st(r):s?lt(r):[]}function ut(r){const e=[];for(let i=0;i<r.length;i+=3)e.push(new c.Vector3(r[i],r[i+1],r[i+2]));return e}function dt(r,e){if(!e||e.length<3)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=[];for(let v=0;v<e.length;v+=3)l.push(new c.Vector3(e[v],e[v+1],e[v+2]));const p=new c.CatmullRomCurve3(l,!1,"catmullrom",.5).getPoints(150).flatMap(v=>[v.x,v.y,v.z]),f=new pe;f.setPositions(p);const h=new te({color:55551,linewidth:3,resolution:new c.Vector2(window.innerWidth,window.innerHeight)}),m=new Ye(f,h);return m.name="轨迹路径",i.add(m),m}function ft(r,e,i,o=4,n=50){let s=1/0,l=-1/0,a=1/0,p=-1/0,f=1/0,h=-1/0;for(let g=0;g<r.length;g+=3){const w=r[g],_=r[g+1],C=r[g+2];s=Math.min(s,w),l=Math.max(l,w),a=Math.min(a,_),p=Math.max(p,_),f=Math.min(f,C),h=Math.max(h,C)}const v=Math.sqrt((l-s)**2+(p-a)**2+(h-f)**2)*.05,E=c.MathUtils.degToRad(e.fov),B=2*Math.tan(E/2)*n,U=v/B*i.domElement.height*(o/4);return Math.max(1,U)}function pt(r){if(r.length%3!==0)return console.error("points array length is not a multiple of 3:",r),null;const e=new c.BufferGeometry;e.setAttribute("position",new c.Float32BufferAttribute(r,3));const i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3)i[s]=0,i[s+1]=.847,i[s+2]=1;e.setAttribute("color",new c.BufferAttribute(i,3));const o=new c.PointsMaterial({vertexColors:!0,size:1,sizeAttenuation:!1}),n=new c.Points(e,o);return o.needsUpdate=!0,n}function mt(r,e){if(!e)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=pt(e);if(!l)return;l.name="轨迹路径",i.add(l);const a=ft(e,o,n,.4,50);return l.material.size=a,l}const ht={class:"obj-viewer-container"},vt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},yt={class:"buttonGroup-right"},wt={class:"buttonGroup-bottom"},xt={class:"left-panel"},bt={class:"panel-header"},St={class:"panel-body"},_t={key:1,class:"clipping-content"},Et={class:"radio-group"},Ct={class:"radio-label"},Vt={class:"radio-label"},zt={class:"radio-label"},At={class:"radio-label"},Ut={class:"right-panel"},Nt={class:"panel-header"},Mt={class:"panel-body"},Tt={key:0,class:"loading-overlay"},Bt=t.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(r,{emit:e}){const i=e,o=r,n=t.ref(null),s=t.ref(!1),l=t.ref(""),a=t.ref(),p=t.ref(!1),f=t.ref(""),h=t.ref(!1),m=t.ref(""),v=t.shallowRef(null),E=t.shallowRef(null),{currentModels:B,resetView:U,initThreeJS:g,handleResize:w,getThreeJSObjects:_,cleanup:C,axesHelperVisible:A,toggleAxesVisibility:X}=O.useThreeJS(n),{isAnimating:F,toggleAnimation:me,stopAnimation:he}=O.useAnimation(_,B),{isClipping:ve,activeClippingAxis:z,toggleClipping:ge,updateClippingPlanes:L}=O.useClipping(_,B),ye=()=>{X()},Y=d=>{p.value=!0,f.value=d,d==="剖面视图"&&!ve.value&&ge()},Z=d=>{h.value=!0,m.value=d,d==="动画仿真"&&i("getAnimationData")},K=t.ref([]),j=t.ref([]),we=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isUv}),xe=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCyd}),be=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCpt}),P=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isNc}),Se=t.computed(()=>{const d=o.fileBlobs||[];return d==null?void 0:d[0]});let k=t.shallowRef(),D=t.shallowRef();const _e=()=>{const{scene:d}=_();k.value&&d&&(O.disposeObj(k.value,d),k.value=null)},Ee=()=>{const{scene:d}=_();D.value&&d&&(O.disposeObj(D.value,d),D.value=null)},ne=()=>{_e(),Ee()},Ce=async d=>{const u=URL.createObjectURL(d),R=await Be.readFileText(u);if(URL.revokeObjectURL(u),Le.isString(R)){const y=await ct(R,o.trackFileType)||[];K.value=y;const ie=K.value;we.value&&(k.value=dt(_,ie)),(xe.value||be.value||P.value)&&(k.value=mt(_,ie)),O.frameCameraToMesh(_,k.value)}},Ve=()=>{var d,u;D.value=ke(),j.value=ut(K.value),j.value&&j.value.length&&(de(D.value,j.value[0],k.value,new c.Color(16711680)),(u=(d=E.value)==null?void 0:d.add)==null||u.call(d,D.value))};t.watch(()=>Se.value,async d=>{d&&(ne(),await Ce(d),P.value&&Ve())},{immediate:!0,deep:!0});const ze=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.playAnimation())},Ae=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.stopAnimation())},Ue=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.forwardFrame())},Ne=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.backwardFrame())},Me=()=>{g(),window.addEventListener("resize",w);const d=_();E.value=d.scene,E.value&&(E.value.name="CPMPIP")},Te=()=>{window.removeEventListener("resize",w),F.value&&he(),ne(),C()};return t.onMounted(async()=>{try{Me()}catch(d){console.error("Three.js 初始化失败:",d),W.ElMessage.error("渲染引擎初始化失败!")}}),t.onBeforeUnmount(()=>{Te()}),(d,u)=>{const R=t.resolveComponent("el-scrollbar");return t.openBlock(),t.createElementBlock("div",ht,[t.createElementVNode("div",{ref_key:"threejsContainer",ref:n,class:"threejs-container"},null,512),t.createElementVNode("div",vt,[t.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:t.unref(U),title:"重置"},null,8,["onClick"]),t.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),t.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),t.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:t.unref(me),title:t.unref(F)?"停止动画":"动画视图"},null,8,["onClick","title"]),t.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:t.unref(A),onClick:ye,title:"显隐坐标轴"},null,8,["active"])]),t.createElementVNode("div",gt,[t.renderSlot(d.$slots,"button-left",{switchRightPanel:Y},void 0,!0),t.createVNode(V.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:u[0]||(u[0]=y=>Y("场景树")),active:p.value&&f.value==="场景树",title:"场景树"},null,8,["active"]),t.createVNode(V.ThreeSvgIcon,{name:"clipping",size:"24",onClick:u[1]||(u[1]=y=>Y("剖面视图")),active:p.value&&f.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),t.createElementVNode("div",yt,[t.renderSlot(d.$slots,"button-right",{switchRightPanel:Z},void 0,!0),t.createVNode(V.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:u[2]||(u[2]=y=>Z("关节控制")),active:h.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),t.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:u[3]||(u[3]=y=>Z("动画仿真")),active:h.value&&m.value==="动画仿真"},null,8,["active"])]),t.createElementVNode("div",wt,[t.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ne}),t.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),t.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Ue}),t.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ae})]),t.withDirectives(t.createElementVNode("div",xt,[t.createElementVNode("div",bt,[t.createElementVNode("span",null,t.toDisplayString(f.value),1),t.createElementVNode("span",{class:"close",onClick:u[4]||(u[4]=y=>p.value=!1)}," X ")]),t.createElementVNode("div",St,[t.createVNode(R,{height:"100%"},{default:t.withCtx(()=>[f.value==="场景树"?(t.openBlock(),t.createBlock(oe.UrdfTree,{key:0,model:v.value},null,8,["model"])):t.createCommentVNode("",!0),f.value==="剖面视图"?(t.openBlock(),t.createElementBlock("div",_t,[t.createElementVNode("div",Et,[t.createElementVNode("label",Ct,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":u[5]||(u[5]=y=>t.isRef(z)?z.value=y:null),onChange:u[6]||(u[6]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[14]||(u[14]=t.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),t.createElementVNode("label",Vt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":u[7]||(u[7]=y=>t.isRef(z)?z.value=y:null),onChange:u[8]||(u[8]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[15]||(u[15]=t.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),t.createElementVNode("label",zt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":u[9]||(u[9]=y=>t.isRef(z)?z.value=y:null),onChange:u[10]||(u[10]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[16]||(u[16]=t.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),t.createElementVNode("label",At,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":u[11]||(u[11]=y=>t.isRef(z)?z.value=y:null),onChange:u[12]||(u[12]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[17]||(u[17]=t.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):t.createCommentVNode("",!0)]),_:1})])],512),[[t.vShow,p.value]]),t.withDirectives(t.createElementVNode("div",Ut,[t.createElementVNode("div",Nt,[t.createElementVNode("span",null,t.toDisplayString(m.value),1),t.createElementVNode("span",{class:"close",onClick:u[13]||(u[13]=y=>h.value=!1)}," X ")]),t.createElementVNode("div",Mt,[t.createVNode(R,{height:"100%"},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(oe.JointPanel,{model:v.value},null,8,["model"]),[[t.vShow,m.value==="关节控制"]]),t.withDirectives(t.createVNode(He,{ref_key:"animationPanelRef",ref:a,cloud:t.unref(k),knife:t.unref(D),vectors:j.value},null,8,["cloud","knife","vectors"]),[[t.vShow,m.value==="动画仿真"&&P.value]])]),_:1})])],512),[[t.vShow,h.value]]),s.value?(t.openBlock(),t.createElementBlock("div",Tt,[u[18]||(u[18]=t.createElementVNode("div",{class:"loading-spinner"},null,-1)),t.createElementVNode("p",null,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)])}}}),Lt=ue._export_sfc(Bt,[["__scopeId","data-v-48ba356f"]]);exports.default=Lt;
370
+ `};class te extends c.ShaderMaterial{constructor(e){super({type:"LineMaterial",uniforms:c.UniformsUtils.clone(c.ShaderLib.line.uniforms),vertexShader:c.ShaderLib.line.vertexShader,fragmentShader:c.ShaderLib.line.fragmentShader,clipping:!0}),this.isLineMaterial=!0,this.setValues(e)}get color(){return this.uniforms.diffuse.value}set color(e){this.uniforms.diffuse.value=e}get worldUnits(){return"WORLD_UNITS"in this.defines}set worldUnits(e){e===!0?this.defines.WORLD_UNITS="":delete this.defines.WORLD_UNITS}get linewidth(){return this.uniforms.linewidth.value}set linewidth(e){this.uniforms.linewidth&&(this.uniforms.linewidth.value=e)}get dashed(){return"USE_DASH"in this.defines}set dashed(e){e===!0!==this.dashed&&(this.needsUpdate=!0),e===!0?this.defines.USE_DASH="":delete this.defines.USE_DASH}get dashScale(){return this.uniforms.dashScale.value}set dashScale(e){this.uniforms.dashScale.value=e}get dashSize(){return this.uniforms.dashSize.value}set dashSize(e){this.uniforms.dashSize.value=e}get dashOffset(){return this.uniforms.dashOffset.value}set dashOffset(e){this.uniforms.dashOffset.value=e}get gapSize(){return this.uniforms.gapSize.value}set gapSize(e){this.uniforms.gapSize.value=e}get opacity(){return this.uniforms.opacity.value}set opacity(e){this.uniforms&&(this.uniforms.opacity.value=e)}get resolution(){return this.uniforms.resolution.value}set resolution(e){this.uniforms.resolution.value.copy(e)}get alphaToCoverage(){return"USE_ALPHA_TO_COVERAGE"in this.defines}set alphaToCoverage(e){this.defines&&(e===!0!==this.alphaToCoverage&&(this.needsUpdate=!0),e===!0?this.defines.USE_ALPHA_TO_COVERAGE="":delete this.defines.USE_ALPHA_TO_COVERAGE)}}const J=new c.Vector4,se=new c.Vector3,ae=new c.Vector3,b=new c.Vector4,x=new c.Vector4,N=new c.Vector4,Q=new c.Vector3,ee=new c.Matrix4,S=new c.Line3,le=new c.Vector3,H=new c.Box3,q=new c.Sphere,M=new c.Vector4;let T,I;function ce(r,e,i){return M.set(0,0,-e,1).applyMatrix4(r.projectionMatrix),M.multiplyScalar(1/M.w),M.x=I/i.width,M.y=I/i.height,M.applyMatrix4(r.projectionMatrixInverse),M.multiplyScalar(1/M.w),Math.abs(Math.max(M.x,M.y))}function qe(r,e){const i=r.matrixWorld,o=r.geometry,n=o.attributes.instanceStart,s=o.attributes.instanceEnd,l=Math.min(o.instanceCount,n.count);for(let a=0,p=l;a<p;a++){S.start.fromBufferAttribute(n,a),S.end.fromBufferAttribute(s,a),S.applyMatrix4(i);const f=new c.Vector3,h=new c.Vector3;T.distanceSqToSegment(S.start,S.end,h,f),h.distanceTo(f)<I*.5&&e.push({point:h,pointOnLine:f,distance:T.origin.distanceTo(h),object:r,face:null,faceIndex:a,uv:null,uv1:null})}}function $e(r,e,i){const o=e.projectionMatrix,s=r.material.resolution,l=r.matrixWorld,a=r.geometry,p=a.attributes.instanceStart,f=a.attributes.instanceEnd,h=Math.min(a.instanceCount,p.count),m=-e.near;T.at(1,N),N.w=1,N.applyMatrix4(e.matrixWorldInverse),N.applyMatrix4(o),N.multiplyScalar(1/N.w),N.x*=s.x/2,N.y*=s.y/2,N.z=0,Q.copy(N),ee.multiplyMatrices(e.matrixWorldInverse,l);for(let v=0,E=h;v<E;v++){if(b.fromBufferAttribute(p,v),x.fromBufferAttribute(f,v),b.w=1,x.w=1,b.applyMatrix4(ee),x.applyMatrix4(ee),b.z>m&&x.z>m)continue;if(b.z>m){const C=b.z-x.z,A=(b.z-m)/C;b.lerp(x,A)}else if(x.z>m){const C=x.z-b.z,A=(x.z-m)/C;x.lerp(b,A)}b.applyMatrix4(o),x.applyMatrix4(o),b.multiplyScalar(1/b.w),x.multiplyScalar(1/x.w),b.x*=s.x/2,b.y*=s.y/2,x.x*=s.x/2,x.y*=s.y/2,S.start.copy(b),S.start.z=0,S.end.copy(x),S.end.z=0;const U=S.closestPointToPointParameter(Q,!0);S.at(U,le);const g=c.MathUtils.lerp(b.z,x.z,U),w=g>=-1&&g<=1,_=Q.distanceTo(le)<I*.5;if(w&&_){S.start.fromBufferAttribute(p,v),S.end.fromBufferAttribute(f,v),S.start.applyMatrix4(l),S.end.applyMatrix4(l);const C=new c.Vector3,A=new c.Vector3;T.distanceSqToSegment(S.start,S.end,A,C),i.push({point:A,pointOnLine:C,distance:T.origin.distanceTo(A),object:r,face:null,faceIndex:v,uv:null,uv1:null})}}}class Xe extends c.Mesh{constructor(e=new fe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLineSegments2=!0,this.type="LineSegments2"}computeLineDistances(){const e=this.geometry,i=e.attributes.instanceStart,o=e.attributes.instanceEnd,n=new Float32Array(2*i.count);for(let l=0,a=0,p=i.count;l<p;l++,a+=2)se.fromBufferAttribute(i,l),ae.fromBufferAttribute(o,l),n[a]=a===0?0:n[a-1],n[a+1]=n[a]+se.distanceTo(ae);const s=new c.InstancedInterleavedBuffer(n,2,1);return e.setAttribute("instanceDistanceStart",new c.InterleavedBufferAttribute(s,1,0)),e.setAttribute("instanceDistanceEnd",new c.InterleavedBufferAttribute(s,1,1)),this}raycast(e,i){const o=this.material.worldUnits,n=e.camera;n===null&&!o&&console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');const s=e.params.Line2!==void 0&&e.params.Line2.threshold||0;T=e.ray;const l=this.matrixWorld,a=this.geometry,p=this.material;I=p.linewidth+s,a.boundingSphere===null&&a.computeBoundingSphere(),q.copy(a.boundingSphere).applyMatrix4(l);let f;if(o)f=I*.5;else{const m=Math.max(n.near,q.distanceToPoint(T.origin));f=ce(n,m,p.resolution)}if(q.radius+=f,T.intersectsSphere(q)===!1)return;a.boundingBox===null&&a.computeBoundingBox(),H.copy(a.boundingBox).applyMatrix4(l);let h;if(o)h=I*.5;else{const m=Math.max(n.near,H.distanceToPoint(T.origin));h=ce(n,m,p.resolution)}H.expandByScalar(h),T.intersectsBox(H)!==!1&&(o?qe(this,i):$e(this,n,i))}onBeforeRender(e){const i=this.material.uniforms;i&&i.resolution&&(e.getViewport(J),this.material.uniforms.resolution.value.set(J.z,J.w))}}class pe extends fe{constructor(){super(),this.isLineGeometry=!0,this.type="LineGeometry"}setPositions(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setPositions(o),this}setColors(e){const i=e.length-3,o=new Float32Array(2*i);for(let n=0;n<i;n+=3)o[2*n]=e[n],o[2*n+1]=e[n+1],o[2*n+2]=e[n+2],o[2*n+3]=e[n+3],o[2*n+4]=e[n+4],o[2*n+5]=e[n+5];return super.setColors(o),this}setFromPoints(e){const i=e.length-1,o=new Float32Array(6*i);for(let n=0;n<i;n++)o[6*n]=e[n].x,o[6*n+1]=e[n].y,o[6*n+2]=e[n].z||0,o[6*n+3]=e[n+1].x,o[6*n+4]=e[n+1].y,o[6*n+5]=e[n+1].z||0;return super.setPositions(o),this}fromLine(e){const i=e.geometry;return this.setPositions(i.attributes.position.array),this}}class Ye extends Xe{constructor(e=new pe,i=new te({color:Math.random()*16777215})){super(e,i),this.isLine2=!0,this.type="Line2"}}function Ze(r){const e=[];return r.forEach(i=>{const[o,n,s]=i.trim().split(/\s+/);e.push(+o,+n,+s)}),e}function $(r,e,i){switch(r){case"X":e.x=+i||0;break;case"Y":e.y=+i||0;break;case"Z":e.z=+i||0;break}}function Ke(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&$(l,n,a),a="",l=h;continue}a=a+f}$(l,n,a),e.push(n.x,n.y,n.z)}),e}const Je=r=>r==null?void 0:r.filter(i=>i.includes("=")),Qe=r=>r.replace(/,/g,""),et=r=>r==null?void 0:r.map(i=>Qe(i)),tt=r=>{const e=Je(r);return et(e)};function nt(r){const e=tt(r),i=[];return e.forEach(o=>{var m,v,E,B,U,g;let[n,s,l,a]=o.trim().split(/\s+/);s=(m=s==null?void 0:s.trim)==null?void 0:m.call(s),l=(v=l==null?void 0:l.trim)==null?void 0:v.call(l),a=(E=a==null?void 0:a.trim)==null?void 0:E.call(a);const[,p]=(B=s==null?void 0:s.split)==null?void 0:B.call(s,"="),[,f]=(U=l==null?void 0:l.split)==null?void 0:U.call(l,"="),[,h]=(g=a==null?void 0:a.split)==null?void 0:g.call(a,"=");i.push(+p,+f,+h)}),i}function it(r){const e=[],i=["X","Y","Z"];return r.forEach(o=>{const n={x:0,y:0,z:0},s=o.trim();if(!s)return;let l=null,a="";for(let p=0;p<(s==null?void 0:s.length);p++){const f=s[p],h=i.find(m=>m===f);if(h){l&&$(l,n,a),a="",l=h;continue}a=a+f}$(l,n,a),e.push(n.x,n.y,n.z)}),e}function ot(r){return r==null?void 0:r.includes("=")}async function rt(r){var n,s;const e=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\r?\n/);if(ot(r))return nt(e);const i=e==null?void 0:e[0],o=(s=i==null?void 0:i.trim())==null?void 0:s.split(/\s+/);if((o==null?void 0:o.length)>=3)return Ze(e);if((o==null?void 0:o.length)===1)return Ke(e)}async function st(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function at(r){const e=r.trim().split(/\r?\n/),i=[];return e.forEach(o=>{const n=o.trim().split(/\s+/);if(n.length!=3)return;const[s,l,a]=n;i.push(+s,+l,+a)}),i}async function lt(r){let e=r.trim().split(/\r?\n/);return e=e.filter(o=>o.startsWith("X")),e=e.map(o=>{const s=o.indexOf("A");return o.slice(0,s)}),it(e)}async function ct(r,e){const{isCyd:i,isUv:o,isCpt:n,isNc:s}=e;return o?rt(r):i?at(r):n?st(r):s?lt(r):[]}function ut(r){const e=[];for(let i=0;i<r.length;i+=3)e.push(new c.Vector3(r[i],r[i+1],r[i+2]));return e}function dt(r,e){if(!e||e.length<3)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=[];for(let v=0;v<e.length;v+=3)l.push(new c.Vector3(e[v],e[v+1],e[v+2]));const p=new c.CatmullRomCurve3(l,!1,"catmullrom",.5).getPoints(150).flatMap(v=>[v.x,v.y,v.z]),f=new pe;f.setPositions(p);const h=new te({color:55551,linewidth:3,resolution:new c.Vector2(window.innerWidth,window.innerHeight)}),m=new Ye(f,h);return m.name="轨迹路径",i.add(m),m}function ft(r,e,i,o=4,n=50){let s=1/0,l=-1/0,a=1/0,p=-1/0,f=1/0,h=-1/0;for(let g=0;g<r.length;g+=3){const w=r[g],_=r[g+1],C=r[g+2];s=Math.min(s,w),l=Math.max(l,w),a=Math.min(a,_),p=Math.max(p,_),f=Math.min(f,C),h=Math.max(h,C)}const v=Math.sqrt((l-s)**2+(p-a)**2+(h-f)**2)*.05,E=c.MathUtils.degToRad(e.fov),B=2*Math.tan(E/2)*n,U=v/B*i.domElement.height*(o/4);return Math.min(.4,U)}function pt(r){if(r.length%3!==0)return console.error("points array length is not a multiple of 3:",r),null;const e=new c.BufferGeometry;e.setAttribute("position",new c.Float32BufferAttribute(r,3));const i=new Float32Array(r.length);for(let s=0;s<r.length;s+=3)i[s]=0,i[s+1]=.847,i[s+2]=1;e.setAttribute("color",new c.BufferAttribute(i,3));const o=new c.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),n=new c.Points(e,o);return o.needsUpdate=!0,n}function mt(r,e){if(!e)return;const{scene:i,camera:o,renderer:n,controls:s}=r();if(!i||!o||!n||!s)return;const l=pt(e);if(!l)return;l.name="轨迹路径",i.add(l);const a=ft(e,o,n,.1,50);return l.material.size=a,l}const ht={class:"obj-viewer-container"},vt={class:"buttonGroup-topLeft"},gt={class:"buttonGroup-left"},yt={class:"buttonGroup-right"},wt={class:"buttonGroup-bottom"},bt={class:"left-panel"},xt={class:"panel-header"},St={class:"panel-body"},_t={key:1,class:"clipping-content"},Et={class:"radio-group"},Ct={class:"radio-label"},Vt={class:"radio-label"},zt={class:"radio-label"},At={class:"radio-label"},Ut={class:"right-panel"},Nt={class:"panel-header"},Mt={class:"panel-body"},Tt={key:0,class:"loading-overlay"},Bt=t.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},emits:["getAnimationData","getThreeData"],setup(r,{emit:e}){const i=e,o=r,n=t.ref(null),s=t.ref(!1),l=t.ref(""),a=t.ref(),p=t.ref(!1),f=t.ref(""),h=t.ref(!1),m=t.ref(""),v=t.shallowRef(null),E=t.shallowRef(null),{currentModels:B,resetView:U,initThreeJS:g,handleResize:w,getThreeJSObjects:_,cleanup:C,axesHelperVisible:A,toggleAxesVisibility:X}=O.useThreeJS(n),{isAnimating:F,toggleAnimation:me,stopAnimation:he}=O.useAnimation(_,B),{isClipping:ve,activeClippingAxis:z,toggleClipping:ge,updateClippingPlanes:L}=O.useClipping(_,B),ye=()=>{X()},Y=d=>{p.value=!0,f.value=d,d==="剖面视图"&&!ve.value&&ge()},Z=d=>{h.value=!0,m.value=d,d==="动画仿真"&&i("getAnimationData")},K=t.ref([]),j=t.ref([]),we=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isUv}),be=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCyd}),xe=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isCpt}),P=t.computed(()=>{var u;return(u=o.trackFileType)==null?void 0:u.isNc}),Se=t.computed(()=>{const d=o.fileBlobs||[];return d==null?void 0:d[0]});let k=t.shallowRef(),D=t.shallowRef();const _e=()=>{const{scene:d}=_();k.value&&d&&(O.disposeObj(k.value,d),k.value=null)},Ee=()=>{const{scene:d}=_();D.value&&d&&(O.disposeObj(D.value,d),D.value=null)},ne=()=>{_e(),Ee()},Ce=async d=>{const u=URL.createObjectURL(d),R=await Be.readFileText(u);if(URL.revokeObjectURL(u),Le.isString(R)){const y=await ct(R,o.trackFileType)||[];K.value=y;const ie=K.value;we.value&&(k.value=dt(_,ie)),(be.value||xe.value||P.value)&&(k.value=mt(_,ie)),O.frameCameraToMesh(_,k.value)}},Ve=()=>{var d,u;D.value=ke(),j.value=ut(K.value),j.value&&j.value.length&&(de(D.value,j.value[0],k.value,new c.Color(16711680)),(u=(d=E.value)==null?void 0:d.add)==null||u.call(d,D.value))};t.watch(()=>Se.value,async d=>{d&&(ne(),await Ce(d),P.value&&Ve())},{immediate:!0,deep:!0});const ze=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.playAnimation())},Ae=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.stopAnimation())},Ue=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.forwardFrame())},Ne=()=>{var d;P.value&&((d=a==null?void 0:a.value)==null||d.backwardFrame())},Me=()=>{g(),window.addEventListener("resize",w);const d=_();E.value=d.scene,E.value&&(E.value.name="CPMPIP")},Te=()=>{window.removeEventListener("resize",w),F.value&&he(),ne(),C()};return t.onMounted(async()=>{try{Me()}catch(d){console.error("Three.js 初始化失败:",d),W.ElMessage.error("渲染引擎初始化失败!")}}),t.onBeforeUnmount(()=>{Te()}),(d,u)=>{const R=t.resolveComponent("el-scrollbar");return t.openBlock(),t.createElementBlock("div",ht,[t.createElementVNode("div",{ref_key:"threejsContainer",ref:n,class:"threejs-container"},null,512),t.createElementVNode("div",vt,[t.createVNode(V.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:t.unref(U),title:"重置"},null,8,["onClick"]),t.createVNode(V.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大"}),t.createVNode(V.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小"}),t.createVNode(V.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:t.unref(me),title:t.unref(F)?"停止动画":"动画视图"},null,8,["onClick","title"]),t.createVNode(V.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:t.unref(A),onClick:ye,title:"显隐坐标轴"},null,8,["active"])]),t.createElementVNode("div",gt,[t.renderSlot(d.$slots,"button-left",{switchRightPanel:Y},void 0,!0),t.createVNode(V.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:u[0]||(u[0]=y=>Y("场景树")),active:p.value&&f.value==="场景树",title:"场景树"},null,8,["active"]),t.createVNode(V.ThreeSvgIcon,{name:"clipping",size:"24",onClick:u[1]||(u[1]=y=>Y("剖面视图")),active:p.value&&f.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),t.createElementVNode("div",yt,[t.renderSlot(d.$slots,"button-right",{switchRightPanel:Z},void 0,!0),t.createVNode(V.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:u[2]||(u[2]=y=>Z("关节控制")),active:h.value&&m.value==="关节控制",title:"关节控制"},null,8,["active"]),t.createVNode(V.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:u[3]||(u[3]=y=>Z("动画仿真")),active:h.value&&m.value==="动画仿真"},null,8,["active"])]),t.createElementVNode("div",wt,[t.createVNode(V.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:Ne}),t.createVNode(V.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ze}),t.createVNode(V.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:Ue}),t.createVNode(V.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:Ae})]),t.withDirectives(t.createElementVNode("div",bt,[t.createElementVNode("div",xt,[t.createElementVNode("span",null,t.toDisplayString(f.value),1),t.createElementVNode("span",{class:"close",onClick:u[4]||(u[4]=y=>p.value=!1)}," X ")]),t.createElementVNode("div",St,[t.createVNode(R,{height:"100%"},{default:t.withCtx(()=>[f.value==="场景树"?(t.openBlock(),t.createBlock(oe.UrdfTree,{key:0,model:v.value},null,8,["model"])):t.createCommentVNode("",!0),f.value==="剖面视图"?(t.openBlock(),t.createElementBlock("div",_t,[t.createElementVNode("div",Et,[t.createElementVNode("label",Ct,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"none","onUpdate:modelValue":u[5]||(u[5]=y=>t.isRef(z)?z.value=y:null),onChange:u[6]||(u[6]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[14]||(u[14]=t.createElementVNode("span",{class:"radio-text"},"无切割",-1))]),t.createElementVNode("label",Vt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"x","onUpdate:modelValue":u[7]||(u[7]=y=>t.isRef(z)?z.value=y:null),onChange:u[8]||(u[8]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[15]||(u[15]=t.createElementVNode("span",{class:"radio-text"},"X轴切割",-1))]),t.createElementVNode("label",zt,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"y","onUpdate:modelValue":u[9]||(u[9]=y=>t.isRef(z)?z.value=y:null),onChange:u[10]||(u[10]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[16]||(u[16]=t.createElementVNode("span",{class:"radio-text"},"Y轴切割",-1))]),t.createElementVNode("label",At,[t.withDirectives(t.createElementVNode("input",{type:"radio",name:"clipping-axis",value:"z","onUpdate:modelValue":u[11]||(u[11]=y=>t.isRef(z)?z.value=y:null),onChange:u[12]||(u[12]=(...y)=>t.unref(L)&&t.unref(L)(...y))},null,544),[[t.vModelRadio,t.unref(z)]]),u[17]||(u[17]=t.createElementVNode("span",{class:"radio-text"},"Z轴切割",-1))])])])):t.createCommentVNode("",!0)]),_:1})])],512),[[t.vShow,p.value]]),t.withDirectives(t.createElementVNode("div",Ut,[t.createElementVNode("div",Nt,[t.createElementVNode("span",null,t.toDisplayString(m.value),1),t.createElementVNode("span",{class:"close",onClick:u[13]||(u[13]=y=>h.value=!1)}," X ")]),t.createElementVNode("div",Mt,[t.createVNode(R,{height:"100%"},{default:t.withCtx(()=>[t.withDirectives(t.createVNode(oe.JointPanel,{model:v.value},null,8,["model"]),[[t.vShow,m.value==="关节控制"]]),t.withDirectives(t.createVNode(He,{ref_key:"animationPanelRef",ref:a,cloud:t.unref(k),knife:t.unref(D),vectors:j.value},null,8,["cloud","knife","vectors"]),[[t.vShow,m.value==="动画仿真"&&P.value]])]),_:1})])],512),[[t.vShow,h.value]]),s.value?(t.openBlock(),t.createElementBlock("div",Tt,[u[18]||(u[18]=t.createElementVNode("div",{class:"loading-spinner"},null,-1)),t.createElementVNode("p",null,t.toDisplayString(l.value),1)])):t.createCommentVNode("",!0)])}}}),Lt=ue._export_sfc(Bt,[["__scopeId","data-v-48ba356f"]]);exports.default=Lt;
@@ -1,7 +1,7 @@
1
1
  import { computed as l0, defineComponent as Hc, defineAsyncComponent as Ja, ref as ri, watch as Vc, createElementBlock as ti, openBlock as jt, normalizeClass as Gc, createElementVNode as Xc, createBlock as Za, createCommentVNode as ai, renderSlot as st, unref as qa, withCtx as mt } from "vue";
2
2
  import { a as xs, cb as zc, p as Y0, s as ds } from "./index-BUYYl2Pc.js";
3
3
  import { u as vs } from "./index.vue_vue_type_style_index_1_lang-Bjoq8geZ.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CdhgB7xx.js";
4
+ import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DFR9Kcwi.js";
5
5
  import { _ as $c } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  function x_(e) {
7
7
  const t = sessionStorage.getItem("loginToken") ?? "123456";
@@ -24803,7 +24803,7 @@ const n_ = { class: "top-menu" }, i_ = {
24803
24803
  },
24804
24804
  emits: ["getThreeData"],
24805
24805
  setup(e, { emit: t }) {
24806
- const r = Ja(() => import("./threeSceneView-D5zDhJoR.js")), a = Ja(() => import("./threePreview-C_TwTZy-.js")), n = Ja(() => import("./threeTrackPathView-QDp-h2uJ.js")), i = Ja(() => import("./threeSceneViewForCPMPIP-8I4MXfwL.js")), s = {
24806
+ const r = Ja(() => import("./threeSceneView-BhmqTLZA.js")), a = Ja(() => import("./threePreview-Bd5BpbCA.js")), n = Ja(() => import("./threeTrackPathView-BvbmDcVs.js")), i = Ja(() => import("./threeSceneViewForCPMPIP-C7cCpwwv.js")), s = {
24807
24807
  ROBOT_SCENE: "robot",
24808
24808
  // 机器人场景
24809
24809
  LATHE_SCENE: "latheScene",