ss-component-new 1.3.621 → 1.3.622
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-Cg9LEvNr.js → MTLLoader-5pQpbMEZ.js} +2 -2
- package/dist/{URDFLoader-mPVZjSIW.js → URDFLoader-BO26K5-d.js} +584 -589
- package/dist/{animationData-CDdaleGB.js → animationData-rL2nYHqW.js} +3 -3
- package/dist/{array-HJsOOS05.js → array-DuZM66_g.js} +113 -112
- package/dist/{clone-MyfSNInd.js → clone-ESeDvnJv.js} +1 -1
- package/dist/{eleIcon-BoKZ_PzU.js → eleIcon-C7Pz9jha.js} +2 -2
- package/dist/{iconfont-BBJ_Xa7g.js → iconfont-BIrta5vE.js} +91 -91
- package/dist/{index-DJrzqi4-.js → index-11kpzK0A.js} +17 -17
- package/dist/{index-vITXyWii.js → index-B0LBEDkm.js} +6437 -6878
- package/dist/{index-BvtOLltL.js → index-B0M1YCUY.js} +7 -7
- package/dist/{index-DibHtT3s.js → index-B1mQwlvc.js} +1032 -999
- package/dist/{index-QpbdZ-N-.js → index-B8XrhVMF.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-CRUkYvae.js → index-BRe_6GdA.js} +4 -4
- 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-DMUuZJrY.js → index-BfOy5Rro.js} +3 -3
- package/dist/{index-6qXeMn6b.js → index-BvkIoiVW.js} +3 -3
- package/dist/{index-BVcc8kay.js → index-C1AGWEl0.js} +22 -20
- package/dist/{index-D1vR2n9D.js → index-C2C4Xubh.js} +5 -5
- package/dist/{index-DIVct0z6.js → index-C3pboX9W.js} +5 -5
- package/dist/{index-xWwc0MvD.js → index-CAzlTHKw.js} +157 -148
- package/dist/{index-DagRVVUS.js → index-CEdE_NSq.js} +4 -4
- package/dist/{index-BkkvdZXm.js → index-CPW7tdrA.js} +20 -17
- package/dist/{index-DjyxFjoY.js → index-CQUr9J0Q.js} +76 -74
- package/dist/{index-CpF3wYnE.js → index-CTGB1BcX.js} +13846 -13797
- package/dist/{index-BybrpYzx.js → index-CX8Apbo7.js} +1 -1
- package/dist/{index-DMkEL6P5.js → index-CsgdODAE.js} +8 -8
- package/dist/{index-DmILGKv9.js → index-D1E8EPxn.js} +61 -57
- package/dist/{index-B8NQAdR4.js → index-D8UY4uNQ.js} +967 -966
- package/dist/{index-DneXSBUw.js → index-D8ybTjwW.js} +8 -8
- package/dist/{index-CYjsE5Gs.js → index-D9xMYIes.js} +3 -3
- 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-B86vVYuK.js → index-ZdNvgZn9.js} +3 -3
- package/dist/index-l27pYXil.js +572 -0
- package/dist/{index-BFqUz4pN.js → index-rlStojTL.js} +1 -1
- package/dist/{index-CM6aWexA.js → index-tMqKF2l6.js} +2 -2
- 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-VCheSKQF.js → index.vue_vue_type_style_index_0_scoped_39e1db95_lang-CoMb-4Xy.js} +27735 -27760
- package/dist/isString-BlNsHiyU.js +8 -0
- package/dist/{localIcon-CoJHw5ss.js → localIcon-D5UoFBU5.js} +1 -1
- package/dist/{main-BuQcSVmx.js → main-C4Ocxkhh.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 +17 -17
- package/dist/ss-component2.js +13 -13
- package/dist/ss-component3.js +1 -1
- package/dist/{threeModel-Br3xFMq_.js → threeModel-eP_5lGNi.js} +174 -174
- package/dist/{threePreview-BjOjXzmX.js → threePreview-DMxYjkgP.js} +300 -302
- package/dist/{threeSceneView-Arn9K2ca.js → threeSceneView-BCi9Iy7Y.js} +24 -23
- package/dist/{threeSceneViewForCPMPIP-DyBpZbxn.js → threeSceneViewForCPMPIP-C-O6XT9G.js} +17 -16
- package/dist/{threeTrackPathView-DuL77ZaW.js → threeTrackPathView-DB61-HKo.js} +7 -7
- package/dist/{threeViewerHost-BYzW22O3.js → threeViewerHost-CZUXimUc.js} +4 -4
- package/dist/{urdfTree-xJWz0AN3.js → urdfTree-BTnijMjA.js} +9 -9
- package/dist/{workpieceTreePanel-Cfj81zvc.js → workpieceTreePanel-Cmcj8MOA.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-BGVDfril.js +0 -2623
- package/dist/isString-Dxm3W5iX.js +0 -8
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { ref as b, watch as Pe,
|
|
2
|
-
import { V as
|
|
3
|
-
import { O as ut } from "./iconfont-
|
|
4
|
-
import {
|
|
1
|
+
import { ref as b, watch as Pe, createElementBlock as q, openBlock as H, createBlock as Le, computed as ie, onMounted as $e, onUnmounted as je, Fragment as Xe, renderList as He, createElementVNode as h, createCommentVNode as xe, toDisplayString as ae, resolveComponent as Je, createVNode as z, defineComponent as Ye, normalizeStyle as Ee, normalizeClass as Fe, nextTick as Be, onBeforeUnmount as qe, withDirectives as se, unref as O, withCtx as Te, isRef as he, vModelRadio as ye, vShow as we } from "vue";
|
|
2
|
+
import { V as M, B as be, S as Ze, C as We, P as Ke, W as Ne, b as Qe, A as et, c as tt, M as Ve, X as nt, G as at, e as Me, f as ot, h as De, i as st, D as ke, H as lt, j as Re, k as Oe, l as Ue, m as ze, E as _e, n as de, o as it, p as rt, T as ct } from "./index.vue_vue_type_style_index_0_scoped_39e1db95_lang-CoMb-4Xy.js";
|
|
3
|
+
import { O as ut } from "./iconfont-BIrta5vE.js";
|
|
4
|
+
import { U as dt, V as pt } from "./index-CTGB1BcX.js";
|
|
5
5
|
import { _ as me } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
6
|
-
import { c as Ge } from "./index-
|
|
7
|
-
import { E as Ie } from "./request-
|
|
8
|
-
function mt(
|
|
9
|
-
let f = null, r = null, c = null, v = null,
|
|
6
|
+
import { c as Ge } from "./index-D8UY4uNQ.js";
|
|
7
|
+
import { E as Ie } from "./request-B1c8BUkR.js";
|
|
8
|
+
function mt(E) {
|
|
9
|
+
let f = null, r = null, c = null, v = null, w = null, k = null, i = null, A = null;
|
|
10
10
|
const F = 1e3 / 30;
|
|
11
11
|
let T = 0;
|
|
12
|
-
const
|
|
13
|
-
if (!
|
|
12
|
+
const D = b([]), l = b(new M()), C = b(new M()), g = () => {
|
|
13
|
+
if (!E.value) return;
|
|
14
14
|
f = new Ze(), f.background = new We(15790320);
|
|
15
|
-
const d =
|
|
15
|
+
const d = E.value;
|
|
16
16
|
r = new Ke(75, d.clientWidth / d.clientHeight, 0.1, 1e4), r.position.set(8, -8, 6), r.up.set(0, 0, 1), r.lookAt(0, 0, 0), c = new Ne({
|
|
17
17
|
antialias: !0,
|
|
18
18
|
alpha: !0
|
|
@@ -20,7 +20,7 @@ function mt(A) {
|
|
|
20
20
|
LEFT: null,
|
|
21
21
|
MIDDLE: Ve.PAN,
|
|
22
22
|
RIGHT: Ve.ROTATE
|
|
23
|
-
}, v.panSpeed = 0.7,
|
|
23
|
+
}, v.panSpeed = 0.7, w = new nt(r, c, {
|
|
24
24
|
container: d,
|
|
25
25
|
type: "cube",
|
|
26
26
|
placement: "top-right",
|
|
@@ -50,23 +50,23 @@ function mt(A) {
|
|
|
50
50
|
back: {
|
|
51
51
|
label: "Bottom"
|
|
52
52
|
}
|
|
53
|
-
}),
|
|
53
|
+
}), w.attachControls(v), p(), _();
|
|
54
54
|
}, e = (d, a) => {
|
|
55
|
-
i && (f.remove(i), i.dispose()),
|
|
56
|
-
const
|
|
57
|
-
i = new at(d,
|
|
55
|
+
i && (f.remove(i), i.dispose()), A && (f.remove(A), A.geometry.dispose(), A.material.dispose());
|
|
56
|
+
const S = Math.min(Math.max(Math.floor(d / 20), 30), 40);
|
|
57
|
+
i = new at(d, S, 13421772, 14540253), i.rotateX(Math.PI / 2), i.position.copy(a), f.add(i);
|
|
58
58
|
const V = new Me(d, d), X = new ot({
|
|
59
59
|
opacity: 0.3,
|
|
60
60
|
// 阴影透明度
|
|
61
61
|
color: 0
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
A = new De(V, X), A.position.copy(a), A.position.z -= 0.01, A.receiveShadow = !0, f.add(A);
|
|
64
64
|
}, u = () => {
|
|
65
|
-
if (
|
|
65
|
+
if (D.value.length === 0)
|
|
66
66
|
return;
|
|
67
67
|
const d = new be();
|
|
68
68
|
let a = !1;
|
|
69
|
-
if (
|
|
69
|
+
if (D.value.forEach((N) => {
|
|
70
70
|
if (N.userData.boundingBox)
|
|
71
71
|
d.union(N.userData.boundingBox), a = !0;
|
|
72
72
|
else if (N.userData.modelId && modelBoundingBoxes.has(N.userData.modelId)) {
|
|
@@ -78,7 +78,7 @@ function mt(A) {
|
|
|
78
78
|
console.warn("无法计算包围盒,网格更新失败");
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
|
-
const
|
|
81
|
+
const S = d.getSize(new M()), V = d.getCenter(new M()), X = Math.max(S.x, S.y, S.z), W = Math.max(X * 8, 50), K = new M(
|
|
82
82
|
V.x,
|
|
83
83
|
V.y,
|
|
84
84
|
d.min.z
|
|
@@ -90,8 +90,8 @@ function mt(A) {
|
|
|
90
90
|
f.add(d);
|
|
91
91
|
const a = new ke(16777215, 2);
|
|
92
92
|
a.position.set(10, 10, 8), a.castShadow = !0, a.shadow.mapSize.width = 4096, a.shadow.mapSize.height = 4096, a.shadow.camera.near = 0.5, a.shadow.camera.far = 50, a.shadow.camera.left = -50, a.shadow.camera.right = 50, a.shadow.camera.top = 50, a.shadow.camera.bottom = -50, f.add(a);
|
|
93
|
-
const
|
|
94
|
-
|
|
93
|
+
const S = new ke(16777215, 0.8);
|
|
94
|
+
S.position.set(-8, -8, 6), f.add(S);
|
|
95
95
|
const V = new ke(16777215, 0.6);
|
|
96
96
|
V.position.set(0, -15, 2), f.add(V);
|
|
97
97
|
const X = new lt(16777215, 4473924, 0.8);
|
|
@@ -103,7 +103,7 @@ function mt(A) {
|
|
|
103
103
|
}, _ = () => {
|
|
104
104
|
k = requestAnimationFrame(_), v && v.update();
|
|
105
105
|
const d = performance.now(), a = d - T;
|
|
106
|
-
a < F || (T = d - a % F, c && f && r && c.render(f, r),
|
|
106
|
+
a < F || (T = d - a % F, c && f && r && c.render(f, r), w && w.render());
|
|
107
107
|
}, U = (d) => {
|
|
108
108
|
[
|
|
109
109
|
"map",
|
|
@@ -117,45 +117,45 @@ function mt(A) {
|
|
|
117
117
|
"lightMap",
|
|
118
118
|
"aoMap",
|
|
119
119
|
"displacementMap"
|
|
120
|
-
].forEach((
|
|
121
|
-
d[
|
|
120
|
+
].forEach((S) => {
|
|
121
|
+
d[S] && d[S].dispose && d[S].dispose();
|
|
122
122
|
}), d.dispose && d.dispose();
|
|
123
123
|
}, R = (d) => {
|
|
124
124
|
d == null || d.traverse((a) => {
|
|
125
|
-
a.geometry && a.geometry.dispose(), a.material && (Array.isArray(a.material) ? a.material.forEach((
|
|
126
|
-
U(
|
|
125
|
+
a.geometry && a.geometry.dispose(), a.material && (Array.isArray(a.material) ? a.material.forEach((S) => {
|
|
126
|
+
U(S);
|
|
127
127
|
}) : U(a.material));
|
|
128
128
|
});
|
|
129
129
|
};
|
|
130
130
|
return {
|
|
131
131
|
// 响应式数据
|
|
132
|
-
currentModels:
|
|
132
|
+
currentModels: D,
|
|
133
133
|
initialCameraPosition: l,
|
|
134
134
|
initialTargetPosition: C,
|
|
135
135
|
// 方法
|
|
136
136
|
initThreeJS: g,
|
|
137
137
|
handleResize: () => {
|
|
138
|
-
if (!
|
|
139
|
-
const d =
|
|
140
|
-
r.aspect = a /
|
|
138
|
+
if (!E.value || !r || !c || !w) return;
|
|
139
|
+
const d = E.value, a = d.clientWidth, S = d.clientHeight;
|
|
140
|
+
r.aspect = a / S, r.updateProjectionMatrix(), c.setSize(a, S), w.update();
|
|
141
141
|
},
|
|
142
142
|
fitCameraToAllModels: (d) => {
|
|
143
|
-
if (!r || !v ||
|
|
143
|
+
if (!r || !v || D.value.length === 0) return;
|
|
144
144
|
const a = new be();
|
|
145
|
-
let
|
|
146
|
-
if (
|
|
145
|
+
let S = !1;
|
|
146
|
+
if (D.value.forEach((te) => {
|
|
147
147
|
if (te.userData.boundingBox)
|
|
148
|
-
a.union(te.userData.boundingBox),
|
|
148
|
+
a.union(te.userData.boundingBox), S = !0;
|
|
149
149
|
else if (te.userData.modelId && d.has(te.userData.modelId)) {
|
|
150
150
|
const re = d.get(te.userData.modelId);
|
|
151
|
-
a.union(re.box),
|
|
151
|
+
a.union(re.box), S = !0;
|
|
152
152
|
} else
|
|
153
|
-
a.expandByObject(te),
|
|
154
|
-
}), !
|
|
153
|
+
a.expandByObject(te), S = !0;
|
|
154
|
+
}), !S) {
|
|
155
155
|
console.warn("无法计算包围盒");
|
|
156
156
|
return;
|
|
157
157
|
}
|
|
158
|
-
const V = a.getSize(new
|
|
158
|
+
const V = a.getSize(new M()), X = a.getCenter(new M()), K = Math.max(V.x, V.y, V.z) * 0.8, N = new M(X.x + K, X.y - K, X.z + K);
|
|
159
159
|
r.position.copy(N), r.lookAt(X), v.target.copy(X), v.update(), l.value.copy(N), C.value.copy(X), u();
|
|
160
160
|
},
|
|
161
161
|
getThreeJSObjects: () => ({
|
|
@@ -163,31 +163,31 @@ function mt(A) {
|
|
|
163
163
|
camera: r,
|
|
164
164
|
renderer: c,
|
|
165
165
|
controls: v,
|
|
166
|
-
gizmo:
|
|
166
|
+
gizmo: w
|
|
167
167
|
}),
|
|
168
168
|
clearAllModels: () => {
|
|
169
169
|
if (!f) return;
|
|
170
|
-
|
|
170
|
+
D.value.forEach((a) => {
|
|
171
171
|
f.remove(a), R(a);
|
|
172
172
|
});
|
|
173
173
|
const d = [];
|
|
174
174
|
f.children.forEach((a) => {
|
|
175
|
-
!a.isLight && !a.isCamera && a.type !== "GridHelper" && a !==
|
|
175
|
+
!a.isLight && !a.isCamera && a.type !== "GridHelper" && a !== A && d.push(a);
|
|
176
176
|
}), d.forEach((a) => {
|
|
177
177
|
f.remove(a), R(a);
|
|
178
|
-
}),
|
|
178
|
+
}), D.value = [], u();
|
|
179
179
|
},
|
|
180
180
|
cleanup: () => {
|
|
181
|
-
k && cancelAnimationFrame(k), i && i.dispose(),
|
|
181
|
+
k && cancelAnimationFrame(k), i && i.dispose(), A && (A.geometry.dispose(), A.material.dispose()), c && c.dispose(), v && v.dispose(), w && w.dispose();
|
|
182
182
|
},
|
|
183
183
|
updateGridForModels: u
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
function ft(
|
|
186
|
+
function ft(E, f) {
|
|
187
187
|
const r = b(!1);
|
|
188
|
-
let c = null, v = 12700,
|
|
188
|
+
let c = null, v = 12700, w = new M(), k = new M(), i = new M(), A = 0, L = null;
|
|
189
189
|
const F = (e) => e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2, T = (e) => {
|
|
190
|
-
const u = new
|
|
190
|
+
const u = new M(), p = A * 1.2, _ = new M(i.x + p, i.y, i.z), U = new M(i.x, i.y + p, i.z), R = new M(i.x, i.y - p, i.z);
|
|
191
191
|
if (e <= 0.567) {
|
|
192
192
|
const G = e / 0.567 * Math.PI * 2;
|
|
193
193
|
u.x = i.x + Math.cos(G) * p, u.z = i.z + Math.sin(G) * p, u.y = i.y;
|
|
@@ -199,11 +199,11 @@ function ft(A, f) {
|
|
|
199
199
|
u.x = i.x + Math.sin(j) * p, u.y = i.y + Math.cos(j) * p, u.z = i.z;
|
|
200
200
|
} else {
|
|
201
201
|
const J = (e - 0.881) / 0.119, G = F(J);
|
|
202
|
-
u.lerpVectors(R,
|
|
202
|
+
u.lerpVectors(R, w, G);
|
|
203
203
|
}
|
|
204
204
|
return u;
|
|
205
|
-
},
|
|
206
|
-
const { camera: e, controls: u } =
|
|
205
|
+
}, D = () => {
|
|
206
|
+
const { camera: e, controls: u } = E();
|
|
207
207
|
if (!e || !u) return;
|
|
208
208
|
c || (c = Date.now());
|
|
209
209
|
const p = Date.now() - c, _ = Math.min(p / v, 1);
|
|
@@ -212,28 +212,28 @@ function ft(A, f) {
|
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
const U = T(_);
|
|
215
|
-
e.position.copy(U), e.lookAt(i), u.target.copy(i), L = requestAnimationFrame(
|
|
215
|
+
e.position.copy(U), e.lookAt(i), u.target.copy(i), L = requestAnimationFrame(D);
|
|
216
216
|
}, l = () => {
|
|
217
217
|
if (f.value.length === 0) return;
|
|
218
|
-
const { camera: e, controls: u } =
|
|
218
|
+
const { camera: e, controls: u } = E();
|
|
219
219
|
if (!e || !u) return;
|
|
220
|
-
|
|
220
|
+
w.copy(e.position), k.copy(u.target);
|
|
221
221
|
const p = new be();
|
|
222
222
|
f.value.forEach((Z) => {
|
|
223
223
|
p.expandByObject(Z);
|
|
224
224
|
});
|
|
225
|
-
const _ = p.getSize(new
|
|
226
|
-
i = p.getCenter(new
|
|
227
|
-
const U = new
|
|
225
|
+
const _ = p.getSize(new M());
|
|
226
|
+
i = p.getCenter(new M()), A = Math.max(_.x, _.y, _.z) * 1.2;
|
|
227
|
+
const U = new M(i.x + A * 1.2, i.y, i.z);
|
|
228
228
|
u.enabled = !1;
|
|
229
229
|
const R = e.position.clone(), J = 1e3, G = Date.now(), j = () => {
|
|
230
230
|
const Z = Date.now() - G, ee = Math.min(Z / J, 1), d = F(ee);
|
|
231
|
-
e.position.lerpVectors(R, U, d), e.lookAt(i), u.target.copy(i), ee < 1 ? requestAnimationFrame(j) : (r.value = !0, c = null,
|
|
231
|
+
e.position.lerpVectors(R, U, d), e.lookAt(i), u.target.copy(i), ee < 1 ? requestAnimationFrame(j) : (r.value = !0, c = null, D());
|
|
232
232
|
};
|
|
233
233
|
j();
|
|
234
234
|
}, C = () => {
|
|
235
235
|
r.value = !1, c = null, L && (cancelAnimationFrame(L), L = null);
|
|
236
|
-
const { controls: e } =
|
|
236
|
+
const { controls: e } = E();
|
|
237
237
|
e && (e.enabled = !0, e.target.copy(k));
|
|
238
238
|
};
|
|
239
239
|
return {
|
|
@@ -241,12 +241,12 @@ function ft(A, f) {
|
|
|
241
241
|
toggleAnimation: () => {
|
|
242
242
|
if (r.value) {
|
|
243
243
|
r.value = !1, c = null, L && (cancelAnimationFrame(L), L = null);
|
|
244
|
-
const { camera: e, controls: u } =
|
|
244
|
+
const { camera: e, controls: u } = E();
|
|
245
245
|
if (!e || !u) return;
|
|
246
246
|
u.enabled = !0;
|
|
247
247
|
const p = e.position.clone(), _ = u.target.clone(), U = 1500, R = Date.now(), J = () => {
|
|
248
248
|
const G = Date.now() - R, j = Math.min(G / U, 1), Z = F(j);
|
|
249
|
-
e.position.lerpVectors(p,
|
|
249
|
+
e.position.lerpVectors(p, w, Z), u.target.lerpVectors(_, k, Z), j < 1 && requestAnimationFrame(J);
|
|
250
250
|
};
|
|
251
251
|
J();
|
|
252
252
|
} else
|
|
@@ -256,26 +256,26 @@ function ft(A, f) {
|
|
|
256
256
|
stopAnimation: C
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function vt(
|
|
259
|
+
function vt(E, f) {
|
|
260
260
|
const r = b(!1), c = b("none");
|
|
261
|
-
let v = [],
|
|
262
|
-
const
|
|
261
|
+
let v = [], w = [], k = new be(), i = new M();
|
|
262
|
+
const A = () => {
|
|
263
263
|
v = [
|
|
264
|
-
new ze(new
|
|
264
|
+
new ze(new M(1, 0, 0), 0),
|
|
265
265
|
// X轴平面
|
|
266
|
-
new ze(new
|
|
266
|
+
new ze(new M(0, 1, 0), 0),
|
|
267
267
|
// Y轴平面
|
|
268
|
-
new ze(new
|
|
268
|
+
new ze(new M(0, 0, 1), 0)
|
|
269
269
|
// Z轴平面
|
|
270
270
|
];
|
|
271
271
|
}, L = () => {
|
|
272
272
|
k.makeEmpty(), f.value.forEach((g) => {
|
|
273
273
|
k.expandByObject(g);
|
|
274
|
-
}), i = k.getCenter(new
|
|
274
|
+
}), i = k.getCenter(new M());
|
|
275
275
|
}, F = (g) => {
|
|
276
|
-
const e = k.getSize(new
|
|
276
|
+
const e = k.getSize(new M());
|
|
277
277
|
let u, p, _;
|
|
278
|
-
g === "x" ? (u = new Me(e.z * 1.2, e.y * 1.2), p = new
|
|
278
|
+
g === "x" ? (u = new Me(e.z * 1.2, e.y * 1.2), p = new M(i.x, i.y, i.z), _ = new _e(0, Math.PI / 2, 0)) : g === "y" ? (u = new Me(e.x * 1.2, e.z * 1.2), p = new M(i.x, i.y, i.z), _ = new _e(Math.PI / 2, 0, 0)) : g === "z" && (u = new Me(e.x * 1.2, e.y * 1.2), p = new M(i.x, i.y, i.z), _ = new _e(0, 0, 0));
|
|
279
279
|
const U = new Oe({
|
|
280
280
|
color: 8900331,
|
|
281
281
|
transparent: !0,
|
|
@@ -285,7 +285,7 @@ function vt(A, f) {
|
|
|
285
285
|
}), R = new De(u, U);
|
|
286
286
|
return R.position.copy(p), R.rotation.copy(_), R;
|
|
287
287
|
}, T = () => {
|
|
288
|
-
if (
|
|
288
|
+
if (D(), l(), c.value === "none")
|
|
289
289
|
return;
|
|
290
290
|
L();
|
|
291
291
|
let g = null;
|
|
@@ -297,13 +297,13 @@ function vt(A, f) {
|
|
|
297
297
|
}) : p.material.clippingPlanes = [g]);
|
|
298
298
|
});
|
|
299
299
|
});
|
|
300
|
-
const { scene: e } =
|
|
300
|
+
const { scene: e } = E();
|
|
301
301
|
if (e) {
|
|
302
302
|
const u = F(c.value);
|
|
303
|
-
e.add(u),
|
|
303
|
+
e.add(u), w.push(u);
|
|
304
304
|
}
|
|
305
305
|
}
|
|
306
|
-
},
|
|
306
|
+
}, D = () => {
|
|
307
307
|
f.value.forEach((g) => {
|
|
308
308
|
g.traverse((e) => {
|
|
309
309
|
e.isMesh && e.material && (Array.isArray(e.material) ? e.material.forEach((u) => {
|
|
@@ -312,19 +312,19 @@ function vt(A, f) {
|
|
|
312
312
|
});
|
|
313
313
|
});
|
|
314
314
|
}, l = () => {
|
|
315
|
-
const { scene: g } =
|
|
316
|
-
g &&
|
|
315
|
+
const { scene: g } = E();
|
|
316
|
+
g && w.forEach((e) => {
|
|
317
317
|
g.remove(e), e.geometry.dispose(), e.material.dispose();
|
|
318
|
-
}),
|
|
318
|
+
}), w = [];
|
|
319
319
|
};
|
|
320
320
|
return {
|
|
321
321
|
isClipping: r,
|
|
322
322
|
activeClippingAxis: c,
|
|
323
323
|
toggleClipping: () => {
|
|
324
|
-
r.value = !r.value, r.value ? (
|
|
324
|
+
r.value = !r.value, r.value ? (A(), f.value.length > 0 && L()) : (c.value = "none", D(), l());
|
|
325
325
|
},
|
|
326
326
|
updateClippingPlanes: T,
|
|
327
|
-
clearClippingPlanes:
|
|
327
|
+
clearClippingPlanes: D,
|
|
328
328
|
clearClippingMeshes: l
|
|
329
329
|
};
|
|
330
330
|
}
|
|
@@ -334,8 +334,8 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
334
334
|
animationData: Object,
|
|
335
335
|
model: Object
|
|
336
336
|
},
|
|
337
|
-
setup(
|
|
338
|
-
const f =
|
|
337
|
+
setup(E) {
|
|
338
|
+
const f = E;
|
|
339
339
|
b();
|
|
340
340
|
const r = b();
|
|
341
341
|
return Pe(
|
|
@@ -347,10 +347,10 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
347
347
|
},
|
|
348
348
|
{ deep: !0, immediate: !0 }
|
|
349
349
|
), (c, v) => {
|
|
350
|
-
var
|
|
350
|
+
var w, k, i;
|
|
351
351
|
return H(), q("div", gt, [
|
|
352
352
|
(H(), Le(dt, {
|
|
353
|
-
itemData: (
|
|
353
|
+
itemData: (w = r.value) == null ? void 0 : w.compData,
|
|
354
354
|
key: (k = r.value) == null ? void 0 : k.id,
|
|
355
355
|
index: (i = r.value) == null ? void 0 : i.id,
|
|
356
356
|
showHeader: !1
|
|
@@ -374,16 +374,16 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
374
374
|
scene: Object,
|
|
375
375
|
animationData: Object
|
|
376
376
|
},
|
|
377
|
-
setup(
|
|
378
|
-
const r =
|
|
377
|
+
setup(E, { expose: f }) {
|
|
378
|
+
const r = E;
|
|
379
379
|
b(!0);
|
|
380
|
-
const c = b([]), v = b(null),
|
|
380
|
+
const c = b([]), v = b(null), w = b(null), k = b(12.5), i = b(), A = b(1302), L = b(30), F = b(!1), T = b(!1), D = b(0), l = b(0), C = b(null), g = it.degToRad, e = b(1), u = () => Bt / Ae / e.value;
|
|
381
381
|
let p = [];
|
|
382
382
|
Pe(
|
|
383
383
|
() => r.animationData,
|
|
384
384
|
(n) => {
|
|
385
385
|
var s;
|
|
386
|
-
|
|
386
|
+
A.value = n.extra.管长, k.value = n.extra.外径 / 2;
|
|
387
387
|
let m = ((s = Ge(n)) == null ? void 0 : s["输出(动画数据)"]) ?? [];
|
|
388
388
|
m && m.length > 0 && (p = m);
|
|
389
389
|
},
|
|
@@ -406,15 +406,15 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
406
406
|
if (!n || !n.joints)
|
|
407
407
|
return console.warn("URDF模型没有关节信息"), [];
|
|
408
408
|
let m = null;
|
|
409
|
-
if (n.traverse((
|
|
410
|
-
|
|
409
|
+
if (n.traverse((x) => {
|
|
410
|
+
x.name === "Pipe_Link" && !m && (m = x);
|
|
411
411
|
}), m)
|
|
412
412
|
i.value = m;
|
|
413
413
|
else
|
|
414
414
|
return console.warn("未找到管子模型"), [];
|
|
415
415
|
const s = [];
|
|
416
|
-
return Object.keys(n.joints).forEach((
|
|
417
|
-
const o = n.joints[
|
|
416
|
+
return Object.keys(n.joints).forEach((x) => {
|
|
417
|
+
const o = n.joints[x];
|
|
418
418
|
if (o._jointType === "fixed")
|
|
419
419
|
return;
|
|
420
420
|
const t = o.limit ? {
|
|
@@ -425,37 +425,37 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
425
425
|
upper: _(o._jointType, !0)
|
|
426
426
|
};
|
|
427
427
|
s.push({
|
|
428
|
-
name:
|
|
428
|
+
name: x,
|
|
429
429
|
type: o._jointType || "unknown",
|
|
430
430
|
limit: t,
|
|
431
431
|
currentValue: o.angle || 0,
|
|
432
432
|
urdfJoint: o
|
|
433
433
|
});
|
|
434
|
-
}), s.sort((
|
|
434
|
+
}), s.sort((x, o) => x.name.localeCompare(o.name));
|
|
435
435
|
}, J = (n, m) => {
|
|
436
436
|
const s = c.value.find((o) => o.name === n);
|
|
437
437
|
if (!s) return;
|
|
438
|
-
const
|
|
438
|
+
const x = parseFloat(m);
|
|
439
439
|
if (s.limit) {
|
|
440
|
-
const o = Math.max(s.limit.lower, Math.min(s.limit.upper,
|
|
440
|
+
const o = Math.max(s.limit.lower, Math.min(s.limit.upper, x));
|
|
441
441
|
s.currentValue = o;
|
|
442
442
|
} else
|
|
443
|
-
s.currentValue =
|
|
443
|
+
s.currentValue = x;
|
|
444
444
|
r.model && r.model.setJointValue ? r.model.setJointValue(n, s.currentValue) : s.urdfJoint && s.urdfJoint.setJointValue(s.currentValue);
|
|
445
445
|
}, G = (n) => n.reduce((m, s) => {
|
|
446
|
-
let
|
|
446
|
+
let x = 0;
|
|
447
447
|
const o = s.Y ?? 0, t = s.C ?? 0, y = s.R ?? 0;
|
|
448
|
-
return o > 0 && (
|
|
448
|
+
return o > 0 && (x += o), t > 0 && y > 0 && (x += y * g(t)), m + x;
|
|
449
449
|
}, 0), j = (n) => {
|
|
450
|
-
const m = [], s = n.Y ?? 0,
|
|
451
|
-
pos: new
|
|
452
|
-
localY: new
|
|
453
|
-
localX: new
|
|
454
|
-
localZ: new
|
|
450
|
+
const m = [], s = n.Y ?? 0, x = n.B ?? 0, o = n.C ?? 0, t = n.R ?? 0, y = {
|
|
451
|
+
pos: new M(0, 0, 0),
|
|
452
|
+
localY: new M(0, 1, 0),
|
|
453
|
+
localX: new M(1, 0, 0),
|
|
454
|
+
localZ: new M(0, 0, 1)
|
|
455
455
|
};
|
|
456
456
|
if (!s && !o) return m;
|
|
457
|
-
if (m.push(y.pos.clone()),
|
|
458
|
-
const Y = new de().makeRotationAxis(y.localY, g(
|
|
457
|
+
if (m.push(y.pos.clone()), x !== 0) {
|
|
458
|
+
const Y = new de().makeRotationAxis(y.localY, g(x));
|
|
459
459
|
y.localX.applyMatrix4(Y), y.localZ.applyMatrix4(Y);
|
|
460
460
|
}
|
|
461
461
|
if (s > 0 && (y.pos.add(y.localY.clone().multiplyScalar(s * pe)), m.push(y.pos.clone())), o > 0 && t > 0) {
|
|
@@ -468,26 +468,26 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
468
468
|
return m;
|
|
469
469
|
}, Z = (n, m = 0) => {
|
|
470
470
|
let s = p.slice(0, n + 1);
|
|
471
|
-
const
|
|
472
|
-
if (
|
|
471
|
+
const x = p[n + 1];
|
|
472
|
+
if (x && m > 0) {
|
|
473
473
|
const I = {
|
|
474
|
-
...
|
|
474
|
+
...x,
|
|
475
475
|
// 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
|
|
476
|
-
B: (
|
|
476
|
+
B: (x.B ?? 0) * m,
|
|
477
477
|
// 根据插值因子计算当前的弯曲角度C,实现从0到目标角度的平滑过渡
|
|
478
|
-
C: (
|
|
478
|
+
C: (x.C ?? 0) * m
|
|
479
479
|
};
|
|
480
480
|
s.push(I);
|
|
481
481
|
}
|
|
482
|
-
const o = G(s), t = Math.max(0,
|
|
483
|
-
y.push(new
|
|
484
|
-
const Y = new
|
|
482
|
+
const o = G(s), t = Math.max(0, A.value - o), y = [];
|
|
483
|
+
y.push(new M(0, 0, 0));
|
|
484
|
+
const Y = new M(0, t * pe, 0);
|
|
485
485
|
t > 0 && y.push(Y);
|
|
486
486
|
let $ = {
|
|
487
487
|
pos: Y.clone(),
|
|
488
|
-
localY: new
|
|
489
|
-
localX: new
|
|
490
|
-
localZ: new
|
|
488
|
+
localY: new M(0, 1, 0),
|
|
489
|
+
localX: new M(1, 0, 0),
|
|
490
|
+
localZ: new M(0, 0, 1)
|
|
491
491
|
};
|
|
492
492
|
const ne = [];
|
|
493
493
|
for (let I = s.length - 1; I >= 0; I--) {
|
|
@@ -513,57 +513,57 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
513
513
|
}
|
|
514
514
|
for (const I of ne)
|
|
515
515
|
I.length > 1 && y.push(...I.slice(1));
|
|
516
|
-
y.length < 2 && y.push(new
|
|
516
|
+
y.length < 2 && y.push(new M(0, 1e-3, 0));
|
|
517
517
|
try {
|
|
518
|
-
const I = new
|
|
518
|
+
const I = new rt(y, !1, "catmullrom", 0.01), P = new ct(I, Math.max(2, y.length * 4), k.value * pe, 18, !1);
|
|
519
519
|
i.value.geometry.dispose(), i.value.geometry = P;
|
|
520
520
|
} catch (I) {
|
|
521
521
|
console.error("管件更新失败", I);
|
|
522
522
|
}
|
|
523
523
|
}, ee = (n, m, s = 1) => {
|
|
524
|
-
n && (Object.keys(n).forEach((
|
|
525
|
-
const o = n[
|
|
526
|
-
t && (t.currentValue = o, r.model && r.model.setJointValue ? r.model.setJointValue(
|
|
524
|
+
n && (Object.keys(n).forEach((x) => {
|
|
525
|
+
const o = n[x], t = c.value.find((y) => y.name === x);
|
|
526
|
+
t && (t.currentValue = o, r.model && r.model.setJointValue ? r.model.setJointValue(x, o) : t.urdfJoint && t.urdfJoint.setJointValue(o));
|
|
527
527
|
}), Z(m, s));
|
|
528
528
|
}, d = (n, m, s) => n + (m - n) * s, a = (n, m, s) => {
|
|
529
529
|
if (!n || !m) return n || m;
|
|
530
|
-
const
|
|
530
|
+
const x = {};
|
|
531
531
|
return Object.keys(n).forEach((o) => {
|
|
532
532
|
const t = n[o], y = m[o];
|
|
533
|
-
|
|
534
|
-
}),
|
|
535
|
-
},
|
|
533
|
+
x[o] = d(t, y || t, s);
|
|
534
|
+
}), x;
|
|
535
|
+
}, S = () => {
|
|
536
536
|
if (p.length === 0) {
|
|
537
537
|
console.warn("没有动画数据");
|
|
538
538
|
return;
|
|
539
539
|
}
|
|
540
|
-
U(), F.value = !0, T.value = !1,
|
|
540
|
+
U(), F.value = !0, T.value = !1, D.value = 0, l.value = 0, V();
|
|
541
541
|
}, V = () => {
|
|
542
542
|
if (!F.value || T.value) return;
|
|
543
|
-
const n =
|
|
543
|
+
const n = D.value;
|
|
544
544
|
if (n >= p.length - 1) {
|
|
545
545
|
const o = p[p.length - 1];
|
|
546
546
|
ee(o, p.length - 1, 1), W();
|
|
547
547
|
return;
|
|
548
548
|
}
|
|
549
|
-
const m = l.value / Ae, s = p[n],
|
|
550
|
-
if (
|
|
551
|
-
const o = a(s,
|
|
549
|
+
const m = l.value / Ae, s = p[n], x = p[n + 1];
|
|
550
|
+
if (x) {
|
|
551
|
+
const o = a(s, x, m);
|
|
552
552
|
ee(o, n, m);
|
|
553
553
|
} else
|
|
554
554
|
ee(s, n);
|
|
555
|
-
l.value++, l.value > Ae && (l.value = 0,
|
|
555
|
+
l.value++, l.value > Ae && (l.value = 0, D.value++), C.value = setTimeout(V, u());
|
|
556
556
|
}, X = () => {
|
|
557
557
|
T.value = !0, C.value && (clearTimeout(C.value), C.value = null);
|
|
558
558
|
}, W = () => {
|
|
559
559
|
F.value = !1, T.value = !1, e.value = 1, C.value && (clearTimeout(C.value), C.value = null);
|
|
560
560
|
};
|
|
561
561
|
f({
|
|
562
|
-
startAnimation:
|
|
562
|
+
startAnimation: S,
|
|
563
563
|
pauseAnimation: X,
|
|
564
564
|
stopAnimation: W,
|
|
565
565
|
resetAll: () => {
|
|
566
|
-
W(),
|
|
566
|
+
W(), D.value = 0, l.value = 0, c.value.forEach((n) => {
|
|
567
567
|
(n.type === "revolute" || n.type === "prismatic") && J(n.name, 0);
|
|
568
568
|
}), Z(-1, 0);
|
|
569
569
|
},
|
|
@@ -586,11 +586,11 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
586
586
|
});
|
|
587
587
|
}, fe = () => {
|
|
588
588
|
const n = () => {
|
|
589
|
-
re(),
|
|
589
|
+
re(), w.value = requestAnimationFrame(n);
|
|
590
590
|
};
|
|
591
591
|
n();
|
|
592
592
|
}, Ce = () => {
|
|
593
|
-
|
|
593
|
+
w.value && (cancelAnimationFrame(w.value), w.value = null);
|
|
594
594
|
};
|
|
595
595
|
return $e(() => {
|
|
596
596
|
fe();
|
|
@@ -599,7 +599,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
599
599
|
}), (n, m) => (H(), q("div", wt, [
|
|
600
600
|
c.value.length > 0 ? (H(), q("div", xt, [
|
|
601
601
|
(H(!0), q(Xe, null, He(c.value, (s) => {
|
|
602
|
-
var
|
|
602
|
+
var x, o, t, y;
|
|
603
603
|
return H(), q("div", {
|
|
604
604
|
key: s.name,
|
|
605
605
|
class: "joint-item"
|
|
@@ -607,7 +607,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
607
607
|
h("div", Mt, [
|
|
608
608
|
h("div", Pt, [
|
|
609
609
|
h("span", bt, ae(s.name), 1),
|
|
610
|
-
h("span", Ct, " [" + ae(((
|
|
610
|
+
h("span", Ct, " [" + ae(((x = s.limit) == null ? void 0 : x.lower.toFixed(2)) ?? (s.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ae(((o = s.limit) == null ? void 0 : o.upper.toFixed(2)) ?? (s.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
|
|
611
611
|
]),
|
|
612
612
|
h("span", kt, ae(s.type), 1)
|
|
613
613
|
]),
|
|
@@ -631,9 +631,9 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
631
631
|
])) : xe("", !0)
|
|
632
632
|
]);
|
|
633
633
|
}), 128))
|
|
634
|
-
])) : (H(), q("div", Ft,
|
|
634
|
+
])) : (H(), q("div", Ft, m[0] || (m[0] = [
|
|
635
635
|
h("p", null, "未检测到可控制的关节", -1)
|
|
636
|
-
])
|
|
636
|
+
])))
|
|
637
637
|
]));
|
|
638
638
|
}
|
|
639
639
|
}, Vt = /* @__PURE__ */ me(Tt, [["__scopeId", "data-v-bcf4fa92"]]), Rt = { class: "panel-content" }, It = "id", Lt = {
|
|
@@ -647,12 +647,12 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
647
647
|
expandStrategy: {
|
|
648
648
|
type: String,
|
|
649
649
|
default: "breadth",
|
|
650
|
-
validator: (
|
|
650
|
+
validator: (E) => ["breadth", "firstLevel"].includes(E)
|
|
651
651
|
}
|
|
652
652
|
},
|
|
653
653
|
emits: ["nodeClick"],
|
|
654
|
-
setup(
|
|
655
|
-
const r =
|
|
654
|
+
setup(E, { emit: f }) {
|
|
655
|
+
const r = E, c = f, v = b([]), w = {
|
|
656
656
|
children: "children",
|
|
657
657
|
label: "label"
|
|
658
658
|
}, k = (l) => {
|
|
@@ -676,7 +676,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
676
676
|
g.push(u);
|
|
677
677
|
}
|
|
678
678
|
}), g;
|
|
679
|
-
},
|
|
679
|
+
}, A = (l) => l ? [{
|
|
680
680
|
name: l == null ? void 0 : l.name,
|
|
681
681
|
label: l == null ? void 0 : l.name,
|
|
682
682
|
show: !0,
|
|
@@ -703,9 +703,9 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
703
703
|
g.push(...u);
|
|
704
704
|
}
|
|
705
705
|
}), g.slice(0, C + 1);
|
|
706
|
-
}, T = ie(() => !v.value || v.value.length === 0 ? [] : r.expandStrategy === "firstLevel" ? F(v.value, r.maxExpandCount) : L(v.value, r.maxExpandCount)),
|
|
706
|
+
}, T = ie(() => !v.value || v.value.length === 0 ? [] : r.expandStrategy === "firstLevel" ? F(v.value, r.maxExpandCount) : L(v.value, r.maxExpandCount)), D = ie(() => r != null && r.model ? A(r.model) : []);
|
|
707
707
|
return Pe(
|
|
708
|
-
|
|
708
|
+
D,
|
|
709
709
|
(l) => {
|
|
710
710
|
v.value = JSON.parse(JSON.stringify(l));
|
|
711
711
|
},
|
|
@@ -715,7 +715,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
715
715
|
return H(), q("div", Rt, [
|
|
716
716
|
z(g, {
|
|
717
717
|
data: v.value,
|
|
718
|
-
props:
|
|
718
|
+
props: w,
|
|
719
719
|
"default-expanded-keys": T.value,
|
|
720
720
|
"node-key": It,
|
|
721
721
|
onNodeClick: k
|
|
@@ -733,25 +733,25 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
733
733
|
spin: { type: Boolean, default: !1 },
|
|
734
734
|
active: { type: Boolean, default: !1 }
|
|
735
735
|
},
|
|
736
|
-
setup(
|
|
737
|
-
const f =
|
|
736
|
+
setup(E) {
|
|
737
|
+
const f = E, r = ie(
|
|
738
738
|
() => ({
|
|
739
739
|
backgroundColor: f.backgroundColor
|
|
740
740
|
})
|
|
741
741
|
), c = ie(() => `#${f.prefix}-${f.name}`), v = ie(() => {
|
|
742
|
-
const { size:
|
|
743
|
-
let k = `${
|
|
742
|
+
const { size: w } = f;
|
|
743
|
+
let k = `${w}`;
|
|
744
744
|
return k = `${k.replace("px", "")}px`, {
|
|
745
745
|
width: k,
|
|
746
746
|
height: k
|
|
747
747
|
};
|
|
748
748
|
});
|
|
749
|
-
return (
|
|
750
|
-
class: Fe(["container", { active:
|
|
749
|
+
return (w, k) => (H(), q("div", {
|
|
750
|
+
class: Fe(["container", { active: w.active }]),
|
|
751
751
|
style: Ee(r.value)
|
|
752
752
|
}, [
|
|
753
753
|
(H(), q("svg", {
|
|
754
|
-
class: Fe(["svg-icon", [
|
|
754
|
+
class: Fe(["svg-icon", [w.$attrs.class, w.spin && "svg-icon-spin"]]),
|
|
755
755
|
style: Ee(v.value),
|
|
756
756
|
"aria-hidden": "true"
|
|
757
757
|
}, [
|
|
@@ -775,12 +775,12 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
775
775
|
}
|
|
776
776
|
},
|
|
777
777
|
emits: ["getAnimationData"],
|
|
778
|
-
setup(
|
|
778
|
+
setup(E, { expose: f, emit: r }) {
|
|
779
779
|
const c = r;
|
|
780
|
-
let v = null,
|
|
781
|
-
const k = b(null), i = b(!1),
|
|
780
|
+
let v = null, w = !1;
|
|
781
|
+
const k = b(null), i = b(!1), A = b("");
|
|
782
782
|
b(!1);
|
|
783
|
-
const L = b(!1), F = b(!1), T = b(""),
|
|
783
|
+
const L = b(!1), F = b(!1), T = b(""), D = b(!1), l = b(""), C = b(), {
|
|
784
784
|
currentModels: g,
|
|
785
785
|
initialCameraPosition: e,
|
|
786
786
|
initialTargetPosition: u,
|
|
@@ -790,14 +790,14 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
790
790
|
getThreeJSObjects: R,
|
|
791
791
|
clearAllModels: J,
|
|
792
792
|
cleanup: G
|
|
793
|
-
} = mt(k), { isAnimating: j, toggleAnimation: Z, stopAnimation: ee } = ft(R, g), { isClipping: d, activeClippingAxis: a, toggleClipping:
|
|
793
|
+
} = mt(k), { isAnimating: j, toggleAnimation: Z, stopAnimation: ee } = ft(R, g), { isClipping: d, activeClippingAxis: a, toggleClipping: S, updateClippingPlanes: V } = vt(
|
|
794
794
|
R,
|
|
795
795
|
g
|
|
796
796
|
), { addModelsFromUrls: X, loadModelByDefaultPath: W, urdfModel: K, modelBoundingBoxes: N } = pt(
|
|
797
797
|
R,
|
|
798
798
|
g,
|
|
799
799
|
i,
|
|
800
|
-
|
|
800
|
+
A,
|
|
801
801
|
J
|
|
802
802
|
), te = () => {
|
|
803
803
|
if (L.value || g.value.length === 0) return;
|
|
@@ -810,24 +810,24 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
810
810
|
o.position.lerpVectors(Y, e.value, ce), t.target.lerpVectors($, u.value, ce), oe < 1 ? requestAnimationFrame(P) : L.value = !1;
|
|
811
811
|
};
|
|
812
812
|
P();
|
|
813
|
-
}, re = async () =>
|
|
813
|
+
}, re = async () => w ? Promise.resolve() : new Promise((o) => {
|
|
814
814
|
const t = () => {
|
|
815
|
-
|
|
815
|
+
w ? o() : requestAnimationFrame(t);
|
|
816
816
|
};
|
|
817
817
|
t();
|
|
818
818
|
}), fe = async (o, t) => {
|
|
819
819
|
try {
|
|
820
|
-
await re(), j.value && ee(), d.value &&
|
|
820
|
+
await re(), j.value && ee(), d.value && S();
|
|
821
821
|
const y = await t(o);
|
|
822
822
|
return U(N), y;
|
|
823
823
|
} catch (y) {
|
|
824
824
|
throw console.error("加载模型失败:", y), y;
|
|
825
825
|
}
|
|
826
826
|
}, Ce = async (o) => fe(o, X), n = async (o) => fe(o, W), m = (o) => {
|
|
827
|
-
F.value = !0, T.value = o, o === "剖面视图" && !d.value &&
|
|
827
|
+
F.value = !0, T.value = o, o === "剖面视图" && !d.value && S();
|
|
828
828
|
}, s = (o) => {
|
|
829
|
-
|
|
830
|
-
},
|
|
829
|
+
D.value = !0, l.value = o, o === "动画仿真" && c("getAnimationData");
|
|
830
|
+
}, x = () => {
|
|
831
831
|
Be(() => {
|
|
832
832
|
var o;
|
|
833
833
|
(o = C.value) == null || o.startAnimation();
|
|
@@ -836,12 +836,12 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
836
836
|
return $e(async () => {
|
|
837
837
|
await Be();
|
|
838
838
|
try {
|
|
839
|
-
p(), v = R().scene,
|
|
839
|
+
p(), v = R().scene, w = !0, window.addEventListener("resize", _);
|
|
840
840
|
} catch (o) {
|
|
841
841
|
console.error("Three.js初始化失败:", o);
|
|
842
842
|
}
|
|
843
843
|
}), qe(() => {
|
|
844
|
-
|
|
844
|
+
w = !1, T.value = "", l.value = "", window.removeEventListener("resize", _), j.value && ee(), G();
|
|
845
845
|
}), f({
|
|
846
846
|
addModelsFromUrls: Ce,
|
|
847
847
|
loadModelByDefaultPath: n
|
|
@@ -939,7 +939,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
939
939
|
name: "guanjiekongzhi",
|
|
940
940
|
size: "24",
|
|
941
941
|
onClick: t[4] || (t[4] = (P) => s("关节控制")),
|
|
942
|
-
active:
|
|
942
|
+
active: D.value && l.value === "关节控制",
|
|
943
943
|
title: "关节控制"
|
|
944
944
|
}, null, 8, ["active"]),
|
|
945
945
|
z(B, {
|
|
@@ -947,7 +947,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
947
947
|
size: "24",
|
|
948
948
|
title: "动画仿真",
|
|
949
949
|
onClick: t[5] || (t[5] = (P) => s("动画仿真")),
|
|
950
|
-
active:
|
|
950
|
+
active: D.value && l.value === "动画仿真"
|
|
951
951
|
}, null, 8, ["active"]),
|
|
952
952
|
z(B, {
|
|
953
953
|
name: "donghuafangzhen",
|
|
@@ -971,7 +971,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
971
971
|
size: "24",
|
|
972
972
|
backgroundColor: "#ffffff",
|
|
973
973
|
title: "播放",
|
|
974
|
-
onClick:
|
|
974
|
+
onClick: x
|
|
975
975
|
}),
|
|
976
976
|
z(B, {
|
|
977
977
|
name: "kuaijin",
|
|
@@ -1072,7 +1072,7 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
1072
1072
|
h("span", null, ae(l.value), 1),
|
|
1073
1073
|
h("span", {
|
|
1074
1074
|
class: "close",
|
|
1075
|
-
onClick: t[15] || (t[15] = (P) =>
|
|
1075
|
+
onClick: t[15] || (t[15] = (P) => D.value = !1)
|
|
1076
1076
|
}, " X ")
|
|
1077
1077
|
]),
|
|
1078
1078
|
z(y, { "max-height": "650px" }, {
|
|
@@ -1082,22 +1082,22 @@ const gt = { class: "panel-content" }, ht = {
|
|
|
1082
1082
|
ref: C,
|
|
1083
1083
|
model: O(K),
|
|
1084
1084
|
scene: O(v),
|
|
1085
|
-
animationData:
|
|
1085
|
+
animationData: E.animationData
|
|
1086
1086
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1087
1087
|
[we, l.value === "关节控制"]
|
|
1088
1088
|
]),
|
|
1089
|
-
se(z(yt, { animationData:
|
|
1089
|
+
se(z(yt, { animationData: E.animationData }, null, 8, ["animationData"]), [
|
|
1090
1090
|
[we, l.value === "动画仿真"]
|
|
1091
1091
|
])
|
|
1092
1092
|
]),
|
|
1093
1093
|
_: 1
|
|
1094
1094
|
})
|
|
1095
1095
|
], 512), [
|
|
1096
|
-
[we,
|
|
1096
|
+
[we, D.value]
|
|
1097
1097
|
]),
|
|
1098
1098
|
i.value ? (H(), q("div", on, [
|
|
1099
1099
|
t[20] || (t[20] = h("div", { class: "loading-spinner" }, null, -1)),
|
|
1100
|
-
h("p", null, ae(
|
|
1100
|
+
h("p", null, ae(A.value), 1)
|
|
1101
1101
|
])) : xe("", !0)
|
|
1102
1102
|
]);
|
|
1103
1103
|
};
|