ss-component-new 1.1.821 → 1.1.822
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/{OrbitControls-D6pgin7s.js → OrbitControls-Cm4Xs_Bq.js} +1 -1
- package/dist/{OrbitControls-Ff5ikkUQ.cjs → OrbitControls-D-XDZGf-.cjs} +1 -1
- package/dist/{STLLoader-BNh7D2zV.cjs → STLLoader-BxpEhvEg.cjs} +161 -161
- package/dist/{STLLoader-LGKv5i3H.js → STLLoader-DofhZbOw.js} +522 -593
- package/dist/{array-D1hKYLwI.cjs → array-Bfmx0w6P.cjs} +2 -2
- package/dist/{array-C60T9pDZ.js → array-DbAuNWGt.js} +1 -1
- package/dist/{iconfont-v9CcCMwF.js → iconfont-DQodgJo8.js} +73 -75
- package/dist/iconfont-Di4uXnX1.cjs +1 -0
- package/dist/icons/svg/editTable.svg +1 -1
- package/dist/icons/svg/export.svg +1 -0
- package/dist/icons/svg/model.svg +1 -0
- package/dist/icons/svg/three.svg +1 -0
- package/dist/index-1i-XlS2m.js +101 -0
- package/dist/{index-BdsJiFeW.cjs → index-6jSC3unU.cjs} +1 -1
- package/dist/{index-2kzGjuzu.js → index-6zbHinQ6.js} +10 -9
- package/dist/index-B-oe2x1V.cjs +109 -0
- package/dist/index-B-qent3l.cjs +1 -0
- package/dist/{index-CukZ8eDZ.js → index-BBo52W9F.js} +4 -4
- package/dist/index-BOev8isw.cjs +21 -0
- package/dist/index-BQgnYD51.js +6492 -0
- package/dist/{index-owcnOlVq.js → index-BYW-ix_Q.js} +5 -5
- package/dist/{index-4_M1SpeV.js → index-Bi1gr72d.js} +14 -14
- package/dist/{index-DnVaHi8q.js → index-BmHmnXS9.js} +7 -7
- package/dist/index-BoS30LXH.cjs +1 -0
- package/dist/index-BuBMi9JA.cjs +1 -0
- package/dist/{index-Zi9xLtwj.js → index-BvE05H-i.js} +2 -2
- package/dist/index-BwpOMKef.cjs +1 -0
- package/dist/index-C18ZPRC7.cjs +1 -0
- package/dist/{index-HVJSfh2g.js → index-CJx2DcDb.js} +21 -19
- package/dist/{index-B3cUSGXB.js → index-CL59qQ_W.js} +9 -8
- package/dist/{index-DDsJpzfR.js → index-CLdN0W98.js} +47 -47
- package/dist/index-CPP7L10q.cjs +1 -0
- package/dist/index-CSWIBSmo.cjs +1 -0
- package/dist/{index-DEobyz7r.js → index-CTgZZ96L.js} +6 -5
- package/dist/{index-WXpPDsev.js → index-CZ1ui4mT.js} +1 -1
- package/dist/index-CfQvGqaX.cjs +1 -0
- package/dist/index-CgJYAzeA.cjs +1 -0
- package/dist/index-ChtmIuBu.js +29771 -0
- package/dist/index-CjFcaJcL.cjs +1 -0
- package/dist/index-CjTmkzBO.js +24 -0
- package/dist/{index-Dtw4WkUo.cjs → index-CngO0AUc.cjs} +1 -1
- package/dist/index-CqCPdyGu.js +1248 -0
- package/dist/index-Cr6pWv0l.cjs +1 -0
- package/dist/{index-Cw95lvvp.js → index-D8Msszln.js} +223 -223
- package/dist/index-DDvUG6fk.js +22 -0
- package/dist/{index-CdMrhxHS.js → index-DMlIMlyC.js} +10 -10
- package/dist/{index-3Cdyqd1B.cjs → index-DOBeGYzT.cjs} +1 -1
- package/dist/index-DP0k43fj.cjs +1 -0
- package/dist/index-DTxccgVM.cjs +1 -0
- package/dist/{index-JAJeIBYE.cjs → index-DVAGljX0.cjs} +1 -1
- package/dist/{index-B5Vi6RBj.cjs → index-DVCrYVKw.cjs} +1 -1
- package/dist/{index-Dxoxm0Cc.js → index-DZWNGFC0.js} +22 -22
- package/dist/{index-CY2iphpd.cjs → index-DbniLh9G.cjs} +1 -1
- package/dist/index-Dj_ofPeK.cjs +1 -0
- package/dist/{index-DtogzZej.js → index-DocnYz5P.js} +1 -1
- package/dist/index-DrL7vroa.js +319 -0
- package/dist/index-Dt2McMki.js +13668 -0
- package/dist/{index-Cphx1eY1.js → index-Gba1Qfcc.js} +7 -8
- package/dist/{index-DMb9Vu-7.js → index-IUkCD4R_.js} +1 -1
- package/dist/{index-DAyzDsjs.js → index-K6BRW_Bw.js} +1 -1
- package/dist/{index-DzM8zZqe.js → index-OH9t-y2p.js} +4 -4
- package/dist/index-PNDdZKYG.cjs +1 -0
- package/dist/{index-Dn04IPFM.js → index-QETLKFyV.js} +10 -10
- package/dist/{index-BWHtpT9o.cjs → index-RgTvyK54.cjs} +1 -1
- package/dist/{index-Cuj-fGNO.cjs → index-VAIU8vMN.cjs} +1 -1
- package/dist/{index-CF_0RdqV.cjs → index-dukFqRog.cjs} +1 -1
- package/dist/{index-C9Boo2Cw.cjs → index-dyoOdMKX.cjs} +1 -1
- package/dist/index-f9bwREQl.cjs +1 -0
- package/dist/index-rPc9VS0S.cjs +1 -0
- package/dist/index-tPamnhR2.js +236 -0
- package/dist/{index-H3kf9EQv.js → index-tX2Hs05F.js} +11 -10
- package/dist/{index-DEU-pXeW.js → index-uvns6W6E.js} +1838 -1812
- package/dist/index-weauvEnW.cjs +4 -0
- package/dist/{index-B8xEed7C.cjs → index-wlnPb2aB.cjs} +1 -1
- package/dist/{index.vue_vue_type_script_setup_true_lang-iyZtrhDf.js → index.vue_vue_type_script_setup_true_lang-C4G6mB7R.js} +28 -28
- package/dist/{index.vue_vue_type_script_setup_true_lang-CaYQQb8M.cjs → index.vue_vue_type_script_setup_true_lang-CWi4UVPF.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-qefZ9E5G.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CtN9Ij0Y.js} +53 -23
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CTcahF4Z.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-mQIxU0SD.cjs} +90 -90
- package/dist/{index.vue_vue_type_style_index_0_scoped_6bfd62db_lang-Cxjh1E1z.js → index.vue_vue_type_style_index_0_scoped_1966237d_lang-D3xcEtDT.js} +6488 -6474
- package/dist/{index.vue_vue_type_style_index_0_scoped_6bfd62db_lang-0eNHRdYw.cjs → index.vue_vue_type_style_index_0_scoped_1966237d_lang-DwIFJsxs.cjs} +14 -14
- package/dist/{index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-kymzIBO8.js → index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-D5CTJUDi.js} +17 -17
- package/dist/{index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-GlR2V0TC.cjs → index.vue_vue_type_style_index_0_scoped_86d2b6b8_lang-VPQBXOPW.cjs} +1 -1
- package/dist/index.vue_vue_type_style_index_1_lang-DraQDAAw.cjs +32 -0
- package/dist/index.vue_vue_type_style_index_1_lang-hffXwR3x.js +7028 -0
- package/dist/isUndefined-4Qg9wncf.js +84 -0
- package/dist/isUndefined-BEt4O79g.cjs +1 -0
- package/dist/{main-C6I42yaU.js → main-CBCk94h5.js} +30 -29
- package/dist/main-DO_PN7jt.cjs +1 -0
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +2 -2
- package/dist/ss-component.js +11 -11
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +12 -12
- package/dist/threeModel-GKSAzHfe.cjs +1 -0
- package/dist/{threeModel-BEt5OVCP.js → threeModel-RJwJMtfW.js} +91 -92
- package/dist/{threePreview-BUZRvBRx.js → threePreview-BSqdALPK.js} +3 -3
- package/dist/{threePreview-Dyzqu5s7.cjs → threePreview-CKvbwCiX.cjs} +1 -1
- package/dist/threeSceneView-BVbVe_Et.js +1277 -0
- package/dist/threeSceneView-KvCERteS.cjs +5 -0
- package/dist/{threeViewerHost-IhSFkCeD.js → threeViewerHost-AuhfL2Cn.js} +55 -57
- package/dist/threeViewerHost-D0pu5wk5.cjs +1 -0
- package/package.json +1 -1
- package/public/icons/svg/editTable.svg +1 -1
- package/public/icons/svg/export.svg +1 -0
- package/public/icons/svg/model.svg +1 -0
- package/public/icons/svg/three.svg +1 -0
- package/dist/animationData-B2T3Oamw.js +0 -108
- package/dist/animationData-Db_9HBoM.cjs +0 -1
- package/dist/iconfont-CZj6ltAs.cjs +0 -1
- package/dist/index-2KKrCkl8.cjs +0 -1
- package/dist/index-2OWkrGDh.js +0 -24
- package/dist/index-B1iXzkUF.cjs +0 -1
- package/dist/index-BBB4VObc.cjs +0 -11
- package/dist/index-BIVWMqJQ.cjs +0 -1
- package/dist/index-BWpZSzL1.cjs +0 -1
- package/dist/index-BllULnvx.cjs +0 -1
- package/dist/index-BvO1uTn0.js +0 -21
- package/dist/index-C2bI4adc.js +0 -8628
- package/dist/index-C9pN8_un.js +0 -548
- package/dist/index-CPdKWCSo.cjs +0 -1
- package/dist/index-CQfFbeTJ.cjs +0 -1
- package/dist/index-CZJOPfp5.js +0 -1152
- package/dist/index-Cb0q1Y5b.cjs +0 -1
- package/dist/index-Cfomm0G1.cjs +0 -109
- package/dist/index-CvvFU_QA.cjs +0 -1
- package/dist/index-DYMLmifU.cjs +0 -1
- package/dist/index-DfPyuGyq.js +0 -101
- package/dist/index-Dm2qfeUm.cjs +0 -1
- package/dist/index-DtX1F0sz.cjs +0 -4
- package/dist/index-Du3VUDcF.cjs +0 -1
- package/dist/index-VWNqRYy9.js +0 -36270
- package/dist/index-kmj8K3JX.cjs +0 -1
- package/dist/index-ndZw4AQJ.cjs +0 -1
- package/dist/index-y5FEcncv.cjs +0 -1
- package/dist/index.vue_vue_type_style_index_1_lang-Bmwy3cgo.cjs +0 -42
- package/dist/index.vue_vue_type_style_index_1_lang-Rs1M3B8e.js +0 -11984
- package/dist/main-2gDZp_zL.cjs +0 -1
- package/dist/threeModel-DgOcIXVI.cjs +0 -1
- package/dist/threeSceneView-BZx98QgN.js +0 -1450
- package/dist/threeSceneView-DSkGJN5d.cjs +0 -5
- package/dist/threeViewerHost-T_51aUg5.cjs +0 -1
|
@@ -0,0 +1,1277 @@
|
|
|
1
|
+
var Ne = Object.defineProperty;
|
|
2
|
+
var qe = (y, o, a) => o in y ? Ne(y, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : y[o] = a;
|
|
3
|
+
var Fe = (y, o, a) => qe(y, typeof o != "symbol" ? o + "" : o, a);
|
|
4
|
+
import { defineComponent as Se, watch as oe, ref as M, shallowRef as be, computed as me, onUnmounted as Pe, resolveComponent as ae, createElementBlock as B, openBlock as E, createElementVNode as p, createCommentVNode as se, createBlock as de, createVNode as f, withCtx as H, unref as J, Fragment as Ie, renderList as Be, toDisplayString as K, onMounted as Ye, nextTick as Ee, onBeforeUnmount as We, withDirectives as ne, isRef as ve, vModelRadio as ge, vShow as he } from "vue";
|
|
5
|
+
import { u as He, a as Qe, b as et, S as D } from "./iconfont-DQodgJo8.js";
|
|
6
|
+
import { U as tt, s as lt } from "./index-ChtmIuBu.js";
|
|
7
|
+
import { L as nt, n as Me, o as at, h as ot, e as De, p as st, O as it, B as rt, V as G, k as pe, l as ut, m as ct, T as dt } from "./STLLoader-DofhZbOw.js";
|
|
8
|
+
import { a as W } from "./index-uvns6W6E.js";
|
|
9
|
+
import { i as Ue, j as mt } from "./index.vue_vue_type_style_index_1_lang-hffXwR3x.js";
|
|
10
|
+
import { c as je, E as j, R as Ae } from "./index-Dt2McMki.js";
|
|
11
|
+
import { o as pt, p as ft } from "./index-D8Msszln.js";
|
|
12
|
+
import { _ as _e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
13
|
+
const vt = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
|
|
14
|
+
function Re(y) {
|
|
15
|
+
if (y == null || !isFinite(y)) return "";
|
|
16
|
+
const o = y / (1024 * 1024);
|
|
17
|
+
if (o >= 1) return `${o.toFixed(1)} MB`;
|
|
18
|
+
const a = y / 1024;
|
|
19
|
+
return a >= 1 ? `${a.toFixed(1)} KB` : `${y} B`;
|
|
20
|
+
}
|
|
21
|
+
function Oe(y) {
|
|
22
|
+
try {
|
|
23
|
+
const o = y.split("?")[0].split("#")[0];
|
|
24
|
+
return o.substring(o.lastIndexOf("/") + 1) || o;
|
|
25
|
+
} catch {
|
|
26
|
+
return y;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function gt(y) {
|
|
30
|
+
const { manager: o, baseFolderUrl: a, onFileProgress: r } = y, g = new tt(o);
|
|
31
|
+
return g.packages = (v) => `${a.endsWith("/") ? a : a + "/"}${v}/`, g.loadMeshCb = (v, b, c) => {
|
|
32
|
+
const $ = (() => {
|
|
33
|
+
const w = v.split("?")[0].split("#")[0], d = w.lastIndexOf(".");
|
|
34
|
+
return d >= 0 ? w.slice(d + 1).toLowerCase() : void 0;
|
|
35
|
+
})();
|
|
36
|
+
switch ($) {
|
|
37
|
+
// OBJ+MTL
|
|
38
|
+
case "obj": {
|
|
39
|
+
const w = (() => {
|
|
40
|
+
try {
|
|
41
|
+
return new URL(".", v).toString();
|
|
42
|
+
} catch {
|
|
43
|
+
const e = v.lastIndexOf("/");
|
|
44
|
+
return e >= 0 ? v.slice(0, e + 1) : v;
|
|
45
|
+
}
|
|
46
|
+
})(), d = (() => {
|
|
47
|
+
var i;
|
|
48
|
+
return (((i = v.split("/").pop()) == null ? void 0 : i.split("?")[0].split("#")[0]) ?? "").replace(/\.[^/.?#]+$/, "");
|
|
49
|
+
})(), h = `${w}${d}.mtl`, s = (e) => {
|
|
50
|
+
const i = new it(b);
|
|
51
|
+
e && i.setMaterials(e), i.load(
|
|
52
|
+
v,
|
|
53
|
+
(t) => c(t),
|
|
54
|
+
(t) => r == null ? void 0 : r(v, t == null ? void 0 : t.loaded, t == null ? void 0 : t.total),
|
|
55
|
+
(t) => {
|
|
56
|
+
console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${v}`, t), c(new Me());
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}, l = new st(b);
|
|
60
|
+
l.setResourcePath(w), l.load(
|
|
61
|
+
h,
|
|
62
|
+
(e) => {
|
|
63
|
+
try {
|
|
64
|
+
e.preload();
|
|
65
|
+
} catch {
|
|
66
|
+
}
|
|
67
|
+
s(e);
|
|
68
|
+
},
|
|
69
|
+
(e) => r == null ? void 0 : r(h, e == null ? void 0 : e.loaded, e == null ? void 0 : e.total),
|
|
70
|
+
(e) => {
|
|
71
|
+
console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${h}。将尝试无材质加载。`), s(void 0);
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
case "stl": {
|
|
77
|
+
new at(b).load(
|
|
78
|
+
v,
|
|
79
|
+
(d) => {
|
|
80
|
+
const h = new ot({ color: 12303291, shininess: 30 }), s = new De(d, h);
|
|
81
|
+
s.castShadow = !0, s.receiveShadow = !0, c(s);
|
|
82
|
+
},
|
|
83
|
+
(d) => r == null ? void 0 : r(v, d == null ? void 0 : d.loaded, d == null ? void 0 : d.total),
|
|
84
|
+
(d) => {
|
|
85
|
+
console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${v}`, d), c(new Me());
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${$} (路径: ${v})`), c(new Me());
|
|
92
|
+
}
|
|
93
|
+
}, g;
|
|
94
|
+
}
|
|
95
|
+
function ht(y, o, a, r) {
|
|
96
|
+
return { loadSceneFromFile: (v) => new Promise((b, c) => {
|
|
97
|
+
a.value = !0, r.value = "正在初始化 URDF 加载器...";
|
|
98
|
+
let $ = 0, w = 0, d = null;
|
|
99
|
+
const h = new nt();
|
|
100
|
+
h.onStart = (l, e, i) => {
|
|
101
|
+
$ = i || 0, w = e || 0, r.value = $ > 0 ? `开始下载资源: 0 / ${$}` : "开始下载资源...", a.value = !0;
|
|
102
|
+
}, h.onProgress = (l, e, i) => {
|
|
103
|
+
w = e, $ = i;
|
|
104
|
+
const t = `正在加载 ${e} / ${i} 个文件: ${Oe(l)}`;
|
|
105
|
+
r.value = t, e === i && (r.value = "资源加载完成,正在处理模型...", setTimeout(() => {
|
|
106
|
+
if (d) {
|
|
107
|
+
d.updateMatrixWorld(!0);
|
|
108
|
+
const _ = new rt().setFromObject(d);
|
|
109
|
+
_.isEmpty() && console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"), d.userData.boundingBox = _, d.traverse((x) => {
|
|
110
|
+
x.isMesh && (x.castShadow = !0, x.receiveShadow = !0);
|
|
111
|
+
}), b(d);
|
|
112
|
+
} else
|
|
113
|
+
c(new Error("URDF 文件本身加载失败。"));
|
|
114
|
+
r.value = "模型加载完成", setTimeout(() => {
|
|
115
|
+
r.value === "模型加载完成" && (a.value = !1, r.value = "");
|
|
116
|
+
}, 500);
|
|
117
|
+
}, 100));
|
|
118
|
+
}, h.onError = (l) => {
|
|
119
|
+
console.warn(`LoadingManager 报告一个资源加载失败: ${l}。加载流程将继续。`);
|
|
120
|
+
};
|
|
121
|
+
const s = (l, e, i) => {
|
|
122
|
+
const t = Oe(l);
|
|
123
|
+
let _;
|
|
124
|
+
i && i > 0 ? _ = `${t}(${Re(e)} / ${Re(i)})` : e && e > 0 ? _ = `${t}(已下载 ${Re(e)})` : _ = `${t}`, r.value = `正在下载第 ${w + 1} / ${$} 个文件: ${_}`;
|
|
125
|
+
};
|
|
126
|
+
try {
|
|
127
|
+
const l = URL.createObjectURL(v);
|
|
128
|
+
gt({
|
|
129
|
+
manager: h,
|
|
130
|
+
baseFolderUrl: vt,
|
|
131
|
+
onFileProgress: s
|
|
132
|
+
}).load(
|
|
133
|
+
l,
|
|
134
|
+
(i) => {
|
|
135
|
+
d = i;
|
|
136
|
+
},
|
|
137
|
+
void 0,
|
|
138
|
+
(i) => {
|
|
139
|
+
console.error(`加载 URDF 文件 (${v.name}) 时发生致命错误:`, i), r.value = "URDF 文件解析失败", a.value = !1, c(new Error(`加载 URDF 文件失败: ${v.name}`, { cause: i }));
|
|
140
|
+
}
|
|
141
|
+
);
|
|
142
|
+
} catch (l) {
|
|
143
|
+
console.error("初始化 URDF 加载时发生致命错误:", l), r.value = "模型加载失败", a.value = !1, c(l);
|
|
144
|
+
}
|
|
145
|
+
}) };
|
|
146
|
+
}
|
|
147
|
+
class yt {
|
|
148
|
+
constructor(o) {
|
|
149
|
+
Fe(this, "robot");
|
|
150
|
+
Fe(this, "movableJoints");
|
|
151
|
+
this.robot = o, this.movableJoints = this.getMovableJoints();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* 获取所有可动关节
|
|
155
|
+
*/
|
|
156
|
+
getMovableJoints() {
|
|
157
|
+
return Object.values(this.robot.joints).filter((o) => o.jointType !== "fixed");
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 获取可动关节名称列表
|
|
161
|
+
*/
|
|
162
|
+
getMovableJointNames() {
|
|
163
|
+
return this.movableJoints.map((o) => o.name);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* 设置单个关节角度
|
|
167
|
+
*/
|
|
168
|
+
setJointAngle(o, a) {
|
|
169
|
+
const r = this.robot.joints[o];
|
|
170
|
+
if (!r || r.jointType === "fixed")
|
|
171
|
+
return console.warn(`关节 ${o} 不存在或不可动`), !1;
|
|
172
|
+
if (r.limit) {
|
|
173
|
+
const g = Math.max(r.limit.lower, Math.min(r.limit.upper, a));
|
|
174
|
+
g !== a && console.warn(`关节 ${o} 角度被限制在 [${r.limit.lower}, ${r.limit.upper}]`), r.setJointValue(g);
|
|
175
|
+
} else
|
|
176
|
+
r.setJointValue(a);
|
|
177
|
+
return !0;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* 批量设置关节角度
|
|
181
|
+
*/
|
|
182
|
+
setJointAngles(o) {
|
|
183
|
+
Object.entries(o).forEach(([a, r]) => {
|
|
184
|
+
typeof r == "number" && !isNaN(r) && this.setJointAngle(a, r);
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* 获取当前所有关节状态
|
|
189
|
+
*/
|
|
190
|
+
getCurrentJointStates() {
|
|
191
|
+
const o = {};
|
|
192
|
+
return this.movableJoints.forEach((a) => {
|
|
193
|
+
o[a.name] = a.angle || 0;
|
|
194
|
+
}), o;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* 重置所有关节到零位
|
|
198
|
+
*/
|
|
199
|
+
resetToZero() {
|
|
200
|
+
this.movableJoints.forEach((o) => {
|
|
201
|
+
o.setJointValue(0);
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* 获取关节限制信息
|
|
206
|
+
*/
|
|
207
|
+
getJointLimits(o) {
|
|
208
|
+
const a = this.robot.joints[o];
|
|
209
|
+
return !a || !a.limit ? null : {
|
|
210
|
+
lower: a.limit.lower,
|
|
211
|
+
upper: a.limit.upper
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 线性插值动画到目标状态
|
|
216
|
+
*/
|
|
217
|
+
async animateToState(o, a = 1e3, r) {
|
|
218
|
+
const g = this.getCurrentJointStates(), v = Date.now();
|
|
219
|
+
return new Promise((b) => {
|
|
220
|
+
const c = () => {
|
|
221
|
+
const $ = Date.now() - v, w = Math.min($ / a, 1), d = this.easeInOutCubic(w), h = {};
|
|
222
|
+
Object.keys(o).forEach((s) => {
|
|
223
|
+
const l = g[s] || 0, e = o[s];
|
|
224
|
+
h[s] = l + (e - l) * d;
|
|
225
|
+
}), this.setJointAngles(h), r && r(w), w < 1 ? requestAnimationFrame(c) : b();
|
|
226
|
+
};
|
|
227
|
+
c();
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* 缓动函数
|
|
232
|
+
*/
|
|
233
|
+
easeInOutCubic(o) {
|
|
234
|
+
return o < 0.5 ? 4 * o * o * o : 1 - Math.pow(-2 * o + 2, 3) / 2;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* 播放关键帧动画序列
|
|
238
|
+
*/
|
|
239
|
+
async playSequence(o, a = 1e3, r) {
|
|
240
|
+
for (let g = 0; g < o.length; g++)
|
|
241
|
+
await this.animateToState(o[g], a, (v) => {
|
|
242
|
+
r && r(g, v);
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
const we = 1e-3, fe = ut.degToRad, bt = (y) => y.reduce((o, a) => {
|
|
247
|
+
let r = 0;
|
|
248
|
+
const g = a.Y ?? 0, v = a.C ?? 0, b = a.R ?? 0;
|
|
249
|
+
return g > 0 && (r += g), v > 0 && b > 0 && (r += b * fe(v)), o + r;
|
|
250
|
+
}, 0), wt = (y) => {
|
|
251
|
+
const o = [], a = y.Y ?? 0, r = y.B ?? 0, g = y.C ?? 0, v = y.R ?? 0, b = {
|
|
252
|
+
pos: new G(0, 0, 0),
|
|
253
|
+
localY: new G(0, 1, 0),
|
|
254
|
+
localX: new G(1, 0, 0),
|
|
255
|
+
localZ: new G(0, 0, 1)
|
|
256
|
+
};
|
|
257
|
+
if (!a && !g) return o;
|
|
258
|
+
if (o.push(b.pos.clone()), r !== 0) {
|
|
259
|
+
const c = new pe().makeRotationAxis(b.localY, fe(r));
|
|
260
|
+
b.localX.applyMatrix4(c), b.localZ.applyMatrix4(c);
|
|
261
|
+
}
|
|
262
|
+
if (a > 0 && (b.pos.add(b.localY.clone().multiplyScalar(a * we)), o.push(b.pos.clone())), g > 0 && v > 0) {
|
|
263
|
+
const c = fe(g), $ = v * we, w = b.pos.clone().add(b.localX.clone().multiplyScalar(-$)), d = Math.max(16, Math.ceil(g / 5));
|
|
264
|
+
for (let h = 1; h <= d; h++) {
|
|
265
|
+
const s = c * h / d, l = new pe().makeRotationAxis(b.localZ, s), i = b.localX.clone().multiplyScalar($).applyMatrix4(l), t = w.clone().add(i);
|
|
266
|
+
o.push(t);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
return o;
|
|
270
|
+
};
|
|
271
|
+
function ye(y, o, a, r, g, v = 0) {
|
|
272
|
+
let b = o.slice(0, g + 1);
|
|
273
|
+
const c = o[g + 1];
|
|
274
|
+
if (c && v > 0) {
|
|
275
|
+
const e = {
|
|
276
|
+
...c,
|
|
277
|
+
// 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
|
|
278
|
+
B: (c.B ?? 0) * v,
|
|
279
|
+
// 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
|
|
280
|
+
C: (c.C ?? 0) * v
|
|
281
|
+
};
|
|
282
|
+
b.push(e);
|
|
283
|
+
}
|
|
284
|
+
const $ = bt(b), w = Math.max(0, a - $), d = [];
|
|
285
|
+
d.push(new G(0, 0, 0));
|
|
286
|
+
const h = new G(0, w * we, 0);
|
|
287
|
+
w > 0 && d.push(h);
|
|
288
|
+
let s = {
|
|
289
|
+
pos: h.clone(),
|
|
290
|
+
localY: new G(0, 1, 0),
|
|
291
|
+
localX: new G(1, 0, 0),
|
|
292
|
+
localZ: new G(0, 0, 1)
|
|
293
|
+
};
|
|
294
|
+
const l = [];
|
|
295
|
+
for (let e = b.length - 1; e >= 0; e--) {
|
|
296
|
+
const i = b[e], t = wt(i);
|
|
297
|
+
if (t.length > 0) {
|
|
298
|
+
const _ = t.map((P) => {
|
|
299
|
+
const I = P.clone(), Q = new pe();
|
|
300
|
+
return Q.makeBasis(s.localX, s.localY, s.localZ), I.applyMatrix4(Q), I.add(s.pos);
|
|
301
|
+
});
|
|
302
|
+
l.push(_);
|
|
303
|
+
const x = _[_.length - 1];
|
|
304
|
+
s.pos = x.clone();
|
|
305
|
+
const O = i.B ?? 0, re = i.C ?? 0;
|
|
306
|
+
if (O !== 0) {
|
|
307
|
+
const P = new pe().makeRotationAxis(s.localY, fe(O));
|
|
308
|
+
s.localX.applyMatrix4(P), s.localZ.applyMatrix4(P);
|
|
309
|
+
}
|
|
310
|
+
if (re > 0) {
|
|
311
|
+
const P = fe(re), I = new pe().makeRotationAxis(s.localZ, P);
|
|
312
|
+
s.localY.applyMatrix4(I), s.localX.applyMatrix4(I);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
for (const e of l)
|
|
317
|
+
e.length > 1 && d.push(...e.slice(1));
|
|
318
|
+
d.length < 2 && d.push(new G(0, 1e-3, 0));
|
|
319
|
+
try {
|
|
320
|
+
const e = new ct(d, !1, "catmullrom", 0.01), i = new dt(e, Math.max(2, d.length * 4), r * we, 18, !1);
|
|
321
|
+
y.geometry.dispose(), y.geometry = i;
|
|
322
|
+
} catch (e) {
|
|
323
|
+
console.error("管件更新失败", e);
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
const _t = { class: "panel-content" }, kt = { class: "action-bar" }, $t = {
|
|
327
|
+
key: 0,
|
|
328
|
+
class: "animation-controls"
|
|
329
|
+
}, Ct = { class: "control-row" }, Vt = { class: "control-row" }, xt = { class: "control-row" }, Tt = { class: "frame-info" }, Ft = { class: "control-row" }, Mt = { class: "progress-bar" }, Rt = {
|
|
330
|
+
key: 1,
|
|
331
|
+
class: "table-footer"
|
|
332
|
+
}, Dt = { class: "dialog-footer" }, St = /* @__PURE__ */ Se({
|
|
333
|
+
__name: "animationPanel",
|
|
334
|
+
props: {
|
|
335
|
+
model: {},
|
|
336
|
+
threeData: {}
|
|
337
|
+
},
|
|
338
|
+
emits: ["getThreeData"],
|
|
339
|
+
setup(y, { emit: o }) {
|
|
340
|
+
const a = y, r = o;
|
|
341
|
+
oe(() => a.threeData, () => {
|
|
342
|
+
if (a.threeData) {
|
|
343
|
+
const u = je(a.threeData);
|
|
344
|
+
c.value = (u == null ? void 0 : u["输出(动画数据)"]) || [], console.log("aniamtion tableData", c.value);
|
|
345
|
+
const n = (u == null ? void 0 : u.extra) || {};
|
|
346
|
+
console.log("aniamtion extraForm", n);
|
|
347
|
+
let k = n.管长, F = n.外径;
|
|
348
|
+
console.log("管长", k, "外径", F, n), x.value = k, O.value = F / 2;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
const g = M(), v = M(), b = async () => {
|
|
352
|
+
if (!sessionStorage.getItem("systemKey")) {
|
|
353
|
+
r("getThreeData");
|
|
354
|
+
return;
|
|
355
|
+
}
|
|
356
|
+
const n = await Ue("弯管仿真加工分析/管件解析", sessionStorage.getItem("systemKey"), "");
|
|
357
|
+
let k = ["管长", "外径"], F = {};
|
|
358
|
+
n == null || n.forEach((C) => {
|
|
359
|
+
var R;
|
|
360
|
+
(C == null ? void 0 : C.comp) === "Form" && ((R = C == null ? void 0 : C.compData) == null || R.forEach((q) => {
|
|
361
|
+
var ue;
|
|
362
|
+
(q == null ? void 0 : q.key) === "formContent" && ((ue = q == null ? void 0 : q.contents) == null || ue.forEach((le) => {
|
|
363
|
+
k.includes(le == null ? void 0 : le.key) && (F[le.key] = le.value);
|
|
364
|
+
}));
|
|
365
|
+
}));
|
|
366
|
+
});
|
|
367
|
+
let V = F.管长, U = F.外径;
|
|
368
|
+
console.log("管长", V, "外径", U, F), x.value = V, O.value = U / 2;
|
|
369
|
+
let Y = {};
|
|
370
|
+
const X = await Ue("弯管仿真加工分析/仿真动画生成", sessionStorage.getItem("systemKey"), "");
|
|
371
|
+
X == null || X.forEach((C) => {
|
|
372
|
+
var R, q, ue, le, Le, ze;
|
|
373
|
+
if ((C == null ? void 0 : C.comp) === "Table") {
|
|
374
|
+
let Je = [], xe = (ue = (q = (R = C == null ? void 0 : C.compData) == null ? void 0 : R.find((z) => (z == null ? void 0 : z.key) === "header")) == null ? void 0 : q.contents) == null ? void 0 : ue.map((z) => z == null ? void 0 : z.label), Te = (ze = (Le = (le = C == null ? void 0 : C.compData) == null ? void 0 : le.find((z) => (z == null ? void 0 : z.key) === "tableContents")) == null ? void 0 : Le.contents) == null ? void 0 : ze.map((z) => (z = z == null ? void 0 : z.filter((ce) => !(ce != null && ce.id)), z));
|
|
375
|
+
Te == null || Te.forEach((z) => {
|
|
376
|
+
Je.push(mt(z, xe == null ? void 0 : xe.filter((ce) => ce !== "操作")));
|
|
377
|
+
}), Y[C.name] = Je, Y[C.name + "Content"] = C;
|
|
378
|
+
}
|
|
379
|
+
}), g.value = Y;
|
|
380
|
+
const A = je(g.value);
|
|
381
|
+
c.value = (A == null ? void 0 : A["输出(动画数据)"]) || [];
|
|
382
|
+
let N = (A == null ? void 0 : A["输出(动画数据)Content"]) ?? [];
|
|
383
|
+
N && (v.value = N);
|
|
384
|
+
}, c = M([]), $ = M(!1), w = M(""), d = M(!1), h = M(0), s = M(0), l = M(1e3), e = M(null);
|
|
385
|
+
let i = !1;
|
|
386
|
+
const t = be(null), _ = be(null), x = M(1302), O = M(12.5), re = M(30), P = M([]), I = M(null), Q = me(() => a.model ? Object.values(a.model.joints).filter((u) => u.jointType !== "fixed").map((u) => u.name) : []), ke = M(["Y", "B", "C", "R"]), S = me(() => [...Q.value, ...ke.value]), $e = me(() => S.value.length > 0 ? `请按以下格式粘贴数据 (第一行为表头,使用 Tab 分隔):
|
|
387
|
+
${S.value.join(" ")}
|
|
388
|
+
0 0 0 ...
|
|
389
|
+
1 2 3 ...` : "请先加载模型。"), Z = (u, n) => {
|
|
390
|
+
if (!n)
|
|
391
|
+
return null;
|
|
392
|
+
const k = u.links[n];
|
|
393
|
+
if (!k)
|
|
394
|
+
return console.warn(`在模型中未找到名为 '${n}' 的 link`), console.log("可用的链接:", Object.keys(u.links)), null;
|
|
395
|
+
let F = null;
|
|
396
|
+
return k.traverse((V) => {
|
|
397
|
+
V instanceof De && !F && (F = V);
|
|
398
|
+
}), F || console.warn(`在 link '${n}' 中未找到可用的 Mesh 对象`), F;
|
|
399
|
+
}, ee = () => {
|
|
400
|
+
_.value && (_.value.visible = !0), t.value && t.value.parent && t.value.parent.remove(t.value), _.value = null, t.value = null;
|
|
401
|
+
};
|
|
402
|
+
oe(S, (u, n) => {
|
|
403
|
+
if (JSON.stringify(u) !== JSON.stringify(n))
|
|
404
|
+
if (u.length > 0) {
|
|
405
|
+
const k = u.reduce((F, V) => (F[V] = "0", F), {});
|
|
406
|
+
c.value = [k];
|
|
407
|
+
} else
|
|
408
|
+
c.value = [];
|
|
409
|
+
}, { immediate: !0 }), oe(() => a.model, (u) => {
|
|
410
|
+
ee(), u ? (e.value = new yt(u), P.value = Object.keys(u.links), P.value.includes("Pipe_Link") ? I.value = "Pipe_Link" : I.value = null) : (e.value = null, P.value = [], I.value = null);
|
|
411
|
+
}, { immediate: !0 }), oe(I, (u) => {
|
|
412
|
+
if (ee(), a.model && u) {
|
|
413
|
+
const n = Z(a.model, u);
|
|
414
|
+
if (console.log(n, "meshToReplace"), n && n.parent) {
|
|
415
|
+
_.value = n;
|
|
416
|
+
const k = new De(
|
|
417
|
+
n.geometry.clone(),
|
|
418
|
+
n.material
|
|
419
|
+
);
|
|
420
|
+
k.name = "managed_pipe_clone", n.parent.add(k), k.position.copy(n.position), k.rotation.copy(n.rotation), k.scale.copy(n.scale), n.visible = !1, k.position.y -= re.value * 1e-3, t.value = k, j.success(`已将 Link: "${u}" 设置为当前管件`);
|
|
421
|
+
} else
|
|
422
|
+
u && console.warn(`在 link '${u}' 中未找到可替换的网格或其没有父级。`);
|
|
423
|
+
}
|
|
424
|
+
});
|
|
425
|
+
const ie = () => c.value.map((u) => ({
|
|
426
|
+
Y: parseFloat(u.Y) || 0,
|
|
427
|
+
B: parseFloat(u.B) || 0,
|
|
428
|
+
C: parseFloat(u.C) || 0,
|
|
429
|
+
R: parseFloat(u.R) || 0
|
|
430
|
+
})), Ce = (u) => {
|
|
431
|
+
if (u < 0 || u >= c.value.length) {
|
|
432
|
+
console.error(`帧索引 ${u} 超出范围`);
|
|
433
|
+
return;
|
|
434
|
+
}
|
|
435
|
+
const n = c.value[u];
|
|
436
|
+
if (console.log(`应用第 ${u} 帧数据 ${n.value}`), e.value) {
|
|
437
|
+
const k = {};
|
|
438
|
+
Q.value.forEach((F) => {
|
|
439
|
+
const V = parseFloat(n[F]);
|
|
440
|
+
isNaN(V) || (k[F] = V);
|
|
441
|
+
}), e.value.setJointAngles(k);
|
|
442
|
+
}
|
|
443
|
+
if (t.value) {
|
|
444
|
+
const k = ie();
|
|
445
|
+
console.log("ybcr数据:", k), ye(
|
|
446
|
+
t.value,
|
|
447
|
+
k,
|
|
448
|
+
x.value,
|
|
449
|
+
O.value,
|
|
450
|
+
u,
|
|
451
|
+
0
|
|
452
|
+
);
|
|
453
|
+
}
|
|
454
|
+
h.value = u;
|
|
455
|
+
}, Ve = async () => {
|
|
456
|
+
if (c.value.length === 0) {
|
|
457
|
+
j.error("无法播放动画:无数据");
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
d.value = !0, i = !1, h.value = 0;
|
|
461
|
+
const u = t.value ? ie() : [];
|
|
462
|
+
try {
|
|
463
|
+
for (let n = 0; n < c.value.length && !i; n++) {
|
|
464
|
+
h.value = n;
|
|
465
|
+
const k = c.value[n], F = {};
|
|
466
|
+
e.value && Q.value.forEach((V) => {
|
|
467
|
+
const U = parseFloat(k[V]);
|
|
468
|
+
isNaN(U) || (F[V] = U);
|
|
469
|
+
}), e.value ? await e.value.animateToState(
|
|
470
|
+
F,
|
|
471
|
+
l.value,
|
|
472
|
+
(V) => {
|
|
473
|
+
s.value = (n + V) / c.value.length * 100, t.value && ye(t.value, u, x.value, O.value, n - 1, V);
|
|
474
|
+
}
|
|
475
|
+
) : t.value ? await new Promise((V) => {
|
|
476
|
+
const U = performance.now();
|
|
477
|
+
let Y;
|
|
478
|
+
const X = (A) => {
|
|
479
|
+
if (i) {
|
|
480
|
+
cancelAnimationFrame(Y), V();
|
|
481
|
+
return;
|
|
482
|
+
}
|
|
483
|
+
const N = A - U, C = Math.min(N / l.value, 1);
|
|
484
|
+
s.value = (n + C) / c.value.length * 100, ye(t.value, u, x.value, O.value, n - 1, C), C < 1 ? Y = requestAnimationFrame(X) : V();
|
|
485
|
+
};
|
|
486
|
+
Y = requestAnimationFrame(X);
|
|
487
|
+
}) : (await new Promise((V) => setTimeout(V, l.value)), s.value = (n + 1) / c.value.length * 100);
|
|
488
|
+
}
|
|
489
|
+
i || j.success("动画播放完成");
|
|
490
|
+
} catch (n) {
|
|
491
|
+
console.error("动画播放出错:", n), j.error("动画播放出错");
|
|
492
|
+
} finally {
|
|
493
|
+
d.value = !1, s.value = 0;
|
|
494
|
+
}
|
|
495
|
+
}, L = () => {
|
|
496
|
+
i = !0, d.value = !1, s.value = 0, j.info("动画已停止");
|
|
497
|
+
}, m = () => {
|
|
498
|
+
if (e.value && e.value.resetToZero(), console.log("pipeMesh.value", t.value), t.value) {
|
|
499
|
+
const u = ie();
|
|
500
|
+
ye(
|
|
501
|
+
t.value,
|
|
502
|
+
u,
|
|
503
|
+
x.value,
|
|
504
|
+
O.value,
|
|
505
|
+
-1,
|
|
506
|
+
0
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
h.value = 0, j.success("机器人和管件已重置");
|
|
510
|
+
}, te = () => {
|
|
511
|
+
console.log("当前管件Mesh:", t.value);
|
|
512
|
+
}, T = (u) => {
|
|
513
|
+
d.value && L(), Ce(u);
|
|
514
|
+
}, Xe = async () => {
|
|
515
|
+
if (S.value.length === 0) {
|
|
516
|
+
j.warning("没有可导出的表头");
|
|
517
|
+
return;
|
|
518
|
+
}
|
|
519
|
+
const u = S.value.join(" ");
|
|
520
|
+
try {
|
|
521
|
+
await navigator.clipboard.writeText(u), j.success("表头已成功复制到剪贴板!");
|
|
522
|
+
} catch (n) {
|
|
523
|
+
console.error("复制失败:", n), j.error("复制失败,请检查浏览器权限或手动复制。");
|
|
524
|
+
}
|
|
525
|
+
}, Ke = () => {
|
|
526
|
+
if (!w.value.trim()) {
|
|
527
|
+
j.warning("导入内容不能为空");
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
const u = w.value.trim().split(`
|
|
531
|
+
`).filter((U) => U.trim() !== "");
|
|
532
|
+
if (u.length < 2) {
|
|
533
|
+
j.error("导入数据至少需要包含表头行和一行数据");
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
const n = u[0].split(" ").map((U) => U.trim()), k = {};
|
|
537
|
+
if (n.forEach((U, Y) => {
|
|
538
|
+
S.value.includes(U) && (k[Y] = U);
|
|
539
|
+
}), Object.keys(k).length === 0) {
|
|
540
|
+
j.error("没有找到匹配的表头,请检查表头名称是否正确");
|
|
541
|
+
return;
|
|
542
|
+
}
|
|
543
|
+
const V = u.slice(1).map((U) => {
|
|
544
|
+
const Y = U.split(" "), X = {};
|
|
545
|
+
return S.value.forEach((A) => {
|
|
546
|
+
X[A] = "0";
|
|
547
|
+
}), Object.entries(k).forEach(([A, N]) => {
|
|
548
|
+
const C = Y[parseInt(A)];
|
|
549
|
+
C !== void 0 && C.trim() !== "" && (X[N] = C.trim());
|
|
550
|
+
}), X;
|
|
551
|
+
});
|
|
552
|
+
V.length > 0 ? (c.value = V, j.success(`成功导入 ${V.length} 行数据!`), $.value = !1, w.value = "") : j.error("未能解析到有效数据,请检查格式。");
|
|
553
|
+
}, Ze = () => {
|
|
554
|
+
const u = S.value.reduce((n, k) => (n[k] = "0", n), {});
|
|
555
|
+
c.value.push(u);
|
|
556
|
+
}, Ge = (u) => `第 ${u + 1} 帧`;
|
|
557
|
+
return Pe(() => {
|
|
558
|
+
ee(), i = !0;
|
|
559
|
+
}), (u, n) => {
|
|
560
|
+
var A, N, C;
|
|
561
|
+
const k = ae("el-icon"), F = ae("el-input-number"), V = ae("el-slider"), U = ae("el-progress"), Y = ae("el-input"), X = ae("el-dialog");
|
|
562
|
+
return E(), B("div", _t, [
|
|
563
|
+
p("div", kt, [
|
|
564
|
+
f(W, {
|
|
565
|
+
onClick: b,
|
|
566
|
+
modelValue: "获取数据"
|
|
567
|
+
}),
|
|
568
|
+
f(W, {
|
|
569
|
+
onClick: Xe,
|
|
570
|
+
disabled: S.value.length === 0,
|
|
571
|
+
modelValue: "导出表头"
|
|
572
|
+
}, null, 8, ["disabled"]),
|
|
573
|
+
f(W, {
|
|
574
|
+
modelValue: "播放",
|
|
575
|
+
onClick: Ve,
|
|
576
|
+
disabled: c.value.length === 0 || d.value,
|
|
577
|
+
buttonType: "primary"
|
|
578
|
+
}, {
|
|
579
|
+
default: H(() => [
|
|
580
|
+
d.value ? (E(), de(k, {
|
|
581
|
+
key: 0,
|
|
582
|
+
class: "is-loading"
|
|
583
|
+
}, {
|
|
584
|
+
default: H(() => [
|
|
585
|
+
f(J(Ae))
|
|
586
|
+
]),
|
|
587
|
+
_: 1
|
|
588
|
+
})) : se("", !0)
|
|
589
|
+
]),
|
|
590
|
+
_: 1
|
|
591
|
+
}, 8, ["disabled"]),
|
|
592
|
+
f(W, {
|
|
593
|
+
onClick: L,
|
|
594
|
+
modelValue: "停止",
|
|
595
|
+
buttonType: "danger"
|
|
596
|
+
}),
|
|
597
|
+
f(W, {
|
|
598
|
+
onClick: m,
|
|
599
|
+
modelValue: "重置",
|
|
600
|
+
buttonType: "primary"
|
|
601
|
+
}),
|
|
602
|
+
f(W, {
|
|
603
|
+
onClick: te,
|
|
604
|
+
modelValue: "测试功能",
|
|
605
|
+
buttonType: "primary"
|
|
606
|
+
})
|
|
607
|
+
]),
|
|
608
|
+
c.value.length > 0 ? (E(), B("div", $t, [
|
|
609
|
+
p("div", Ct, [
|
|
610
|
+
n[8] || (n[8] = p("label", null, "帧间隔 (ms):", -1)),
|
|
611
|
+
f(F, {
|
|
612
|
+
modelValue: l.value,
|
|
613
|
+
"onUpdate:modelValue": n[0] || (n[0] = (R) => l.value = R),
|
|
614
|
+
min: 100,
|
|
615
|
+
max: 5e3,
|
|
616
|
+
step: 100,
|
|
617
|
+
size: "small",
|
|
618
|
+
style: { width: "120px" }
|
|
619
|
+
}, null, 8, ["modelValue"]),
|
|
620
|
+
n[9] || (n[9] = p("label", null, "管件总长 (mm):", -1)),
|
|
621
|
+
f(F, {
|
|
622
|
+
modelValue: x.value,
|
|
623
|
+
"onUpdate:modelValue": n[1] || (n[1] = (R) => x.value = R),
|
|
624
|
+
min: 0,
|
|
625
|
+
size: "small",
|
|
626
|
+
style: { width: "120px" }
|
|
627
|
+
}, null, 8, ["modelValue"]),
|
|
628
|
+
n[10] || (n[10] = p("label", null, "管件半径 (mm):", -1)),
|
|
629
|
+
f(F, {
|
|
630
|
+
modelValue: O.value,
|
|
631
|
+
"onUpdate:modelValue": n[2] || (n[2] = (R) => O.value = R),
|
|
632
|
+
min: 0,
|
|
633
|
+
size: "small",
|
|
634
|
+
style: { width: "120px" }
|
|
635
|
+
}, null, 8, ["modelValue"])
|
|
636
|
+
]),
|
|
637
|
+
p("div", Vt, [
|
|
638
|
+
n[11] || (n[11] = p("label", null, "管件 Mesh:", -1)),
|
|
639
|
+
f(J(pt), {
|
|
640
|
+
modelValue: I.value,
|
|
641
|
+
"onUpdate:modelValue": n[3] || (n[3] = (R) => I.value = R),
|
|
642
|
+
placeholder: "选择管件Link",
|
|
643
|
+
size: "small",
|
|
644
|
+
disabled: "",
|
|
645
|
+
style: { width: "180px" }
|
|
646
|
+
}, {
|
|
647
|
+
default: H(() => [
|
|
648
|
+
(E(!0), B(Ie, null, Be(P.value, (R) => (E(), de(J(ft), {
|
|
649
|
+
key: R,
|
|
650
|
+
label: R,
|
|
651
|
+
value: R
|
|
652
|
+
}, null, 8, ["label", "value"]))), 128))
|
|
653
|
+
]),
|
|
654
|
+
_: 1
|
|
655
|
+
}, 8, ["modelValue", "disabled"])
|
|
656
|
+
]),
|
|
657
|
+
p("div", xt, [
|
|
658
|
+
n[12] || (n[12] = p("label", null, "当前帧:", -1)),
|
|
659
|
+
p("span", Tt, K(h.value + 1) + " / " + K(c.value.length), 1)
|
|
660
|
+
]),
|
|
661
|
+
p("div", Ft, [
|
|
662
|
+
n[13] || (n[13] = p("label", null, "动画进度:", -1)),
|
|
663
|
+
f(V, {
|
|
664
|
+
modelValue: h.value,
|
|
665
|
+
"onUpdate:modelValue": n[4] || (n[4] = (R) => h.value = R),
|
|
666
|
+
min: 0,
|
|
667
|
+
max: c.value.length > 0 ? c.value.length - 1 : 0,
|
|
668
|
+
step: 1,
|
|
669
|
+
"format-tooltip": Ge,
|
|
670
|
+
onInput: T,
|
|
671
|
+
disabled: c.value.length === 0,
|
|
672
|
+
style: { "flex-grow": "1", margin: "0 10px" }
|
|
673
|
+
}, null, 8, ["modelValue", "max", "disabled"])
|
|
674
|
+
]),
|
|
675
|
+
p("div", Mt, [
|
|
676
|
+
f(U, {
|
|
677
|
+
percentage: s.value,
|
|
678
|
+
"show-text": !1,
|
|
679
|
+
"stroke-width": 6
|
|
680
|
+
}, null, 8, ["percentage"])
|
|
681
|
+
])
|
|
682
|
+
])) : se("", !0),
|
|
683
|
+
(E(), de(lt, {
|
|
684
|
+
itemData: (A = v.value) == null ? void 0 : A.compData,
|
|
685
|
+
key: (N = v.value) == null ? void 0 : N.id,
|
|
686
|
+
index: (C = v.value) == null ? void 0 : C.id,
|
|
687
|
+
showHeader: !1
|
|
688
|
+
}, null, 8, ["itemData", "index"])),
|
|
689
|
+
S.value.length > 0 ? (E(), B("div", Rt, [
|
|
690
|
+
f(W, {
|
|
691
|
+
modelValue: "添加新行",
|
|
692
|
+
onClick: Ze,
|
|
693
|
+
buttonType: "primary"
|
|
694
|
+
}, {
|
|
695
|
+
default: H(() => [
|
|
696
|
+
d.value ? (E(), de(k, {
|
|
697
|
+
key: 0,
|
|
698
|
+
class: "is-loading"
|
|
699
|
+
}, {
|
|
700
|
+
default: H(() => [
|
|
701
|
+
f(J(Ae))
|
|
702
|
+
]),
|
|
703
|
+
_: 1
|
|
704
|
+
})) : se("", !0)
|
|
705
|
+
]),
|
|
706
|
+
_: 1
|
|
707
|
+
})
|
|
708
|
+
])) : se("", !0),
|
|
709
|
+
f(X, {
|
|
710
|
+
modelValue: $.value,
|
|
711
|
+
"onUpdate:modelValue": n[7] || (n[7] = (R) => $.value = R),
|
|
712
|
+
title: "导入数据",
|
|
713
|
+
width: "500px"
|
|
714
|
+
}, {
|
|
715
|
+
footer: H(() => [
|
|
716
|
+
p("span", Dt, [
|
|
717
|
+
f(W, {
|
|
718
|
+
modelValue: "取消",
|
|
719
|
+
onClick: n[6] || (n[6] = (R) => $.value = !1)
|
|
720
|
+
}),
|
|
721
|
+
f(W, {
|
|
722
|
+
modelValue: "确认导入",
|
|
723
|
+
onClick: Ke,
|
|
724
|
+
type: "primary"
|
|
725
|
+
})
|
|
726
|
+
])
|
|
727
|
+
]),
|
|
728
|
+
default: H(() => [
|
|
729
|
+
n[14] || (n[14] = p("p", { class: "import-instructions" }, " 请从Excel或csv中复制数据 (首行为表头, Tab分隔) ", -1)),
|
|
730
|
+
f(Y, {
|
|
731
|
+
modelValue: w.value,
|
|
732
|
+
"onUpdate:modelValue": n[5] || (n[5] = (R) => w.value = R),
|
|
733
|
+
type: "textarea",
|
|
734
|
+
rows: 10,
|
|
735
|
+
placeholder: $e.value
|
|
736
|
+
}, null, 8, ["modelValue", "placeholder"])
|
|
737
|
+
]),
|
|
738
|
+
_: 1,
|
|
739
|
+
__: [14]
|
|
740
|
+
}, 8, ["modelValue"])
|
|
741
|
+
]);
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
}), Lt = /* @__PURE__ */ _e(St, [["__scopeId", "data-v-bd8eb2be"]]), zt = { class: "panel-content" }, Jt = {
|
|
745
|
+
key: 0,
|
|
746
|
+
class: "joints-list"
|
|
747
|
+
}, Et = { class: "joint-info-row" }, Ut = { class: "joint-left" }, jt = { class: "joint-name" }, At = { class: "joint-range" }, Ot = { class: "joint-type" }, Pt = {
|
|
748
|
+
key: 0,
|
|
749
|
+
class: "joint-control-row"
|
|
750
|
+
}, It = { class: "slider-container" }, Bt = ["min", "max", "value", "onInput"], Yt = { class: "value-display" }, Xt = { class: "joint-value" }, Kt = { class: "unit" }, Zt = {
|
|
751
|
+
key: 1,
|
|
752
|
+
class: "empty-state"
|
|
753
|
+
}, Gt = /* @__PURE__ */ Se({
|
|
754
|
+
__name: "urdfJointPanel",
|
|
755
|
+
props: {
|
|
756
|
+
model: {}
|
|
757
|
+
},
|
|
758
|
+
setup(y, { expose: o }) {
|
|
759
|
+
const a = y, r = M([]), g = M(null), v = (s, l = !1) => s === "revolute" ? l ? Math.PI : -Math.PI : s === "prismatic" ? l ? 1 : -1 : 0, b = (s) => {
|
|
760
|
+
if (!s || !s.joints)
|
|
761
|
+
return console.warn("URDF模型无效或不包含关节信息"), [];
|
|
762
|
+
const l = [];
|
|
763
|
+
return Object.keys(s.joints).forEach((e) => {
|
|
764
|
+
var _, x;
|
|
765
|
+
const i = s.joints[e];
|
|
766
|
+
if (i.jointType === "fixed")
|
|
767
|
+
return;
|
|
768
|
+
const t = {
|
|
769
|
+
lower: ((_ = i.limit) == null ? void 0 : _.lower) ?? v(i.jointType, !1),
|
|
770
|
+
upper: ((x = i.limit) == null ? void 0 : x.upper) ?? v(i.jointType, !0)
|
|
771
|
+
};
|
|
772
|
+
l.push({
|
|
773
|
+
name: e,
|
|
774
|
+
type: i.jointType || "unknown",
|
|
775
|
+
limit: t,
|
|
776
|
+
currentValue: i.angle || 0,
|
|
777
|
+
urdfJoint: i
|
|
778
|
+
});
|
|
779
|
+
}), l.sort((e, i) => e.name.localeCompare(i.name));
|
|
780
|
+
}, c = (s, l) => {
|
|
781
|
+
var _;
|
|
782
|
+
const e = r.value.find((x) => x.name === s);
|
|
783
|
+
if (!e) return;
|
|
784
|
+
const i = parseFloat(l), t = Math.max(e.limit.lower, Math.min(e.limit.upper, i));
|
|
785
|
+
e.currentValue = t, (_ = a.model) != null && _.setJointValue ? a.model.setJointValue(s, t) : e.urdfJoint.setJointValue(t);
|
|
786
|
+
}, $ = () => {
|
|
787
|
+
r.value.forEach((s) => {
|
|
788
|
+
(s.type === "revolute" || s.type === "prismatic") && c(s.name, 0);
|
|
789
|
+
});
|
|
790
|
+
}, w = () => {
|
|
791
|
+
a.model && r.value.forEach((s) => {
|
|
792
|
+
s.urdfJoint.angle !== void 0 && s.currentValue !== s.urdfJoint.angle && (s.currentValue = s.urdfJoint.angle);
|
|
793
|
+
});
|
|
794
|
+
}, d = () => {
|
|
795
|
+
const s = () => {
|
|
796
|
+
w(), g.value = requestAnimationFrame(s);
|
|
797
|
+
};
|
|
798
|
+
s();
|
|
799
|
+
}, h = () => {
|
|
800
|
+
g.value && (cancelAnimationFrame(g.value), g.value = null);
|
|
801
|
+
};
|
|
802
|
+
return oe(
|
|
803
|
+
() => a.model,
|
|
804
|
+
(s) => {
|
|
805
|
+
s ? r.value = b(s) : r.value = [];
|
|
806
|
+
},
|
|
807
|
+
{ immediate: !0 }
|
|
808
|
+
), Ye(() => {
|
|
809
|
+
d();
|
|
810
|
+
}), Pe(() => {
|
|
811
|
+
h();
|
|
812
|
+
}), o({
|
|
813
|
+
resetAllJoints: $
|
|
814
|
+
}), (s, l) => (E(), B("div", zt, [
|
|
815
|
+
r.value.length > 0 ? (E(), B("div", Jt, [
|
|
816
|
+
(E(!0), B(Ie, null, Be(r.value, (e) => (E(), B("div", {
|
|
817
|
+
key: e.name,
|
|
818
|
+
class: "joint-item"
|
|
819
|
+
}, [
|
|
820
|
+
p("div", Et, [
|
|
821
|
+
p("div", Ut, [
|
|
822
|
+
p("span", jt, K(e.name), 1),
|
|
823
|
+
p("span", At, " [" + K(e.limit.lower.toFixed(2)) + ", " + K(e.limit.upper.toFixed(2)) + "] ", 1)
|
|
824
|
+
]),
|
|
825
|
+
p("span", Ot, K(e.type), 1)
|
|
826
|
+
]),
|
|
827
|
+
e.type === "revolute" || e.type === "prismatic" ? (E(), B("div", Pt, [
|
|
828
|
+
p("div", It, [
|
|
829
|
+
p("input", {
|
|
830
|
+
type: "range",
|
|
831
|
+
min: e.limit.lower,
|
|
832
|
+
max: e.limit.upper,
|
|
833
|
+
step: "0.01",
|
|
834
|
+
value: e.currentValue,
|
|
835
|
+
onInput: (i) => c(e.name, i.target.value),
|
|
836
|
+
class: "joint-slider"
|
|
837
|
+
}, null, 40, Bt)
|
|
838
|
+
]),
|
|
839
|
+
p("div", Yt, [
|
|
840
|
+
p("span", Xt, K(e.currentValue ? Number(e.currentValue).toFixed(3) : "0.000"), 1),
|
|
841
|
+
p("span", Kt, K(e.type === "revolute" ? "rad" : "m"), 1)
|
|
842
|
+
])
|
|
843
|
+
])) : se("", !0)
|
|
844
|
+
]))), 128))
|
|
845
|
+
])) : (E(), B("div", Zt, l[0] || (l[0] = [
|
|
846
|
+
p("p", null, "未检测到可控制的关节", -1)
|
|
847
|
+
])))
|
|
848
|
+
]));
|
|
849
|
+
}
|
|
850
|
+
}), Nt = /* @__PURE__ */ _e(Gt, [["__scopeId", "data-v-9adcbc67"]]), qt = { class: "panel-content" }, Wt = "id", Ht = {
|
|
851
|
+
__name: "urdfTree",
|
|
852
|
+
props: {
|
|
853
|
+
model: Object,
|
|
854
|
+
maxExpandCount: {
|
|
855
|
+
type: Number,
|
|
856
|
+
default: 10
|
|
857
|
+
},
|
|
858
|
+
expandStrategy: {
|
|
859
|
+
type: String,
|
|
860
|
+
default: "breadth",
|
|
861
|
+
validator: (y) => ["breadth", "firstLevel"].includes(y)
|
|
862
|
+
}
|
|
863
|
+
},
|
|
864
|
+
emits: ["nodeClick"],
|
|
865
|
+
setup(y, { emit: o }) {
|
|
866
|
+
const a = y, r = o, g = M([]), v = {
|
|
867
|
+
children: "children",
|
|
868
|
+
label: "label"
|
|
869
|
+
}, b = (l) => {
|
|
870
|
+
r("nodeClick", l);
|
|
871
|
+
}, c = (l, e = 0) => {
|
|
872
|
+
const i = [];
|
|
873
|
+
return Array.isArray(l) && (l == null ? void 0 : l.length) > 0 && l.forEach((t) => {
|
|
874
|
+
if (!(t != null && t.isMesh) && ((t == null ? void 0 : t.type) === "URDFJoint" || (t == null ? void 0 : t.type) === "URDFLink")) {
|
|
875
|
+
const _ = {
|
|
876
|
+
name: t == null ? void 0 : t.name,
|
|
877
|
+
label: t == null ? void 0 : t.name,
|
|
878
|
+
show: !0,
|
|
879
|
+
level: e + 1,
|
|
880
|
+
isPenultimate: !1,
|
|
881
|
+
type: t == null ? void 0 : t.type,
|
|
882
|
+
id: t == null ? void 0 : t.id,
|
|
883
|
+
limit: (t == null ? void 0 : t.limit) ?? "",
|
|
884
|
+
children: c(t == null ? void 0 : t.children, e + 1),
|
|
885
|
+
path: t == null ? void 0 : t.name
|
|
886
|
+
};
|
|
887
|
+
i.push(_);
|
|
888
|
+
}
|
|
889
|
+
}), i;
|
|
890
|
+
}, $ = (l) => l ? [{
|
|
891
|
+
name: l == null ? void 0 : l.name,
|
|
892
|
+
label: l == null ? void 0 : l.name,
|
|
893
|
+
show: !0,
|
|
894
|
+
level: 1,
|
|
895
|
+
isPenultimate: !1,
|
|
896
|
+
type: l == null ? void 0 : l.type,
|
|
897
|
+
id: l == null ? void 0 : l.id,
|
|
898
|
+
limit: (l == null ? void 0 : l.limit) ?? "",
|
|
899
|
+
children: c(l == null ? void 0 : l.children, 1),
|
|
900
|
+
path: l == null ? void 0 : l.name
|
|
901
|
+
}] : [], w = (l, e) => {
|
|
902
|
+
const i = [], t = [...l];
|
|
903
|
+
for (; t.length > 0 && i.length < e; ) {
|
|
904
|
+
const _ = t.shift();
|
|
905
|
+
_.children && _.children.length > 0 && (i.push(_.id), t.push(..._.children));
|
|
906
|
+
}
|
|
907
|
+
return i;
|
|
908
|
+
}, d = (l, e) => {
|
|
909
|
+
const i = [];
|
|
910
|
+
return l.forEach((t) => {
|
|
911
|
+
if (t.children && t.children.length > 0) {
|
|
912
|
+
i.push(t.id);
|
|
913
|
+
const _ = t.children.filter((x) => x.children && x.children.length > 0).slice(0, e).map((x) => x.id);
|
|
914
|
+
i.push(..._);
|
|
915
|
+
}
|
|
916
|
+
}), i.slice(0, e + 1);
|
|
917
|
+
}, h = me(() => !g.value || g.value.length === 0 ? [] : a.expandStrategy === "firstLevel" ? d(g.value, a.maxExpandCount) : w(g.value, a.maxExpandCount)), s = me(() => a != null && a.model ? $(a.model) : []);
|
|
918
|
+
return oe(
|
|
919
|
+
s,
|
|
920
|
+
(l) => {
|
|
921
|
+
g.value = JSON.parse(JSON.stringify(l));
|
|
922
|
+
},
|
|
923
|
+
{ immediate: !0 }
|
|
924
|
+
), (l, e) => {
|
|
925
|
+
const i = ae("el-tree");
|
|
926
|
+
return E(), B("div", qt, [
|
|
927
|
+
f(i, {
|
|
928
|
+
data: g.value,
|
|
929
|
+
props: v,
|
|
930
|
+
"default-expanded-keys": h.value,
|
|
931
|
+
"node-key": Wt,
|
|
932
|
+
onNodeClick: b
|
|
933
|
+
}, null, 8, ["data", "default-expanded-keys"])
|
|
934
|
+
]);
|
|
935
|
+
};
|
|
936
|
+
}
|
|
937
|
+
}, Qt = /* @__PURE__ */ _e(Ht, [["__scopeId", "data-v-0dda287c"]]), el = { class: "obj-viewer-container" }, tl = { class: "buttonGroup-top" }, ll = { class: "buttonGroup-topLeft" }, nl = { class: "buttonGroup-left" }, al = { class: "buttonGroup-right" }, ol = { class: "buttonGroup-bottom" }, sl = { class: "left-panel" }, il = { class: "panel-header" }, rl = { class: "panel-body" }, ul = {
|
|
938
|
+
key: 1,
|
|
939
|
+
class: "clipping-content"
|
|
940
|
+
}, cl = { class: "radio-group" }, dl = { class: "radio-label" }, ml = { class: "radio-label" }, pl = { class: "radio-label" }, fl = { class: "radio-label" }, vl = { class: "right-panel" }, gl = { class: "panel-header" }, hl = { class: "panel-body" }, yl = {
|
|
941
|
+
key: 0,
|
|
942
|
+
class: "loading-overlay"
|
|
943
|
+
}, bl = /* @__PURE__ */ Se({
|
|
944
|
+
__name: "threeSceneView",
|
|
945
|
+
props: {
|
|
946
|
+
fileBlobs: { default: () => [] },
|
|
947
|
+
animationData: { default: () => ({}) },
|
|
948
|
+
threeData: {}
|
|
949
|
+
},
|
|
950
|
+
emits: ["getAnimationData", "getThreeData"],
|
|
951
|
+
setup(y, { emit: o }) {
|
|
952
|
+
const a = o, r = y, g = M(null), v = M(!1), b = M(""), c = M(!1), $ = M(""), w = M(!1), d = M(""), h = be(null), s = be(null), {
|
|
953
|
+
currentModels: l,
|
|
954
|
+
resetView: e,
|
|
955
|
+
initThreeJS: i,
|
|
956
|
+
handleResize: t,
|
|
957
|
+
getThreeJSObjects: _,
|
|
958
|
+
cleanup: x,
|
|
959
|
+
setModels: O
|
|
960
|
+
} = He(g), { loadSceneFromFile: re } = ht(
|
|
961
|
+
_,
|
|
962
|
+
l,
|
|
963
|
+
v,
|
|
964
|
+
b
|
|
965
|
+
), { isAnimating: P, toggleAnimation: I, stopAnimation: Q } = Qe(_, l), { isClipping: ke, activeClippingAxis: S, toggleClipping: $e, updateClippingPlanes: Z } = et(_, l), ee = (L) => {
|
|
966
|
+
c.value = !0, $.value = L, L === "剖面视图" && !ke.value && $e();
|
|
967
|
+
}, ie = (L) => {
|
|
968
|
+
w.value = !0, d.value = L, L === "动画仿真" && a("getAnimationData");
|
|
969
|
+
}, Ce = () => {
|
|
970
|
+
a("getThreeData");
|
|
971
|
+
}, Ve = () => {
|
|
972
|
+
Ee(() => {
|
|
973
|
+
});
|
|
974
|
+
};
|
|
975
|
+
return oe(() => r.fileBlobs, (L) => {
|
|
976
|
+
if (L && L.length > 0) {
|
|
977
|
+
const m = L[0];
|
|
978
|
+
if (!m.name.toLowerCase().endsWith(".urdf")) {
|
|
979
|
+
j.warning("提供的文件不是有效的 urdf 文件。");
|
|
980
|
+
return;
|
|
981
|
+
}
|
|
982
|
+
re(m).then((te) => {
|
|
983
|
+
h.value = te;
|
|
984
|
+
}).catch((te) => {
|
|
985
|
+
console.error("加载URDF文件时发生错误:", te), j.error("加载urdf模型失败"), h.value = null;
|
|
986
|
+
});
|
|
987
|
+
} else
|
|
988
|
+
h.value = null;
|
|
989
|
+
}, {
|
|
990
|
+
immediate: !0,
|
|
991
|
+
deep: !0
|
|
992
|
+
}), oe(h, (L) => {
|
|
993
|
+
O(L ? [L] : []);
|
|
994
|
+
}), Ye(async () => {
|
|
995
|
+
await Ee();
|
|
996
|
+
try {
|
|
997
|
+
i(), window.addEventListener("resize", t);
|
|
998
|
+
const L = _();
|
|
999
|
+
s.value = L.scene;
|
|
1000
|
+
} catch (L) {
|
|
1001
|
+
console.error("Three.js 初始化失败:", L), j.error("渲染引擎初始化失败!");
|
|
1002
|
+
}
|
|
1003
|
+
}), We(() => {
|
|
1004
|
+
$.value = "", d.value = "", window.removeEventListener("resize", t), P.value && Q(), x();
|
|
1005
|
+
}), (L, m) => {
|
|
1006
|
+
const te = ae("el-scrollbar");
|
|
1007
|
+
return E(), B("div", el, [
|
|
1008
|
+
p("div", {
|
|
1009
|
+
ref_key: "threejsContainer",
|
|
1010
|
+
ref: g,
|
|
1011
|
+
class: "threejs-container"
|
|
1012
|
+
}, null, 512),
|
|
1013
|
+
p("div", tl, [
|
|
1014
|
+
f(D, {
|
|
1015
|
+
name: "guanjianjiexi",
|
|
1016
|
+
size: "34"
|
|
1017
|
+
}),
|
|
1018
|
+
f(D, {
|
|
1019
|
+
name: "guanjiekongzhi",
|
|
1020
|
+
size: "34"
|
|
1021
|
+
}),
|
|
1022
|
+
f(D, {
|
|
1023
|
+
name: "gongyishengcheng",
|
|
1024
|
+
size: "34"
|
|
1025
|
+
}),
|
|
1026
|
+
f(D, {
|
|
1027
|
+
name: "buchangshezhi",
|
|
1028
|
+
size: "34"
|
|
1029
|
+
}),
|
|
1030
|
+
f(D, {
|
|
1031
|
+
name: "shuchujiagongchengxu",
|
|
1032
|
+
size: "34"
|
|
1033
|
+
})
|
|
1034
|
+
]),
|
|
1035
|
+
p("div", ll, [
|
|
1036
|
+
f(D, {
|
|
1037
|
+
name: "viewReset",
|
|
1038
|
+
size: "24",
|
|
1039
|
+
onClick: J(e),
|
|
1040
|
+
title: "重置"
|
|
1041
|
+
}, null, 8, ["onClick"]),
|
|
1042
|
+
f(D, {
|
|
1043
|
+
name: "fangda",
|
|
1044
|
+
size: "24",
|
|
1045
|
+
title: "放大"
|
|
1046
|
+
}),
|
|
1047
|
+
f(D, {
|
|
1048
|
+
name: "suoxiao",
|
|
1049
|
+
size: "24",
|
|
1050
|
+
title: "缩小"
|
|
1051
|
+
}),
|
|
1052
|
+
f(D, {
|
|
1053
|
+
name: "lookAround",
|
|
1054
|
+
size: "24",
|
|
1055
|
+
onClick: J(I),
|
|
1056
|
+
title: J(P) ? "停止动画" : "动画视图"
|
|
1057
|
+
}, null, 8, ["onClick", "title"])
|
|
1058
|
+
]),
|
|
1059
|
+
p("div", nl, [
|
|
1060
|
+
f(D, {
|
|
1061
|
+
name: "jiegoushu",
|
|
1062
|
+
size: "24",
|
|
1063
|
+
onClick: m[0] || (m[0] = (T) => ee("场景树")),
|
|
1064
|
+
active: c.value && $.value === "场景树",
|
|
1065
|
+
title: "场景树"
|
|
1066
|
+
}, null, 8, ["active"]),
|
|
1067
|
+
f(D, {
|
|
1068
|
+
name: "clipping",
|
|
1069
|
+
size: "24",
|
|
1070
|
+
onClick: m[1] || (m[1] = (T) => ee("剖面视图")),
|
|
1071
|
+
active: c.value && $.value === "剖面视图",
|
|
1072
|
+
title: "剖面视图"
|
|
1073
|
+
}, null, 8, ["active"]),
|
|
1074
|
+
f(D, {
|
|
1075
|
+
name: "donghuafangzhen",
|
|
1076
|
+
size: "24",
|
|
1077
|
+
onClick: m[2] || (m[2] = (T) => ee("场景树3"))
|
|
1078
|
+
}),
|
|
1079
|
+
f(D, {
|
|
1080
|
+
name: "donghuafangzhen",
|
|
1081
|
+
size: "24",
|
|
1082
|
+
onClick: m[3] || (m[3] = (T) => ee("场景4"))
|
|
1083
|
+
})
|
|
1084
|
+
]),
|
|
1085
|
+
p("div", al, [
|
|
1086
|
+
f(D, {
|
|
1087
|
+
name: "donghuafangzhen",
|
|
1088
|
+
size: "24"
|
|
1089
|
+
}),
|
|
1090
|
+
f(D, {
|
|
1091
|
+
name: "donghuafangzhen",
|
|
1092
|
+
size: "24"
|
|
1093
|
+
}),
|
|
1094
|
+
f(D, {
|
|
1095
|
+
name: "guanjiekongzhi",
|
|
1096
|
+
size: "24",
|
|
1097
|
+
onClick: m[4] || (m[4] = (T) => ie("关节控制")),
|
|
1098
|
+
active: w.value && d.value === "关节控制",
|
|
1099
|
+
title: "关节控制"
|
|
1100
|
+
}, null, 8, ["active"]),
|
|
1101
|
+
f(D, {
|
|
1102
|
+
name: "donghuafangzhen",
|
|
1103
|
+
size: "24",
|
|
1104
|
+
title: "动画仿真",
|
|
1105
|
+
onClick: m[5] || (m[5] = (T) => ie("动画仿真")),
|
|
1106
|
+
active: w.value && d.value === "动画仿真"
|
|
1107
|
+
}, null, 8, ["active"]),
|
|
1108
|
+
f(D, {
|
|
1109
|
+
name: "donghuafangzhen",
|
|
1110
|
+
size: "24",
|
|
1111
|
+
title: "urdf动画",
|
|
1112
|
+
onClick: m[6] || (m[6] = (T) => ie("urdf动画")),
|
|
1113
|
+
active: w.value && d.value === "urdf动画"
|
|
1114
|
+
}, null, 8, ["active"]),
|
|
1115
|
+
f(D, {
|
|
1116
|
+
name: "donghuafangzhen",
|
|
1117
|
+
size: "24"
|
|
1118
|
+
})
|
|
1119
|
+
]),
|
|
1120
|
+
p("div", ol, [
|
|
1121
|
+
f(D, {
|
|
1122
|
+
name: "kuaitui",
|
|
1123
|
+
size: "24",
|
|
1124
|
+
backgroundColor: "#ffffff",
|
|
1125
|
+
title: "快退",
|
|
1126
|
+
onClick: m[7] || (m[7] = () => {
|
|
1127
|
+
})
|
|
1128
|
+
}),
|
|
1129
|
+
f(D, {
|
|
1130
|
+
name: "bofang",
|
|
1131
|
+
size: "24",
|
|
1132
|
+
backgroundColor: "#ffffff",
|
|
1133
|
+
title: "播放",
|
|
1134
|
+
onClick: Ve
|
|
1135
|
+
}),
|
|
1136
|
+
f(D, {
|
|
1137
|
+
name: "kuaijin",
|
|
1138
|
+
size: "24",
|
|
1139
|
+
backgroundColor: "#ffffff",
|
|
1140
|
+
title: "快进",
|
|
1141
|
+
onClick: m[8] || (m[8] = () => {
|
|
1142
|
+
})
|
|
1143
|
+
}),
|
|
1144
|
+
f(D, {
|
|
1145
|
+
name: "zanting",
|
|
1146
|
+
size: "24",
|
|
1147
|
+
backgroundColor: "#ffffff",
|
|
1148
|
+
title: "暂停",
|
|
1149
|
+
onClick: m[9] || (m[9] = () => {
|
|
1150
|
+
})
|
|
1151
|
+
}),
|
|
1152
|
+
f(D, {
|
|
1153
|
+
name: "zhongzhi",
|
|
1154
|
+
size: "24",
|
|
1155
|
+
backgroundColor: "#ffffff",
|
|
1156
|
+
title: "停止",
|
|
1157
|
+
onClick: m[10] || (m[10] = () => {
|
|
1158
|
+
})
|
|
1159
|
+
})
|
|
1160
|
+
]),
|
|
1161
|
+
ne(p("div", sl, [
|
|
1162
|
+
p("div", il, [
|
|
1163
|
+
p("span", null, K($.value), 1),
|
|
1164
|
+
p("span", {
|
|
1165
|
+
class: "close",
|
|
1166
|
+
onClick: m[11] || (m[11] = (T) => c.value = !1)
|
|
1167
|
+
}, " X ")
|
|
1168
|
+
]),
|
|
1169
|
+
p("div", rl, [
|
|
1170
|
+
f(te, { height: "100%" }, {
|
|
1171
|
+
default: H(() => [
|
|
1172
|
+
$.value === "场景树" ? (E(), de(Qt, {
|
|
1173
|
+
key: 0,
|
|
1174
|
+
model: h.value
|
|
1175
|
+
}, null, 8, ["model"])) : se("", !0),
|
|
1176
|
+
$.value === "剖面视图" ? (E(), B("div", ul, [
|
|
1177
|
+
p("div", cl, [
|
|
1178
|
+
p("label", dl, [
|
|
1179
|
+
ne(p("input", {
|
|
1180
|
+
type: "radio",
|
|
1181
|
+
name: "clipping-axis",
|
|
1182
|
+
value: "none",
|
|
1183
|
+
"onUpdate:modelValue": m[12] || (m[12] = (T) => ve(S) ? S.value = T : null),
|
|
1184
|
+
onChange: m[13] || (m[13] = //@ts-ignore
|
|
1185
|
+
(...T) => J(Z) && J(Z)(...T))
|
|
1186
|
+
}, null, 544), [
|
|
1187
|
+
[ge, J(S)]
|
|
1188
|
+
]),
|
|
1189
|
+
m[21] || (m[21] = p("span", { class: "radio-text" }, "无切割", -1))
|
|
1190
|
+
]),
|
|
1191
|
+
p("label", ml, [
|
|
1192
|
+
ne(p("input", {
|
|
1193
|
+
type: "radio",
|
|
1194
|
+
name: "clipping-axis",
|
|
1195
|
+
value: "x",
|
|
1196
|
+
"onUpdate:modelValue": m[14] || (m[14] = (T) => ve(S) ? S.value = T : null),
|
|
1197
|
+
onChange: m[15] || (m[15] = //@ts-ignore
|
|
1198
|
+
(...T) => J(Z) && J(Z)(...T))
|
|
1199
|
+
}, null, 544), [
|
|
1200
|
+
[ge, J(S)]
|
|
1201
|
+
]),
|
|
1202
|
+
m[22] || (m[22] = p("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1203
|
+
]),
|
|
1204
|
+
p("label", pl, [
|
|
1205
|
+
ne(p("input", {
|
|
1206
|
+
type: "radio",
|
|
1207
|
+
name: "clipping-axis",
|
|
1208
|
+
value: "y",
|
|
1209
|
+
"onUpdate:modelValue": m[16] || (m[16] = (T) => ve(S) ? S.value = T : null),
|
|
1210
|
+
onChange: m[17] || (m[17] = //@ts-ignore
|
|
1211
|
+
(...T) => J(Z) && J(Z)(...T))
|
|
1212
|
+
}, null, 544), [
|
|
1213
|
+
[ge, J(S)]
|
|
1214
|
+
]),
|
|
1215
|
+
m[23] || (m[23] = p("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1216
|
+
]),
|
|
1217
|
+
p("label", fl, [
|
|
1218
|
+
ne(p("input", {
|
|
1219
|
+
type: "radio",
|
|
1220
|
+
name: "clipping-axis",
|
|
1221
|
+
value: "z",
|
|
1222
|
+
"onUpdate:modelValue": m[18] || (m[18] = (T) => ve(S) ? S.value = T : null),
|
|
1223
|
+
onChange: m[19] || (m[19] = //@ts-ignore
|
|
1224
|
+
(...T) => J(Z) && J(Z)(...T))
|
|
1225
|
+
}, null, 544), [
|
|
1226
|
+
[ge, J(S)]
|
|
1227
|
+
]),
|
|
1228
|
+
m[24] || (m[24] = p("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1229
|
+
])
|
|
1230
|
+
])
|
|
1231
|
+
])) : se("", !0)
|
|
1232
|
+
]),
|
|
1233
|
+
_: 1
|
|
1234
|
+
})
|
|
1235
|
+
])
|
|
1236
|
+
], 512), [
|
|
1237
|
+
[he, c.value]
|
|
1238
|
+
]),
|
|
1239
|
+
ne(p("div", vl, [
|
|
1240
|
+
p("div", gl, [
|
|
1241
|
+
p("span", null, K(d.value), 1),
|
|
1242
|
+
p("span", {
|
|
1243
|
+
class: "close",
|
|
1244
|
+
onClick: m[20] || (m[20] = (T) => w.value = !1)
|
|
1245
|
+
}, " X ")
|
|
1246
|
+
]),
|
|
1247
|
+
p("div", hl, [
|
|
1248
|
+
f(te, { height: "100%" }, {
|
|
1249
|
+
default: H(() => [
|
|
1250
|
+
ne(f(Nt, { model: h.value }, null, 8, ["model"]), [
|
|
1251
|
+
[he, d.value === "关节控制"]
|
|
1252
|
+
]),
|
|
1253
|
+
ne(f(Lt, {
|
|
1254
|
+
model: h.value,
|
|
1255
|
+
onGetThreeData: Ce,
|
|
1256
|
+
threeData: r.threeData
|
|
1257
|
+
}, null, 8, ["model", "threeData"]), [
|
|
1258
|
+
[he, d.value === "动画仿真"]
|
|
1259
|
+
])
|
|
1260
|
+
]),
|
|
1261
|
+
_: 1
|
|
1262
|
+
})
|
|
1263
|
+
])
|
|
1264
|
+
], 512), [
|
|
1265
|
+
[he, w.value]
|
|
1266
|
+
]),
|
|
1267
|
+
v.value ? (E(), B("div", yl, [
|
|
1268
|
+
m[25] || (m[25] = p("div", { class: "loading-spinner" }, null, -1)),
|
|
1269
|
+
p("p", null, K(b.value), 1)
|
|
1270
|
+
])) : se("", !0)
|
|
1271
|
+
]);
|
|
1272
|
+
};
|
|
1273
|
+
}
|
|
1274
|
+
}), Rl = /* @__PURE__ */ _e(bl, [["__scopeId", "data-v-2598a604"]]);
|
|
1275
|
+
export {
|
|
1276
|
+
Rl as default
|
|
1277
|
+
};
|