ss-component-new 1.3.698 → 1.3.700

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 (91) hide show
  1. package/dist/JSEncrypt-B36c1iN5.js +1983 -0
  2. package/dist/MTLLoader-DzQM5Czw.js +657 -0
  3. package/dist/URDFLoader-CPXooEPU.js +2299 -0
  4. package/dist/animationData-DOIhMG9C.js +83 -0
  5. package/dist/array-lig-X3M9.js +1045 -0
  6. package/dist/clone-Dp_gc9ll.js +8 -0
  7. package/dist/config.js +1 -1
  8. package/dist/eleIcon-qStmsM1q.js +29 -0
  9. package/dist/fileUtil-UOt_otFo.js +20 -0
  10. package/dist/iconfont-DwCBmDct.js +1026 -0
  11. package/dist/icons/svg/functionList.svg +1 -0
  12. package/dist/icons/svg/method.svg +1 -0
  13. package/dist/index-11kpzK0A.js +209 -0
  14. package/dist/index-B-AFi1eL.js +873 -0
  15. package/dist/index-B0H3C7WG.js +103 -0
  16. package/dist/index-BDRDpsgF.js +25297 -0
  17. package/dist/{index-BKK_dL6t.js → index-BHtNKL1L.js} +1 -1
  18. package/dist/index-BJ3RS3n_.js +63004 -0
  19. package/dist/index-BJLCuYEK.js +84 -0
  20. package/dist/index-BbyrFzEO.js +93 -0
  21. package/dist/index-Bn1_Pbpm.js +98 -0
  22. package/dist/index-BniHrGik.js +107 -0
  23. package/dist/index-BooO2Bml.js +78 -0
  24. package/dist/index-Bw3sTXPI.js +8993 -0
  25. package/dist/index-C7sOKXGv.js +48 -0
  26. package/dist/index-CGUz8yrZ.js +20503 -0
  27. package/dist/index-CGi0g-VN.js +627 -0
  28. package/dist/index-CV_jQDcg.js +9 -0
  29. package/dist/index-CWOXvFfD.js +44 -0
  30. package/dist/{index-BKoAuSBh.js → index-ChNfRlIP.js} +18 -223
  31. package/dist/index-CjlKFGAF.js +470 -0
  32. package/dist/index-CydXQbtX.js +622 -0
  33. package/dist/index-D9XVxZlg.js +411 -0
  34. package/dist/index-DAJxL40d.js +55 -0
  35. package/dist/index-DBsEVMiM.js +201 -0
  36. package/dist/index-DG4hoOWt.js +665 -0
  37. package/dist/index-DUbk5m5P.js +99 -0
  38. package/dist/index-Ds6m_4JJ.js +28500 -0
  39. package/dist/index-DupTchhl.js +1000 -0
  40. package/dist/index-DxduRnLV.js +93 -0
  41. package/dist/index-DyCq_odP.js +331 -0
  42. package/dist/index-TDMzk3L7.js +83 -0
  43. package/dist/index-UB_oCdlo.js +62 -0
  44. package/dist/index-VV2Ao7jZ.js +119 -0
  45. package/dist/index-YjBTGOkO.js +61 -0
  46. package/dist/index-erE4kNF5.js +30 -0
  47. package/dist/index-iY5h1bpA.js +572 -0
  48. package/dist/index-jbOjjV0j.js +447 -0
  49. package/dist/index-rlStojTL.js +52 -0
  50. package/dist/index-uF-ibwG0.js +9 -0
  51. package/dist/index.vue_vue_type_script_setup_true_lang-DRzriV-s.js +55 -0
  52. package/dist/index.vue_vue_type_style_index_0_scoped_05e3a1d8_lang-Mr9QL-WU.js +137877 -0
  53. package/dist/isString-0ZglyOfu.js +8 -0
  54. package/dist/localIcon-D5UoFBU5.js +76 -0
  55. package/dist/main-Cepry4zn.js +502 -0
  56. package/dist/menuIndex-BB0uVPRX.js +159 -0
  57. package/dist/obj/model.mtl +42 -0
  58. package/dist/obj/model.obj +26110 -0
  59. package/dist/request-1RPa2bBn.js +9048 -0
  60. package/dist/ss-component.css +8 -2
  61. package/dist/ss-component.js +64 -28
  62. package/dist/ss-component2.js +75 -15
  63. package/dist/ss-component3.js +1 -1
  64. package/dist/threeModel-DcUyC6Vh.js +1109 -0
  65. package/dist/threePreview-CbGqCMch.js +2810 -0
  66. package/dist/threeSceneView-BDyFpkq-.js +1290 -0
  67. package/dist/threeSceneViewForCPMPIP-DUSufDRq.js +539 -0
  68. package/dist/threeTrackPathView-yLEUuGXc.js +620 -0
  69. package/dist/threeViewerHost-BXdZ6Wgi.js +233 -0
  70. package/dist/urdfTree-C6mx4T9t.js +254 -0
  71. package/dist/workpieceTreePanel-DjR9f2D1.js +559 -0
  72. package/package.json +6 -8
  73. package/public/config.js +1 -1
  74. package/public/icons/svg/functionList.svg +1 -0
  75. package/public/icons/svg/method.svg +1 -0
  76. package/public/obj/model.mtl +42 -0
  77. package/public/obj/model.obj +26110 -0
  78. package/dist/header-R5IfoKTX.js +0 -4029
  79. package/dist/index-B9isvN1d.js +0 -182
  80. package/dist/index-BKKAvqK3.js +0 -1043
  81. package/dist/index-By70dOai.js +0 -50
  82. package/dist/index-Cc1nPEpp.js +0 -49044
  83. package/dist/index-RUwH0Fls.js +0 -365
  84. package/dist/index.vue_vue_type_script_setup_true_lang-Dj5jZLRU.js +0 -11484
  85. package/dist/menu-Blo579Ai.js +0 -5217
  86. /package/dist/icons/svg/{update.svg → Update.svg} +0 -0
  87. /package/dist/icons/svg/{table-close.svg → tableClose.svg} +0 -0
  88. /package/dist/icons/svg/{table-expand.svg → tableExpand.svg} +0 -0
  89. /package/public/icons/svg/{update.svg → Update.svg} +0 -0
  90. /package/public/icons/svg/{table-close.svg → tableClose.svg} +0 -0
  91. /package/public/icons/svg/{table-expand.svg → tableExpand.svg} +0 -0
