ss-component-new 1.2.97 → 1.2.99
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-B4z0XNO-.js +304 -0
- package/dist/MTLLoader-n_3HPhif.cjs +2 -0
- package/dist/OBJLoader-C_JaUegI.cjs +5 -0
- package/dist/OBJLoader-Dilcv9TL.js +356 -0
- package/dist/{OrbitControls-B85G8nPk.cjs → OrbitControls-8LBwRzcq.cjs} +1 -1
- package/dist/{OrbitControls-DFhYzlF3.js → OrbitControls-Cz47Q27N.js} +1 -1
- package/dist/{animationData-DfKVkFbz.js → animationData-C8lM4zZj.js} +1 -1
- package/dist/{animationData-DxBvEqB1.cjs → animationData-CKcPDmLp.cjs} +1 -1
- package/dist/{iconfont-C7kE-QbU.cjs → iconfont-B1cUqs_N.cjs} +1 -1
- package/dist/{iconfont-WOKNi2xx.js → iconfont-CUWS5tNH.js} +2 -2
- package/dist/{index-D0hovh9R.cjs → index-2hqZ_tND.cjs} +1 -1
- package/dist/{index-331j518H.cjs → index-AuEh0RiU.cjs} +1 -1
- package/dist/{index-D_igus4A.cjs → index-B2UPNwqJ.cjs} +1 -1
- package/dist/{index-BYk9Fb6p.js → index-BCvmfE-Q.js} +3 -3
- package/dist/{index-DeOwZgqL.js → index-BDw8DIQx.js} +130 -130
- package/dist/{index-CqI3frdZ.js → index-BPv8txj6.js} +6 -6
- package/dist/{index-DgZVeYqH.js → index-BQaejVqo.js} +1 -1
- package/dist/{index-DSPjcpWK.cjs → index-Ba16ouw0.cjs} +1 -1
- package/dist/{index-D_RGoDln.js → index-BaSO3EEl.js} +3 -3
- package/dist/{index-DHZMd8iK.cjs → index-BdSiNUC0.cjs} +1 -1
- package/dist/{index-BDxPlbe2.cjs → index-BfU8GMj1.cjs} +1 -1
- package/dist/{index-Cppt0AsF.cjs → index-BjKKDSDx.cjs} +1 -1
- package/dist/{index-C-dlFxRJ.cjs → index-BqgfejIC.cjs} +1 -1
- package/dist/{index-BODyH6MD.js → index-BxONUPjM.js} +1 -1
- package/dist/{index-BFzMf0GC.js → index-Byp3gJNW.js} +1 -1
- package/dist/{index-DJ6qg2Mo.js → index-C7ZsHeLt.js} +3 -3
- package/dist/{index-B-AhHUV1.js → index-C9p_wwJ7.js} +6 -6
- package/dist/{index-BoTiP0aV.js → index-CKlt750z.js} +1 -1
- package/dist/{index-CQRJ3pLh.cjs → index-CQwDw3-2.cjs} +1 -1
- package/dist/{index-hhS08X8b.js → index-CR1Ng5ip.js} +3 -3
- package/dist/{index-D6u590uA.cjs → index-CZIqVNof.cjs} +1 -1
- package/dist/{index-iErxMZBi.cjs → index-C_208RkZ.cjs} +1 -1
- package/dist/{index-S1LIIzCa.cjs → index-CqZ1E-Mt.cjs} +1 -1
- package/dist/{index-DHjtOySN.js → index-CrNsPd4D.js} +2 -2
- package/dist/{index-DrzK0O_g.cjs → index-CvQCAGWI.cjs} +1 -1
- package/dist/{index-Cnk_4Zz5.cjs → index-CyCcPnZb.cjs} +1 -1
- package/dist/{index-BI7g3c_u.js → index-CyE5qCBb.js} +13 -13
- package/dist/{index-DHBoRe9V.cjs → index-D32pAhQk.cjs} +1 -1
- package/dist/{index-DRfVnLTN.js → index-DAUjjqaD.js} +391 -391
- package/dist/{index-DbDM-XfB.cjs → index-DQTlc6Gq.cjs} +1 -1
- package/dist/{index-B_zjoT4m.js → index-DTilOAv_.js} +2 -2
- package/dist/{index-_PP-dSm3.cjs → index-D_22J0ok.cjs} +1 -1
- package/dist/{index-iZ9BRKg5.js → index-DboUMA_C.js} +1 -1
- package/dist/{index-BXv3aZ7v.js → index-DgMQpO6g.js} +1 -1
- package/dist/{index-CPAXrzNY.cjs → index-Dh6GqpZF.cjs} +1 -1
- package/dist/{index-CZPnP0uy.cjs → index-DhqEoDPT.cjs} +1 -1
- package/dist/{index-CeGM8aBH.js → index-DlwlGkyt.js} +2 -2
- package/dist/{index-6sZXjGGz.cjs → index-DtDmxPdD.cjs} +1 -1
- package/dist/{index-kLDMroPk.js → index-GxmJC9kr.js} +1 -1
- package/dist/{index-CLOUp_4j.cjs → index-XKn5AuYT.cjs} +1 -1
- package/dist/{index-Cr5if46q.js → index-mEKMjplD.js} +1 -1
- package/dist/{index-Bhha7SY3.js → index-vglZ0qjT.js} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DSlAeFA3.cjs → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DKwCF412.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-ERjMISIK.js → index.vue_vue_type_style_index_0_scoped_0b6f1a18_lang-DqIuWlps.js} +6 -6
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-3GcG1eTD.js → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CICG8Qah.js} +8908 -8949
- package/dist/{index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-Dzyqt2Z-.cjs → index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-K6lh7Rrj.cjs} +302 -302
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-mJB_yl_P.js → index.vue_vue_type_style_index_0_scoped_92477073_lang-Cpyo5jke.js} +3 -3
- package/dist/{index.vue_vue_type_style_index_0_scoped_92477073_lang-DODc2KPN.cjs → index.vue_vue_type_style_index_0_scoped_92477073_lang-Cq8VF9uK.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_1_lang-BH0DRFVE.js → index.vue_vue_type_style_index_1_lang-B_HCEX9y.js} +6 -5
- package/dist/{index.vue_vue_type_style_index_1_lang-BRFs_L5R.cjs → index.vue_vue_type_style_index_1_lang-rTLLuvuo.cjs} +5 -5
- package/dist/loaderUtil-B0djdt91.js +5 -0
- package/dist/loaderUtil-CaWWb8db.cjs +1 -0
- package/dist/{main-Z5UMyCj6.js → main-DHx-3OSy.js} +2 -2
- package/dist/{main-B541MQH8.cjs → main-DS156sQ4.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +9 -9
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +10 -10
- package/dist/{threeModel-tKq0hvaK.cjs → threeModel-CfIK1rQB.cjs} +1 -1
- package/dist/{threeModel-BcjGbIJZ.js → threeModel-WYCdw_Ff.js} +4 -4
- package/dist/{threePreview-BnPMGQ2H.js → threePreview-C29AR7Mr.js} +310 -305
- package/dist/threePreview-Ci8TnUQ8.cjs +1 -0
- package/dist/{threeSceneView-DVUTlm6F.cjs → threeSceneView-C2MDCMux.cjs} +2 -2
- package/dist/{threeSceneView-BUD002PP.js → threeSceneView-F15mW1mm.js} +7 -7
- package/dist/threeSceneViewForCPMPIP-DK4G_ZpP.js +687 -0
- package/dist/threeSceneViewForCPMPIP-DuPZn_qv.cjs +5 -0
- package/dist/threeTrackPathView-C4eBUMef.cjs +370 -0
- package/dist/{threeTrackPathView-DDCEu3Gx.js → threeTrackPathView-DMj6YGxT.js} +436 -427
- package/dist/{threeViewerHost-BVeUteVd.js → threeViewerHost-C9ipsMff.js} +2 -2
- package/dist/{threeViewerHost-Sda_AoRw.cjs → threeViewerHost-CW6JmOUJ.cjs} +2 -2
- package/dist/{urdfTree-Br9VYqKp.cjs → urdfTree-CTiMB7ge.cjs} +1 -1
- package/dist/{urdfTree-DaWvX-6R.js → urdfTree-DGEACy9-.js} +1 -1
- package/dist/{workpieceTreePanel-BdRaFNRp.js → workpieceTreePanel-C1gy5a8r.js} +53 -52
- package/dist/workpieceTreePanel-Ded0Gqke.cjs +1 -0
- package/package.json +1 -1
- package/dist/MTLLoader-DnouUI-8.js +0 -657
- package/dist/MTLLoader-zZDM0NQh.cjs +0 -6
- package/dist/obj/model.mtl +0 -42
- package/dist/obj/model.obj +0 -26110
- package/dist/threePreview-DD0br2ae.cjs +0 -1
- package/dist/threeSceneViewForCPMPIP-BYYbyqD7.cjs +0 -5
- package/dist/threeSceneViewForCPMPIP-D4RC4BAo.js +0 -683
- package/dist/threeTrackPathView-BvUihuyk.cjs +0 -370
- package/dist/workpieceTreePanel-Z3aVdOWB.cjs +0 -1
- package/public/obj/model.mtl +0 -42
- package/public/obj/model.obj +0 -26110
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
var ce = Object.defineProperty;
|
|
2
2
|
var de = (b, l, o) => l in b ? ce(b, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : b[l] = o;
|
|
3
3
|
var E = (b, l, o) => de(b, typeof l != "symbol" ? l + "" : l, o);
|
|
4
|
-
import { U as me } from "./index.vue_vue_type_style_index_1_lang-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { U as me } from "./index.vue_vue_type_style_index_1_lang-B_HCEX9y.js";
|
|
5
|
+
import { O as ve } from "./OBJLoader-Dilcv9TL.js";
|
|
6
|
+
import { S as pe, M as fe } from "./MTLLoader-B4z0XNO-.js";
|
|
7
|
+
import { f as re, h as F } from "./threeViewerHost-C9ipsMff.js";
|
|
8
|
+
import { aZ as be, u as J, o as we, k as he, B as _e, a_ as ge, Y as ye, V as Le } from "./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-CICG8Qah.js";
|
|
9
|
+
import { ref as T, defineComponent as je, computed as O, watch as ue, resolveComponent as x, createElementBlock as k, openBlock as P, createVNode as S, createElementVNode as c, withCtx as $, createTextVNode as D, toDisplayString as C } from "vue";
|
|
10
|
+
import { c as Re, e as Se, g as Ue } from "./iconfont-CUWS5tNH.js";
|
|
11
|
+
import { _ as Ce } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
12
|
+
const Me = "http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";
|
|
13
|
+
function Oe(b) {
|
|
14
|
+
const { mtlUrl: l, manager: o, resourcePath: s, onLoad: m, onProgress: i, onError: h } = b, v = new fe(o);
|
|
14
15
|
return s && v.setResourcePath(s), v.load(l, m, i, h), v;
|
|
15
16
|
}
|
|
16
|
-
function
|
|
17
|
-
const { objUrl: l, manager: o, materials: s, onLoad: m, onProgress: i, onError: h } = b, v = new
|
|
17
|
+
function $e(b) {
|
|
18
|
+
const { objUrl: l, manager: o, materials: s, onLoad: m, onProgress: i, onError: h } = b, v = new ve(o);
|
|
18
19
|
return s && v.setMaterials(s), v.load(l, m, i, h), v;
|
|
19
20
|
}
|
|
20
21
|
function De(b) {
|
|
@@ -38,7 +39,7 @@ function De(b) {
|
|
|
38
39
|
var u;
|
|
39
40
|
return (((u = i.split("/").pop()) == null ? void 0 : u.split("?")[0].split("#")[0]) ?? "").replace(/\.[^/.?#]+$/, "");
|
|
40
41
|
})(), f = `${_}${r}.mtl`, g = (n) => {
|
|
41
|
-
|
|
42
|
+
$e({
|
|
42
43
|
objUrl: i,
|
|
43
44
|
manager: h,
|
|
44
45
|
materials: n,
|
|
@@ -49,7 +50,7 @@ function De(b) {
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
+
Oe({
|
|
53
54
|
mtlUrl: f,
|
|
54
55
|
manager: h,
|
|
55
56
|
resourcePath: _,
|
|
@@ -68,7 +69,7 @@ function De(b) {
|
|
|
68
69
|
break;
|
|
69
70
|
}
|
|
70
71
|
case "stl": {
|
|
71
|
-
new
|
|
72
|
+
new pe(h).load(
|
|
72
73
|
i,
|
|
73
74
|
(r) => {
|
|
74
75
|
const f = new we({ color: 12303291, shininess: 30 }), g = new he(r, f);
|
|
@@ -86,7 +87,7 @@ function De(b) {
|
|
|
86
87
|
}
|
|
87
88
|
}, m;
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
+
function po(b, l, o, s) {
|
|
90
91
|
return { loadSceneFromFile: (i) => new Promise((h, v) => {
|
|
91
92
|
o.value = !0, s.value = "正在初始化 URDF 加载器...";
|
|
92
93
|
let L = 0, _ = 0, r = null;
|
|
@@ -121,7 +122,7 @@ function vo(b, l, o, s) {
|
|
|
121
122
|
const n = URL.createObjectURL(i);
|
|
122
123
|
De({
|
|
123
124
|
manager: f,
|
|
124
|
-
baseFolderUrl:
|
|
125
|
+
baseFolderUrl: Me,
|
|
125
126
|
onFileProgress: g
|
|
126
127
|
}).load(
|
|
127
128
|
n,
|
|
@@ -138,7 +139,7 @@ function vo(b, l, o, s) {
|
|
|
138
139
|
}
|
|
139
140
|
}) };
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function fo(b, l, o, s = ["URDFVisual"]) {
|
|
142
143
|
let m = null;
|
|
143
144
|
const i = T(null), h = new ge(), v = new ye(), L = /* @__PURE__ */ new Map();
|
|
144
145
|
function _() {
|
|
@@ -206,14 +207,14 @@ function po(b, l, o, s = ["URDFVisual"]) {
|
|
|
206
207
|
updateRotation: U
|
|
207
208
|
};
|
|
208
209
|
}
|
|
209
|
-
const
|
|
210
|
+
const bo = {
|
|
210
211
|
SINGLE: "单机",
|
|
211
212
|
DOUBLE: "双机"
|
|
212
|
-
},
|
|
213
|
+
}, wo = {
|
|
213
214
|
ROBOT: 1,
|
|
214
215
|
PIPECOMPARSION: 2
|
|
215
216
|
};
|
|
216
|
-
class
|
|
217
|
+
class ho {
|
|
217
218
|
constructor(l) {
|
|
218
219
|
E(this, "robot");
|
|
219
220
|
E(this, "movableJoints");
|
|
@@ -315,7 +316,7 @@ class wo {
|
|
|
315
316
|
const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
316
317
|
key: 0,
|
|
317
318
|
class: "obj-base"
|
|
318
|
-
}, xe = ["title"], ke = ["title"], Pe = { key: 1 }, Te = { class: "obj-position" }, Ve = { class: "coord-item" }, ze = { class: "coord-item" }, Ie = { class: "coord-item" }, Ae = { class: "obj-rotation" }, Be = { class: "coord-item" }, Ne = { class: "coord-item" }, We = { class: "coord-item" }, Ye = { class: "world" },
|
|
319
|
+
}, xe = ["title"], ke = ["title"], Pe = { key: 1 }, Te = { class: "obj-position" }, Ve = { class: "coord-item" }, ze = { class: "coord-item" }, Ie = { class: "coord-item" }, Ae = { class: "obj-rotation" }, Be = { class: "coord-item" }, Ne = { class: "coord-item" }, We = { class: "coord-item" }, Ye = { class: "world" }, Ze = { class: "coord-line" }, qe = { class: "coord-text" }, Xe = { class: "world-position-item" }, Ge = { class: "world-position-item" }, Ke = { class: "world-position-item" }, He = { class: "coord-line" }, Qe = { class: "coord-text" }, eo = { class: "world-rotation-item" }, oo = { class: "world-rotation-item" }, to = { class: "world-rotation-item" }, so = /* @__PURE__ */ je({
|
|
319
320
|
__name: "workpieceTreePanel",
|
|
320
321
|
props: {
|
|
321
322
|
model: {},
|
|
@@ -366,12 +367,12 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
366
367
|
return e.forEach((a) => {
|
|
367
368
|
if (a.children && a.children.length > 0) {
|
|
368
369
|
w.push(a.id);
|
|
369
|
-
const j = a.children.filter((
|
|
370
|
+
const j = a.children.filter((M) => M.children && M.children.length > 0).slice(0, t).map((M) => M.id);
|
|
370
371
|
w.push(...j);
|
|
371
372
|
}
|
|
372
373
|
}), w.slice(0, t + 1);
|
|
373
374
|
};
|
|
374
|
-
|
|
375
|
+
O(() => !m.value || m.value.length === 0 ? [] : o.expandStrategy === "firstLevel" ? _(m.value, o.maxExpandCount) : L(m.value, o.maxExpandCount));
|
|
375
376
|
const r = (e) => e ? parseFloat(e.toFixed(3)) : 0, f = (e) => e ? parseFloat(e.toFixed(1)) : 0, g = (e, t) => {
|
|
376
377
|
s("updatePosition", {
|
|
377
378
|
obj: o.model,
|
|
@@ -386,13 +387,13 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
386
387
|
});
|
|
387
388
|
}, u = (e) => {
|
|
388
389
|
s("visibleChange", e);
|
|
389
|
-
}, y =
|
|
390
|
+
}, y = O(() => o != null && o.model ? v(o.model) : []), U = O(() => {
|
|
390
391
|
var e, t;
|
|
391
392
|
return ((e = o == null ? void 0 : o.model) == null ? void 0 : e.name) || ((t = o == null ? void 0 : o.model) == null ? void 0 : t.type);
|
|
392
|
-
}), p =
|
|
393
|
+
}), p = O(() => {
|
|
393
394
|
var e;
|
|
394
395
|
return (e = o == null ? void 0 : o.model) == null ? void 0 : e.type;
|
|
395
|
-
}), d =
|
|
396
|
+
}), d = O(() => {
|
|
396
397
|
var e;
|
|
397
398
|
return (e = o == null ? void 0 : o.model) == null ? void 0 : e.visible;
|
|
398
399
|
});
|
|
@@ -408,11 +409,11 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
408
409
|
},
|
|
409
410
|
{ immediate: !0 }
|
|
410
411
|
), (e, t) => {
|
|
411
|
-
var
|
|
412
|
+
var M, V, z, I, A, B, N, W, Y, Z, q, X, G, K, H, Q, ee, oe, te, se, ie, le, ae, ne;
|
|
412
413
|
const w = x("el-divider"), a = x("el-switch"), j = x("el-input-number");
|
|
413
414
|
return P(), k("div", Ee, [
|
|
414
415
|
S(w, null, {
|
|
415
|
-
default:
|
|
416
|
+
default: $(() => t[6] || (t[6] = [
|
|
416
417
|
D("对象")
|
|
417
418
|
])),
|
|
418
419
|
_: 1,
|
|
@@ -423,11 +424,11 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
423
424
|
c("div", {
|
|
424
425
|
class: "obj-name",
|
|
425
426
|
title: U.value
|
|
426
|
-
},
|
|
427
|
+
}, C(U.value), 9, xe),
|
|
427
428
|
c("div", {
|
|
428
429
|
class: "obj-type",
|
|
429
430
|
title: p.value
|
|
430
|
-
}, "[" +
|
|
431
|
+
}, "[" + C(p.value) + "]", 9, ke)
|
|
431
432
|
])) : (P(), k("div", Pe, "空")),
|
|
432
433
|
S(a, {
|
|
433
434
|
"model-value": d.value,
|
|
@@ -435,7 +436,7 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
435
436
|
}, null, 8, ["model-value"])
|
|
436
437
|
]),
|
|
437
438
|
S(w, null, {
|
|
438
|
-
default:
|
|
439
|
+
default: $(() => t[7] || (t[7] = [
|
|
439
440
|
D("相对位置")
|
|
440
441
|
])),
|
|
441
442
|
_: 1,
|
|
@@ -445,7 +446,7 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
445
446
|
c("div", Ve, [
|
|
446
447
|
t[8] || (t[8] = c("span", { class: "axis-label" }, "X", -1)),
|
|
447
448
|
S(j, {
|
|
448
|
-
"model-value": r((V = (
|
|
449
|
+
"model-value": r((V = (M = i.value) == null ? void 0 : M.position) == null ? void 0 : V.x),
|
|
449
450
|
onChange: t[0] || (t[0] = (R) => g(R, "x")),
|
|
450
451
|
size: "small",
|
|
451
452
|
class: "coord-input-compact",
|
|
@@ -483,7 +484,7 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
483
484
|
])
|
|
484
485
|
]),
|
|
485
486
|
S(w, null, {
|
|
486
|
-
default:
|
|
487
|
+
default: $(() => t[11] || (t[11] = [
|
|
487
488
|
D("相对旋转")
|
|
488
489
|
])),
|
|
489
490
|
_: 1,
|
|
@@ -506,7 +507,7 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
506
507
|
c("div", Ne, [
|
|
507
508
|
t[13] || (t[13] = c("span", { class: "axis-label" }, "Y°", -1)),
|
|
508
509
|
S(j, {
|
|
509
|
-
"model-value": f((
|
|
510
|
+
"model-value": f((Z = (Y = i.value) == null ? void 0 : Y.rotation) == null ? void 0 : Z.y),
|
|
510
511
|
onChange: t[4] || (t[4] = (R) => n(R, "y")),
|
|
511
512
|
size: "small",
|
|
512
513
|
class: "coord-input-compact",
|
|
@@ -519,7 +520,7 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
519
520
|
c("div", We, [
|
|
520
521
|
t[14] || (t[14] = c("span", { class: "axis-label" }, "Z°", -1)),
|
|
521
522
|
S(j, {
|
|
522
|
-
"model-value": f((
|
|
523
|
+
"model-value": f((X = (q = i.value) == null ? void 0 : q.rotation) == null ? void 0 : X.z),
|
|
523
524
|
onChange: t[5] || (t[5] = (R) => n(R, "z")),
|
|
524
525
|
size: "small",
|
|
525
526
|
class: "coord-input-compact",
|
|
@@ -531,39 +532,39 @@ const Ee = { class: "panel-content" }, Fe = { class: "obj" }, Je = {
|
|
|
531
532
|
])
|
|
532
533
|
]),
|
|
533
534
|
S(w, null, {
|
|
534
|
-
default:
|
|
535
|
+
default: $(() => t[15] || (t[15] = [
|
|
535
536
|
D("世界信息")
|
|
536
537
|
])),
|
|
537
538
|
_: 1,
|
|
538
539
|
__: [15]
|
|
539
540
|
}),
|
|
540
541
|
c("div", Ye, [
|
|
541
|
-
c("div",
|
|
542
|
+
c("div", Ze, [
|
|
542
543
|
t[16] || (t[16] = c("span", { class: "coord-label" }, "世界位置:", -1)),
|
|
543
|
-
c("span",
|
|
544
|
-
c("div",
|
|
545
|
-
c("div", Ge,
|
|
546
|
-
c("div", Ke,
|
|
544
|
+
c("span", qe, [
|
|
545
|
+
c("div", Xe, C(r((K = (G = i.value) == null ? void 0 : G.worldPosition) == null ? void 0 : K.x)) + ", ", 1),
|
|
546
|
+
c("div", Ge, C(r((Q = (H = i.value) == null ? void 0 : H.worldPosition) == null ? void 0 : Q.y)) + ", ", 1),
|
|
547
|
+
c("div", Ke, C(r((oe = (ee = i.value) == null ? void 0 : ee.worldPosition) == null ? void 0 : oe.z)), 1)
|
|
547
548
|
])
|
|
548
549
|
]),
|
|
549
550
|
c("div", He, [
|
|
550
551
|
t[17] || (t[17] = c("span", { class: "coord-label" }, "世界旋转:", -1)),
|
|
551
552
|
c("span", Qe, [
|
|
552
|
-
c("div", eo,
|
|
553
|
-
c("div", oo,
|
|
554
|
-
c("div", to,
|
|
553
|
+
c("div", eo, C(f((se = (te = i.value) == null ? void 0 : te.worldRotation) == null ? void 0 : se.x)) + "°, ", 1),
|
|
554
|
+
c("div", oo, C(f((le = (ie = i.value) == null ? void 0 : ie.worldRotation) == null ? void 0 : le.y)) + "°, ", 1),
|
|
555
|
+
c("div", to, C(f((ne = (ae = i.value) == null ? void 0 : ae.worldRotation) == null ? void 0 : ne.z)) + "° ", 1)
|
|
555
556
|
])
|
|
556
557
|
])
|
|
557
558
|
])
|
|
558
559
|
]);
|
|
559
560
|
};
|
|
560
561
|
}
|
|
561
|
-
}),
|
|
562
|
+
}), _o = /* @__PURE__ */ Ce(so, [["__scopeId", "data-v-00d48931"]]);
|
|
562
563
|
export {
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
564
|
+
ho as U,
|
|
565
|
+
_o as W,
|
|
566
|
+
po as a,
|
|
567
|
+
bo as r,
|
|
568
|
+
wo as s,
|
|
569
|
+
fo as u
|
|
569
570
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var te=Object.defineProperty;var oe=(b,n,o)=>n in b?te(b,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):b[n]=o;var j=(b,n,o)=>oe(b,typeof n!="symbol"?n+"":n,o);const se=require("./index.vue_vue_type_style_index_1_lang-rTLLuvuo.cjs"),le=require("./OBJLoader-C_JaUegI.cjs"),ee=require("./MTLLoader-n_3HPhif.cjs"),C=require("./threeViewerHost-CW6JmOUJ.cjs"),R=require("./index.vue_vue_type_style_index_0_scoped_0f027c8c_lang-K6lh7Rrj.cjs"),e=require("vue"),D=require("./iconfont-B1cUqs_N.cjs"),re=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ne="http://222.92.178.198:60000/chfs/shared/Insofrobot/urdf";function ie(b){const{mtlUrl:n,manager:o,resourcePath:l,onLoad:m,onProgress:r,onError:w}=b,p=new ee.MTLLoader(o);return l&&p.setResourcePath(l),p.load(n,m,r,w),p}function ae(b){const{objUrl:n,manager:o,materials:l,onLoad:m,onProgress:r,onError:w}=b,p=new le.OBJLoader(o);return l&&p.setMaterials(l),p.load(n,m,r,w),p}function ce(b){const{manager:n,baseFolderUrl:o,onFileProgress:l}=b,m=new se.URDFLoader(n);return m.packages=r=>`${o.endsWith("/")?o:o+"/"}${r}/`,m.loadMeshCb=(r,w,p)=>{const g=(()=>{const E=r.split("?")[0].split("#")[0],c=E.lastIndexOf(".");return c>=0?E.slice(c+1).toLowerCase():void 0})();switch(g){case"obj":{const E=(()=>{try{return new URL(".",r).toString()}catch{const a=r.lastIndexOf("/");return a>=0?r.slice(0,a+1):r}})(),c=(()=>{var d;return(((d=r.split("/").pop())==null?void 0:d.split("?")[0].split("#")[0])??"").replace(/\.[^/.?#]+$/,"")})(),f=`${E}${c}.mtl`,h=a=>{ae({objUrl:r,manager:w,materials:a,onLoad:d=>p(d),onProgress:d=>l==null?void 0:l(r,d==null?void 0:d.loaded,d==null?void 0:d.total),onError:d=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 OBJ 模型: ${r}`,d),p(new R.Group)}})};ie({mtlUrl:f,manager:w,resourcePath:E,onLoad:a=>{try{a.preload()}catch{}h(a)},onProgress:a=>l==null?void 0:l(f,a==null?void 0:a.loaded,a==null?void 0:a.total),onError:a=>{console.warn(`[URDF 资源警告] 未找到或加载材质失败: ${f}。将尝试无材质加载。`),h(void 0)}});break}case"stl":{new ee.STLLoader(w).load(r,c=>{const f=new R.MeshPhongMaterial({color:12303291,shininess:30}),h=new R.Mesh(c,f);h.castShadow=!0,h.receiveShadow=!0,p(h)},c=>l==null?void 0:l(r,c==null?void 0:c.loaded,c==null?void 0:c.total),c=>{console.error(`[URDF 资源加载失败,已跳过] 无法加载 STL 模型: ${r}`,c),p(new R.Group)});break}default:console.error(`[URDF 资源加载失败,已跳过] 不支持的网格格式: .${g} (路径: ${r})`),p(new R.Group)}},m}function de(b,n,o,l){return{loadSceneFromFile:r=>new Promise((w,p)=>{o.value=!0,l.value="正在初始化 URDF 加载器...";let g=0,E=0,c=null;const f=new R.LoadingManager;f.onStart=(a,d,V)=>{g=V||0,E=d||0,l.value=g>0?`开始下载资源: 0 / ${g}`:"开始下载资源...",o.value=!0},f.onProgress=(a,d,V)=>{E=d,g=V;const L=`正在加载 ${d} / ${V} 个文件: ${C.getFilenameFromUrl(a)}`;l.value=L,d===V&&(l.value="资源加载完成,正在处理模型...",setTimeout(()=>{if(c){c.updateMatrixWorld(!0);const v=new R.Box3().setFromObject(c);v.isEmpty()&&console.warn("模型加载完成,但所有可视化网格均加载失败,模型将不可见。"),c.userData.boundingBox=v,c.traverse(u=>{u.isMesh&&(u.castShadow=!0,u.receiveShadow=!0)}),w(c)}else p(new Error("URDF 文件本身加载失败。"));l.value="模型加载完成",setTimeout(()=>{l.value==="模型加载完成"&&(o.value=!1,l.value="")},500)},100))},f.onError=a=>{console.warn(`LoadingManager 报告一个资源加载失败: ${a}。加载流程将继续。`)};const h=(a,d,V)=>{const L=C.getFilenameFromUrl(a);let v;V&&V>0?v=`${L}(${C.formatBytes(d)} / ${C.formatBytes(V)})`:d&&d>0?v=`${L}(已下载 ${C.formatBytes(d)})`:v=`${L}`,l.value=`正在下载第 ${E+1} / ${g} 个文件: ${v}`};try{const a=URL.createObjectURL(r);ce({manager:f,baseFolderUrl:ne,onFileProgress:h}).load(a,V=>{c=V},void 0,V=>{console.error(`加载 URDF 文件 (${r.name}) 时发生致命错误:`,V),l.value="URDF 文件解析失败",o.value=!1,p(new Error(`加载 URDF 文件失败: ${r.name}`))})}catch(a){console.error("初始化 URDF 加载时发生致命错误:",a),l.value="模型加载失败",o.value=!1,p(a)}})}}function ue(b,n,o,l=["URDFVisual"]){let m=null;const r=e.ref(null),w=new R.Raycaster,p=new R.Vector2,g=new Map;function E(){o.value.forEach(v=>{v.traverse(u=>{l!=null&&l.includes(u.type)&&g.set(u.id,{obj:u,axis:u.axis||new R.Vector3(1,0,0),limits:u.limits})})})}function c(v){r.value&&r.value.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(0))}),r.value=v,v.obj.traverse(u=>{var t;u.material&&((t=u.material.emissive)==null||t.set(65280))})}function f(v){const u=b.value.getBoundingClientRect();p.x=(v.clientX-u.left)/u.width*2-1,p.y=-((v.clientY-u.top)/u.height)*2+1,w.setFromCamera(p,m);const t=w.intersectObjects(o.value,!0);if(t.length===0)return;let s=t[0].object,_=null;for(;s;){if(g.has(s.id)){_=g.get(s.id);break}s=s.parent}_&&c(_)}function h(){b.value&&b.value.removeEventListener("click",f,!1)}function a(){const{scene:v,camera:u}=n();m=u,E(),b.value&&b.value.addEventListener("click",f,!1)}function d(v){r.value&&(r.value.obj.visible=v)}function V(v){var s;const{axis:u,value:t}=v;D.updateObjectPosition((s=r.value)==null?void 0:s.obj,u,t)}function L(v){var s;const{axis:u,value:t}=v;D.updateObjectRotation((s=r.value)==null?void 0:s.obj,u,t)}return{initRaycaster:a,dispose:h,selectedObject3D:r,setSelectedObjVisible:d,updatePosition:V,updateRotation:L}}const me={SINGLE:"单机",DOUBLE:"双机"},pe={ROBOT:1,PIPECOMPARSION:2};class ve{constructor(n){j(this,"robot");j(this,"movableJoints");this.robot=n,this.movableJoints=this.getMovableJoints()}getMovableJoints(){return Object.values(this.robot.joints).filter(n=>n.jointType!=="fixed")}getMovableJointNames(){return this.movableJoints.map(n=>n.name)}setJointAngle(n,o){const l=this.robot.joints[n];if(!l||l.jointType==="fixed")return console.warn(`关节 ${n} 不存在或不可动`),!1;if(l.limit){const m=Math.max(l.limit.lower,Math.min(l.limit.upper,o));m!==o&&console.warn(`关节 ${n} 角度被限制在 [${l.limit.lower}, ${l.limit.upper}]`),l.setJointValue(m)}else l.setJointValue(o);return!0}setJointAngles(n){Object.entries(n).forEach(([o,l])=>{typeof l=="number"&&!isNaN(l)&&this.setJointAngle(o,l)})}getCurrentJointStates(){const n={};return this.movableJoints.forEach(o=>{n[o.name]=o.angle||0}),n}resetToZero(){this.movableJoints.forEach(n=>{n.setJointValue(0)})}getJointLimits(n){const o=this.robot.joints[n];return!o||!o.limit?null:{lower:o.limit.lower,upper:o.limit.upper}}async animateToState(n,o=1e3,l){const m=this.getCurrentJointStates(),r=Date.now();return new Promise(w=>{const p=()=>{const g=Date.now()-r,E=Math.min(g/o,1),c=this.easeInOutCubic(E),f={};Object.keys(n).forEach(h=>{const a=m[h]||0,d=n[h];f[h]=a+(d-a)*c}),this.setJointAngles(f),l&&l(E),E<1?requestAnimationFrame(p):w()};p()})}easeInOutCubic(n){return n<.5?4*n*n*n:1-Math.pow(-2*n+2,3)/2}async playSequence(n,o=1e3,l){for(let m=0;m<n.length;m++)await this.animateToState(n[m],o,r=>{l&&l(m,r)})}}const fe={class:"panel-content"},be={class:"obj"},_e={key:0,class:"obj-base"},we=["title"],Ee=["title"],he={key:1},Ve={class:"obj-position"},ge={class:"coord-item"},ye={class:"coord-item"},Ne={class:"coord-item"},Le={class:"obj-rotation"},Re={class:"coord-item"},Se={class:"coord-item"},Ce={class:"coord-item"},je={class:"world"},De={class:"coord-line"},Ue={class:"coord-text"},Me={class:"world-position-item"},Fe={class:"world-position-item"},Oe={class:"world-position-item"},$e={class:"coord-line"},xe={class:"coord-text"},Je={class:"world-rotation-item"},Te={class:"world-rotation-item"},ke={class:"world-rotation-item"},Pe=e.defineComponent({__name:"workpieceTreePanel",props:{model:{},maxExpandCount:{default:10},expandStrategy:{default:"breadth"}},emits:["nodeClick","visibleChange","updatePosition","updateRotation"],setup(b,{emit:n}){const o=b,l=n,m=e.ref([]),r=e.ref({}),w=(t,s=0)=>{const _=[];return Array.isArray(t)&&(t==null?void 0:t.length)>0&&t.forEach(i=>{if(!(i!=null&&i.isMesh)){const y={name:i==null?void 0:i.name,label:(i==null?void 0:i.name)||(i==null?void 0:i.type),show:!0,level:s+1,isPenultimate:!1,type:i==null?void 0:i.type,id:i==null?void 0:i.id,limit:(i==null?void 0:i.limit)??"",children:w(i==null?void 0:i.children,s+1),path:i==null?void 0:i.name};_.push(y)}}),_},p=t=>t?[{name:t==null?void 0:t.name,label:(t==null?void 0:t.name)||(t==null?void 0:t.type),show:!0,level:1,isPenultimate:!1,type:t==null?void 0:t.type,id:t==null?void 0:t.id,limit:(t==null?void 0:t.limit)??"",children:w(t==null?void 0:t.children,1),path:t==null?void 0:t.name}]:[],g=(t,s)=>{const _=[],i=[...t];for(;i.length>0&&_.length<s;){const y=i.shift();y.children&&y.children.length>0&&(_.push(y.id),i.push(...y.children))}return _},E=(t,s)=>{const _=[];return t.forEach(i=>{if(i.children&&i.children.length>0){_.push(i.id);const y=i.children.filter(S=>S.children&&S.children.length>0).slice(0,s).map(S=>S.id);_.push(...y)}}),_.slice(0,s+1)};e.computed(()=>!m.value||m.value.length===0?[]:o.expandStrategy==="firstLevel"?E(m.value,o.maxExpandCount):g(m.value,o.maxExpandCount));const c=t=>t?parseFloat(t.toFixed(3)):0,f=t=>t?parseFloat(t.toFixed(1)):0,h=(t,s)=>{l("updatePosition",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},a=(t,s)=>{l("updateRotation",{obj:o.model,axis:s,value:(t==null?void 0:t.toString())||"0"})},d=t=>{l("visibleChange",t)},V=e.computed(()=>o!=null&&o.model?p(o.model):[]),L=e.computed(()=>{var t,s;return((t=o==null?void 0:o.model)==null?void 0:t.name)||((s=o==null?void 0:o.model)==null?void 0:s.type)}),v=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.type}),u=e.computed(()=>{var t;return(t=o==null?void 0:o.model)==null?void 0:t.visible});return e.watch(()=>o.model,()=>{o.model&&(r.value=D.getObject3DData(o.model))},{deep:!0,immediate:!0}),e.watch(V,t=>{m.value=JSON.parse(JSON.stringify(t))},{immediate:!0}),(t,s)=>{var S,U,M,F,O,$,x,J,T,k,P,B,z,I,q,A,W,G,X,Y,Z,H,K,Q;const _=e.resolveComponent("el-divider"),i=e.resolveComponent("el-switch"),y=e.resolveComponent("el-input-number");return e.openBlock(),e.createElementBlock("div",fe,[e.createVNode(_,null,{default:e.withCtx(()=>s[6]||(s[6]=[e.createTextVNode("对象")])),_:1,__:[6]}),e.createElementVNode("div",be,[o.model?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("div",{class:"obj-name",title:L.value},e.toDisplayString(L.value),9,we),e.createElementVNode("div",{class:"obj-type",title:v.value},"["+e.toDisplayString(v.value)+"]",9,Ee)])):(e.openBlock(),e.createElementBlock("div",he,"空")),e.createVNode(i,{"model-value":u.value,onChange:d},null,8,["model-value"])]),e.createVNode(_,null,{default:e.withCtx(()=>s[7]||(s[7]=[e.createTextVNode("相对位置")])),_:1,__:[7]}),e.createElementVNode("div",Ve,[e.createElementVNode("div",ge,[s[8]||(s[8]=e.createElementVNode("span",{class:"axis-label"},"X",-1)),e.createVNode(y,{"model-value":c((U=(S=r.value)==null?void 0:S.position)==null?void 0:U.x),onChange:s[0]||(s[0]=N=>h(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",ye,[s[9]||(s[9]=e.createElementVNode("span",{class:"axis-label"},"Y",-1)),e.createVNode(y,{"model-value":c((F=(M=r.value)==null?void 0:M.position)==null?void 0:F.y),onChange:s[1]||(s[1]=N=>h(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ne,[s[10]||(s[10]=e.createElementVNode("span",{class:"axis-label"},"Z",-1)),e.createVNode(y,{"model-value":c(($=(O=r.value)==null?void 0:O.position)==null?void 0:$.z),onChange:s[2]||(s[2]=N=>h(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[11]||(s[11]=[e.createTextVNode("相对旋转")])),_:1,__:[11]}),e.createElementVNode("div",Le,[e.createElementVNode("div",Re,[s[12]||(s[12]=e.createElementVNode("span",{class:"axis-label"},"X°",-1)),e.createVNode(y,{"model-value":f((J=(x=r.value)==null?void 0:x.rotation)==null?void 0:J.x),onChange:s[3]||(s[3]=N=>a(N,"x")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Se,[s[13]||(s[13]=e.createElementVNode("span",{class:"axis-label"},"Y°",-1)),e.createVNode(y,{"model-value":f((k=(T=r.value)==null?void 0:T.rotation)==null?void 0:k.y),onChange:s[4]||(s[4]=N=>a(N,"y")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])]),e.createElementVNode("div",Ce,[s[14]||(s[14]=e.createElementVNode("span",{class:"axis-label"},"Z°",-1)),e.createVNode(y,{"model-value":f((B=(P=r.value)==null?void 0:P.rotation)==null?void 0:B.z),onChange:s[5]||(s[5]=N=>a(N,"z")),size:"small",class:"coord-input-compact",precision:3,step:.1,controls:!0,"controls-position":"right"},null,8,["model-value"])])]),e.createVNode(_,null,{default:e.withCtx(()=>s[15]||(s[15]=[e.createTextVNode("世界信息")])),_:1,__:[15]}),e.createElementVNode("div",je,[e.createElementVNode("div",De,[s[16]||(s[16]=e.createElementVNode("span",{class:"coord-label"},"世界位置:",-1)),e.createElementVNode("span",Ue,[e.createElementVNode("div",Me,e.toDisplayString(c((I=(z=r.value)==null?void 0:z.worldPosition)==null?void 0:I.x))+", ",1),e.createElementVNode("div",Fe,e.toDisplayString(c((A=(q=r.value)==null?void 0:q.worldPosition)==null?void 0:A.y))+", ",1),e.createElementVNode("div",Oe,e.toDisplayString(c((G=(W=r.value)==null?void 0:W.worldPosition)==null?void 0:G.z)),1)])]),e.createElementVNode("div",$e,[s[17]||(s[17]=e.createElementVNode("span",{class:"coord-label"},"世界旋转:",-1)),e.createElementVNode("span",xe,[e.createElementVNode("div",Je,e.toDisplayString(f((Y=(X=r.value)==null?void 0:X.worldRotation)==null?void 0:Y.x))+"°, ",1),e.createElementVNode("div",Te,e.toDisplayString(f((H=(Z=r.value)==null?void 0:Z.worldRotation)==null?void 0:H.y))+"°, ",1),e.createElementVNode("div",ke,e.toDisplayString(f((Q=(K=r.value)==null?void 0:K.worldRotation)==null?void 0:Q.z))+"° ",1)])])])])}}}),Be=re._export_sfc(Pe,[["__scopeId","data-v-00d48931"]]);exports.URDFRobotController=ve;exports.WorkpieceTreePanel=Be;exports.robotMode=me;exports.sceneType=pe;exports.useRaycaster=ue;exports.useUrdfLoader=de;
|