ss-component-new 1.2.111 → 1.2.113

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 (97) hide show
  1. package/dist/{MTLLoader-hWX_D7j7.js → MTLLoader-CxvMDUe0.js} +1 -1
  2. package/dist/{MTLLoader-BgOTItOM.cjs → MTLLoader-DGjQiY9j.cjs} +1 -1
  3. package/dist/{OBJLoader-C3tq7BYe.cjs → OBJLoader-DJpc8vUj.cjs} +1 -1
  4. package/dist/{OBJLoader-BukOM4Nu.js → OBJLoader-qAJoaDam.js} +1 -1
  5. package/dist/{OrbitControls-jkIlFyOy.js → OrbitControls-BMEUSilq.js} +1 -1
  6. package/dist/{OrbitControls-DKRnuekm.cjs → OrbitControls-Y0_MwO63.cjs} +1 -1
  7. package/dist/{URDFLoader-VSdgVBcE.js → URDFLoader-DFaB1rOB.js} +97 -97
  8. package/dist/{URDFLoader-CX_gwIob.cjs → URDFLoader-z_OD751c.cjs} +1 -1
  9. package/dist/{animationData-B6OrW5p6.js → animationData-Clde34ha.js} +7 -7
  10. package/dist/{animationData-C7dHVqYg.cjs → animationData-DcdD2uXH.cjs} +1 -1
  11. package/dist/{array-B_QF2OoW.js → array-DdC5qADi.js} +1 -1
  12. package/dist/{array-BgZ91brz.cjs → array-DyI9Z7da.cjs} +1 -1
  13. package/dist/{iconfont-BgB-_U_6.js → iconfont-BXKkx1g6.js} +88 -88
  14. package/dist/iconfont-Bi9FnKuf.cjs +1 -0
  15. package/dist/{index-d_PGJZkK.js → index-4PVKlafX.js} +1 -1
  16. package/dist/{index-CT0ojXx1.cjs → index-6hYePeg5.cjs} +1 -1
  17. package/dist/{index-cgzu94nF.cjs → index-B1DG30Df.cjs} +1 -1
  18. package/dist/{index-azgr74so.js → index-B8eH4yd_.js} +1 -1
  19. package/dist/{index-CUKZC4Nj.js → index-BAvTpFlb.js} +1 -1
  20. package/dist/{index-CbzP4t5J.cjs → index-BDUgsfdc.cjs} +1 -1
  21. package/dist/{index-DkTkLUFp.js → index-BGYM_yzB.js} +1 -1
  22. package/dist/index-BUC9msP6.cjs +1 -0
  23. package/dist/{index-9Bq99VYB.cjs → index-BWdy2G65.cjs} +1 -1
  24. package/dist/{index-BOfis0vA.js → index-BZBOlP5a.js} +3 -3
  25. package/dist/{index-Bx40M9YE.js → index-BfVijxl4.js} +1 -1
  26. package/dist/{index-CcCFQb0J.cjs → index-BgMxvBrj.cjs} +1 -1
  27. package/dist/{index-BheoHyAf.cjs → index-BsyhUS4V.cjs} +1 -1
  28. package/dist/{index-B2-FEPjF.js → index-BxrVd7R_.js} +1 -1
  29. package/dist/{index-BcQjNx-Q.cjs → index-C5pOxrIu.cjs} +1 -1
  30. package/dist/{index-Co-G3YR2.cjs → index-C6VrMmAM.cjs} +1 -1
  31. package/dist/{index-Cyq0NQxD.js → index-CH7VgZsg.js} +4 -4
  32. package/dist/{index-DTM9dTrs.js → index-CKtVnHqz.js} +1 -1
  33. package/dist/{index-D4M6WyOm.js → index-CL-M8PGp.js} +3422 -3421
  34. package/dist/{index-BPP3Oi4x.js → index-CNyI4C5D.js} +4 -4
  35. package/dist/{index-ClqfqYxq.cjs → index-CWUgMjDD.cjs} +1 -1
  36. package/dist/{index-C1XnW8VT.cjs → index-CXPAg3zi.cjs} +1 -1
  37. package/dist/{index-DPGM3-ZE.js → index-Cag9EKDi.js} +9 -9
  38. package/dist/{index-BNGaTEx5.cjs → index-Ce63svvK.cjs} +1 -1
  39. package/dist/{index-Dll9lcYi.js → index-Cfh6xox2.js} +1 -1
  40. package/dist/{index-D-h6ztpZ.cjs → index-CoVIQ7yB.cjs} +1 -1
  41. package/dist/{index-ygHebc1d.js → index-CrLgmQwX.js} +16 -16
  42. package/dist/{index-DaMyMwHq.js → index-Ct7FxVrb.js} +1 -1
  43. package/dist/{index-BKWeM8bu.js → index-D2J4nD2U.js} +3 -3
  44. package/dist/{index-CCixZ8x2.cjs → index-D6gzqbUQ.cjs} +1 -1
  45. package/dist/{index-DQW-r04P.js → index-D7uWgp_G.js} +1 -1
  46. package/dist/{index-Cs6-4hum.js → index-DZ6iK-To.js} +2 -2
  47. package/dist/{index-B_CKxC0N.cjs → index-Ddk7mQP9.cjs} +1 -1
  48. package/dist/{index-DbDdlA5q.js → index-Ddl5YPaT.js} +7 -7
  49. package/dist/{index-BE67ZntN.js → index-Dn7a-X3Y.js} +2 -2
  50. package/dist/index-DnoDETkE.cjs +1 -0
  51. package/dist/{index-9ASTWGRl.cjs → index-DvR7fcc6.cjs} +1 -1
  52. package/dist/{index-i-fwIxhy.cjs → index-Dw15nvpm.cjs} +1 -1
  53. package/dist/{index-DalbUyWu.cjs → index-DyLovBRT.cjs} +1 -1
  54. package/dist/{index-Cjs5dfSY.cjs → index-Md9bylWp.cjs} +1 -1
  55. package/dist/{index-Bnhk2Wum.js → index-OXqTOaYL.js} +1 -1
  56. package/dist/{index-6kcPKvxJ.cjs → index-PGBtNsFS.cjs} +1 -1
  57. package/dist/{index-VMUoElNW.js → index-bNwKGgV2.js} +4 -4
  58. package/dist/{index-Cf1Y1Sze.cjs → index-lOzwjQZi.cjs} +1 -1
  59. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-BgpRnb6p.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-D1CNkdop.js} +9 -9
  60. package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-cYS0o50W.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DzZjQSCB.cjs} +2 -2
  61. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dgy71NC0.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DV9lk-8w.js} +22 -31
  62. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-o8Cf7V1D.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eVz0Sp.cjs} +149 -149
  63. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-D5E2HyCn.cjs → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Bo97w4bj.cjs} +1 -1
  64. package/dist/{index.vue_vue_type_style_index_0_scoped_140f5e74_lang-BEM7doEB.js → index.vue_vue_type_style_index_0_scoped_140f5e74_lang-Deyo5lI4.js} +4 -4
  65. package/dist/{index.vue_vue_type_style_index_1_lang-C6g1KtOz.cjs → index.vue_vue_type_style_index_1_lang-BwsR7epS.cjs} +1 -1
  66. package/dist/{index.vue_vue_type_style_index_1_lang-Cqs4qqQV.js → index.vue_vue_type_style_index_1_lang-Duqg1WtV.js} +4 -4
  67. package/dist/{loaderUtil-BFbM8t6R.js → loaderUtil-1wRb28no.js} +1 -1
  68. package/dist/{loaderUtil-DWuLgv1P.cjs → loaderUtil-Cq8QCp9W.cjs} +1 -1
  69. package/dist/{main-BlxcR1aO.js → main-5e5sWLUD.js} +3 -3
  70. package/dist/{main-BIJA7Oyr.cjs → main-CBFpUWMt.cjs} +1 -1
  71. package/dist/ss-component.cjs +1 -1
  72. package/dist/ss-component.css +1 -1
  73. package/dist/ss-component.js +9 -9
  74. package/dist/ss-component2.cjs +1 -1
  75. package/dist/ss-component2.js +10 -10
  76. package/dist/{threeModel-wFgYGhPU.cjs → threeModel-BbUQzHU5.cjs} +1 -1
  77. package/dist/{threeModel-B8-8TvnY.js → threeModel-BqpIaxlN.js} +4 -4
  78. package/dist/{threePreview-vuENkCyX.cjs → threePreview-Aib1ZmEj.cjs} +1 -1
  79. package/dist/{threePreview-BgJvhDAL.js → threePreview-B-BL8PZx.js} +4 -4
  80. package/dist/{threeSceneView-D18FzdLv.js → threeSceneView-BVK89QUf.js} +8 -8
  81. package/dist/{threeSceneView-B7qSJrwR.cjs → threeSceneView-CLF-6z2y.cjs} +1 -1
  82. package/dist/{threeSceneViewForCPMPIP-RT8liwZe.js → threeSceneViewForCPMPIP-BjV_TpZd.js} +7 -7
  83. package/dist/{threeSceneViewForCPMPIP-9yi6jiex.cjs → threeSceneViewForCPMPIP-wW_fS1HP.cjs} +1 -1
  84. package/dist/threeTrackPathView-BwlIgu4k.js +605 -0
  85. package/dist/threeTrackPathView-CjpKhUbd.cjs +1 -0
  86. package/dist/{threeViewerHost-DeU3hwnv.js → threeViewerHost-D3LMGTE2.js} +2 -2
  87. package/dist/{threeViewerHost-LpwVv2oj.cjs → threeViewerHost-EljVz9SK.cjs} +1 -1
  88. package/dist/{urdfTree-DLpxOUSk.js → urdfTree-C1_9e3Ka.js} +1 -1
  89. package/dist/{urdfTree-DE-KsOZc.cjs → urdfTree-W9sGK4ua.cjs} +1 -1
  90. package/dist/{workpieceTreePanel-D2M5yIk2.js → workpieceTreePanel-B5YNWinu.js} +47 -47
  91. package/dist/{workpieceTreePanel-D0Y23OeS.cjs → workpieceTreePanel-DrSgMdW9.cjs} +1 -1
  92. package/package.json +1 -1
  93. package/dist/iconfont-DU9A12zM.cjs +0 -1
  94. package/dist/index-B-6muHKY.cjs +0 -1
  95. package/dist/index-CRIDwb3u.cjs +0 -1
  96. package/dist/threeTrackPathView-DWGdVtPl.js +0 -1458
  97. package/dist/threeTrackPathView-cB27_BKX.cjs +0 -370