@@ -0,0 +1,1290 @@
1
+ import { defineComponent as Le, ref as h, watch as ae, shallowRef as be, computed as ke, onUnmounted as Ie, resolveComponent as U, createElementBlock as Ve, openBlock as Q, createElementVNode as u, createVNode as l, withCtx as M, createBlock as ye, createCommentVNode as Pe, unref as X, 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-BXdZ6Wgi.js";
3
+ import { u as Je, a as Qe, b as et, T as Y, C as tt } from "./iconfont-DwCBmDct.js";
4
+ import { U as lt, u as ot, a as nt, W as at } from "./workpieceTreePanel-DjR9f2D1.js";
5
+ import { c as st } from "./index-Bw3sTXPI.js";
6
+ import { ax as it, E as j, aO as rt, aP as ct } from "./request-1RPa2bBn.js";
7
+ /* empty css */
8
+ import { p as De, T as xe, V as D, n as H, o as ut, s 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_05e3a1d8_lang-Mr9QL-WU.js";
9
+ import "./index-BJ3RS3n_.js";
10
+ import "./index-BHtNKL1L.js";
11
+ import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
12
+ import { y as Be, z as Ct, A as Pt } from "./index-Ds6m_4JJ.js";
13
+ import "./index-iY5h1bpA.js";
14
+ import "./index-DyCq_odP.js";
15
+ import { f as kt, a as xt, g as Rt, b as Mt } from "./animationData-DOIhMG9C.js";
16
+ import { g as Tt, a as Vt, b as Dt, c as St, U as At, J as $t } from "./urdfTree-C6mx4T9t.js";
17
+ import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
18
+ import { s as Ft } from "./index-11kpzK0A.js";
19
+ const I = 1e-3, oe = ut.degToRad, je = new dt({
20
+ // 灰色
21
+ color: 13421772,
22
+ metalness: 0.3,
23
+ roughness: 0.6,
24
+ side: _t
25
+ });
26
+ function zt(y = 5e-3, v = 64) {
27
+ const d = new De([new D(0, 0, 0), new D(0, 0, 0)]), n = new xe(d, v, y, 16, !1), m = je;
28
+ return new Se(n, m);
29
+ }
30
+ const Ne = (y) => y.reduce((v, d) => {
31
+ let n = 0;
32
+ const m = d.Y ?? 0, _ = d.C ?? 0, s = d.R ?? 0;
33
+ return m > 0 && (n += m), _ > 0 && s > 0 && (n += s * oe(_)), v + n;
34
+ }, 0), We = (y) => {
35
+ const v = [], d = y.Y ?? 0, n = y.B ?? 0, m = y.C ?? 0, _ = y.R ?? 0, s = {
36
+ pos: new D(0, 0, 0),
37
+ localY: new D(0, 1, 0),
38
+ localX: new D(1, 0, 0),
39
+ localZ: new D(0, 0, 1)
40
+ };
41
+ if (!d && !m) return v;
42
+ if (v.push(s.pos.clone()), n !== 0) {
43
+ const b = new H().makeRotationAxis(s.localY, oe(n));
44
+ s.localX.applyMatrix4(b), s.localZ.applyMatrix4(b);
45
+ }
46
+ if (d > 0 && (s.pos.add(s.localY.clone().multiplyScalar(d * I)), v.push(s.pos.clone())), m > 0 && _ > 0) {
47
+ const b = oe(m), f = _ * I, w = s.pos.clone().add(s.localX.clone().multiplyScalar(-f)), a = Math.max(16, Math.ceil(m / 5));
48
+ for (let C = 1; C <= a; C++) {
49
+ const p = b * C / a, P = new H().makeRotationAxis(s.localZ, p), c = s.localX.clone().multiplyScalar(f).applyMatrix4(P), T = w.clone().add(c);
50
+ v.push(T);
51
+ }
52
+ }
53
+ return v;
54
+ };
55
+ function Yt(y, v) {
56
+ const d = new pt();
57
+ d.name = "CompletePipe";
58
+ const n = {
59
+ pos: new D(0, 0, 0),
60
+ localX: new D(1, 0, 0),
61
+ localY: new D(0, 1, 0),
62
+ localZ: new D(0, 0, 1)
63
+ };
64
+ let m = 0, _ = 1;
65
+ for (let s = 0; s < y.length; s++) {
66
+ const b = y[s], f = b.Y ?? 0, w = b.B ?? 0, a = b.C ?? 0, C = b.R ?? 0;
67
+ if (w !== 0) {
68
+ const p = new H().makeRotationAxis(n.localY, oe(w));
69
+ n.localX.applyMatrix4(p), n.localZ.applyMatrix4(p);
70
+ }
71
+ if (f > 0) {
72
+ const p = n.pos.clone();
73
+ n.pos.add(n.localY.clone().multiplyScalar(f * I));
74
+ const P = n.pos.clone(), r = Lt(p, P, v * I);
75
+ r.userData = {
76
+ segmentType: "straight",
77
+ segmentIndex: m,
78
+ frameIndex: s,
79
+ length: f,
80
+ frame: { Y: f, B: w, C: a, R: C }
81
+ }, r.name = `直段_${m}`, d.add(r);
82
+ const c = p.clone();
83
+ Bt(d, _, c, v * I), m++;
84
+ }
85
+ if (a > 0 && C > 0) {
86
+ const p = oe(a), P = C * I, r = [];
87
+ r.push(n.pos.clone());
88
+ const c = n.pos.clone().add(n.localX.clone().multiplyScalar(-P)), T = Math.max(16, Math.ceil(a / 5));
89
+ for (let g = 1; g <= T; g++) {
90
+ const V = p * g / T, B = new H().makeRotationAxis(n.localZ, V), Z = n.localX.clone().multiplyScalar(P).applyMatrix4(B), ee = c.clone().add(Z);
91
+ r.push(ee);
92
+ }
93
+ const A = Ut(r, v * I);
94
+ A.userData = {
95
+ segmentType: "bend",
96
+ segmentIndex: m,
97
+ frameIndex: s,
98
+ angle: a,
99
+ radius: C,
100
+ centerPoint: c.toArray(),
101
+ frame: { Y: f, B: w, C: a, R: C }
102
+ }, A.name = `弯段_${m}`, d.add(A), Math.floor(r.length / 2), r[0], n.pos = r[r.length - 1].clone();
103
+ const $ = new H().makeRotationAxis(n.localZ, p);
104
+ n.localY.applyMatrix4($), n.localX.applyMatrix4($), m++, _++;
105
+ }
106
+ }
107
+ return d;
108
+ }
109
+ function Bt(y, v, d, n) {
110
+ const m = new D(0, n * 2, n * 5), _ = d.clone().add(m), s = [d, _], b = new vt().setFromPoints(s), f = new ft({
111
+ color: 16711680,
112
+ dashSize: n * 0.5,
113
+ gapSize: n * 0.3,
114
+ linewidth: 1
115
+ }), w = new gt(b, f);
116
+ w.computeLineDistances(), y.add(w);
117
+ const a = document.createElement("canvas"), C = a.getContext("2d");
118
+ 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);
119
+ const p = new ht(a), P = new bt({
120
+ map: p,
121
+ transparent: !0,
122
+ depthTest: !1,
123
+ depthWrite: !1
124
+ }), r = new yt(P), c = n * 3;
125
+ r.scale.set(c, c, 1), r.position.copy(_), r.name = `Label_${v}`, r.userData = { labelNumber: v }, y.add(r);
126
+ }
127
+ function Lt(y, v, d) {
128
+ const n = new mt(y, v), m = new xe(n, 2, d, 18, !1);
129
+ return new Se(m, je);
130
+ }
131
+ function Ut(y, v) {
132
+ const d = new De(y, !1, "catmullrom", 0.01), n = new xe(d, Math.max(16, y.length * 2), v, 18, !1);
133
+ return new Se(n, je);
134
+ }
135
+ function Ee(y, v, d, n, m, _ = 0) {
136
+ let s = v.slice(0, m + 1);
137
+ const b = v[m + 1];
138
+ if (b && _ > 0) {
139
+ const r = {
140
+ ...b,
141
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
142
+ B: (b.B ?? 0) * _,
143
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
144
+ C: (b.C ?? 0) * _
145
+ };
146
+ s.push(r);
147
+ }
148
+ const f = Ne(s), w = Math.max(0, d - f), a = [];
149
+ a.push(new D(0, 0, 0));
150
+ const C = new D(0, w * I, 0);
151
+ w > 0 && a.push(C);
152
+ let p = {
153
+ pos: C.clone(),
154
+ localY: new D(0, 1, 0),
155
+ localX: new D(1, 0, 0),
156
+ localZ: new D(0, 0, 1)
157
+ };
158
+ const P = [];
159
+ for (let r = s.length - 1; r >= 0; r--) {
160
+ const c = s[r], T = We(c);
161
+ if (T.length > 0) {
162
+ const A = T.map((B) => {
163
+ const L = B.clone(), Z = new H();
164
+ return Z.makeBasis(p.localX, p.localY, p.localZ), L.applyMatrix4(Z), L.add(p.pos);
165
+ });
166
+ P.push(A);
167
+ const $ = A[A.length - 1];
168
+ p.pos = $.clone();
169
+ const g = c.B ?? 0, V = c.C ?? 0;
170
+ if (g !== 0) {
171
+ const B = new H().makeRotationAxis(p.localY, oe(g));
172
+ p.localX.applyMatrix4(B), p.localZ.applyMatrix4(B);
173
+ }
174
+ if (V > 0) {
175
+ const B = oe(V), L = new H().makeRotationAxis(p.localZ, B);
176
+ p.localY.applyMatrix4(L), p.localX.applyMatrix4(L);
177
+ }
178
+ }
179
+ }
180
+ for (const r of P)
181
+ r.length > 1 && a.push(...r.slice(1));
182
+ a.length < 2 && a.push(new D(0, 1e-3, 0));
183
+ try {
184
+ const r = new De(a, !1, "catmullrom", 0.01), c = new xe(r, Math.max(2, a.length * 4), n * I, 18, !1);
185
+ y.geometry.dispose(), y.geometry = c;
186
+ } catch (r) {
187
+ console.error("管件更新失败", r);
188
+ }
189
+ }
190
+ function Oe(y, v, d, n = 0) {
191
+ let m = y.slice(0, d + 1);
192
+ const _ = y[d + 1];
193
+ if (_ && n > 0) {
194
+ const p = {
195
+ ..._,
196
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
197
+ B: (_.B ?? 0) * n,
198
+ // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
199
+ C: (_.C ?? 0) * n
200
+ };
201
+ m.push(p);
202
+ }
203
+ const s = Ne(m), b = Math.max(0, v - s), f = [];
204
+ f.push(new D(0, 0, 0));
205
+ const w = new D(0, b * I, 0);
206
+ b > 0 && f.push(w);
207
+ let a = {
208
+ pos: w.clone(),
209
+ localY: new D(0, 1, 0),
210
+ localX: new D(1, 0, 0),
211
+ localZ: new D(0, 0, 1)
212
+ };
213
+ const C = [];
214
+ for (let p = m.length - 1; p >= 0; p--) {
215
+ const P = m[p], r = We(P);
216
+ if (r.length > 0) {
217
+ const c = r.map((g) => {
218
+ const V = g.clone(), B = new H();
219
+ return B.makeBasis(a.localX, a.localY, a.localZ), V.applyMatrix4(B), V.add(a.pos);
220
+ });
221
+ C.push(c);
222
+ const T = c[c.length - 1];
223
+ a.pos = T.clone();
224
+ const A = P.B ?? 0, $ = P.C ?? 0;
225
+ if (A !== 0) {
226
+ const g = new H().makeRotationAxis(a.localY, oe(A));
227
+ a.localX.applyMatrix4(g), a.localZ.applyMatrix4(g);
228
+ }
229
+ if ($ > 0) {
230
+ const g = oe($), V = new H().makeRotationAxis(a.localZ, g);
231
+ a.localY.applyMatrix4(V), a.localX.applyMatrix4(V);
232
+ }
233
+ }
234
+ }
235
+ for (const p of C)
236
+ p.length > 1 && f.push(...p.slice(1));
237
+ return f.length < 2 && f.push(new D(0, 1e-3, 0)), f;
238
+ }
239
+ function Xe(y, v, d, n, m, _, s, b = 0, f = 0) {
240
+ const w = m - f, a = Oe(n, w, s, b);
241
+ let p = Oe(d, f, s, b);
242
+ p.forEach((r) => r.y = -r.y), p.reverse();
243
+ const P = [...p, ...a];
244
+ try {
245
+ const r = new De(P, !1, "catmullrom", 0.01), c = new xe(r, Math.max(2, P.length * 4), _ * I, 18, !1);
246
+ v.geometry.dispose(), y.geometry.dispose(), v.parent && v.parent.remove(v), y.geometry = c;
247
+ } catch (r) {
248
+ console.error("管件更新失败", r);
249
+ }
250
+ }
251
+ 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" }, Jt = { class: "control-row" }, Nt = { class: "progress-bar" }, Wt = { class: "dialog-footer" }, It = /* @__PURE__ */ Le({
252
+ __name: "animationPanel",
253
+ props: {
254
+ model: {},
255
+ threeData: {}
256
+ },
257
+ setup(y, { expose: v }) {
258
+ const d = y, n = h(), m = h();
259
+ ae(() => d.threeData, (e) => {
260
+ const o = e == null ? void 0 : e.data;
261
+ m.value = o == null ? void 0 : o.type;
262
+ }, {
263
+ immediate: !0
264
+ });
265
+ const _ = async () => {
266
+ let e = {};
267
+ m.value === Te.SINGLE && (e = await kt()), m.value === Te.DOUBLE && (e = await xt());
268
+ const {
269
+ initialPipeLength: o = 0,
270
+ pipeRadius: t = 0,
271
+ clampLength: i = 0,
272
+ animationData: R
273
+ } = e;
274
+ $.value = o, g.value = t, V.value = i, n.value = R;
275
+ const x = st(n.value), le = fe(G.value), K = (x == null ? void 0 : x["输出(动画数据)"]) || [];
276
+ s.value = K.length ? K : [le];
277
+ }, s = h([]), b = h(!1), f = h(""), w = h(!1), a = h(0), C = h(0), p = h(1e3);
278
+ let P = !1;
279
+ 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 = ke(() => d.model ? Tt(d.model).map((t) => t.name) : []), ee = h(["Y", "B", "C", "R"]), G = ke(() => [...Z.value, ...ee.value]), _e = ke(() => G.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
280
+ ${G.value.join(" ")}
281
+ 0 0 0 ...
282
+ 1 2 3 ...` : "请先加载模型。"), ve = () => s.value.map((e) => ({
283
+ Y: parseFloat(e.Y) || 0,
284
+ B: parseFloat(e.B) || 0,
285
+ C: parseFloat(e.C) || 0,
286
+ R: parseFloat(e.R) || 0
287
+ })), se = () => {
288
+ const e = [], o = [];
289
+ return s.value.forEach((t) => {
290
+ const { Y1: i, B1: R, C1: x, R1: le, Y2: K, B2: ue, C2: Ce, R2: z } = t;
291
+ e.push({
292
+ Y: parseFloat(i) || 0,
293
+ B: parseFloat(R) || 0,
294
+ C: parseFloat(x) || 0,
295
+ R: parseFloat(le) || 0
296
+ }), o.push({
297
+ Y: parseFloat(K) || 0,
298
+ B: parseFloat(ue) || 0,
299
+ C: parseFloat(Ce) || 0,
300
+ R: parseFloat(z) || 0
301
+ });
302
+ }), {
303
+ posPipeYbcr: e,
304
+ negPipeYbcr: o
305
+ };
306
+ }, S = (e = 0, o = 0) => {
307
+ if (c.value && T.value) {
308
+ const t = se();
309
+ Xe(
310
+ c.value,
311
+ T.value,
312
+ t.posPipeYbcr,
313
+ t.negPipeYbcr,
314
+ $.value,
315
+ g.value,
316
+ e,
317
+ o,
318
+ V.value
319
+ );
320
+ } else if (c.value) {
321
+ const t = ve();
322
+ Ee(c.value, t, $.value, g.value, e, o);
323
+ }
324
+ }, k = (e) => {
325
+ if (e < 0 || e >= s.value.length) {
326
+ console.error(`帧索引 ${e} 超出范围`);
327
+ return;
328
+ }
329
+ const o = s.value[e];
330
+ if (console.log(`应用第 ${e} 帧数据 ${o}`), a.value = e, r.value) {
331
+ const t = {};
332
+ Z.value.forEach((i) => {
333
+ const R = parseFloat(o[i]);
334
+ isNaN(R) || (t[i] = R);
335
+ }), r.value.setJointAngles(t);
336
+ }
337
+ S(e, 0);
338
+ }, J = async () => {
339
+ if (s.value.length === 0) {
340
+ j.error("无法播放动画:无数据");
341
+ return;
342
+ }
343
+ if (!w.value) {
344
+ w.value = !0, P = !1, s.value.length - 1 === a.value && (a.value = 0);
345
+ try {
346
+ for (let e = a.value + 1; e < s.value.length && !P; e++) {
347
+ a.value = e;
348
+ const o = s.value[e], t = {};
349
+ r.value && Z.value.forEach((i) => {
350
+ const R = parseFloat(o[i]);
351
+ isNaN(R) || (t[i] = R);
352
+ }), r.value ? await r.value.animateToState(
353
+ t,
354
+ p.value,
355
+ (i) => {
356
+ C.value = (e + i) / s.value.length * 100, S(e - 1, i);
357
+ }
358
+ ) : (await new Promise((i) => setTimeout(i, p.value)), C.value = (e + 1) / s.value.length * 100);
359
+ }
360
+ P || j.success("动画播放完成");
361
+ } catch (e) {
362
+ console.error("动画播放出错:", e), j.error("动画播放出错");
363
+ } finally {
364
+ w.value = !1, C.value = 0;
365
+ }
366
+ }
367
+ }, E = () => {
368
+ P = !0, w.value = !1, C.value = 0, j.info("动画已停止");
369
+ }, N = () => {
370
+ a.value = 0;
371
+ }, O = () => {
372
+ if (c.value && T.value) {
373
+ const e = se();
374
+ Xe(
375
+ c.value,
376
+ T.value,
377
+ e.posPipeYbcr,
378
+ e.negPipeYbcr,
379
+ $.value,
380
+ g.value,
381
+ -1,
382
+ 0,
383
+ V.value
384
+ );
385
+ } else if (c.value) {
386
+ const e = ve();
387
+ Ee(
388
+ c.value,
389
+ e,
390
+ $.value,
391
+ g.value,
392
+ -1,
393
+ 0
394
+ );
395
+ }
396
+ }, te = () => {
397
+ r.value && r.value.resetToZero(), O(), N(), j.success("机器人和管件已重置");
398
+ }, q = (e) => `第 ${e + 1} 帧`, W = (e) => {
399
+ w.value && E(), k(e);
400
+ }, ie = () => {
401
+ w.value && E(), !(a.value + 1 >= s.value.length) && k(a.value + 1);
402
+ }, F = () => {
403
+ w.value && E(), a.value !== 0 && k(a.value - 1);
404
+ }, ne = () => {
405
+ 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;
406
+ }, fe = (e) => e == null ? void 0 : e.reduce((o, t) => (o[t] = "0", o), {});
407
+ ae(G, (e, o) => {
408
+ if (JSON.stringify(e) !== JSON.stringify(o))
409
+ if (e.length > 0) {
410
+ const t = fe(e);
411
+ s.value = [t];
412
+ } else
413
+ s.value = [];
414
+ }, { immediate: !0 });
415
+ const re = h(0), we = (e) => {
416
+ re.value = e;
417
+ }, Ae = (e, o) => {
418
+ if (!e || !o)
419
+ return;
420
+ const t = St(e, o), i = zt();
421
+ i.visible = !1, t == null || t.add(i);
422
+ }, $e = (e) => {
423
+ r.value = new lt(e), B.value = Dt(e), L.value = "Pipe_Joint";
424
+ }, ce = () => {
425
+ r.value = null, B.value = [], L.value = null;
426
+ }, ge = (e) => {
427
+ $e(e), Ae(e, L.value), we(re.value + 1), te();
428
+ };
429
+ ae(() => d.model, (e) => {
430
+ if (ne(), e) {
431
+ ge(e);
432
+ return;
433
+ }
434
+ ce();
435
+ }, { immediate: !0 });
436
+ const Re = (e) => {
437
+ var t, i;
438
+ const o = new Se(
439
+ e.geometry.clone(),
440
+ e.material
441
+ );
442
+ 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;
443
+ };
444
+ ae([L, V, $, re], ([e, o]) => {
445
+ if (ne(), d.model && e) {
446
+ const t = Vt(d.model, e);
447
+ if (console.log(t, "meshToReplace"), t && t.parent) {
448
+ A.value = t, t.visible = !1;
449
+ const i = Re(t);
450
+ if (m.value === Te.SINGLE && (i.position.y -= o * 1e-3), c.value = i, m.value === Te.DOUBLE) {
451
+ const R = Re(t);
452
+ T.value = R;
453
+ }
454
+ S(0, 0);
455
+ } else
456
+ e && console.warn(`在 link '${e}' 中未找到可替换的网格或其没有父级。`);
457
+ }
458
+ });
459
+ const Fe = async () => {
460
+ if (G.value.length === 0) {
461
+ j.warning("没有可导出的表头");
462
+ return;
463
+ }
464
+ const e = G.value.join(" ");
465
+ try {
466
+ await navigator.clipboard.writeText(e), j.success("表头已成功复制到剪贴板!");
467
+ } catch (o) {
468
+ console.error("复制失败:", o), j.error("复制失败,请检查浏览器权限或手动复制。");
469
+ }
470
+ }, ze = () => {
471
+ if (!f.value.trim()) {
472
+ j.warning("导入内容不能为空");
473
+ return;
474
+ }
475
+ const e = f.value.trim().split(`
476
+ `).filter((x) => x.trim() !== "");
477
+ if (e.length < 2) {
478
+ j.error("导入数据至少需要包含表头行和一行数据");
479
+ return;
480
+ }
481
+ const o = e[0].split(" ").map((x) => x.trim()), t = {};
482
+ if (o.forEach((x, le) => {
483
+ G.value.includes(x) && (t[le] = x);
484
+ }), Object.keys(t).length === 0) {
485
+ j.error("没有找到匹配的表头,请检查表头名称是否正确");
486
+ return;
487
+ }
488
+ const R = e.slice(1).map((x) => {
489
+ const le = x.split(" "), K = {};
490
+ return G.value.forEach((ue) => {
491
+ K[ue] = "0";
492
+ }), Object.entries(t).forEach(([ue, Ce]) => {
493
+ const z = le[parseInt(ue)];
494
+ z !== void 0 && z.trim() !== "" && (K[Ce] = z.trim());
495
+ }), K;
496
+ });
497
+ R.length > 0 ? (s.value = R, j.success(`成功导入 ${R.length} 行数据!`), b.value = !1, f.value = "") : j.error("未能解析到有效数据,请检查格式。");
498
+ };
499
+ return Ie(() => {
500
+ ne(), P = !0;
501
+ }), v({ playAnimation: J, stopAnimation: E, forwardFrame: ie, backwardFrame: F }), (e, o) => {
502
+ 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");
503
+ return Q(), Ve("div", jt, [
504
+ u("div", Et, [
505
+ l(me, {
506
+ onClick: _,
507
+ modelValue: "获取数据"
508
+ }),
509
+ l(me, {
510
+ onClick: Fe,
511
+ disabled: G.value.length === 0,
512
+ modelValue: "导出表头"
513
+ }, null, 8, ["disabled"]),
514
+ l(me, {
515
+ modelValue: "播放",
516
+ onClick: J,
517
+ disabled: s.value.length === 0 || w.value,
518
+ buttonType: "primary"
519
+ }, {
520
+ default: M(() => [
521
+ w.value ? (Q(), ye(t, {
522
+ key: 0,
523
+ class: "is-loading"
524
+ }, {
525
+ default: M(() => [
526
+ l(X(it))
527
+ ]),
528
+ _: 1
529
+ })) : Pe("", !0)
530
+ ]),
531
+ _: 1
532
+ }, 8, ["disabled"]),
533
+ l(me, {
534
+ onClick: E,
535
+ modelValue: "停止",
536
+ buttonType: "danger"
537
+ }),
538
+ l(me, {
539
+ onClick: te,
540
+ modelValue: "重置",
541
+ buttonType: "primary"
542
+ })
543
+ ]),
544
+ u("div", Ot, [
545
+ u("div", Xt, [
546
+ l(x, {
547
+ "label-width": "auto",
548
+ style: { width: "100%" }
549
+ }, {
550
+ default: M(() => [
551
+ l(R, {
552
+ label: "帧间隔 (ms):",
553
+ prop: "frameDuration"
554
+ }, {
555
+ default: M(() => [
556
+ l(i, {
557
+ modelValue: p.value,
558
+ "onUpdate:modelValue": o[0] || (o[0] = (z) => p.value = z),
559
+ min: 100,
560
+ max: 5e3,
561
+ step: 100,
562
+ style: { width: "100%" }
563
+ }, null, 8, ["modelValue"])
564
+ ]),
565
+ _: 1
566
+ }),
567
+ l(R, {
568
+ label: "管件总长 (mm):",
569
+ prop: "initialPipeLength"
570
+ }, {
571
+ default: M(() => [
572
+ l(i, {
573
+ modelValue: $.value,
574
+ "onUpdate:modelValue": o[1] || (o[1] = (z) => $.value = z),
575
+ min: 0,
576
+ style: { width: "100%" }
577
+ }, null, 8, ["modelValue"])
578
+ ]),
579
+ _: 1
580
+ }),
581
+ l(R, {
582
+ label: "管件半径 (mm):",
583
+ prop: "pipeRadius"
584
+ }, {
585
+ default: M(() => [
586
+ l(i, {
587
+ modelValue: g.value,
588
+ "onUpdate:modelValue": o[2] || (o[2] = (z) => g.value = z),
589
+ min: 0,
590
+ style: { width: "100%" }
591
+ }, null, 8, ["modelValue"])
592
+ ]),
593
+ _: 1
594
+ }),
595
+ l(R, {
596
+ label: "夹持长度 (mm):",
597
+ prop: "clampLength"
598
+ }, {
599
+ default: M(() => [
600
+ l(i, {
601
+ modelValue: V.value,
602
+ "onUpdate:modelValue": o[3] || (o[3] = (z) => V.value = z),
603
+ min: 0,
604
+ style: { width: "100%" }
605
+ }, null, 8, ["modelValue"])
606
+ ]),
607
+ _: 1
608
+ })
609
+ ]),
610
+ _: 1
611
+ })
612
+ ]),
613
+ o[10] || (o[10] = u("div", { class: "control-row" }, [
614
+ u("label", null, "管件 Mesh:")
615
+ ], -1)),
616
+ u("div", Gt, [
617
+ o[8] || (o[8] = u("label", null, "当前帧:", -1)),
618
+ u("span", Zt, he(a.value + 1) + " / " + he(s.value.length), 1)
619
+ ]),
620
+ u("div", Jt, [
621
+ o[9] || (o[9] = u("label", null, "动画进度:", -1)),
622
+ l(le, {
623
+ modelValue: a.value,
624
+ "onUpdate:modelValue": o[4] || (o[4] = (z) => a.value = z),
625
+ min: 0,
626
+ max: s.value.length > 0 ? s.value.length - 1 : 0,
627
+ step: 1,
628
+ "format-tooltip": q,
629
+ onInput: W,
630
+ disabled: s.value.length === 0,
631
+ style: { "flex-grow": "1", margin: "0 10px" }
632
+ }, null, 8, ["modelValue", "max", "disabled"])
633
+ ]),
634
+ u("div", Nt, [
635
+ l(K, {
636
+ percentage: C.value,
637
+ "show-text": !1,
638
+ "stroke-width": 6
639
+ }, null, 8, ["percentage"])
640
+ ])
641
+ ]),
642
+ l(Ce, {
643
+ modelValue: b.value,
644
+ "onUpdate:modelValue": o[7] || (o[7] = (z) => b.value = z),
645
+ title: "导入数据",
646
+ width: "500px"
647
+ }, {
648
+ footer: M(() => [
649
+ u("span", Wt, [
650
+ l(me, {
651
+ modelValue: "取消",
652
+ onClick: o[6] || (o[6] = (z) => b.value = !1)
653
+ }),
654
+ l(me, {
655
+ modelValue: "确认导入",
656
+ onClick: ze,
657
+ type: "primary"
658
+ })
659
+ ])
660
+ ]),
661
+ default: M(() => [
662
+ o[11] || (o[11] = u("p", { class: "import-instructions" }, " 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ", -1)),
663
+ l(ue, {
664
+ modelValue: f.value,
665
+ "onUpdate:modelValue": o[5] || (o[5] = (z) => f.value = z),
666
+ type: "textarea",
667
+ rows: 10,
668
+ placeholder: _e.value
669
+ }, null, 8, ["modelValue", "placeholder"])
670
+ ]),
671
+ _: 1,
672
+ __: [11]
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 Pt(["工件库", "弯管"], 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: P,
703
+ toggleAxesVisibility: r,
704
+ addModelAndFit: c
705
+ } = Je(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: k, outerDiameter: J, innerDiameter: E, thickness: N, ybcrList: O } = S || {};
719
+ g.value.form = {
720
+ length: k,
721
+ outerDiameter: J,
722
+ innerDiameter: E,
723
+ thickness: N
724
+ }, g.value.list = O;
725
+ }, B = () => {
726
+ const { form: S, list: k } = g.value, {
727
+ outerDiameter: J
728
+ } = S, E = J / 2, N = k == null ? void 0 : k.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(N, 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 k = await Kt(S);
757
+ V(k);
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, k) => {
778
+ const J = U("el-icon"), E = U("el-option"), N = 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
+ k[6] || (k[6] = u("div", {
789
+ class: "header-left",
790
+ title: "管件解析"
791
+ }, " 管件解析 ", -1)),
792
+ u("div", el, [
793
+ l(J, null, {
794
+ default: M(() => [
795
+ l(X(rt), { onClick: Z })
796
+ ]),
797
+ _: 1
798
+ }),
799
+ l(J, 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
+ k[7] || (k[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(N, {
825
+ modelValue: T.value.pipe,
826
+ "onUpdate:modelValue": k[0] || (k[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(N, {
850
+ modelValue: g.value.reverse,
851
+ "onUpdate:modelValue": k[1] || (k[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
+ k[8] || (k[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": k[2] || (k[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": k[3] || (k[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": k[4] || (k[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": k[5] || (k[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" }, Pl = { class: "right-panel" }, kl = { 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(""), P = 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
+ } = Je(n), { loadSceneFromFile: ve } = nt(
991
+ V,
992
+ T,
993
+ _,
994
+ s
995
+ ), { isAnimating: se, toggleAnimation: S, startAnimation: k, stopAnimation: J } = Qe(V, T), { isClipping: E, activeClippingAxis: N, 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
+ N.value = t, te();
999
+ }, Ae = ke(() => d.value === Ye.ROBOT), $e = ke(() => 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
+ P.value = R;
1023
+ }).catch((R) => {
1024
+ console.error("加载URDF文件时发生错误:", R), j.error("加载urdf模型失败"), P.value = null;
1025
+ });
1026
+ } else
1027
+ P.value = null;
1028
+ }, {
1029
+ immediate: !0,
1030
+ deep: !0
1031
+ }), ae(P, (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 && J(), 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: P.value
1225
+ }, null, 8, ["model"])) : Pe("", !0),
1226
+ f.value === "剖面视图" ? (Q(), ye(tt, {
1227
+ key: 1,
1228
+ value: X(N),
1229
+ onChange: we
1230
+ }, null, 8, ["value"])) : Pe("", !0),
1231
+ f.value === "工件树" ? (Q(), ye(at, {
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"])) : Pe("", !0)
1238
+ ];
1239
+ }),
1240
+ _: 1
1241
+ })
1242
+ ])
1243
+ ], 512), [
1244
+ [de, b.value]
1245
+ ]),
1246
+ pe(u("div", Pl, [
1247
+ u("div", kl, [
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: P.value }, null, 8, ["model"]), [
1258
+ [de, a.value === "关节控制"]
1259
+ ]),
1260
+ pe(l(Ht, {
1261
+ ref_key: "animationPanelRef",
1262
+ ref: c,
1263
+ model: P.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
+ ])) : Pe("", !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
+ };