ss-component-new 1.2.4 → 1.2.5

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 (121) hide show
  1. package/dist/OrbitControls-D1lM0xvz.cjs +1 -0
  2. package/dist/OrbitControls-DI8fa9gz.js +419 -0
  3. package/dist/STLLoader-KxFIlfhN.cjs +6 -0
  4. package/dist/STLLoader-memlq1bT.js +609 -0
  5. package/dist/{animationData-CfT99nMO.cjs → animationData-C-RfOMuc.cjs} +1 -1
  6. package/dist/{animationData-9n1X4UvO.js → animationData-y8dsr3_3.js} +4 -4
  7. package/dist/{array-pg68Qbs1.js → array-A59WrroX.js} +1 -1
  8. package/dist/{array-BPHS7JFA.cjs → array-BtZq8qON.cjs} +1 -1
  9. package/dist/config.js +1 -1
  10. package/dist/{iconfont-ljBfzBSE.js → iconfont-7cEds3Xj.js} +2 -2
  11. package/dist/{iconfont-t5epssvu.cjs → iconfont-CsuwJCas.cjs} +1 -1
  12. package/dist/{index-d6tSWKtY.cjs → index-1z9RrjZc.cjs} +1 -1
  13. package/dist/{index-CCIJ-P3X.cjs → index-3W-Y0xpv.cjs} +1 -1
  14. package/dist/{index-C1lB8apW.js → index-700WRwjB.js} +4 -4
  15. package/dist/{index-CyP2hcVu.js → index-B8mnYY10.js} +6 -6
  16. package/dist/{index-BAj0dyBF.js → index-BCbxnJnH.js} +152 -152
  17. package/dist/index-BKJg9Djt.cjs +1 -0
  18. package/dist/{index-BjXcyVvp.js → index-BLgbZvdb.js} +2 -2
  19. package/dist/{index-DEwcUkb-.js → index-BYDi6Owv.js} +3 -3
  20. package/dist/{index-DPyzaxnq.cjs → index-Bb7Xqt9a.cjs} +1 -1
  21. package/dist/{index-CCsSOTaB.js → index-Bc4DtcwM.js} +2 -2
  22. package/dist/{index-B8J_v2Ky.cjs → index-BstfB43W.cjs} +1 -1
  23. package/dist/{index-DSsZtYMz.js → index-BvApH9cT.js} +2 -2
  24. package/dist/{index-FxX6NP0J.js → index-BwjuTBrR.js} +1 -1
  25. package/dist/{index-zQVJFawn.cjs → index-Bxyl11ug.cjs} +1 -1
  26. package/dist/{index-D0_4keB8.js → index-ByVPv-Yz.js} +5 -5
  27. package/dist/{index-Bx4qIiIa.cjs → index-C1oE8qIa.cjs} +1 -1
  28. package/dist/{index-BuKHInQb.js → index-C461j30b.js} +1 -1
  29. package/dist/{index-CLtFz5gE.js → index-C4zGJtAL.js} +3 -3
  30. package/dist/{index-CMlYJD5U.cjs → index-C5z5UbxK.cjs} +1 -1
  31. package/dist/{index-bj8hK6Pe.js → index-CIH_h4z2.js} +2 -2
  32. package/dist/{index-B9nZeing.cjs → index-CIcvrh1S.cjs} +1 -1
  33. package/dist/{index-CxNBcsll.cjs → index-CJK74ski.cjs} +1 -1
  34. package/dist/{index-LXb5DfDE.cjs → index-CKowlJfn.cjs} +1 -1
  35. package/dist/{index-NFCeQcv4.cjs → index-COKoQtgg.cjs} +1 -1
  36. package/dist/{index-DCf7Tz40.cjs → index-COV5L9rX.cjs} +1 -1
  37. package/dist/{index-DsHRVZ0E.js → index-CX_HTfbe.js} +2 -2
  38. package/dist/{index-UN4JU0ly.js → index-CYp77kPp.js} +1 -1
  39. package/dist/{index---6UATT0.js → index-C_GxFCMg.js} +3 -3
  40. package/dist/{index-pLeOyTaj.js → index-CdELRsxO.js} +6 -6
  41. package/dist/{index-BEJOd_29.js → index-Cj8I0l8I.js} +4 -4
  42. package/dist/{index-CmlXlH2b.cjs → index-CjI5pDiU.cjs} +1 -1
  43. package/dist/{index-DBScQH7L.js → index-Cli0OESv.js} +167 -167
  44. package/dist/{index-B5srJr0o.js → index-CwnxmCht.js} +2 -2
  45. package/dist/{index-CK_O7QdV.cjs → index-CxOoKysB.cjs} +1 -1
  46. package/dist/{index-BrsIZVyD.cjs → index-CxnH4vfV.cjs} +1 -1
  47. package/dist/{index-B5vIeQUq.cjs → index-D2ZBhyUI.cjs} +1 -1
  48. package/dist/{index-DS5z17Mc.js → index-D3-XwkD_.js} +7 -7
  49. package/dist/{index-1DtctdYW.cjs → index-D8WF1ILq.cjs} +1 -1
  50. package/dist/{index-Bi7yv8jC.cjs → index-DIOVPmEg.cjs} +1 -1
  51. package/dist/{index-BOVdAFDH.cjs → index-DLBS_tgM.cjs} +1 -1
  52. package/dist/{index-CDXq3gs4.js → index-DNaqgwk-.js} +20 -20
  53. package/dist/{index-PIEkAjRf.js → index-DPk1uhLn.js} +12 -12
  54. package/dist/{index-CAHYTZ1Q.cjs → index-DQP6am4n.cjs} +1 -1
  55. package/dist/{index-DFg-bhPI.js → index-DSb6SjE3.js} +1 -1
  56. package/dist/{index-Y7MUJdPv.js → index-DTCYk2wI.js} +2 -2
  57. package/dist/{index-DOlPMLvf.cjs → index-DTOlfKkI.cjs} +1 -1
  58. package/dist/{index-8CcD03tl.js → index-DU_1ks22.js} +6 -6
  59. package/dist/{index-BKhDFqMM.cjs → index-DWrDb90D.cjs} +1 -1
  60. package/dist/{index-Dk8D9SRm.js → index-DX6yycjK.js} +1 -1
  61. package/dist/{index-CpE8hbs0.js → index-DYU11-M5.js} +6 -6
  62. package/dist/{index-DPaTtF3h.cjs → index-DYx6r9hf.cjs} +1 -1
  63. package/dist/{index-DJ1PTHpx.cjs → index-De5HlcQy.cjs} +1 -1
  64. package/dist/{index-B5gNufYw.js → index-DgymXtI4.js} +2 -2
  65. package/dist/{index-BNNxPuEV.js → index-Dzrvm_bg.js} +1 -1
  66. package/dist/{index-C-AOuDkl.cjs → index-GmZ7sLUW.cjs} +1 -1
  67. package/dist/{index-DszzdQnM.cjs → index-HvKkM5Lq.cjs} +1 -1
  68. package/dist/{index-Bsdjuxq1.cjs → index-NcJvspI2.cjs} +1 -1
  69. package/dist/{index-C0HHmjrg.cjs → index-O8If5b4T.cjs} +1 -1
  70. package/dist/{index-D-r_YKrq.cjs → index-OsCw48Sn.cjs} +2 -2
  71. package/dist/{index-nUEWiqy9.cjs → index-Y6CA0bCm.cjs} +1 -1
  72. package/dist/{index-CdPbJekh.js → index-Y9ssLsHN.js} +13 -13
  73. package/dist/{index-xHEf6hcO.js → index-yQZ9D_YR.js} +2 -2
  74. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BhLzDN6s.js} +2 -2
  75. package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cmc1oALS.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-DLUx599w.cjs} +1 -1
  76. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-Bg_c-oAL.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-D-2EkcBi.js} +6 -6
  77. package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-C795GAHK.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-llikchjv.cjs} +1 -1
  78. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-Bn5qXF4J.cjs → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DiMotFL8.cjs} +1 -1
  79. package/dist/{index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-9kDr7Iek.js → index.vue_vue_type_style_index_0_scoped_bcdf4fb0_lang-DodcXWpb.js} +13 -13
  80. package/dist/{index.vue_vue_type_style_index_1_lang-Bn7P4fYM.cjs → index.vue_vue_type_style_index_1_lang-BJQzMo8k.cjs} +45 -46
  81. package/dist/{index.vue_vue_type_style_index_1_lang-D1n_3_F6.js → index.vue_vue_type_style_index_1_lang-BMzWMYje.js} +5012 -5100
  82. package/dist/{index.vue_vue_type_style_index_1_lang-zN5mc8b0.cjs → index.vue_vue_type_style_index_1_lang-BcYTED7W.cjs} +2 -2
  83. package/dist/{index.vue_vue_type_style_index_1_lang-Exyt6qTf.js → index.vue_vue_type_style_index_1_lang-CFvcnWO4.js} +31 -25
  84. package/dist/{isString-BAN9KLwf.js → isString-BNK38WbE.js} +1 -1
  85. package/dist/{isString-ChvWbctO.cjs → isString-BmAegMGI.cjs} +1 -1
  86. package/dist/{main-BUEuCNq-.cjs → main-C3-nmz2f.cjs} +1 -1
  87. package/dist/{main-Dk3BZDsa.js → main-DS4xl7Jm.js} +5 -5
  88. package/dist/ss-component.cjs +1 -1
  89. package/dist/ss-component.css +1 -1
  90. package/dist/ss-component.js +11 -11
  91. package/dist/ss-component2.cjs +1 -1
  92. package/dist/ss-component2.js +12 -12
  93. package/dist/three-viewport-gizmo-BxFHxv_x.js +18587 -0
  94. package/dist/three-viewport-gizmo-CwaL5sMV.cjs +4195 -0
  95. package/dist/{threeLatheView-DfSxRY8B.cjs → threeLatheView-BzHB-t_G.cjs} +1 -1
  96. package/dist/{threeLatheView-DcuDjVv0.js → threeLatheView-sTBlm0tt.js} +4 -4
  97. package/dist/{threeModel-DjjtL0-a.cjs → threeModel-BoNyasP7.cjs} +1 -1
  98. package/dist/{threeModel-YRFvkgXU.js → threeModel-CaxS7sQg.js} +5 -5
  99. package/dist/threePreview-Cy7NY-gw.cjs +1 -0
  100. package/dist/threePreview-DPyqhBkJ.js +1873 -0
  101. package/dist/threeSceneView-BIAOu60U.js +1471 -0
  102. package/dist/threeSceneView-wQdzFhdw.cjs +5 -0
  103. package/dist/{threeSceneViewForCPMPIP-DA-twBdG.cjs → threeSceneViewForCPMPIP-Bkr16khM.cjs} +2 -2
  104. package/dist/{threeSceneViewForCPMPIP-axjwKt9X.js → threeSceneViewForCPMPIP-XYA9PRYN.js} +27 -27
  105. package/dist/{threeViewerHost-D7L1FW__.js → threeViewerHost-BkOYLPdk.js} +4 -4
  106. package/dist/{threeViewerHost-B02OtfCk.cjs → threeViewerHost-D1i6LUb6.cjs} +1 -1
  107. package/dist/{useRayCaster-ClcofJkf.cjs → useRayCaster-0bnGc301.cjs} +1 -1
  108. package/dist/{useRayCaster-CAqupK7D.js → useRayCaster-CdDOIWOo.js} +12 -12
  109. package/package.json +1 -1
  110. package/public/config.js +1 -1
  111. package/dist/OrbitControls-Co_9huz0.cjs +0 -1
  112. package/dist/OrbitControls-DA4VpOM_.js +0 -458
  113. package/dist/STLLoader-DmGTF0Nv.js +0 -657
  114. package/dist/STLLoader-RU7KqloS.cjs +0 -6
  115. package/dist/index-5hLZZ6t-.cjs +0 -1
  116. package/dist/three-viewport-gizmo-BHznJ6W3.js +0 -26015
  117. package/dist/three-viewport-gizmo-BV37JzRa.cjs +0 -4197
  118. package/dist/threePreview-ByUYJkts.cjs +0 -1
  119. package/dist/threePreview-CyYfnbB6.js +0 -1972
  120. package/dist/threeSceneView-mhrcH0WG.cjs +0 -5
  121. package/dist/threeSceneView-zvyCHrp1.js +0 -1469
