ss-component-new 1.2.320 → 1.2.321
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-CDSTkv2r.js → MTLLoader-DPOghquc.js} +44 -44
- package/dist/{MTLLoader-CzQIVnkW.cjs → MTLLoader-WtlM9u4_.cjs} +1 -1
- package/dist/{OrbitControls-D-H9X2Xc.cjs → OrbitControls-B4WKzU1G.cjs} +1 -1
- package/dist/{OrbitControls-DcmX9nvA.js → OrbitControls-D-nkCRIf.js} +1 -1
- package/dist/{URDFLoader-B_kf63rV.cjs → URDFLoader-BCALUmPB.cjs} +1 -1
- package/dist/{URDFLoader-CdN4_DgF.js → URDFLoader-CWlOHauP.js} +95 -95
- package/dist/{animationData-Clpy-I6C.cjs → animationData-C0UguIKQ.cjs} +1 -1
- package/dist/{animationData-CEhF6uNe.js → animationData-Dzdp9nas.js} +22 -22
- package/dist/{array-hFAdDlKV.cjs → array-CK9adN1S.cjs} +1 -1
- package/dist/{array-BnbdEheX.js → array-DsXvI7kM.js} +36 -36
- package/dist/{iconfont-D0jIkQMM.js → iconfont-BnHV6N2N.js} +21 -21
- package/dist/{iconfont-CdKkdWWU.cjs → iconfont-lNXhZpFp.cjs} +1 -1
- package/dist/{index-acHXwlR5.cjs → index--86Gn2ru.cjs} +1 -1
- package/dist/{index-DMzQ5VfV.cjs → index-0mdQIssU.cjs} +1 -1
- package/dist/index-1Owg_Mf-.cjs +1 -0
- package/dist/{index-BN6O_Eek.js → index-9UoNKztf.js} +1 -1
- package/dist/{index-DGWdVqDd.cjs → index-A_jMsoyr.cjs} +1 -1
- package/dist/{index-Hsb03y-r.js → index-B1H0LkPE.js} +1 -1
- package/dist/{index-Dtm1Qjht.js → index-BBclOeFM.js} +1 -1
- package/dist/{index-B63s-JlF.js → index-BGMypXCK.js} +4 -4
- package/dist/{index-ChY5FLQd.js → index-BSgP28TB.js} +2 -2
- package/dist/{index-CsYuwsiy.cjs → index-B_ocki10.cjs} +1 -1
- package/dist/{index-CZmHTDer.cjs → index-BcDHAiO3.cjs} +1 -1
- package/dist/{index-B9biCv6N.js → index-BsIOE41E.js} +1 -1
- package/dist/{index-BUgBjm_0.cjs → index-BykHr1Eg.cjs} +1 -1
- package/dist/{index-BULVh0UT.js → index-C7bPptTr.js} +1 -1
- package/dist/{index-BbLk-2Gd.js → index-CZ6fkXHY.js} +5 -5
- package/dist/index-CZXiiKiM.cjs +11 -0
- package/dist/index-CigkH2AZ.js +12465 -0
- package/dist/{index-CuaMF-D0.js → index-Cxsfl10z.js} +3 -3
- package/dist/{index-BMobTVwt.cjs → index-D0xh6m7C.cjs} +1 -1
- package/dist/{index-CKJP2psW.cjs → index-D2lip588.cjs} +1 -1
- package/dist/{index-BBYRL3BD.js → index-D7Gyeuk1.js} +4 -4
- package/dist/{index-CmYzo1h5.cjs → index-DCYH5zL4.cjs} +1 -1
- package/dist/{index-CIWoZH8M.cjs → index-DN4tn4Q1.cjs} +1 -1
- package/dist/{index-DhORf5Ca.cjs → index-DRTEyrqM.cjs} +1 -1
- package/dist/{index-C_mznIEq.js → index-DTAyw_rT.js} +5 -5
- package/dist/{index-ChkaCKRr.js → index-DWpSqmnH.js} +2150 -2152
- package/dist/{index-WhfGtq5k.js → index-DeINnO1a.js} +1 -1
- package/dist/{index-CDxSv4Fm.cjs → index-DlRKKRIJ.cjs} +1 -1
- package/dist/{index-2pT_YeoR.cjs → index-DmUZr5rN.cjs} +1 -1
- package/dist/{index-Dcvmiima.js → index-DuAd7WnG.js} +1 -1
- package/dist/{index-gII2yOS-.js → index-Dz0Yy_aU.js} +3 -3
- package/dist/{index-DsWNgreC.js → index-EEdSZ0XK.js} +1 -1
- package/dist/{index-D-EuGZq6.cjs → index-HIz3WqB6.cjs} +1 -1
- package/dist/{index-an4li1M5.cjs → index-HZa2fjvR.cjs} +1 -1
- package/dist/{index-auR6PIXZ.js → index-McjYxFmy.js} +4 -4
- package/dist/{index-B2NXMUwG.cjs → index-NT3-shBq.cjs} +1 -1
- package/dist/{index-BkR1ZyW0.cjs → index-Y-aMAtUz.cjs} +1 -1
- package/dist/{index-q3TzHC9c.cjs → index-ZDxZcfNU.cjs} +1 -1
- package/dist/{index-B--dkiC3.js → index-r0hSh3Ho.js} +1 -1
- package/dist/{index-Cz3X-nTr.js → index-seLSz6FS.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bo3GWmfl.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B-jMTZLT.cjs} +107 -107
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-C7EqnG9z.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-gYZo9wwL.js} +152 -151
- package/dist/{index.vue_vue_type_style_index_1_lang-CCAvftWy.js → index.vue_vue_type_style_index_1_lang-BlEiaBVX.js} +182 -182
- package/dist/{index.vue_vue_type_style_index_1_lang-C82aG_1o.cjs → index.vue_vue_type_style_index_1_lang-Dl0UrVqn.cjs} +1 -1
- package/dist/{main-TVcRSKDf.cjs → main-D9dcB2l7.cjs} +1 -1
- package/dist/{main-CGEK-Lu3.js → main-DrHv50I2.js} +3 -3
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.js +8 -8
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-BWNBsSte.cjs → threeModel-CU32ZPcV.cjs} +1 -1
- package/dist/{threeModel-DiqA6QHp.js → threeModel-D99aHX_f.js} +24 -24
- package/dist/{threePreview-_Y77vG5u.js → threePreview-Br0EE4Ud.js} +114 -114
- package/dist/{threePreview-Ceu1jsHj.cjs → threePreview-DVU8LB-6.cjs} +1 -1
- package/dist/{threeSceneView-KzaY14zK.js → threeSceneView-COmqJFJG.js} +8 -8
- package/dist/{threeSceneView-CQIft8NI.cjs → threeSceneView-DqdT1Ddr.cjs} +1 -1
- package/dist/{threeSceneViewForCPMPIP-Cb79-tDO.js → threeSceneViewForCPMPIP-B51x6Ync.js} +7 -7
- package/dist/{threeSceneViewForCPMPIP-B77HstZi.cjs → threeSceneViewForCPMPIP-ra01ZlH4.cjs} +1 -1
- package/dist/{threeTrackPathView-CmZ0-vAj.js → threeTrackPathView-C22dVYEt.js} +88 -88
- package/dist/{threeTrackPathView-Bb5aCZ93.cjs → threeTrackPathView-DAoYI7KH.cjs} +1 -1
- package/dist/{threeViewerHost-C7xRsvtB.js → threeViewerHost-CxfATzg5.js} +15 -15
- package/dist/{threeViewerHost-9ZQ5PlEH.cjs → threeViewerHost-dB3mMvbG.cjs} +1 -1
- package/dist/{urdfTree-BIfrcTrZ.js → urdfTree-B7vFAieq.js} +4 -4
- package/dist/{urdfTree-Cf82F-ZA.cjs → urdfTree-Un6KDIVy.cjs} +1 -1
- package/dist/{workpieceTreePanel-CoG2RuKE.js → workpieceTreePanel-CgNiyUrm.js} +27 -27
- package/dist/{workpieceTreePanel-BjrztNlC.cjs → workpieceTreePanel-D6QEaOh8.cjs} +1 -1
- package/package.json +1 -1
- package/dist/index-CbJ7Fc-s.js +0 -12271
- package/dist/index-GVffFAZv.cjs +0 -1
- package/dist/index-J-1vJ4iC.cjs +0 -11
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as ce, computed as M, ref as k, resolveComponent as
|
|
2
|
-
import { u as De, a as Ne, b as Ze, C as
|
|
3
|
-
import { O,
|
|
4
|
-
import { E as
|
|
5
|
-
import { U as et, J as tt } from "./urdfTree-
|
|
1
|
+
import { defineComponent as ce, computed as M, ref as k, resolveComponent as X, createElementBlock as ee, openBlock as E, createElementVNode as d, createVNode as p, withCtx as B, toDisplayString as Y, shallowRef as D, watch as Xe, onMounted as Ee, onBeforeUnmount as Ye, withDirectives as N, createCommentVNode as S, unref as A, renderSlot as ie, createBlock as le, vShow as Z, nextTick as je } from "vue";
|
|
2
|
+
import { u as De, a as Ne, b as Ze, C as Ie, f as Be, d as re } from "./iconfont-BnHV6N2N.js";
|
|
3
|
+
import { Q as O, a1 as Oe, bH as Ge, aD as qe, V as te, aF as ue, aS as fe, aY as Ke, aH as We, aX as He, aU as Je, aV as Re, ab as Qe, bI as Se } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-gYZo9wwL.js";
|
|
4
|
+
import { E as I } from "./index-BUf2BDmR.js";
|
|
5
|
+
import { U as et, J as tt } from "./urdfTree-B7vFAieq.js";
|
|
6
6
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
7
7
|
import { T as w } from "./svgIcon-4u4PW7Is.js";
|
|
8
8
|
import { i as nt } from "./isString-Dt9iv6Ix.js";
|
|
9
9
|
function ot(e = 0.5, n = 4) {
|
|
10
10
|
const o = new Oe(
|
|
11
11
|
new Ge(e, n, 32),
|
|
12
|
-
new
|
|
12
|
+
new qe({
|
|
13
13
|
color: "#919191ff",
|
|
14
14
|
// 再提一档灰度
|
|
15
15
|
metalness: 0.3,
|
|
@@ -62,7 +62,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
62
62
|
s.value = g, de(a.knife, y, a.cloud);
|
|
63
63
|
}, v = async () => {
|
|
64
64
|
if (l.value.length === 0) {
|
|
65
|
-
|
|
65
|
+
I.error("无法播放动画:无数据");
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
if (!t.value) {
|
|
@@ -70,7 +70,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
70
70
|
try {
|
|
71
71
|
for (let g = s.value + 1; g < l.value.length && !f; g++)
|
|
72
72
|
await new Promise((y) => setTimeout(y, r.value)), m(g);
|
|
73
|
-
f ||
|
|
73
|
+
f || I.success("动画播放完成");
|
|
74
74
|
} catch (g) {
|
|
75
75
|
console.error("动画播放出错:", g);
|
|
76
76
|
} finally {
|
|
@@ -78,7 +78,7 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}, C = () => {
|
|
81
|
-
f = !0, t.value = !1,
|
|
81
|
+
f = !0, t.value = !1, I.info("动画已停止");
|
|
82
82
|
}, P = (g) => {
|
|
83
83
|
t.value && C(), m(g);
|
|
84
84
|
}, _ = () => {
|
|
@@ -91,21 +91,21 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
91
91
|
return n({ playAnimation: v, stopAnimation: C, forwardFrame: _, backwardFrame: T, resetAnimationFrame: h, reset: async () => {
|
|
92
92
|
await C(), h();
|
|
93
93
|
} }), (g, y) => {
|
|
94
|
-
const
|
|
95
|
-
return
|
|
94
|
+
const q = X("el-input-number"), K = X("el-form-item"), W = X("el-form"), H = X("el-slider");
|
|
95
|
+
return E(), ee("div", it, [
|
|
96
96
|
d("div", lt, [
|
|
97
97
|
d("div", rt, [
|
|
98
|
-
p(
|
|
98
|
+
p(W, {
|
|
99
99
|
"label-width": "auto",
|
|
100
100
|
style: { width: "100%" }
|
|
101
101
|
}, {
|
|
102
|
-
default:
|
|
103
|
-
p(
|
|
102
|
+
default: B(() => [
|
|
103
|
+
p(K, {
|
|
104
104
|
label: "帧间隔 (ms):",
|
|
105
105
|
prop: "frameDuration"
|
|
106
106
|
}, {
|
|
107
|
-
default:
|
|
108
|
-
p(
|
|
107
|
+
default: B(() => [
|
|
108
|
+
p(q, {
|
|
109
109
|
modelValue: r.value,
|
|
110
110
|
"onUpdate:modelValue": y[0] || (y[0] = (U) => r.value = U),
|
|
111
111
|
min: 0,
|
|
@@ -122,11 +122,11 @@ const it = { class: "panel-content" }, lt = { class: "animation-controls" }, rt
|
|
|
122
122
|
]),
|
|
123
123
|
d("div", ct, [
|
|
124
124
|
y[2] || (y[2] = d("label", null, "当前帧:", -1)),
|
|
125
|
-
d("span", ut,
|
|
125
|
+
d("span", ut, Y(s.value + 1) + " / " + Y(l.value.length), 1)
|
|
126
126
|
]),
|
|
127
127
|
d("div", ft, [
|
|
128
128
|
y[3] || (y[3] = d("label", null, "动画进度:", -1)),
|
|
129
|
-
p(
|
|
129
|
+
p(H, {
|
|
130
130
|
modelValue: s.value,
|
|
131
131
|
"onUpdate:modelValue": y[1] || (y[1] = (U) => s.value = U),
|
|
132
132
|
min: 0,
|
|
@@ -279,25 +279,25 @@ function Lt(e) {
|
|
|
279
279
|
n.push(new te(e[o], e[o + 1], e[o + 2]));
|
|
280
280
|
return n;
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function Vt(e) {
|
|
283
283
|
const n = new ue();
|
|
284
284
|
n.setAttribute("position", new fe(e, 3));
|
|
285
|
-
const o = new
|
|
285
|
+
const o = new Ke({
|
|
286
286
|
color: 55551,
|
|
287
287
|
linewidth: 3
|
|
288
288
|
});
|
|
289
|
-
return new
|
|
289
|
+
return new We(n, o);
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function $t(e, n) {
|
|
292
292
|
if (!n || n.length < 3)
|
|
293
293
|
return;
|
|
294
294
|
const { scene: o, camera: a, renderer: l, controls: t } = e();
|
|
295
295
|
if (!o || !a || !l || !t)
|
|
296
296
|
return;
|
|
297
|
-
const s =
|
|
297
|
+
const s = Vt(n);
|
|
298
298
|
return s.name = "轨迹路径", o.add(s), s;
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function Xt(e, n, o, a = 4, l = 50) {
|
|
301
301
|
let t = 1 / 0, s = -1 / 0, r = 1 / 0, f = -1 / 0, c = 1 / 0, m = -1 / 0;
|
|
302
302
|
for (let h = 0; h < e.length; h += 3) {
|
|
303
303
|
const L = e[h], g = e[h + 1], y = e[h + 2];
|
|
@@ -306,7 +306,7 @@ function Et(e, n, o, a = 4, l = 50) {
|
|
|
306
306
|
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);
|
|
307
307
|
return Math.min(0.4, T);
|
|
308
308
|
}
|
|
309
|
-
function
|
|
309
|
+
function Et(e) {
|
|
310
310
|
if (e.length % 3 !== 0)
|
|
311
311
|
return console.error("points array length is not a multiple of 3:", e), null;
|
|
312
312
|
const n = new ue();
|
|
@@ -314,32 +314,32 @@ function Xt(e) {
|
|
|
314
314
|
const o = new Float32Array(e.length);
|
|
315
315
|
for (let t = 0; t < e.length; t += 3)
|
|
316
316
|
o[t] = 0, o[t + 1] = 0.847, o[t + 2] = 1;
|
|
317
|
-
n.setAttribute("color", new
|
|
318
|
-
const a = new
|
|
317
|
+
n.setAttribute("color", new He(o, 3));
|
|
318
|
+
const a = new Je({
|
|
319
319
|
vertexColors: !0,
|
|
320
320
|
size: 0.4,
|
|
321
321
|
// 像素世界单位
|
|
322
322
|
sizeAttenuation: !0
|
|
323
|
-
}), l = new
|
|
323
|
+
}), l = new Re(n, a);
|
|
324
324
|
return a.needsUpdate = !0, l;
|
|
325
325
|
}
|
|
326
|
-
function
|
|
326
|
+
function Yt(e, n) {
|
|
327
327
|
if (!n)
|
|
328
328
|
return;
|
|
329
329
|
const { scene: o, camera: a, renderer: l, controls: t } = e();
|
|
330
330
|
if (!o || !a || !l || !t)
|
|
331
331
|
return;
|
|
332
|
-
const s =
|
|
332
|
+
const s = Et(n);
|
|
333
333
|
if (!s)
|
|
334
334
|
return;
|
|
335
335
|
s.name = "轨迹路径", o.add(s);
|
|
336
|
-
const r =
|
|
336
|
+
const r = Xt(n, a, l, 0.1, 50);
|
|
337
337
|
return s.material.size = r, s;
|
|
338
338
|
}
|
|
339
|
-
const
|
|
339
|
+
const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft" }, Nt = { class: "buttonGroup-left" }, Zt = { class: "buttonGroup-right" }, It = { class: "buttonGroup-bottom" }, Bt = { class: "left-panel" }, Ot = { class: "panel-header" }, Gt = { class: "panel-body" }, qt = { class: "right-panel" }, Kt = { class: "panel-header" }, Wt = { class: "panel-body" }, Ht = {
|
|
340
340
|
key: 0,
|
|
341
341
|
class: "loading-overlay"
|
|
342
|
-
},
|
|
342
|
+
}, Jt = /* @__PURE__ */ ce({
|
|
343
343
|
__name: "threeTrackPathView",
|
|
344
344
|
props: {
|
|
345
345
|
fileBlobs: {},
|
|
@@ -356,19 +356,19 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
356
356
|
cleanup: L,
|
|
357
357
|
setModels: g,
|
|
358
358
|
setAndFitModels: y,
|
|
359
|
-
axesHelperVisible:
|
|
360
|
-
toggleAxesVisibility:
|
|
361
|
-
zoomIn:
|
|
362
|
-
zoomOut:
|
|
363
|
-
} = De(o), { isAnimating: U, toggleAnimation: me, startAnimation:
|
|
364
|
-
|
|
359
|
+
axesHelperVisible: q,
|
|
360
|
+
toggleAxesVisibility: K,
|
|
361
|
+
zoomIn: W,
|
|
362
|
+
zoomOut: H
|
|
363
|
+
} = De(o), { isAnimating: U, toggleAnimation: me, startAnimation: Rt, stopAnimation: pe } = Ne(h, C), { isClipping: he, activeClippingAxis: ne, toggleClipping: ge, updateClippingPlanes: ye } = Ze(h, C), Ce = () => {
|
|
364
|
+
K();
|
|
365
365
|
}, we = (i) => {
|
|
366
366
|
ne.value = i, ye();
|
|
367
|
-
},
|
|
367
|
+
}, J = (i) => {
|
|
368
368
|
s.value = !0, r.value = i, i === "剖面视图" && !he.value && ge();
|
|
369
|
-
},
|
|
369
|
+
}, R = (i) => {
|
|
370
370
|
f.value = !0, c.value = i;
|
|
371
|
-
}, Q = k([]),
|
|
371
|
+
}, Q = k([]), V = k([]), ke = M(() => {
|
|
372
372
|
var u;
|
|
373
373
|
return (u = n.trackFileType) == null ? void 0 : u.isUv;
|
|
374
374
|
}), be = M(() => {
|
|
@@ -394,19 +394,19 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
394
394
|
}, se = () => {
|
|
395
395
|
Te(), ze();
|
|
396
396
|
}, Ae = async (i) => {
|
|
397
|
-
const u = URL.createObjectURL(i),
|
|
398
|
-
if (URL.revokeObjectURL(u), nt(
|
|
399
|
-
Q.value = await Mt(
|
|
397
|
+
const u = URL.createObjectURL(i), $ = await Se(u);
|
|
398
|
+
if (URL.revokeObjectURL(u), nt($)) {
|
|
399
|
+
Q.value = await Mt($, n.trackFileType) || [];
|
|
400
400
|
const z = Q.value;
|
|
401
|
-
ke.value && (b.value =
|
|
401
|
+
ke.value && (b.value = $t(h, z)), (be.value || _e.value || x.value) && (b.value = Yt(h, z));
|
|
402
402
|
}
|
|
403
403
|
}, Pe = async () => {
|
|
404
404
|
var i, u;
|
|
405
|
-
F.value = ot(),
|
|
405
|
+
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));
|
|
406
406
|
}, ae = async (i) => {
|
|
407
|
-
se(), await Ae(i), b.value &&
|
|
407
|
+
se(), await Ae(i), b.value && Be(h, b.value), x.value && Pe();
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
Xe(() => oe.value, async (i) => {
|
|
410
410
|
i && await ae(i);
|
|
411
411
|
}, {
|
|
412
412
|
immediate: !0,
|
|
@@ -427,27 +427,27 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
427
427
|
}, Le = () => {
|
|
428
428
|
var i;
|
|
429
429
|
x.value && ((i = t == null ? void 0 : t.value) == null || i.backwardFrame());
|
|
430
|
-
},
|
|
431
|
-
_(),
|
|
432
|
-
o.value && (
|
|
430
|
+
}, Ve = () => {
|
|
431
|
+
_(), je(() => {
|
|
432
|
+
o.value && (j = new ResizeObserver(T), j.observe(o.value));
|
|
433
433
|
});
|
|
434
434
|
const i = h();
|
|
435
435
|
v.value = i.scene, v.value && (v.value.name = "CPMPIP");
|
|
436
|
-
},
|
|
437
|
-
|
|
436
|
+
}, $e = () => {
|
|
437
|
+
j && j.disconnect(), U.value && pe(), se(), L();
|
|
438
438
|
};
|
|
439
|
-
let
|
|
440
|
-
return
|
|
439
|
+
let j = null;
|
|
440
|
+
return Ee(async () => {
|
|
441
441
|
try {
|
|
442
|
-
|
|
442
|
+
Ve();
|
|
443
443
|
} catch (i) {
|
|
444
|
-
console.error("Three.js 初始化失败:", i),
|
|
444
|
+
console.error("Three.js 初始化失败:", i), I.error("渲染引擎初始化失败!");
|
|
445
445
|
}
|
|
446
|
-
}),
|
|
447
|
-
|
|
446
|
+
}), Ye(() => {
|
|
447
|
+
$e();
|
|
448
448
|
}), (i, u) => {
|
|
449
|
-
const
|
|
450
|
-
return
|
|
449
|
+
const $ = X("el-scrollbar");
|
|
450
|
+
return E(), ee("div", jt, [
|
|
451
451
|
d("div", {
|
|
452
452
|
ref_key: "threejsContainer",
|
|
453
453
|
ref: o,
|
|
@@ -464,13 +464,13 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
464
464
|
name: "fangda",
|
|
465
465
|
size: "24",
|
|
466
466
|
title: "放大",
|
|
467
|
-
onClick: A(
|
|
467
|
+
onClick: A(W)
|
|
468
468
|
}, null, 8, ["onClick"]),
|
|
469
469
|
p(w, {
|
|
470
470
|
name: "suoxiao",
|
|
471
471
|
size: "24",
|
|
472
472
|
title: "缩小",
|
|
473
|
-
onClick: A(
|
|
473
|
+
onClick: A(H)
|
|
474
474
|
}, null, 8, ["onClick"]),
|
|
475
475
|
p(w, {
|
|
476
476
|
name: "lookAround",
|
|
@@ -481,34 +481,34 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
481
481
|
p(w, {
|
|
482
482
|
name: "zuobiaoxi",
|
|
483
483
|
size: "24",
|
|
484
|
-
active: A(
|
|
484
|
+
active: A(q),
|
|
485
485
|
onClick: Ce,
|
|
486
486
|
title: "显隐坐标轴"
|
|
487
487
|
}, null, 8, ["active"])
|
|
488
488
|
]),
|
|
489
489
|
d("div", Nt, [
|
|
490
|
-
ie(i.$slots, "button-left", { switchRightPanel:
|
|
490
|
+
ie(i.$slots, "button-left", { switchRightPanel: J }, void 0, !0),
|
|
491
491
|
p(w, {
|
|
492
492
|
name: "jiegoushu",
|
|
493
493
|
size: "24",
|
|
494
|
-
onClick: u[0] || (u[0] = (z) =>
|
|
494
|
+
onClick: u[0] || (u[0] = (z) => J("场景树")),
|
|
495
495
|
active: s.value && r.value === "场景树",
|
|
496
496
|
title: "场景树"
|
|
497
497
|
}, null, 8, ["active"]),
|
|
498
498
|
p(w, {
|
|
499
499
|
name: "clipping",
|
|
500
500
|
size: "24",
|
|
501
|
-
onClick: u[1] || (u[1] = (z) =>
|
|
501
|
+
onClick: u[1] || (u[1] = (z) => J("剖面视图")),
|
|
502
502
|
active: s.value && r.value === "剖面视图",
|
|
503
503
|
title: "剖面视图"
|
|
504
504
|
}, null, 8, ["active"])
|
|
505
505
|
]),
|
|
506
506
|
d("div", Zt, [
|
|
507
|
-
ie(i.$slots, "button-right", { switchRightPanel:
|
|
507
|
+
ie(i.$slots, "button-right", { switchRightPanel: R }, void 0, !0),
|
|
508
508
|
p(w, {
|
|
509
509
|
name: "guanjiekongzhi",
|
|
510
510
|
size: "24",
|
|
511
|
-
onClick: u[2] || (u[2] = (z) =>
|
|
511
|
+
onClick: u[2] || (u[2] = (z) => R("关节控制")),
|
|
512
512
|
active: f.value && c.value === "关节控制",
|
|
513
513
|
title: "关节控制"
|
|
514
514
|
}, null, 8, ["active"]),
|
|
@@ -516,11 +516,11 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
516
516
|
name: "donghuafangzhen",
|
|
517
517
|
size: "24",
|
|
518
518
|
title: "动画仿真",
|
|
519
|
-
onClick: u[3] || (u[3] = (z) =>
|
|
519
|
+
onClick: u[3] || (u[3] = (z) => R("动画仿真")),
|
|
520
520
|
active: f.value && c.value === "动画仿真"
|
|
521
521
|
}, null, 8, ["active"])
|
|
522
522
|
]),
|
|
523
|
-
d("div",
|
|
523
|
+
d("div", It, [
|
|
524
524
|
p(w, {
|
|
525
525
|
name: "kuaitui",
|
|
526
526
|
size: "24",
|
|
@@ -550,22 +550,22 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
550
550
|
onClick: Ue
|
|
551
551
|
})
|
|
552
552
|
]),
|
|
553
|
-
N(d("div",
|
|
553
|
+
N(d("div", Bt, [
|
|
554
554
|
d("div", Ot, [
|
|
555
|
-
d("span", null,
|
|
555
|
+
d("span", null, Y(r.value), 1),
|
|
556
556
|
d("span", {
|
|
557
557
|
class: "close",
|
|
558
558
|
onClick: u[4] || (u[4] = (z) => s.value = !1)
|
|
559
559
|
}, " X ")
|
|
560
560
|
]),
|
|
561
561
|
d("div", Gt, [
|
|
562
|
-
p(
|
|
563
|
-
default:
|
|
564
|
-
r.value === "场景树" ? (
|
|
562
|
+
p($, { height: "100%" }, {
|
|
563
|
+
default: B(() => [
|
|
564
|
+
r.value === "场景树" ? (E(), le(et, {
|
|
565
565
|
key: 0,
|
|
566
566
|
model: m.value
|
|
567
567
|
}, null, 8, ["model"])) : S("", !0),
|
|
568
|
-
r.value === "剖面视图" ? (
|
|
568
|
+
r.value === "剖面视图" ? (E(), le(Ie, {
|
|
569
569
|
key: 1,
|
|
570
570
|
value: A(ne),
|
|
571
571
|
onChange: we
|
|
@@ -577,17 +577,17 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
577
577
|
], 512), [
|
|
578
578
|
[Z, s.value]
|
|
579
579
|
]),
|
|
580
|
-
N(d("div",
|
|
581
|
-
d("div",
|
|
582
|
-
d("span", null,
|
|
580
|
+
N(d("div", qt, [
|
|
581
|
+
d("div", Kt, [
|
|
582
|
+
d("span", null, Y(c.value), 1),
|
|
583
583
|
d("span", {
|
|
584
584
|
class: "close",
|
|
585
585
|
onClick: u[5] || (u[5] = (z) => f.value = !1)
|
|
586
586
|
}, " X ")
|
|
587
587
|
]),
|
|
588
|
-
d("div",
|
|
589
|
-
p(
|
|
590
|
-
default:
|
|
588
|
+
d("div", Wt, [
|
|
589
|
+
p($, { height: "100%" }, {
|
|
590
|
+
default: B(() => [
|
|
591
591
|
N(p(tt, { model: m.value }, null, 8, ["model"]), [
|
|
592
592
|
[Z, c.value === "关节控制"]
|
|
593
593
|
]),
|
|
@@ -596,7 +596,7 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
596
596
|
ref: t,
|
|
597
597
|
cloud: A(b),
|
|
598
598
|
knife: A(F),
|
|
599
|
-
vectors:
|
|
599
|
+
vectors: V.value
|
|
600
600
|
}, null, 8, ["cloud", "knife", "vectors"]), [
|
|
601
601
|
[Z, c.value === "动画仿真" && x.value]
|
|
602
602
|
])
|
|
@@ -607,14 +607,14 @@ const Yt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
607
607
|
], 512), [
|
|
608
608
|
[Z, f.value]
|
|
609
609
|
]),
|
|
610
|
-
a.value ? (
|
|
610
|
+
a.value ? (E(), ee("div", Ht, [
|
|
611
611
|
u[6] || (u[6] = d("div", { class: "loading-spinner" }, null, -1)),
|
|
612
|
-
d("p", null,
|
|
612
|
+
d("p", null, Y(l.value), 1)
|
|
613
613
|
])) : S("", !0)
|
|
614
614
|
]);
|
|
615
615
|
};
|
|
616
616
|
}
|
|
617
|
-
}), ln = /* @__PURE__ */ ve(
|
|
617
|
+
}), ln = /* @__PURE__ */ ve(Jt, [["__scopeId", "data-v-7178b621"]]);
|
|
618
618
|
export {
|
|
619
619
|
ln as default
|
|
620
620
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./iconfont-CdKkdWWU.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Bo3GWmfl.cjs"),I=require("./index-B5Iw9Udy.cjs"),K=require("./urdfTree-Cf82F-ZA.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-C9Flprgd.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-lNXhZpFp.cjs"),p=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B-jMTZLT.cjs"),I=require("./index-B5Iw9Udy.cjs"),K=require("./urdfTree-Un6KDIVy.cjs"),R=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),w=require("./svgIcon-CDPAgQbj.cjs"),ge=require("./isString-C9Flprgd.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,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as U, defineAsyncComponent as b, computed as
|
|
1
|
+
import { defineComponent as U, defineAsyncComponent as b, computed as B, ref as R, watch as H, createElementBlock as N, openBlock as T, createElementVNode as K, createBlock as I, createCommentVNode as V, renderSlot as u, unref as m, withCtx as d } from "vue";
|
|
2
2
|
import { n as W, p as D, s as M } from "./index-BUf2BDmR.js";
|
|
3
3
|
import { u as $ } from "./index-BjCGdt04.js";
|
|
4
|
-
import { e as j,
|
|
5
|
-
import { _ as
|
|
4
|
+
import { e as j, aA as A, aB as L } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-gYZo9wwL.js";
|
|
5
|
+
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
6
|
const se = {
|
|
7
7
|
SINGLE: "单机",
|
|
8
8
|
DOUBLE: "双机"
|
|
@@ -18,7 +18,7 @@ const se = {
|
|
|
18
18
|
// 重大专项场景
|
|
19
19
|
PREVIEW: "preview"
|
|
20
20
|
// 预览模式
|
|
21
|
-
},
|
|
21
|
+
}, z = W("threeState", {
|
|
22
22
|
state: () => ({
|
|
23
23
|
data: {
|
|
24
24
|
files: [],
|
|
@@ -35,7 +35,7 @@ const se = {
|
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
37
|
function Y() {
|
|
38
|
-
const E = $(D), { platform: O } = M(E), y =
|
|
38
|
+
const E = $(D), { platform: O } = M(E), y = z(D), i = ["uv", "cyd", "nc"], p = ["urdf"], n = ["obj", "stl"], P = [...i, ...p, ...n], f = (e) => {
|
|
39
39
|
if (!g())
|
|
40
40
|
throw new Error("不是三维系统");
|
|
41
41
|
y.setData(e);
|
|
@@ -113,20 +113,20 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
113
113
|
height: { default: "100%" }
|
|
114
114
|
},
|
|
115
115
|
setup(E) {
|
|
116
|
-
const O = b(() => import("./threeSceneView-
|
|
116
|
+
const O = b(() => import("./threeSceneView-COmqJFJG.js")), y = b(() => import("./threePreview-Br0EE4Ud.js")), i = b(() => import("./threeTrackPathView-C22dVYEt.js")), p = b(() => import("./threeSceneViewForCPMPIP-B51x6Ync.js")), n = E, P = $(D), { platName: f } = M(P), { isUrdf: _, isTrackPathFile: g } = Y(), c = B(() => {
|
|
117
117
|
var t;
|
|
118
118
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
119
119
|
const { url: e } = s;
|
|
120
120
|
return e;
|
|
121
121
|
});
|
|
122
|
-
}), h =
|
|
122
|
+
}), h = B(() => {
|
|
123
123
|
var e;
|
|
124
124
|
const t = (e = n == null ? void 0 : n.files) == null ? void 0 : e[0];
|
|
125
125
|
return (t == null ? void 0 : t.extension) || "";
|
|
126
|
-
}), S =
|
|
126
|
+
}), S = B(() => {
|
|
127
127
|
var t, s;
|
|
128
128
|
return (s = (t = n == null ? void 0 : n.threeData) == null ? void 0 : t.data) == null ? void 0 : s.trackFileType;
|
|
129
|
-
}), v =
|
|
129
|
+
}), v = B(() => {
|
|
130
130
|
if (n.componentType)
|
|
131
131
|
switch (n.componentType) {
|
|
132
132
|
case "robot":
|
|
@@ -165,7 +165,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
165
165
|
K("div", J, [
|
|
166
166
|
u(t.$slots, "top-menu", {}, void 0, !0)
|
|
167
167
|
]),
|
|
168
|
-
v.value === m(a).ROBOT_SCENE ? (T(),
|
|
168
|
+
v.value === m(a).ROBOT_SCENE ? (T(), I(m(O), {
|
|
169
169
|
key: 0,
|
|
170
170
|
fileBlobs: l.value,
|
|
171
171
|
threeData: n.threeData
|
|
@@ -177,7 +177,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
177
177
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
178
178
|
]),
|
|
179
179
|
_: 3
|
|
180
|
-
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).TRACK_PATH ? (T(),
|
|
180
|
+
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).TRACK_PATH ? (T(), I(m(i), {
|
|
181
181
|
key: 1,
|
|
182
182
|
fileBlobs: l.value,
|
|
183
183
|
threeData: n.threeData,
|
|
@@ -190,7 +190,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
190
190
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
191
191
|
]),
|
|
192
192
|
_: 3
|
|
193
|
-
}, 8, ["fileBlobs", "threeData", "trackFileType"])) : v.value === m(a).CPMPIP_SCENE ? (T(),
|
|
193
|
+
}, 8, ["fileBlobs", "threeData", "trackFileType"])) : v.value === m(a).CPMPIP_SCENE ? (T(), I(m(p), {
|
|
194
194
|
key: 2,
|
|
195
195
|
fileBlobs: l.value,
|
|
196
196
|
threeData: n.threeData
|
|
@@ -202,7 +202,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
202
202
|
u(t.$slots, "management-page", {}, void 0, !0)
|
|
203
203
|
]),
|
|
204
204
|
_: 3
|
|
205
|
-
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).PREVIEW ? (T(),
|
|
205
|
+
}, 8, ["fileBlobs", "threeData"])) : v.value === m(a).PREVIEW ? (T(), I(m(y), {
|
|
206
206
|
key: 3,
|
|
207
207
|
fileBlobs: l.value
|
|
208
208
|
}, {
|
|
@@ -217,7 +217,7 @@ const q = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
217
217
|
C.value ? (T(), N("div", Q, " 文件下载中,请稍候... ")) : V("", !0)
|
|
218
218
|
]));
|
|
219
219
|
}
|
|
220
|
-
}), Z = /* @__PURE__ */
|
|
220
|
+
}), Z = /* @__PURE__ */ G(X, [["__scopeId", "data-v-9798f55b"]]), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
221
221
|
__proto__: null,
|
|
222
222
|
default: Z
|
|
223
223
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -227,5 +227,5 @@ export {
|
|
|
227
227
|
se as r,
|
|
228
228
|
oe as s,
|
|
229
229
|
ae as t,
|
|
230
|
-
|
|
230
|
+
z as u
|
|
231
231
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),h=require("./index-B5Iw9Udy.cjs"),b=require("./index-BJR7UdIU.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-
|
|
1
|
+
"use strict";const e=require("vue"),h=require("./index-B5Iw9Udy.cjs"),b=require("./index-BJR7UdIU.cjs"),S=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-B-jMTZLT.cjs"),F=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),R={SINGLE:"单机",DOUBLE:"双机"},N={ROBOT:1,PIPECOMPARSION:2},i={ROBOT_SCENE:"robot",TRACK_PATH:"trackPath",CPMPIP_SCENE:"cpmpip",PREVIEW:"preview"},I=h.defineStore("threeState",{state:()=>({data:{files:[],data:{}}}),actions:{setData(v){this.data=v},getData(){return this.data}}});function O(){const v=b.useMenuState(h.pinia),{platform:g}=h.storeToRefs(v),P=I(h.pinia),c=["uv","cyd","nc"],d=["urdf"],r=["obj","stl"],T=[...c,...d,...r],f=t=>{if(!C())throw new Error("不是三维系统");P.setData(t)},y=()=>P.getData(),C=()=>g.value==="three",l=t=>S.getFileExtension(t),m=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)},p=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 d==null?void 0:d.includes(o)},B=t=>C()&&m(t),n=t=>({url:t,extension:l(t)});return{getData:y,setData:f,isThreeSystem:C,isUrdf:_,isGeneralFile:E,isTrackPathFile:p,isThreeFile:m,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 V={class:"three-platform mv-inline"},A={class:"top-menu"},M={key:4,class:"loading"},H=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-DqdT1Ddr.cjs"))),P=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threePreview-DVU8LB-6.cjs"))),c=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeTrackPathView-DAoYI7KH.cjs"))),d=e.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./threeSceneViewForCPMPIP-ra01ZlH4.cjs"))),r=v,T=b.useMenuState(h.pinia),{platName:f}=h.storeToRefs(T),{isUrdf:y,isTrackPathFile:C}=O(),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})}),m=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}),p=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(m.value)?i.CPMPIP_SCENE:(f==null?void 0:f.value)===S.platNameConstants.ROBOT&&y(m.value)?i.ROBOT_SCENE:C(m.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",V,[e.createElementVNode("div",A,[e.renderSlot(n.$slots,"top-menu",{},void 0,!0)]),p.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"])):p.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"])):p.value===e.unref(i).CPMPIP_SCENE?(e.openBlock(),e.createBlock(e.unref(d),{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"])):p.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",M," 文件下载中,请稍候... ")):e.createCommentVNode("",!0)]))}}),D=F._export_sfc(H,[["__scopeId","data-v-9798f55b"]]),$=Object.freeze(Object.defineProperty({__proto__:null,default:D},Symbol.toStringTag,{value:"Module"}));exports.ThreeViewerHost=D;exports.robotMode=R;exports.sceneType=N;exports.threeViewerHost=$;exports.useThreeState=I;exports.useThreeSystem=O;
|