ss-component-new 1.2.90 → 1.2.92

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