ss-component-new 1.3.614 → 1.3.615
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/JSEncrypt-B36c1iN5.js +1983 -0
- package/dist/{MTLLoader-B6ottYFV.js → MTLLoader-BL2uYkTJ.js} +2 -2
- package/dist/{OrbitControls-BFVKU7s-.js → OrbitControls-Zyj23qrC.js} +1 -1
- package/dist/{URDFLoader-CH-7Pzmq.js → URDFLoader-CRx5L75v.js} +584 -589
- package/dist/{animationData-F0z3GN7j.js → animationData-CJQE6_nu.js} +3 -3
- package/dist/{array-DZZ1aQEC.js → array-CKTk7Sq_.js} +14 -13
- package/dist/{clone-MyfSNInd.js → clone-ESeDvnJv.js} +1 -1
- package/dist/{eleIcon-BoKZ_PzU.js → eleIcon-C7Pz9jha.js} +2 -2
- package/dist/{iconfont-BJYdStg5.js → iconfont-DZGSkx-_.js} +247 -396
- package/dist/{index-CbFYfzNE.js → index--FPbFJB2.js} +6 -6
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-BvtOLltL.js → index-B0M1YCUY.js} +7 -7
- package/dist/{index-aTEfnfYn.js → index-BA1kJZth.js} +40 -36
- package/dist/{index-CT1LWsrT.js → index-BBBCr4Oo.js} +2 -2
- package/dist/{index-dD-mKgue.js → index-BHtNKL1L.js} +2 -2
- package/dist/{index-CznUP1Ek.js → index-BJFXtH-X.js} +3 -3
- package/dist/{index-DcPtyCDm.js → index-BUqviBFi.js} +35 -29
- package/dist/{index-B2LYEScO.js → index-BXh02EAd.js} +4 -4
- package/dist/{index-CkO7j_i1.js → index-B_fRppeJ.js} +8 -8
- package/dist/index-BmaW6Me9.js +572 -0
- package/dist/{index-6qXeMn6b.js → index-BvkIoiVW.js} +3 -3
- package/dist/{index-DIVct0z6.js → index-C3pboX9W.js} +5 -5
- package/dist/{index-BkkvdZXm.js → index-CPW7tdrA.js} +20 -17
- package/dist/{index-CXqqIuf-.js → index-CTicGWoS.js} +3 -3
- package/dist/{index-BybrpYzx.js → index-CX8Apbo7.js} +1 -1
- package/dist/{index-DI44qg1B.js → index-Cn33Gz2z.js} +616 -587
- package/dist/{index-DmILGKv9.js → index-D1E8EPxn.js} +61 -57
- package/dist/{index-B8NQAdR4.js → index-D8UY4uNQ.js} +967 -966
- package/dist/{index-CYjsE5Gs.js → index-D9xMYIes.js} +3 -3
- package/dist/{index-C6H6VzYm.js → index-DAs4L0hx.js} +6436 -6878
- package/dist/{index-IT-HvgkV.js → index-Dd-8nw2f.js} +20 -18
- package/dist/{index-pMtaHLbt.js → index-DjSJhlad.js} +62 -60
- package/dist/{index-hg0CdgKe.js → index-DkumSU1-.js} +4 -4
- package/dist/{index-CvZcm-Tt.js → index-DlQXFCw8.js} +8 -7
- package/dist/{index-BvyM6d06.js → index-DsdWSuDi.js} +483 -482
- package/dist/{index-DCY5J8nu.js → index-XvX6TMzr.js} +1 -1
- package/dist/{index-B4NcYIuS.js → index-YvUJL9Us.js} +1 -1
- package/dist/{index-BskHs38T.js → index-cYgzND1g.js} +8594 -8615
- package/dist/{index-BFS4iFyT.js → index-gXFBfuoD.js} +8 -8
- package/dist/{index-TgVsU-aK.js → index-obXIOkF7.js} +4 -4
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-DEbrqw2f.js → index-t9LvhXac.js} +5 -5
- package/dist/{index-CM6aWexA.js → index-tMqKF2l6.js} +2 -2
- package/dist/{index-BCb4e7gH.js → index-tniD_xHN.js} +157 -148
- package/dist/{index.vue_vue_type_script_setup_true_lang-DwbHXtUp.js → index.vue_vue_type_script_setup_true_lang-DRzriV-s.js} +2 -2
- package/dist/{index.vue_vue_type_style_index_0_scoped_39e1db95_lang-Dp7tIi0S.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js} +27735 -27760
- package/dist/isString-BlNsHiyU.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-DMRXk1rO.js → main-DgwLoFSd.js} +9 -9
- package/dist/{menuIndex-BiUB7t5q.js → menuIndex-DAW9B-9g.js} +1 -1
- package/dist/obj/model.mtl +42 -0
- package/dist/obj/model.obj +26110 -0
- package/dist/{request-BfrhYBTM.js → request-B1c8BUkR.js} +3075 -3493
- package/dist/ss-component.css +3 -3
- package/dist/ss-component.js +14 -14
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/svgIcon-4u4PW7Is.js +42 -0
- package/dist/{threeModel-gP4XEBBx.js → threeModel-Df46gQvy.js} +174 -174
- package/dist/{threePreview-CpcrqmFS.js → threePreview-C4Ra7sjU.js} +554 -554
- package/dist/threeSceneView-tLPMhgrS.js +1291 -0
- package/dist/{threeSceneViewForCPMPIP-DuORHSj3.js → threeSceneViewForCPMPIP-DZ5wkTWo.js} +208 -207
- package/dist/{threeTrackPathView-Bw6e-quT.js → threeTrackPathView-DT80eKxv.js} +25 -25
- package/dist/{threeViewerHost-BPdmCSow.js → threeViewerHost-t6BRTmw8.js} +4 -4
- package/dist/urdfTree-Bu7OVUsr.js +404 -0
- package/dist/{workpieceTreePanel-XH9mYAT2.js → workpieceTreePanel-CuXFoEjJ.js} +60 -56
- package/package.json +1 -1
- package/public/obj/model.mtl +42 -0
- package/public/obj/model.obj +26110 -0
- package/dist/index-BmHnPjUq.js +0 -2623
- package/dist/isString-Dxm3W5iX.js +0 -8
- package/dist/svgIcon-4m2zaZkj.js +0 -42
- package/dist/threeSceneView-CWlU0pao.js +0 -1290
- package/dist/urdfTree-DU02c_91.js +0 -254
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as ce, computed as U, ref as k, resolveComponent as E,
|
|
2
|
-
import { u as De,
|
|
3
|
-
import {
|
|
4
|
-
import "./index-
|
|
5
|
-
import
|
|
6
|
-
import { E as B } from "./request-
|
|
1
|
+
import { defineComponent as ce, computed as U, ref as k, resolveComponent as E, createElementBlock as ee, openBlock as X, createElementVNode as d, createVNode as p, withCtx as I, toDisplayString as Y, shallowRef as D, watch as Ee, onMounted as Xe, onBeforeUnmount as Ye, withDirectives as N, createCommentVNode as S, unref as A, renderSlot as ae, createBlock as le, vShow as Z, nextTick as je } from "vue";
|
|
2
|
+
import { u as De, C as Ne, f as Ze, d as re } from "./iconfont-DZGSkx-_.js";
|
|
3
|
+
import { u as Be, d as Ie, U as Oe, J as Ge } from "./urdfTree-Bu7OVUsr.js";
|
|
4
|
+
import { C as O, h as qe, b0 as Ke, t as We, V as te, u as ue, Y as fe, a2 as Je, w as Re, a1 as He, _ as Qe, $ as Se, o as et, b1 as tt } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js";
|
|
5
|
+
import "./index-D8UY4uNQ.js";
|
|
6
|
+
import { E as B } from "./request-B1c8BUkR.js";
|
|
7
7
|
import { _ as ve } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
-
import { T as w } from "./svgIcon-
|
|
9
|
-
import { i as nt } from "./isString-
|
|
8
|
+
import { T as w } from "./svgIcon-4u4PW7Is.js";
|
|
9
|
+
import { i as nt } from "./isString-BlNsHiyU.js";
|
|
10
10
|
function ot(e = 0.5, n = 4) {
|
|
11
|
-
const o = new
|
|
12
|
-
new
|
|
13
|
-
new
|
|
11
|
+
const o = new qe(
|
|
12
|
+
new Ke(e, n, 32),
|
|
13
|
+
new We({
|
|
14
14
|
color: "#919191ff",
|
|
15
15
|
// 再提一档灰度
|
|
16
16
|
metalness: 0.3,
|
|
@@ -283,11 +283,11 @@ function Lt(e) {
|
|
|
283
283
|
function $t(e) {
|
|
284
284
|
const n = new ue();
|
|
285
285
|
n.setAttribute("position", new fe(e, 3));
|
|
286
|
-
const o = new
|
|
286
|
+
const o = new Je({
|
|
287
287
|
color: 55551,
|
|
288
288
|
linewidth: 3
|
|
289
289
|
});
|
|
290
|
-
return new
|
|
290
|
+
return new Re(n, o);
|
|
291
291
|
}
|
|
292
292
|
function Vt(e, n) {
|
|
293
293
|
if (!n || n.length < 3)
|
|
@@ -304,7 +304,7 @@ function Et(e, n, o, i = 4, l = 50) {
|
|
|
304
304
|
const L = e[h], g = e[h + 1], y = e[h + 2];
|
|
305
305
|
t = Math.min(t, L), s = Math.max(s, L), r = Math.min(r, g), f = Math.max(f, g), c = Math.min(c, y), m = Math.max(m, y);
|
|
306
306
|
}
|
|
307
|
-
const C = Math.sqrt((s - t) ** 2 + (f - r) ** 2 + (m - c) ** 2) * 0.05, P =
|
|
307
|
+
const C = Math.sqrt((s - t) ** 2 + (f - r) ** 2 + (m - c) ** 2) * 0.05, P = et.degToRad(n.fov), _ = 2 * Math.tan(P / 2) * l, T = C / _ * o.domElement.height * (i / 4);
|
|
308
308
|
return Math.min(0.4, T);
|
|
309
309
|
}
|
|
310
310
|
function Xt(e) {
|
|
@@ -315,13 +315,13 @@ function Xt(e) {
|
|
|
315
315
|
const o = new Float32Array(e.length);
|
|
316
316
|
for (let t = 0; t < e.length; t += 3)
|
|
317
317
|
o[t] = 0, o[t + 1] = 0.847, o[t + 2] = 1;
|
|
318
|
-
n.setAttribute("color", new
|
|
319
|
-
const i = new
|
|
318
|
+
n.setAttribute("color", new He(o, 3));
|
|
319
|
+
const i = new Qe({
|
|
320
320
|
vertexColors: !0,
|
|
321
321
|
size: 0.4,
|
|
322
322
|
// 像素世界单位
|
|
323
323
|
sizeAttenuation: !0
|
|
324
|
-
}), l = new
|
|
324
|
+
}), l = new Se(n, i);
|
|
325
325
|
return i.needsUpdate = !0, l;
|
|
326
326
|
}
|
|
327
327
|
function Yt(e, n) {
|
|
@@ -361,7 +361,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
361
361
|
toggleAxesVisibility: K,
|
|
362
362
|
zoomIn: W,
|
|
363
363
|
zoomOut: J
|
|
364
|
-
} = De(o), { isAnimating: M, toggleAnimation: me,
|
|
364
|
+
} = De(o), { isAnimating: M, toggleAnimation: me, stopAnimation: pe } = Be(h, C), { isClipping: he, activeClippingAxis: ne, toggleClipping: ge, updateClippingPlanes: ye } = Ie(h, C), Ce = () => {
|
|
365
365
|
K();
|
|
366
366
|
}, we = (a) => {
|
|
367
367
|
ne.value = a, ye();
|
|
@@ -395,7 +395,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
395
395
|
}, se = () => {
|
|
396
396
|
Te(), ze();
|
|
397
397
|
}, Ae = async (a) => {
|
|
398
|
-
const u = URL.createObjectURL(a), V = await
|
|
398
|
+
const u = URL.createObjectURL(a), V = await tt(u);
|
|
399
399
|
if (URL.revokeObjectURL(u), nt(V)) {
|
|
400
400
|
Q.value = await Ut(V, n.trackFileType) || [];
|
|
401
401
|
const z = Q.value;
|
|
@@ -405,7 +405,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
405
405
|
var a, u;
|
|
406
406
|
F.value = ot(), $.value = Lt(Q.value), $.value && $.value.length && (de(F.value, $.value[0], b.value, new O(16711680)), (u = (a = v.value) == null ? void 0 : a.add) == null || u.call(a, F.value));
|
|
407
407
|
}, ie = async (a) => {
|
|
408
|
-
se(), await Ae(a), b.value &&
|
|
408
|
+
se(), await Ae(a), b.value && Ze(h, b.value), x.value && Pe();
|
|
409
409
|
};
|
|
410
410
|
Ee(() => oe.value, async (a) => {
|
|
411
411
|
a && await ie(a);
|
|
@@ -562,11 +562,11 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
562
562
|
d("div", Gt, [
|
|
563
563
|
p(V, { height: "100%" }, {
|
|
564
564
|
default: I(() => [
|
|
565
|
-
r.value === "场景树" ? (X(), le(
|
|
565
|
+
r.value === "场景树" ? (X(), le(Oe, {
|
|
566
566
|
key: 0,
|
|
567
567
|
model: m.value
|
|
568
568
|
}, null, 8, ["model"])) : S("", !0),
|
|
569
|
-
r.value === "剖面视图" ? (X(), le(
|
|
569
|
+
r.value === "剖面视图" ? (X(), le(Ne, {
|
|
570
570
|
key: 1,
|
|
571
571
|
value: A(ne),
|
|
572
572
|
onChange: we
|
|
@@ -589,7 +589,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
589
589
|
d("div", Wt, [
|
|
590
590
|
p(V, { height: "100%" }, {
|
|
591
591
|
default: I(() => [
|
|
592
|
-
N(p(
|
|
592
|
+
N(p(Ge, { model: m.value }, null, 8, ["model"]), [
|
|
593
593
|
[Z, c.value === "关节控制"]
|
|
594
594
|
]),
|
|
595
595
|
N(p(dt, {
|
|
@@ -615,7 +615,7 @@ const jt = { class: "obj-viewer-container" }, Dt = { class: "buttonGroup-topLeft
|
|
|
615
615
|
]);
|
|
616
616
|
};
|
|
617
617
|
}
|
|
618
|
-
}),
|
|
618
|
+
}), ln = /* @__PURE__ */ ve(Rt, [["__scopeId", "data-v-7178b621"]]);
|
|
619
619
|
export {
|
|
620
|
-
|
|
620
|
+
ln as default
|
|
621
621
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as U, defineAsyncComponent as b, computed as I, ref as R, watch as H,
|
|
2
|
-
import { Y as W, u as A, p as D, s as $ } from "./index-
|
|
3
|
-
import { g as j, q as M, r as L } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-
|
|
1
|
+
import { defineComponent as U, defineAsyncComponent as b, computed as I, ref as R, watch as H, createElementBlock as N, openBlock as T, createElementVNode as K, createBlock as B, createCommentVNode as V, renderSlot as u, unref as m, withCtx as d } from "vue";
|
|
2
|
+
import { Y as W, u as A, p as D, s as $ } from "./index-D8UY4uNQ.js";
|
|
3
|
+
import { g as j, q as M, r as L } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js";
|
|
4
4
|
import { _ as G } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const re = {
|
|
6
6
|
SINGLE: "单机",
|
|
@@ -112,7 +112,7 @@ const z = { class: "three-platform mv-inline" }, J = { class: "top-menu" }, Q =
|
|
|
112
112
|
height: { default: "100%" }
|
|
113
113
|
},
|
|
114
114
|
setup(E) {
|
|
115
|
-
const O = b(() => import("./threeSceneView-
|
|
115
|
+
const O = b(() => import("./threeSceneView-tLPMhgrS.js")), y = b(() => import("./threePreview-C4Ra7sjU.js")), i = b(() => import("./threeTrackPathView-DT80eKxv.js")), p = b(() => import("./threeSceneViewForCPMPIP-DZ5wkTWo.js")), n = E, P = A(D), { platName: f } = $(P), { isUrdf: _, isTrackPathFile: g } = q(), c = I(() => {
|
|
116
116
|
var t;
|
|
117
117
|
return (t = n == null ? void 0 : n.files) == null ? void 0 : t.map((s) => {
|
|
118
118
|
const { url: e, name: r } = s;
|
|
@@ -0,0 +1,404 @@
|
|
|
1
|
+
import { ref as b, defineComponent as O, watch as U, onMounted as X, onUnmounted as Y, createElementBlock as F, openBlock as E, Fragment as Z, renderList as $, createElementVNode as P, createCommentVNode as G, toDisplayString as V, computed as T, resolveComponent as W, createVNode as H } from "vue";
|
|
2
|
+
import { V as d, B as R, h as I, e as L, k as Q, l as j, m as D, E as B } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-X_k372gl.js";
|
|
3
|
+
import { c as z } from "./iconfont-DZGSkx-_.js";
|
|
4
|
+
import { _ as N } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
|
+
function Ce(p, u) {
|
|
6
|
+
const r = b(!1);
|
|
7
|
+
let c = null, m = 12700, h = new d(), y = new d(), a = new d(), x = 0, g = null;
|
|
8
|
+
const v = (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2, k = (e) => {
|
|
9
|
+
const n = new d(), o = x * 1.2, f = new d(a.x + o, a.y, a.z), M = new d(a.x, a.y + o, a.z), C = new d(a.x, a.y - o, a.z);
|
|
10
|
+
if (e <= 0.567) {
|
|
11
|
+
const _ = e / 0.567 * Math.PI * 2;
|
|
12
|
+
n.x = a.x + Math.cos(_) * o, n.z = a.z + Math.sin(_) * o, n.y = a.y;
|
|
13
|
+
} else if (e <= 0.724) {
|
|
14
|
+
const w = (e - 0.567) / 0.157, _ = v(w);
|
|
15
|
+
n.lerpVectors(f, M, _);
|
|
16
|
+
} else if (e <= 0.881) {
|
|
17
|
+
const w = (e - 0.724) / 0.157, A = v(w) * Math.PI;
|
|
18
|
+
n.x = a.x + Math.sin(A) * o, n.y = a.y + Math.cos(A) * o, n.z = a.z;
|
|
19
|
+
} else {
|
|
20
|
+
const w = (e - 0.881) / 0.119, _ = v(w);
|
|
21
|
+
n.lerpVectors(C, h, _);
|
|
22
|
+
}
|
|
23
|
+
return n;
|
|
24
|
+
}, l = () => {
|
|
25
|
+
const { camera: e, controls: n } = p();
|
|
26
|
+
if (!e || !n) return;
|
|
27
|
+
c || (c = Date.now());
|
|
28
|
+
const o = Date.now() - c, f = Math.min(o / m, 1);
|
|
29
|
+
if (f >= 1) {
|
|
30
|
+
i();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const M = k(f);
|
|
34
|
+
e.position.copy(M), e.lookAt(a), n.target.copy(a), g = requestAnimationFrame(l);
|
|
35
|
+
}, t = () => {
|
|
36
|
+
if (u.value.length === 0) return;
|
|
37
|
+
const { camera: e, controls: n } = p();
|
|
38
|
+
if (!e || !n) return;
|
|
39
|
+
h.copy(e.position), y.copy(n.target);
|
|
40
|
+
const o = new R();
|
|
41
|
+
u.value.forEach((J) => {
|
|
42
|
+
o.expandByObject(J);
|
|
43
|
+
});
|
|
44
|
+
const f = o.getSize(new d());
|
|
45
|
+
a = o.getCenter(new d()), x = Math.max(f.x, f.y, f.z) * 1.2;
|
|
46
|
+
const M = new d(a.x + x * 1.2, a.y, a.z);
|
|
47
|
+
n.enabled = !1;
|
|
48
|
+
const C = e.position.clone(), w = 1e3, _ = Date.now(), A = () => {
|
|
49
|
+
const J = Date.now() - _, S = Math.min(J / w, 1), K = v(S);
|
|
50
|
+
e.position.lerpVectors(C, M, K), e.lookAt(a), n.target.copy(a), S < 1 ? requestAnimationFrame(A) : (r.value = !0, c = null, l());
|
|
51
|
+
};
|
|
52
|
+
A();
|
|
53
|
+
}, i = () => {
|
|
54
|
+
r.value = !1, c = null, g && (cancelAnimationFrame(g), g = null);
|
|
55
|
+
const { controls: e } = p();
|
|
56
|
+
e && (e.enabled = !0, e.target.copy(y));
|
|
57
|
+
};
|
|
58
|
+
return {
|
|
59
|
+
isAnimating: r,
|
|
60
|
+
toggleAnimation: () => {
|
|
61
|
+
if (r.value) {
|
|
62
|
+
r.value = !1, c = null, g && (cancelAnimationFrame(g), g = null);
|
|
63
|
+
const { camera: e, controls: n } = p();
|
|
64
|
+
if (!e || !n) return;
|
|
65
|
+
n.enabled = !0;
|
|
66
|
+
const o = e.position.clone(), f = n.target.clone(), M = 1500, C = Date.now(), w = () => {
|
|
67
|
+
const _ = Date.now() - C, A = Math.min(_ / M, 1), J = v(A);
|
|
68
|
+
e.position.lerpVectors(o, h, J), n.target.lerpVectors(f, y, J), A < 1 && requestAnimationFrame(w);
|
|
69
|
+
};
|
|
70
|
+
w();
|
|
71
|
+
} else
|
|
72
|
+
t();
|
|
73
|
+
},
|
|
74
|
+
startAnimation: t,
|
|
75
|
+
stopAnimation: i
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
function Ae(p, u) {
|
|
79
|
+
const r = b(!1), c = b("none");
|
|
80
|
+
let m = [], h = [], y = new R(), a = new d();
|
|
81
|
+
const x = () => {
|
|
82
|
+
m = [
|
|
83
|
+
new D(new d(1, 0, 0), 0),
|
|
84
|
+
// X轴平面
|
|
85
|
+
new D(new d(0, 1, 0), 0),
|
|
86
|
+
// Y轴平面
|
|
87
|
+
new D(new d(0, 0, 1), 0)
|
|
88
|
+
// Z轴平面
|
|
89
|
+
];
|
|
90
|
+
}, g = () => {
|
|
91
|
+
y.makeEmpty(), u.value.forEach((s) => {
|
|
92
|
+
y.expandByObject(s);
|
|
93
|
+
}), a = y.getCenter(new d());
|
|
94
|
+
}, v = (s) => {
|
|
95
|
+
const e = y.getSize(new d());
|
|
96
|
+
let n, o, f;
|
|
97
|
+
s === z.X ? (n = new L(e.z * 1.2, e.y * 1.2), o = new d(a.x, a.y, a.z), f = new B(0, Math.PI / 2, 0)) : s === z.Y ? (n = new L(e.x * 1.2, e.z * 1.2), o = new d(a.x, a.y, a.z), f = new B(Math.PI / 2, 0, 0)) : s === z.Z && (n = new L(e.x * 1.2, e.y * 1.2), o = new d(a.x, a.y, a.z), f = new B(0, 0, 0));
|
|
98
|
+
const M = new Q({
|
|
99
|
+
color: 8900331,
|
|
100
|
+
transparent: !0,
|
|
101
|
+
opacity: 0.3,
|
|
102
|
+
side: j,
|
|
103
|
+
depthWrite: !1
|
|
104
|
+
}), C = new I(n, M);
|
|
105
|
+
return o && C.position.copy(o), f && C.rotation.copy(f), C;
|
|
106
|
+
}, k = () => {
|
|
107
|
+
if (l(), t(), c.value === "none")
|
|
108
|
+
return;
|
|
109
|
+
g();
|
|
110
|
+
let s = null;
|
|
111
|
+
if (c.value === z.X ? (m[0].constant = -a.x, s = m[0]) : c.value === z.Y ? (m[1].constant = -a.y, s = m[1]) : c.value === z.Z && (m[2].constant = -a.z, s = m[2]), s) {
|
|
112
|
+
u.value.forEach((n) => {
|
|
113
|
+
n.traverse((o) => {
|
|
114
|
+
o instanceof I && o.isMesh && o.material && (Array.isArray(o.material) ? o.material.forEach((f) => {
|
|
115
|
+
f.clippingPlanes = [s];
|
|
116
|
+
}) : o.material.clippingPlanes = [s]);
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
const { scene: e } = p();
|
|
120
|
+
if (e) {
|
|
121
|
+
const n = v(c.value);
|
|
122
|
+
e.add(n), h.push(n);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}, l = () => {
|
|
126
|
+
u.value.forEach((s) => {
|
|
127
|
+
s.traverse((e) => {
|
|
128
|
+
e instanceof I && e.isMesh && e.material && (Array.isArray(e.material) ? e.material.forEach((n) => {
|
|
129
|
+
n.clippingPlanes = [];
|
|
130
|
+
}) : e.material.clippingPlanes = []);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
}, t = () => {
|
|
134
|
+
const { scene: s } = p();
|
|
135
|
+
s && h.forEach((e) => {
|
|
136
|
+
s.remove(e), e.geometry.dispose(), Array.isArray(e.material) ? e.material.forEach((n) => {
|
|
137
|
+
n.dispose();
|
|
138
|
+
}) : e.material.dispose();
|
|
139
|
+
}), h = [];
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
isClipping: r,
|
|
143
|
+
activeClippingAxis: c,
|
|
144
|
+
toggleClipping: () => {
|
|
145
|
+
r.value = !r.value, r.value ? (x(), u.value.length > 0 && g()) : (c.value = "none", l(), t());
|
|
146
|
+
},
|
|
147
|
+
updateClippingPlanes: k,
|
|
148
|
+
clearClippingPlanes: l,
|
|
149
|
+
clearClippingMeshes: t
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const ee = (p, u) => {
|
|
153
|
+
if (!u)
|
|
154
|
+
return null;
|
|
155
|
+
const r = p.joints[u];
|
|
156
|
+
return r || null;
|
|
157
|
+
}, ke = (p, u) => {
|
|
158
|
+
if (!u)
|
|
159
|
+
return null;
|
|
160
|
+
const r = ee(p, u);
|
|
161
|
+
if (!r)
|
|
162
|
+
return null;
|
|
163
|
+
let c = null;
|
|
164
|
+
return r.traverse((m) => {
|
|
165
|
+
m instanceof I && !c && (c = m);
|
|
166
|
+
}), c;
|
|
167
|
+
}, te = (p, u) => {
|
|
168
|
+
if (!u)
|
|
169
|
+
return null;
|
|
170
|
+
const r = p.links[u];
|
|
171
|
+
return r || null;
|
|
172
|
+
}, Fe = (p, u) => {
|
|
173
|
+
if (!u)
|
|
174
|
+
return null;
|
|
175
|
+
const r = te(p, u);
|
|
176
|
+
if (!r)
|
|
177
|
+
return null;
|
|
178
|
+
let c = null;
|
|
179
|
+
return r.traverse((m) => {
|
|
180
|
+
m instanceof I && !c && (c = m);
|
|
181
|
+
}), c;
|
|
182
|
+
}, q = (p) => {
|
|
183
|
+
const u = p.joints;
|
|
184
|
+
return Object.values(u);
|
|
185
|
+
}, Ee = (p) => q(p).filter((c) => c.jointType !== "fixed"), Je = (p) => {
|
|
186
|
+
const u = p.links;
|
|
187
|
+
return Object.keys(u);
|
|
188
|
+
}, ne = { class: "panel-content" }, se = {
|
|
189
|
+
key: 0,
|
|
190
|
+
class: "joints-list"
|
|
191
|
+
}, ae = { class: "joint-info-row" }, oe = { class: "joint-left" }, ie = { class: "joint-name" }, re = { class: "joint-range" }, le = { class: "joint-type" }, ce = {
|
|
192
|
+
key: 0,
|
|
193
|
+
class: "joint-control-row"
|
|
194
|
+
}, ue = { class: "slider-container" }, pe = ["min", "max", "value", "onInput"], me = { class: "value-display" }, de = { class: "joint-value" }, fe = { class: "unit" }, ge = {
|
|
195
|
+
key: 1,
|
|
196
|
+
class: "empty-state"
|
|
197
|
+
}, he = /* @__PURE__ */ O({
|
|
198
|
+
__name: "urdfJointPanel",
|
|
199
|
+
props: {
|
|
200
|
+
model: {}
|
|
201
|
+
},
|
|
202
|
+
setup(p, { expose: u }) {
|
|
203
|
+
const r = p, c = b([]), m = b(null), h = (l, t = !1) => l === "revolute" ? t ? Math.PI : -Math.PI : l === "prismatic" ? t ? 1 : -1 : 0, y = (l) => {
|
|
204
|
+
if (!l || !l.joints)
|
|
205
|
+
return console.warn("URDF模型无效或不包含关节信息"), [];
|
|
206
|
+
const t = [];
|
|
207
|
+
return q(l).forEach((s) => {
|
|
208
|
+
var n, o;
|
|
209
|
+
if (s.jointType === "fixed")
|
|
210
|
+
return;
|
|
211
|
+
let e = {
|
|
212
|
+
lower: ((n = s.limit) == null ? void 0 : n.lower) ?? h(s.jointType, !1),
|
|
213
|
+
upper: ((o = s.limit) == null ? void 0 : o.upper) ?? h(s.jointType, !0)
|
|
214
|
+
};
|
|
215
|
+
s.jointType === "continuous" && (e = {
|
|
216
|
+
lower: -10 * Math.PI,
|
|
217
|
+
upper: 10 * Math.PI
|
|
218
|
+
}), t.push({
|
|
219
|
+
name: s.name,
|
|
220
|
+
type: s.jointType || "unknown",
|
|
221
|
+
limit: e,
|
|
222
|
+
currentValue: s.angle || 0,
|
|
223
|
+
urdfJoint: s
|
|
224
|
+
});
|
|
225
|
+
}), t;
|
|
226
|
+
}, a = (l, t) => {
|
|
227
|
+
var n;
|
|
228
|
+
const i = c.value.find((o) => o.name === l);
|
|
229
|
+
if (!i) return;
|
|
230
|
+
const s = parseFloat(t), e = Math.max(i.limit.lower, Math.min(i.limit.upper, s));
|
|
231
|
+
i.currentValue = e, (n = r.model) != null && n.setJointValue ? r.model.setJointValue(l, e) : i.urdfJoint.setJointValue(e);
|
|
232
|
+
}, x = () => {
|
|
233
|
+
c.value.forEach((l) => {
|
|
234
|
+
(l.type === "revolute" || l.type === "continuous" || l.type === "prismatic") && a(l.name, 0);
|
|
235
|
+
});
|
|
236
|
+
}, g = () => {
|
|
237
|
+
r.model && c.value.forEach((l) => {
|
|
238
|
+
l.urdfJoint.angle !== void 0 && l.currentValue !== l.urdfJoint.angle && (l.currentValue = l.urdfJoint.angle);
|
|
239
|
+
});
|
|
240
|
+
}, v = () => {
|
|
241
|
+
const l = () => {
|
|
242
|
+
g(), m.value = requestAnimationFrame(l);
|
|
243
|
+
};
|
|
244
|
+
l();
|
|
245
|
+
}, k = () => {
|
|
246
|
+
m.value && (cancelAnimationFrame(m.value), m.value = null);
|
|
247
|
+
};
|
|
248
|
+
return U(
|
|
249
|
+
() => r.model,
|
|
250
|
+
(l) => {
|
|
251
|
+
l ? c.value = y(l) : c.value = [];
|
|
252
|
+
},
|
|
253
|
+
{ immediate: !0 }
|
|
254
|
+
), X(() => {
|
|
255
|
+
v();
|
|
256
|
+
}), Y(() => {
|
|
257
|
+
k();
|
|
258
|
+
}), u({
|
|
259
|
+
resetAllJoints: x
|
|
260
|
+
}), (l, t) => (E(), F("div", ne, [
|
|
261
|
+
c.value.length > 0 ? (E(), F("div", se, [
|
|
262
|
+
(E(!0), F(Z, null, $(c.value, (i) => (E(), F("div", {
|
|
263
|
+
key: i.name,
|
|
264
|
+
class: "joint-item"
|
|
265
|
+
}, [
|
|
266
|
+
P("div", ae, [
|
|
267
|
+
P("div", oe, [
|
|
268
|
+
P("span", ie, V(i.name), 1),
|
|
269
|
+
P("span", re, " [" + V(i.limit.lower.toFixed(2)) + ", " + V(i.limit.upper.toFixed(2)) + "] ", 1)
|
|
270
|
+
]),
|
|
271
|
+
P("span", le, V(i.type), 1)
|
|
272
|
+
]),
|
|
273
|
+
i.type === "revolute" || i.type === "prismatic" || i.type === "continuous" ? (E(), F("div", ce, [
|
|
274
|
+
P("div", ue, [
|
|
275
|
+
P("input", {
|
|
276
|
+
type: "range",
|
|
277
|
+
min: i.limit.lower,
|
|
278
|
+
max: i.limit.upper,
|
|
279
|
+
step: "0.001",
|
|
280
|
+
value: i.currentValue,
|
|
281
|
+
onInput: (s) => a(i.name, s.target.value),
|
|
282
|
+
class: "joint-slider"
|
|
283
|
+
}, null, 40, pe)
|
|
284
|
+
]),
|
|
285
|
+
P("div", me, [
|
|
286
|
+
P("span", de, V(i.currentValue ? Number(i.currentValue).toFixed(3) : "0.000"), 1),
|
|
287
|
+
P("span", fe, V(i.type === "prismatic" ? "m" : "rad"), 1)
|
|
288
|
+
])
|
|
289
|
+
])) : G("", !0)
|
|
290
|
+
]))), 128))
|
|
291
|
+
])) : (E(), F("div", ge, t[0] || (t[0] = [
|
|
292
|
+
P("p", null, "未检测到可控制的关节", -1)
|
|
293
|
+
])))
|
|
294
|
+
]));
|
|
295
|
+
}
|
|
296
|
+
}), Ve = /* @__PURE__ */ N(he, [["__scopeId", "data-v-b1467983"]]), ye = { class: "panel-content" }, ve = "id", we = {
|
|
297
|
+
__name: "urdfTree",
|
|
298
|
+
props: {
|
|
299
|
+
model: Object,
|
|
300
|
+
maxExpandCount: {
|
|
301
|
+
type: Number,
|
|
302
|
+
default: 10
|
|
303
|
+
},
|
|
304
|
+
expandStrategy: {
|
|
305
|
+
type: String,
|
|
306
|
+
default: "breadth",
|
|
307
|
+
validator: (p) => ["breadth", "firstLevel"].includes(p)
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
emits: ["nodeClick"],
|
|
311
|
+
setup(p, { emit: u }) {
|
|
312
|
+
const r = p, c = u, m = b([]), h = {
|
|
313
|
+
children: "children",
|
|
314
|
+
label: "label"
|
|
315
|
+
}, y = (t) => {
|
|
316
|
+
c("nodeClick", t);
|
|
317
|
+
}, a = (t, i = 0) => {
|
|
318
|
+
const s = [];
|
|
319
|
+
return Array.isArray(t) && (t == null ? void 0 : t.length) > 0 && t.forEach((e) => {
|
|
320
|
+
if (!(e != null && e.isMesh) && ((e == null ? void 0 : e.type) === "URDFJoint" || (e == null ? void 0 : e.type) === "URDFLink")) {
|
|
321
|
+
const n = {
|
|
322
|
+
name: e == null ? void 0 : e.name,
|
|
323
|
+
label: e == null ? void 0 : e.name,
|
|
324
|
+
show: !0,
|
|
325
|
+
level: i + 1,
|
|
326
|
+
isPenultimate: !1,
|
|
327
|
+
type: e == null ? void 0 : e.type,
|
|
328
|
+
id: e == null ? void 0 : e.id,
|
|
329
|
+
limit: (e == null ? void 0 : e.limit) ?? "",
|
|
330
|
+
children: a(e == null ? void 0 : e.children, i + 1),
|
|
331
|
+
path: e == null ? void 0 : e.name
|
|
332
|
+
};
|
|
333
|
+
s.push(n);
|
|
334
|
+
}
|
|
335
|
+
}), s;
|
|
336
|
+
}, x = (t) => t ? [{
|
|
337
|
+
name: t == null ? void 0 : t.name,
|
|
338
|
+
label: t == null ? void 0 : t.name,
|
|
339
|
+
show: !0,
|
|
340
|
+
level: 1,
|
|
341
|
+
isPenultimate: !1,
|
|
342
|
+
type: t == null ? void 0 : t.type,
|
|
343
|
+
id: t == null ? void 0 : t.id,
|
|
344
|
+
limit: (t == null ? void 0 : t.limit) ?? "",
|
|
345
|
+
children: a(t == null ? void 0 : t.children, 1) || [],
|
|
346
|
+
path: t == null ? void 0 : t.name
|
|
347
|
+
}] : [], g = (t, i) => {
|
|
348
|
+
const s = [], e = [...t];
|
|
349
|
+
for (; e.length > 0 && s.length < i; ) {
|
|
350
|
+
const n = e.shift();
|
|
351
|
+
n.children && n.children.length > 0 && (s.push(n.id), e.push(...n.children));
|
|
352
|
+
}
|
|
353
|
+
return s;
|
|
354
|
+
}, v = (t, i) => {
|
|
355
|
+
const s = [];
|
|
356
|
+
return t.forEach((e) => {
|
|
357
|
+
if (e.children && e.children.length > 0) {
|
|
358
|
+
s.push(e.id);
|
|
359
|
+
const n = e.children.filter((o) => o.children && o.children.length > 0).slice(0, i).map((o) => o.id);
|
|
360
|
+
s.push(...n);
|
|
361
|
+
}
|
|
362
|
+
}), s.slice(0, i + 1);
|
|
363
|
+
}, k = T(() => !m.value || m.value.length === 0 ? [] : r.expandStrategy === "firstLevel" ? v(m.value, r.maxExpandCount) : g(m.value, r.maxExpandCount)), l = T(() => [{
|
|
364
|
+
name: "场景",
|
|
365
|
+
label: "场景",
|
|
366
|
+
show: !0,
|
|
367
|
+
level: 1,
|
|
368
|
+
isPenultimate: !1,
|
|
369
|
+
type: "场景",
|
|
370
|
+
id: "场景",
|
|
371
|
+
children: r != null && r.model ? x(r.model) : [],
|
|
372
|
+
path: "场景"
|
|
373
|
+
}]);
|
|
374
|
+
return U(
|
|
375
|
+
l,
|
|
376
|
+
(t) => {
|
|
377
|
+
m.value = JSON.parse(JSON.stringify(t));
|
|
378
|
+
},
|
|
379
|
+
{ immediate: !0 }
|
|
380
|
+
), (t, i) => {
|
|
381
|
+
const s = W("el-tree");
|
|
382
|
+
return E(), F("div", ye, [
|
|
383
|
+
H(s, {
|
|
384
|
+
data: m.value,
|
|
385
|
+
props: h,
|
|
386
|
+
"default-expanded-keys": k.value,
|
|
387
|
+
"node-key": ve,
|
|
388
|
+
onNodeClick: y
|
|
389
|
+
}, null, 8, ["data", "default-expanded-keys"])
|
|
390
|
+
]);
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
}, ze = /* @__PURE__ */ N(we, [["__scopeId", "data-v-cfde50c3"]]);
|
|
394
|
+
export {
|
|
395
|
+
Ve as J,
|
|
396
|
+
ze as U,
|
|
397
|
+
ke as a,
|
|
398
|
+
Je as b,
|
|
399
|
+
ee as c,
|
|
400
|
+
Ae as d,
|
|
401
|
+
Fe as e,
|
|
402
|
+
Ee as g,
|
|
403
|
+
Ce as u
|
|
404
|
+
};
|