@@ -1,1469 +0,0 @@
1
- import { defineComponent as Le, ref as C, watch as ce, shallowRef as fe, computed as _e, onUnmounted as Ge, resolveComponent as N, createElementBlock as ge, openBlock as ne, createElementVNode as o, createCommentVNode as me, createVNode as e, withCtx as z, createBlock as De, unref as B, toDisplayString as ve, onBeforeUnmount as Oe, createTextVNode as Ie, onMounted as Ne, nextTick as qe, withDirectives as Q, vShow as de, renderSlot as be, isRef as ke, vModelRadio as xe } from "vue";
2
- import { U as He, r as Te, s as Be, u as We, a as Ke, W as Qe } from "./useRayCaster-CAqupK7D.js";
3
- import { u as Xe, a as et, b as tt, S as E } from "./iconfont-ljBfzBSE.js";
4
- import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BTu7I4mn.js";
5
- import { a9 as lt, c as ot, E as J, a as nt, aM as at, ao as st } from "./index-UN4JU0ly.js";
6
- import "./index.vue_vue_type_style_index_1_lang-Exyt6qTf.js";
7
- import "./index-BHtNKL1L.js";
8
- import { _ as ie, s as it } from "./index-Dk8D9SRm.js";
9
- import "./index.vue_vue_type_style_index_1_lang-D1n_3_F6.js";
10
- import { m as Ve, T as we, V as O, e as he, n as rt, k as te, l as ut, o as ct, i as pt, L as dt, p as mt, q as vt, r as ft, s as gt, t as ht, u as bt } from "./three-viewport-gizmo-BHznJ6W3.js";
11
- import "./index-B5gNufYw.js";
12
- import { f as yt, a as _t } from "./animationData-9n1X4UvO.js";
13
- import { _ as je } from "./_plugin-vue_export-helper-CHgC5LLL.js";
14
- import { U as wt, J as Ct } from "./urdfTree-BuTtRGdl.js";
15
- const ee = 1e-3, re = ut.degToRad, Ue = new rt({
16
- // 灰色
17
- color: 13421772,
18
- metalness: 0.3,
19
- roughness: 0.6,
20
- side: pt
21
- });
22
- function Pt(k = 5e-3, g = 64) {
23
- const T = new Ve([new O(0, 0, 0), new O(0, 0, 0)]), s = new we(T, g, k, 16, !1), P = Ue;
24
- return new he(s, P);
25
- }
26
- const Ze = (k) => k.reduce((g, T) => {
27
- let s = 0;
28
- const P = T.Y ?? 0, V = T.C ?? 0, f = T.R ?? 0;
29
- return P > 0 && (s += P), V > 0 && f > 0 && (s += f * re(V)), g + s;
30
- }, 0), Je = (k) => {
31
- const g = [], T = k.Y ?? 0, s = k.B ?? 0, P = k.C ?? 0, V = k.R ?? 0, f = {
32
- pos: new O(0, 0, 0),
33
- localY: new O(0, 1, 0),
34
- localX: new O(1, 0, 0),
35
- localZ: new O(0, 0, 1)
36
- };
37
- if (!T && !P) return g;
38
- if (g.push(f.pos.clone()), s !== 0) {
39
- const D = new te().makeRotationAxis(f.localY, re(s));
40
- f.localX.applyMatrix4(D), f.localZ.applyMatrix4(D);
41
- }
42
- if (T > 0 && (f.pos.add(f.localY.clone().multiplyScalar(T * ee)), g.push(f.pos.clone())), P > 0 && V > 0) {
43
- const D = re(P), S = V * ee, p = f.pos.clone().add(f.localX.clone().multiplyScalar(-S)), u = Math.max(16, Math.ceil(P / 5));
44
- for (let b = 1; b <= u; b++) {
45
- const a = D * b / u, y = new te().makeRotationAxis(f.localZ, a), _ = f.localX.clone().multiplyScalar(S).applyMatrix4(y), h = p.clone().add(_);
46
- g.push(h);
47
- }
48
- }
49
- return g;
50
- };
51
- function kt(k, g) {
52
- const T = new ct();
53
- T.name = "CompletePipe";
54
- const s = {
55
- pos: new O(0, 0, 0),
56
- localX: new O(1, 0, 0),
57
- localY: new O(0, 1, 0),
58
- localZ: new O(0, 0, 1)
59
- };
60
- let P = 0, V = 1;
61
- for (let f = 0; f < k.length; f++) {
62
- const D = k[f], S = D.Y ?? 0, p = D.B ?? 0, u = D.C ?? 0, b = D.R ?? 0;
63
- if (p !== 0) {
64
- const a = new te().makeRotationAxis(s.localY, re(p));
65
- s.localX.applyMatrix4(a), s.localZ.applyMatrix4(a);
66
- }
67
- if (S > 0) {
68
- const a = s.pos.clone();
69
- s.pos.add(s.localY.clone().multiplyScalar(S * ee));
70
- const y = s.pos.clone(), i = Tt(a, y, g * ee);
71
- i.userData = {
72
- segmentType: "straight",
73
- segmentIndex: P,
74
- frameIndex: f,
75
- length: S,
76
- frame: { Y: S, B: p, C: u, R: b }
77
- }, i.name = `直段_${P}`, T.add(i);
78
- const _ = a.clone();
79
- xt(T, V, _, g * ee), P++;
80
- }
81
- if (u > 0 && b > 0) {
82
- const a = re(u), y = b * ee, i = [];
83
- i.push(s.pos.clone());
84
- const _ = s.pos.clone().add(s.localX.clone().multiplyScalar(-y)), h = Math.max(16, Math.ceil(u / 5));
85
- for (let R = 1; R <= h; R++) {
86
- const X = a * R / h, $ = new te().makeRotationAxis(s.localZ, X), G = s.localX.clone().multiplyScalar(y).applyMatrix4($), ae = _.clone().add(G);
87
- i.push(ae);
88
- }
89
- const M = Mt(i, g * ee);
90
- M.userData = {
91
- segmentType: "bend",
92
- segmentIndex: P,
93
- frameIndex: f,
94
- angle: u,
95
- radius: b,
96
- centerPoint: _.toArray(),
97
- frame: { Y: S, B: p, C: u, R: b }
98
- }, M.name = `弯段_${P}`, T.add(M), Math.floor(i.length / 2), i[0], s.pos = i[i.length - 1].clone();
99
- const m = new te().makeRotationAxis(s.localZ, a);
100
- s.localY.applyMatrix4(m), s.localX.applyMatrix4(m), P++, V++;
101
- }
102
- }
103
- return T;
104
- }
105
- function xt(k, g, T, s) {
106
- const P = new O(0, s * 2, s * 5), V = T.clone().add(P), f = [T, V], D = new mt().setFromPoints(f), S = new vt({
107
- color: 16711680,
108
- dashSize: s * 0.5,
109
- gapSize: s * 0.3,
110
- linewidth: 1
111
- }), p = new ft(D, S);
112
- p.computeLineDistances(), k.add(p);
113
- const u = document.createElement("canvas"), b = u.getContext("2d");
114
- u.width = 128, u.height = 128, b.clearRect(0, 0, 128, 128), b.fillStyle = "#FF0000", b.font = "bold 80px Arial", b.textAlign = "center", b.textBaseline = "middle", b.fillText(g.toString(), 64, 64);
115
- const a = new gt(u), y = new ht({
116
- map: a,
117
- transparent: !0,
118
- depthTest: !1,
119
- depthWrite: !1
120
- }), i = new bt(y), _ = s * 3;
121
- i.scale.set(_, _, 1), i.position.copy(V), i.name = `Label_${g}`, i.userData = { labelNumber: g }, k.add(i);
122
- }
123
- function Tt(k, g, T) {
124
- const s = new dt(k, g), P = new we(s, 2, T, 18, !1);
125
- return new he(P, Ue);
126
- }
127
- function Mt(k, g) {
128
- const T = new Ve(k, !1, "catmullrom", 0.01), s = new we(T, Math.max(16, k.length * 2), g, 18, !1);
129
- return new he(s, Ue);
130
- }
131
- function Me(k, g, T, s, P, V = 0) {
132
- let f = g.slice(0, P + 1);
133
- const D = g[P + 1];
134
- if (D && V > 0) {
135
- const i = {
136
- ...D,
137
- // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
138
- B: (D.B ?? 0) * V,
139
- // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
140
- C: (D.C ?? 0) * V
141
- };
142
- f.push(i);
143
- }
144
- const S = Ze(f), p = Math.max(0, T - S), u = [];
145
- u.push(new O(0, 0, 0));
146
- const b = new O(0, p * ee, 0);
147
- p > 0 && u.push(b);
148
- let a = {
149
- pos: b.clone(),
150
- localY: new O(0, 1, 0),
151
- localX: new O(1, 0, 0),
152
- localZ: new O(0, 0, 1)
153
- };
154
- const y = [];
155
- for (let i = f.length - 1; i >= 0; i--) {
156
- const _ = f[i], h = Je(_);
157
- if (h.length > 0) {
158
- const M = h.map(($) => {
159
- const A = $.clone(), G = new te();
160
- return G.makeBasis(a.localX, a.localY, a.localZ), A.applyMatrix4(G), A.add(a.pos);
161
- });
162
- y.push(M);
163
- const m = M[M.length - 1];
164
- a.pos = m.clone();
165
- const R = _.B ?? 0, X = _.C ?? 0;
166
- if (R !== 0) {
167
- const $ = new te().makeRotationAxis(a.localY, re(R));
168
- a.localX.applyMatrix4($), a.localZ.applyMatrix4($);
169
- }
170
- if (X > 0) {
171
- const $ = re(X), A = new te().makeRotationAxis(a.localZ, $);
172
- a.localY.applyMatrix4(A), a.localX.applyMatrix4(A);
173
- }
174
- }
175
- }
176
- for (const i of y)
177
- i.length > 1 && u.push(...i.slice(1));
178
- u.length < 2 && u.push(new O(0, 1e-3, 0));
179
- try {
180
- const i = new Ve(u, !1, "catmullrom", 0.01), _ = new we(i, Math.max(2, u.length * 4), s * ee, 18, !1);
181
- k.geometry.dispose(), k.geometry = _;
182
- } catch (i) {
183
- console.error("管件更新失败", i);
184
- }
185
- }
186
- function Ee(k, g, T, s = 0) {
187
- let P = k.slice(0, T + 1);
188
- const V = k[T + 1];
189
- if (V && s > 0) {
190
- const a = {
191
- ...V,
192
- // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
193
- B: (V.B ?? 0) * s,
194
- // 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
195
- C: (V.C ?? 0) * s
196
- };
197
- P.push(a);
198
- }
199
- const f = Ze(P), D = Math.max(0, g - f), S = [];
200
- S.push(new O(0, 0, 0));
201
- const p = new O(0, D * ee, 0);
202
- D > 0 && S.push(p);
203
- let u = {
204
- pos: p.clone(),
205
- localY: new O(0, 1, 0),
206
- localX: new O(1, 0, 0),
207
- localZ: new O(0, 0, 1)
208
- };
209
- const b = [];
210
- for (let a = P.length - 1; a >= 0; a--) {
211
- const y = P[a], i = Je(y);
212
- if (i.length > 0) {
213
- const _ = i.map((R) => {
214
- const X = R.clone(), $ = new te();
215
- return $.makeBasis(u.localX, u.localY, u.localZ), X.applyMatrix4($), X.add(u.pos);
216
- });
217
- b.push(_);
218
- const h = _[_.length - 1];
219
- u.pos = h.clone();
220
- const M = y.B ?? 0, m = y.C ?? 0;
221
- if (M !== 0) {
222
- const R = new te().makeRotationAxis(u.localY, re(M));
223
- u.localX.applyMatrix4(R), u.localZ.applyMatrix4(R);
224
- }
225
- if (m > 0) {
226
- const R = re(m), X = new te().makeRotationAxis(u.localZ, R);
227
- u.localY.applyMatrix4(X), u.localX.applyMatrix4(X);
228
- }
229
- }
230
- }
231
- for (const a of b)
232
- a.length > 1 && S.push(...a.slice(1));
233
- return S.length < 2 && S.push(new O(0, 1e-3, 0)), S;
234
- }
235
- function ye(k, g, T, s, P, V, f, D = 0, S = 0) {
236
- const p = P - S, u = Ee(s, p, f, D);
237
- let a = Ee(T, S, f, D);
238
- a.forEach((i) => i.y = -i.y), a.reverse();
239
- const y = [...a, ...u];
240
- try {
241
- const i = new Ve(y, !1, "catmullrom", 0.01), _ = new we(i, Math.max(2, y.length * 4), V * ee, 18, !1);
242
- g.geometry.dispose(), k.geometry.dispose(), g.parent && g.parent.remove(g), k.geometry = _;
243
- } catch (i) {
244
- console.error("管件更新失败", i);
245
- }
246
- }
247
- const Dt = { class: "panel-content" }, Vt = { class: "action-bar" }, Rt = {
248
- key: 0,
249
- class: "animation-controls"
250
- }, St = { class: "control-row" }, $t = { class: "control-row" }, At = { class: "frame-info" }, zt = { class: "control-row" }, Ft = { class: "progress-bar" }, Yt = { class: "dialog-footer" }, Bt = /* @__PURE__ */ Le({
251
- __name: "animationPanel",
252
- props: {
253
- model: {},
254
- threeData: {}
255
- },
256
- emits: ["getThreeData"],
257
- setup(k, { expose: g, emit: T }) {
258
- const s = k, P = T, V = C(), f = C(), D = C();
259
- ce(() => s.threeData, (l) => {
260
- const t = l == null ? void 0 : l.data;
261
- D.value = t == null ? void 0 : t.type;
262
- }, {
263
- immediate: !0
264
- });
265
- const S = async () => {
266
- if (!sessionStorage.getItem("systemKey")) {
267
- P("getThreeData");
268
- return;
269
- }
270
- let t = {};
271
- D.value === Te.SINGLE && (t = await yt()), D.value === Te.DOUBLE && (t = await _t());
272
- const {
273
- initialPipeLength: c = 0,
274
- pipeRadius: x = 0,
275
- clampLength: d = 0,
276
- animationData: F
277
- } = t;
278
- $.value = c, A.value = x, G.value = d, V.value = F;
279
- const U = ot(V.value);
280
- p.value = (U == null ? void 0 : U["输出(动画数据)"]) || [];
281
- let r = (U == null ? void 0 : U["输出(动画数据)Content"]) ?? [];
282
- r && (f.value = r);
283
- }, p = C([]), u = C(!1), b = C(""), a = C(!1), y = C(0), i = C(0), _ = C(1e3), h = C(null);
284
- let M = !1;
285
- const m = fe(null), R = fe(null), X = fe(null), $ = C(1302), A = C(12.5), G = C(30), ae = C([]), L = C(null), w = _e(() => s.model ? Object.values(s.model.joints).filter((l) => l.jointType !== "fixed").map((l) => l.name) : []), H = C(["Y", "B", "C", "R"]), Z = _e(() => [...w.value, ...H.value]), W = _e(() => Z.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
286
- ${Z.value.join(" ")}
287
- 0 0 0 ...
288
- 1 2 3 ...` : "请先加载模型。"), K = (l, t) => {
289
- if (!t)
290
- return null;
291
- const c = l.joints[t];
292
- if (!c)
293
- return console.warn(`在模型中未找到名为 '${t}' 的 Joint`), null;
294
- let x = null;
295
- return c.traverse((d) => {
296
- d instanceof he && !x && (x = d);
297
- }), x || console.warn(`在 Joint '${t}' 中未找到可用的 Mesh 对象`), x;
298
- }, ue = (l, t) => {
299
- if (!t)
300
- return null;
301
- const c = l.joints[t];
302
- return c || (console.warn(`在模型中未找到名为 '${t}' 的 Joint`), console.log("可用的链接:", Object.keys(l.links)), null);
303
- }, se = () => {
304
- X.value && (X.value.visible = !0), m.value && m.value.parent && m.value.parent.remove(m.value), X.value = null, m.value = null, R.value = null;
305
- };
306
- ce(Z, (l, t) => {
307
- if (JSON.stringify(l) !== JSON.stringify(t))
308
- if (l.length > 0) {
309
- const c = l.reduce((x, d) => (x[d] = "0", x), {});
310
- p.value = [c];
311
- } else
312
- p.value = [];
313
- }, { immediate: !0 });
314
- const le = (l, t) => {
315
- const c = ue(l, t), x = Pt();
316
- x.visible = !1, c == null || c.add(x);
317
- };
318
- ce(() => s.model, (l) => {
319
- se(), l ? (h.value = new He(l), ae.value = Object.keys(l.links), L.value = "Pipe_Joint", le(l, L.value)) : (h.value = null, ae.value = [], L.value = null);
320
- }, { immediate: !0 }), ce([L, G], ([l, t]) => {
321
- if (se(), s.model && l) {
322
- const c = K(s.model, l);
323
- if (console.log(c, "meshToReplace"), c && c.parent) {
324
- X.value = c;
325
- const x = new he(
326
- c.geometry.clone(),
327
- c.material
328
- );
329
- if (x.name = "managed_pipe_clone", c.parent.add(x), x.position.copy(c.position), x.rotation.copy(c.rotation), x.scale.copy(c.scale), c.visible = !1, D.value === Te.SINGLE && (x.position.y -= t * 1e-3), m.value = x, D.value === Te.DOUBLE) {
330
- const d = new he(
331
- c.geometry.clone(),
332
- c.material
333
- );
334
- d.name = "managed_oppsite_pipe_clone", d.position.copy(c.position), d.rotation.copy(c.rotation), d.scale.copy(c.scale), c.parent.add(d), R.value = d;
335
- }
336
- m.value && R.value && ye(
337
- m.value,
338
- R.value,
339
- [],
340
- [],
341
- $.value,
342
- A.value,
343
- 0,
344
- 0,
345
- G.value
346
- );
347
- } else
348
- l && console.warn(`在 link '${l}' 中未找到可替换的网格或其没有父级。`);
349
- }
350
- });
351
- const j = () => p.value.map((l) => ({
352
- Y: parseFloat(l.Y) || 0,
353
- B: parseFloat(l.B) || 0,
354
- C: parseFloat(l.C) || 0,
355
- R: parseFloat(l.R) || 0
356
- })), oe = () => {
357
- const l = [], t = [];
358
- return p.value.forEach((c) => {
359
- const { Y1: x, B1: d, C1: F, R1: U, Y2: r, B2: n, C2: q, R2: v } = c;
360
- l.push({
361
- Y: parseFloat(x) || 0,
362
- B: parseFloat(d) || 0,
363
- C: parseFloat(F) || 0,
364
- R: parseFloat(U) || 0
365
- }), t.push({
366
- Y: parseFloat(r) || 0,
367
- B: parseFloat(n) || 0,
368
- C: parseFloat(q) || 0,
369
- R: parseFloat(v) || 0
370
- });
371
- }), {
372
- posPipeYbcr: l,
373
- negPipeYbcr: t
374
- };
375
- }, Y = (l) => {
376
- if (l < 0 || l >= p.value.length) {
377
- console.error(`帧索引 ${l} 超出范围`);
378
- return;
379
- }
380
- const t = p.value[l];
381
- if (console.log(`应用第 ${l} 帧数据 ${t}`), y.value = l, h.value) {
382
- const c = {};
383
- w.value.forEach((x) => {
384
- const d = parseFloat(t[x]);
385
- isNaN(d) || (c[x] = d);
386
- }), h.value.setJointAngles(c);
387
- }
388
- if (m.value && R.value) {
389
- const c = oe();
390
- console.log("ybcr数据:", c), ye(
391
- m.value,
392
- R.value,
393
- c.posPipeYbcr,
394
- c.negPipeYbcr,
395
- $.value,
396
- A.value,
397
- l,
398
- 0,
399
- G.value
400
- );
401
- return;
402
- }
403
- if (m.value) {
404
- const c = j();
405
- console.log("ybcr数据:", c), Me(
406
- m.value,
407
- c,
408
- $.value,
409
- A.value,
410
- l,
411
- 0
412
- );
413
- return;
414
- }
415
- }, Ce = async () => {
416
- if (p.value.length === 0) {
417
- J.error("无法播放动画:无数据");
418
- return;
419
- }
420
- a.value = !0, M = !1;
421
- const l = m.value ? j() : [];
422
- try {
423
- for (let t = y.value + 1; t < p.value.length && !M; t++) {
424
- y.value = t;
425
- const c = p.value[t], x = {};
426
- h.value && w.value.forEach((d) => {
427
- const F = parseFloat(c[d]);
428
- isNaN(F) || (x[d] = F);
429
- }), h.value ? await h.value.animateToState(
430
- x,
431
- _.value,
432
- (d) => {
433
- if (i.value = (t + d) / p.value.length * 100, m.value && R.value) {
434
- const F = oe();
435
- console.log("ybcr数据:", l), ye(
436
- m.value,
437
- R.value,
438
- F.posPipeYbcr,
439
- F.negPipeYbcr,
440
- $.value,
441
- A.value,
442
- t - 1,
443
- d,
444
- G.value
445
- );
446
- } else m.value && Me(m.value, l, $.value, A.value, t - 1, d);
447
- }
448
- ) : m.value && R.value ? await new Promise((d) => {
449
- const F = performance.now();
450
- let U;
451
- const r = (n) => {
452
- if (M) {
453
- cancelAnimationFrame(U), d();
454
- return;
455
- }
456
- const q = n - F, v = Math.min(q / _.value, 1);
457
- i.value = (t + v) / p.value.length * 100;
458
- const I = oe();
459
- ye(
460
- m.value,
461
- R.value,
462
- I.posPipeYbcr,
463
- I.negPipeYbcr,
464
- $.value,
465
- A.value,
466
- t - 1,
467
- v,
468
- G.value
469
- ), v < 1 ? U = requestAnimationFrame(r) : d();
470
- };
471
- U = requestAnimationFrame(r);
472
- }) : m.value ? await new Promise((d) => {
473
- const F = performance.now();
474
- let U;
475
- const r = (n) => {
476
- if (M) {
477
- cancelAnimationFrame(U), d();
478
- return;
479
- }
480
- const q = n - F, v = Math.min(q / _.value, 1);
481
- i.value = (t + v) / p.value.length * 100, Me(m.value, l, $.value, A.value, t - 1, v), v < 1 ? U = requestAnimationFrame(r) : d();
482
- };
483
- U = requestAnimationFrame(r);
484
- }) : (await new Promise((d) => setTimeout(d, _.value)), i.value = (t + 1) / p.value.length * 100);
485
- }
486
- M || J.success("动画播放完成");
487
- } catch (t) {
488
- console.error("动画播放出错:", t), J.error("动画播放出错");
489
- } finally {
490
- a.value = !1, i.value = 0;
491
- }
492
- }, pe = () => {
493
- M = !0, a.value = !1, i.value = 0, J.info("动画已停止");
494
- }, Re = () => {
495
- if (h.value && h.value.resetToZero(), console.log("pipeMesh.value", m.value), m.value && R.value) {
496
- const l = oe();
497
- ye(
498
- m.value,
499
- R.value,
500
- l.posPipeYbcr,
501
- l.negPipeYbcr,
502
- $.value,
503
- A.value,
504
- -1,
505
- 0,
506
- G.value
507
- );
508
- } else if (m.value) {
509
- const l = j();
510
- Me(
511
- m.value,
512
- l,
513
- $.value,
514
- A.value,
515
- -1,
516
- 0
517
- );
518
- }
519
- y.value = 0, J.success("机器人和管件已重置");
520
- }, Se = () => {
521
- console.log("当前管件Mesh:", m.value);
522
- }, $e = (l) => {
523
- a.value && pe(), Y(l);
524
- }, Ae = () => {
525
- a.value && pe(), !(y.value + 1 >= p.value.length) && Y(y.value + 1);
526
- }, ze = () => {
527
- a.value && pe(), y.value !== 0 && Y(y.value - 1);
528
- }, Fe = async () => {
529
- if (Z.value.length === 0) {
530
- J.warning("没有可导出的表头");
531
- return;
532
- }
533
- const l = Z.value.join(" ");
534
- try {
535
- await navigator.clipboard.writeText(l), J.success("表头已成功复制到剪贴板!");
536
- } catch (t) {
537
- console.error("复制失败:", t), J.error("复制失败,请检查浏览器权限或手动复制。");
538
- }
539
- }, Ye = () => {
540
- if (!b.value.trim()) {
541
- J.warning("导入内容不能为空");
542
- return;
543
- }
544
- const l = b.value.trim().split(`
545
- `).filter((F) => F.trim() !== "");
546
- if (l.length < 2) {
547
- J.error("导入数据至少需要包含表头行和一行数据");
548
- return;
549
- }
550
- const t = l[0].split(" ").map((F) => F.trim()), c = {};
551
- if (t.forEach((F, U) => {
552
- Z.value.includes(F) && (c[U] = F);
553
- }), Object.keys(c).length === 0) {
554
- J.error("没有找到匹配的表头,请检查表头名称是否正确");
555
- return;
556
- }
557
- const d = l.slice(1).map((F) => {
558
- const U = F.split(" "), r = {};
559
- return Z.value.forEach((n) => {
560
- r[n] = "0";
561
- }), Object.entries(c).forEach(([n, q]) => {
562
- const v = U[parseInt(n)];
563
- v !== void 0 && v.trim() !== "" && (r[q] = v.trim());
564
- }), r;
565
- });
566
- d.length > 0 ? (p.value = d, J.success(`成功导入 ${d.length} 行数据!`), u.value = !1, b.value = "") : J.error("未能解析到有效数据,请检查格式。");
567
- }, Pe = (l) => `第 ${l + 1} 帧`;
568
- return Ge(() => {
569
- se(), M = !0;
570
- }), g({ playAnimation: Ce, stopAnimation: pe, forwardFrame: Ae, backwardFrame: ze }), (l, t) => {
571
- const c = N("el-icon"), x = N("el-input-number"), d = N("el-form-item"), F = N("el-form"), U = N("el-slider"), r = N("el-progress"), n = N("el-input"), q = N("el-dialog");
572
- return ne(), ge("div", Dt, [
573
- o("div", Vt, [
574
- e(ie, {
575
- onClick: S,
576
- modelValue: "获取数据"
577
- }),
578
- e(ie, {
579
- onClick: Fe,
580
- disabled: Z.value.length === 0,
581
- modelValue: "导出表头"
582
- }, null, 8, ["disabled"]),
583
- e(ie, {
584
- modelValue: "播放",
585
- onClick: Ce,
586
- disabled: p.value.length === 0 || a.value,
587
- buttonType: "primary"
588
- }, {
589
- default: z(() => [
590
- a.value ? (ne(), De(c, {
591
- key: 0,
592
- class: "is-loading"
593
- }, {
594
- default: z(() => [
595
- e(B(lt))
596
- ]),
597
- _: 1
598
- })) : me("", !0)
599
- ]),
600
- _: 1
601
- }, 8, ["disabled"]),
602
- e(ie, {
603
- onClick: pe,
604
- modelValue: "停止",
605
- buttonType: "danger"
606
- }),
607
- e(ie, {
608
- onClick: Re,
609
- modelValue: "重置",
610
- buttonType: "primary"
611
- }),
612
- e(ie, {
613
- onClick: Se,
614
- modelValue: "测试功能",
615
- buttonType: "primary"
616
- })
617
- ]),
618
- p.value.length > 0 ? (ne(), ge("div", Rt, [
619
- o("div", St, [
620
- e(F, {
621
- "label-width": "auto",
622
- style: { width: "100%" }
623
- }, {
624
- default: z(() => [
625
- e(d, {
626
- label: "帧间隔 (ms):",
627
- prop: "frameDuration"
628
- }, {
629
- default: z(() => [
630
- e(x, {
631
- modelValue: _.value,
632
- "onUpdate:modelValue": t[0] || (t[0] = (v) => _.value = v),
633
- min: 100,
634
- max: 5e3,
635
- step: 100,
636
- style: { width: "100%" }
637
- }, null, 8, ["modelValue"])
638
- ]),
639
- _: 1
640
- }),
641
- e(d, {
642
- label: "管件总长 (mm):",
643
- prop: "initialPipeLength"
644
- }, {
645
- default: z(() => [
646
- e(x, {
647
- modelValue: $.value,
648
- "onUpdate:modelValue": t[1] || (t[1] = (v) => $.value = v),
649
- min: 0,
650
- style: { width: "100%" }
651
- }, null, 8, ["modelValue"])
652
- ]),
653
- _: 1
654
- }),
655
- e(d, {
656
- label: "管件半径 (mm):",
657
- prop: "pipeRadius"
658
- }, {
659
- default: z(() => [
660
- e(x, {
661
- modelValue: A.value,
662
- "onUpdate:modelValue": t[2] || (t[2] = (v) => A.value = v),
663
- min: 0,
664
- style: { width: "100%" }
665
- }, null, 8, ["modelValue"])
666
- ]),
667
- _: 1
668
- }),
669
- e(d, {
670
- label: "夹持长度 (mm):",
671
- prop: "clampLength"
672
- }, {
673
- default: z(() => [
674
- e(x, {
675
- modelValue: G.value,
676
- "onUpdate:modelValue": t[3] || (t[3] = (v) => G.value = v),
677
- min: 0,
678
- style: { width: "100%" }
679
- }, null, 8, ["modelValue"])
680
- ]),
681
- _: 1
682
- })
683
- ]),
684
- _: 1
685
- })
686
- ]),
687
- t[10] || (t[10] = o("div", { class: "control-row" }, [
688
- o("label", null, "管件 Mesh:")
689
- ], -1)),
690
- o("div", $t, [
691
- t[8] || (t[8] = o("label", null, "当前帧:", -1)),
692
- o("span", At, ve(y.value + 1) + " / " + ve(p.value.length), 1)
693
- ]),
694
- o("div", zt, [
695
- t[9] || (t[9] = o("label", null, "动画进度:", -1)),
696
- e(U, {
697
- modelValue: y.value,
698
- "onUpdate:modelValue": t[4] || (t[4] = (v) => y.value = v),
699
- min: 0,
700
- max: p.value.length > 0 ? p.value.length - 1 : 0,
701
- step: 1,
702
- "format-tooltip": Pe,
703
- onInput: $e,
704
- disabled: p.value.length === 0,
705
- style: { "flex-grow": "1", margin: "0 10px" }
706
- }, null, 8, ["modelValue", "max", "disabled"])
707
- ]),
708
- o("div", Ft, [
709
- e(r, {
710
- percentage: i.value,
711
- "show-text": !1,
712
- "stroke-width": 6
713
- }, null, 8, ["percentage"])
714
- ])
715
- ])) : me("", !0),
716
- e(q, {
717
- modelValue: u.value,
718
- "onUpdate:modelValue": t[7] || (t[7] = (v) => u.value = v),
719
- title: "导入数据",
720
- width: "500px"
721
- }, {
722
- footer: z(() => [
723
- o("span", Yt, [
724
- e(ie, {
725
- modelValue: "取消",
726
- onClick: t[6] || (t[6] = (v) => u.value = !1)
727
- }),
728
- e(ie, {
729
- modelValue: "确认导入",
730
- onClick: Ye,
731
- type: "primary"
732
- })
733
- ])
734
- ]),
735
- default: z(() => [
736
- t[11] || (t[11] = o("p", { class: "import-instructions" }, " 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ", -1)),
737
- e(n, {
738
- modelValue: b.value,
739
- "onUpdate:modelValue": t[5] || (t[5] = (v) => b.value = v),
740
- type: "textarea",
741
- rows: 10,
742
- placeholder: W.value
743
- }, null, 8, ["modelValue", "placeholder"])
744
- ]),
745
- _: 1,
746
- __: [11]
747
- }, 8, ["modelValue"])
748
- ]);
749
- };
750
- }
751
- }), Lt = /* @__PURE__ */ je(Bt, [["__scopeId", "data-v-e955dfd2"]]), jt = "http://139.196.154.85:20018";
752
- function Ut(k, g = !1) {
753
- return console.log(k, "data"), nt({
754
- url: `${jt}/api/pipeBendingTraditional/pipeAnsys/${g}`,
755
- method: "post",
756
- data: k
757
- });
758
- }
759
- const Et = { class: "pipe-analysis-dialog-header" }, Ot = { class: "header-right" }, Xt = { class: "pipe-analysis-dialog-body" }, Zt = { class: "panel-left" }, Jt = { class: "pipe-analysis-input" }, Gt = { class: "input-params" }, It = { class: "step-label" }, Nt = { class: "button-group" }, qt = { class: "upload-content" }, Ht = { class: "file-item" }, Wt = { key: 0 }, Kt = { class: "pipe-analysis-output" }, Qt = { class: "ouput-params" }, el = /* @__PURE__ */ Le({
760
- __name: "pipeAnalysisPanel",
761
- emits: ["nodeClick", "visibleChange", "updatePosition", "updateRotation"],
762
- setup(k, { expose: g, emit: T }) {
763
- const s = C(null), P = fe(null), {
764
- initThreeJS: V,
765
- handleResize: f,
766
- cleanup: D,
767
- clearAllModels: S,
768
- addModelAndFit: p
769
- } = Xe(s), u = C(null), b = C({ file: null }), a = C(null), y = C(!1), i = () => {
770
- var L;
771
- (L = u.value) == null || L.click();
772
- }, _ = async (L) => {
773
- var Z;
774
- const H = (Z = L.target.files) == null ? void 0 : Z[0];
775
- H && (a.value = H);
776
- };
777
- C("ybcr");
778
- const h = C({
779
- form: {},
780
- list: [],
781
- reverse: !1
782
- }), M = async () => {
783
- var L;
784
- if (!a.value) {
785
- J.warning("请先选择文件");
786
- return;
787
- }
788
- try {
789
- y.value = !0;
790
- const w = new FormData();
791
- w.set("file", a.value);
792
- let H = !1;
793
- ((L = h.value) == null ? void 0 : L.reverse) == !0 && (H = !0);
794
- const { data: { data: Z } = {} } = await Ut(w, H);
795
- m(Z), J.success("提交成功");
796
- } catch (w) {
797
- J.error("提交失败,请重试"), console.error("提交错误:", w);
798
- } finally {
799
- y.value = !1;
800
- }
801
- }, m = (L) => {
802
- const { length: w, outerDiameter: H, innerDiameter: Z, thickness: W, ybcrList: K } = L || {};
803
- h.value.form = {
804
- length: w,
805
- outerDiameter: H,
806
- innerDiameter: Z,
807
- thickness: W
808
- }, h.value.list = K;
809
- }, R = () => {
810
- const { form: L, list: w } = h.value, {
811
- outerDiameter: H
812
- } = L, Z = H / 2, W = w == null ? void 0 : w.map((ue) => {
813
- const { y: se, b: le, c: j, r: oe } = ue;
814
- return {
815
- Y: se,
816
- B: le,
817
- C: j,
818
- R: oe
819
- };
820
- });
821
- S();
822
- const K = kt(W, Z);
823
- p(K);
824
- }, X = C(!1), $ = () => {
825
- const L = X.value;
826
- X.value = !L;
827
- }, A = C(!1), G = () => {
828
- A.value = !1;
829
- }, ae = () => {
830
- A.value = !0;
831
- };
832
- return ce(() => h, () => {
833
- R();
834
- }, {
835
- deep: !0
836
- }), ce(() => s, () => {
837
- try {
838
- if (P.value)
839
- return;
840
- V(), window.addEventListener("resize", f);
841
- } catch (L) {
842
- console.error("Three.js 初始化失败:", L), J.error("渲染引擎初始化失败!");
843
- }
844
- }, {
845
- deep: !0
846
- }), Oe(() => {
847
- window.removeEventListener("resize", f), D();
848
- }), g({ openDialog: ae }), (L, w) => {
849
- const H = N("el-icon"), Z = N("el-button"), W = N("el-form-item"), K = N("el-form"), ue = N("el-option"), se = N("el-select"), le = N("el-input"), j = N("el-table-column"), oe = N("el-table");
850
- return ne(), De(it, {
851
- class: "pipe-analysis-dialog",
852
- visible: A.value,
853
- onBeforeDestroy: L.onDestroy,
854
- showClose: !1,
855
- fullScreen: X.value
856
- }, {
857
- header: z(() => [
858
- o("div", Et, [
859
- w[5] || (w[5] = o("div", {
860
- class: "header-left",
861
- title: "管件解析"
862
- }, " 管件解析 ", -1)),
863
- o("div", Ot, [
864
- e(H, null, {
865
- default: z(() => [
866
- e(B(at), { onClick: $ })
867
- ]),
868
- _: 1
869
- }),
870
- e(H, null, {
871
- default: z(() => [
872
- e(B(st), { onClick: G })
873
- ]),
874
- _: 1
875
- })
876
- ])
877
- ])
878
- ]),
879
- default: z(() => [
880
- o("div", Xt, [
881
- o("div", Zt, [
882
- o("div", Jt, [
883
- w[8] || (w[8] = o("span", { class: "item-view-group" }, [
884
- o("span", { class: "group-name-wrap" }, "输入")
885
- ], -1)),
886
- o("div", Gt, [
887
- e(K, {
888
- model: b.value,
889
- "label-width": "auto",
890
- "label-position": "top"
891
- }, {
892
- default: z(() => [
893
- e(W, { label: "step文件" }, {
894
- label: z(() => [
895
- o("div", It, [
896
- w[7] || (w[7] = o("div", null, " step文件 ", -1)),
897
- o("div", Nt, [
898
- e(ie, {
899
- emptyColor: !0,
900
- onClickTrigger: i,
901
- modelValue: "上传"
902
- }),
903
- o("input", {
904
- type: "file",
905
- ref_key: "fileInput",
906
- ref: u,
907
- accept: ".step,.csv",
908
- onChange: _,
909
- style: { display: "none" }
910
- }, null, 544),
911
- e(Z, {
912
- type: "primary",
913
- onClick: M,
914
- loading: y.value,
915
- disabled: !a.value
916
- }, {
917
- default: z(() => w[6] || (w[6] = [
918
- Ie(" 解析 ")
919
- ])),
920
- _: 1,
921
- __: [6]
922
- }, 8, ["loading", "disabled"])
923
- ])
924
- ])
925
- ]),
926
- default: z(() => {
927
- var Y;
928
- return [
929
- o("div", qt, [
930
- o("div", Ht, [
931
- a.value ? (ne(), ge("div", Wt, ve((Y = a.value) == null ? void 0 : Y.name), 1)) : me("", !0)
932
- ])
933
- ])
934
- ];
935
- }),
936
- _: 1
937
- })
938
- ]),
939
- _: 1
940
- }, 8, ["model"])
941
- ])
942
- ]),
943
- o("div", Kt, [
944
- e(W, { label: "加工方向" }, {
945
- default: z(() => [
946
- e(se, {
947
- modelValue: h.value.reverse,
948
- "onUpdate:modelValue": w[0] || (w[0] = (Y) => h.value.reverse = Y),
949
- placeholder: "请选择加工方向"
950
- }, {
951
- default: z(() => [
952
- e(ue, {
953
- label: "正向",
954
- value: !1
955
- }),
956
- e(ue, {
957
- label: "反向",
958
- value: !0
959
- })
960
- ]),
961
- _: 1
962
- }, 8, ["modelValue"])
963
- ]),
964
- _: 1
965
- }),
966
- w[9] || (w[9] = o("span", { class: "item-view-group" }, [
967
- o("span", { class: "group-name-wrap" }, "输出(弯管基础参数)")
968
- ], -1)),
969
- o("div", Qt, [
970
- e(K, {
971
- model: h.value.form,
972
- "label-width": "auto",
973
- "label-position": "top",
974
- inline: !0
975
- }, {
976
- default: z(() => [
977
- e(W, { label: "管长" }, {
978
- default: z(() => [
979
- e(le, {
980
- modelValue: h.value.form.length,
981
- "onUpdate:modelValue": w[1] || (w[1] = (Y) => h.value.form.length = Y)
982
- }, null, 8, ["modelValue"])
983
- ]),
984
- _: 1
985
- }),
986
- e(W, { label: "外径" }, {
987
- default: z(() => [
988
- e(le, {
989
- modelValue: h.value.form.outerDiameter,
990
- "onUpdate:modelValue": w[2] || (w[2] = (Y) => h.value.form.outerDiameter = Y)
991
- }, null, 8, ["modelValue"])
992
- ]),
993
- _: 1
994
- }),
995
- e(W, { label: "内径" }, {
996
- default: z(() => [
997
- e(le, {
998
- modelValue: h.value.form.innerDiameter,
999
- "onUpdate:modelValue": w[3] || (w[3] = (Y) => h.value.form.innerDiameter = Y)
1000
- }, null, 8, ["modelValue"])
1001
- ]),
1002
- _: 1
1003
- }),
1004
- e(W, { label: "壁厚" }, {
1005
- default: z(() => [
1006
- e(le, {
1007
- modelValue: h.value.form.thickness,
1008
- "onUpdate:modelValue": w[4] || (w[4] = (Y) => h.value.form.thickness = Y)
1009
- }, null, 8, ["modelValue"])
1010
- ]),
1011
- _: 1
1012
- })
1013
- ]),
1014
- _: 1
1015
- }, 8, ["model"]),
1016
- e(oe, {
1017
- ref: "singleTableRef",
1018
- data: h.value.list,
1019
- "highlight-current-rowstyle": "width: 100%"
1020
- }, {
1021
- default: z(() => [
1022
- e(j, {
1023
- type: "index",
1024
- width: "50"
1025
- }),
1026
- e(j, {
1027
- property: "y",
1028
- label: "Y"
1029
- }),
1030
- e(j, {
1031
- property: "b",
1032
- label: "B"
1033
- }),
1034
- e(j, {
1035
- property: "c",
1036
- label: "C"
1037
- }),
1038
- e(j, {
1039
- property: "r",
1040
- label: "R"
1041
- })
1042
- ]),
1043
- _: 1
1044
- }, 8, ["data"])
1045
- ])
1046
- ])
1047
- ]),
1048
- o("div", {
1049
- class: "panel-right",
1050
- ref_key: "threejsContainer",
1051
- ref: s
1052
- }, null, 512)
1053
- ])
1054
- ]),
1055
- _: 1
1056
- }, 8, ["visible", "onBeforeDestroy", "fullScreen"]);
1057
- };
1058
- }
1059
- }), tl = /* @__PURE__ */ je(el, [["__scopeId", "data-v-577e5f83"]]), ll = { class: "obj-viewer-container" }, ol = { class: "pipe-comparison" }, nl = {
1060
- ref: "pipe1",
1061
- class: "pipe-container"
1062
- }, al = {
1063
- ref: "pipe2",
1064
- class: "pipe-container"
1065
- }, sl = { class: "buttonGroup-top" }, il = { class: "buttonGroup-topLeft" }, rl = { class: "buttonGroup-left" }, ul = { class: "buttonGroup-right" }, cl = { class: "buttonGroup-bottom" }, pl = { class: "top-panel" }, dl = { class: "panel-header" }, ml = { class: "panel-body" }, vl = { class: "left-panel" }, fl = { class: "panel-header" }, gl = { class: "panel-body" }, hl = {
1066
- key: 1,
1067
- class: "clipping-content"
1068
- }, bl = { class: "radio-group" }, yl = { class: "radio-label" }, _l = { class: "radio-label" }, wl = { class: "radio-label" }, Cl = { class: "radio-label" }, Pl = { class: "right-panel" }, kl = { class: "panel-header" }, xl = { class: "panel-body" }, Tl = {
1069
- key: 0,
1070
- class: "loading-overlay"
1071
- }, Ml = /* @__PURE__ */ Le({
1072
- __name: "threeSceneView",
1073
- props: {
1074
- fileBlobs: { default: () => [] },
1075
- animationData: { default: () => ({}) },
1076
- threeData: {}
1077
- },
1078
- emits: ["getAnimationData", "getThreeData"],
1079
- setup(k, { emit: g }) {
1080
- const T = g, s = k, P = C(Be.ROBOT), V = C(null), f = C(), D = C(!1), S = C(""), p = C(!1), u = C(""), b = C(!1), a = C(""), y = C(!1), i = C(""), _ = fe(null), h = fe(null), M = C(), {
1081
- currentModels: m,
1082
- resetView: R,
1083
- initThreeJS: X,
1084
- handleResize: $,
1085
- getThreeJSObjects: A,
1086
- cleanup: G,
1087
- setModels: ae,
1088
- axesHelperVisible: L,
1089
- toggleAxesVisibility: w,
1090
- zoomIn: H,
1091
- zoomOut: Z
1092
- } = Xe(V), { loadSceneFromFile: W } = Ke(
1093
- A,
1094
- m,
1095
- D,
1096
- S
1097
- ), { isAnimating: K, toggleAnimation: ue, stopAnimation: se } = et(A, m), { isClipping: le, activeClippingAxis: j, toggleClipping: oe, updateClippingPlanes: Y } = tt(A, m), { initRaycaster: Ce, selectedObject3D: pe, setSelectedObjVisible: Re, updatePosition: Se, updateRotation: $e, dispose: Ae } = We(V, A, m), ze = () => {
1098
- w();
1099
- }, Fe = _e(() => P.value === Be.ROBOT), Ye = _e(() => P.value === Be.PIPECOMPARSION), Pe = (r) => {
1100
- var n;
1101
- i.value = r, i.value === "弯管解析" ? (n = f.value) == null || n.openDialog() : y.value = !0;
1102
- }, l = (r) => {
1103
- p.value = !0, u.value = r, r === "剖面视图" && !le.value && oe();
1104
- }, t = (r) => {
1105
- b.value = !0, a.value = r, r === "动画仿真" && T("getAnimationData");
1106
- }, c = () => {
1107
- T("getThreeData");
1108
- }, x = () => {
1109
- var r;
1110
- (r = M == null ? void 0 : M.value) == null || r.playAnimation();
1111
- }, d = () => {
1112
- var r;
1113
- (r = M == null ? void 0 : M.value) == null || r.stopAnimation();
1114
- }, F = () => {
1115
- var r;
1116
- (r = M == null ? void 0 : M.value) == null || r.forwardFrame();
1117
- }, U = () => {
1118
- var r;
1119
- (r = M == null ? void 0 : M.value) == null || r.backwardFrame();
1120
- };
1121
- return ce(() => s.fileBlobs, (r) => {
1122
- if (r && r.length > 0) {
1123
- const n = r[0];
1124
- if (!n.name.toLowerCase().endsWith(".urdf"))
1125
- return;
1126
- W(n).then((q) => {
1127
- _.value = q;
1128
- }).catch((q) => {
1129
- console.error("加载URDF文件时发生错误:", q), J.error("加载urdf模型失败"), _.value = null;
1130
- });
1131
- } else
1132
- _.value = null;
1133
- }, {
1134
- immediate: !0,
1135
- deep: !0
1136
- }), ce(_, (r) => {
1137
- ae(r ? [r] : []), Ce();
1138
- }), Ne(async () => {
1139
- await qe();
1140
- try {
1141
- X(), window.addEventListener("resize", $);
1142
- const r = A();
1143
- h.value = r.scene;
1144
- } catch (r) {
1145
- console.error("Three.js 初始化失败:", r), J.error("渲染引擎初始化失败!");
1146
- }
1147
- }), Oe(() => {
1148
- u.value = "", a.value = "", window.removeEventListener("resize", $), K.value && se(), G(), Ae();
1149
- }), (r, n) => {
1150
- const q = N("el-scrollbar");
1151
- return ne(), ge("div", ll, [
1152
- Q(o("div", {
1153
- ref_key: "threejsContainer",
1154
- ref: V,
1155
- class: "threejs-container"
1156
- }, null, 512), [
1157
- [de, Fe.value]
1158
- ]),
1159
- Q(o("div", ol, [
1160
- o("div", nl, null, 512),
1161
- o("div", al, null, 512)
1162
- ], 512), [
1163
- [de, Ye.value]
1164
- ]),
1165
- o("div", sl, [
1166
- be(r.$slots, "button-top", { switchTopPanel: Pe }, void 0, !0),
1167
- e(E, {
1168
- name: "guanjianjiexi",
1169
- size: "34",
1170
- onClick: n[0] || (n[0] = (v) => Pe("弯管解析"))
1171
- }),
1172
- e(E, {
1173
- name: "guanjiekongzhi",
1174
- size: "34"
1175
- }),
1176
- e(E, {
1177
- name: "gongyishengcheng",
1178
- size: "34"
1179
- }),
1180
- e(E, {
1181
- name: "buchangshezhi",
1182
- size: "34"
1183
- }),
1184
- e(E, {
1185
- name: "shuchujiagongchengxu",
1186
- size: "34"
1187
- }),
1188
- be(r.$slots, "logout", {}, void 0, !0)
1189
- ]),
1190
- o("div", il, [
1191
- e(E, {
1192
- name: "viewReset",
1193
- size: "24",
1194
- onClick: B(R),
1195
- title: "重置"
1196
- }, null, 8, ["onClick"]),
1197
- e(E, {
1198
- name: "fangda",
1199
- size: "24",
1200
- title: "放大",
1201
- onClick: B(H)
1202
- }, null, 8, ["onClick"]),
1203
- e(E, {
1204
- name: "suoxiao",
1205
- size: "24",
1206
- title: "缩小",
1207
- onClick: B(Z)
1208
- }, null, 8, ["onClick"]),
1209
- e(E, {
1210
- name: "lookAround",
1211
- size: "24",
1212
- onClick: B(ue),
1213
- title: B(K) ? "停止动画" : "动画视图"
1214
- }, null, 8, ["onClick", "title"]),
1215
- e(E, {
1216
- name: "zuobiaoxi",
1217
- size: "24",
1218
- active: B(L),
1219
- onClick: ze,
1220
- title: "显隐坐标轴"
1221
- }, null, 8, ["active"])
1222
- ]),
1223
- o("div", rl, [
1224
- e(E, {
1225
- name: "jiegoushu",
1226
- size: "24",
1227
- onClick: n[1] || (n[1] = (v) => l("场景树")),
1228
- active: p.value && u.value === "场景树",
1229
- title: "场景树"
1230
- }, null, 8, ["active"]),
1231
- e(E, {
1232
- name: "clipping",
1233
- size: "24",
1234
- onClick: n[2] || (n[2] = (v) => l("剖面视图")),
1235
- active: p.value && u.value === "剖面视图",
1236
- title: "剖面视图"
1237
- }, null, 8, ["active"]),
1238
- e(E, {
1239
- name: "zhaozi",
1240
- size: "24",
1241
- onClick: n[3] || (n[3] = (v) => l("工件树")),
1242
- active: p.value && u.value === "工件树",
1243
- title: "工件 "
1244
- }, null, 8, ["active"]),
1245
- e(E, {
1246
- name: "donghuafangzhen",
1247
- size: "24",
1248
- onClick: n[4] || (n[4] = (v) => l("场景4"))
1249
- })
1250
- ]),
1251
- o("div", ul, [
1252
- be(r.$slots, "button-right", { switchRightPanel: t }, void 0, !0),
1253
- e(E, {
1254
- name: "donghuafangzhen",
1255
- size: "24"
1256
- }),
1257
- e(E, {
1258
- name: "donghuafangzhen",
1259
- size: "24"
1260
- }),
1261
- e(E, {
1262
- name: "guanjiekongzhi",
1263
- size: "24",
1264
- onClick: n[5] || (n[5] = (v) => t("关节控制")),
1265
- active: b.value && a.value === "关节控制",
1266
- title: "关节控制"
1267
- }, null, 8, ["active"]),
1268
- e(E, {
1269
- name: "donghuafangzhen",
1270
- size: "24",
1271
- title: "动画仿真",
1272
- onClick: n[6] || (n[6] = (v) => t("动画仿真")),
1273
- active: b.value && a.value === "动画仿真"
1274
- }, null, 8, ["active"]),
1275
- e(E, {
1276
- name: "donghuafangzhen",
1277
- size: "24",
1278
- title: "urdf动画",
1279
- onClick: n[7] || (n[7] = (v) => t("urdf动画")),
1280
- active: b.value && a.value === "urdf动画"
1281
- }, null, 8, ["active"]),
1282
- e(E, {
1283
- name: "donghuafangzhen",
1284
- size: "24"
1285
- })
1286
- ]),
1287
- o("div", cl, [
1288
- e(E, {
1289
- name: "kuaitui",
1290
- size: "24",
1291
- backgroundColor: "#ffffff",
1292
- title: "快退",
1293
- onClick: U
1294
- }),
1295
- e(E, {
1296
- name: "bofang",
1297
- size: "24",
1298
- backgroundColor: "#ffffff",
1299
- title: "播放",
1300
- onClick: x
1301
- }),
1302
- e(E, {
1303
- name: "kuaijin",
1304
- size: "24",
1305
- backgroundColor: "#ffffff",
1306
- title: "快进",
1307
- onClick: F
1308
- }),
1309
- e(E, {
1310
- name: "zanting",
1311
- size: "24",
1312
- backgroundColor: "#ffffff",
1313
- title: "暂停",
1314
- onClick: d
1315
- })
1316
- ]),
1317
- Q(o("div", pl, [
1318
- o("div", dl, [
1319
- o("span", null, ve(i.value), 1),
1320
- o("span", {
1321
- class: "close",
1322
- onClick: n[8] || (n[8] = (v) => y.value = !1)
1323
- }, " X ")
1324
- ]),
1325
- o("div", ml, [
1326
- e(q, { height: "100%" }, {
1327
- default: z(() => [
1328
- be(r.$slots, "top-panel", { topPanelType: i.value }, void 0, !0)
1329
- ]),
1330
- _: 3
1331
- })
1332
- ])
1333
- ], 512), [
1334
- [de, y.value]
1335
- ]),
1336
- Q(o("div", vl, [
1337
- o("div", fl, [
1338
- o("span", null, ve(u.value), 1),
1339
- o("span", {
1340
- class: "close",
1341
- onClick: n[9] || (n[9] = (v) => p.value = !1)
1342
- }, " X ")
1343
- ]),
1344
- o("div", gl, [
1345
- e(q, { height: "100%" }, {
1346
- default: z(() => {
1347
- var v;
1348
- return [
1349
- u.value === "场景树" ? (ne(), De(wt, {
1350
- key: 0,
1351
- model: _.value
1352
- }, null, 8, ["model"])) : me("", !0),
1353
- u.value === "剖面视图" ? (ne(), ge("div", hl, [
1354
- o("div", bl, [
1355
- o("label", yl, [
1356
- Q(o("input", {
1357
- type: "radio",
1358
- name: "clipping-axis",
1359
- value: "none",
1360
- "onUpdate:modelValue": n[10] || (n[10] = (I) => ke(j) ? j.value = I : null),
1361
- onChange: n[11] || (n[11] = //@ts-ignore
1362
- (...I) => B(Y) && B(Y)(...I))
1363
- }, null, 544), [
1364
- [xe, B(j)]
1365
- ]),
1366
- n[19] || (n[19] = o("span", { class: "radio-text" }, "无切割", -1))
1367
- ]),
1368
- o("label", _l, [
1369
- Q(o("input", {
1370
- type: "radio",
1371
- name: "clipping-axis",
1372
- value: "x",
1373
- "onUpdate:modelValue": n[12] || (n[12] = (I) => ke(j) ? j.value = I : null),
1374
- onChange: n[13] || (n[13] = //@ts-ignore
1375
- (...I) => B(Y) && B(Y)(...I))
1376
- }, null, 544), [
1377
- [xe, B(j)]
1378
- ]),
1379
- n[20] || (n[20] = o("span", { class: "radio-text" }, "X轴切割", -1))
1380
- ]),
1381
- o("label", wl, [
1382
- Q(o("input", {
1383
- type: "radio",
1384
- name: "clipping-axis",
1385
- value: "y",
1386
- "onUpdate:modelValue": n[14] || (n[14] = (I) => ke(j) ? j.value = I : null),
1387
- onChange: n[15] || (n[15] = //@ts-ignore
1388
- (...I) => B(Y) && B(Y)(...I))
1389
- }, null, 544), [
1390
- [xe, B(j)]
1391
- ]),
1392
- n[21] || (n[21] = o("span", { class: "radio-text" }, "Y轴切割", -1))
1393
- ]),
1394
- o("label", Cl, [
1395
- Q(o("input", {
1396
- type: "radio",
1397
- name: "clipping-axis",
1398
- value: "z",
1399
- "onUpdate:modelValue": n[16] || (n[16] = (I) => ke(j) ? j.value = I : null),
1400
- onChange: n[17] || (n[17] = //@ts-ignore
1401
- (...I) => B(Y) && B(Y)(...I))
1402
- }, null, 544), [
1403
- [xe, B(j)]
1404
- ]),
1405
- n[22] || (n[22] = o("span", { class: "radio-text" }, "Z轴切割", -1))
1406
- ])
1407
- ])
1408
- ])) : me("", !0),
1409
- u.value === "工件树" ? (ne(), De(Qe, {
1410
- key: 2,
1411
- model: (v = B(pe)) == null ? void 0 : v.obj,
1412
- onVisibleChange: B(Re),
1413
- onUpdatePosition: B(Se),
1414
- onUpdateRotation: B($e)
1415
- }, null, 8, ["model", "onVisibleChange", "onUpdatePosition", "onUpdateRotation"])) : me("", !0)
1416
- ];
1417
- }),
1418
- _: 1
1419
- })
1420
- ])
1421
- ], 512), [
1422
- [de, p.value]
1423
- ]),
1424
- Q(o("div", Pl, [
1425
- o("div", kl, [
1426
- o("span", null, ve(a.value), 1),
1427
- o("span", {
1428
- class: "close",
1429
- onClick: n[18] || (n[18] = (v) => b.value = !1)
1430
- }, " X ")
1431
- ]),
1432
- o("div", xl, [
1433
- e(q, { height: "100%" }, {
1434
- default: z(() => [
1435
- Q(e(Ct, { model: _.value }, null, 8, ["model"]), [
1436
- [de, a.value === "关节控制"]
1437
- ]),
1438
- Q(e(Lt, {
1439
- ref_key: "animationPanelRef",
1440
- ref: M,
1441
- model: _.value,
1442
- onGetThreeData: c,
1443
- threeData: s.threeData
1444
- }, null, 8, ["model", "threeData"]), [
1445
- [de, a.value === "动画仿真"]
1446
- ]),
1447
- be(r.$slots, "right-panel", { rightPanelType: a.value }, void 0, !0)
1448
- ]),
1449
- _: 3
1450
- })
1451
- ])
1452
- ], 512), [
1453
- [de, b.value]
1454
- ]),
1455
- D.value ? (ne(), ge("div", Tl, [
1456
- n[23] || (n[23] = o("div", { class: "loading-spinner" }, null, -1)),
1457
- o("p", null, ve(S.value), 1)
1458
- ])) : me("", !0),
1459
- e(tl, {
1460
- ref_key: "pipeAnalysisPanelRef",
1461
- ref: f
1462
- }, null, 512)
1463
- ]);
1464
- };
1465
- }
1466
- }), Ol = /* @__PURE__ */ je(Ml, [["__scopeId", "data-v-3bada747"]]);
1467
- export {
1468
- Ol as default
1469
- };