ss-component-new 1.2.57 → 1.2.59

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