ss-component-new 1.2.331 → 1.2.333
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.
- package/dist/{MTLLoader-wwr1B193.cjs → MTLLoader-C9zwOo5R.cjs} +1 -1
- package/dist/{MTLLoader-Cp2efv7h.js → MTLLoader-DEhuJ8cA.js} +1 -1
- package/dist/{OrbitControls-Dk0u7TVO.cjs → OrbitControls-CrWBKSTk.cjs} +1 -1
- package/dist/{OrbitControls-RSLz2S0b.js → OrbitControls-hKxTuAne.js} +1 -1
- package/dist/{URDFLoader-CkO4RJLO.cjs → URDFLoader-BHqq00po.cjs} +1 -1
- package/dist/{URDFLoader-BpUMfsF6.js → URDFLoader-BU46gp7K.js} +2 -2
- package/dist/{animationData-C7ciTI7m.js → animationData-BbL90xGU.js} +2 -2
- package/dist/{animationData-BoxVqycf.cjs → animationData-BpQQZnbj.cjs} +1 -1
- package/dist/array-CbS69fPx.cjs +1 -0
- package/dist/{array-CVIR-i--.js → array-g-BzIhKE.js} +12 -12
- package/dist/{iconfont-C2QDZzSl.js → iconfont-gpkjnIRx.js} +2 -2
- package/dist/{iconfont-TZ8GIkZM.cjs → iconfont-m2r8ESph.cjs} +1 -1
- package/dist/{index-Bp1PEp0W.js → index-1ax1erqY.js} +5 -5
- package/dist/{index-DfZf-0j4.js → index-4cqyGWUU.js} +2 -2
- package/dist/{index-BFxYIpIU.js → index-95RC0SB0.js} +8 -9
- package/dist/{index-Bog5kQji.js → index-B0lFT37d.js} +1 -1
- package/dist/{index-081NeEuV.cjs → index-B4XQbv4q.cjs} +1 -1
- package/dist/index-BDGC3yIw.cjs +42 -0
- package/dist/index-BGP7aEbi.cjs +1 -0
- package/dist/{index-CiO2uT4E.cjs → index-BHaaYQfC.cjs} +12 -12
- package/dist/{index-CkO99t26.cjs → index-BQTrub6X.cjs} +1 -1
- package/dist/{index-BGmdJ8Zg.js → index-BS0-LNeC.js} +7 -7
- package/dist/{index-Bos1deWK.cjs → index-BV6P_J2D.cjs} +1 -1
- package/dist/{index-DPeOjfU1.cjs → index-BWIBX9Sl.cjs} +1 -1
- package/dist/index-BfeqiijR.cjs +1 -0
- package/dist/{index-CzKMGoa-.js → index-Bh66WJwb.js} +15 -15
- package/dist/{index-DRvE5S23.js → index-BqjG1Y2Y.js} +16 -17
- package/dist/{index-BWBPdata.cjs → index-C6K5EORF.cjs} +1 -1
- package/dist/index-C9a63MeW.cjs +13 -0
- package/dist/index-CEhfRVcG.cjs +1 -0
- package/dist/index-CErvylUA.cjs +1 -0
- package/dist/{index-DkIWU9Bu.js → index-CGefc7Ak.js} +769 -766
- package/dist/{index-uN57qZre.cjs → index-CHxsrbXy.cjs} +1 -1
- package/dist/{index-B2GT4T1e.cjs → index-CIybeMPI.cjs} +1 -1
- package/dist/index-CKgsrRZt.js +10442 -0
- package/dist/{index-i5Ue_JoA.cjs → index-CKwnphQR.cjs} +1 -1
- package/dist/{index-C2_KHquo.js → index-CM-E1W8F.js} +7 -7
- package/dist/{index-DEF6SrBV.js → index-CUNUX64A.js} +4 -4
- package/dist/{index-BGB8AN7S.js → index-CXx07mqc.js} +38 -38
- package/dist/{index-X2bwtZbV.js → index-CbJ39TR9.js} +14 -14
- package/dist/index-Cbp2cz1D.cjs +1 -0
- package/dist/index-CdqgG6z_.cjs +1 -0
- package/dist/{index-B_SWTmBD.cjs → index-Cexe1_nR.cjs} +1 -1
- package/dist/{index-DdBe7pKL.cjs → index-Cgt2DO86.cjs} +1 -1
- package/dist/{index-DHf9fOS7.js → index-Ch1TDVys.js} +18 -18
- package/dist/{index-DkEJVaAX.js → index-ChKY9Q_c.js} +8 -8
- package/dist/index-Cp8dl8Y4.cjs +1 -0
- package/dist/{index-CkUnZ2se.cjs → index-CzrqxMQq.cjs} +1 -1
- package/dist/{index-DSt_Eqwk.js → index-D-v_mH2L.js} +326 -326
- package/dist/{index-D3oj5RSK.js → index-D7Ejivyg.js} +12 -12
- package/dist/{index-DU4iimmS.cjs → index-D7p_01Bm.cjs} +1 -1
- package/dist/{index-u30t7l7e.js → index-DAw-JFPy.js} +4 -4
- package/dist/{index-DVf8au0C.cjs → index-DJMikZ6m.cjs} +1 -1
- package/dist/{index-Dw0CPCgX.js → index-DJv0U7ep.js} +8 -8
- package/dist/index-DL-scY6_.js +8211 -0
- package/dist/index-DRjfXii0.cjs +1 -0
- package/dist/{index-Z8iuWbfd.js → index-DhBrMxH5.js} +2 -2
- package/dist/index-DjOAHJHD.cjs +11 -0
- package/dist/{index-CY36YclZ.js → index-DkGjjjvX.js} +51 -51
- package/dist/{index-TdIk51gx.js → index-Du5EVvZy.js} +1 -1
- package/dist/{index-BqAHAwh3.js → index-FTgRHaEc.js} +2 -2
- package/dist/{index-CF2oTbnv.js → index-HoGtZJB5.js} +2 -2
- package/dist/{index-CRhbl-Xs.cjs → index-L3o91yA1.cjs} +1 -1
- package/dist/{index-H-RrS-FV.js → index-N7UyY0Cn.js} +8 -9
- package/dist/{index-BAnu2IcW.js → index-OmrdMljT.js} +36 -37
- package/dist/{index-DKKKZSMe.cjs → index-V1en5J1m.cjs} +1 -1
- package/dist/index-cGDJIpua.cjs +11 -0
- package/dist/{index-CDseWBxW.js → index-ihdYLrfi.js} +13 -13
- package/dist/{index-Bg3lrziJ.js → index-mhd92owW.js} +1 -1
- package/dist/index-xkAnmSfa.cjs +1 -0
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BDXu7acs.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BYcd0jgi.cjs} +147 -147
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BXs-wWd7.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js} +14 -14
- package/dist/index.vue_vue_type_style_index_1_lang-D3aPbrch.cjs +3 -0
- package/dist/{index.vue_vue_type_style_index_1_lang-BzNe13gn.js → index.vue_vue_type_style_index_1_lang-D4T1pSpg.js} +8 -8
- package/dist/{isString-DDsphIfV.cjs → isString-BM0aTbV9.cjs} +1 -1
- package/dist/{isString-D0BsYbM3.js → isString-DkWdJm3P.js} +1 -1
- package/dist/main-BAe55yT4.cjs +11 -0
- package/dist/{main-BEgGvauC.js → main-DLYiVNbO.js} +9 -10
- package/dist/{menuIndex-BLcswWB-.js → menuIndex-4B2w4mPA.js} +1 -1
- package/dist/{menuIndex-bwSbtzjl.cjs → menuIndex-CJYZx11j.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/{threeModel-CsoaXy4U.cjs → threeModel-5zOGJMgA.cjs} +1 -1
- package/dist/{threeModel-o-U3qE_Y.js → threeModel-CGM-saVm.js} +6 -6
- package/dist/{threePreview-B9pRhKDM.js → threePreview-BRK8_lKV.js} +7 -6
- package/dist/threePreview-BkKC0IgX.cjs +1 -0
- package/dist/{threeSceneView-DRPX8OYV.js → threeSceneView-5V5smS73.js} +53 -53
- package/dist/{threeSceneView-DN8Xyzfv.cjs → threeSceneView-BCQKeoTk.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BCTxqfOq.cjs → threeSceneViewForCPMPIP-DVqwxUS8.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-B_SeEcU9.js → threeSceneViewForCPMPIP-DqG9ZYEL.js} +15 -15
- package/dist/threeTrackPathView-BrBEbTGo.cjs +1 -0
- package/dist/{threeTrackPathView-C-bjSsJM.js → threeTrackPathView-CBKRfkly.js} +8 -7
- package/dist/{threeViewerHost-irhPdb16.js → threeViewerHost-CTAXJC99.js} +10 -11
- package/dist/threeViewerHost-QHAFlASe.cjs +1 -0
- package/dist/{urdfTree-5g-HLyvW.js → urdfTree-DAM1Wv4K.js} +1 -1
- package/dist/{urdfTree-S5yUGyZL.cjs → urdfTree-DNQtn8Y5.cjs} +1 -1
- package/dist/{workpieceTreePanel-BaLWAZDy.js → workpieceTreePanel-B8WM9_Wb.js} +4 -4
- package/dist/{workpieceTreePanel-hlLH8y_h.cjs → workpieceTreePanel-DKMsi2D-.cjs} +1 -1
- package/package.json +1 -1
- package/dist/array-Bi-wunyk.cjs +0 -1
- package/dist/index-BEqVDCR5.cjs +0 -1
- package/dist/index-BVMFNtUY.cjs +0 -11
- package/dist/index-BV_kcZph.js +0 -12765
- package/dist/index-Bc85VROV.cjs +0 -32
- package/dist/index-BhpB-M-v.cjs +0 -13
- package/dist/index-BxQs7JCB.cjs +0 -1
- package/dist/index-CQ5cuVUq.cjs +0 -1
- package/dist/index-CjrO5PEa.cjs +0 -1
- package/dist/index-CoaLtkUJ.cjs +0 -1
- package/dist/index-Df5Gg8qa.cjs +0 -1
- package/dist/index-DmDnw4T-.cjs +0 -1
- package/dist/index-UbLqf_y6.cjs +0 -1
- package/dist/index-cx0rUqLg.js +0 -5929
- package/dist/index-k04UdLA7.cjs +0 -1
- package/dist/index-pSTYzLRc.cjs +0 -21
- package/dist/index.vue_vue_type_style_index_1_lang-OiQttjIF.cjs +0 -3
- package/dist/main-BDV5VAB6.cjs +0 -11
- package/dist/threePreview-CGRM7OHr.cjs +0 -1
- package/dist/threeTrackPathView-Dkc-x5Po.cjs +0 -1
- package/dist/threeViewerHost-e0FA2tJj.cjs +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as Le, ref as h, watch as ne, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as U, createElementBlock as Te, openBlock as Q, createElementVNode as u, createVNode as l, withCtx as M, createBlock as ye, createCommentVNode as ke, unref as X, toDisplayString as he, onMounted as Ge, onBeforeUnmount as Ze, Fragment as He, renderList as
|
|
2
|
-
import { r as De, s as Ye } from "./threeViewerHost-
|
|
3
|
-
import { u as Je, a as Qe, b as et, C as tt } from "./iconfont-
|
|
4
|
-
import { U as lt, u as ot, a as at, W as nt } from "./workpieceTreePanel-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import "./index.
|
|
1
|
+
import { defineComponent as Le, ref as h, watch as ne, shallowRef as be, computed as Pe, onUnmounted as Ie, resolveComponent as U, createElementBlock as Te, openBlock as Q, createElementVNode as u, createVNode as l, withCtx as M, 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 De, s as Ye } from "./threeViewerHost-CTAXJC99.js";
|
|
3
|
+
import { u as Je, a as Qe, b as et, C as tt } from "./iconfont-gpkjnIRx.js";
|
|
4
|
+
import { U as lt, u as ot, a as at, W as nt } from "./workpieceTreePanel-B8WM9_Wb.js";
|
|
5
|
+
import { c as st } from "./index-CKgsrRZt.js";
|
|
6
|
+
import { a6 as it, E, ar as rt, an as ct } from "./index-DL-scY6_.js";
|
|
7
|
+
import { a8 as Ve, a9 as xe, V, a6 as H, a7 as ut, ay as pt, Z as Se, az as dt, aA as mt, aB as vt, aC as ft, aD as gt, aE as ht, aF as bt, aG as yt, a3 as _t, aH as Be, aI as wt, aJ as Ct, aK as kt } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js";
|
|
8
|
+
import "./index.vue_vue_type_style_index_1_lang-D4T1pSpg.js";
|
|
8
9
|
import "./index-BHtNKL1L.js";
|
|
9
10
|
import { _ as me } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
10
|
-
import "./index-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { g as Dt, a as Tt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-5g-HLyvW.js";
|
|
11
|
+
import "./index-CbJ39TR9.js";
|
|
12
|
+
import { f as Pt, a as xt, g as Rt, b as Mt } from "./animationData-BbL90xGU.js";
|
|
13
|
+
import { g as Dt, a as Tt, b as Vt, c as St, U as At, J as $t } from "./urdfTree-DAM1Wv4K.js";
|
|
14
14
|
import { _ as Ue } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
15
|
-
import { s as Ft } from "./index-
|
|
15
|
+
import { s as Ft } from "./index-B0lFT37d.js";
|
|
16
16
|
import { T as Y } from "./svgIcon-4u4PW7Is.js";
|
|
17
|
-
const I = 1e-3, oe =
|
|
17
|
+
const I = 1e-3, oe = ut.degToRad, Ee = new dt({
|
|
18
18
|
// 灰色
|
|
19
19
|
color: 13421772,
|
|
20
20
|
metalness: 0.3,
|
|
21
21
|
roughness: 0.6,
|
|
22
|
-
side:
|
|
22
|
+
side: _t
|
|
23
23
|
});
|
|
24
24
|
function zt(y = 5e-3, v = 64) {
|
|
25
25
|
const d = new Ve([new V(0, 0, 0), new V(0, 0, 0)]), a = new xe(d, v, y, 16, !1), m = Ee;
|
|
@@ -51,7 +51,7 @@ const Ne = (y) => y.reduce((v, d) => {
|
|
|
51
51
|
return v;
|
|
52
52
|
};
|
|
53
53
|
function Yt(y, v) {
|
|
54
|
-
const d = new
|
|
54
|
+
const d = new pt();
|
|
55
55
|
d.name = "CompletePipe";
|
|
56
56
|
const a = {
|
|
57
57
|
pos: new V(0, 0, 0),
|
|
@@ -105,25 +105,25 @@ function Yt(y, v) {
|
|
|
105
105
|
return d;
|
|
106
106
|
}
|
|
107
107
|
function Bt(y, v, d, a) {
|
|
108
|
-
const m = new V(0, a * 2, a * 5), _ = d.clone().add(m), s = [d, _], b = new
|
|
108
|
+
const m = new V(0, a * 2, a * 5), _ = d.clone().add(m), s = [d, _], b = new vt().setFromPoints(s), f = new ft({
|
|
109
109
|
color: 16711680,
|
|
110
110
|
dashSize: a * 0.5,
|
|
111
111
|
gapSize: a * 0.3,
|
|
112
112
|
linewidth: 1
|
|
113
|
-
}), w = new
|
|
113
|
+
}), w = new gt(b, f);
|
|
114
114
|
w.computeLineDistances(), y.add(w);
|
|
115
115
|
const n = document.createElement("canvas"), C = n.getContext("2d");
|
|
116
116
|
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(v.toString(), 64, 64);
|
|
117
|
-
const p = new
|
|
117
|
+
const p = new ht(n), k = new bt({
|
|
118
118
|
map: p,
|
|
119
119
|
transparent: !0,
|
|
120
120
|
depthTest: !1,
|
|
121
121
|
depthWrite: !1
|
|
122
|
-
}), r = new
|
|
122
|
+
}), r = new yt(k), c = a * 3;
|
|
123
123
|
r.scale.set(c, c, 1), r.position.copy(_), r.name = `Label_${v}`, r.userData = { labelNumber: v }, y.add(r);
|
|
124
124
|
}
|
|
125
125
|
function Lt(y, v, d) {
|
|
126
|
-
const a = new
|
|
126
|
+
const a = new mt(y, v), m = new xe(a, 2, d, 18, !1);
|
|
127
127
|
return new Se(m, Ee);
|
|
128
128
|
}
|
|
129
129
|
function Ut(y, v) {
|
|
@@ -270,8 +270,8 @@ const Et = { class: "panel-content" }, jt = { class: "action-bar" }, Ot = { clas
|
|
|
270
270
|
animationData: R
|
|
271
271
|
} = e;
|
|
272
272
|
$.value = o, g.value = t, T.value = i, a.value = R;
|
|
273
|
-
const x =
|
|
274
|
-
s.value =
|
|
273
|
+
const x = st(a.value), le = fe(G.value), q = (x == null ? void 0 : x["输出(动画数据)"]) || [];
|
|
274
|
+
s.value = q.length ? q : [le];
|
|
275
275
|
}, s = h([]), b = h(!1), f = h(""), w = h(!1), n = h(0), C = h(0), p = h(1e3);
|
|
276
276
|
let k = !1;
|
|
277
277
|
const r = h(null), c = be(null), D = be(null), A = be(null), $ = h(0), g = h(12.5), T = h(30), B = h([]), L = h(null), Z = Pe(() => d.model ? Dt(d.model).map((t) => t.name) : []), ee = h(["Y", "B", "C", "R"]), G = Pe(() => [...Z.value, ...ee.value]), _e = Pe(() => G.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
@@ -285,14 +285,14 @@ ${G.value.join(" ")}
|
|
|
285
285
|
})), se = () => {
|
|
286
286
|
const e = [], o = [];
|
|
287
287
|
return s.value.forEach((t) => {
|
|
288
|
-
const { Y1: i, B1: R, C1: x, R1: le, Y2:
|
|
288
|
+
const { Y1: i, B1: R, C1: x, R1: le, Y2: q, B2: ue, C2: Ce, R2: z } = t;
|
|
289
289
|
e.push({
|
|
290
290
|
Y: parseFloat(i) || 0,
|
|
291
291
|
B: parseFloat(R) || 0,
|
|
292
292
|
C: parseFloat(x) || 0,
|
|
293
293
|
R: parseFloat(le) || 0
|
|
294
294
|
}), o.push({
|
|
295
|
-
Y: parseFloat(
|
|
295
|
+
Y: parseFloat(q) || 0,
|
|
296
296
|
B: parseFloat(ue) || 0,
|
|
297
297
|
C: parseFloat(Ce) || 0,
|
|
298
298
|
R: parseFloat(z) || 0
|
|
@@ -393,7 +393,7 @@ ${G.value.join(" ")}
|
|
|
393
393
|
}
|
|
394
394
|
}, te = () => {
|
|
395
395
|
r.value && r.value.resetToZero(), O(), N(), E.success("机器人和管件已重置");
|
|
396
|
-
},
|
|
396
|
+
}, K = (e) => `第 ${e + 1} 帧`, W = (e) => {
|
|
397
397
|
w.value && j(), P(e);
|
|
398
398
|
}, ie = () => {
|
|
399
399
|
w.value && j(), !(n.value + 1 >= s.value.length) && P(n.value + 1);
|
|
@@ -484,20 +484,20 @@ ${G.value.join(" ")}
|
|
|
484
484
|
return;
|
|
485
485
|
}
|
|
486
486
|
const R = e.slice(1).map((x) => {
|
|
487
|
-
const le = x.split(" "),
|
|
487
|
+
const le = x.split(" "), q = {};
|
|
488
488
|
return G.value.forEach((ue) => {
|
|
489
|
-
|
|
489
|
+
q[ue] = "0";
|
|
490
490
|
}), Object.entries(t).forEach(([ue, Ce]) => {
|
|
491
491
|
const z = le[parseInt(ue)];
|
|
492
|
-
z !== void 0 && z.trim() !== "" && (
|
|
493
|
-
}),
|
|
492
|
+
z !== void 0 && z.trim() !== "" && (q[Ce] = z.trim());
|
|
493
|
+
}), q;
|
|
494
494
|
});
|
|
495
495
|
R.length > 0 ? (s.value = R, E.success(`成功导入 ${R.length} 行数据!`), b.value = !1, f.value = "") : E.error("未能解析到有效数据,请检查格式。");
|
|
496
496
|
};
|
|
497
497
|
return Ie(() => {
|
|
498
498
|
ae(), k = !0;
|
|
499
499
|
}), v({ playAnimation: J, stopAnimation: j, forwardFrame: ie, backwardFrame: F }), (e, o) => {
|
|
500
|
-
const t = U("el-icon"), i = U("el-input-number"), R = U("el-form-item"), x = U("el-form"), le = U("el-slider"),
|
|
500
|
+
const t = U("el-icon"), i = U("el-input-number"), R = U("el-form-item"), x = U("el-form"), le = U("el-slider"), q = U("el-progress"), ue = U("el-input"), Ce = U("el-dialog");
|
|
501
501
|
return Q(), Te("div", Et, [
|
|
502
502
|
u("div", jt, [
|
|
503
503
|
l(me, {
|
|
@@ -521,7 +521,7 @@ ${G.value.join(" ")}
|
|
|
521
521
|
class: "is-loading"
|
|
522
522
|
}, {
|
|
523
523
|
default: M(() => [
|
|
524
|
-
l(X(
|
|
524
|
+
l(X(it))
|
|
525
525
|
]),
|
|
526
526
|
_: 1
|
|
527
527
|
})) : ke("", !0)
|
|
@@ -623,14 +623,14 @@ ${G.value.join(" ")}
|
|
|
623
623
|
min: 0,
|
|
624
624
|
max: s.value.length > 0 ? s.value.length - 1 : 0,
|
|
625
625
|
step: 1,
|
|
626
|
-
"format-tooltip":
|
|
626
|
+
"format-tooltip": K,
|
|
627
627
|
onInput: W,
|
|
628
628
|
disabled: s.value.length === 0,
|
|
629
629
|
style: { "flex-grow": "1", margin: "0 10px" }
|
|
630
630
|
}, null, 8, ["modelValue", "max", "disabled"])
|
|
631
631
|
]),
|
|
632
632
|
u("div", Nt, [
|
|
633
|
-
l(
|
|
633
|
+
l(q, {
|
|
634
634
|
percentage: C.value,
|
|
635
635
|
"show-text": !1,
|
|
636
636
|
"stroke-width": 6
|
|
@@ -672,17 +672,17 @@ ${G.value.join(" ")}
|
|
|
672
672
|
]);
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
}), Ht = /* @__PURE__ */ Ue(It, [["__scopeId", "data-v-49a19db9"]]),
|
|
676
|
-
const v = await Rt(["工件库", "弯管"]), d = Be("工件列表", v), a =
|
|
675
|
+
}), Ht = /* @__PURE__ */ Ue(It, [["__scopeId", "data-v-49a19db9"]]), Kt = async () => {
|
|
676
|
+
const v = await Rt(["工件库", "弯管"]), d = Be("工件列表", v), a = wt(d);
|
|
677
677
|
return a == null ? void 0 : a.map((_) => ({
|
|
678
678
|
name: _,
|
|
679
679
|
mainKey: _
|
|
680
680
|
}));
|
|
681
|
-
},
|
|
682
|
-
const d = await
|
|
681
|
+
}, qt = async (y) => {
|
|
682
|
+
const d = await Ct(["工件库", "弯管"], y), a = Be("弯管基础参数", d), m = Be("弯管特征尺寸", d), _ = {
|
|
683
683
|
outerDiameter: 0,
|
|
684
684
|
ybcrList: []
|
|
685
|
-
}, s = Mt(a), b =
|
|
685
|
+
}, s = Mt(a), b = kt(m);
|
|
686
686
|
return _.outerDiameter = (s == null ? void 0 : s.外径) || 0, _.ybcrList = b || [], _;
|
|
687
687
|
}, 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" }, al = { class: "input-params" }, nl = { class: "pipe-analysis-output" }, sl = { class: "ouput-params" }, il = /* @__PURE__ */ Le({
|
|
688
688
|
__name: "pipeAnalysisPanel",
|
|
@@ -724,14 +724,14 @@ ${G.value.join(" ")}
|
|
|
724
724
|
const { form: S, list: P } = g.value, {
|
|
725
725
|
outerDiameter: J
|
|
726
726
|
} = S, j = J / 2, N = P == null ? void 0 : P.map((te) => {
|
|
727
|
-
const { y:
|
|
727
|
+
const { y: K, b: W, c: ie, r: F, Y: ae, B: fe, C: re, R: we } = te;
|
|
728
728
|
return ae ? {
|
|
729
729
|
Y: ae,
|
|
730
730
|
B: fe,
|
|
731
731
|
C: re,
|
|
732
732
|
R: we
|
|
733
733
|
} : {
|
|
734
|
-
Y:
|
|
734
|
+
Y: K,
|
|
735
735
|
B: W,
|
|
736
736
|
C: ie,
|
|
737
737
|
R: F
|
|
@@ -748,10 +748,10 @@ ${G.value.join(" ")}
|
|
|
748
748
|
}, _e = () => {
|
|
749
749
|
ee.value = !0;
|
|
750
750
|
}, ve = async () => {
|
|
751
|
-
const S = await
|
|
751
|
+
const S = await Kt();
|
|
752
752
|
$(S);
|
|
753
753
|
}, se = async (S) => {
|
|
754
|
-
const P = await
|
|
754
|
+
const P = await qt(S);
|
|
755
755
|
T(P);
|
|
756
756
|
};
|
|
757
757
|
return ne(() => g, () => {
|
|
@@ -773,7 +773,7 @@ ${G.value.join(" ")}
|
|
|
773
773
|
}), Ze(() => {
|
|
774
774
|
window.removeEventListener("resize", f), n();
|
|
775
775
|
}), v({ openDialog: _e }), (S, P) => {
|
|
776
|
-
const J = U("el-icon"), j = U("el-option"), N = U("el-select"), O = U("el-form-item"), te = U("el-form"),
|
|
776
|
+
const J = U("el-icon"), j = U("el-option"), N = U("el-select"), O = U("el-form-item"), te = U("el-form"), K = U("el-input"), W = U("el-table-column"), ie = U("el-table");
|
|
777
777
|
return Q(), ye(Ft, {
|
|
778
778
|
class: "pipe-analysis-dialog",
|
|
779
779
|
visible: ee.value,
|
|
@@ -790,13 +790,13 @@ ${G.value.join(" ")}
|
|
|
790
790
|
u("div", el, [
|
|
791
791
|
l(J, null, {
|
|
792
792
|
default: M(() => [
|
|
793
|
-
l(X(
|
|
793
|
+
l(X(rt), { onClick: Z })
|
|
794
794
|
]),
|
|
795
795
|
_: 1
|
|
796
796
|
}),
|
|
797
797
|
l(J, null, {
|
|
798
798
|
default: M(() => [
|
|
799
|
-
l(X(
|
|
799
|
+
l(X(ct), { onClick: G })
|
|
800
800
|
]),
|
|
801
801
|
_: 1
|
|
802
802
|
})
|
|
@@ -826,7 +826,7 @@ ${G.value.join(" ")}
|
|
|
826
826
|
onChange: se
|
|
827
827
|
}, {
|
|
828
828
|
default: M(() => [
|
|
829
|
-
(Q(!0), Te(He, null,
|
|
829
|
+
(Q(!0), Te(He, null, Ke(A.value, (F) => (Q(), ye(j, {
|
|
830
830
|
label: F.name,
|
|
831
831
|
value: F.mainKey
|
|
832
832
|
}, null, 8, ["label", "value"]))), 256))
|
|
@@ -877,7 +877,7 @@ ${G.value.join(" ")}
|
|
|
877
877
|
default: M(() => [
|
|
878
878
|
l(O, { label: "管长" }, {
|
|
879
879
|
default: M(() => [
|
|
880
|
-
l(
|
|
880
|
+
l(K, {
|
|
881
881
|
modelValue: g.value.form.length,
|
|
882
882
|
"onUpdate:modelValue": P[2] || (P[2] = (F) => g.value.form.length = F)
|
|
883
883
|
}, null, 8, ["modelValue"])
|
|
@@ -886,7 +886,7 @@ ${G.value.join(" ")}
|
|
|
886
886
|
}),
|
|
887
887
|
l(O, { label: "外径" }, {
|
|
888
888
|
default: M(() => [
|
|
889
|
-
l(
|
|
889
|
+
l(K, {
|
|
890
890
|
modelValue: g.value.form.outerDiameter,
|
|
891
891
|
"onUpdate:modelValue": P[3] || (P[3] = (F) => g.value.form.outerDiameter = F)
|
|
892
892
|
}, null, 8, ["modelValue"])
|
|
@@ -895,7 +895,7 @@ ${G.value.join(" ")}
|
|
|
895
895
|
}),
|
|
896
896
|
l(O, { label: "内径" }, {
|
|
897
897
|
default: M(() => [
|
|
898
|
-
l(
|
|
898
|
+
l(K, {
|
|
899
899
|
modelValue: g.value.form.innerDiameter,
|
|
900
900
|
"onUpdate:modelValue": P[4] || (P[4] = (F) => g.value.form.innerDiameter = F)
|
|
901
901
|
}, null, 8, ["modelValue"])
|
|
@@ -904,7 +904,7 @@ ${G.value.join(" ")}
|
|
|
904
904
|
}),
|
|
905
905
|
l(O, { label: "壁厚" }, {
|
|
906
906
|
default: M(() => [
|
|
907
|
-
l(
|
|
907
|
+
l(K, {
|
|
908
908
|
modelValue: g.value.form.thickness,
|
|
909
909
|
"onUpdate:modelValue": P[5] || (P[5] = (F) => g.value.form.thickness = F)
|
|
910
910
|
}, null, 8, ["modelValue"])
|
|
@@ -990,7 +990,7 @@ ${G.value.join(" ")}
|
|
|
990
990
|
D,
|
|
991
991
|
_,
|
|
992
992
|
s
|
|
993
|
-
), { isAnimating: se, toggleAnimation: S, startAnimation: P, stopAnimation: J } = Qe(T, D), { isClipping: j, activeClippingAxis: N, toggleClipping: O, updateClippingPlanes: te } = et(T, D), { initRaycaster:
|
|
993
|
+
), { isAnimating: se, toggleAnimation: S, startAnimation: P, stopAnimation: J } = Qe(T, D), { isClipping: j, activeClippingAxis: N, toggleClipping: O, updateClippingPlanes: te } = et(T, D), { initRaycaster: K, selectedObject3D: W, setSelectedObjVisible: ie, updatePosition: F, updateRotation: ae, dispose: fe } = ot(a, T, D), re = () => {
|
|
994
994
|
ee();
|
|
995
995
|
}, we = (t) => {
|
|
996
996
|
N.value = t, te();
|
|
@@ -1027,11 +1027,11 @@ ${G.value.join(" ")}
|
|
|
1027
1027
|
immediate: !0,
|
|
1028
1028
|
deep: !0
|
|
1029
1029
|
}), ne(k, (t) => {
|
|
1030
|
-
L(t ? [t] : []),
|
|
1030
|
+
L(t ? [t] : []), K();
|
|
1031
1031
|
});
|
|
1032
1032
|
let o = null;
|
|
1033
1033
|
return Ge(async () => {
|
|
1034
|
-
await
|
|
1034
|
+
await qe();
|
|
1035
1035
|
try {
|
|
1036
1036
|
$(), a.value && (o = new ResizeObserver(g), o.observe(a.value));
|
|
1037
1037
|
const t = T();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ne=require("./threeViewerHost-QHAFlASe.cjs"),pe=require("./iconfont-m2r8ESph.cjs"),ve=require("./workpieceTreePanel-DKMsi2D-.cjs"),Me=require("./index-BDGC3yIw.cjs"),B=require("./index-DjOAHJHD.cjs"),n=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BYcd0jgi.cjs");require("./index.vue_vue_type_style_index_1_lang-D3aPbrch.cjs");require("./index-BpPyaNFa.cjs");const le=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs");require("./index-Cgt2DO86.cjs");const fe=require("./animationData-BpQQZnbj.cjs"),ie=require("./urdfTree-DNQtn8Y5.cjs"),we=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),Te=require("./index-D7p_01Bm.cjs"),R=require("./svgIcon-CDPAgQbj.cjs"),G=.001,W=n.MathUtils.degToRad,ye=new n.MeshStandardMaterial({color:13421772,metalness:.3,roughness:.6,side:n.DoubleSide});function Ee(V=.005,v=64){const p=new n.CatmullRomCurve3([new n.Vector3(0,0,0),new n.Vector3(0,0,0)]),a=new n.TubeGeometry(p,v,V,16,!1),m=ye;return new n.Mesh(a,m)}const xe=V=>V.reduce((v,p)=>{let a=0;const m=p.Y??0,b=p.C??0,s=p.R??0;return m>0&&(a+=m),b>0&&s>0&&(a+=s*W(b)),v+a},0),ke=V=>{const v=[],p=V.Y??0,a=V.B??0,m=V.C??0,b=V.R??0,s={pos:new n.Vector3(0,0,0),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};if(!p&&!m)return v;if(v.push(s.pos.clone()),a!==0){const g=new n.Matrix4().makeRotationAxis(s.localY,W(a));s.localX.applyMatrix4(g),s.localZ.applyMatrix4(g)}if(p>0&&(s.pos.add(s.localY.clone().multiplyScalar(p*G)),v.push(s.pos.clone())),m>0&&b>0){const g=W(m),f=b*G,w=s.pos.clone().add(s.localX.clone().multiplyScalar(-f)),r=Math.max(16,Math.ceil(m/5));for(let y=1;y<=r;y++){const d=g*y/r,_=new n.Matrix4().makeRotationAxis(s.localZ,d),u=s.localX.clone().multiplyScalar(f).applyMatrix4(_),k=w.clone().add(u);v.push(k)}}return v};function Se(V,v){const p=new n.Group;p.name="CompletePipe";const a={pos:new n.Vector3(0,0,0),localX:new n.Vector3(1,0,0),localY:new n.Vector3(0,1,0),localZ:new n.Vector3(0,0,1)};let m=0,b=1;for(let s=0;s<V.length;s++){const g=V[s],f=g.Y??0,w=g.B??0,r=g.C??0,y=g.R??0;if(w!==0){const d=new n.Matrix4().makeRotationAxis(a.localY,W(w));a.localX.applyMatrix4(d),a.localZ.applyMatrix4(d)}if(f>0){const d=a.pos.clone();a.pos.add(a.localY.clone().multiplyScalar(f*G));const _=a.pos.clone(),c=De(d,_,v*G);c.userData={segmentType:"straight",segmentIndex:m,frameIndex:s,length:f,frame:{Y:f,B:w,C:r,R:y}},c.name=`直段_${m}`,p.add(c);const u=d.clone();Pe(p,b,u,v*G),m++}if(r>0&&y>0){const d=W(r),_=y*G,c=[];c.push(a.pos.clone());const u=a.pos.clone().add(a.localX.clone().multiplyScalar(-_)),k=Math.max(16,Math.ceil(r/5));for(let h=1;h<=k;h++){const M=d*h/k,A=new n.Matrix4().makeRotationAxis(a.localZ,M),L=a.localX.clone().multiplyScalar(_).applyMatrix4(A),q=u.clone().add(L);c.push(q)}const E=Re(c,v*G);E.userData={segmentType:"bend",segmentIndex:m,frameIndex:s,angle:r,radius:y,centerPoint:u.toArray(),frame:{Y:f,B:w,C:r,R:y}},E.name=`弯段_${m}`,p.add(E),Math.floor(c.length/2),c[0],a.pos=c[c.length-1].clone();const S=new n.Matrix4().makeRotationAxis(a.localZ,d);a.localY.applyMatrix4(S),a.localX.applyMatrix4(S),m++,b++}}return p}function Pe(V,v,p,a){const m=new n.Vector3(0,a*2,a*5),b=p.clone().add(m),s=[p,b],g=new n.BufferGeometry().setFromPoints(s),f=new n.LineDashedMaterial({color:16711680,dashSize:a*.5,gapSize:a*.3,linewidth:1}),w=new n.Line(g,f);w.computeLineDistances(),V.add(w);const r=document.createElement("canvas"),y=r.getContext("2d");r.width=128,r.height=128,y.clearRect(0,0,128,128),y.fillStyle="#FF0000",y.font="bold 80px Arial",y.textAlign="center",y.textBaseline="middle",y.fillText(v.toString(),64,64);const d=new n.CanvasTexture(r),_=new n.SpriteMaterial({map:d,transparent:!0,depthTest:!1,depthWrite:!1}),c=new n.Sprite(_),u=a*3;c.scale.set(u,u,1),c.position.copy(b),c.name=`Label_${v}`,c.userData={labelNumber:v},V.add(c)}function De(V,v,p){const a=new n.LineCurve3(V,v),m=new n.TubeGeometry(a,2,p,18,!1);return new n.Mesh(m,ye)}function Re(V,v){const p=new n.CatmullRomCurve3(V,!1,"catmullrom",.01),a=new n.TubeGeometry(p,Math.max(16,V.length*2),v,18,!1);return new n.Mesh(a,ye)}function _e(V,v,p,a,m,b=0){let s=v.slice(0,m+1);const g=v[m+1];if(g&&b>0){const c={...g,B:(g.B??0)*b,C:(g.C??0)*b};s.push(c)}const f=xe(s),w=Math.max(0,p-f),r=[];r.push(new n.Vector3(0,0,0));const y=new n.Vector3(0,w*G,0);w>0&&r.push(y);let d={pos:y.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const _=[];for(let c=s.length-1;c>=0;c--){const u=s[c],k=ke(u);if(k.length>0){const E=k.map(A=>{const $=A.clone(),L=new n.Matrix4;return L.makeBasis(d.localX,d.localY,d.localZ),$.applyMatrix4(L),$.add(d.pos)});_.push(E);const S=E[E.length-1];d.pos=S.clone();const h=u.B??0,M=u.C??0;if(h!==0){const A=new n.Matrix4().makeRotationAxis(d.localY,W(h));d.localX.applyMatrix4(A),d.localZ.applyMatrix4(A)}if(M>0){const A=W(M),$=new n.Matrix4().makeRotationAxis(d.localZ,A);d.localY.applyMatrix4($),d.localX.applyMatrix4($)}}}for(const c of _)c.length>1&&r.push(...c.slice(1));r.length<2&&r.push(new n.Vector3(0,.001,0));try{const c=new n.CatmullRomCurve3(r,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,r.length*4),a*G,18,!1);V.geometry.dispose(),V.geometry=u}catch(c){console.error("管件更新失败",c)}}function Ce(V,v,p,a=0){let m=V.slice(0,p+1);const b=V[p+1];if(b&&a>0){const d={...b,B:(b.B??0)*a,C:(b.C??0)*a};m.push(d)}const s=xe(m),g=Math.max(0,v-s),f=[];f.push(new n.Vector3(0,0,0));const w=new n.Vector3(0,g*G,0);g>0&&f.push(w);let r={pos:w.clone(),localY:new n.Vector3(0,1,0),localX:new n.Vector3(1,0,0),localZ:new n.Vector3(0,0,1)};const y=[];for(let d=m.length-1;d>=0;d--){const _=m[d],c=ke(_);if(c.length>0){const u=c.map(h=>{const M=h.clone(),A=new n.Matrix4;return A.makeBasis(r.localX,r.localY,r.localZ),M.applyMatrix4(A),M.add(r.pos)});y.push(u);const k=u[u.length-1];r.pos=k.clone();const E=_.B??0,S=_.C??0;if(E!==0){const h=new n.Matrix4().makeRotationAxis(r.localY,W(E));r.localX.applyMatrix4(h),r.localZ.applyMatrix4(h)}if(S>0){const h=W(S),M=new n.Matrix4().makeRotationAxis(r.localZ,h);r.localY.applyMatrix4(M),r.localX.applyMatrix4(M)}}}for(const d of y)d.length>1&&f.push(...d.slice(1));return f.length<2&&f.push(new n.Vector3(0,.001,0)),f}function Ne(V,v,p,a,m,b,s,g=0,f=0){const w=m-f,r=Ce(a,w,s,g);let d=Ce(p,f,s,g);d.forEach(c=>c.y=-c.y),d.reverse();const _=[...d,...r];try{const c=new n.CatmullRomCurve3(_,!1,"catmullrom",.01),u=new n.TubeGeometry(c,Math.max(2,_.length*4),b*G,18,!1);v.geometry.dispose(),V.geometry.dispose(),v.parent&&v.parent.remove(v),V.geometry=u}catch(c){console.error("管件更新失败",c)}}const Be={class:"panel-content"},Ae={class:"action-bar"},$e={class:"animation-controls"},Fe={class:"control-row"},ze={class:"control-row"},Ye={class:"frame-info"},Le={class:"control-row"},Ue={class:"progress-bar"},Ie={class:"dialog-footer"},je=e.defineComponent({__name:"animationPanel",props:{model:{},threeData:{}},setup(V,{expose:v}){const p=V,a=e.ref(),m=e.ref();e.watch(()=>p.threeData,t=>{const l=t==null?void 0:t.data;m.value=l==null?void 0:l.type},{immediate:!0});const b=async()=>{let t={};m.value===ne.robotMode.SINGLE&&(t=await fe.fetchSingleRobotAnimationData()),m.value===ne.robotMode.DOUBLE&&(t=await fe.fetchDoubleRobotAnimationData());const{initialPipeLength:l=0,pipeRadius:o=0,clampLength:i=0,animationData:x}=t;S.value=l,h.value=o,M.value=i,a.value=x;const N=Me.cloneDeep(a.value),J=re(Y.value),X=(N==null?void 0:N["输出(动画数据)"])||[];s.value=X.length?X:[J]},s=e.ref([]),g=e.ref(!1),f=e.ref(""),w=e.ref(!1),r=e.ref(0),y=e.ref(0),d=e.ref(1e3);let _=!1;const c=e.ref(null),u=e.shallowRef(null),k=e.shallowRef(null),E=e.shallowRef(null),S=e.ref(0),h=e.ref(12.5),M=e.ref(30),A=e.ref([]),$=e.ref(null),L=e.computed(()=>p.model?ie.getNonFixedJoints(p.model).map(o=>o.name):[]),q=e.ref(["Y","B","C","R"]),Y=e.computed(()=>[...L.value,...q.value]),ce=e.computed(()=>Y.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${Y.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),ae=()=>s.value.map(t=>({Y:parseFloat(t.Y)||0,B:parseFloat(t.B)||0,C:parseFloat(t.C)||0,R:parseFloat(t.R)||0})),K=()=>{const t=[],l=[];return s.value.forEach(o=>{const{Y1:i,B1:x,C1:N,R1:J,Y2:X,B2:oe,C2:de,R2:D}=o;t.push({Y:parseFloat(i)||0,B:parseFloat(x)||0,C:parseFloat(N)||0,R:parseFloat(J)||0}),l.push({Y:parseFloat(X)||0,B:parseFloat(oe)||0,C:parseFloat(de)||0,R:parseFloat(D)||0})}),{posPipeYbcr:t,negPipeYbcr:l}},T=(t=0,l=0)=>{if(u.value&&k.value){const o=K();Ne(u.value,k.value,o.posPipeYbcr,o.negPipeYbcr,S.value,h.value,t,l,M.value)}else if(u.value){const o=ae();_e(u.value,o,S.value,h.value,t,l)}},C=t=>{if(t<0||t>=s.value.length){console.error(`帧索引 ${t} 超出范围`);return}const l=s.value[t];if(console.log(`应用第 ${t} 帧数据 ${l}`),r.value=t,c.value){const o={};L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value.setJointAngles(o)}T(t,0)},U=async()=>{if(s.value.length===0){B.ElMessage.error("无法播放动画:无数据");return}if(!w.value){w.value=!0,_=!1,s.value.length-1===r.value&&(r.value=0);try{for(let t=r.value+1;t<s.value.length&&!_;t++){r.value=t;const l=s.value[t],o={};c.value&&L.value.forEach(i=>{const x=parseFloat(l[i]);isNaN(x)||(o[i]=x)}),c.value?await c.value.animateToState(o,d.value,i=>{y.value=(t+i)/s.value.length*100,T(t-1,i)}):(await new Promise(i=>setTimeout(i,d.value)),y.value=(t+1)/s.value.length*100)}_||B.ElMessage.success("动画播放完成")}catch(t){console.error("动画播放出错:",t),B.ElMessage.error("动画播放出错")}finally{w.value=!1,y.value=0}}},F=()=>{_=!0,w.value=!1,y.value=0,B.ElMessage.info("动画已停止")},I=()=>{r.value=0},z=()=>{if(u.value&&k.value){const t=K();Ne(u.value,k.value,t.posPipeYbcr,t.negPipeYbcr,S.value,h.value,-1,0,M.value)}else if(u.value){const t=ae();_e(u.value,t,S.value,h.value,-1,0)}},Z=()=>{c.value&&c.value.resetToZero(),z(),I(),B.ElMessage.success("机器人和管件已重置")},O=t=>`第 ${t+1} 帧`,j=t=>{w.value&&F(),C(t)},Q=()=>{w.value&&F(),!(r.value+1>=s.value.length)&&C(r.value+1)},P=()=>{w.value&&F(),r.value!==0&&C(r.value-1)},H=()=>{E.value&&(E.value.visible=!0),u.value&&u.value.parent&&u.value.parent.remove(u.value),E.value=null,u.value=null,k.value=null},re=t=>t==null?void 0:t.reduce((l,o)=>(l[o]="0",l),{});e.watch(Y,(t,l)=>{if(JSON.stringify(t)!==JSON.stringify(l))if(t.length>0){const o=re(t);s.value=[o]}else s.value=[]},{immediate:!0});const ee=e.ref(0),ue=t=>{ee.value=t},he=(t,l)=>{if(!t||!l)return;const o=ie.getTargetJoint(t,l),i=Ee();i.visible=!1,o==null||o.add(i)},ge=t=>{c.value=new ve.URDFRobotController(t),A.value=ie.getAllLinkName(t),$.value="Pipe_Joint"},te=()=>{c.value=null,A.value=[],$.value=null},se=t=>{ge(t),he(t,$.value),ue(ee.value+1),Z()};e.watch(()=>p.model,t=>{if(H(),t){se(t);return}te()},{immediate:!0});const me=t=>{var o,i;const l=new n.Mesh(t.geometry.clone(),t.material);return l.name="managed_pipe_clone",(i=(o=t==null?void 0:t.parent)==null?void 0:o.add)==null||i.call(o,l),l.position.copy(t.position),l.rotation.copy(t.rotation),l.scale.copy(t.scale),l};e.watch([$,M,S,ee],([t,l])=>{if(H(),p.model&&t){const o=ie.getMeshFromJoint(p.model,t);if(console.log(o,"meshToReplace"),o&&o.parent){E.value=o,o.visible=!1;const i=me(o);if(m.value===ne.robotMode.SINGLE&&(i.position.y-=l*.001),u.value=i,m.value===ne.robotMode.DOUBLE){const x=me(o);k.value=x}T(0,0)}else t&&console.warn(`在 link '${t}' 中未找到可替换的网格或其没有父级。`)}});const Ve=async()=>{if(Y.value.length===0){B.ElMessage.warning("没有可导出的表头");return}const t=Y.value.join(" ");try{await navigator.clipboard.writeText(t),B.ElMessage.success("表头已成功复制到剪贴板!")}catch(l){console.error("复制失败:",l),B.ElMessage.error("复制失败,请检查浏览器权限或手动复制。")}},be=()=>{if(!f.value.trim()){B.ElMessage.warning("导入内容不能为空");return}const t=f.value.trim().split(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),ee=require("./threeViewerHost-QHAFlASe.cjs"),q=require("./iconfont-m2r8ESph.cjs"),J=require("./workpieceTreePanel-DKMsi2D-.cjs"),Ce=require("./index-BDGC3yIw.cjs"),h=require("./index-DjOAHJHD.cjs");require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BYcd0jgi.cjs");const te=require("./index.vue_vue_type_script_setup_true_lang-BKTJR2th.cjs"),U=require("./urdfTree-DNQtn8Y5.cjs"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),g=require("./svgIcon-CDPAgQbj.cjs"),_e=require("./animationData-BpQQZnbj.cjs"),we=require("./MTLLoader-C9zwOo5R.cjs"),Se={class:"panel-content"},Pe={key:0,class:"animation-controls"},Te={class:"control-row"},Be={class:"control-row"},xe={class:"frame-info"},ze={class:"control-row"},De={key:1,class:"empty-state"},Le={class:"dialog-footer"},je=e.defineComponent({__name:"urdfAnimationPanel",props:{model:{},scene:{},xyzbcList:{}},setup(P,{expose:m}){const y=P,s=e.ref([]),_=e.ref(!1),T=e.ref(""),i=e.ref("stopped"),f=e.ref(0),w=e.ref(0),b=e.ref(10),u=e.ref(null);let c=0;const V=e.ref([]),N=e.computed(()=>y.model?U.getNonFixedJoints(y.model).map(p=>p.name):[]),S=e.computed(()=>[...N.value]),H=e.computed(()=>S.value.length>0?`请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
2
2
|
${S.value.join(" ")}
|
|
3
3
|
0 0 0 ...
|
|
4
4
|
1 2 3 ...`:"请先加载模型。"),$=e.computed(()=>s.value[f.value]||{});e.watch(()=>y.model,o=>{o?(u.value=new J.URDFRobotController(o),V.value=U.getAllLinkName(o),f.value=0):(u.value=null,V.value=[])},{immediate:!0});const D=o=>{if(o<0||o>=s.value.length){console.error(`帧索引 ${o} 超出范围`);return}const n=s.value[o];if(u.value){const p={};N.value.forEach(k=>{const r=parseFloat(n[k]);isNaN(r)||(p[k]=r)}),u.value.setJointAngles(p)}f.value=o,w.value=s.value.length>1?o/(s.value.length-1)*100:100},L=async o=>{try{for(let n=f.value;n<s.value.length;n++){if(o!==c)return;const p=s.value[n],k={};if(u.value)N.value.forEach(r=>{const d=parseFloat(p[r]);isNaN(d)||(k[r]=d)}),await u.value.animateToState(k,b.value,r=>{o===c&&(w.value=(n+r)/s.value.length*100)});else{if(await new Promise(r=>setTimeout(r,b.value)),o!==c)return;w.value=(n+1)/s.value.length*100}f.value=n}o===c&&(h.ElMessage.success("动画播放完成"),i.value="stopped",w.value=100)}catch(n){console.error("动画播放出错:",n),h.ElMessage.error("动画播放出错"),i.value="stopped"}},B=()=>{if(s.value.length===0){h.ElMessage.error("无动画数据");return}i.value==="stopped"&&(f.value=0,D(0)),i.value="playing",c++,L(c),h.ElMessage.info("动画播放中")},M=()=>{i.value==="playing"&&(c++,i.value="paused",h.ElMessage.info("动画已暂停"))},R=()=>{c++,i.value="stopped",f.value=0,w.value=0,D(0),h.ElMessage.info("动画已停止并重置")},G=()=>{i.value==="playing"?M():B()},x=o=>{c++,i.value="paused",D(o)},X=()=>{if(!T.value.trim()){h.ElMessage.warning("导入内容不能为空");return}const o=T.value.trim().split(`
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent as ge, ref as r, computed as k, watch as X, onUnmounted as De, resolveComponent as G, createElementBlock as x, openBlock as g, createElementVNode as n, createCommentVNode as U, createVNode as s, toDisplayString as L, Fragment as Be, renderList as Je, withCtx as le, shallowRef as te, onMounted as Me, nextTick as me, onBeforeUnmount as Ee, withDirectives as I, vShow as W, unref as z, renderSlot as ve, createBlock as de } from "vue";
|
|
2
|
-
import { s as pe } from "./threeViewerHost-
|
|
3
|
-
import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-
|
|
4
|
-
import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-
|
|
5
|
-
import {
|
|
6
|
-
import "./index
|
|
2
|
+
import { s as pe } from "./threeViewerHost-CTAXJC99.js";
|
|
3
|
+
import { u as Ge, a as He, b as Ie, C as We } from "./iconfont-gpkjnIRx.js";
|
|
4
|
+
import { U as Xe, u as Ye, a as Ze, W as qe } from "./workpieceTreePanel-B8WM9_Wb.js";
|
|
5
|
+
import { c as Ke } from "./index-CKgsrRZt.js";
|
|
6
|
+
import { E as _ } from "./index-DL-scY6_.js";
|
|
7
|
+
import "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js";
|
|
7
8
|
import { _ as fe } from "./index.vue_vue_type_script_setup_true_lang-DRzriV-s.js";
|
|
8
|
-
import { g as
|
|
9
|
-
import { c as nt } from "./index-cx0rUqLg.js";
|
|
9
|
+
import { g as Qe, b as et, U as tt, J as lt, d as nt } from "./urdfTree-DAM1Wv4K.js";
|
|
10
10
|
import { _ as he } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
import { T as y } from "./svgIcon-4u4PW7Is.js";
|
|
12
|
-
import { i as at } from "./animationData-
|
|
13
|
-
import { O as ot } from "./MTLLoader-
|
|
12
|
+
import { i as at } from "./animationData-BbL90xGU.js";
|
|
13
|
+
import { O as ot } from "./MTLLoader-DEhuJ8cA.js";
|
|
14
14
|
const st = { class: "panel-content" }, it = {
|
|
15
15
|
key: 0,
|
|
16
16
|
class: "animation-controls"
|
|
@@ -27,12 +27,12 @@ const st = { class: "panel-content" }, it = {
|
|
|
27
27
|
setup(S, { expose: f }) {
|
|
28
28
|
const j = S, i = r([]), T = r(!1), F = r(""), c = r("stopped"), h = r(0), O = r(0), C = r(10), v = r(null);
|
|
29
29
|
let d = 0;
|
|
30
|
-
const P = r([]), w = k(() => j.model ?
|
|
30
|
+
const P = r([]), w = k(() => j.model ? Qe(j.model).map((b) => b.name) : []), R = k(() => [...w.value]), ne = k(() => R.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
31
31
|
${R.value.join(" ")}
|
|
32
32
|
0 0 0 ...
|
|
33
33
|
1 2 3 ...` : "请先加载模型。"), Y = k(() => i.value[h.value] || {});
|
|
34
34
|
X(() => j.model, (a) => {
|
|
35
|
-
a ? (v.value = new Xe(a), P.value =
|
|
35
|
+
a ? (v.value = new Xe(a), P.value = et(a), h.value = 0) : (v.value = null, P.value = []);
|
|
36
36
|
}, { immediate: !0 });
|
|
37
37
|
const J = (a) => {
|
|
38
38
|
if (a < 0 || a >= i.value.length) {
|
|
@@ -118,7 +118,7 @@ ${R.value.join(" ")}
|
|
|
118
118
|
u.length > 0 ? (i.value = u, _.success(`成功导入 ${u.length} 行数据!`), T.value = !1, F.value = "", q()) : _.error("未能解析到有效数据,请检查格式。");
|
|
119
119
|
};
|
|
120
120
|
X(() => j.xyzbcList, () => {
|
|
121
|
-
j.xyzbcList && (i.value =
|
|
121
|
+
j.xyzbcList && (i.value = Ke(j.xyzbcList));
|
|
122
122
|
}, {
|
|
123
123
|
immediate: !0
|
|
124
124
|
});
|
|
@@ -293,7 +293,7 @@ ${R.value.join(" ")}
|
|
|
293
293
|
}, Te = () => {
|
|
294
294
|
var t;
|
|
295
295
|
(t = M.value) == null || t.stopAnimation();
|
|
296
|
-
}, Oe = (t, e) =>
|
|
296
|
+
}, Oe = (t, e) => nt(t, e), Re = async (t) => {
|
|
297
297
|
const e = Oe(t, R.value);
|
|
298
298
|
if (Y.value = e, console.log("bladeObjUrl", T.value), e && e.parent && T.value) {
|
|
299
299
|
const o = await bt(T.value);
|
|
@@ -457,7 +457,7 @@ ${R.value.join(" ")}
|
|
|
457
457
|
default: le(() => {
|
|
458
458
|
var $;
|
|
459
459
|
return [
|
|
460
|
-
v.value === "场景树" ? (g(), de(
|
|
460
|
+
v.value === "场景树" ? (g(), de(tt, {
|
|
461
461
|
key: 0,
|
|
462
462
|
model: w.value
|
|
463
463
|
}, null, 8, ["model"])) : U("", !0),
|
|
@@ -492,7 +492,7 @@ ${R.value.join(" ")}
|
|
|
492
492
|
n("div", xt, [
|
|
493
493
|
s(o, { height: "100%" }, {
|
|
494
494
|
default: le(() => [
|
|
495
|
-
I(s(
|
|
495
|
+
I(s(lt, { model: w.value }, null, 8, ["model"]), [
|
|
496
496
|
[W, P.value === "机床控制"]
|
|
497
497
|
]),
|
|
498
498
|
I(s(be, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-m2r8ESph.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BYcd0jgi.cjs");require("./index-BDGC3yIw.cjs");const K=require("./urdfTree-DNQtn8Y5.cjs"),I=require("./index-DjOAHJHD.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-BM0aTbV9.cjs");function ye(t=.5,o=4){const r=new p.Mesh(new p.ConeGeometry(t,o,32),new p.MeshStandardMaterial({color:"#919191ff",metalness:.3,roughness:.6})),s=r.geometry.parameters.height;return r.geometry.translate(0,-s/2,0),r.rotation.set(-90,0,0,"XYZ"),r}function Ce(t,o){t.position.copy(o)}function we(t,o,r=new p.Color(16711680)){const s=new p.Vector3;o.getWorldPosition(s);const a=t.geometry.attributes.position,n=t.geometry.attributes.color,l=new p.Color(55551);let c=1/0,f=-1;for(let u=0;u<a.count;u++){const v=new p.Vector3().fromBufferAttribute(a,u).distanceTo(s);v<c&&(c=v,f=u)}for(let u=0;u<n.count;u++)l.toArray(n.array,u*3);if(f!==-1){const u=r.toArray(),m=f*3+2;for(let v=0;v<m;v=v+3)n.array[v]=u[0],n.array[v+1]=u[1],n.array[v+2]=u[2]}n.needsUpdate=!0}function S(t,o,r,s=new p.Color(16711680)){Ce(t,o),we(r,t,s)}const ke={class:"panel-content"},_e={class:"animation-controls"},Ve={class:"control-row"},be={class:"control-row"},Ne={class:"frame-info"},Te={class:"control-row"},Ee=e.defineComponent({__name:"trackAnimationPanel",props:{cloud:{},knife:{},vectors:{}},emits:["getThreeData"],setup(t,{expose:o,emit:r}){const s=t,a=e.computed(()=>s.vectors),n=e.ref(!1),l=e.ref(0),c=e.ref(100);let f=!1;const u=g=>`第 ${g+1} 帧`,m=g=>{if(g<0||g>=a.value.length){console.error(`帧索引 ${g} 超出范围`);return}const y=a.value[g];l.value=g,S(s.knife,y,s.cloud)},v=async()=>{if(a.value.length===0){I.ElMessage.error("无法播放动画:无数据");return}if(!n.value){n.value=!0,f=!1,a.value.length-1===l.value&&(l.value=0);try{for(let g=l.value+1;g<a.value.length&&!f;g++)await new Promise(y=>setTimeout(y,c.value)),m(g);f||I.ElMessage.success("动画播放完成")}catch(g){console.error("动画播放出错:",g)}finally{n.value=!1}}},C=()=>{f=!0,n.value=!1,I.ElMessage.info("动画已停止")},N=g=>{n.value&&C(),m(g)},_=()=>{n.value&&C(),!(l.value+1>=a.value.length)&&m(l.value+1)},V=()=>{n.value&&C(),l.value!==0&&m(l.value-1)},h=()=>{l.value=0};return o({playAnimation:v,stopAnimation:C,forwardFrame:_,backwardFrame:V,resetAnimationFrame:h,reset:async()=>{await C(),h()}}),(g,y)=>{const L=e.resolveComponent("el-input-number"),B=e.resolveComponent("el-form-item"),D=e.resolveComponent("el-form"),$=e.resolveComponent("el-slider");return e.openBlock(),e.createElementBlock("div",ke,[e.createElementVNode("div",_e,[e.createElementVNode("div",Ve,[e.createVNode(D,{"label-width":"auto",style:{width:"100%"}},{default:e.withCtx(()=>[e.createVNode(B,{label:"帧间隔 (ms):",prop:"frameDuration"},{default:e.withCtx(()=>[e.createVNode(L,{modelValue:c.value,"onUpdate:modelValue":y[0]||(y[0]=z=>c.value=z),min:0,max:5e3,step:10,style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1})]),e.createElementVNode("div",be,[y[2]||(y[2]=e.createElementVNode("label",null,"当前帧:",-1)),e.createElementVNode("span",Ne,e.toDisplayString(l.value+1)+" / "+e.toDisplayString(a.value.length),1)]),e.createElementVNode("div",Te,[y[3]||(y[3]=e.createElementVNode("label",null,"动画进度:",-1)),e.createVNode($,{modelValue:l.value,"onUpdate:modelValue":y[1]||(y[1]=z=>l.value=z),min:0,max:a.value.length>0?a.value.length-1:0,step:1,"format-tooltip":u,onInput:N,disabled:a.value.length===0,style:{"flex-grow":"1",margin:"0 10px"}},null,8,["modelValue","max","disabled"])])])])}}}),xe=R._export_sfc(Ee,[["__scopeId","data-v-f6fc7a8c"]]);function ze(t){const o=[];return t.forEach(r=>{const[s,a,n]=r.trim().split(/\s+/);o.push(+s,+a,+n)}),o}function U(t,o,r){switch(t){case"X":o.x=+r||0;break;case"Y":o.y=+r||0;break;case"Z":o.z=+r||0;break}}function Ae(t){const o=[],r=["X","Y","Z"];return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f],m=r.find(v=>v===u);if(m){l&&U(l,a,c),c="",l=m;continue}c=c+u}U(l,a,c),o.push(a.x,a.y,a.z)}),o}const Pe=t=>t==null?void 0:t.filter(r=>r.includes("=")),Me=t=>t.replace(/,/g,""),Fe=t=>t==null?void 0:t.map(r=>Me(r)),Ie=t=>{const o=Pe(t);return Fe(o)};function Ue(t){const o=Ie(t),r=[];return o.forEach(s=>{var v,C,N,_,V,h;let[a,n,l,c]=s.trim().split(/\s+/);n=(v=n==null?void 0:n.trim)==null?void 0:v.call(n),l=(C=l==null?void 0:l.trim)==null?void 0:C.call(l),c=(N=c==null?void 0:c.trim)==null?void 0:N.call(c);const[,f]=(_=n==null?void 0:n.split)==null?void 0:_.call(n,"="),[,u]=(V=l==null?void 0:l.split)==null?void 0:V.call(l,"="),[,m]=(h=c==null?void 0:c.split)==null?void 0:h.call(c,"=");r.push(+f,+u,+m)}),r}const Le=t=>t>="0"&&t<="9",Be=t=>t==="+"||t==="-",De=t=>t===".";function $e(t){return Le(t)||Be(t)||De(t)}function je(t){const o=[],r=new Set(["X","Y","Z"]);return t.forEach(s=>{const a={x:0,y:0,z:0},n=s.trim();if(!n)return;let l=null,c="";for(let f=0;f<(n==null?void 0:n.length);f++){const u=n[f];if(u==="T")break;const m=r.has(u)?u:null,v=$e(u);if(m||!v){l&&U(l,a,c),l=m,c="";continue}c=c+u}l&&U(l,a,c),o.push(a.x,a.y,a.z)}),o}function qe(t){return t==null?void 0:t.includes("=")}async function Xe(t){var a,n;const o=(a=t==null?void 0:t.trim())==null?void 0:a.split(/\r?\n/);if(qe(t))return Ue(o);const r=o==null?void 0:o[0],s=(n=r==null?void 0:r.trim())==null?void 0:n.split(/\s+/);if((s==null?void 0:s.length)>=3)return ze(o);if((s==null?void 0:s.length)===1)return Ae(o)}async function Ye(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Ze(t){const o=t.trim().split(/\r?\n/),r=[];return o.forEach(s=>{const a=s.trim().split(/\s+/);if(a.length!=3)return;const[n,l,c]=a;r.push(+n,+l,+c)}),r}async function Oe(t){let o=t.trim().split(/\r?\n/);return o=o.filter(s=>{const a=s.startsWith("X")||s.startsWith("Y")||s.startsWith("Z"),n=s.startsWith("G")&&(s.includes("X")||s.includes("Y")||s.includes("Z")),l=s.startsWith("N")&&(s.includes("X")||s.includes("Y")||s.includes("Z"));return a||n||l}),je(o)}async function Ge(t,o){const{isCyd:r,isUv:s,isCpt:a,isNc:n}=o;return s?Xe(t):r?Ze(t):a?Ye(t):n?Oe(t):[]}function Ke(t){const o=[];for(let r=0;r<t.length;r+=3)o.push(new p.Vector3(t[r],t[r+1],t[r+2]));return o}function Re(t){const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new p.LineBasicMaterial({color:55551,linewidth:3});return new p.Line(o,r)}function Se(t,o){if(!o||o.length<3)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=Re(o);return l.name="轨迹路径",r.add(l),l}function We(t,o,r,s=4,a=50){let n=1/0,l=-1/0,c=1/0,f=-1/0,u=1/0,m=-1/0;for(let h=0;h<t.length;h+=3){const A=t[h],g=t[h+1],y=t[h+2];n=Math.min(n,A),l=Math.max(l,A),c=Math.min(c,g),f=Math.max(f,g),u=Math.min(u,y),m=Math.max(m,y)}const C=Math.sqrt((l-n)**2+(f-c)**2+(m-u)**2)*.05,N=p.MathUtils.degToRad(o.fov),_=2*Math.tan(N/2)*a,V=C/_*r.domElement.height*(s/4);return Math.min(.4,V)}function He(t){if(t.length%3!==0)return console.error("points array length is not a multiple of 3:",t),null;const o=new p.BufferGeometry;o.setAttribute("position",new p.Float32BufferAttribute(t,3));const r=new Float32Array(t.length);for(let n=0;n<t.length;n+=3)r[n]=0,r[n+1]=.847,r[n+2]=1;o.setAttribute("color",new p.BufferAttribute(r,3));const s=new p.PointsMaterial({vertexColors:!0,size:.4,sizeAttenuation:!0}),a=new p.Points(o,s);return s.needsUpdate=!0,a}function Je(t,o){if(!o)return;const{scene:r,camera:s,renderer:a,controls:n}=t();if(!r||!s||!a||!n)return;const l=He(o);if(!l)return;l.name="轨迹路径",r.add(l);const c=We(o,s,a,.1,50);return l.material.size=c,l}const Qe={class:"obj-viewer-container"},et={class:"buttonGroup-topLeft"},tt={class:"buttonGroup-left"},nt={class:"buttonGroup-right"},ot={class:"buttonGroup-bottom"},rt={class:"left-panel"},lt={class:"panel-header"},st={class:"panel-body"},it={class:"right-panel"},at={class:"panel-header"},ct={class:"panel-body"},ut={key:0,class:"loading-overlay"},dt=e.defineComponent({__name:"threeTrackPathView",props:{fileBlobs:{},threeData:{default:()=>""},trackFileType:{}},setup(t){const o=t,r=e.ref(null),s=e.ref(!1),a=e.ref(""),n=e.ref(),l=e.ref(!1),c=e.ref(""),f=e.ref(!1),u=e.ref(""),m=e.shallowRef(null),v=e.shallowRef(null),{currentModels:C,resetView:N,initThreeJS:_,handleResize:V,getThreeJSObjects:h,cleanup:A,setModels:g,setAndFitModels:y,axesHelperVisible:L,toggleAxesVisibility:B,zoomIn:D,zoomOut:$}=x.useThreeJS(r),{isAnimating:z,toggleAnimation:W,startAnimation:vt,stopAnimation:H}=x.useAnimation(h,C),{isClipping:J,activeClippingAxis:Y,toggleClipping:Q,updateClippingPlanes:ee}=x.useClipping(h,C),te=()=>{B()},ne=i=>{Y.value=i,ee()},j=i=>{l.value=!0,c.value=i,i==="剖面视图"&&!J.value&&Q()},q=i=>{f.value=!0,u.value=i},X=e.ref([]),P=e.ref([]),oe=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isUv}),re=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCyd}),le=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isCpt}),T=e.computed(()=>{var d;return(d=o.trackFileType)==null?void 0:d.isNc}),Z=e.computed(()=>{const i=o.fileBlobs||[];return i==null?void 0:i[0]});let k=e.shallowRef(),E=e.shallowRef();const se=()=>{const{scene:i}=h();k.value&&i&&(x.disposeObj(k.value,i),k.value=null)},ie=()=>{const{scene:i}=h();E.value&&i&&(x.disposeObj(E.value,i),E.value=null)},O=()=>{se(),ie()},ae=async i=>{const d=URL.createObjectURL(i),M=await p.readFileText(d);if(URL.revokeObjectURL(d),ge.isString(M)){X.value=await Ge(M,o.trackFileType)||[];const b=X.value;oe.value&&(k.value=Se(h,b)),(re.value||le.value||T.value)&&(k.value=Je(h,b))}},ce=async()=>{var i,d;E.value=ye(),P.value=Ke(X.value),P.value&&P.value.length&&(S(E.value,P.value[0],k.value,new p.Color(16711680)),(d=(i=v.value)==null?void 0:i.add)==null||d.call(i,E.value))},G=async i=>{O(),await ae(i),k.value&&x.frameCameraToObject3D(h,k.value),T.value&&ce()};e.watch(()=>Z.value,async i=>{i&&await G(i)},{immediate:!0,deep:!0});const ue=async()=>{var i;await((i=n==null?void 0:n.value)==null?void 0:i.reset()),await G(Z.value)},de=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.playAnimation())},fe=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.stopAnimation())},ve=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.forwardFrame())},me=()=>{var i;T.value&&((i=n==null?void 0:n.value)==null||i.backwardFrame())},pe=()=>{_(),e.nextTick(()=>{r.value&&(F=new ResizeObserver(V),F.observe(r.value))});const i=h();v.value=i.scene,v.value&&(v.value.name="CPMPIP")},he=()=>{F&&F.disconnect(),z.value&&H(),O(),A()};let F=null;return e.onMounted(async()=>{try{pe()}catch(i){console.error("Three.js 初始化失败:",i),I.ElMessage.error("渲染引擎初始化失败!")}}),e.onBeforeUnmount(()=>{he()}),(i,d)=>{const M=e.resolveComponent("el-scrollbar");return e.openBlock(),e.createElementBlock("div",Qe,[e.createElementVNode("div",{ref_key:"threejsContainer",ref:r,class:"threejs-container"},null,512),e.createElementVNode("div",et,[e.createVNode(w.ThreeSvgIcon,{name:"viewReset",size:"24",onClick:ue,title:"重置"}),e.createVNode(w.ThreeSvgIcon,{name:"fangda",size:"24",title:"放大",onClick:e.unref(D)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"suoxiao",size:"24",title:"缩小",onClick:e.unref($)},null,8,["onClick"]),e.createVNode(w.ThreeSvgIcon,{name:"lookAround",size:"24",onClick:e.unref(W),title:e.unref(z)?"停止动画":"动画视图"},null,8,["onClick","title"]),e.createVNode(w.ThreeSvgIcon,{name:"zuobiaoxi",size:"24",active:e.unref(L),onClick:te,title:"显隐坐标轴"},null,8,["active"])]),e.createElementVNode("div",tt,[e.renderSlot(i.$slots,"button-left",{switchRightPanel:j},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"jiegoushu",size:"24",onClick:d[0]||(d[0]=b=>j("场景树")),active:l.value&&c.value==="场景树",title:"场景树"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"clipping",size:"24",onClick:d[1]||(d[1]=b=>j("剖面视图")),active:l.value&&c.value==="剖面视图",title:"剖面视图"},null,8,["active"])]),e.createElementVNode("div",nt,[e.renderSlot(i.$slots,"button-right",{switchRightPanel:q},void 0,!0),e.createVNode(w.ThreeSvgIcon,{name:"guanjiekongzhi",size:"24",onClick:d[2]||(d[2]=b=>q("关节控制")),active:f.value&&u.value==="关节控制",title:"关节控制"},null,8,["active"]),e.createVNode(w.ThreeSvgIcon,{name:"donghuafangzhen",size:"24",title:"动画仿真",onClick:d[3]||(d[3]=b=>q("动画仿真")),active:f.value&&u.value==="动画仿真"},null,8,["active"])]),e.createElementVNode("div",ot,[e.createVNode(w.ThreeSvgIcon,{name:"kuaitui",size:"24",backgroundColor:"#ffffff",title:"快退",onClick:me}),e.createVNode(w.ThreeSvgIcon,{name:"bofang",size:"24",backgroundColor:"#ffffff",title:"播放",onClick:de}),e.createVNode(w.ThreeSvgIcon,{name:"kuaijin",size:"24",backgroundColor:"#ffffff",title:"快进",onClick:ve}),e.createVNode(w.ThreeSvgIcon,{name:"zanting",size:"24",backgroundColor:"#ffffff",title:"暂停",onClick:fe})]),e.withDirectives(e.createElementVNode("div",rt,[e.createElementVNode("div",lt,[e.createElementVNode("span",null,e.toDisplayString(c.value),1),e.createElementVNode("span",{class:"close",onClick:d[4]||(d[4]=b=>l.value=!1)}," X ")]),e.createElementVNode("div",st,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[c.value==="场景树"?(e.openBlock(),e.createBlock(K.UrdfTree,{key:0,model:m.value},null,8,["model"])):e.createCommentVNode("",!0),c.value==="剖面视图"?(e.openBlock(),e.createBlock(x.ClippingPanel,{key:1,value:e.unref(Y),onChange:ne},null,8,["value"])):e.createCommentVNode("",!0)]),_:1})])],512),[[e.vShow,l.value]]),e.withDirectives(e.createElementVNode("div",it,[e.createElementVNode("div",at,[e.createElementVNode("span",null,e.toDisplayString(u.value),1),e.createElementVNode("span",{class:"close",onClick:d[5]||(d[5]=b=>f.value=!1)}," X ")]),e.createElementVNode("div",ct,[e.createVNode(M,{height:"100%"},{default:e.withCtx(()=>[e.withDirectives(e.createVNode(K.JointPanel,{model:m.value},null,8,["model"]),[[e.vShow,u.value==="关节控制"]]),e.withDirectives(e.createVNode(xe,{ref_key:"animationPanelRef",ref:n,cloud:e.unref(k),knife:e.unref(E),vectors:P.value},null,8,["cloud","knife","vectors"]),[[e.vShow,u.value==="动画仿真"&&T.value]])]),_:1})])],512),[[e.vShow,f.value]]),s.value?(e.openBlock(),e.createElementBlock("div",ut,[d[6]||(d[6]=e.createElementVNode("div",{class:"loading-spinner"},null,-1)),e.createElementVNode("p",null,e.toDisplayString(a.value),1)])):e.createCommentVNode("",!0)])}}}),ft=R._export_sfc(dt,[["__scopeId","data-v-7178b621"]]);exports.default=ft;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { defineComponent as ce, computed as U, ref as k, resolveComponent as E, createElementBlock as ee, openBlock as D, createElementVNode as d, createVNode as p, withCtx as I, toDisplayString as X, shallowRef as Y, watch as Ee, onMounted as De, onBeforeUnmount as Xe, withDirectives as Z, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as N, nextTick as je } from "vue";
|
|
2
|
-
import { u as Ye, a as Ze, b as Ne, C as Be, f as Ie, d as re } from "./iconfont-
|
|
3
|
-
import { M as O, Z as Oe, bD as Ge, az as qe, V as te, aB as ue, aO as fe, aU as Ke, aD as We, aT as Je, aQ as Re, aR as He, a7 as Qe, bE as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
4
|
-
import
|
|
5
|
-
import { U as et, J as tt } from "./urdfTree-
|
|
2
|
+
import { u as Ye, a as Ze, b as Ne, C as Be, f as Ie, d as re } from "./iconfont-gpkjnIRx.js";
|
|
3
|
+
import { M as O, Z as Oe, bD as Ge, az as qe, V as te, aB as ue, aO as fe, aU as Ke, aD as We, aT as Je, aQ as Re, aR as He, a7 as Qe, bE as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js";
|
|
4
|
+
import "./index-CKgsrRZt.js";
|
|
5
|
+
import { U as et, J as tt } from "./urdfTree-DAM1Wv4K.js";
|
|
6
|
+
import { E as B } from "./index-DL-scY6_.js";
|
|
6
7
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
8
|
import { T as w } from "./svgIcon-4u4PW7Is.js";
|
|
8
|
-
import { i as nt } from "./isString-
|
|
9
|
+
import { i as nt } from "./isString-DkWdJm3P.js";
|
|
9
10
|
function ot(e = 0.5, n = 4) {
|
|
10
11
|
const o = new Oe(
|
|
11
12
|
new Ge(e, n, 32),
|
|
@@ -614,7 +615,7 @@ const jt = { class: "obj-viewer-container" }, Yt = { class: "buttonGroup-topLeft
|
|
|
614
615
|
]);
|
|
615
616
|
};
|
|
616
617
|
}
|
|
617
|
-
}),
|
|
618
|
+
}), rn = /* @__PURE__ */ ve(Rt, [["__scopeId", "data-v-7178b621"]]);
|
|
618
619
|
export {
|
|
619
|
-
|
|
620
|
+
rn as default
|
|
620
621
|
};
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { defineComponent as U, defineAsyncComponent as b, computed as I, ref as R, watch as H, createElementBlock as N, openBlock as T, createElementVNode as K, createBlock as B, createCommentVNode as V, renderSlot as u, unref as m, withCtx as d } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { e as j, ax as M, aa as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BXs-wWd7.js";
|
|
2
|
+
import { e as W, u as A, p as D, s as $ } from "./index-CKgsrRZt.js";
|
|
3
|
+
import { e as j, ax as M, aa as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js";
|
|
5
4
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
const
|
|
5
|
+
const re = {
|
|
7
6
|
SINGLE: "单机",
|
|
8
7
|
DOUBLE: "双机"
|
|
9
|
-
},
|
|
8
|
+
}, se = {
|
|
10
9
|
ROBOT: 1,
|
|
11
10
|
PIPECOMPARSION: 2
|
|
12
11
|
}, a = {
|
|
@@ -35,7 +34,7 @@ const se = {
|
|
|
35
34
|
}
|
|
36
35
|
});
|
|
37
36
|
function Y() {
|
|
38
|
-
const E =
|
|
37
|
+
const E = A(D), { platform: O } = $(E), y = z(D), i = ["uv", "cyd", "nc"], p = ["urdf"], n = ["obj", "stl"], P = [...i, ...p, ...n], f = (e) => {
|
|
39
38
|
if (!g())
|
|
40
39
|
throw new Error("不是三维系统");
|
|
41
40
|
y.setData(e);
|
|
@@ -113,7 +112,7 @@ const q = { class: "three-platform mv-inline" }, x = { class: "top-menu" }, J =
|
|
|
113
112
|
height: { default: "100%" }
|
|
114
113
|
},
|
|
115
114
|
setup(E) {
|
|
116
|
-
const O = b(() => import("./threeSceneView-
|
|
115
|
+
const O = b(() => import("./threeSceneView-5V5smS73.js")), y = b(() => import("./threePreview-BRK8_lKV.js")), i = b(() => import("./threeTrackPathView-CBKRfkly.js")), p = b(() => import("./threeSceneViewForCPMPIP-DqG9ZYEL.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = Y(), c = I(() => {
|
|
117
116
|
var t;
|
|
118
117
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
119
118
|
const { url: e } = s;
|
|
@@ -217,15 +216,15 @@ const q = { class: "three-platform mv-inline" }, x = { class: "top-menu" }, J =
|
|
|
217
216
|
C.value ? (T(), N("div", J, " 文件下载中,请稍候... ")) : V("", !0)
|
|
218
217
|
]));
|
|
219
218
|
}
|
|
220
|
-
}), X = /* @__PURE__ */ G(Q, [["__scopeId", "data-v-9798f55b"]]),
|
|
219
|
+
}), X = /* @__PURE__ */ G(Q, [["__scopeId", "data-v-9798f55b"]]), oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
221
220
|
__proto__: null,
|
|
222
221
|
default: X
|
|
223
222
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
224
223
|
export {
|
|
225
224
|
X as T,
|
|
226
225
|
Y as a,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
226
|
+
re as r,
|
|
227
|
+
se as s,
|
|
228
|
+
oe as t,
|
|
230
229
|
z as u
|
|
231
230
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./index-BDGC3yIw.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BYcd0jgi.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),F={SINGLE:"单机",DOUBLE:"双机"},R={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},b=d.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function I(){const v=d.useMenuState(d.pinia),{platform:g}=d.storeToRefs(v),P=b(d.pinia),c=["uv","cyd","nc"],m=["urdf"],r=["obj","stl"],T=[...c,...m,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),p=t=>{if(!t)return!1;const o=l(t);return T==null?void 0:T.includes(o)},E=t=>{if(!t)return!1;const o=l(t);return r==null?void 0:r.includes(o)},h=t=>{if(!t)return!1;const o=l(t);return c==null?void 0:c.includes(o)},u=t=>{if(!t)return{isCpt:!1,isCyd:!1,isUv:!1,isNc:!1};const o=l(t),a=c==null?void 0:c.find(k=>k===o);return{isCpt:a==="cpt",isCyd:a==="cyd",isUv:a==="uv",isNc:a==="nc"}},_=t=>{if(!t)return!1;const o=l(t);return m==null?void 0:m.includes(o)},B=t=>C()&&p(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:h,isThreeFile:p,isUseBackdrop:B,initTrackFileType:u,getFileExtension:l,getFileInfo:n,getFilesInfo:t=>{const o=[];for(let a=0;a<t.length;a++){const w=t[a],k=n(w);o.push(k)}return o}}}const N={class:"three-platform mv-inline"},V={class:"top-menu"},A={key:4,class:"loading"},M=e.defineComponent({__name:"threeViewerHost",props:{files:{default:()=>[]},threeData:{},componentType:{},width:{default:"100%"},height:{default:"100%"}},setup(v){const g=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneView-BCQKeoTk.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-BkKC0IgX.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-BrBEbTGo.cjs"))),m=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-DVqwxUS8.cjs"))),r=v,T=d.useMenuState(d.pinia),{platName:f}=d.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=I(),l=e.computed(()=>{var n;return(n=r==null?void 0:r.files)==null?void 0:n.map(s=>{const{url:t}=s;return t})}),p=e.computed(()=>{var t;const n=(t=r==null?void 0:r.files)==null?void 0:t[0];return(n==null?void 0:n.extension)||""}),E=e.computed(()=>{var n,s;return(s=(n=r==null?void 0:r.threeData)==null?void 0:n.data)==null?void 0:s.trackFileType}),h=e.computed(()=>{if(r.componentType)switch(r.componentType){case"robot":return i.ROBOT_SCENE;case"track":return i.TRACK_PATH;case"cpmpip":return i.CPMPIP_SCENE;case"preview":return i.PREVIEW}return(f==null?void 0:f.value)===S.platNameConstants.CPMPIP&&y(p.value)?i.CPMPIP_SCENE:(f==null?void 0:f.value)===S.platNameConstants.ROBOT&&y(p.value)?i.ROBOT_SCENE:C(p.value)&&E.value?i.TRACK_PATH:i.PREVIEW}),u=e.ref([]),_=e.ref(!1);async function B(n){if(!n||!n.length){u.value=[];return}_.value=!0;try{const s=await Promise.all(n.map(t=>S.downloadFile(t)));u.value=s}catch(s){console.error("文件下载时发生错误:",s),u.value=[]}finally{_.value=!1}}return e.watch(()=>l.value,async n=>{await B(n||[])},{immediate:!0,deep:!0}),(n,s)=>(e.openBlock(),e.createElementBlock("div",N,[e.createElementVNode("div",V,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),h.value===e.unref(i).ROBOT_SCENE?(e.openBlock(),e.createBlock(e.unref(g),{key:0,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):h.value===e.unref(i).TRACK_PATH?(e.openBlock(),e.createBlock(e.unref(c),{key:1,fileBlobs:u.value,threeData:r.threeData,trackFileType:E.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData","trackFileType"])):h.value===e.unref(i).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(m),{key:2,fileBlobs:u.value,threeData:r.threeData},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs","threeData"])):h.value===e.unref(i).PREVIEW?(e.openBlock(),e.createBlock(e.unref(P),{key:3,fileBlobs:u.value},{"button-left":e.withCtx(()=>[e.renderSlot(n.$slots,"management-menu",{},void 0,!0)]),"button-right":e.withCtx(()=>[e.renderSlot(n.$slots,"management-page",{},void 0,!0)]),_:3},8,["fileBlobs"])):e.createCommentVNode("",!0),_.value?(e.openBlock(),e.createElementBlock("div",A," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),O=D._export_sfc(M,[["__scopeId","data-v-9798f55b"]]),H=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=O;exports.robotMode=F;exports.sceneType=R;exports.threeViewerHost=H;exports.useThreeState=b;exports.useThreeSystem=I;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as I, ref as F, watch as M, onMounted as C, onUnmounted as E, createElementBlock as m, openBlock as f, Fragment as P, renderList as T, createElementVNode as c, createCommentVNode as U, toDisplayString as h, computed as L, resolveComponent as S, createVNode as A } from "vue";
|
|
2
|
-
import { Z as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
2
|
+
import { Z as V } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CUjt37hI.js";
|
|
3
3
|
import { _ as b } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
4
|
const D = (i, a) => {
|
|
5
5
|
if (!a)
|