@@ -0,0 +1,605 @@
1
+ import { defineComponent as re, computed as L, ref as b, resolveComponent as j, createElementBlock as S, openBlock as V, createElementVNode as d, createVNode as p, withCtx as O, toDisplayString as D, shallowRef as N, watch as $e, onMounted as je, onBeforeUnmount as Ve, withDirectives as X, createCommentVNode as Q, unref as P, renderSlot as ie, createBlock as le, vShow as B } from "vue";
2
+ import { u as De, a as Ne, b as Xe, C as Be, f as Ie, d as ae } from "./iconfont-BXKkx1g6.js";
3
+ import { a1 as Y, _ as ee, aN as ce, aZ as ue, b3 as Oe, aP as Ye, b2 as Ze, a$ as qe, b0 as Ge, am as Ke, bO as Je } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DV9lk-8w.js";
4
+ import { E as I } from "./index-DIUrwul5.js";
5
+ import { U as We, J as He } from "./urdfTree-C1_9e3Ka.js";
6
+ import { l as Re } from "./loaderUtil-1wRb28no.js";
7
+ import { _ as fe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
8
+ import { T as w } from "./svgIcon-D-_fXUBL.js";
9
+ import { i as Qe } from "./isString-CN3i5s9o.js";
10
+ async function Se(e) {
11
+ return await Re(e);
12
+ }
13
+ function et(e, n) {
14
+ e.position.copy(n);
15
+ }
16
+ function tt(e, n, s = new Y(16711680)) {
17
+ const a = new ee();
18
+ n.getWorldPosition(a);
19
+ const l = e.geometry.attributes.position, t = e.geometry.attributes.color, o = new Y(55551);
20
+ let r = 1 / 0, f = -1;
21
+ for (let c = 0; c < l.count; c++) {
22
+ const v = new ee().fromBufferAttribute(l, c).distanceTo(a);
23
+ v < r && (r = v, f = c);
24
+ }
25
+ for (let c = 0; c < t.count; c++) o.toArray(t.array, c * 3);
26
+ if (f !== -1) {
27
+ const c = s.toArray(), m = f * 3 + 2;
28
+ for (let v = 0; v < m; v = v + 3)
29
+ t.array[v] = c[0], t.array[v + 1] = c[1], t.array[v + 2] = c[2];
30
+ }
31
+ t.needsUpdate = !0;
32
+ }
33
+ function ve(e, n, s, a = new Y(16711680)) {
34
+ et(e, n), tt(s, e, a);
35
+ }
36
+ const nt = { class: "panel-content" }, ot = { class: "animation-controls" }, st = { class: "control-row" }, it = { class: "control-row" }, lt = { class: "frame-info" }, at = { class: "control-row" }, rt = /* @__PURE__ */ re({
37
+ __name: "trackAnimationPanel",
38
+ props: {
39
+ cloud: {},
40
+ knife: {},
41
+ vectors: {}
42
+ },
43
+ emits: ["getThreeData"],
44
+ setup(e, { expose: n, emit: s }) {
45
+ const a = e, l = L(() => a.vectors), t = b(!1), o = b(0), r = b(100);
46
+ let f = !1;
47
+ const c = (g) => `第 ${g + 1} 帧`, m = (g) => {
48
+ if (g < 0 || g >= l.value.length) {
49
+ console.error(`帧索引 ${g} 超出范围`);
50
+ return;
51
+ }
52
+ const y = l.value[g];
53
+ o.value = g, ve(a.knife, y, a.cloud);
54
+ }, v = async () => {
55
+ if (l.value.length === 0) {
56
+ I.error("无法播放动画:无数据");
57
+ return;
58
+ }
59
+ if (!t.value) {
60
+ t.value = !0, f = !1, l.value.length - 1 === o.value && (o.value = 0);
61
+ try {
62
+ for (let g = o.value + 1; g < l.value.length && !f; g++)
63
+ await new Promise((y) => setTimeout(y, r.value)), m(g);
64
+ f || I.success("动画播放完成");
65
+ } catch (g) {
66
+ console.error("动画播放出错:", g);
67
+ } finally {
68
+ t.value = !1;
69
+ }
70
+ }
71
+ }, C = () => {
72
+ f = !0, t.value = !1, I.info("动画已停止");
73
+ }, A = (g) => {
74
+ t.value && C(), m(g);
75
+ }, z = () => {
76
+ t.value && C(), !(o.value + 1 >= l.value.length) && m(o.value + 1);
77
+ }, k = () => {
78
+ t.value && C(), o.value !== 0 && m(o.value - 1);
79
+ }, h = () => {
80
+ o.value = 0;
81
+ };
82
+ return n({ playAnimation: v, stopAnimation: C, forwardFrame: z, backwardFrame: k, resetAnimationFrame: h, reset: async () => {
83
+ await C(), h();
84
+ } }), (g, y) => {
85
+ const q = j("el-input-number"), G = j("el-form-item"), K = j("el-form"), J = j("el-slider");
86
+ return V(), S("div", nt, [
87
+ d("div", ot, [
88
+ d("div", st, [
89
+ p(K, {
90
+ "label-width": "auto",
91
+ style: { width: "100%" }
92
+ }, {
93
+ default: O(() => [
94
+ p(G, {
95
+ label: "帧间隔 (ms):",
96
+ prop: "frameDuration"
97
+ }, {
98
+ default: O(() => [
99
+ p(q, {
100
+ modelValue: r.value,
101
+ "onUpdate:modelValue": y[0] || (y[0] = (U) => r.value = U),
102
+ min: 0,
103
+ max: 5e3,
104
+ step: 10,
105
+ style: { width: "100%" }
106
+ }, null, 8, ["modelValue"])
107
+ ]),
108
+ _: 1
109
+ })
110
+ ]),
111
+ _: 1
112
+ })
113
+ ]),
114
+ d("div", it, [
115
+ y[2] || (y[2] = d("label", null, "当前帧:", -1)),
116
+ d("span", lt, D(o.value + 1) + " / " + D(l.value.length), 1)
117
+ ]),
118
+ d("div", at, [
119
+ y[3] || (y[3] = d("label", null, "动画进度:", -1)),
120
+ p(J, {
121
+ modelValue: o.value,
122
+ "onUpdate:modelValue": y[1] || (y[1] = (U) => o.value = U),
123
+ min: 0,
124
+ max: l.value.length > 0 ? l.value.length - 1 : 0,
125
+ step: 1,
126
+ "format-tooltip": c,
127
+ onInput: A,
128
+ disabled: l.value.length === 0,
129
+ style: { "flex-grow": "1", margin: "0 10px" }
130
+ }, null, 8, ["modelValue", "max", "disabled"])
131
+ ])
132
+ ])
133
+ ]);
134
+ };
135
+ }
136
+ }), ct = /* @__PURE__ */ fe(rt, [["__scopeId", "data-v-f6fc7a8c"]]);
137
+ function ut(e) {
138
+ const n = [];
139
+ return e.forEach((s) => {
140
+ const [a, l, t] = s.trim().split(/\s+/);
141
+ n.push(+a, +l, +t);
142
+ }), n;
143
+ }
144
+ function Z(e, n, s) {
145
+ switch (e) {
146
+ case "X":
147
+ n.x = +s || 0;
148
+ break;
149
+ case "Y":
150
+ n.y = +s || 0;
151
+ break;
152
+ case "Z":
153
+ n.z = +s || 0;
154
+ break;
155
+ }
156
+ }
157
+ function ft(e) {
158
+ const n = [], s = ["X", "Y", "Z"];
159
+ return e.forEach((a) => {
160
+ const l = {
161
+ x: 0,
162
+ y: 0,
163
+ z: 0
164
+ }, t = a.trim();
165
+ if (!t)
166
+ return;
167
+ let o = null, r = "";
168
+ for (let f = 0; f < (t == null ? void 0 : t.length); f++) {
169
+ const c = t[f], m = s.find((v) => v === c);
170
+ if (m) {
171
+ o && Z(o, l, r), r = "", o = m;
172
+ continue;
173
+ }
174
+ r = r + c;
175
+ }
176
+ Z(o, l, r), n.push(l.x, l.y, l.z);
177
+ }), n;
178
+ }
179
+ const vt = (e) => e == null ? void 0 : e.filter((s) => s.includes("=")), dt = (e) => e.replace(/,/g, ""), mt = (e) => e == null ? void 0 : e.map((s) => dt(s)), pt = (e) => {
180
+ const n = vt(e);
181
+ return mt(n);
182
+ };
183
+ function ht(e) {
184
+ const n = pt(e), s = [];
185
+ return n.forEach((a) => {
186
+ var v, C, A, z, k, h;
187
+ let [l, t, o, r] = a.trim().split(/\s+/);
188
+ t = (v = t == null ? void 0 : t.trim) == null ? void 0 : v.call(t), o = (C = o == null ? void 0 : o.trim) == null ? void 0 : C.call(o), r = (A = r == null ? void 0 : r.trim) == null ? void 0 : A.call(r);
189
+ const [, f] = (z = t == null ? void 0 : t.split) == null ? void 0 : z.call(t, "="), [, c] = (k = o == null ? void 0 : o.split) == null ? void 0 : k.call(o, "="), [, m] = (h = r == null ? void 0 : r.split) == null ? void 0 : h.call(r, "=");
190
+ s.push(+f, +c, +m);
191
+ }), s;
192
+ }
193
+ const gt = (e) => e >= "0" && e <= "9", yt = (e) => e === "+" || e === "-", Ct = (e) => e === ".";
194
+ function wt(e) {
195
+ return gt(e) || yt(e) || Ct(e);
196
+ }
197
+ function bt(e) {
198
+ const n = [], s = /* @__PURE__ */ new Set(["X", "Y", "Z"]);
199
+ return e.forEach((a) => {
200
+ const l = {
201
+ x: 0,
202
+ y: 0,
203
+ z: 0
204
+ }, t = a.trim();
205
+ if (!t)
206
+ return;
207
+ let o = null, r = "";
208
+ for (let f = 0; f < (t == null ? void 0 : t.length); f++) {
209
+ const c = t[f], m = s.has(c) ? c : null, v = wt(c);
210
+ if (m || !v) {
211
+ o && Z(o, l, r), o = m, r = "";
212
+ continue;
213
+ }
214
+ r = r + c;
215
+ }
216
+ o && Z(o, l, r), n.push(l.x, l.y, l.z);
217
+ }), n;
218
+ }
219
+ function kt(e) {
220
+ return e == null ? void 0 : e.includes("=");
221
+ }
222
+ async function _t(e) {
223
+ var l, t;
224
+ const n = (l = e == null ? void 0 : e.trim()) == null ? void 0 : l.split(/\r?\n/);
225
+ if (kt(e))
226
+ return ht(n);
227
+ const s = n == null ? void 0 : n[0], a = (t = s == null ? void 0 : s.trim()) == null ? void 0 : t.split(/\s+/);
228
+ if ((a == null ? void 0 : a.length) >= 3)
229
+ return ut(n);
230
+ if ((a == null ? void 0 : a.length) === 1)
231
+ return ft(n);
232
+ }
233
+ async function zt(e) {
234
+ const n = e.trim().split(/\r?\n/), s = [];
235
+ return n.forEach((a) => {
236
+ const l = a.trim().split(/\s+/);
237
+ if (l.length != 3)
238
+ return;
239
+ const [t, o, r] = l;
240
+ s.push(+t, +o, +r);
241
+ }), s;
242
+ }
243
+ async function Tt(e) {
244
+ const n = e.trim().split(/\r?\n/), s = [];
245
+ return n.forEach((a) => {
246
+ const l = a.trim().split(/\s+/);
247
+ if (l.length != 3)
248
+ return;
249
+ const [t, o, r] = l;
250
+ s.push(+t, +o, +r);
251
+ }), s;
252
+ }
253
+ async function Pt(e) {
254
+ let n = e.trim().split(/\r?\n/);
255
+ return n = n.filter((a) => {
256
+ const l = a.startsWith("X"), t = a.startsWith("G") && a.includes("X");
257
+ return l || t;
258
+ }), bt(n);
259
+ }
260
+ async function At(e, n) {
261
+ const { isCyd: s, isUv: a, isCpt: l, isNc: t } = n;
262
+ return a ? _t(e) : s ? Tt(e) : l ? zt(e) : t ? Pt(e) : [];
263
+ }
264
+ function xt(e) {
265
+ const n = [];
266
+ for (let s = 0; s < e.length; s += 3)
267
+ n.push(new ee(e[s], e[s + 1], e[s + 2]));
268
+ return n;
269
+ }
270
+ function Ft(e) {
271
+ const n = new ce();
272
+ n.setAttribute("position", new ue(e, 3));
273
+ const s = new Oe({
274
+ color: 55551,
275
+ linewidth: 3
276
+ });
277
+ return new Ye(n, s);
278
+ }
279
+ function Ut(e, n) {
280
+ if (!n || n.length < 3)
281
+ return;
282
+ const { scene: s, camera: a, renderer: l, controls: t } = e();
283
+ if (!s || !a || !l || !t)
284
+ return;
285
+ const o = Ft(n);
286
+ return o.name = "轨迹路径", s.add(o), o;
287
+ }
288
+ function Lt(e, n, s, a = 4, l = 50) {
289
+ let t = 1 / 0, o = -1 / 0, r = 1 / 0, f = -1 / 0, c = 1 / 0, m = -1 / 0;
290
+ for (let h = 0; h < e.length; h += 3) {
291
+ const M = e[h], g = e[h + 1], y = e[h + 2];
292
+ t = Math.min(t, M), o = Math.max(o, M), r = Math.min(r, g), f = Math.max(f, g), c = Math.min(c, y), m = Math.max(m, y);
293
+ }
294
+ const C = Math.sqrt((o - t) ** 2 + (f - r) ** 2 + (m - c) ** 2) * 0.05, A = Ke.degToRad(n.fov), z = 2 * Math.tan(A / 2) * l, k = C / z * s.domElement.height * (a / 4);
295
+ return Math.min(0.4, k);
296
+ }
297
+ function Mt(e) {
298
+ if (e.length % 3 !== 0)
299
+ return console.error("points array length is not a multiple of 3:", e), null;
300
+ const n = new ce();
301
+ n.setAttribute("position", new ue(e, 3));
302
+ const s = new Float32Array(e.length);
303
+ for (let t = 0; t < e.length; t += 3)
304
+ s[t] = 0, s[t + 1] = 0.847, s[t + 2] = 1;
305
+ n.setAttribute("color", new Ze(s, 3));
306
+ const a = new qe({
307
+ vertexColors: !0,
308
+ size: 0.4,
309
+ // 像素世界单位
310
+ sizeAttenuation: !0
311
+ }), l = new Ge(n, a);
312
+ return a.needsUpdate = !0, l;
313
+ }
314
+ function Et(e, n) {
315
+ if (!n)
316
+ return;
317
+ const { scene: s, camera: a, renderer: l, controls: t } = e();
318
+ if (!s || !a || !l || !t)
319
+ return;
320
+ const o = Mt(n);
321
+ if (!o)
322
+ return;
323
+ o.name = "轨迹路径", s.add(o);
324
+ const r = Lt(n, a, l, 0.1, 50);
325
+ return o.material.size = r, o;
326
+ }
327
+ const $t = { class: "obj-viewer-container" }, jt = { class: "buttonGroup-topLeft" }, Vt = { class: "buttonGroup-left" }, Dt = { class: "buttonGroup-right" }, Nt = { class: "buttonGroup-bottom" }, Xt = { class: "left-panel" }, Bt = { class: "panel-header" }, It = { class: "panel-body" }, Ot = { class: "right-panel" }, Yt = { class: "panel-header" }, Zt = { class: "panel-body" }, qt = {
328
+ key: 0,
329
+ class: "loading-overlay"
330
+ }, Gt = /* @__PURE__ */ re({
331
+ __name: "threeTrackPathView",
332
+ props: {
333
+ fileBlobs: {},
334
+ threeData: { default: () => "" },
335
+ trackFileType: {}
336
+ },
337
+ setup(e) {
338
+ const n = e, s = b(null), a = b(!1), l = b(""), t = b(), o = b(!1), r = b(""), f = b(!1), c = b(""), m = N(null), v = N(null), {
339
+ currentModels: C,
340
+ resetView: A,
341
+ initThreeJS: z,
342
+ handleResize: k,
343
+ getThreeJSObjects: h,
344
+ cleanup: M,
345
+ setModels: g,
346
+ setAndFitModels: y,
347
+ axesHelperVisible: q,
348
+ toggleAxesVisibility: G,
349
+ zoomIn: K,
350
+ zoomOut: J
351
+ } = De(s), { isAnimating: U, toggleAnimation: de, startAnimation: Kt, stopAnimation: me } = Ne(h, C), { isClipping: pe, activeClippingAxis: te, toggleClipping: he, updateClippingPlanes: ge } = Xe(h, C), ye = () => {
352
+ G();
353
+ }, Ce = (i) => {
354
+ te.value = i, ge();
355
+ }, W = (i) => {
356
+ o.value = !0, r.value = i, i === "剖面视图" && !pe.value && he();
357
+ }, H = (i) => {
358
+ f.value = !0, c.value = i;
359
+ }, R = b([]), E = b([]), we = L(() => {
360
+ var u;
361
+ return (u = n.trackFileType) == null ? void 0 : u.isUv;
362
+ }), be = L(() => {
363
+ var u;
364
+ return (u = n.trackFileType) == null ? void 0 : u.isCyd;
365
+ }), ke = L(() => {
366
+ var u;
367
+ return (u = n.trackFileType) == null ? void 0 : u.isCpt;
368
+ }), x = L(() => {
369
+ var u;
370
+ return (u = n.trackFileType) == null ? void 0 : u.isNc;
371
+ }), ne = L(() => {
372
+ const i = n.fileBlobs || [];
373
+ return i == null ? void 0 : i[0];
374
+ });
375
+ let _ = N(), F = N();
376
+ const _e = () => {
377
+ const { scene: i } = h();
378
+ _.value && i && (ae(_.value, i), _.value = null);
379
+ }, ze = () => {
380
+ const { scene: i } = h();
381
+ F.value && i && (ae(F.value, i), F.value = null);
382
+ }, oe = () => {
383
+ _e(), ze();
384
+ }, Te = async (i) => {
385
+ const u = URL.createObjectURL(i), $ = await Je(u);
386
+ if (URL.revokeObjectURL(u), Qe($)) {
387
+ R.value = await At($, n.trackFileType) || [];
388
+ const T = R.value;
389
+ we.value && (_.value = Ut(h, T)), (be.value || ke.value || x.value) && (_.value = Et(h, T));
390
+ }
391
+ }, Pe = async () => {
392
+ var i, u;
393
+ F.value = await Se("http://222.92.178.198:55002/CPMPIP/Cut/1_4%20Single%20Flute%20End%20Mill-Cut002.obj"), E.value = xt(R.value), E.value && E.value.length && (ve(F.value, E.value[0], _.value, new Y(16711680)), (u = (i = v.value) == null ? void 0 : i.add) == null || u.call(i, F.value));
394
+ }, se = async (i) => {
395
+ oe(), await Te(i), _.value && Ie(h, _.value), x.value && Pe();
396
+ };
397
+ $e(() => ne.value, async (i) => {
398
+ i && await se(i);
399
+ }, {
400
+ immediate: !0,
401
+ deep: !0
402
+ });
403
+ const Ae = async () => {
404
+ var i;
405
+ await ((i = t == null ? void 0 : t.value) == null ? void 0 : i.reset()), await se(ne.value);
406
+ }, xe = () => {
407
+ var i;
408
+ x.value && ((i = t == null ? void 0 : t.value) == null || i.playAnimation());
409
+ }, Fe = () => {
410
+ var i;
411
+ x.value && ((i = t == null ? void 0 : t.value) == null || i.stopAnimation());
412
+ }, Ue = () => {
413
+ var i;
414
+ x.value && ((i = t == null ? void 0 : t.value) == null || i.forwardFrame());
415
+ }, Le = () => {
416
+ var i;
417
+ x.value && ((i = t == null ? void 0 : t.value) == null || i.backwardFrame());
418
+ }, Me = () => {
419
+ z(), window.addEventListener("resize", k);
420
+ const i = h();
421
+ v.value = i.scene, v.value && (v.value.name = "CPMPIP");
422
+ }, Ee = () => {
423
+ window.removeEventListener("resize", k), U.value && me(), oe(), M();
424
+ };
425
+ return je(async () => {
426
+ try {
427
+ Me();
428
+ } catch (i) {
429
+ console.error("Three.js 初始化失败:", i), I.error("渲染引擎初始化失败!");
430
+ }
431
+ }), Ve(() => {
432
+ Ee();
433
+ }), (i, u) => {
434
+ const $ = j("el-scrollbar");
435
+ return V(), S("div", $t, [
436
+ d("div", {
437
+ ref_key: "threejsContainer",
438
+ ref: s,
439
+ class: "threejs-container"
440
+ }, null, 512),
441
+ d("div", jt, [
442
+ p(w, {
443
+ name: "viewReset",
444
+ size: "24",
445
+ onClick: Ae,
446
+ title: "重置"
447
+ }),
448
+ p(w, {
449
+ name: "fangda",
450
+ size: "24",
451
+ title: "放大",
452
+ onClick: P(K)
453
+ }, null, 8, ["onClick"]),
454
+ p(w, {
455
+ name: "suoxiao",
456
+ size: "24",
457
+ title: "缩小",
458
+ onClick: P(J)
459
+ }, null, 8, ["onClick"]),
460
+ p(w, {
461
+ name: "lookAround",
462
+ size: "24",
463
+ onClick: P(de),
464
+ title: P(U) ? "停止动画" : "动画视图"
465
+ }, null, 8, ["onClick", "title"]),
466
+ p(w, {
467
+ name: "zuobiaoxi",
468
+ size: "24",
469
+ active: P(q),
470
+ onClick: ye,
471
+ title: "显隐坐标轴"
472
+ }, null, 8, ["active"])
473
+ ]),
474
+ d("div", Vt, [
475
+ ie(i.$slots, "button-left", { switchRightPanel: W }, void 0, !0),
476
+ p(w, {
477
+ name: "jiegoushu",
478
+ size: "24",
479
+ onClick: u[0] || (u[0] = (T) => W("场景树")),
480
+ active: o.value && r.value === "场景树",
481
+ title: "场景树"
482
+ }, null, 8, ["active"]),
483
+ p(w, {
484
+ name: "clipping",
485
+ size: "24",
486
+ onClick: u[1] || (u[1] = (T) => W("剖面视图")),
487
+ active: o.value && r.value === "剖面视图",
488
+ title: "剖面视图"
489
+ }, null, 8, ["active"])
490
+ ]),
491
+ d("div", Dt, [
492
+ ie(i.$slots, "button-right", { switchRightPanel: H }, void 0, !0),
493
+ p(w, {
494
+ name: "guanjiekongzhi",
495
+ size: "24",
496
+ onClick: u[2] || (u[2] = (T) => H("关节控制")),
497
+ active: f.value && c.value === "关节控制",
498
+ title: "关节控制"
499
+ }, null, 8, ["active"]),
500
+ p(w, {
501
+ name: "donghuafangzhen",
502
+ size: "24",
503
+ title: "动画仿真",
504
+ onClick: u[3] || (u[3] = (T) => H("动画仿真")),
505
+ active: f.value && c.value === "动画仿真"
506
+ }, null, 8, ["active"])
507
+ ]),
508
+ d("div", Nt, [
509
+ p(w, {
510
+ name: "kuaitui",
511
+ size: "24",
512
+ backgroundColor: "#ffffff",
513
+ title: "快退",
514
+ onClick: Le
515
+ }),
516
+ p(w, {
517
+ name: "bofang",
518
+ size: "24",
519
+ backgroundColor: "#ffffff",
520
+ title: "播放",
521
+ onClick: xe
522
+ }),
523
+ p(w, {
524
+ name: "kuaijin",
525
+ size: "24",
526
+ backgroundColor: "#ffffff",
527
+ title: "快进",
528
+ onClick: Ue
529
+ }),
530
+ p(w, {
531
+ name: "zanting",
532
+ size: "24",
533
+ backgroundColor: "#ffffff",
534
+ title: "暂停",
535
+ onClick: Fe
536
+ })
537
+ ]),
538
+ X(d("div", Xt, [
539
+ d("div", Bt, [
540
+ d("span", null, D(r.value), 1),
541
+ d("span", {
542
+ class: "close",
543
+ onClick: u[4] || (u[4] = (T) => o.value = !1)
544
+ }, " X ")
545
+ ]),
546
+ d("div", It, [
547
+ p($, { height: "100%" }, {
548
+ default: O(() => [
549
+ r.value === "场景树" ? (V(), le(We, {
550
+ key: 0,
551
+ model: m.value
552
+ }, null, 8, ["model"])) : Q("", !0),
553
+ r.value === "剖面视图" ? (V(), le(Be, {
554
+ key: 1,
555
+ value: P(te),
556
+ onChange: Ce
557
+ }, null, 8, ["value"])) : Q("", !0)
558
+ ]),
559
+ _: 1
560
+ })
561
+ ])
562
+ ], 512), [
563
+ [B, o.value]
564
+ ]),
565
+ X(d("div", Ot, [
566
+ d("div", Yt, [
567
+ d("span", null, D(c.value), 1),
568
+ d("span", {
569
+ class: "close",
570
+ onClick: u[5] || (u[5] = (T) => f.value = !1)
571
+ }, " X ")
572
+ ]),
573
+ d("div", Zt, [
574
+ p($, { height: "100%" }, {
575
+ default: O(() => [
576
+ X(p(He, { model: m.value }, null, 8, ["model"]), [
577
+ [B, c.value === "关节控制"]
578
+ ]),
579
+ X(p(ct, {
580
+ ref_key: "animationPanelRef",
581
+ ref: t,
582
+ cloud: P(_),
583
+ knife: P(F),
584
+ vectors: E.value
585
+ }, null, 8, ["cloud", "knife", "vectors"]), [
586
+ [B, c.value === "动画仿真" && x.value]
587
+ ])
588
+ ]),
589
+ _: 1
590
+ })
591
+ ])
592
+ ], 512), [
593
+ [B, f.value]
594
+ ]),
595
+ a.value ? (V(), S("div", qt, [
596
+ u[6] || (u[6] = d("div", { class: "loading-spinner" }, null, -1)),
597
+ d("p", null, D(l.value), 1)
598
+ ])) : Q("", !0)
599
+ ]);
600
+ };
601
+ }
602
+ }), on = /* @__PURE__ */ fe(Gt, [["__scopeId", "data-v-d3474f33"]]);
603
+ export {
604
+ on as default
605
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),z=require("./iconfont-Bi9FnKuf.cjs"),g=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-D_eVz0Sp.cjs"),M=require("./index-C8qRkCgn.cjs"),G=require("./urdfTree-W9sGK4ua.cjs"),he=require("./loaderUtil-Cq8QCp9W.cjs"),K=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CUM54R6L.cjs"),ge=require("./isString--eJE54G5.cjs");async function ye(t){return await he.loadObjByUrl(t)}function Ce(t,o){t.position.copy(o)}function we(t,o,l=new g.Color(16711680)){const a=new g.Vector3;o.getWorldPosition(a);const s=t.geometry.attributes.position,n=t.geometry.attributes.color,r=new g.Color(55551);let c=1/0,f=-1;for(let u=0;u<s.count;u++){const v=new g.Vector3().fromBufferAttribute(s,u).distanceTo(a);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)r.toArray(n.array,u*3);if(f!==-1){const u=l.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,l,a=new g.Color(16711680)){Ce(t,o),we(l,t,a)}const ke={class:"panel-content"},_e={class:"animation-controls"},Ve={class:"control-row"},be={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:l}){const a=t,s=e.computed(()=>a.vectors),n=e.ref(!1),r=e.ref(0),c=e.ref(100);let f=!1;const u=h=>`第 ${h+1} 帧`,m=h=>{if(h<0||h>=s.value.length){console.error(`帧索引 ${h} 超出范围`);return}const y=s.value[h];r.value=h,S(a.knife,y,a.cloud)},v=async()=>{if(s.value.length===0){M.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,s.value.length-1===r.value&&(r.value=0);try{for(let h=r.value+1;h<s.value.length&&!f;h++)await new Promise(y=>setTimeout(y,c.value)),m(h);f||M.ElMessage.success("动画播放完成")}catch(h){console.error("动画播放出错:",h)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,M.ElMessage.info("动画已停止")},N=h=>{n.value&&C(),m(h)},V=()=>{n.value&&C(),!(r.value+1>=s.value.length)&&m(r.value+1)},k=()=>{n.value&&C(),r.value!==0&&m(r.value-1)},p=()=>{r.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:V,backwardFrame:k,resetAnimationFrame:p,reset:async()=>{await C(),p()}}),(h,y)=>{const U=e.resolveComponent("el-input-number"),L=e.resolveComponent("el-form-item"),B=e.resolveComponent("el-form"),D=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",Ve,[e.createVNode(B,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(L,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(U,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=x=>c.value=x),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",be,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(r.value+1)+" / "+e.toDisplayString(s.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode(D,{modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=x=>r.value=x),min:0,max:s.value.length>0?s.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:s.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),ze=K._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function xe(t){const o=[];return t.forEach(l=>{const[a,s,n]=l.trim().split(/\s+/);o.push(+a,+s,+n)}),o}function I(t,o,l){switch(t){case"X":o.x=+l||0;break;case"Y":o.y=+l||0;break;case"Z":o.z=+l||0;break}}function Ae(t){const o=[],l=["X","Y","Z"];return t.forEach(a=>{const s={x:0,y:0,z:0},n=a.trim();if(!n)return;let r=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=l.find(v=>v===u);if(m){r&&I(r,s,c),c="",r=m;continue}c=c+u}I(r,s,c),o.push(s.x,s.y,s.z)}),o}const Pe=t=>t==null?void 0:t.filter(l=>l.includes("=")),Fe=t=>t.replace(/,/g,""),Me=t=>t==null?void 0:t.map(l=>Fe(l)),Ie=t=>{const o=Pe(t);return Me(o)};function Ue(t){const o=Ie(t),l=[];return o.forEach(a=>{var v,C,N,V,k,p;let[s,n,r,c]=a.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),r=(C=r==null?void 0:r.trim)==null?void 0:C.call(r),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(V=n==null?void 0:n.split)==null?void 0:V.call(n,"="),[,u]=(k=r==null?void 0:r.split)==null?void 0:k.call(r,"="),[,m]=(p=c==null?void 0:c.split)==null?void 0:p.call(c,"=");l.push(+f,+u,+m)}),l}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function je(t){return Le(t)||Be(t)||De(t)}function $e(t){const o=[],l=new Set(["X","Y","Z"]);return t.forEach(a=>{const s={x:0,y:0,z:0},n=a.trim();if(!n)return;let r=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=l.has(u)?u:null,v=je(u);if(m||!v){r&&I(r,s,c),r=m,c="";continue}c=c+u}r&&I(r,s,c),o.push(s.x,s.y,s.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var s,n;const o=(s=t==null?void 0:t.trim())==null?void 0:s.split(/\r?\n/);if(qe(t))return Ue(o);const l=o==null?void 0:o[0],a=(n=l==null?void 0:l.trim())==null?void 0:n.split(/\s+/);if((a==null?void 0:a.length)>=3)return xe(o);if((a==null?void 0:a.length)===1)return Ae(o)}async function Oe(t){const o=t.trim().split(/\r?\n/),l=[];return o.forEach(a=>{const s=a.trim().split(/\s+/);if(s.length!=3)return;const[n,r,c]=s;l.push(+n,+r,+c)}),l}async function Ye(t){const o=t.trim().split(/\r?\n/),l=[];return o.forEach(a=>{const s=a.trim().split(/\s+/);if(s.length!=3)return;const[n,r,c]=s;l.push(+n,+r,+c)}),l}async function Ze(t){let o=t.trim().split(/\r?\n/);return o=o.filter(a=>{const s=a.startsWith("X"),n=a.startsWith("G")&&a.includes("X");return s||n}),$e(o)}async function Ge(t,o){const{isCyd:l,isUv:a,isCpt:s,isNc:n}=o;return a?Xe(t):l?Ye(t):s?Oe(t):n?Ze(t):[]}function Ke(t){const o=[];for(let l=0;l<t.length;l+=3)o.push(new g.Vector3(t[l],t[l+1],t[l+2]));return o}function Se(t){const o=new g.BufferGeometry;o.setAttribute("position",new g.Float32BufferAttribute(t,3));const l=new g.LineBasicMaterial({color:55551,linewidth:3});return new g.Line(o,l)}function Re(t,o){if(!o||o.length<3)return;const{scene:l,camera:a,renderer:s,controls:n}=t();if(!l||!a||!s||!n)return;const r=Se(o);return r.name="轨迹路径",l.add(r),r}function He(t,o,l,a=4,s=50){let n=1/0,r=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let p=0;p<t.length;p+=3){const A=t[p],h=t[p+1],y=t[p+2];n=Math.min(n,A),r=Math.max(r,A),c=Math.min(c,h),f=Math.max(f,h),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((r-n)**2+(f-c)**2+(m-u)**2)*.05,N=g.MathUtils.degToRad(o.fov),V=2*Math.tan(N/2)*s,k=C/V*l.domElement.height*(a/4);return Math.min(.4,k)}function Je(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new g.BufferGeometry;o.setAttribute("position",new g.Float32BufferAttribute(t,3));const l=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)l[n]=0,l[n+1]=.847,l[n+2]=1;o.setAttribute("color",new g.BufferAttribute(l,3));const a=new g.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),s=new g.Points(o,a);return a.needsUpdate=!0,s}function We(t,o){if(!o)return;const{scene:l,camera:a,renderer:s,controls:n}=t();if(!l||!a||!s||!n)return;const r=Je(o);if(!r)return;r.name="轨迹路径",l.add(r);const c=He(o,a,s,.1,50);return r.material.size=c,r}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"},it={class:"panel-body"},st={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,l=e.ref(null),a=e.ref(!1),s=e.ref(""),n=e.ref(),r=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:V,handleResize:k,getThreeJSObjects:p,cleanup:A,setModels:h,setAndFitModels:y,axesHelperVisible:U,toggleAxesVisibility:L,zoomIn:B,zoomOut:D}=z.useThreeJS(l),{isAnimating:x,toggleAnimation:R,startAnimation:vt,stopAnimation:H}=z.useAnimation(p,C),{isClipping:J,activeClippingAxis:X,toggleClipping:W,updateClippingPlanes:Q}=z.useClipping(p,C),ee=()=>{L()},te=i=>{X.value=i,Q()},j=i=>{r.value=!0,c.value=i,i==="剖面视图"&&!J.value&&W()},$=i=>{f.value=!0,u.value=i},q=e.ref([]),P=e.ref([]),ne=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),re=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}),O=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let _=e.shallowRef(),E=e.shallowRef();const le=()=>{const{scene:i}=p();_.value&&i&&(z.disposeObj(_.value,i),_.value=null)},ie=()=>{const{scene:i}=p();E.value&&i&&(z.disposeObj(E.value,i),E.value=null)},Y=()=>{le(),ie()},se=async i=>{const d=URL.createObjectURL(i),F=await g.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(F)){q.value=await Ge(F,o.trackFileType)||[];const b=q.value;ne.value&&(_.value=Re(p,b)),(oe.value||re.value||T.value)&&(_.value=We(p,b))}},ae=async()=>{var i,d;E.value=await ye("http://222.92.178.198:55002/CPMPIP/Cut/1_4%20Single%20Flute%20End%20Mill-Cut002.obj"),P.value=Ke(q.value),P.value&&P.value.length&&(S(E.value,P.value[0],_.value,new g.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},Z=async i=>{Y(),await se(i),_.value&&z.frameCameraToObject3D(p,_.value),T.value&&ae()};e.watch(()=>O.value,async i=>{i&&await Z(i)},{immediate:!0,deep:!0});const ce=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await Z(O.value)},ue=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},me=()=>{V(),window.addEventListener("resize",k);const i=p();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},pe=()=>{window.removeEventListener("resize",k),x.value&&H(),Y(),A()};return e.onMounted(async()=>{try{me()}catch(i){console.error("Three.js 初始化失败:",i),M.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{pe()}),(i,d)=>{const F=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:l,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ce,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(B)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(R),title:e.unref(x)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(U),onClick:ee,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]=b=>j("场景树")),active:r.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=b=>j("剖面视图")),active:r.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:$},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=b=>$("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=b=>$("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:ue}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:fe}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:de})]),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]=b=>r.value=!1)}," X ")]),e.createElementVNode("div",it,[e.createVNode(F,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(G.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(z.ClippingPanel,{key:1,value:e.unref(X),onChange:te},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,r.value]]),e.withDirectives(e.createElementVNode("div",st,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=b=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(F,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(G.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(ze,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(_),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),a.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(s.value),1)])):e.createCommentVNode("",!0)])}}}),ft=K._export_sfc(dt,[["__scopeId","data-v-d3474f33"]]);exports.default=ft;
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as U, defineAsyncComponent as S, computed as I, ref as R, watch as H, createElementBlock as N, openBlock as T, createElementVNode as K, createBlock as B, createCommentVNode as V, renderSlot as u, unref as m, withCtx as d } from "vue";
2
2
  import { bS as W, p as D, s as A } from "./index-DIUrwul5.js";
3
3
  import { u as $ } from "./index-AIq5wzuR.js";
4
- import { b as j, aI as M, aJ as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dgy71NC0.js";
4
+ import { b as j, aI as M, aJ as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DV9lk-8w.js";
5
5
  import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
6
6
  const se = {
7
7
  SINGLE: "单机",
@@ -113,7 +113,7 @@ const Y = { class: "three-platform mv-inline" }, q = { class: "top-menu" }, Q =
113
113
  height: { default: "100%" }
114
114
  },
115
115
  setup(E) {
116
- const O = S(() => import("./threeSceneView-D18FzdLv.js")), y = S(() => import("./threePreview-BgJvhDAL.js")), i = S(() => import("./threeTrackPathView-DWGdVtPl.js")), p = S(() => import("./threeSceneViewForCPMPIP-RT8liwZe.js")), n = E, P = $(D), { platName: f } = A(P), { isUrdf: _, isTrackPathFile: g } = J(), c = I(() => {
116
+ const O = S(() => import("./threeSceneView-BVK89QUf.js")), y = S(() => import("./threePreview-B-BL8PZx.js")), i = S(() => import("./threeTrackPathView-BwlIgu4k.js")), p = S(() => import("./threeSceneViewForCPMPIP-BjV_TpZd.js")), n = E, P = $(D), { platName: f } = A(P), { isUrdf: _, isTrackPathFile: g } = J(), c = I(() => {
117
117
  var t;
118
118
  return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
119
119
  const { url: e } = s;