ss-component-new 1.3.615 → 1.3.617

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 (74) hide show
  1. package/dist/{MTLLoader-BL2uYkTJ.js → MTLLoader-B6ottYFV.js} +2 -2
  2. package/dist/{OrbitControls-Zyj23qrC.js → OrbitControls-BFVKU7s-.js} +1 -1
  3. package/dist/{URDFLoader-CRx5L75v.js → URDFLoader-CH-7Pzmq.js} +589 -584
  4. package/dist/{animationData-CJQE6_nu.js → animationData-F0z3GN7j.js} +3 -3
  5. package/dist/{array-CKTk7Sq_.js → array-CQiszLQE.js} +13 -14
  6. package/dist/{clone-ESeDvnJv.js → clone-MyfSNInd.js} +1 -1
  7. package/dist/{eleIcon-C7Pz9jha.js → eleIcon-BoKZ_PzU.js} +2 -2
  8. package/dist/{iconfont-DZGSkx-_.js → iconfont-BJYdStg5.js} +396 -247
  9. package/dist/{index-gXFBfuoD.js → index-0zQirLAy.js} +8 -8
  10. package/dist/{index-BvkIoiVW.js → index-6qXeMn6b.js} +3 -3
  11. package/dist/{index-obXIOkF7.js → index-8OmAlKII.js} +4 -4
  12. package/dist/{index-BXh02EAd.js → index-B2LYEScO.js} +4 -4
  13. package/dist/{index-YvUJL9Us.js → index-B4NcYIuS.js} +1 -1
  14. package/dist/{index-D8UY4uNQ.js → index-B8NQAdR4.js} +966 -967
  15. package/dist/{index-rlStojTL.js → index-BFqUz4pN.js} +1 -1
  16. package/dist/{index-t9LvhXac.js → index-BHtLrI43.js} +5 -5
  17. package/dist/{index--FPbFJB2.js → index-BODochNh.js} +6 -6
  18. package/dist/{index-CPW7tdrA.js → index-BkkvdZXm.js} +17 -20
  19. package/dist/{index-B0M1YCUY.js → index-BvtOLltL.js} +7 -7
  20. package/dist/{index-DsdWSuDi.js → index-BvyM6d06.js} +482 -483
  21. package/dist/{index-CX8Apbo7.js → index-BybrpYzx.js} +1 -1
  22. package/dist/{index-BJFXtH-X.js → index-CAMjP0It.js} +3 -3
  23. package/dist/{index-tMqKF2l6.js → index-CM6aWexA.js} +2 -2
  24. package/dist/{index-BBBCr4Oo.js → index-CT1LWsrT.js} +2 -2
  25. package/dist/{index-CTicGWoS.js → index-CXqqIuf-.js} +3 -3
  26. package/dist/{index-D9xMYIes.js → index-CYjsE5Gs.js} +3 -3
  27. package/dist/{index-B_fRppeJ.js → index-CkO7j_i1.js} +8 -8
  28. package/dist/{index-cYgzND1g.js → index-CnCBS4CT.js} +16268 -16240
  29. package/dist/{index-DlQXFCw8.js → index-CvZcm-Tt.js} +7 -8
  30. package/dist/{index-tniD_xHN.js → index-D2BpwRDj.js} +148 -157
  31. package/dist/{index-DAs4L0hx.js → index-D43kQTBs.js} +6973 -6531
  32. package/dist/{index-DjSJhlad.js → index-D56uKIwO.js} +60 -62
  33. package/dist/{index-XvX6TMzr.js → index-DCY5J8nu.js} +1 -1
  34. package/dist/{index-C3pboX9W.js → index-DIVct0z6.js} +5 -5
  35. package/dist/{index-Dd-8nw2f.js → index-DIzunSUT.js} +18 -20
  36. package/dist/{index-11kpzK0A.js → index-DJrzqi4-.js} +17 -17
  37. package/dist/{index-Cn33Gz2z.js → index-DSrPdLF-.js} +587 -616
  38. package/dist/{index-BUqviBFi.js → index-DcPtyCDm.js} +29 -35
  39. package/dist/{index-D1E8EPxn.js → index-DmILGKv9.js} +57 -61
  40. package/dist/{index-BA1kJZth.js → index-aTEfnfYn.js} +36 -40
  41. package/dist/{index-BHtNKL1L.js → index-dD-mKgue.js} +2 -2
  42. package/dist/{index-DkumSU1-.js → index-hg0CdgKe.js} +4 -4
  43. package/dist/index-mjGbAjJz.js +2623 -0
  44. package/dist/{index.vue_vue_type_script_setup_true_lang-DRzriV-s.js → index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js} +2 -2
  45. package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js} +27760 -27735
  46. package/dist/isString-Dxm3W5iX.js +8 -0
  47. package/dist/{localIcon-D5UoFBU5.js → localIcon-CoJHw5ss.js} +1 -1
  48. package/dist/{main-DgwLoFSd.js → main-BDvWHXas.js} +9 -9
  49. package/dist/{menuIndex-DAW9B-9g.js → menuIndex-BiUB7t5q.js} +1 -1
  50. package/dist/{request-B1c8BUkR.js → request-BfrhYBTM.js} +3480 -3062
  51. package/dist/ss-component.css +3 -3
  52. package/dist/ss-component.js +14 -14
  53. package/dist/ss-component2.js +13 -13
  54. package/dist/ss-component3.js +1 -1
  55. package/dist/svgIcon-4m2zaZkj.js +42 -0
  56. package/dist/{threeModel-Df46gQvy.js → threeModel-B7guecMM.js} +174 -174
  57. package/dist/{threePreview-C4Ra7sjU.js → threePreview-CpcrqmFS.js} +554 -554
  58. package/dist/threeSceneView-CWTmvCY4.js +1290 -0
  59. package/dist/{threeSceneViewForCPMPIP-DZ5wkTWo.js → threeSceneViewForCPMPIP-VzWmr9CP.js} +207 -208
  60. package/dist/{threeTrackPathView-DT80eKxv.js → threeTrackPathView-Bw6e-quT.js} +25 -25
  61. package/dist/{threeViewerHost-t6BRTmw8.js → threeViewerHost-DIiGjw_8.js} +4 -4
  62. package/dist/urdfTree-DU02c_91.js +254 -0
  63. package/dist/{workpieceTreePanel-CuXFoEjJ.js → workpieceTreePanel-XH9mYAT2.js} +56 -60
  64. package/package.json +1 -1
  65. package/dist/JSEncrypt-B36c1iN5.js +0 -1983
  66. package/dist/index-BmaW6Me9.js +0 -572
  67. package/dist/isString-BlNsHiyU.js +0 -8
  68. package/dist/obj/model.mtl +0 -42
  69. package/dist/obj/model.obj +0 -26110
  70. package/dist/svgIcon-4u4PW7Is.js +0 -42
  71. package/dist/threeSceneView-tLPMhgrS.js +0 -1291
  72. package/dist/urdfTree-Bu7OVUsr.js +0 -404
  73. package/public/obj/model.mtl +0 -42
  74. package/public/obj/model.obj +0 -26110
