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