ss-component-new 1.3.39 → 1.3.40
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-2i72y41c.js → MTLLoader-CBRDqlja.js} +24 -24
- package/dist/{MTLLoader-DXzoNrir.cjs → MTLLoader-YtHulNzU.cjs} +1 -1
- package/dist/{OrbitControls-25f9O6FX.cjs → OrbitControls-Bwzpfq8_.cjs} +1 -1
- package/dist/{OrbitControls-DLMbmcAk.js → OrbitControls-CKR1ruPg.js} +1 -1
- package/dist/{URDFLoader-C9bE_XzP.js → URDFLoader-D-0fnLWu.js} +189 -189
- package/dist/{URDFLoader-Cr4cwEF8.cjs → URDFLoader-DIvTWPgk.cjs} +1 -1
- package/dist/{animationData-0idWk1St.js → animationData-BBVNOO1d.js} +19 -19
- package/dist/{animationData-Bq1xWpzh.cjs → animationData-krmt7b15.cjs} +1 -1
- package/dist/{array-D7ZpHOUW.js → array-B7hKAHMR.js} +46 -46
- package/dist/{array-BcZ8wZJh.cjs → array-BMhRsnRu.cjs} +1 -1
- package/dist/{iconfont-D_lKvP4A.js → iconfont-CSj9Ypb0.js} +29 -29
- package/dist/{iconfont-C8smb8wH.cjs → iconfont-CUPzGSlt.cjs} +1 -1
- package/dist/index-BDzsGCjm.cjs +11 -0
- package/dist/{index-CuwDFx38.cjs → index-BFKUrR1o.cjs} +1 -1
- package/dist/{index-Dl-Z36zZ.cjs → index-BG3-boe7.cjs} +1 -1
- package/dist/index-BJ8XP3Y-.cjs +1 -0
- package/dist/{index-BJPBBWWH.cjs → index-BLxE_tkf.cjs} +1 -1
- package/dist/{index-Ddoq7kRQ.js → index-BT6DSXQW.js} +9 -9
- package/dist/{index-BFqQiTF3.cjs → index-BUsoO5VT.cjs} +1 -1
- package/dist/{index-U0xNmCVP.cjs → index-BVgS3Nd5.cjs} +1 -1
- package/dist/{index-BJ4dYIP9.js → index-Bcrscjdm.js} +2 -2
- package/dist/{index-2cLYbH8L.js → index-BgUChdje.js} +8 -8
- package/dist/index-BteE57Nz.js +103 -0
- package/dist/{index-mMYvuatu.js → index-C75tqiG_.js} +41 -41
- package/dist/{index-C09fhtZ7.js → index-C7WQ1ky5.js} +2 -2
- package/dist/index-C8FzkPpO.cjs +1 -0
- package/dist/{index-DRTxe12U.cjs → index-C8fMwErX.cjs} +13 -13
- package/dist/{index-BeF439qb.js → index-CCsW4SQb.js} +7 -7
- package/dist/{index-nr6V1FzX.js → index-CEq2QX9L.js} +7 -7
- package/dist/{index-CXiOVgoz.js → index-CEzEaG0d.js} +1 -1
- package/dist/{index-BjVhxFhd.js → index-CGm9oYu2.js} +5 -5
- package/dist/{index-Cjqg29ul.cjs → index-CIrXKpNl.cjs} +1 -1
- package/dist/{index-CXF4fGBx.cjs → index-CQozkDNK.cjs} +1 -1
- package/dist/{index-C-_cejgk.js → index-CTE81JBY.js} +3 -3
- package/dist/{index-BSzis22W.cjs → index-CliK2V0E.cjs} +1 -1
- package/dist/{index-CYttSa5h.js → index-CppJQDiT.js} +3 -3
- package/dist/{index-DM30Ja8n.cjs → index-Cul6hC7f.cjs} +1 -1
- package/dist/{index-CMro3YG1.cjs → index-CuvQZsbE.cjs} +1 -1
- package/dist/{index-DU9e5EhS.cjs → index-Cw4Pm2PQ.cjs} +1 -1
- package/dist/{index-BmPlus3L.cjs → index-CwMhzp9R.cjs} +1 -1
- package/dist/{index-DdKUuRez.js → index-D39AtL48.js} +1 -1
- package/dist/{index-DQeVX7pl.js → index-D9lVn2ja.js} +5 -5
- package/dist/{index-CyiMl_77.js → index-DABBYx7H.js} +1 -1
- package/dist/{index-CvwIVk4C.js → index-DDQZOo-o.js} +3 -3
- package/dist/{index-Bmjp4oN2.cjs → index-DDsoPHBA.cjs} +1 -1
- package/dist/{index-CZZ8Ifs9.js → index-DFjh1qWr.js} +2 -2
- package/dist/{index-Va8AOLWi.js → index-DGRL8SEt.js} +1 -1
- package/dist/index-DGeMVYJU.js +12544 -0
- package/dist/{index-HWbROorb.js → index-DLyb9Q5L.js} +2 -2
- package/dist/{index-BFkiAoiG.cjs → index-DN2waPoj.cjs} +1 -1
- package/dist/{index-Dhu1H8ka.js → index-DWfxnemZ.js} +2 -2
- package/dist/{index-BAu0NK04.cjs → index-DdNJrN4I.cjs} +1 -1
- package/dist/{index-BC4zbL4W.cjs → index-Dm-5UkTK.cjs} +1 -1
- package/dist/{index-DkCH5VtE.js → index-Dq8v_eJA.js} +6 -6
- package/dist/{index-OaeHF7Y4.cjs → index-Du0eSoIx.cjs} +1 -1
- package/dist/{index-C0hS-bj5.js → index-DxVKhVHR.js} +7 -7
- package/dist/{index-BeqcmxG1.js → index-OYiyhWAy.js} +7 -7
- package/dist/{index-DPmCVTf0.cjs → index-OZTa9Fl3.cjs} +1 -1
- package/dist/{index-CqvnJnTM.cjs → index-d6tZBTSp.cjs} +1 -1
- package/dist/{index-CEcgrss3.cjs → index-euZWOilV.cjs} +1 -1
- package/dist/{index-SG3iZ1zi.cjs → index-lDcFCgsk.cjs} +1 -1
- package/dist/{index-CldRoanF.js → index-rZKPYWM6.js} +2 -2
- package/dist/{index-COQpDVsv.js → index-sMsCzNtW.js} +1535 -1570
- package/dist/{index-BWCv7zxy.cjs → index-vCTVD7cV.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BvJutNeG.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.cjs} +382 -392
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Cghhtxxz.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js} +28120 -28781
- package/dist/{index.vue_vue_type_style_index_1_lang-BIBuo_6N.cjs → index.vue_vue_type_style_index_1_lang-DDedRKQj.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-M5fbenhC.js → index.vue_vue_type_style_index_1_lang-q8rMzh6x.js} +75 -75
- package/dist/{main-CZBz_zjr.js → main-CbBG4x5W.js} +4 -4
- package/dist/{main-pPT0wg-M.cjs → main-D7LZI3yR.cjs} +1 -1
- package/dist/{menuIndex-D52EAwtb.cjs → menuIndex-8RF_0N_y.cjs} +1 -1
- package/dist/{menuIndex-DYaogp2R.js → menuIndex-BwWrdu20.js} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +10 -10
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +11 -11
- package/dist/{threeModel-BObCDF1v.js → threeModel-CiTIBkkk.js} +45 -45
- package/dist/{threeModel-hIc2ofR5.cjs → threeModel-Dd-cfGXr.cjs} +1 -1
- package/dist/{threePreview-Dm8s6ZzZ.cjs → threePreview-CBFQtSls.cjs} +1 -1
- package/dist/{threePreview-STh6e4ji.js → threePreview-XQG7sQy9.js} +125 -125
- package/dist/{threeSceneView-BrPJwJe5.js → threeSceneView-CdZFIImJ.js} +38 -38
- package/dist/{threeSceneView-DsimUKrC.cjs → threeSceneView-D97Sc8hd.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-C5cYg_nz.cjs → threeSceneViewForCPMPIP-4Cjv1ZS4.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-BjnGQodx.js → threeSceneViewForCPMPIP-DH__ogKh.js} +8 -8
- package/dist/{threeTrackPathView-BQYAP4DB.js → threeTrackPathView-BFQXaw-a.js} +78 -78
- package/dist/{threeTrackPathView-CJsgvwfM.cjs → threeTrackPathView-s17KavQX.cjs} +1 -1
- package/dist/{threeViewerHost-Sk5pSWMo.js → threeViewerHost-BgPjA_94.js} +11 -11
- package/dist/{threeViewerHost-B9_P3rIV.cjs → threeViewerHost-C39tiQj-.cjs} +1 -1
- package/dist/{urdfTree-B1eVnyil.js → urdfTree-DM6uTeXj.js} +10 -10
- package/dist/{urdfTree-DoHqwX6e.cjs → urdfTree-HdeBG5se.cjs} +1 -1
- package/dist/{workpieceTreePanel-DKNEmjW7.cjs → workpieceTreePanel-BKOHDm85.cjs} +1 -1
- package/dist/{workpieceTreePanel-CZA2q-tk.js → workpieceTreePanel-C5qUdbmi.js} +63 -63
- package/package.json +1 -1
- package/dist/index-Ccqg6q19.cjs +0 -1
- package/dist/index-CpbBe_mV.cjs +0 -1
- package/dist/index-DIWralYr.js +0 -67
- package/dist/index-De99NYNm.cjs +0 -1
- package/dist/index-O6tv0Wzx.js +0 -11883
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as ce, computed as
|
|
2
|
-
import { u as
|
|
3
|
-
import {
|
|
4
|
-
import "./index-
|
|
5
|
-
import { U as et, J as tt } from "./urdfTree-
|
|
6
|
-
import { E as
|
|
1
|
+
import { defineComponent as ce, computed as U, ref as k, resolveComponent as E, createElementBlock as ee, openBlock as X, createElementVNode as d, createVNode as p, withCtx as I, toDisplayString as Y, shallowRef as B, watch as Ee, onMounted as Xe, onBeforeUnmount as Ye, withDirectives as D, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as N, nextTick as je } from "vue";
|
|
2
|
+
import { u as Be, a as De, b as Ne, C as Ze, f as Ie, d as re } from "./iconfont-CSj9Ypb0.js";
|
|
3
|
+
import { L as O, Y as Oe, bB as Ge, ax as qe, V as te, az as ue, aM as fe, aS as Ke, aB as We, aR as Je, aO as Re, aP as He, a6 as Qe, bC as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js";
|
|
4
|
+
import "./index-sMsCzNtW.js";
|
|
5
|
+
import { U as et, J as tt } from "./urdfTree-DM6uTeXj.js";
|
|
6
|
+
import { E as Z } from "./index-B8HqIYd5.js";
|
|
7
7
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
import { T as w } from "./svgIcon-4u4PW7Is.js";
|
|
9
9
|
import { i as nt } from "./isString-FfOeP713.js";
|
|
@@ -52,7 +52,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
52
52
|
},
|
|
53
53
|
emits: ["getThreeData"],
|
|
54
54
|
setup(e, { expose: n, emit: o }) {
|
|
55
|
-
const a = e, l =
|
|
55
|
+
const a = e, l = U(() => a.vectors), t = k(!1), s = k(0), r = k(100);
|
|
56
56
|
let f = !1;
|
|
57
57
|
const c = (g) => `第 ${g + 1} 帧`, m = (g) => {
|
|
58
58
|
if (g < 0 || g >= l.value.length) {
|
|
@@ -63,7 +63,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
63
63
|
s.value = g, de(a.knife, y, a.cloud);
|
|
64
64
|
}, v = async () => {
|
|
65
65
|
if (l.value.length === 0) {
|
|
66
|
-
|
|
66
|
+
Z.error("无法播放动画:无数据");
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
69
|
if (!t.value) {
|
|
@@ -71,7 +71,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
71
71
|
try {
|
|
72
72
|
for (let g = s.value + 1; g < l.value.length && !f; g++)
|
|
73
73
|
await new Promise((y) => setTimeout(y, r.value)), m(g);
|
|
74
|
-
f ||
|
|
74
|
+
f || Z.success("动画播放完成");
|
|
75
75
|
} catch (g) {
|
|
76
76
|
console.error("动画播放出错:", g);
|
|
77
77
|
} finally {
|
|
@@ -79,7 +79,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}, C = () => {
|
|
82
|
-
f = !0, t.value = !1,
|
|
82
|
+
f = !0, t.value = !1, Z.info("动画已停止");
|
|
83
83
|
}, P = (g) => {
|
|
84
84
|
t.value && C(), m(g);
|
|
85
85
|
}, _ = () => {
|
|
@@ -92,23 +92,23 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
92
92
|
return n({ playAnimation: v, stopAnimation: C, forwardFrame: _, backwardFrame: T, resetAnimationFrame: h, reset: async () => {
|
|
93
93
|
await C(), h();
|
|
94
94
|
} }), (g, y) => {
|
|
95
|
-
const q =
|
|
96
|
-
return
|
|
95
|
+
const q = E("el-input-number"), K = E("el-form-item"), W = E("el-form"), J = E("el-slider");
|
|
96
|
+
return X(), ee("div", it, [
|
|
97
97
|
d("div", lt, [
|
|
98
98
|
d("div", rt, [
|
|
99
99
|
p(W, {
|
|
100
100
|
"label-width": "auto",
|
|
101
101
|
style: { width: "100%" }
|
|
102
102
|
}, {
|
|
103
|
-
default:
|
|
103
|
+
default: I(() => [
|
|
104
104
|
p(K, {
|
|
105
105
|
label: "帧间隔 (ms):",
|
|
106
106
|
prop: "frameDuration"
|
|
107
107
|
}, {
|
|
108
|
-
default:
|
|
108
|
+
default: I(() => [
|
|
109
109
|
p(q, {
|
|
110
110
|
modelValue: r.value,
|
|
111
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
111
|
+
"onUpdate:modelValue": y[0] || (y[0] = (M) => r.value = M),
|
|
112
112
|
min: 0,
|
|
113
113
|
max: 5e3,
|
|
114
114
|
step: 10,
|
|
@@ -127,9 +127,9 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
127
127
|
]),
|
|
128
128
|
d("div", ft, [
|
|
129
129
|
y[3] || (y[3] = d("label", null, "动画进度:", -1)),
|
|
130
|
-
p(
|
|
130
|
+
p(J, {
|
|
131
131
|
modelValue: s.value,
|
|
132
|
-
"onUpdate:modelValue": y[1] || (y[1] = (
|
|
132
|
+
"onUpdate:modelValue": y[1] || (y[1] = (M) => s.value = M),
|
|
133
133
|
min: 0,
|
|
134
134
|
max: l.value.length > 0 ? l.value.length - 1 : 0,
|
|
135
135
|
step: 1,
|
|
@@ -263,16 +263,16 @@ async function Ft(e) {
|
|
|
263
263
|
o.push(+t, +s, +r);
|
|
264
264
|
}), o;
|
|
265
265
|
}
|
|
266
|
-
async function
|
|
266
|
+
async function Mt(e) {
|
|
267
267
|
let n = e.trim().split(/\r?\n/);
|
|
268
268
|
return n = n.filter((a) => {
|
|
269
269
|
const l = a.startsWith("X") || a.startsWith("Y") || a.startsWith("Z"), t = a.startsWith("G") && (a.includes("X") || a.includes("Y") || a.includes("Z")), s = a.startsWith("N") && (a.includes("X") || a.includes("Y") || a.includes("Z"));
|
|
270
270
|
return l || t || s;
|
|
271
271
|
}), zt(n);
|
|
272
272
|
}
|
|
273
|
-
async function
|
|
273
|
+
async function Ut(e, n) {
|
|
274
274
|
const { isCyd: o, isUv: a, isCpt: l, isNc: t } = n;
|
|
275
|
-
return a ? Pt(e) : o ? Ft(e) : l ? xt(e) : t ?
|
|
275
|
+
return a ? Pt(e) : o ? Ft(e) : l ? xt(e) : t ? Mt(e) : [];
|
|
276
276
|
}
|
|
277
277
|
function Lt(e) {
|
|
278
278
|
const n = [];
|
|
@@ -298,7 +298,7 @@ function $t(e, n) {
|
|
|
298
298
|
const s = Vt(n);
|
|
299
299
|
return s.name = "轨迹路径", o.add(s), s;
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Et(e, n, o, a = 4, l = 50) {
|
|
302
302
|
let t = 1 / 0, s = -1 / 0, r = 1 / 0, f = -1 / 0, c = 1 / 0, m = -1 / 0;
|
|
303
303
|
for (let h = 0; h < e.length; h += 3) {
|
|
304
304
|
const L = e[h], g = e[h + 1], y = e[h + 2];
|
|
@@ -307,7 +307,7 @@ function Xt(e, n, o, a = 4, l = 50) {
|
|
|
307
307
|
const C = Math.sqrt((s - t) ** 2 + (f - r) ** 2 + (m - c) ** 2) * 0.05, P = Qe.degToRad(n.fov), _ = 2 * Math.tan(P / 2) * l, T = C / _ * o.domElement.height * (a / 4);
|
|
308
308
|
return Math.min(0.4, T);
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function Xt(e) {
|
|
311
311
|
if (e.length % 3 !== 0)
|
|
312
312
|
return console.error("points array length is not a multiple of 3:", e), null;
|
|
313
313
|
const n = new ue();
|
|
@@ -315,13 +315,13 @@ function Et(e) {
|
|
|
315
315
|
const o = new Float32Array(e.length);
|
|
316
316
|
for (let t = 0; t < e.length; t += 3)
|
|
317
317
|
o[t] = 0, o[t + 1] = 0.847, o[t + 2] = 1;
|
|
318
|
-
n.setAttribute("color", new
|
|
319
|
-
const a = new
|
|
318
|
+
n.setAttribute("color", new Je(o, 3));
|
|
319
|
+
const a = new Re({
|
|
320
320
|
vertexColors: !0,
|
|
321
321
|
size: 0.4,
|
|
322
322
|
// 像素世界单位
|
|
323
323
|
sizeAttenuation: !0
|
|
324
|
-
}), l = new
|
|
324
|
+
}), l = new He(n, a);
|
|
325
325
|
return a.needsUpdate = !0, l;
|
|
326
326
|
}
|
|
327
327
|
function Yt(e, n) {
|
|
@@ -330,17 +330,17 @@ function Yt(e, n) {
|
|
|
330
330
|
const { scene: o, camera: a, renderer: l, controls: t } = e();
|
|
331
331
|
if (!o || !a || !l || !t)
|
|
332
332
|
return;
|
|
333
|
-
const s =
|
|
333
|
+
const s = Xt(n);
|
|
334
334
|
if (!s)
|
|
335
335
|
return;
|
|
336
336
|
s.name = "轨迹路径", o.add(s);
|
|
337
|
-
const r =
|
|
337
|
+
const r = Et(n, a, l, 0.1, 50);
|
|
338
338
|
return s.material.size = r, s;
|
|
339
339
|
}
|
|
340
|
-
const jt = { class: "obj-viewer-container" },
|
|
340
|
+
const jt = { class: "obj-viewer-container" }, Bt = { class: "buttonGroup-topLeft" }, Dt = { class: "buttonGroup-left" }, Nt = { class: "buttonGroup-right" }, Zt = { class: "buttonGroup-bottom" }, It = { class: "left-panel" }, Ot = { class: "panel-header" }, Gt = { class: "panel-body" }, qt = { class: "right-panel" }, Kt = { class: "panel-header" }, Wt = { class: "panel-body" }, Jt = {
|
|
341
341
|
key: 0,
|
|
342
342
|
class: "loading-overlay"
|
|
343
|
-
},
|
|
343
|
+
}, Rt = /* @__PURE__ */ ce({
|
|
344
344
|
__name: "threeTrackPathView",
|
|
345
345
|
props: {
|
|
346
346
|
fileBlobs: {},
|
|
@@ -348,7 +348,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
348
348
|
trackFileType: {}
|
|
349
349
|
},
|
|
350
350
|
setup(e) {
|
|
351
|
-
const n = e, o = k(null), a = k(!1), l = k(""), t = k(), s = k(!1), r = k(""), f = k(!1), c = k(""), m =
|
|
351
|
+
const n = e, o = k(null), a = k(!1), l = k(""), t = k(), s = k(!1), r = k(""), f = k(!1), c = k(""), m = B(null), v = B(null), {
|
|
352
352
|
currentModels: C,
|
|
353
353
|
resetView: P,
|
|
354
354
|
initThreeJS: _,
|
|
@@ -360,32 +360,32 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
360
360
|
axesHelperVisible: q,
|
|
361
361
|
toggleAxesVisibility: K,
|
|
362
362
|
zoomIn: W,
|
|
363
|
-
zoomOut:
|
|
364
|
-
} =
|
|
363
|
+
zoomOut: J
|
|
364
|
+
} = Be(o), { isAnimating: M, toggleAnimation: me, startAnimation: Ht, stopAnimation: pe } = De(h, C), { isClipping: he, activeClippingAxis: ne, toggleClipping: ge, updateClippingPlanes: ye } = Ne(h, C), Ce = () => {
|
|
365
365
|
K();
|
|
366
366
|
}, we = (i) => {
|
|
367
367
|
ne.value = i, ye();
|
|
368
|
-
}, J = (i) => {
|
|
369
|
-
s.value = !0, r.value = i, i === "剖面视图" && !he.value && ge();
|
|
370
368
|
}, R = (i) => {
|
|
369
|
+
s.value = !0, r.value = i, i === "剖面视图" && !he.value && ge();
|
|
370
|
+
}, H = (i) => {
|
|
371
371
|
f.value = !0, c.value = i;
|
|
372
|
-
}, Q = k([]), V = k([]), ke =
|
|
372
|
+
}, Q = k([]), V = k([]), ke = U(() => {
|
|
373
373
|
var u;
|
|
374
374
|
return (u = n.trackFileType) == null ? void 0 : u.isUv;
|
|
375
|
-
}), be =
|
|
375
|
+
}), be = U(() => {
|
|
376
376
|
var u;
|
|
377
377
|
return (u = n.trackFileType) == null ? void 0 : u.isCyd;
|
|
378
|
-
}), _e =
|
|
378
|
+
}), _e = U(() => {
|
|
379
379
|
var u;
|
|
380
380
|
return (u = n.trackFileType) == null ? void 0 : u.isCpt;
|
|
381
|
-
}), x =
|
|
381
|
+
}), x = U(() => {
|
|
382
382
|
var u;
|
|
383
383
|
return (u = n.trackFileType) == null ? void 0 : u.isNc;
|
|
384
|
-
}), oe =
|
|
384
|
+
}), oe = U(() => {
|
|
385
385
|
const i = n.fileBlobs || [];
|
|
386
386
|
return i == null ? void 0 : i[0];
|
|
387
387
|
});
|
|
388
|
-
let b =
|
|
388
|
+
let b = B(), F = B();
|
|
389
389
|
const Te = () => {
|
|
390
390
|
const { scene: i } = h();
|
|
391
391
|
b.value && i && (re(b.value, i), b.value = null);
|
|
@@ -397,7 +397,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
397
397
|
}, Ae = async (i) => {
|
|
398
398
|
const u = URL.createObjectURL(i), $ = await Se(u);
|
|
399
399
|
if (URL.revokeObjectURL(u), nt($)) {
|
|
400
|
-
Q.value = await
|
|
400
|
+
Q.value = await Ut($, n.trackFileType) || [];
|
|
401
401
|
const z = Q.value;
|
|
402
402
|
ke.value && (b.value = $t(h, z)), (be.value || _e.value || x.value) && (b.value = Yt(h, z));
|
|
403
403
|
}
|
|
@@ -405,9 +405,9 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
405
405
|
var i, u;
|
|
406
406
|
F.value = ot(), V.value = Lt(Q.value), V.value && V.value.length && (de(F.value, V.value[0], b.value, new O(16711680)), (u = (i = v.value) == null ? void 0 : i.add) == null || u.call(i, F.value));
|
|
407
407
|
}, ae = async (i) => {
|
|
408
|
-
se(), await Ae(i), b.value &&
|
|
408
|
+
se(), await Ae(i), b.value && Ie(h, b.value), x.value && Pe();
|
|
409
409
|
};
|
|
410
|
-
|
|
410
|
+
Ee(() => oe.value, async (i) => {
|
|
411
411
|
i && await ae(i);
|
|
412
412
|
}, {
|
|
413
413
|
immediate: !0,
|
|
@@ -419,10 +419,10 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
419
419
|
}, Fe = () => {
|
|
420
420
|
var i;
|
|
421
421
|
x.value && ((i = t == null ? void 0 : t.value) == null || i.playAnimation());
|
|
422
|
-
},
|
|
422
|
+
}, Me = () => {
|
|
423
423
|
var i;
|
|
424
424
|
x.value && ((i = t == null ? void 0 : t.value) == null || i.stopAnimation());
|
|
425
|
-
},
|
|
425
|
+
}, Ue = () => {
|
|
426
426
|
var i;
|
|
427
427
|
x.value && ((i = t == null ? void 0 : t.value) == null || i.forwardFrame());
|
|
428
428
|
}, Le = () => {
|
|
@@ -435,26 +435,26 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
435
435
|
const i = h();
|
|
436
436
|
v.value = i.scene, v.value && (v.value.name = "CPMPIP");
|
|
437
437
|
}, $e = () => {
|
|
438
|
-
j && j.disconnect(),
|
|
438
|
+
j && j.disconnect(), M.value && pe(), se(), L();
|
|
439
439
|
};
|
|
440
440
|
let j = null;
|
|
441
|
-
return
|
|
441
|
+
return Xe(async () => {
|
|
442
442
|
try {
|
|
443
443
|
Ve();
|
|
444
444
|
} catch (i) {
|
|
445
|
-
console.error("Three.js 初始化失败:", i),
|
|
445
|
+
console.error("Three.js 初始化失败:", i), Z.error("渲染引擎初始化失败!");
|
|
446
446
|
}
|
|
447
447
|
}), Ye(() => {
|
|
448
448
|
$e();
|
|
449
449
|
}), (i, u) => {
|
|
450
|
-
const $ =
|
|
451
|
-
return
|
|
450
|
+
const $ = E("el-scrollbar");
|
|
451
|
+
return X(), ee("div", jt, [
|
|
452
452
|
d("div", {
|
|
453
453
|
ref_key: "threejsContainer",
|
|
454
454
|
ref: o,
|
|
455
455
|
class: "threejs-container"
|
|
456
456
|
}, null, 512),
|
|
457
|
-
d("div",
|
|
457
|
+
d("div", Bt, [
|
|
458
458
|
p(w, {
|
|
459
459
|
name: "viewReset",
|
|
460
460
|
size: "24",
|
|
@@ -471,13 +471,13 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
471
471
|
name: "suoxiao",
|
|
472
472
|
size: "24",
|
|
473
473
|
title: "缩小",
|
|
474
|
-
onClick: A(
|
|
474
|
+
onClick: A(J)
|
|
475
475
|
}, null, 8, ["onClick"]),
|
|
476
476
|
p(w, {
|
|
477
477
|
name: "lookAround",
|
|
478
478
|
size: "24",
|
|
479
479
|
onClick: A(me),
|
|
480
|
-
title: A(
|
|
480
|
+
title: A(M) ? "停止动画" : "动画视图"
|
|
481
481
|
}, null, 8, ["onClick", "title"]),
|
|
482
482
|
p(w, {
|
|
483
483
|
name: "zuobiaoxi",
|
|
@@ -487,29 +487,29 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
487
487
|
title: "显隐坐标轴"
|
|
488
488
|
}, null, 8, ["active"])
|
|
489
489
|
]),
|
|
490
|
-
d("div",
|
|
491
|
-
ie(i.$slots, "button-left", { switchRightPanel:
|
|
490
|
+
d("div", Dt, [
|
|
491
|
+
ie(i.$slots, "button-left", { switchRightPanel: R }, void 0, !0),
|
|
492
492
|
p(w, {
|
|
493
493
|
name: "jiegoushu",
|
|
494
494
|
size: "24",
|
|
495
|
-
onClick: u[0] || (u[0] = (z) =>
|
|
495
|
+
onClick: u[0] || (u[0] = (z) => R("场景树")),
|
|
496
496
|
active: s.value && r.value === "场景树",
|
|
497
497
|
title: "场景树"
|
|
498
498
|
}, null, 8, ["active"]),
|
|
499
499
|
p(w, {
|
|
500
500
|
name: "clipping",
|
|
501
501
|
size: "24",
|
|
502
|
-
onClick: u[1] || (u[1] = (z) =>
|
|
502
|
+
onClick: u[1] || (u[1] = (z) => R("剖面视图")),
|
|
503
503
|
active: s.value && r.value === "剖面视图",
|
|
504
504
|
title: "剖面视图"
|
|
505
505
|
}, null, 8, ["active"])
|
|
506
506
|
]),
|
|
507
|
-
d("div",
|
|
508
|
-
ie(i.$slots, "button-right", { switchRightPanel:
|
|
507
|
+
d("div", Nt, [
|
|
508
|
+
ie(i.$slots, "button-right", { switchRightPanel: H }, void 0, !0),
|
|
509
509
|
p(w, {
|
|
510
510
|
name: "guanjiekongzhi",
|
|
511
511
|
size: "24",
|
|
512
|
-
onClick: u[2] || (u[2] = (z) =>
|
|
512
|
+
onClick: u[2] || (u[2] = (z) => H("关节控制")),
|
|
513
513
|
active: f.value && c.value === "关节控制",
|
|
514
514
|
title: "关节控制"
|
|
515
515
|
}, null, 8, ["active"]),
|
|
@@ -517,11 +517,11 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
517
517
|
name: "donghuafangzhen",
|
|
518
518
|
size: "24",
|
|
519
519
|
title: "动画仿真",
|
|
520
|
-
onClick: u[3] || (u[3] = (z) =>
|
|
520
|
+
onClick: u[3] || (u[3] = (z) => H("动画仿真")),
|
|
521
521
|
active: f.value && c.value === "动画仿真"
|
|
522
522
|
}, null, 8, ["active"])
|
|
523
523
|
]),
|
|
524
|
-
d("div",
|
|
524
|
+
d("div", Zt, [
|
|
525
525
|
p(w, {
|
|
526
526
|
name: "kuaitui",
|
|
527
527
|
size: "24",
|
|
@@ -541,17 +541,17 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
541
541
|
size: "24",
|
|
542
542
|
backgroundColor: "#ffffff",
|
|
543
543
|
title: "快进",
|
|
544
|
-
onClick:
|
|
544
|
+
onClick: Ue
|
|
545
545
|
}),
|
|
546
546
|
p(w, {
|
|
547
547
|
name: "zanting",
|
|
548
548
|
size: "24",
|
|
549
549
|
backgroundColor: "#ffffff",
|
|
550
550
|
title: "暂停",
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: Me
|
|
552
552
|
})
|
|
553
553
|
]),
|
|
554
|
-
|
|
554
|
+
D(d("div", It, [
|
|
555
555
|
d("div", Ot, [
|
|
556
556
|
d("span", null, Y(r.value), 1),
|
|
557
557
|
d("span", {
|
|
@@ -561,12 +561,12 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
561
561
|
]),
|
|
562
562
|
d("div", Gt, [
|
|
563
563
|
p($, { height: "100%" }, {
|
|
564
|
-
default:
|
|
565
|
-
r.value === "场景树" ? (
|
|
564
|
+
default: I(() => [
|
|
565
|
+
r.value === "场景树" ? (X(), le(et, {
|
|
566
566
|
key: 0,
|
|
567
567
|
model: m.value
|
|
568
568
|
}, null, 8, ["model"])) : S("", !0),
|
|
569
|
-
r.value === "剖面视图" ? (
|
|
569
|
+
r.value === "剖面视图" ? (X(), le(Ze, {
|
|
570
570
|
key: 1,
|
|
571
571
|
value: A(ne),
|
|
572
572
|
onChange: we
|
|
@@ -576,9 +576,9 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
576
576
|
})
|
|
577
577
|
])
|
|
578
578
|
], 512), [
|
|
579
|
-
[
|
|
579
|
+
[N, s.value]
|
|
580
580
|
]),
|
|
581
|
-
|
|
581
|
+
D(d("div", qt, [
|
|
582
582
|
d("div", Kt, [
|
|
583
583
|
d("span", null, Y(c.value), 1),
|
|
584
584
|
d("span", {
|
|
@@ -588,34 +588,34 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
588
588
|
]),
|
|
589
589
|
d("div", Wt, [
|
|
590
590
|
p($, { height: "100%" }, {
|
|
591
|
-
default:
|
|
592
|
-
|
|
593
|
-
[
|
|
591
|
+
default: I(() => [
|
|
592
|
+
D(p(tt, { model: m.value }, null, 8, ["model"]), [
|
|
593
|
+
[N, c.value === "关节控制"]
|
|
594
594
|
]),
|
|
595
|
-
|
|
595
|
+
D(p(dt, {
|
|
596
596
|
ref_key: "animationPanelRef",
|
|
597
597
|
ref: t,
|
|
598
598
|
cloud: A(b),
|
|
599
599
|
knife: A(F),
|
|
600
600
|
vectors: V.value
|
|
601
601
|
}, null, 8, ["cloud", "knife", "vectors"]), [
|
|
602
|
-
[
|
|
602
|
+
[N, c.value === "动画仿真" && x.value]
|
|
603
603
|
])
|
|
604
604
|
]),
|
|
605
605
|
_: 1
|
|
606
606
|
})
|
|
607
607
|
])
|
|
608
608
|
], 512), [
|
|
609
|
-
[
|
|
609
|
+
[N, f.value]
|
|
610
610
|
]),
|
|
611
|
-
a.value ? (
|
|
611
|
+
a.value ? (X(), ee("div", Jt, [
|
|
612
612
|
u[6] || (u[6] = d("div", { class: "loading-spinner" }, null, -1)),
|
|
613
613
|
d("p", null, Y(l.value), 1)
|
|
614
614
|
])) : S("", !0)
|
|
615
615
|
]);
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
}), rn = /* @__PURE__ */ ve(
|
|
618
|
+
}), rn = /* @__PURE__ */ ve(Rt, [["__scopeId", "data-v-7178b621"]]);
|
|
619
619
|
export {
|
|
620
620
|
rn as default
|
|
621
621
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-C8smb8wH.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-BvJutNeG.cjs");require("./index-DRTxe12U.cjs");const K=require("./urdfTree-DoHqwX6e.cjs"),I=require("./index-C5pQXH0_.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-Cdf6R00a.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
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-CUPzGSlt.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.cjs");require("./index-C8fMwErX.cjs");const K=require("./urdfTree-HdeBG5se.cjs"),I=require("./index-C5pQXH0_.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-Cdf6R00a.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,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as U, defineAsyncComponent as b, computed as
|
|
2
|
-
import {
|
|
3
|
-
import { e as j,
|
|
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 { e as W, u as A, p as D, s as $ } from "./index-sMsCzNtW.js";
|
|
3
|
+
import { e as j, av as M, a9 as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-n7J00Lcz.js";
|
|
4
4
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const re = {
|
|
6
6
|
SINGLE: "单机",
|
|
@@ -112,20 +112,20 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
112
112
|
height: { default: "100%" }
|
|
113
113
|
},
|
|
114
114
|
setup(E) {
|
|
115
|
-
const O = b(() => import("./threeSceneView-
|
|
115
|
+
const O = b(() => import("./threeSceneView-CdZFIImJ.js")), y = b(() => import("./threePreview-XQG7sQy9.js")), i = b(() => import("./threeTrackPathView-BFQXaw-a.js")), p = b(() => import("./threeSceneViewForCPMPIP-DH__ogKh.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = Y(), c = I(() => {
|
|
116
116
|
var t;
|
|
117
117
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
118
118
|
const { url: e } = s;
|
|
119
119
|
return e;
|
|
120
120
|
});
|
|
121
|
-
}), h =
|
|
121
|
+
}), h = I(() => {
|
|
122
122
|
var e;
|
|
123
123
|
const t = (e = n == null ? void 0 : n.files) == null ? void 0 : e[0];
|
|
124
124
|
return (t == null ? void 0 : t.extension) || "";
|
|
125
|
-
}), S =
|
|
125
|
+
}), S = I(() => {
|
|
126
126
|
var t, s;
|
|
127
127
|
return (s = (t = n == null ? void 0 : n.threeData) == null ? void 0 : t.data) == null ? void 0 : s.trackFileType;
|
|
128
|
-
}), v =
|
|
128
|
+
}), v = I(() => {
|
|
129
129
|
if (n.componentType)
|
|
130
130
|
switch (n.componentType) {
|
|
131
131
|
case "robot":
|
|
@@ -164,7 +164,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
164
164
|
K("div", J, [
|
|
165
165
|
u(t.$slots, "top-menu", {}, void 0, !0)
|
|
166
166
|
]),
|
|
167
|
-
v.value === m(a).ROBOT_SCENE ? (T(),
|
|
167
|
+
v.value === m(a).ROBOT_SCENE ? (T(), B(m(O), {
|
|
168
168
|
key: 0,
|
|
169
169
|
fileBlobs: l.value,
|
|
170
170
|
threeData: n.threeData
|
|
@@ -176,7 +176,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
176
176
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
177
177
|
]),
|
|
178
178
|
_: 3
|
|
179
|
-
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).TRACK_PATH ? (T(),
|
|
179
|
+
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).TRACK_PATH ? (T(), B(m(i), {
|
|
180
180
|
key: 1,
|
|
181
181
|
fileBlobs: l.value,
|
|
182
182
|
threeData: n.threeData,
|
|
@@ -189,7 +189,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
189
189
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
190
190
|
]),
|
|
191
191
|
_: 3
|
|
192
|
-
}, 8, ["fileBlobs", "threeData", "trackFileType"])) : v.value === m(a).CPMPIP_SCENE ? (T(),
|
|
192
|
+
}, 8, ["fileBlobs", "threeData", "trackFileType"])) : v.value === m(a).CPMPIP_SCENE ? (T(), B(m(p), {
|
|
193
193
|
key: 2,
|
|
194
194
|
fileBlobs: l.value,
|
|
195
195
|
threeData: n.threeData
|
|
@@ -201,7 +201,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
201
201
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
202
202
|
]),
|
|
203
203
|
_: 3
|
|
204
|
-
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).PREVIEW ? (T(),
|
|
204
|
+
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).PREVIEW ? (T(), B(m(y), {
|
|
205
205
|
key: 3,
|
|
206
206
|
fileBlobs: l.value
|
|
207
207
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),d=require("./index-
|
|
1
|
+
"use strict";const e=require("vue"),d=require("./index-C8fMwErX.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-b_9vxv2X.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-D97Sc8hd.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-CBFQtSls.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-s17KavQX.cjs"))),m=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-4Cjv1ZS4.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;
|