@@ -0,0 +1,1290 @@
1
+ import { defineComponent as Le, ref as h, watch as ae, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as U, openBlock as Q, createElementBlock as Ve, createElementVNode as u, createVNode as l, withCtx as M, createBlock as ye, unref as X, createCommentVNode as ke, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as He, renderList as qe, nextTick as Ke, withDirectives as pe, vShow as de, renderSlot as Me } from "vue";
2
+ import { r as Te, s as Ye } from "./threeViewerHost-DIiGjw_8.js";
3
+ import { u as Ne, a as Qe, b as et, C as tt } from "./iconfont-BJYdStg5.js";
4
+ import { U as lt, u as ot, W as nt, a as at } from "./workpieceTreePanel-XH9mYAT2.js";
5
+ import { c as st } from "./index-B8NQAdR4.js";
6
+ import { av as it, E as j, aM as rt, aN as ct } from "./request-BfrhYBTM.js";
7
+ /* empty css */
8
+ import { o as De, T as xe, V as D, n as H, s as ut, p as pt, h as Se, t as dt, L as mt, u as vt, v as ft, w as gt, x as ht, y as bt, z as yt, l as _t, F as wt } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js";
9
+ import "./index-CnCBS4CT.js";
10
+ import "./index-dD-mKgue.js";
11
+ import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js";
12
+ import { y as Be, z as Ct, A as kt } from "./index-BvyM6d06.js";
13
+ import "./index-mjGbAjJz.js";
14
+ import "./index-CYjsE5Gs.js";
15
+ import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-F0z3GN7j.js";
16
+ import { g as Tt, a as Vt, b as Dt, c as St, U as At, J as $t } from "./urdfTree-DU02c_91.js";
17
+ import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
+ import { s as Ft } from "./index-DJrzqi4-.js";
19
+ import { T as Y } from "./svgIcon-4m2zaZkj.js";
20
+ const I = 1e-3, oe = pt.degToRad, je = new dt({
21
+ // 灰色
22
+ color: 13421772,
23
+ metalness: 0.3,
24
+ roughness: 0.6,
25
+ side: _t
26
+ });
27
+ function zt(y = 5e-3, v = 64) {
28
+ const d = new De([new D(0, 0, 0), new D(0, 0, 0)]), n = new xe(d, v, y, 16, !1), m = je;
29
+ return new Se(n, m);
30
+ }
31
+ const Je = (y) => y.reduce((v, d) => {
32
+ let n = 0;
33
+ const m = d.Y ?? 0, _ = d.C ?? 0, s = d.R ?? 0;
34
+ return m > 0 && (n += m), _ > 0 && s > 0 && (n += s * oe(_)), v + n;
35
+ }, 0), We = (y) => {
36
+ const v = [], d = y.Y ?? 0, n = y.B ?? 0, m = y.C ?? 0, _ = y.R ?? 0, s = {
37
+ pos: new D(0, 0, 0),
38
+ localY: new D(0, 1, 0),
39
+ localX: new D(1, 0, 0),
40
+ localZ: new D(0, 0, 1)
41
+ };
42
+ if (!d && !m) return v;
43
+ if (v.push(s.pos.clone()), n !== 0) {
44
+ const b = new H().makeRotationAxis(s.localY, oe(n));
45
+ s.localX.applyMatrix4(b), s.localZ.applyMatrix4(b);
46
+ }
47
+ if (d > 0 && (s.pos.add(s.localY.clone().multiplyScalar(d * I)), v.push(s.pos.clone())), m > 0 && _ > 0) {
48
+ const b = oe(m), f = _ * I, w = s.pos.clone().add(s.localX.clone().multiplyScalar(-f)), a = Math.max(16, Math.ceil(m / 5));
49
+ for (let C = 1; C <= a; C++) {
50
+ const p = b * C / a, k = new H().makeRotationAxis(s.localZ, p), c = s.localX.clone().multiplyScalar(f).applyMatrix4(k), T = w.clone().add(c);
51
+ v.push(T);
52
+ }
53
+ }
54
+ return v;
55
+ };
56
+ function Yt(y, v) {
57
+ const d = new ut();
58
+ d.name = "CompletePipe";
59
+ const n = {
60
+ pos: new D(0, 0, 0),
61
+ localX: new D(1, 0, 0),
62
+ localY: new D(0, 1, 0),
63
+ localZ: new D(0, 0, 1)
64
+ };
65
+ let m = 0, _ = 1;
66
+ for (let s = 0; s < y.length; s++) {
67
+ const b = y[s], f = b.Y ?? 0, w = b.B ?? 0, a = b.C ?? 0, C = b.R ?? 0;
68
+ if (w !== 0) {
69
+ const p = new H().makeRotationAxis(n.localY, oe(w));
70
+ n.localX.applyMatrix4(p), n.localZ.applyMatrix4(p);
71
+ }
72
+ if (f > 0) {
73
+ const p = n.pos.clone();
74
+ n.pos.add(n.localY.clone().multiplyScalar(f * I));
75
+ const k = n.pos.clone(), r = Lt(p, k, v * I);
76
+ r.userData = {
77
+ segmentType: "straight",
78
+ segmentIndex: m,
79
+ frameIndex: s,
80
+ length: f,
81
+ frame: { Y: f, B: w, C: a, R: C }
82
+ }, r.name = `直段_${m}`, d.add(r);
83
+ const c = p.clone();
84
+ Bt(d, _, c, v * I), m++;
85
+ }
86
+ if (a > 0 && C > 0) {
87
+ const p = oe(a), k = C * I, r = [];
88
+ r.push(n.pos.clone());
89
+ const c = n.pos.clone().add(n.localX.clone().multiplyScalar(-k)), T = Math.max(16, Math.ceil(a / 5));
90
+ for (let g = 1; g <= T; g++) {
91
+ const V = p * g / T, B = new H().makeRotationAxis(n.localZ, V), Z = n.localX.clone().multiplyScalar(k).applyMatrix4(B), ee = c.clone().add(Z);
92
+ r.push(ee);
93
+ }
94
+ const A = Ut(r, v * I);
95
+ A.userData = {
96
+ segmentType: "bend",
97
+ segmentIndex: m,
98
+ frameIndex: s,
99
+ angle: a,
100
+ radius: C,
101
+ centerPoint: c.toArray(),
102
+ frame: { Y: f, B: w, C: a, R: C }
103
+ }, A.name = `弯段_${m}`, d.add(A), Math.floor(r.length / 2), r[0], n.pos = r[r.length - 1].clone();
104
+ const $ = new H().makeRotationAxis(n.localZ, p);
105
+ n.localY.applyMatrix4($), n.localX.applyMatrix4($), m++, _++;
106
+ }
107
+ }
108
+ return d;
109
+ }
110
+ function Bt(y, v, d, n) {
111
+ const m = new D(0, n * 2, n * 5), _ = d.clone().add(m), s = [d, _], b = new vt().setFromPoints(s), f = new ft({
112
+ color: 16711680,
113
+ dashSize: n * 0.5,
114
+ gapSize: n * 0.3,
115
+ linewidth: 1
116
+ }), w = new gt(b, f);
117
+ w.computeLineDistances(), y.add(w);
118
+ const a = document.createElement("canvas"), C = a.getContext("2d");
119
+ a.width = 128, a.height = 128, C.clearRect(0, 0, 128, 128), C.fillStyle = "#FF0000", C.font = "bold 80px Arial", C.textAlign = "center", C.textBaseline = "middle", C.fillText(v.toString(), 64, 64);
120
+ const p = new ht(a), k = new bt({
121
+ map: p,
122
+ transparent: !0,
123
+ depthTest: !1,
124
+ depthWrite: !1
125
+ }), r = new yt(k), c = n * 3;
126
+ r.scale.set(c, c, 1), r.position.copy(_), r.name = `Label_${v}`, r.userData = { labelNumber: v }, y.add(r);
127
+ }
128
+ function Lt(y, v, d) {
129
+ const n = new mt(y, v), m = new xe(n, 2, d, 18, !1);
130
+ return new Se(m, je);
131
+ }
132
+ function Ut(y, v) {
133
+ const d = new De(y, !1, "catmullrom", 0.01), n = new xe(d, Math.max(16, y.length * 2), v, 18, !1);
134
+ return new Se(n, je);
135
+ }
136
+ function Ee(y, v, d, n, m, _ = 0) {
137
+ let s = v.slice(0, m + 1);
138
+ const b = v[m + 1];
139
+ if (b && _ > 0) {
140
+ const r = {
141
+ ...b,
142
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
143
+ B: (b.B ?? 0) * _,
144
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
145
+ C: (b.C ?? 0) * _
146
+ };
147
+ s.push(r);
148
+ }
149
+ const f = Je(s), w = Math.max(0, d - f), a = [];
150
+ a.push(new D(0, 0, 0));
151
+ const C = new D(0, w * I, 0);
152
+ w > 0 && a.push(C);
153
+ let p = {
154
+ pos: C.clone(),
155
+ localY: new D(0, 1, 0),
156
+ localX: new D(1, 0, 0),
157
+ localZ: new D(0, 0, 1)
158
+ };
159
+ const k = [];
160
+ for (let r = s.length - 1; r >= 0; r--) {
161
+ const c = s[r], T = We(c);
162
+ if (T.length > 0) {
163
+ const A = T.map((B) => {
164
+ const L = B.clone(), Z = new H();
165
+ return Z.makeBasis(p.localX, p.localY, p.localZ), L.applyMatrix4(Z), L.add(p.pos);
166
+ });
167
+ k.push(A);
168
+ const $ = A[A.length - 1];
169
+ p.pos = $.clone();
170
+ const g = c.B ?? 0, V = c.C ?? 0;
171
+ if (g !== 0) {
172
+ const B = new H().makeRotationAxis(p.localY, oe(g));
173
+ p.localX.applyMatrix4(B), p.localZ.applyMatrix4(B);
174
+ }
175
+ if (V > 0) {
176
+ const B = oe(V), L = new H().makeRotationAxis(p.localZ, B);
177
+ p.localY.applyMatrix4(L), p.localX.applyMatrix4(L);
178
+ }
179
+ }
180
+ }
181
+ for (const r of k)
182
+ r.length > 1 && a.push(...r.slice(1));
183
+ a.length < 2 && a.push(new D(0, 1e-3, 0));
184
+ try {
185
+ const r = new De(a, !1, "catmullrom", 0.01), c = new xe(r, Math.max(2, a.length * 4), n * I, 18, !1);
186
+ y.geometry.dispose(), y.geometry = c;
187
+ } catch (r) {
188
+ console.error("管件更新失败", r);
189
+ }
190
+ }
191
+ function Oe(y, v, d, n = 0) {
192
+ let m = y.slice(0, d + 1);
193
+ const _ = y[d + 1];
194
+ if (_ && n > 0) {
195
+ const p = {
196
+ ..._,
197
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
198
+ B: (_.B ?? 0) * n,
199
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
200
+ C: (_.C ?? 0) * n
201
+ };
202
+ m.push(p);
203
+ }
204
+ const s = Je(m), b = Math.max(0, v - s), f = [];
205
+ f.push(new D(0, 0, 0));
206
+ const w = new D(0, b * I, 0);
207
+ b > 0 && f.push(w);
208
+ let a = {
209
+ pos: w.clone(),
210
+ localY: new D(0, 1, 0),
211
+ localX: new D(1, 0, 0),
212
+ localZ: new D(0, 0, 1)
213
+ };
214
+ const C = [];
215
+ for (let p = m.length - 1; p >= 0; p--) {
216
+ const k = m[p], r = We(k);
217
+ if (r.length > 0) {
218
+ const c = r.map((g) => {
219
+ const V = g.clone(), B = new H();
220
+ return B.makeBasis(a.localX, a.localY, a.localZ), V.applyMatrix4(B), V.add(a.pos);
221
+ });
222
+ C.push(c);
223
+ const T = c[c.length - 1];
224
+ a.pos = T.clone();
225
+ const A = k.B ?? 0, $ = k.C ?? 0;
226
+ if (A !== 0) {
227
+ const g = new H().makeRotationAxis(a.localY, oe(A));
228
+ a.localX.applyMatrix4(g), a.localZ.applyMatrix4(g);
229
+ }
230
+ if ($ > 0) {
231
+ const g = oe($), V = new H().makeRotationAxis(a.localZ, g);
232
+ a.localY.applyMatrix4(V), a.localX.applyMatrix4(V);
233
+ }
234
+ }
235
+ }
236
+ for (const p of C)
237
+ p.length > 1 && f.push(...p.slice(1));
238
+ return f.length < 2 && f.push(new D(0, 1e-3, 0)), f;
239
+ }
240
+ function Xe(y, v, d, n, m, _, s, b = 0, f = 0) {
241
+ const w = m - f, a = Oe(n, w, s, b);
242
+ let p = Oe(d, f, s, b);
243
+ p.forEach((r) => r.y = -r.y), p.reverse();
244
+ const k = [...p, ...a];
245
+ try {
246
+ const r = new De(k, !1, "catmullrom", 0.01), c = new xe(r, Math.max(2, k.length * 4), _ * I, 18, !1);
247
+ v.geometry.dispose(), y.geometry.dispose(), v.parent && v.parent.remove(v), y.geometry = c;
248
+ } catch (r) {
249
+ console.error("管件更新失败", r);
250
+ }
251
+ }
252
+ const jt = { class: "panel-content" }, Et = { class: "action-bar" }, Ot = { class: "animation-controls" }, Xt = { class: "control-row" }, Gt = { class: "control-row" }, Zt = { class: "frame-info" }, Nt = { class: "control-row" }, Jt = { class: "progress-bar" }, Wt = { class: "dialog-footer" }, It = /* @__PURE__ */ Le({
253
+ __name: "animationPanel",
254
+ props: {
255
+ model: {},
256
+ threeData: {}
257
+ },
258
+ setup(y, { expose: v }) {
259
+ const d = y, n = h(), m = h();
260
+ ae(() => d.threeData, (e) => {
261
+ const o = e == null ? void 0 : e.data;
262
+ m.value = o == null ? void 0 : o.type;
263
+ }, {
264
+ immediate: !0
265
+ });
266
+ const _ = async () => {
267
+ let e = {};
268
+ m.value === Te.SINGLE && (e = await Pt()), m.value === Te.DOUBLE && (e = await xt());
269
+ const {
270
+ initialPipeLength: o = 0,
271
+ pipeRadius: t = 0,
272
+ clampLength: i = 0,
273
+ animationData: R
274
+ } = e;
275
+ $.value = o, g.value = t, V.value = i, n.value = R;
276
+ const x = st(n.value), le = fe(G.value), K = (x == null ? void 0 : x["输出(动画数据)"]) || [];
277
+ s.value = K.length ? K : [le];
278
+ }, s = h([]), b = h(!1), f = h(""), w = h(!1), a = h(0), C = h(0), p = h(1e3);
279
+ let k = !1;
280
+ const r = h(null), c = be(null), T = be(null), A = be(null), $ = h(0), g = h(12.5), V = h(30), B = h([]), L = h(null), Z = Pe(() => d.model ? Tt(d.model).map((t) => t.name) : []), ee = h(["Y", "B", "C", "R"]), G = Pe(() => [...Z.value, ...ee.value]), _e = Pe(() => G.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
281
+ ${G.value.join(" ")}
282
+ 0 0 0 ...
283
+ 1 2 3 ...` : "请先加载模型。"), ve = () => s.value.map((e) => ({
284
+ Y: parseFloat(e.Y) || 0,
285
+ B: parseFloat(e.B) || 0,
286
+ C: parseFloat(e.C) || 0,
287
+ R: parseFloat(e.R) || 0
288
+ })), se = () => {
289
+ const e = [], o = [];
290
+ return s.value.forEach((t) => {
291
+ const { Y1: i, B1: R, C1: x, R1: le, Y2: K, B2: ue, C2: Ce, R2: z } = t;
292
+ e.push({
293
+ Y: parseFloat(i) || 0,
294
+ B: parseFloat(R) || 0,
295
+ C: parseFloat(x) || 0,
296
+ R: parseFloat(le) || 0
297
+ }), o.push({
298
+ Y: parseFloat(K) || 0,
299
+ B: parseFloat(ue) || 0,
300
+ C: parseFloat(Ce) || 0,
301
+ R: parseFloat(z) || 0
302
+ });
303
+ }), {
304
+ posPipeYbcr: e,
305
+ negPipeYbcr: o
306
+ };
307
+ }, S = (e = 0, o = 0) => {
308
+ if (c.value && T.value) {
309
+ const t = se();
310
+ Xe(
311
+ c.value,
312
+ T.value,
313
+ t.posPipeYbcr,
314
+ t.negPipeYbcr,
315
+ $.value,
316
+ g.value,
317
+ e,
318
+ o,
319
+ V.value
320
+ );
321
+ } else if (c.value) {
322
+ const t = ve();
323
+ Ee(c.value, t, $.value, g.value, e, o);
324
+ }
325
+ }, P = (e) => {
326
+ if (e < 0 || e >= s.value.length) {
327
+ console.error(`帧索引 ${e} 超出范围`);
328
+ return;
329
+ }
330
+ const o = s.value[e];
331
+ if (console.log(`应用第 ${e} 帧数据 ${o}`), a.value = e, r.value) {
332
+ const t = {};
333
+ Z.value.forEach((i) => {
334
+ const R = parseFloat(o[i]);
335
+ isNaN(R) || (t[i] = R);
336
+ }), r.value.setJointAngles(t);
337
+ }
338
+ S(e, 0);
339
+ }, N = async () => {
340
+ if (s.value.length === 0) {
341
+ j.error("无法播放动画:无数据");
342
+ return;
343
+ }
344
+ if (!w.value) {
345
+ w.value = !0, k = !1, s.value.length - 1 === a.value && (a.value = 0);
346
+ try {
347
+ for (let e = a.value + 1; e < s.value.length && !k; e++) {
348
+ a.value = e;
349
+ const o = s.value[e], t = {};
350
+ r.value && Z.value.forEach((i) => {
351
+ const R = parseFloat(o[i]);
352
+ isNaN(R) || (t[i] = R);
353
+ }), r.value ? await r.value.animateToState(
354
+ t,
355
+ p.value,
356
+ (i) => {
357
+ C.value = (e + i) / s.value.length * 100, S(e - 1, i);
358
+ }
359
+ ) : (await new Promise((i) => setTimeout(i, p.value)), C.value = (e + 1) / s.value.length * 100);
360
+ }
361
+ k || j.success("动画播放完成");
362
+ } catch (e) {
363
+ console.error("动画播放出错:", e), j.error("动画播放出错");
364
+ } finally {
365
+ w.value = !1, C.value = 0;
366
+ }
367
+ }
368
+ }, E = () => {
369
+ k = !0, w.value = !1, C.value = 0, j.info("动画已停止");
370
+ }, J = () => {
371
+ a.value = 0;
372
+ }, O = () => {
373
+ if (c.value && T.value) {
374
+ const e = se();
375
+ Xe(
376
+ c.value,
377
+ T.value,
378
+ e.posPipeYbcr,
379
+ e.negPipeYbcr,
380
+ $.value,
381
+ g.value,
382
+ -1,
383
+ 0,
384
+ V.value
385
+ );
386
+ } else if (c.value) {
387
+ const e = ve();
388
+ Ee(
389
+ c.value,
390
+ e,
391
+ $.value,
392
+ g.value,
393
+ -1,
394
+ 0
395
+ );
396
+ }
397
+ }, te = () => {
398
+ r.value && r.value.resetToZero(), O(), J(), j.success("机器人和管件已重置");
399
+ }, q = (e) => `第 ${e + 1} 帧`, W = (e) => {
400
+ w.value && E(), P(e);
401
+ }, ie = () => {
402
+ w.value && E(), !(a.value + 1 >= s.value.length) && P(a.value + 1);
403
+ }, F = () => {
404
+ w.value && E(), a.value !== 0 && P(a.value - 1);
405
+ }, ne = () => {
406
+ A.value && (A.value.visible = !0), c.value && c.value.parent && c.value.parent.remove(c.value), A.value = null, c.value = null, T.value = null;
407
+ }, fe = (e) => e == null ? void 0 : e.reduce((o, t) => (o[t] = "0", o), {});
408
+ ae(G, (e, o) => {
409
+ if (JSON.stringify(e) !== JSON.stringify(o))
410
+ if (e.length > 0) {
411
+ const t = fe(e);
412
+ s.value = [t];
413
+ } else
414
+ s.value = [];
415
+ }, { immediate: !0 });
416
+ const re = h(0), we = (e) => {
417
+ re.value = e;
418
+ }, Ae = (e, o) => {
419
+ if (!e || !o)
420
+ return;
421
+ const t = St(e, o), i = zt();
422
+ i.visible = !1, t == null || t.add(i);
423
+ }, $e = (e) => {
424
+ r.value = new lt(e), B.value = Dt(e), L.value = "Pipe_Joint";
425
+ }, ce = () => {
426
+ r.value = null, B.value = [], L.value = null;
427
+ }, ge = (e) => {
428
+ $e(e), Ae(e, L.value), we(re.value + 1), te();
429
+ };
430
+ ae(() => d.model, (e) => {
431
+ if (ne(), e) {
432
+ ge(e);
433
+ return;
434
+ }
435
+ ce();
436
+ }, { immediate: !0 });
437
+ const Re = (e) => {
438
+ var t, i;
439
+ const o = new Se(
440
+ e.geometry.clone(),
441
+ e.material
442
+ );
443
+ return o.name = "managed_pipe_clone", (i = (t = e == null ? void 0 : e.parent) == null ? void 0 : t.add) == null || i.call(t, o), o.position.copy(e.position), o.rotation.copy(e.rotation), o.scale.copy(e.scale), o;
444
+ };
445
+ ae([L, V, $, re], ([e, o]) => {
446
+ if (ne(), d.model && e) {
447
+ const t = Vt(d.model, e);
448
+ if (console.log(t, "meshToReplace"), t && t.parent) {
449
+ A.value = t, t.visible = !1;
450
+ const i = Re(t);
451
+ if (m.value === Te.SINGLE && (i.position.y -= o * 1e-3), c.value = i, m.value === Te.DOUBLE) {
452
+ const R = Re(t);
453
+ T.value = R;
454
+ }
455
+ S(0, 0);
456
+ } else
457
+ e && console.warn(`在 link '${e}' 中未找到可替换的网格或其没有父级。`);
458
+ }
459
+ });
460
+ const Fe = async () => {
461
+ if (G.value.length === 0) {
462
+ j.warning("没有可导出的表头");
463
+ return;
464
+ }
465
+ const e = G.value.join(" ");
466
+ try {
467
+ await navigator.clipboard.writeText(e), j.success("表头已成功复制到剪贴板!");
468
+ } catch (o) {
469
+ console.error("复制失败:", o), j.error("复制失败,请检查浏览器权限或手动复制。");
470
+ }
471
+ }, ze = () => {
472
+ if (!f.value.trim()) {
473
+ j.warning("导入内容不能为空");
474
+ return;
475
+ }
476
+ const e = f.value.trim().split(`
477
+ `).filter((x) => x.trim() !== "");
478
+ if (e.length < 2) {
479
+ j.error("导入数据至少需要包含表头行和一行数据");
480
+ return;
481
+ }
482
+ const o = e[0].split(" ").map((x) => x.trim()), t = {};
483
+ if (o.forEach((x, le) => {
484
+ G.value.includes(x) && (t[le] = x);
485
+ }), Object.keys(t).length === 0) {
486
+ j.error("没有找到匹配的表头,请检查表头名称是否正确");
487
+ return;
488
+ }
489
+ const R = e.slice(1).map((x) => {
490
+ const le = x.split(" "), K = {};
491
+ return G.value.forEach((ue) => {
492
+ K[ue] = "0";
493
+ }), Object.entries(t).forEach(([ue, Ce]) => {
494
+ const z = le[parseInt(ue)];
495
+ z !== void 0 && z.trim() !== "" && (K[Ce] = z.trim());
496
+ }), K;
497
+ });
498
+ R.length > 0 ? (s.value = R, j.success(`成功导入 ${R.length} 行数据!`), b.value = !1, f.value = "") : j.error("未能解析到有效数据,请检查格式。");
499
+ };
500
+ return Ie(() => {
501
+ ne(), k = !0;
502
+ }), v({ playAnimation: N, stopAnimation: E, forwardFrame: ie, backwardFrame: F }), (e, o) => {
503
+ const t = U("el-icon"), i = U("el-input-number"), R = U("el-form-item"), x = U("el-form"), le = U("el-slider"), K = U("el-progress"), ue = U("el-input"), Ce = U("el-dialog");
504
+ return Q(), Ve("div", jt, [
505
+ u("div", Et, [
506
+ l(me, {
507
+ onClick: _,
508
+ modelValue: "获取数据"
509
+ }),
510
+ l(me, {
511
+ onClick: Fe,
512
+ disabled: G.value.length === 0,
513
+ modelValue: "导出表头"
514
+ }, null, 8, ["disabled"]),
515
+ l(me, {
516
+ modelValue: "播放",
517
+ onClick: N,
518
+ disabled: s.value.length === 0 || w.value,
519
+ buttonType: "primary"
520
+ }, {
521
+ default: M(() => [
522
+ w.value ? (Q(), ye(t, {
523
+ key: 0,
524
+ class: "is-loading"
525
+ }, {
526
+ default: M(() => [
527
+ l(X(it))
528
+ ]),
529
+ _: 1
530
+ })) : ke("", !0)
531
+ ]),
532
+ _: 1
533
+ }, 8, ["disabled"]),
534
+ l(me, {
535
+ onClick: E,
536
+ modelValue: "停止",
537
+ buttonType: "danger"
538
+ }),
539
+ l(me, {
540
+ onClick: te,
541
+ modelValue: "重置",
542
+ buttonType: "primary"
543
+ })
544
+ ]),
545
+ u("div", Ot, [
546
+ u("div", Xt, [
547
+ l(x, {
548
+ "label-width": "auto",
549
+ style: { width: "100%" }
550
+ }, {
551
+ default: M(() => [
552
+ l(R, {
553
+ label: "帧间隔 (ms):",
554
+ prop: "frameDuration"
555
+ }, {
556
+ default: M(() => [
557
+ l(i, {
558
+ modelValue: p.value,
559
+ "onUpdate:modelValue": o[0] || (o[0] = (z) => p.value = z),
560
+ min: 100,
561
+ max: 5e3,
562
+ step: 100,
563
+ style: { width: "100%" }
564
+ }, null, 8, ["modelValue"])
565
+ ]),
566
+ _: 1
567
+ }),
568
+ l(R, {
569
+ label: "管件总长 (mm):",
570
+ prop: "initialPipeLength"
571
+ }, {
572
+ default: M(() => [
573
+ l(i, {
574
+ modelValue: $.value,
575
+ "onUpdate:modelValue": o[1] || (o[1] = (z) => $.value = z),
576
+ min: 0,
577
+ style: { width: "100%" }
578
+ }, null, 8, ["modelValue"])
579
+ ]),
580
+ _: 1
581
+ }),
582
+ l(R, {
583
+ label: "管件半径 (mm):",
584
+ prop: "pipeRadius"
585
+ }, {
586
+ default: M(() => [
587
+ l(i, {
588
+ modelValue: g.value,
589
+ "onUpdate:modelValue": o[2] || (o[2] = (z) => g.value = z),
590
+ min: 0,
591
+ style: { width: "100%" }
592
+ }, null, 8, ["modelValue"])
593
+ ]),
594
+ _: 1
595
+ }),
596
+ l(R, {
597
+ label: "夹持长度 (mm):",
598
+ prop: "clampLength"
599
+ }, {
600
+ default: M(() => [
601
+ l(i, {
602
+ modelValue: V.value,
603
+ "onUpdate:modelValue": o[3] || (o[3] = (z) => V.value = z),
604
+ min: 0,
605
+ style: { width: "100%" }
606
+ }, null, 8, ["modelValue"])
607
+ ]),
608
+ _: 1
609
+ })
610
+ ]),
611
+ _: 1
612
+ })
613
+ ]),
614
+ o[10] || (o[10] = u("div", { class: "control-row" }, [
615
+ u("label", null, "管件 Mesh:")
616
+ ], -1)),
617
+ u("div", Gt, [
618
+ o[8] || (o[8] = u("label", null, "当前帧:", -1)),
619
+ u("span", Zt, he(a.value + 1) + " / " + he(s.value.length), 1)
620
+ ]),
621
+ u("div", Nt, [
622
+ o[9] || (o[9] = u("label", null, "动画进度:", -1)),
623
+ l(le, {
624
+ modelValue: a.value,
625
+ "onUpdate:modelValue": o[4] || (o[4] = (z) => a.value = z),
626
+ min: 0,
627
+ max: s.value.length > 0 ? s.value.length - 1 : 0,
628
+ step: 1,
629
+ "format-tooltip": q,
630
+ onInput: W,
631
+ disabled: s.value.length === 0,
632
+ style: { "flex-grow": "1", margin: "0 10px" }
633
+ }, null, 8, ["modelValue", "max", "disabled"])
634
+ ]),
635
+ u("div", Jt, [
636
+ l(K, {
637
+ percentage: C.value,
638
+ "show-text": !1,
639
+ "stroke-width": 6
640
+ }, null, 8, ["percentage"])
641
+ ])
642
+ ]),
643
+ l(Ce, {
644
+ modelValue: b.value,
645
+ "onUpdate:modelValue": o[7] || (o[7] = (z) => b.value = z),
646
+ title: "导入数据",
647
+ width: "500px"
648
+ }, {
649
+ footer: M(() => [
650
+ u("span", Wt, [
651
+ l(me, {
652
+ modelValue: "取消",
653
+ onClick: o[6] || (o[6] = (z) => b.value = !1)
654
+ }),
655
+ l(me, {
656
+ modelValue: "确认导入",
657
+ onClick: ze,
658
+ type: "primary"
659
+ })
660
+ ])
661
+ ]),
662
+ default: M(() => [
663
+ o[11] || (o[11] = u("p", { class: "import-instructions" }, " 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ", -1)),
664
+ l(ue, {
665
+ modelValue: f.value,
666
+ "onUpdate:modelValue": o[5] || (o[5] = (z) => f.value = z),
667
+ type: "textarea",
668
+ rows: 10,
669
+ placeholder: _e.value
670
+ }, null, 8, ["modelValue", "placeholder"])
671
+ ]),
672
+ _: 1
673
+ }, 8, ["modelValue"])
674
+ ]);
675
+ };
676
+ }
677
+ }), Ht = /* @__PURE__ */ Ue(It, [["__scopeId", "data-v-49a19db9"]]), qt = async () => {
678
+ const v = await Rt(["工件库", "弯管"]), d = Be("工件列表", v), n = Ct(d);
679
+ return n == null ? void 0 : n.map((_) => ({
680
+ name: _,
681
+ mainKey: _
682
+ }));
683
+ }, Kt = async (y) => {
684
+ const d = await kt(["工件库", "弯管"], y), n = Be("弯管基础参数", d), m = Be("弯管特征尺寸", d), _ = {
685
+ outerDiameter: 0,
686
+ ybcrList: []
687
+ }, s = Mt(n), b = wt(m);
688
+ return _.outerDiameter = (s == null ? void 0 : s.外径) || 0, _.ybcrList = b || [], _;
689
+ }, Qt = { class: "pipe-analysis-dialog-header" }, el = { class: "header-right" }, tl = { class: "pipe-analysis-dialog-body" }, ll = { class: "panel-left" }, ol = { class: "pipe-analysis-input" }, nl = { class: "input-params" }, al = { class: "pipe-analysis-output" }, sl = { class: "ouput-params" }, il = /* @__PURE__ */ Le({
690
+ __name: "pipeAnalysisPanel",
691
+ emits: ["nodeClick", "visibleChange", "updatePosition", "updateRotation"],
692
+ setup(y, { expose: v, emit: d }) {
693
+ const n = h(null), m = be(null), {
694
+ currentModels: _,
695
+ resetView: s,
696
+ initThreeJS: b,
697
+ handleResize: f,
698
+ getThreeJSObjects: w,
699
+ cleanup: a,
700
+ setModels: C,
701
+ clearAllModels: p,
702
+ axesHelperVisible: k,
703
+ toggleAxesVisibility: r,
704
+ addModelAndFit: c
705
+ } = Ne(n);
706
+ h(null);
707
+ const T = h({ file: null, pipe: "" });
708
+ h(null), h(!1);
709
+ const A = h([]), $ = (S) => {
710
+ A.value = S;
711
+ };
712
+ h("ybcr");
713
+ const g = h({
714
+ form: {},
715
+ list: [],
716
+ reverse: !1
717
+ }), V = (S) => {
718
+ const { length: P, outerDiameter: N, innerDiameter: E, thickness: J, ybcrList: O } = S || {};
719
+ g.value.form = {
720
+ length: P,
721
+ outerDiameter: N,
722
+ innerDiameter: E,
723
+ thickness: J
724
+ }, g.value.list = O;
725
+ }, B = () => {
726
+ const { form: S, list: P } = g.value, {
727
+ outerDiameter: N
728
+ } = S, E = N / 2, J = P == null ? void 0 : P.map(((te) => {
729
+ const { y: q, b: W, c: ie, r: F, Y: ne, B: fe, C: re, R: we } = te;
730
+ return ne ? {
731
+ Y: ne,
732
+ B: fe,
733
+ C: re,
734
+ R: we
735
+ } : {
736
+ Y: q,
737
+ B: W,
738
+ C: ie,
739
+ R: F
740
+ };
741
+ }));
742
+ p();
743
+ const O = Yt(J, E);
744
+ c(O);
745
+ }, L = h(!1), Z = () => {
746
+ const S = L.value;
747
+ L.value = !S;
748
+ }, ee = h(!1), G = () => {
749
+ ee.value = !1;
750
+ }, _e = () => {
751
+ ee.value = !0;
752
+ }, ve = async () => {
753
+ const S = await qt();
754
+ $(S);
755
+ }, se = async (S) => {
756
+ const P = await Kt(S);
757
+ V(P);
758
+ };
759
+ return ae(() => g, () => {
760
+ B();
761
+ }, {
762
+ deep: !0
763
+ }), ae(() => n, () => {
764
+ try {
765
+ if (m.value)
766
+ return;
767
+ b(), window.addEventListener("resize", f);
768
+ } catch (S) {
769
+ console.error("Three.js 初始化失败:", S), j.error("渲染引擎初始化失败!");
770
+ }
771
+ }, {
772
+ deep: !0
773
+ }), Ge(async () => {
774
+ ve();
775
+ }), Ze(() => {
776
+ window.removeEventListener("resize", f), a();
777
+ }), v({ openDialog: _e }), (S, P) => {
778
+ const N = U("el-icon"), E = U("el-option"), J = U("el-select"), O = U("el-form-item"), te = U("el-form"), q = U("el-input"), W = U("el-table-column"), ie = U("el-table");
779
+ return Q(), ye(Ft, {
780
+ class: "pipe-analysis-dialog",
781
+ visible: ee.value,
782
+ onBeforeDestroy: S.onDestroy,
783
+ showClose: !1,
784
+ fullScreen: L.value
785
+ }, {
786
+ header: M(() => [
787
+ u("div", Qt, [
788
+ P[6] || (P[6] = u("div", {
789
+ class: "header-left",
790
+ title: "管件解析"
791
+ }, " 管件解析 ", -1)),
792
+ u("div", el, [
793
+ l(N, null, {
794
+ default: M(() => [
795
+ l(X(rt), { onClick: Z })
796
+ ]),
797
+ _: 1
798
+ }),
799
+ l(N, null, {
800
+ default: M(() => [
801
+ l(X(ct), { onClick: G })
802
+ ]),
803
+ _: 1
804
+ })
805
+ ])
806
+ ])
807
+ ]),
808
+ default: M(() => [
809
+ u("div", tl, [
810
+ u("div", ll, [
811
+ u("div", ol, [
812
+ P[7] || (P[7] = u("span", { class: "item-view-group" }, [
813
+ u("span", { class: "group-name-wrap" }, "输入")
814
+ ], -1)),
815
+ u("div", nl, [
816
+ l(te, {
817
+ model: T.value,
818
+ "label-width": "auto",
819
+ "label-position": "top"
820
+ }, {
821
+ default: M(() => [
822
+ l(O, { label: "弯管" }, {
823
+ default: M(() => [
824
+ l(J, {
825
+ modelValue: T.value.pipe,
826
+ "onUpdate:modelValue": P[0] || (P[0] = (F) => T.value.pipe = F),
827
+ placeholder: "请选择弯管",
828
+ onChange: se
829
+ }, {
830
+ default: M(() => [
831
+ (Q(!0), Ve(He, null, qe(A.value, (F) => (Q(), ye(E, {
832
+ label: F.name,
833
+ value: F.mainKey
834
+ }, null, 8, ["label", "value"]))), 256))
835
+ ]),
836
+ _: 1
837
+ }, 8, ["modelValue"])
838
+ ]),
839
+ _: 1
840
+ })
841
+ ]),
842
+ _: 1
843
+ }, 8, ["model"])
844
+ ])
845
+ ]),
846
+ u("div", al, [
847
+ l(O, { label: "加工方向" }, {
848
+ default: M(() => [
849
+ l(J, {
850
+ modelValue: g.value.reverse,
851
+ "onUpdate:modelValue": P[1] || (P[1] = (F) => g.value.reverse = F),
852
+ placeholder: "请选择加工方向"
853
+ }, {
854
+ default: M(() => [
855
+ l(E, {
856
+ label: "正向",
857
+ value: !1
858
+ }),
859
+ l(E, {
860
+ label: "反向",
861
+ value: !0
862
+ })
863
+ ]),
864
+ _: 1
865
+ }, 8, ["modelValue"])
866
+ ]),
867
+ _: 1
868
+ }),
869
+ P[8] || (P[8] = u("span", { class: "item-view-group" }, [
870
+ u("span", { class: "group-name-wrap" }, "输出(弯管基础参数)")
871
+ ], -1)),
872
+ u("div", sl, [
873
+ l(te, {
874
+ model: g.value.form,
875
+ "label-width": "auto",
876
+ "label-position": "top",
877
+ inline: !0
878
+ }, {
879
+ default: M(() => [
880
+ l(O, { label: "管长" }, {
881
+ default: M(() => [
882
+ l(q, {
883
+ modelValue: g.value.form.length,
884
+ "onUpdate:modelValue": P[2] || (P[2] = (F) => g.value.form.length = F)
885
+ }, null, 8, ["modelValue"])
886
+ ]),
887
+ _: 1
888
+ }),
889
+ l(O, { label: "外径" }, {
890
+ default: M(() => [
891
+ l(q, {
892
+ modelValue: g.value.form.outerDiameter,
893
+ "onUpdate:modelValue": P[3] || (P[3] = (F) => g.value.form.outerDiameter = F)
894
+ }, null, 8, ["modelValue"])
895
+ ]),
896
+ _: 1
897
+ }),
898
+ l(O, { label: "内径" }, {
899
+ default: M(() => [
900
+ l(q, {
901
+ modelValue: g.value.form.innerDiameter,
902
+ "onUpdate:modelValue": P[4] || (P[4] = (F) => g.value.form.innerDiameter = F)
903
+ }, null, 8, ["modelValue"])
904
+ ]),
905
+ _: 1
906
+ }),
907
+ l(O, { label: "壁厚" }, {
908
+ default: M(() => [
909
+ l(q, {
910
+ modelValue: g.value.form.thickness,
911
+ "onUpdate:modelValue": P[5] || (P[5] = (F) => g.value.form.thickness = F)
912
+ }, null, 8, ["modelValue"])
913
+ ]),
914
+ _: 1
915
+ })
916
+ ]),
917
+ _: 1
918
+ }, 8, ["model"]),
919
+ l(ie, {
920
+ ref: "singleTableRef",
921
+ data: g.value.list,
922
+ "highlight-current-rowstyle": "width: 100%"
923
+ }, {
924
+ default: M(() => [
925
+ l(W, {
926
+ type: "index",
927
+ width: "50"
928
+ }),
929
+ l(W, {
930
+ property: "y",
931
+ label: "Y"
932
+ }),
933
+ l(W, {
934
+ property: "b",
935
+ label: "B"
936
+ }),
937
+ l(W, {
938
+ property: "c",
939
+ label: "C"
940
+ }),
941
+ l(W, {
942
+ property: "r",
943
+ label: "R"
944
+ })
945
+ ]),
946
+ _: 1
947
+ }, 8, ["data"])
948
+ ])
949
+ ])
950
+ ]),
951
+ u("div", {
952
+ class: "panel-right",
953
+ ref_key: "threejsContainer",
954
+ ref: n
955
+ }, null, 512)
956
+ ])
957
+ ]),
958
+ _: 1
959
+ }, 8, ["visible", "onBeforeDestroy", "fullScreen"]);
960
+ };
961
+ }
962
+ }), rl = /* @__PURE__ */ Ue(il, [["__scopeId", "data-v-61e834a4"]]), cl = { class: "obj-viewer-container" }, ul = { class: "pipe-comparison" }, pl = {
963
+ ref: "pipe1",
964
+ class: "pipe-container"
965
+ }, dl = {
966
+ ref: "pipe2",
967
+ class: "pipe-container"
968
+ }, ml = { class: "buttonGroup-topLeft" }, vl = { class: "buttonGroup-left" }, fl = { class: "buttonGroup-right" }, gl = { class: "buttonGroup-bottom" }, hl = { class: "top-panel" }, bl = { class: "panel-header" }, yl = { class: "panel-body" }, _l = { class: "left-panel" }, wl = { class: "panel-header" }, Cl = { class: "panel-body" }, kl = { class: "right-panel" }, Pl = { class: "panel-header" }, xl = { class: "panel-body" }, Rl = {
969
+ key: 0,
970
+ class: "loading-overlay"
971
+ }, Ml = /* @__PURE__ */ Le({
972
+ __name: "threeSceneView",
973
+ props: {
974
+ fileBlobs: { default: () => [] },
975
+ threeData: {}
976
+ },
977
+ setup(y) {
978
+ const v = y, d = h(Ye.ROBOT), n = h(null), m = h(), _ = h(!1), s = h(""), b = h(!1), f = h(""), w = h(!1), a = h(""), C = h(!1), p = h(""), k = be(null), r = be(null), c = h(), {
979
+ currentModels: T,
980
+ resetView: A,
981
+ initThreeJS: $,
982
+ handleResize: g,
983
+ getThreeJSObjects: V,
984
+ cleanup: B,
985
+ setAndFitModels: L,
986
+ axesHelperVisible: Z,
987
+ toggleAxesVisibility: ee,
988
+ zoomIn: G,
989
+ zoomOut: _e
990
+ } = Ne(n), { loadSceneFromFile: ve } = at(
991
+ V,
992
+ T,
993
+ _,
994
+ s
995
+ ), { isAnimating: se, toggleAnimation: S, startAnimation: P, stopAnimation: N } = Qe(V, T), { isClipping: E, activeClippingAxis: J, toggleClipping: O, updateClippingPlanes: te } = et(V, T), { initRaycaster: q, selectedObject3D: W, setSelectedObjVisible: ie, updatePosition: F, updateRotation: ne, dispose: fe } = ot(n, V, T), re = () => {
996
+ ee();
997
+ }, we = (t) => {
998
+ J.value = t, te();
999
+ }, Ae = Pe(() => d.value === Ye.ROBOT), $e = Pe(() => d.value === Ye.PIPECOMPARSION), ce = (t) => {
1000
+ b.value = !0, f.value = t, t === "剖面视图" && !E.value && O();
1001
+ }, ge = (t) => {
1002
+ w.value = !0, a.value = t;
1003
+ }, Re = () => {
1004
+ var t;
1005
+ (t = c == null ? void 0 : c.value) == null || t.playAnimation();
1006
+ }, Fe = () => {
1007
+ var t;
1008
+ (t = c == null ? void 0 : c.value) == null || t.stopAnimation();
1009
+ }, ze = () => {
1010
+ var t;
1011
+ (t = c == null ? void 0 : c.value) == null || t.forwardFrame();
1012
+ }, e = () => {
1013
+ var t;
1014
+ (t = c == null ? void 0 : c.value) == null || t.backwardFrame();
1015
+ };
1016
+ ae(() => v.fileBlobs, (t) => {
1017
+ if (t && t.length > 0) {
1018
+ const i = t[0];
1019
+ if (!i.name.toLowerCase().endsWith(".urdf"))
1020
+ return;
1021
+ ve(i).then((R) => {
1022
+ k.value = R;
1023
+ }).catch((R) => {
1024
+ console.error("加载URDF文件时发生错误:", R), j.error("加载urdf模型失败"), k.value = null;
1025
+ });
1026
+ } else
1027
+ k.value = null;
1028
+ }, {
1029
+ immediate: !0,
1030
+ deep: !0
1031
+ }), ae(k, (t) => {
1032
+ L(t ? [t] : []), q();
1033
+ });
1034
+ let o = null;
1035
+ return Ge(async () => {
1036
+ await Ke();
1037
+ try {
1038
+ $(), n.value && (o = new ResizeObserver(g), o.observe(n.value));
1039
+ const t = V();
1040
+ r.value = t.scene;
1041
+ } catch (t) {
1042
+ console.error("Three.js 初始化失败:", t), j.error("渲染引擎初始化失败!");
1043
+ }
1044
+ }), Ze(() => {
1045
+ f.value = "", a.value = "", o && o.disconnect(), se.value && N(), B(), fe();
1046
+ }), (t, i) => {
1047
+ const R = U("el-scrollbar");
1048
+ return Q(), Ve("div", cl, [
1049
+ pe(u("div", {
1050
+ ref_key: "threejsContainer",
1051
+ ref: n,
1052
+ class: "threejs-container"
1053
+ }, null, 512), [
1054
+ [de, Ae.value]
1055
+ ]),
1056
+ pe(u("div", ul, [
1057
+ u("div", pl, null, 512),
1058
+ u("div", dl, null, 512)
1059
+ ], 512), [
1060
+ [de, $e.value]
1061
+ ]),
1062
+ u("div", ml, [
1063
+ l(Y, {
1064
+ name: "viewReset",
1065
+ size: "24",
1066
+ onClick: X(A),
1067
+ title: "重置"
1068
+ }, null, 8, ["onClick"]),
1069
+ l(Y, {
1070
+ name: "fangda",
1071
+ size: "24",
1072
+ title: "放大",
1073
+ onClick: X(G)
1074
+ }, null, 8, ["onClick"]),
1075
+ l(Y, {
1076
+ name: "suoxiao",
1077
+ size: "24",
1078
+ title: "缩小",
1079
+ onClick: X(_e)
1080
+ }, null, 8, ["onClick"]),
1081
+ l(Y, {
1082
+ name: "lookAround",
1083
+ size: "24",
1084
+ onClick: X(S),
1085
+ title: X(se) ? "停止动画" : "动画视图"
1086
+ }, null, 8, ["onClick", "title"]),
1087
+ l(Y, {
1088
+ name: "zuobiaoxi",
1089
+ size: "24",
1090
+ active: X(Z),
1091
+ onClick: re,
1092
+ title: "显隐坐标轴"
1093
+ }, null, 8, ["active"])
1094
+ ]),
1095
+ u("div", vl, [
1096
+ Me(t.$slots, "button-left", { switchRightPanel: ce }, void 0, !0),
1097
+ l(Y, {
1098
+ name: "jiegoushu",
1099
+ size: "24",
1100
+ onClick: i[0] || (i[0] = (x) => ce("场景树")),
1101
+ active: b.value && f.value === "场景树",
1102
+ title: "场景树"
1103
+ }, null, 8, ["active"]),
1104
+ l(Y, {
1105
+ name: "clipping",
1106
+ size: "24",
1107
+ onClick: i[1] || (i[1] = (x) => ce("剖面视图")),
1108
+ active: b.value && f.value === "剖面视图",
1109
+ title: "剖面视图"
1110
+ }, null, 8, ["active"]),
1111
+ l(Y, {
1112
+ name: "zhaozi",
1113
+ size: "24",
1114
+ onClick: i[2] || (i[2] = (x) => ce("工件树")),
1115
+ active: b.value && f.value === "工件树",
1116
+ title: "工件 "
1117
+ }, null, 8, ["active"]),
1118
+ l(Y, {
1119
+ name: "donghuafangzhen",
1120
+ size: "24",
1121
+ onClick: i[3] || (i[3] = (x) => ce("场景4"))
1122
+ })
1123
+ ]),
1124
+ u("div", fl, [
1125
+ Me(t.$slots, "button-right", { switchRightPanel: ge }, void 0, !0),
1126
+ l(Y, {
1127
+ name: "donghuafangzhen",
1128
+ size: "24"
1129
+ }),
1130
+ l(Y, {
1131
+ name: "donghuafangzhen",
1132
+ size: "24"
1133
+ }),
1134
+ l(Y, {
1135
+ name: "guanjiekongzhi",
1136
+ size: "24",
1137
+ onClick: i[4] || (i[4] = (x) => ge("关节控制")),
1138
+ active: w.value && a.value === "关节控制",
1139
+ title: "关节控制"
1140
+ }, null, 8, ["active"]),
1141
+ l(Y, {
1142
+ name: "donghuafangzhen",
1143
+ size: "24",
1144
+ title: "动画仿真",
1145
+ onClick: i[5] || (i[5] = (x) => ge("动画仿真")),
1146
+ active: w.value && a.value === "动画仿真"
1147
+ }, null, 8, ["active"]),
1148
+ l(Y, {
1149
+ name: "donghuafangzhen",
1150
+ size: "24",
1151
+ title: "urdf动画",
1152
+ onClick: i[6] || (i[6] = (x) => ge("urdf动画")),
1153
+ active: w.value && a.value === "urdf动画"
1154
+ }, null, 8, ["active"]),
1155
+ l(Y, {
1156
+ name: "donghuafangzhen",
1157
+ size: "24"
1158
+ })
1159
+ ]),
1160
+ u("div", gl, [
1161
+ l(Y, {
1162
+ name: "kuaitui",
1163
+ size: "24",
1164
+ backgroundColor: "#ffffff",
1165
+ title: "快退",
1166
+ onClick: e
1167
+ }),
1168
+ l(Y, {
1169
+ name: "bofang",
1170
+ size: "24",
1171
+ backgroundColor: "#ffffff",
1172
+ title: "播放",
1173
+ onClick: Re
1174
+ }),
1175
+ l(Y, {
1176
+ name: "kuaijin",
1177
+ size: "24",
1178
+ backgroundColor: "#ffffff",
1179
+ title: "快进",
1180
+ onClick: ze
1181
+ }),
1182
+ l(Y, {
1183
+ name: "zanting",
1184
+ size: "24",
1185
+ backgroundColor: "#ffffff",
1186
+ title: "暂停",
1187
+ onClick: Fe
1188
+ })
1189
+ ]),
1190
+ pe(u("div", hl, [
1191
+ u("div", bl, [
1192
+ u("span", null, he(p.value), 1),
1193
+ u("span", {
1194
+ class: "close",
1195
+ onClick: i[7] || (i[7] = (x) => C.value = !1)
1196
+ }, " X ")
1197
+ ]),
1198
+ u("div", yl, [
1199
+ l(R, { height: "100%" }, {
1200
+ default: M(() => [
1201
+ Me(t.$slots, "top-panel", { topPanelType: p.value }, void 0, !0)
1202
+ ]),
1203
+ _: 3
1204
+ })
1205
+ ])
1206
+ ], 512), [
1207
+ [de, C.value]
1208
+ ]),
1209
+ pe(u("div", _l, [
1210
+ u("div", wl, [
1211
+ u("span", null, he(f.value), 1),
1212
+ u("span", {
1213
+ class: "close",
1214
+ onClick: i[8] || (i[8] = (x) => b.value = !1)
1215
+ }, " X ")
1216
+ ]),
1217
+ u("div", Cl, [
1218
+ l(R, { height: "100%" }, {
1219
+ default: M(() => {
1220
+ var x;
1221
+ return [
1222
+ f.value === "场景树" ? (Q(), ye(At, {
1223
+ key: 0,
1224
+ model: k.value
1225
+ }, null, 8, ["model"])) : ke("", !0),
1226
+ f.value === "剖面视图" ? (Q(), ye(tt, {
1227
+ key: 1,
1228
+ value: X(J),
1229
+ onChange: we
1230
+ }, null, 8, ["value"])) : ke("", !0),
1231
+ f.value === "工件树" ? (Q(), ye(nt, {
1232
+ key: 2,
1233
+ model: (x = X(W)) == null ? void 0 : x.obj,
1234
+ onVisibleChange: X(ie),
1235
+ onUpdatePosition: X(F),
1236
+ onUpdateRotation: X(ne)
1237
+ }, null, 8, ["model", "onVisibleChange", "onUpdatePosition", "onUpdateRotation"])) : ke("", !0)
1238
+ ];
1239
+ }),
1240
+ _: 1
1241
+ })
1242
+ ])
1243
+ ], 512), [
1244
+ [de, b.value]
1245
+ ]),
1246
+ pe(u("div", kl, [
1247
+ u("div", Pl, [
1248
+ u("span", null, he(a.value), 1),
1249
+ u("span", {
1250
+ class: "close",
1251
+ onClick: i[9] || (i[9] = (x) => w.value = !1)
1252
+ }, " X ")
1253
+ ]),
1254
+ u("div", xl, [
1255
+ l(R, { height: "100%" }, {
1256
+ default: M(() => [
1257
+ pe(l($t, { model: k.value }, null, 8, ["model"]), [
1258
+ [de, a.value === "关节控制"]
1259
+ ]),
1260
+ pe(l(Ht, {
1261
+ ref_key: "animationPanelRef",
1262
+ ref: c,
1263
+ model: k.value,
1264
+ threeData: v.threeData
1265
+ }, null, 8, ["model", "threeData"]), [
1266
+ [de, a.value === "动画仿真"]
1267
+ ]),
1268
+ Me(t.$slots, "right-panel", { rightPanelType: a.value }, void 0, !0)
1269
+ ]),
1270
+ _: 3
1271
+ })
1272
+ ])
1273
+ ], 512), [
1274
+ [de, w.value]
1275
+ ]),
1276
+ _.value ? (Q(), Ve("div", Rl, [
1277
+ i[10] || (i[10] = u("div", { class: "loading-spinner" }, null, -1)),
1278
+ u("p", null, he(s.value), 1)
1279
+ ])) : ke("", !0),
1280
+ l(rl, {
1281
+ ref_key: "pipeAnalysisPanelRef",
1282
+ ref: m
1283
+ }, null, 512)
1284
+ ]);
1285
+ };
1286
+ }
1287
+ }), Jl = /* @__PURE__ */ Ue(Ml, [["__scopeId", "data-v-ec34be42"]]);
1288
+ export {
1289
+ Jl as default
1290
+ };