ss-component-new 1.1.607 → 1.1.608
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/{index-CV9GhHVQ.js → index-BgydVX0j.js} +1 -1
- package/dist/{index-BhfNBV_Y.cjs → index-CfJqgH7E.cjs} +1 -1
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +1 -1
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +1 -1
- package/dist/threeModel-BZkfaTio.cjs +1 -0
- package/dist/{threeModel-CGO5VFhW.js → threeModel-DTY2N9TB.js} +554 -551
- package/package.json +1 -1
- package/dist/threeModel-BFW_sW2p.cjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { E as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { c as
|
|
5
|
-
const
|
|
1
|
+
import { ref as E, watch as Ee, createElementBlock as J, openBlock as X, createBlock as He, computed as pe, resolveComponent as Xe, createVNode as k, onMounted as $e, onUnmounted as et, Fragment as tt, renderList as st, createElementVNode as P, createCommentVNode as Pe, toDisplayString as ne, defineComponent as it, normalizeStyle as Ie, normalizeClass as Fe, nextTick as Ne, onBeforeUnmount as ot, withDirectives as le, unref as Z, withCtx as Ue, isRef as ge, vModelRadio as ye, vShow as ve } from "vue";
|
|
2
|
+
import { E as at, V as g, M as re, T as ue, Q as Ye, F as Ve, G as ie, R as nt, P as Me, H as Ge, J as De, K as lt, L as rt, N as ct, W as ht, O as ut, U as pt, X as dt, Y as mt, Z as ft, _ as xe, $ as _t, a0 as Le, a1 as gt, a2 as ke, a3 as yt, a4 as Be, a5 as Je, a6 as We, a7 as Ae, D as vt, a8 as fe, a9 as bt, aa as wt, ab as Pt } from "./index-Y9kXXuBJ.js";
|
|
3
|
+
import { _ as _e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
|
+
import { c as qe } from "./menu-BxkEScwt.js";
|
|
5
|
+
const Ze = { type: "change" }, Oe = { type: "start" }, Qe = { type: "end" }, be = new nt(), Ke = new Me(), Mt = Math.cos(70 * Ge.DEG2RAD), Y = new g(), G = 2 * Math.PI, A = {
|
|
6
6
|
NONE: -1,
|
|
7
7
|
ROTATE: 0,
|
|
8
8
|
DOLLY: 1,
|
|
@@ -11,8 +11,8 @@ const Be = { type: "change" }, Le = { type: "start" }, qe = { type: "end" }, ve
|
|
|
11
11
|
TOUCH_PAN: 4,
|
|
12
12
|
TOUCH_DOLLY_PAN: 5,
|
|
13
13
|
TOUCH_DOLLY_ROTATE: 6
|
|
14
|
-
},
|
|
15
|
-
class
|
|
14
|
+
}, Re = 1e-6;
|
|
15
|
+
class xt extends at {
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new controls instance.
|
|
18
18
|
*
|
|
@@ -20,7 +20,7 @@ class Mt extends ot {
|
|
|
20
20
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
21
21
|
*/
|
|
22
22
|
constructor(e, t = null) {
|
|
23
|
-
super(e, t), this.state = A.NONE, this.target = new
|
|
23
|
+
super(e, t), this.state = A.NONE, this.target = new g(), this.cursor = new g(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: re.ROTATE, MIDDLE: re.DOLLY, RIGHT: re.PAN }, this.touches = { ONE: ue.ROTATE, TWO: ue.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new g(), this._lastQuaternion = new Ye(), this._lastTargetPosition = new g(), this._quat = new Ye().setFromUnitVectors(e.up, new g(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ve(), this._sphericalDelta = new Ve(), this._scale = 1, this._panOffset = new g(), this._rotateStart = new ie(), this._rotateEnd = new ie(), this._rotateDelta = new ie(), this._panStart = new ie(), this._panEnd = new ie(), this._panDelta = new ie(), this._dollyStart = new ie(), this._dollyEnd = new ie(), this._dollyDelta = new ie(), this._dollyDirection = new g(), this._mouse = new ie(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Dt.bind(this), this._onPointerDown = Et.bind(this), this._onPointerUp = Tt.bind(this), this._onContextMenu = Lt.bind(this), this._onMouseWheel = kt.bind(this), this._onKeyDown = At.bind(this), this._onTouchStart = Rt.bind(this), this._onTouchMove = zt.bind(this), this._onMouseDown = Ct.bind(this), this._onMouseMove = St.bind(this), this._interceptControlDown = Ot.bind(this), this._interceptControlUp = jt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
24
24
|
}
|
|
25
25
|
connect(e) {
|
|
26
26
|
super.connect(e), this.domElement.addEventListener("pointerdown", this._onPointerDown), this.domElement.addEventListener("pointercancel", this._onPointerUp), this.domElement.addEventListener("contextmenu", this._onContextMenu), this.domElement.addEventListener("wheel", this._onMouseWheel, { passive: !1 }), this.domElement.getRootNode().addEventListener("keydown", this._interceptControlDown, { passive: !0, capture: !0 }), this.domElement.style.touchAction = "none";
|
|
@@ -81,13 +81,13 @@ class Mt extends ot {
|
|
|
81
81
|
* was called, or the initial state.
|
|
82
82
|
*/
|
|
83
83
|
reset() {
|
|
84
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
84
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(Ze), this.update(), this.state = A.NONE;
|
|
85
85
|
}
|
|
86
86
|
update(e = null) {
|
|
87
87
|
const t = this.object.position;
|
|
88
|
-
|
|
89
|
-
let i = this.minAzimuthAngle,
|
|
90
|
-
isFinite(i) && isFinite(
|
|
88
|
+
Y.copy(t).sub(this.target), Y.applyQuaternion(this._quat), this._spherical.setFromVector3(Y), this.autoRotate && this.state === A.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
|
|
89
|
+
let i = this.minAzimuthAngle, n = this.maxAzimuthAngle;
|
|
90
|
+
isFinite(i) && isFinite(n) && (i < -Math.PI ? i += G : i > Math.PI && (i -= G), n < -Math.PI ? n += G : n > Math.PI && (n -= G), i <= n ? this._spherical.theta = Math.max(i, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + n) / 2 ? Math.max(i, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
|
|
91
91
|
let p = !1;
|
|
92
92
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
93
93
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
@@ -95,28 +95,28 @@ class Mt extends ot {
|
|
|
95
95
|
const v = this._spherical.radius;
|
|
96
96
|
this._spherical.radius = this._clampDistance(this._spherical.radius * this._scale), p = v != this._spherical.radius;
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
98
|
+
if (Y.setFromSpherical(this._spherical), Y.applyQuaternion(this._quatInverse), t.copy(this.target).add(Y), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
|
|
99
99
|
let v = null;
|
|
100
100
|
if (this.object.isPerspectiveCamera) {
|
|
101
|
-
const
|
|
102
|
-
v = this._clampDistance(
|
|
103
|
-
const
|
|
104
|
-
this.object.position.addScaledVector(this._dollyDirection,
|
|
101
|
+
const l = Y.length();
|
|
102
|
+
v = this._clampDistance(l * this._scale);
|
|
103
|
+
const D = l - v;
|
|
104
|
+
this.object.position.addScaledVector(this._dollyDirection, D), this.object.updateMatrixWorld(), p = !!D;
|
|
105
105
|
} else if (this.object.isOrthographicCamera) {
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), p =
|
|
110
|
-
const x = new
|
|
111
|
-
x.unproject(this.object), this.object.position.sub(x).add(
|
|
106
|
+
const l = new g(this._mouse.x, this._mouse.y, 0);
|
|
107
|
+
l.unproject(this.object);
|
|
108
|
+
const D = this.object.zoom;
|
|
109
|
+
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), p = D !== this.object.zoom;
|
|
110
|
+
const x = new g(this._mouse.x, this._mouse.y, 0);
|
|
111
|
+
x.unproject(this.object), this.object.position.sub(x).add(l), this.object.updateMatrixWorld(), v = Y.length();
|
|
112
112
|
} else
|
|
113
113
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
114
|
-
v !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(v).add(this.object.position) : (
|
|
114
|
+
v !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(v).add(this.object.position) : (be.origin.copy(this.object.position), be.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(be.direction)) < Mt ? this.object.lookAt(this.target) : (Ke.setFromNormalAndCoplanarPoint(this.object.up, this.target), be.intersectPlane(Ke, this.target))));
|
|
115
115
|
} else if (this.object.isOrthographicCamera) {
|
|
116
116
|
const v = this.object.zoom;
|
|
117
117
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), v !== this.object.zoom && (this.object.updateProjectionMatrix(), p = !0);
|
|
118
118
|
}
|
|
119
|
-
return this._scale = 1, this._performCursorZoom = !1, p || this._lastPosition.distanceToSquared(this.object.position) >
|
|
119
|
+
return this._scale = 1, this._performCursorZoom = !1, p || this._lastPosition.distanceToSquared(this.object.position) > Re || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Re || this._lastTargetPosition.distanceToSquared(this.target) > Re ? (this.dispatchEvent(Ze), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
120
120
|
}
|
|
121
121
|
_getAutoRotationAngle(e) {
|
|
122
122
|
return e !== null ? G / 60 * this.autoRotateSpeed * e : G / 60 / 60 * this.autoRotateSpeed;
|
|
@@ -132,18 +132,18 @@ class Mt extends ot {
|
|
|
132
132
|
this._sphericalDelta.phi -= e;
|
|
133
133
|
}
|
|
134
134
|
_panLeft(e, t) {
|
|
135
|
-
|
|
135
|
+
Y.setFromMatrixColumn(t, 0), Y.multiplyScalar(-e), this._panOffset.add(Y);
|
|
136
136
|
}
|
|
137
137
|
_panUp(e, t) {
|
|
138
|
-
this.screenSpacePanning === !0 ?
|
|
138
|
+
this.screenSpacePanning === !0 ? Y.setFromMatrixColumn(t, 1) : (Y.setFromMatrixColumn(t, 0), Y.crossVectors(this.object.up, Y)), Y.multiplyScalar(e), this._panOffset.add(Y);
|
|
139
139
|
}
|
|
140
140
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
141
141
|
_pan(e, t) {
|
|
142
142
|
const i = this.domElement;
|
|
143
143
|
if (this.object.isPerspectiveCamera) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
let p =
|
|
144
|
+
const n = this.object.position;
|
|
145
|
+
Y.copy(n).sub(this.target);
|
|
146
|
+
let p = Y.length();
|
|
147
147
|
p *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * e * p / i.clientHeight, this.object.matrix), this._panUp(2 * t * p / i.clientHeight, this.object.matrix);
|
|
148
148
|
} else this.object.isOrthographicCamera ? (this._panLeft(e * (this.object.right - this.object.left) / this.object.zoom / i.clientWidth, this.object.matrix), this._panUp(t * (this.object.top - this.object.bottom) / this.object.zoom / i.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
149
149
|
}
|
|
@@ -157,8 +157,8 @@ class Mt extends ot {
|
|
|
157
157
|
if (!this.zoomToCursor)
|
|
158
158
|
return;
|
|
159
159
|
this._performCursorZoom = !0;
|
|
160
|
-
const i = this.domElement.getBoundingClientRect(),
|
|
161
|
-
this._mouse.x =
|
|
160
|
+
const i = this.domElement.getBoundingClientRect(), n = e - i.left, p = t - i.top, v = i.width, l = i.height;
|
|
161
|
+
this._mouse.x = n / v * 2 - 1, this._mouse.y = -(p / l) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
162
162
|
}
|
|
163
163
|
_clampDistance(e) {
|
|
164
164
|
return Math.max(this.minDistance, Math.min(this.maxDistance, e));
|
|
@@ -211,20 +211,20 @@ class Mt extends ot {
|
|
|
211
211
|
if (this._pointers.length === 1)
|
|
212
212
|
this._rotateStart.set(e.pageX, e.pageY);
|
|
213
213
|
else {
|
|
214
|
-
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x),
|
|
215
|
-
this._rotateStart.set(i,
|
|
214
|
+
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
|
|
215
|
+
this._rotateStart.set(i, n);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
_handleTouchStartPan(e) {
|
|
219
219
|
if (this._pointers.length === 1)
|
|
220
220
|
this._panStart.set(e.pageX, e.pageY);
|
|
221
221
|
else {
|
|
222
|
-
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x),
|
|
223
|
-
this._panStart.set(i,
|
|
222
|
+
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
|
|
223
|
+
this._panStart.set(i, n);
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
_handleTouchStartDolly(e) {
|
|
227
|
-
const t = this._getSecondPointerPosition(e), i = e.pageX - t.x,
|
|
227
|
+
const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, n = e.pageY - t.y, p = Math.sqrt(i * i + n * n);
|
|
228
228
|
this._dollyStart.set(0, p);
|
|
229
229
|
}
|
|
230
230
|
_handleTouchStartDollyPan(e) {
|
|
@@ -237,8 +237,8 @@ class Mt extends ot {
|
|
|
237
237
|
if (this._pointers.length == 1)
|
|
238
238
|
this._rotateEnd.set(e.pageX, e.pageY);
|
|
239
239
|
else {
|
|
240
|
-
const i = this._getSecondPointerPosition(e),
|
|
241
|
-
this._rotateEnd.set(
|
|
240
|
+
const i = this._getSecondPointerPosition(e), n = 0.5 * (e.pageX + i.x), p = 0.5 * (e.pageY + i.y);
|
|
241
|
+
this._rotateEnd.set(n, p);
|
|
242
242
|
}
|
|
243
243
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
244
244
|
const t = this.domElement;
|
|
@@ -248,16 +248,16 @@ class Mt extends ot {
|
|
|
248
248
|
if (this._pointers.length === 1)
|
|
249
249
|
this._panEnd.set(e.pageX, e.pageY);
|
|
250
250
|
else {
|
|
251
|
-
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x),
|
|
252
|
-
this._panEnd.set(i,
|
|
251
|
+
const t = this._getSecondPointerPosition(e), i = 0.5 * (e.pageX + t.x), n = 0.5 * (e.pageY + t.y);
|
|
252
|
+
this._panEnd.set(i, n);
|
|
253
253
|
}
|
|
254
254
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
255
255
|
}
|
|
256
256
|
_handleTouchMoveDolly(e) {
|
|
257
|
-
const t = this._getSecondPointerPosition(e), i = e.pageX - t.x,
|
|
257
|
+
const t = this._getSecondPointerPosition(e), i = e.pageX - t.x, n = e.pageY - t.y, p = Math.sqrt(i * i + n * n);
|
|
258
258
|
this._dollyEnd.set(0, p), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
259
|
-
const v = (e.pageX + t.x) * 0.5,
|
|
260
|
-
this._updateZoomParameters(v,
|
|
259
|
+
const v = (e.pageX + t.x) * 0.5, l = (e.pageY + t.y) * 0.5;
|
|
260
|
+
this._updateZoomParameters(v, l);
|
|
261
261
|
}
|
|
262
262
|
_handleTouchMoveDollyPan(e) {
|
|
263
263
|
this.enableZoom && this._handleTouchMoveDolly(e), this.enablePan && this._handleTouchMovePan(e);
|
|
@@ -308,16 +308,16 @@ class Mt extends ot {
|
|
|
308
308
|
return e.ctrlKey && !this._controlActive && (i.deltaY *= 10), i;
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
function
|
|
312
|
-
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(
|
|
311
|
+
function Et(a) {
|
|
312
|
+
this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(a.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(a) && (this._addPointer(a), a.pointerType === "touch" ? this._onTouchStart(a) : this._onMouseDown(a)));
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
this.enabled !== !1 && (
|
|
314
|
+
function Dt(a) {
|
|
315
|
+
this.enabled !== !1 && (a.pointerType === "touch" ? this._onTouchMove(a) : this._onMouseMove(a));
|
|
316
316
|
}
|
|
317
|
-
function
|
|
318
|
-
switch (this._removePointer(
|
|
317
|
+
function Tt(a) {
|
|
318
|
+
switch (this._removePointer(a), this._pointers.length) {
|
|
319
319
|
case 0:
|
|
320
|
-
this.domElement.releasePointerCapture(
|
|
320
|
+
this.domElement.releasePointerCapture(a.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Qe), this.state = A.NONE;
|
|
321
321
|
break;
|
|
322
322
|
case 1:
|
|
323
323
|
const e = this._pointers[0], t = this._pointerPositions[e];
|
|
@@ -325,9 +325,9 @@ function Dt(o) {
|
|
|
325
325
|
break;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
|
-
function
|
|
328
|
+
function Ct(a) {
|
|
329
329
|
let e;
|
|
330
|
-
switch (
|
|
330
|
+
switch (a.button) {
|
|
331
331
|
case 0:
|
|
332
332
|
e = this.mouseButtons.LEFT;
|
|
333
333
|
break;
|
|
@@ -341,66 +341,66 @@ function Tt(o) {
|
|
|
341
341
|
e = -1;
|
|
342
342
|
}
|
|
343
343
|
switch (e) {
|
|
344
|
-
case
|
|
344
|
+
case re.DOLLY:
|
|
345
345
|
if (this.enableZoom === !1) return;
|
|
346
|
-
this._handleMouseDownDolly(
|
|
346
|
+
this._handleMouseDownDolly(a), this.state = A.DOLLY;
|
|
347
347
|
break;
|
|
348
|
-
case
|
|
349
|
-
if (
|
|
348
|
+
case re.ROTATE:
|
|
349
|
+
if (a.ctrlKey || a.metaKey || a.shiftKey) {
|
|
350
350
|
if (this.enablePan === !1) return;
|
|
351
|
-
this._handleMouseDownPan(
|
|
351
|
+
this._handleMouseDownPan(a), this.state = A.PAN;
|
|
352
352
|
} else {
|
|
353
353
|
if (this.enableRotate === !1) return;
|
|
354
|
-
this._handleMouseDownRotate(
|
|
354
|
+
this._handleMouseDownRotate(a), this.state = A.ROTATE;
|
|
355
355
|
}
|
|
356
356
|
break;
|
|
357
|
-
case
|
|
358
|
-
if (
|
|
357
|
+
case re.PAN:
|
|
358
|
+
if (a.ctrlKey || a.metaKey || a.shiftKey) {
|
|
359
359
|
if (this.enableRotate === !1) return;
|
|
360
|
-
this._handleMouseDownRotate(
|
|
360
|
+
this._handleMouseDownRotate(a), this.state = A.ROTATE;
|
|
361
361
|
} else {
|
|
362
362
|
if (this.enablePan === !1) return;
|
|
363
|
-
this._handleMouseDownPan(
|
|
363
|
+
this._handleMouseDownPan(a), this.state = A.PAN;
|
|
364
364
|
}
|
|
365
365
|
break;
|
|
366
366
|
default:
|
|
367
367
|
this.state = A.NONE;
|
|
368
368
|
}
|
|
369
|
-
this.state !== A.NONE && this.dispatchEvent(
|
|
369
|
+
this.state !== A.NONE && this.dispatchEvent(Oe);
|
|
370
370
|
}
|
|
371
|
-
function
|
|
371
|
+
function St(a) {
|
|
372
372
|
switch (this.state) {
|
|
373
373
|
case A.ROTATE:
|
|
374
374
|
if (this.enableRotate === !1) return;
|
|
375
|
-
this._handleMouseMoveRotate(
|
|
375
|
+
this._handleMouseMoveRotate(a);
|
|
376
376
|
break;
|
|
377
377
|
case A.DOLLY:
|
|
378
378
|
if (this.enableZoom === !1) return;
|
|
379
|
-
this._handleMouseMoveDolly(
|
|
379
|
+
this._handleMouseMoveDolly(a);
|
|
380
380
|
break;
|
|
381
381
|
case A.PAN:
|
|
382
382
|
if (this.enablePan === !1) return;
|
|
383
|
-
this._handleMouseMovePan(
|
|
383
|
+
this._handleMouseMovePan(a);
|
|
384
384
|
break;
|
|
385
385
|
}
|
|
386
386
|
}
|
|
387
|
-
function
|
|
388
|
-
this.enabled === !1 || this.enableZoom === !1 || this.state !== A.NONE || (
|
|
387
|
+
function kt(a) {
|
|
388
|
+
this.enabled === !1 || this.enableZoom === !1 || this.state !== A.NONE || (a.preventDefault(), this.dispatchEvent(Oe), this._handleMouseWheel(this._customWheelEvent(a)), this.dispatchEvent(Qe));
|
|
389
389
|
}
|
|
390
|
-
function
|
|
391
|
-
this.enabled !== !1 && this._handleKeyDown(
|
|
390
|
+
function At(a) {
|
|
391
|
+
this.enabled !== !1 && this._handleKeyDown(a);
|
|
392
392
|
}
|
|
393
|
-
function
|
|
394
|
-
switch (this._trackPointer(
|
|
393
|
+
function Rt(a) {
|
|
394
|
+
switch (this._trackPointer(a), this._pointers.length) {
|
|
395
395
|
case 1:
|
|
396
396
|
switch (this.touches.ONE) {
|
|
397
397
|
case ue.ROTATE:
|
|
398
398
|
if (this.enableRotate === !1) return;
|
|
399
|
-
this._handleTouchStartRotate(
|
|
399
|
+
this._handleTouchStartRotate(a), this.state = A.TOUCH_ROTATE;
|
|
400
400
|
break;
|
|
401
401
|
case ue.PAN:
|
|
402
402
|
if (this.enablePan === !1) return;
|
|
403
|
-
this._handleTouchStartPan(
|
|
403
|
+
this._handleTouchStartPan(a), this.state = A.TOUCH_PAN;
|
|
404
404
|
break;
|
|
405
405
|
default:
|
|
406
406
|
this.state = A.NONE;
|
|
@@ -410,11 +410,11 @@ function At(o) {
|
|
|
410
410
|
switch (this.touches.TWO) {
|
|
411
411
|
case ue.DOLLY_PAN:
|
|
412
412
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
413
|
-
this._handleTouchStartDollyPan(
|
|
413
|
+
this._handleTouchStartDollyPan(a), this.state = A.TOUCH_DOLLY_PAN;
|
|
414
414
|
break;
|
|
415
415
|
case ue.DOLLY_ROTATE:
|
|
416
416
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
417
|
-
this._handleTouchStartDollyRotate(
|
|
417
|
+
this._handleTouchStartDollyRotate(a), this.state = A.TOUCH_DOLLY_ROTATE;
|
|
418
418
|
break;
|
|
419
419
|
default:
|
|
420
420
|
this.state = A.NONE;
|
|
@@ -423,53 +423,53 @@ function At(o) {
|
|
|
423
423
|
default:
|
|
424
424
|
this.state = A.NONE;
|
|
425
425
|
}
|
|
426
|
-
this.state !== A.NONE && this.dispatchEvent(
|
|
426
|
+
this.state !== A.NONE && this.dispatchEvent(Oe);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
429
|
-
switch (this._trackPointer(
|
|
428
|
+
function zt(a) {
|
|
429
|
+
switch (this._trackPointer(a), this.state) {
|
|
430
430
|
case A.TOUCH_ROTATE:
|
|
431
431
|
if (this.enableRotate === !1) return;
|
|
432
|
-
this._handleTouchMoveRotate(
|
|
432
|
+
this._handleTouchMoveRotate(a), this.update();
|
|
433
433
|
break;
|
|
434
434
|
case A.TOUCH_PAN:
|
|
435
435
|
if (this.enablePan === !1) return;
|
|
436
|
-
this._handleTouchMovePan(
|
|
436
|
+
this._handleTouchMovePan(a), this.update();
|
|
437
437
|
break;
|
|
438
438
|
case A.TOUCH_DOLLY_PAN:
|
|
439
439
|
if (this.enableZoom === !1 && this.enablePan === !1) return;
|
|
440
|
-
this._handleTouchMoveDollyPan(
|
|
440
|
+
this._handleTouchMoveDollyPan(a), this.update();
|
|
441
441
|
break;
|
|
442
442
|
case A.TOUCH_DOLLY_ROTATE:
|
|
443
443
|
if (this.enableZoom === !1 && this.enableRotate === !1) return;
|
|
444
|
-
this._handleTouchMoveDollyRotate(
|
|
444
|
+
this._handleTouchMoveDollyRotate(a), this.update();
|
|
445
445
|
break;
|
|
446
446
|
default:
|
|
447
447
|
this.state = A.NONE;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
this.enabled !== !1 &&
|
|
450
|
+
function Lt(a) {
|
|
451
|
+
this.enabled !== !1 && a.preventDefault();
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
|
|
453
|
+
function Ot(a) {
|
|
454
|
+
a.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
455
455
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
456
|
+
function jt(a) {
|
|
457
|
+
a.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
458
458
|
}
|
|
459
|
-
function
|
|
460
|
-
let e = null, t = null, i = null,
|
|
461
|
-
const x =
|
|
462
|
-
if (!
|
|
463
|
-
e = new
|
|
464
|
-
const m =
|
|
465
|
-
t = new
|
|
459
|
+
function It(a) {
|
|
460
|
+
let e = null, t = null, i = null, n = null, p = null, v = null, l = null, D = null;
|
|
461
|
+
const x = E([]), z = E(new g()), O = E(new g()), I = () => {
|
|
462
|
+
if (!a.value) return;
|
|
463
|
+
e = new lt(), e.background = new rt(15790320);
|
|
464
|
+
const m = a.value;
|
|
465
|
+
t = new ct(75, m.clientWidth / m.clientHeight, 0.1, 1e4), t.position.set(8, -8, 6), t.up.set(0, 0, 1), t.lookAt(0, 0, 0), i = new ht({
|
|
466
466
|
antialias: !0,
|
|
467
467
|
alpha: !0
|
|
468
|
-
}), i.setSize(m.clientWidth, m.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type =
|
|
468
|
+
}), i.setSize(m.clientWidth, m.clientHeight), i.localClippingEnabled = !0, i.shadowMap.enabled = !0, i.shadowMap.type = ut, i.toneMapping = pt, i.toneMappingExposure = 1, i.outputColorSpace = dt, m.appendChild(i.domElement), n = new xt(t, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
|
|
469
469
|
LEFT: null,
|
|
470
|
-
MIDDLE:
|
|
471
|
-
RIGHT:
|
|
472
|
-
},
|
|
470
|
+
MIDDLE: re.PAN,
|
|
471
|
+
RIGHT: re.ROTATE
|
|
472
|
+
}, n.panSpeed = 0.7, p = new mt(t, i, {
|
|
473
473
|
container: m,
|
|
474
474
|
type: "cube",
|
|
475
475
|
placement: "top-right",
|
|
@@ -499,58 +499,58 @@ function jt(o) {
|
|
|
499
499
|
back: {
|
|
500
500
|
label: "Bottom"
|
|
501
501
|
}
|
|
502
|
-
}), p.attachControls(
|
|
503
|
-
},
|
|
504
|
-
|
|
502
|
+
}), p.attachControls(n), _(), s();
|
|
503
|
+
}, h = (m, u) => {
|
|
504
|
+
l && (e.remove(l), l.dispose()), D && (e.remove(D), D.geometry.dispose(), D.material.dispose());
|
|
505
505
|
const T = Math.min(Math.max(Math.floor(m / 20), 30), 40);
|
|
506
|
-
|
|
507
|
-
const
|
|
506
|
+
l = new ft(m, T, 13421772, 14540253), l.rotateX(Math.PI / 2), l.position.copy(u), e.add(l);
|
|
507
|
+
const V = new xe(m, m), R = new _t({
|
|
508
508
|
opacity: 0.3,
|
|
509
509
|
// 阴影透明度
|
|
510
510
|
color: 0
|
|
511
511
|
});
|
|
512
|
-
|
|
513
|
-
},
|
|
512
|
+
D = new Le(V, R), D.position.copy(u), D.position.z -= 0.01, D.receiveShadow = !0, e.add(D);
|
|
513
|
+
}, C = () => {
|
|
514
514
|
if (x.value.length === 0)
|
|
515
515
|
return;
|
|
516
|
-
const m = new
|
|
516
|
+
const m = new De();
|
|
517
517
|
let u = !1;
|
|
518
518
|
if (x.value.forEach((W) => {
|
|
519
519
|
if (W.userData.boundingBox)
|
|
520
520
|
m.union(W.userData.boundingBox), u = !0;
|
|
521
521
|
else if (W.userData.modelId && modelBoundingBoxes.has(W.userData.modelId)) {
|
|
522
|
-
const
|
|
523
|
-
m.union(
|
|
522
|
+
const te = modelBoundingBoxes.get(W.userData.modelId);
|
|
523
|
+
m.union(te.box), u = !0;
|
|
524
524
|
} else
|
|
525
525
|
m.expandByObject(W), u = !0;
|
|
526
526
|
}), !u) {
|
|
527
527
|
console.warn("无法计算包围盒,网格更新失败");
|
|
528
528
|
return;
|
|
529
529
|
}
|
|
530
|
-
const T = m.getSize(new
|
|
531
|
-
|
|
532
|
-
|
|
530
|
+
const T = m.getSize(new g()), V = m.getCenter(new g()), R = Math.max(T.x, T.y, T.z), oe = Math.max(R * 8, 50), F = new g(
|
|
531
|
+
V.x,
|
|
532
|
+
V.y,
|
|
533
533
|
m.min.z
|
|
534
534
|
// 模型的最底部
|
|
535
535
|
);
|
|
536
|
-
|
|
537
|
-
},
|
|
538
|
-
const m = new
|
|
536
|
+
h(oe, F);
|
|
537
|
+
}, _ = () => {
|
|
538
|
+
const m = new gt(4210752, 0.6);
|
|
539
539
|
e.add(m);
|
|
540
|
-
const u = new
|
|
540
|
+
const u = new ke(16777215, 2);
|
|
541
541
|
u.position.set(10, 10, 8), u.castShadow = !0, u.shadow.mapSize.width = 4096, u.shadow.mapSize.height = 4096, u.shadow.camera.near = 0.5, u.shadow.camera.far = 50, u.shadow.camera.left = -50, u.shadow.camera.right = 50, u.shadow.camera.top = 50, u.shadow.camera.bottom = -50, e.add(u);
|
|
542
|
-
const T = new
|
|
542
|
+
const T = new ke(16777215, 0.8);
|
|
543
543
|
T.position.set(-8, -8, 6), e.add(T);
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const R = new
|
|
544
|
+
const V = new ke(16777215, 0.6);
|
|
545
|
+
V.position.set(0, -15, 2), e.add(V);
|
|
546
|
+
const R = new yt(16777215, 4473924, 0.8);
|
|
547
547
|
e.add(R);
|
|
548
|
-
const oe = new
|
|
548
|
+
const oe = new Be(16777215, 1, 50);
|
|
549
549
|
oe.position.set(15, 15, 15), e.add(oe);
|
|
550
|
-
const
|
|
551
|
-
|
|
550
|
+
const F = new Be(16777215, 0.5, 50);
|
|
551
|
+
F.position.set(-15, -15, 15), e.add(F);
|
|
552
552
|
}, s = () => {
|
|
553
|
-
v = requestAnimationFrame(s),
|
|
553
|
+
v = requestAnimationFrame(s), n && n.update(), i && e && t && i.render(e, t), p && p.render();
|
|
554
554
|
}, d = (m) => {
|
|
555
555
|
[
|
|
556
556
|
"map",
|
|
@@ -580,36 +580,36 @@ function jt(o) {
|
|
|
580
580
|
initialCameraPosition: z,
|
|
581
581
|
initialTargetPosition: O,
|
|
582
582
|
// 方法
|
|
583
|
-
initThreeJS:
|
|
583
|
+
initThreeJS: I,
|
|
584
584
|
handleResize: () => {
|
|
585
|
-
if (!
|
|
586
|
-
const m =
|
|
585
|
+
if (!a.value || !t || !i || !p) return;
|
|
586
|
+
const m = a.value, u = m.clientWidth, T = m.clientHeight;
|
|
587
587
|
t.aspect = u / T, t.updateProjectionMatrix(), i.setSize(u, T), p.update();
|
|
588
588
|
},
|
|
589
589
|
fitCameraToAllModels: (m) => {
|
|
590
|
-
if (!t || !
|
|
591
|
-
const u = new
|
|
590
|
+
if (!t || !n || x.value.length === 0) return;
|
|
591
|
+
const u = new De();
|
|
592
592
|
let T = !1;
|
|
593
|
-
if (x.value.forEach((
|
|
594
|
-
if (
|
|
595
|
-
u.union(
|
|
596
|
-
else if (
|
|
597
|
-
const de = m.get(
|
|
593
|
+
if (x.value.forEach((te) => {
|
|
594
|
+
if (te.userData.boundingBox)
|
|
595
|
+
u.union(te.userData.boundingBox), T = !0;
|
|
596
|
+
else if (te.userData.modelId && m.has(te.userData.modelId)) {
|
|
597
|
+
const de = m.get(te.userData.modelId);
|
|
598
598
|
u.union(de.box), T = !0;
|
|
599
599
|
} else
|
|
600
|
-
u.expandByObject(
|
|
600
|
+
u.expandByObject(te), T = !0;
|
|
601
601
|
}), !T) {
|
|
602
602
|
console.warn("无法计算包围盒");
|
|
603
603
|
return;
|
|
604
604
|
}
|
|
605
|
-
const
|
|
606
|
-
t.position.copy(W), t.lookAt(R),
|
|
605
|
+
const V = u.getSize(new g()), R = u.getCenter(new g()), F = Math.max(V.x, V.y, V.z) * 0.8, W = new g(R.x + F, R.y - F, R.z + F);
|
|
606
|
+
t.position.copy(W), t.lookAt(R), n.target.copy(R), n.update(), z.value.copy(W), O.value.copy(R), C();
|
|
607
607
|
},
|
|
608
608
|
getThreeJSObjects: () => ({
|
|
609
609
|
scene: e,
|
|
610
610
|
camera: t,
|
|
611
611
|
renderer: i,
|
|
612
|
-
controls:
|
|
612
|
+
controls: n,
|
|
613
613
|
gizmo: p
|
|
614
614
|
}),
|
|
615
615
|
clearAllModels: () => {
|
|
@@ -619,68 +619,68 @@ function jt(o) {
|
|
|
619
619
|
});
|
|
620
620
|
const m = [];
|
|
621
621
|
e.children.forEach((u) => {
|
|
622
|
-
!u.isLight && !u.isCamera && u.type !== "GridHelper" && u !==
|
|
622
|
+
!u.isLight && !u.isCamera && u.type !== "GridHelper" && u !== D && m.push(u);
|
|
623
623
|
}), m.forEach((u) => {
|
|
624
624
|
e.remove(u), w(u);
|
|
625
|
-
}), x.value = [],
|
|
625
|
+
}), x.value = [], C();
|
|
626
626
|
},
|
|
627
627
|
cleanup: () => {
|
|
628
|
-
v && cancelAnimationFrame(v),
|
|
628
|
+
v && cancelAnimationFrame(v), l && l.dispose(), D && (D.geometry.dispose(), D.material.dispose()), i && i.dispose(), n && n.dispose(), p && p.dispose();
|
|
629
629
|
},
|
|
630
|
-
updateGridForModels:
|
|
630
|
+
updateGridForModels: C
|
|
631
631
|
};
|
|
632
632
|
}
|
|
633
|
-
function
|
|
634
|
-
const t =
|
|
635
|
-
let i = null,
|
|
633
|
+
function Ft(a, e) {
|
|
634
|
+
const t = E(!1);
|
|
635
|
+
let i = null, n = 12700, p = new g(), v = new g(), l = new g(), D = 0, x = null;
|
|
636
636
|
const z = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, O = (s) => {
|
|
637
|
-
const d = new
|
|
637
|
+
const d = new g(), w = D * 1.2, j = new g(l.x + w, l.y, l.z), $ = new g(l.x, l.y + w, l.z), N = new g(l.x, l.y - w, l.z);
|
|
638
638
|
if (s <= 0.567) {
|
|
639
|
-
const
|
|
640
|
-
d.x =
|
|
639
|
+
const H = s / 0.567 * Math.PI * 2;
|
|
640
|
+
d.x = l.x + Math.cos(H) * w, d.z = l.z + Math.sin(H) * w, d.y = l.y;
|
|
641
641
|
} else if (s <= 0.724) {
|
|
642
|
-
const
|
|
643
|
-
d.lerpVectors(j, $,
|
|
642
|
+
const K = (s - 0.567) / 0.157, H = z(K);
|
|
643
|
+
d.lerpVectors(j, $, H);
|
|
644
644
|
} else if (s <= 0.881) {
|
|
645
|
-
const
|
|
646
|
-
d.x =
|
|
645
|
+
const K = (s - 0.724) / 0.157, m = z(K) * Math.PI;
|
|
646
|
+
d.x = l.x + Math.sin(m) * w, d.y = l.y + Math.cos(m) * w, d.z = l.z;
|
|
647
647
|
} else {
|
|
648
|
-
const
|
|
649
|
-
d.lerpVectors(
|
|
648
|
+
const K = (s - 0.881) / 0.119, H = z(K);
|
|
649
|
+
d.lerpVectors(N, p, H);
|
|
650
650
|
}
|
|
651
651
|
return d;
|
|
652
|
-
},
|
|
653
|
-
const { camera: s, controls: d } =
|
|
652
|
+
}, I = () => {
|
|
653
|
+
const { camera: s, controls: d } = a();
|
|
654
654
|
if (!s || !d) return;
|
|
655
655
|
i || (i = Date.now());
|
|
656
|
-
const w = Date.now() - i, j = Math.min(w /
|
|
656
|
+
const w = Date.now() - i, j = Math.min(w / n, 1);
|
|
657
657
|
if (j >= 1) {
|
|
658
|
-
|
|
658
|
+
C();
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
661
661
|
const $ = O(j);
|
|
662
|
-
s.position.copy($), s.lookAt(
|
|
663
|
-
},
|
|
662
|
+
s.position.copy($), s.lookAt(l), d.target.copy(l), x = requestAnimationFrame(I);
|
|
663
|
+
}, h = () => {
|
|
664
664
|
if (e.value.length === 0) return;
|
|
665
|
-
const { camera: s, controls: d } =
|
|
665
|
+
const { camera: s, controls: d } = a();
|
|
666
666
|
if (!s || !d) return;
|
|
667
667
|
p.copy(s.position), v.copy(d.target);
|
|
668
|
-
const w = new
|
|
668
|
+
const w = new De();
|
|
669
669
|
e.value.forEach((u) => {
|
|
670
670
|
w.expandByObject(u);
|
|
671
671
|
});
|
|
672
|
-
const j = w.getSize(new
|
|
673
|
-
|
|
674
|
-
const $ = new
|
|
672
|
+
const j = w.getSize(new g());
|
|
673
|
+
l = w.getCenter(new g()), D = Math.max(j.x, j.y, j.z) * 1.2;
|
|
674
|
+
const $ = new g(l.x + D * 1.2, l.y, l.z);
|
|
675
675
|
d.enabled = !1;
|
|
676
|
-
const
|
|
677
|
-
const u = Date.now() -
|
|
678
|
-
s.position.lerpVectors(
|
|
676
|
+
const N = s.position.clone(), K = 1e3, H = Date.now(), m = () => {
|
|
677
|
+
const u = Date.now() - H, T = Math.min(u / K, 1), V = z(T);
|
|
678
|
+
s.position.lerpVectors(N, $, V), s.lookAt(l), d.target.copy(l), T < 1 ? requestAnimationFrame(m) : (t.value = !0, i = null, I());
|
|
679
679
|
};
|
|
680
680
|
m();
|
|
681
|
-
},
|
|
681
|
+
}, C = () => {
|
|
682
682
|
t.value = !1, i = null, x && (cancelAnimationFrame(x), x = null);
|
|
683
|
-
const { controls: s } =
|
|
683
|
+
const { controls: s } = a();
|
|
684
684
|
s && (s.enabled = !0, s.target.copy(v));
|
|
685
685
|
};
|
|
686
686
|
return {
|
|
@@ -688,124 +688,124 @@ function It(o, e) {
|
|
|
688
688
|
toggleAnimation: () => {
|
|
689
689
|
if (t.value) {
|
|
690
690
|
t.value = !1, i = null, x && (cancelAnimationFrame(x), x = null);
|
|
691
|
-
const { camera: s, controls: d } =
|
|
691
|
+
const { camera: s, controls: d } = a();
|
|
692
692
|
if (!s || !d) return;
|
|
693
693
|
d.enabled = !0;
|
|
694
|
-
const w = s.position.clone(), j = d.target.clone(), $ = 1500,
|
|
695
|
-
const
|
|
696
|
-
s.position.lerpVectors(w, p, u), d.target.lerpVectors(j, v, u), m < 1 && requestAnimationFrame(
|
|
694
|
+
const w = s.position.clone(), j = d.target.clone(), $ = 1500, N = Date.now(), K = () => {
|
|
695
|
+
const H = Date.now() - N, m = Math.min(H / $, 1), u = z(m);
|
|
696
|
+
s.position.lerpVectors(w, p, u), d.target.lerpVectors(j, v, u), m < 1 && requestAnimationFrame(K);
|
|
697
697
|
};
|
|
698
|
-
|
|
698
|
+
K();
|
|
699
699
|
} else
|
|
700
|
-
|
|
700
|
+
h();
|
|
701
701
|
},
|
|
702
|
-
startAnimation:
|
|
703
|
-
stopAnimation:
|
|
702
|
+
startAnimation: h,
|
|
703
|
+
stopAnimation: C
|
|
704
704
|
};
|
|
705
705
|
}
|
|
706
|
-
function
|
|
707
|
-
const t =
|
|
708
|
-
let
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
new
|
|
706
|
+
function Nt(a, e) {
|
|
707
|
+
const t = E(!1), i = E("none");
|
|
708
|
+
let n = [], p = [], v = new De(), l = new g();
|
|
709
|
+
const D = () => {
|
|
710
|
+
n = [
|
|
711
|
+
new Me(new g(1, 0, 0), 0),
|
|
712
712
|
// X轴平面
|
|
713
|
-
new
|
|
713
|
+
new Me(new g(0, 1, 0), 0),
|
|
714
714
|
// Y轴平面
|
|
715
|
-
new
|
|
715
|
+
new Me(new g(0, 0, 1), 0)
|
|
716
716
|
// Z轴平面
|
|
717
717
|
];
|
|
718
718
|
}, x = () => {
|
|
719
|
-
v.makeEmpty(), e.value.forEach((
|
|
720
|
-
v.expandByObject(
|
|
721
|
-
}),
|
|
722
|
-
}, z = (
|
|
723
|
-
const s = v.getSize(new
|
|
719
|
+
v.makeEmpty(), e.value.forEach((_) => {
|
|
720
|
+
v.expandByObject(_);
|
|
721
|
+
}), l = v.getCenter(new g());
|
|
722
|
+
}, z = (_) => {
|
|
723
|
+
const s = v.getSize(new g());
|
|
724
724
|
let d, w, j;
|
|
725
|
-
|
|
726
|
-
const $ = new
|
|
725
|
+
_ === "x" ? (d = new xe(s.z * 1.2, s.y * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(0, Math.PI / 2, 0)) : _ === "y" ? (d = new xe(s.x * 1.2, s.z * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(Math.PI / 2, 0, 0)) : _ === "z" && (d = new xe(s.x * 1.2, s.y * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(0, 0, 0));
|
|
726
|
+
const $ = new Je({
|
|
727
727
|
color: 8900331,
|
|
728
728
|
transparent: !0,
|
|
729
729
|
opacity: 0.3,
|
|
730
|
-
side:
|
|
730
|
+
side: We,
|
|
731
731
|
depthWrite: !1
|
|
732
|
-
}),
|
|
733
|
-
return
|
|
732
|
+
}), N = new Le(d, $);
|
|
733
|
+
return N.position.copy(w), N.rotation.copy(j), N;
|
|
734
734
|
}, O = () => {
|
|
735
|
-
if (
|
|
735
|
+
if (I(), h(), i.value === "none")
|
|
736
736
|
return;
|
|
737
737
|
x();
|
|
738
|
-
let
|
|
739
|
-
if (i.value === "x" ? (
|
|
738
|
+
let _ = null;
|
|
739
|
+
if (i.value === "x" ? (n[0].constant = -l.x, _ = n[0]) : i.value === "y" ? (n[1].constant = -l.y, _ = n[1]) : i.value === "z" && (n[2].constant = -l.z, _ = n[2]), _) {
|
|
740
740
|
e.value.forEach((d) => {
|
|
741
741
|
d.traverse((w) => {
|
|
742
742
|
w.isMesh && w.material && (Array.isArray(w.material) ? w.material.forEach((j) => {
|
|
743
|
-
j.clippingPlanes = [
|
|
744
|
-
}) : w.material.clippingPlanes = [
|
|
743
|
+
j.clippingPlanes = [_];
|
|
744
|
+
}) : w.material.clippingPlanes = [_]);
|
|
745
745
|
});
|
|
746
746
|
});
|
|
747
|
-
const { scene: s } =
|
|
747
|
+
const { scene: s } = a();
|
|
748
748
|
if (s) {
|
|
749
749
|
const d = z(i.value);
|
|
750
750
|
s.add(d), p.push(d);
|
|
751
751
|
}
|
|
752
752
|
}
|
|
753
|
-
},
|
|
754
|
-
e.value.forEach((
|
|
755
|
-
|
|
753
|
+
}, I = () => {
|
|
754
|
+
e.value.forEach((_) => {
|
|
755
|
+
_.traverse((s) => {
|
|
756
756
|
s.isMesh && s.material && (Array.isArray(s.material) ? s.material.forEach((d) => {
|
|
757
757
|
d.clippingPlanes = [];
|
|
758
758
|
}) : s.material.clippingPlanes = []);
|
|
759
759
|
});
|
|
760
760
|
});
|
|
761
|
-
},
|
|
762
|
-
const { scene:
|
|
763
|
-
|
|
764
|
-
|
|
761
|
+
}, h = () => {
|
|
762
|
+
const { scene: _ } = a();
|
|
763
|
+
_ && p.forEach((s) => {
|
|
764
|
+
_.remove(s), s.geometry.dispose(), s.material.dispose();
|
|
765
765
|
}), p = [];
|
|
766
766
|
};
|
|
767
767
|
return {
|
|
768
768
|
isClipping: t,
|
|
769
769
|
activeClippingAxis: i,
|
|
770
770
|
toggleClipping: () => {
|
|
771
|
-
t.value = !t.value, t.value ? (
|
|
771
|
+
t.value = !t.value, t.value ? (D(), e.value.length > 0 && x()) : (i.value = "none", I(), h());
|
|
772
772
|
},
|
|
773
773
|
updateClippingPlanes: O,
|
|
774
|
-
clearClippingPlanes:
|
|
775
|
-
clearClippingMeshes:
|
|
774
|
+
clearClippingPlanes: I,
|
|
775
|
+
clearClippingMeshes: h
|
|
776
776
|
};
|
|
777
777
|
}
|
|
778
|
-
const
|
|
778
|
+
const Ut = { class: "panel-content" }, Yt = {
|
|
779
779
|
__name: "animationTable",
|
|
780
780
|
props: {
|
|
781
781
|
animationData: Object,
|
|
782
782
|
model: Object
|
|
783
783
|
},
|
|
784
|
-
setup(
|
|
785
|
-
const e =
|
|
786
|
-
|
|
787
|
-
const t =
|
|
788
|
-
return
|
|
784
|
+
setup(a) {
|
|
785
|
+
const e = a;
|
|
786
|
+
E();
|
|
787
|
+
const t = E();
|
|
788
|
+
return Ee(
|
|
789
789
|
() => [e == null ? void 0 : e.animationData],
|
|
790
790
|
() => {
|
|
791
|
-
var
|
|
792
|
-
let i = ((
|
|
791
|
+
var n;
|
|
792
|
+
let i = ((n = qe(e == null ? void 0 : e.animationData)) == null ? void 0 : n.动画输出Content) ?? [];
|
|
793
793
|
i && (t.value = i);
|
|
794
794
|
},
|
|
795
795
|
{ deep: !0, immediate: !0 }
|
|
796
|
-
), (i,
|
|
797
|
-
var p, v,
|
|
798
|
-
return X(), J("div",
|
|
799
|
-
(X(), He(
|
|
796
|
+
), (i, n) => {
|
|
797
|
+
var p, v, l;
|
|
798
|
+
return X(), J("div", Ut, [
|
|
799
|
+
(X(), He(vt, {
|
|
800
800
|
itemData: (p = t.value) == null ? void 0 : p.compData,
|
|
801
801
|
key: (v = t.value) == null ? void 0 : v.id,
|
|
802
|
-
index: (
|
|
802
|
+
index: (l = t.value) == null ? void 0 : l.id,
|
|
803
803
|
showHeader: !1
|
|
804
804
|
}, null, 8, ["itemData", "index"]))
|
|
805
805
|
]);
|
|
806
806
|
};
|
|
807
807
|
}
|
|
808
|
-
},
|
|
808
|
+
}, Vt = /* @__PURE__ */ _e(Yt, [["__scopeId", "data-v-02b89b4b"]]), Bt = { class: "panel-content" }, Zt = "id", Kt = {
|
|
809
809
|
__name: "urdfTree",
|
|
810
810
|
props: {
|
|
811
811
|
model: Object,
|
|
@@ -816,83 +816,83 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
816
816
|
expandStrategy: {
|
|
817
817
|
type: String,
|
|
818
818
|
default: "breadth",
|
|
819
|
-
validator: (
|
|
819
|
+
validator: (a) => ["breadth", "firstLevel"].includes(a)
|
|
820
820
|
}
|
|
821
821
|
},
|
|
822
822
|
emits: ["nodeClick"],
|
|
823
|
-
setup(
|
|
824
|
-
const t =
|
|
823
|
+
setup(a, { emit: e }) {
|
|
824
|
+
const t = a, i = e, n = E([]), p = {
|
|
825
825
|
children: "children",
|
|
826
826
|
label: "label"
|
|
827
|
-
}, v = (
|
|
828
|
-
i("nodeClick",
|
|
829
|
-
},
|
|
830
|
-
const
|
|
831
|
-
return Array.isArray(
|
|
827
|
+
}, v = (h) => {
|
|
828
|
+
i("nodeClick", h);
|
|
829
|
+
}, l = (h, C = 0) => {
|
|
830
|
+
const _ = [];
|
|
831
|
+
return Array.isArray(h) && (h == null ? void 0 : h.length) > 0 && h.forEach((s) => {
|
|
832
832
|
if (!(s != null && s.isMesh) && ((s == null ? void 0 : s.type) === "URDFJoint" || (s == null ? void 0 : s.type) === "URDFLink")) {
|
|
833
833
|
const d = {
|
|
834
834
|
name: s == null ? void 0 : s.name,
|
|
835
835
|
label: s == null ? void 0 : s.name,
|
|
836
836
|
show: !0,
|
|
837
|
-
level:
|
|
837
|
+
level: C + 1,
|
|
838
838
|
isPenultimate: !1,
|
|
839
839
|
type: s == null ? void 0 : s.type,
|
|
840
840
|
id: s == null ? void 0 : s.id,
|
|
841
841
|
limit: (s == null ? void 0 : s.limit) ?? "",
|
|
842
|
-
children:
|
|
842
|
+
children: l(s == null ? void 0 : s.children, C + 1),
|
|
843
843
|
path: s == null ? void 0 : s.name
|
|
844
844
|
};
|
|
845
|
-
|
|
845
|
+
_.push(d);
|
|
846
846
|
}
|
|
847
|
-
}),
|
|
848
|
-
},
|
|
849
|
-
name:
|
|
850
|
-
label:
|
|
847
|
+
}), _;
|
|
848
|
+
}, D = (h) => h ? [{
|
|
849
|
+
name: h == null ? void 0 : h.name,
|
|
850
|
+
label: h == null ? void 0 : h.name,
|
|
851
851
|
show: !0,
|
|
852
852
|
level: 1,
|
|
853
853
|
isPenultimate: !1,
|
|
854
|
-
type:
|
|
855
|
-
id:
|
|
856
|
-
limit: (
|
|
857
|
-
children:
|
|
858
|
-
path:
|
|
859
|
-
}] : [], x = (
|
|
860
|
-
const
|
|
861
|
-
for (; s.length > 0 &&
|
|
854
|
+
type: h == null ? void 0 : h.type,
|
|
855
|
+
id: h == null ? void 0 : h.id,
|
|
856
|
+
limit: (h == null ? void 0 : h.limit) ?? "",
|
|
857
|
+
children: l(h == null ? void 0 : h.children, 1),
|
|
858
|
+
path: h == null ? void 0 : h.name
|
|
859
|
+
}] : [], x = (h, C) => {
|
|
860
|
+
const _ = [], s = [...h];
|
|
861
|
+
for (; s.length > 0 && _.length < C; ) {
|
|
862
862
|
const d = s.shift();
|
|
863
|
-
d.children && d.children.length > 0 && (
|
|
863
|
+
d.children && d.children.length > 0 && (_.push(d.id), s.push(...d.children));
|
|
864
864
|
}
|
|
865
|
-
return
|
|
866
|
-
}, z = (
|
|
867
|
-
const
|
|
868
|
-
return
|
|
865
|
+
return _;
|
|
866
|
+
}, z = (h, C) => {
|
|
867
|
+
const _ = [];
|
|
868
|
+
return h.forEach((s) => {
|
|
869
869
|
if (s.children && s.children.length > 0) {
|
|
870
|
-
|
|
871
|
-
const d = s.children.filter((w) => w.children && w.children.length > 0).slice(0,
|
|
872
|
-
|
|
870
|
+
_.push(s.id);
|
|
871
|
+
const d = s.children.filter((w) => w.children && w.children.length > 0).slice(0, C).map((w) => w.id);
|
|
872
|
+
_.push(...d);
|
|
873
873
|
}
|
|
874
|
-
}),
|
|
875
|
-
}, O = pe(() => !
|
|
876
|
-
return
|
|
877
|
-
|
|
878
|
-
(
|
|
879
|
-
|
|
874
|
+
}), _.slice(0, C + 1);
|
|
875
|
+
}, O = pe(() => !n.value || n.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? z(n.value, t.maxExpandCount) : x(n.value, t.maxExpandCount)), I = pe(() => t != null && t.model ? D(t.model) : []);
|
|
876
|
+
return Ee(
|
|
877
|
+
I,
|
|
878
|
+
(h) => {
|
|
879
|
+
n.value = JSON.parse(JSON.stringify(h));
|
|
880
880
|
},
|
|
881
881
|
{ immediate: !0 }
|
|
882
|
-
), (
|
|
883
|
-
const
|
|
884
|
-
return X(), J("div",
|
|
885
|
-
k(
|
|
886
|
-
data:
|
|
882
|
+
), (h, C) => {
|
|
883
|
+
const _ = Xe("el-tree");
|
|
884
|
+
return X(), J("div", Bt, [
|
|
885
|
+
k(_, {
|
|
886
|
+
data: n.value,
|
|
887
887
|
props: p,
|
|
888
888
|
"default-expanded-keys": O.value,
|
|
889
|
-
"node-key":
|
|
889
|
+
"node-key": Zt,
|
|
890
890
|
onNodeClick: v
|
|
891
891
|
}, null, 8, ["data", "default-expanded-keys"])
|
|
892
892
|
]);
|
|
893
893
|
};
|
|
894
894
|
}
|
|
895
|
-
}, Ht = /* @__PURE__ */
|
|
895
|
+
}, Ht = /* @__PURE__ */ _e(Kt, [["__scopeId", "data-v-fde9ea18"]]), Xt = {
|
|
896
896
|
key: 0,
|
|
897
897
|
class: "joints-list"
|
|
898
898
|
}, $t = { class: "joint-info-row" }, Gt = { class: "joint-left" }, Jt = { class: "joint-name" }, Wt = { class: "joint-range" }, qt = { class: "joint-type" }, Qt = {
|
|
@@ -901,158 +901,158 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
901
901
|
}, es = { class: "slider-container" }, ts = ["min", "max", "value", "onInput", "disabled"], ss = { class: "value-display" }, is = { class: "joint-value" }, os = { class: "unit" }, as = {
|
|
902
902
|
key: 1,
|
|
903
903
|
class: "empty-state"
|
|
904
|
-
},
|
|
904
|
+
}, we = 1e-3, ns = 1e3, ze = 60, ls = {
|
|
905
905
|
__name: "jointPanel",
|
|
906
906
|
props: {
|
|
907
907
|
model: Object,
|
|
908
908
|
scene: Object,
|
|
909
909
|
animationData: Object
|
|
910
910
|
},
|
|
911
|
-
setup(
|
|
912
|
-
const t =
|
|
913
|
-
|
|
914
|
-
const i =
|
|
911
|
+
setup(a, { expose: e }) {
|
|
912
|
+
const t = a;
|
|
913
|
+
E(!0);
|
|
914
|
+
const i = E([]), n = E(null), p = E(null), v = E(12.5), l = E(), D = E(1302), x = E(!1), z = E(!1), O = E(0), I = E(0), h = E(null), C = Ge.degToRad, _ = E(1), s = () => ns / ze / _.value;
|
|
915
915
|
let d = [];
|
|
916
|
-
|
|
916
|
+
Ee(
|
|
917
917
|
() => t.animationData,
|
|
918
|
-
(
|
|
919
|
-
var
|
|
920
|
-
console.log(111,
|
|
921
|
-
let b = ((
|
|
918
|
+
(r) => {
|
|
919
|
+
var c;
|
|
920
|
+
console.log(111, r), D.value = r.extra.管长, v.value = r.extra.外径 / 2;
|
|
921
|
+
let b = ((c = qe(r)) == null ? void 0 : c.动画输出) ?? [];
|
|
922
922
|
b && b.length > 0 && (d = b);
|
|
923
923
|
},
|
|
924
924
|
{ deep: !0 }
|
|
925
925
|
), pe(() => d.length > 0);
|
|
926
|
-
const w = (
|
|
927
|
-
if (!
|
|
926
|
+
const w = (r, b = !1) => r === "revolute" ? b ? Math.PI : -Math.PI : r === "prismatic" ? b ? 1 : -1 : 0, j = () => {
|
|
927
|
+
if (!n.value)
|
|
928
928
|
return ElMessage.error("未加载 URDF"), !1;
|
|
929
|
-
let
|
|
930
|
-
return
|
|
931
|
-
b.name === "Pipe_Link" && !
|
|
932
|
-
|
|
929
|
+
let r = null;
|
|
930
|
+
return n.value.traverse((b) => {
|
|
931
|
+
b.name === "Pipe_Link" && !r && b.traverse((c) => {
|
|
932
|
+
c instanceof Le && !r && (r = c);
|
|
933
933
|
});
|
|
934
|
-
}),
|
|
934
|
+
}), r ? (l.value = r, r.material = new Je({
|
|
935
935
|
color: 11184810,
|
|
936
936
|
shininess: 80,
|
|
937
|
-
side:
|
|
937
|
+
side: We
|
|
938
938
|
}), !0) : (ElMessage.error("Pipe_Link 内未找到 Mesh"), !1);
|
|
939
|
-
}, $ = (
|
|
940
|
-
if (!
|
|
939
|
+
}, $ = (r) => {
|
|
940
|
+
if (!r || !r.joints)
|
|
941
941
|
return console.warn("URDF模型没有关节信息"), [];
|
|
942
942
|
let b = null;
|
|
943
|
-
if (
|
|
943
|
+
if (r.traverse((M) => {
|
|
944
944
|
M.name === "Pipe_Link" && !b && (b = M);
|
|
945
945
|
}), b)
|
|
946
|
-
|
|
946
|
+
l.value = b;
|
|
947
947
|
else
|
|
948
948
|
return console.warn("未找到管子模型"), [];
|
|
949
|
-
const
|
|
950
|
-
return Object.keys(
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
949
|
+
const c = [];
|
|
950
|
+
return Object.keys(r.joints).forEach((M) => {
|
|
951
|
+
const f = r.joints[M];
|
|
952
|
+
if (f._jointType === "fixed")
|
|
953
953
|
return;
|
|
954
|
-
const
|
|
955
|
-
lower:
|
|
956
|
-
upper:
|
|
954
|
+
const y = f.limit ? {
|
|
955
|
+
lower: f.limit.lower ?? w(f._jointType, !1),
|
|
956
|
+
upper: f.limit.upper ?? w(f._jointType, !0)
|
|
957
957
|
} : {
|
|
958
|
-
lower: w(
|
|
959
|
-
upper: w(
|
|
958
|
+
lower: w(f._jointType, !1),
|
|
959
|
+
upper: w(f._jointType, !0)
|
|
960
960
|
};
|
|
961
|
-
|
|
961
|
+
c.push({
|
|
962
962
|
name: M,
|
|
963
|
-
type:
|
|
964
|
-
limit:
|
|
965
|
-
currentValue:
|
|
966
|
-
urdfJoint:
|
|
963
|
+
type: f._jointType || "unknown",
|
|
964
|
+
limit: y,
|
|
965
|
+
currentValue: f.angle || 0,
|
|
966
|
+
urdfJoint: f
|
|
967
967
|
});
|
|
968
|
-
}),
|
|
969
|
-
},
|
|
970
|
-
const
|
|
971
|
-
if (!
|
|
968
|
+
}), c.sort((M, f) => M.name.localeCompare(f.name));
|
|
969
|
+
}, N = (r, b) => {
|
|
970
|
+
const c = i.value.find((f) => f.name === r);
|
|
971
|
+
if (!c) return;
|
|
972
972
|
const M = parseFloat(b);
|
|
973
|
-
if (
|
|
974
|
-
const
|
|
975
|
-
|
|
973
|
+
if (c.limit) {
|
|
974
|
+
const f = Math.max(c.limit.lower, Math.min(c.limit.upper, M));
|
|
975
|
+
c.currentValue = f;
|
|
976
976
|
} else
|
|
977
|
-
|
|
978
|
-
t.model && t.model.setJointValue ? t.model.setJointValue(
|
|
979
|
-
},
|
|
977
|
+
c.currentValue = M;
|
|
978
|
+
t.model && t.model.setJointValue ? t.model.setJointValue(r, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
|
|
979
|
+
}, K = (r) => r.reduce((b, c) => {
|
|
980
980
|
let M = 0;
|
|
981
|
-
const
|
|
982
|
-
return
|
|
983
|
-
}, 0),
|
|
984
|
-
const b = [],
|
|
985
|
-
pos: new
|
|
986
|
-
localY: new
|
|
987
|
-
localX: new
|
|
988
|
-
localZ: new
|
|
981
|
+
const f = c.Y ?? 0, y = c.C ?? 0, o = c.R ?? 0;
|
|
982
|
+
return f > 0 && (M += f), y > 0 && o > 0 && (M += o * C(y)), b + M;
|
|
983
|
+
}, 0), H = (r) => {
|
|
984
|
+
const b = [], c = r.Y ?? 0, M = r.B ?? 0, f = r.C ?? 0, y = r.R ?? 0, o = {
|
|
985
|
+
pos: new g(0, 0, 0),
|
|
986
|
+
localY: new g(0, 1, 0),
|
|
987
|
+
localX: new g(1, 0, 0),
|
|
988
|
+
localZ: new g(0, 0, 1)
|
|
989
989
|
};
|
|
990
|
-
if (!
|
|
991
|
-
if (b.push(
|
|
992
|
-
const
|
|
993
|
-
|
|
990
|
+
if (!c && !f) return b;
|
|
991
|
+
if (b.push(o.pos.clone()), M !== 0) {
|
|
992
|
+
const U = new fe().makeRotationAxis(o.localY, C(M));
|
|
993
|
+
o.localX.applyMatrix4(U), o.localZ.applyMatrix4(U);
|
|
994
994
|
}
|
|
995
|
-
if (
|
|
996
|
-
const
|
|
995
|
+
if (c > 0 && (o.pos.add(o.localY.clone().multiplyScalar(c * we)), b.push(o.pos.clone())), f > 0 && y > 0) {
|
|
996
|
+
const U = C(f), B = y * we, q = o.pos.clone().add(o.localX.clone().multiplyScalar(-B)), ae = Math.max(16, Math.ceil(f / 5));
|
|
997
997
|
for (let Q = 1; Q <= ae; Q++) {
|
|
998
|
-
const
|
|
999
|
-
b.push(
|
|
998
|
+
const S = U * Q / ae, ee = new fe().makeRotationAxis(o.localZ, S), se = o.localX.clone().multiplyScalar(B).applyMatrix4(ee), ce = q.clone().add(se);
|
|
999
|
+
b.push(ce);
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
return b;
|
|
1003
|
-
}, m = (
|
|
1004
|
-
const b = d.slice(0,
|
|
1005
|
-
|
|
1006
|
-
const
|
|
1007
|
-
M > 0 &&
|
|
1008
|
-
let
|
|
1009
|
-
pos:
|
|
1010
|
-
localY: new
|
|
1011
|
-
localX: new
|
|
1012
|
-
localZ: new
|
|
1003
|
+
}, m = (r) => {
|
|
1004
|
+
const b = d.slice(0, r + 1), c = K(b), M = Math.max(0, D.value - c), f = [];
|
|
1005
|
+
f.push(new g(0, 0, 0));
|
|
1006
|
+
const y = new g(0, M * we, 0);
|
|
1007
|
+
M > 0 && f.push(y);
|
|
1008
|
+
let o = {
|
|
1009
|
+
pos: y.clone(),
|
|
1010
|
+
localY: new g(0, 1, 0),
|
|
1011
|
+
localX: new g(1, 0, 0),
|
|
1012
|
+
localZ: new g(0, 0, 1)
|
|
1013
1013
|
};
|
|
1014
|
-
const
|
|
1015
|
-
for (let
|
|
1016
|
-
const q = b[
|
|
1014
|
+
const U = [];
|
|
1015
|
+
for (let B = b.length - 1; B >= 0; B--) {
|
|
1016
|
+
const q = b[B], ae = H(q);
|
|
1017
1017
|
if (ae.length > 0) {
|
|
1018
1018
|
const Q = ae.map((se) => {
|
|
1019
|
-
const
|
|
1020
|
-
return
|
|
1019
|
+
const ce = se.clone(), je = new fe();
|
|
1020
|
+
return je.makeBasis(o.localX, o.localY, o.localZ), ce.applyMatrix4(je), ce.add(o.pos);
|
|
1021
1021
|
});
|
|
1022
|
-
|
|
1023
|
-
const
|
|
1024
|
-
|
|
1025
|
-
const
|
|
1026
|
-
if (
|
|
1027
|
-
const se = new
|
|
1028
|
-
|
|
1022
|
+
U.push(Q);
|
|
1023
|
+
const S = Q[Q.length - 1];
|
|
1024
|
+
o.pos = S.clone();
|
|
1025
|
+
const ee = q.B ?? 0, he = q.C ?? 0;
|
|
1026
|
+
if (ee !== 0) {
|
|
1027
|
+
const se = new fe().makeRotationAxis(o.localY, C(ee));
|
|
1028
|
+
o.localX.applyMatrix4(se), o.localZ.applyMatrix4(se);
|
|
1029
1029
|
}
|
|
1030
|
-
if (
|
|
1031
|
-
const se =
|
|
1032
|
-
|
|
1030
|
+
if (he > 0) {
|
|
1031
|
+
const se = C(he), ce = new fe().makeRotationAxis(o.localZ, se);
|
|
1032
|
+
o.localY.applyMatrix4(ce), o.localX.applyMatrix4(ce);
|
|
1033
1033
|
}
|
|
1034
1034
|
}
|
|
1035
1035
|
}
|
|
1036
|
-
for (const
|
|
1037
|
-
|
|
1038
|
-
|
|
1036
|
+
for (const B of U)
|
|
1037
|
+
B.length > 1 && f.push(...B.slice(1));
|
|
1038
|
+
f.length < 2 && f.push(new g(0, 1e-3, 0));
|
|
1039
1039
|
try {
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
} catch (
|
|
1043
|
-
console.error("管件更新失败",
|
|
1040
|
+
const B = new bt(f, !1, "catmullrom", 0.01), q = new wt(B, Math.max(2, f.length * 4), v.value * we, 18, !1);
|
|
1041
|
+
l.value.geometry.dispose(), l.value.geometry = q;
|
|
1042
|
+
} catch (B) {
|
|
1043
|
+
console.error("管件更新失败", B);
|
|
1044
1044
|
}
|
|
1045
|
-
}, u = (
|
|
1046
|
-
|
|
1047
|
-
const M =
|
|
1048
|
-
|
|
1045
|
+
}, u = (r, b) => {
|
|
1046
|
+
r && (Object.keys(r).forEach((c) => {
|
|
1047
|
+
const M = r[c], f = i.value.find((y) => y.name === c);
|
|
1048
|
+
f && (f.currentValue = M, t.model && t.model.setJointValue ? t.model.setJointValue(c, M) : f.urdfJoint && f.urdfJoint.setJointValue(M));
|
|
1049
1049
|
}), m(b));
|
|
1050
|
-
}, T = (
|
|
1051
|
-
if (!
|
|
1050
|
+
}, T = (r, b, c) => r + (b - r) * c, V = (r, b, c) => {
|
|
1051
|
+
if (!r || !b) return r || b;
|
|
1052
1052
|
const M = {};
|
|
1053
|
-
return Object.keys(
|
|
1054
|
-
const
|
|
1055
|
-
M[
|
|
1053
|
+
return Object.keys(r).forEach((f) => {
|
|
1054
|
+
const y = r[f], o = b[f];
|
|
1055
|
+
M[f] = T(y, o || y, c);
|
|
1056
1056
|
}), M;
|
|
1057
1057
|
}, R = () => {
|
|
1058
1058
|
if (d.length === 0) {
|
|
@@ -1060,97 +1060,100 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1060
1060
|
return;
|
|
1061
1061
|
}
|
|
1062
1062
|
j(), x.value = !0, z.value = !1;
|
|
1063
|
-
const
|
|
1063
|
+
const r = () => {
|
|
1064
1064
|
if (!x.value || z.value) return;
|
|
1065
|
-
const b =
|
|
1066
|
-
if (
|
|
1067
|
-
const
|
|
1068
|
-
u(
|
|
1065
|
+
const b = I.value / ze, c = O.value, M = d[O.value], f = d[O.value + 1];
|
|
1066
|
+
if (f) {
|
|
1067
|
+
const y = V(M, f, b);
|
|
1068
|
+
u(y, c);
|
|
1069
1069
|
} else
|
|
1070
|
-
u(M,
|
|
1071
|
-
if (
|
|
1072
|
-
|
|
1070
|
+
u(M, c);
|
|
1071
|
+
if (I.value++, I.value >= ze && (I.value = 0, O.value++, O.value >= d.length - 1)) {
|
|
1072
|
+
F();
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
1075
|
-
|
|
1075
|
+
h.value = setTimeout(r, s());
|
|
1076
1076
|
};
|
|
1077
|
-
|
|
1077
|
+
r();
|
|
1078
1078
|
}, oe = () => {
|
|
1079
|
-
z.value = !0,
|
|
1080
|
-
},
|
|
1081
|
-
x.value = !1, z.value = !1,
|
|
1079
|
+
z.value = !0, h.value && (clearTimeout(h.value), h.value = null);
|
|
1080
|
+
}, F = () => {
|
|
1081
|
+
x.value = !1, z.value = !1, _.value = 1, h.value && (clearTimeout(h.value), h.value = null);
|
|
1082
1082
|
};
|
|
1083
1083
|
e({
|
|
1084
1084
|
startAnimation: R,
|
|
1085
1085
|
pauseAnimation: oe,
|
|
1086
|
-
stopAnimation:
|
|
1086
|
+
stopAnimation: F,
|
|
1087
1087
|
resetAll: () => {
|
|
1088
|
-
|
|
1089
|
-
(
|
|
1088
|
+
F(), O.value = 0, I.value = 0, i.value.forEach((r) => {
|
|
1089
|
+
(r.type === "revolute" || r.type === "prismatic") && N(r.name, 0);
|
|
1090
1090
|
});
|
|
1091
1091
|
},
|
|
1092
1092
|
fastForward: () => {
|
|
1093
|
-
|
|
1093
|
+
_.value < 4 && (_.value = Math.min(4, _.value * 2));
|
|
1094
1094
|
},
|
|
1095
1095
|
fastBackward: () => {
|
|
1096
|
-
|
|
1096
|
+
_.value > 0.25 && (_.value = Math.max(0.25, _.value / 2));
|
|
1097
1097
|
}
|
|
1098
|
-
}),
|
|
1098
|
+
}), Ee(
|
|
1099
1099
|
() => t.model,
|
|
1100
|
-
(
|
|
1101
|
-
|
|
1100
|
+
(r) => {
|
|
1101
|
+
r ? (n.value = r, i.value = $(r)) : i.value = [];
|
|
1102
1102
|
},
|
|
1103
1103
|
{ immediate: !0 }
|
|
1104
1104
|
);
|
|
1105
|
-
const
|
|
1106
|
-
!t.model || x.value && !z.value || i.value.forEach((
|
|
1107
|
-
|
|
1105
|
+
const Te = () => {
|
|
1106
|
+
!t.model || x.value && !z.value || i.value.forEach((r) => {
|
|
1107
|
+
r.urdfJoint && r.urdfJoint.angle !== void 0 && (r.currentValue = r.urdfJoint.angle);
|
|
1108
1108
|
});
|
|
1109
|
-
}, Te = () => {
|
|
1110
|
-
const l = () => {
|
|
1111
|
-
De(), p.value = requestAnimationFrame(l);
|
|
1112
|
-
};
|
|
1113
|
-
l();
|
|
1114
1109
|
}, Ce = () => {
|
|
1110
|
+
const r = () => {
|
|
1111
|
+
Te(), p.value = requestAnimationFrame(r);
|
|
1112
|
+
};
|
|
1113
|
+
r();
|
|
1114
|
+
}, Se = () => {
|
|
1115
1115
|
p.value && (cancelAnimationFrame(p.value), p.value = null);
|
|
1116
|
-
};
|
|
1117
|
-
return
|
|
1118
|
-
|
|
1119
|
-
}),
|
|
1120
|
-
|
|
1121
|
-
}), (
|
|
1116
|
+
}, me = E(Date.now());
|
|
1117
|
+
return $e(() => {
|
|
1118
|
+
Ce(), me.value = Date.now();
|
|
1119
|
+
}), et(() => {
|
|
1120
|
+
Se(), F();
|
|
1121
|
+
}), (r, b) => (X(), J("div", {
|
|
1122
|
+
class: "panel-content",
|
|
1123
|
+
key: me.value
|
|
1124
|
+
}, [
|
|
1122
1125
|
i.value.length > 0 ? (X(), J("div", Xt, [
|
|
1123
|
-
(X(!0), J(
|
|
1124
|
-
var M,
|
|
1126
|
+
(X(!0), J(tt, null, st(i.value, (c) => {
|
|
1127
|
+
var M, f, y, o;
|
|
1125
1128
|
return X(), J("div", {
|
|
1126
|
-
key:
|
|
1129
|
+
key: c.name,
|
|
1127
1130
|
class: "joint-item"
|
|
1128
1131
|
}, [
|
|
1129
1132
|
P("div", $t, [
|
|
1130
1133
|
P("div", Gt, [
|
|
1131
|
-
P("span", Jt,
|
|
1132
|
-
P("span", Wt, " [" +
|
|
1134
|
+
P("span", Jt, ne(c.name), 1),
|
|
1135
|
+
P("span", Wt, " [" + ne(((M = c.limit) == null ? void 0 : M.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ne(((f = c.limit) == null ? void 0 : f.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
|
|
1133
1136
|
]),
|
|
1134
|
-
P("span", qt,
|
|
1137
|
+
P("span", qt, ne(c.type), 1)
|
|
1135
1138
|
]),
|
|
1136
|
-
|
|
1139
|
+
c.type === "revolute" || c.type === "prismatic" ? (X(), J("div", Qt, [
|
|
1137
1140
|
P("div", es, [
|
|
1138
1141
|
P("input", {
|
|
1139
1142
|
type: "range",
|
|
1140
|
-
min: ((
|
|
1141
|
-
max: ((
|
|
1143
|
+
min: ((y = c.limit) == null ? void 0 : y.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
|
|
1144
|
+
max: ((o = c.limit) == null ? void 0 : o.upper) ?? (c.type === "revolute" ? Math.PI : 1),
|
|
1142
1145
|
step: 0.01,
|
|
1143
|
-
value:
|
|
1144
|
-
onInput: (
|
|
1146
|
+
value: c.currentValue,
|
|
1147
|
+
onInput: (U) => N(c.name, U.target.value),
|
|
1145
1148
|
class: "joint-slider",
|
|
1146
1149
|
disabled: x.value && !z.value
|
|
1147
1150
|
}, null, 40, ts)
|
|
1148
1151
|
]),
|
|
1149
1152
|
P("div", ss, [
|
|
1150
|
-
P("span", is,
|
|
1151
|
-
P("span", os,
|
|
1153
|
+
P("span", is, ne(c.currentValue ? Number(c.currentValue).toFixed(3) : "0.000"), 1),
|
|
1154
|
+
P("span", os, ne(c.type === "revolute" ? "rad" : "m"), 1)
|
|
1152
1155
|
])
|
|
1153
|
-
])) :
|
|
1156
|
+
])) : Pe("", !0)
|
|
1154
1157
|
]);
|
|
1155
1158
|
}), 128))
|
|
1156
1159
|
])) : (X(), J("div", as, b[0] || (b[0] = [
|
|
@@ -1158,7 +1161,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1158
1161
|
])))
|
|
1159
1162
|
]));
|
|
1160
1163
|
}
|
|
1161
|
-
}, rs = /* @__PURE__ */
|
|
1164
|
+
}, rs = /* @__PURE__ */ _e(ls, [["__scopeId", "data-v-9a9fed3f"]]), cs = ["xlink:href"], hs = /* @__PURE__ */ it({
|
|
1162
1165
|
__name: "svgIcon",
|
|
1163
1166
|
props: {
|
|
1164
1167
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1168,12 +1171,12 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1168
1171
|
spin: { type: Boolean, default: !1 },
|
|
1169
1172
|
active: { type: Boolean, default: !1 }
|
|
1170
1173
|
},
|
|
1171
|
-
setup(
|
|
1172
|
-
const e =
|
|
1174
|
+
setup(a) {
|
|
1175
|
+
const e = a, t = pe(
|
|
1173
1176
|
() => ({
|
|
1174
1177
|
backgroundColor: e.backgroundColor
|
|
1175
1178
|
})
|
|
1176
|
-
), i = pe(() => `#${e.prefix}-${e.name}`),
|
|
1179
|
+
), i = pe(() => `#${e.prefix}-${e.name}`), n = pe(() => {
|
|
1177
1180
|
const { size: p } = e;
|
|
1178
1181
|
let v = `${p}`;
|
|
1179
1182
|
return v = `${v.replace("px", "")}px`, {
|
|
@@ -1182,19 +1185,19 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1182
1185
|
};
|
|
1183
1186
|
});
|
|
1184
1187
|
return (p, v) => (X(), J("div", {
|
|
1185
|
-
class:
|
|
1186
|
-
style:
|
|
1188
|
+
class: Fe(["container", { active: p.active }]),
|
|
1189
|
+
style: Ie(t.value)
|
|
1187
1190
|
}, [
|
|
1188
1191
|
(X(), J("svg", {
|
|
1189
|
-
class:
|
|
1190
|
-
style:
|
|
1192
|
+
class: Fe(["svg-icon", [p.$attrs.class, p.spin && "svg-icon-spin"]]),
|
|
1193
|
+
style: Ie(n.value),
|
|
1191
1194
|
"aria-hidden": "true"
|
|
1192
1195
|
}, [
|
|
1193
1196
|
P("use", { "xlink:href": i.value }, null, 8, cs)
|
|
1194
1197
|
], 6))
|
|
1195
1198
|
], 6));
|
|
1196
1199
|
}
|
|
1197
|
-
}), L = /* @__PURE__ */
|
|
1200
|
+
}), L = /* @__PURE__ */ _e(hs, [["__scopeId", "data-v-53bfc052"]]), us = { class: "obj-viewer-container" }, ps = { class: "buttonGroup-top" }, ds = { class: "buttonGroup-topLeft" }, ms = { class: "buttonGroup-left" }, fs = { class: "buttonGroup-right" }, _s = { class: "buttonGroup-bottom" }, gs = { class: "left-panel" }, ys = { class: "panel-header" }, vs = {
|
|
1198
1201
|
key: 1,
|
|
1199
1202
|
class: "clipping-content"
|
|
1200
1203
|
}, bs = { class: "radio-group" }, ws = { class: "radio-label" }, Ps = { class: "radio-label" }, Ms = { class: "radio-label" }, xs = { class: "radio-label" }, Es = { class: "right-panel" }, Ds = { class: "panel-header" }, Ts = {
|
|
@@ -1210,79 +1213,79 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1210
1213
|
}
|
|
1211
1214
|
},
|
|
1212
1215
|
emits: ["getAnimationData"],
|
|
1213
|
-
setup(
|
|
1216
|
+
setup(a, { expose: e, emit: t }) {
|
|
1214
1217
|
const i = t;
|
|
1215
|
-
let
|
|
1216
|
-
const v =
|
|
1217
|
-
|
|
1218
|
-
const x =
|
|
1219
|
-
currentModels:
|
|
1218
|
+
let n = null, p = !1;
|
|
1219
|
+
const v = E(null), l = E(!1), D = E("");
|
|
1220
|
+
E(!1);
|
|
1221
|
+
const x = E(!1), z = E(!1), O = E(""), I = E(!1), h = E(""), C = E(), {
|
|
1222
|
+
currentModels: _,
|
|
1220
1223
|
initialCameraPosition: s,
|
|
1221
1224
|
initialTargetPosition: d,
|
|
1222
1225
|
initThreeJS: w,
|
|
1223
1226
|
handleResize: j,
|
|
1224
1227
|
fitCameraToAllModels: $,
|
|
1225
|
-
getThreeJSObjects:
|
|
1226
|
-
clearAllModels:
|
|
1227
|
-
cleanup:
|
|
1228
|
-
} =
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
), { addModelsFromUrls: W, loadModelByDefaultPath:
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
),
|
|
1238
|
-
if (x.value ||
|
|
1228
|
+
getThreeJSObjects: N,
|
|
1229
|
+
clearAllModels: K,
|
|
1230
|
+
cleanup: H
|
|
1231
|
+
} = It(v), { isAnimating: m, toggleAnimation: u, stopAnimation: T } = Ft(N, _), { isClipping: V, activeClippingAxis: R, toggleClipping: oe, updateClippingPlanes: F } = Nt(
|
|
1232
|
+
N,
|
|
1233
|
+
_
|
|
1234
|
+
), { addModelsFromUrls: W, loadModelByDefaultPath: te, urdfModel: de, modelBoundingBoxes: Te } = Pt(
|
|
1235
|
+
N,
|
|
1236
|
+
_,
|
|
1237
|
+
l,
|
|
1238
|
+
D,
|
|
1239
|
+
K
|
|
1240
|
+
), Ce = () => {
|
|
1241
|
+
if (x.value || _.value.length === 0) return;
|
|
1239
1242
|
x.value = !0, m.value && T();
|
|
1240
|
-
const { camera:
|
|
1241
|
-
if (!
|
|
1242
|
-
|
|
1243
|
-
const
|
|
1244
|
-
const
|
|
1245
|
-
|
|
1243
|
+
const { camera: y, controls: o } = N();
|
|
1244
|
+
if (!y || !o) return;
|
|
1245
|
+
o.enabled = !0;
|
|
1246
|
+
const U = (ee) => ee < 0.5 ? 4 * ee * ee * ee : 1 - Math.pow(-2 * ee + 2, 3) / 2, B = y.position.clone(), q = o.target.clone(), ae = 1500, Q = Date.now(), S = () => {
|
|
1247
|
+
const ee = Date.now() - Q, he = Math.min(ee / ae, 1), se = U(he);
|
|
1248
|
+
y.position.lerpVectors(B, s.value, se), o.target.lerpVectors(q, d.value, se), he < 1 ? requestAnimationFrame(S) : x.value = !1;
|
|
1246
1249
|
};
|
|
1247
|
-
|
|
1248
|
-
},
|
|
1249
|
-
const
|
|
1250
|
-
p ?
|
|
1250
|
+
S();
|
|
1251
|
+
}, Se = async () => p ? Promise.resolve() : new Promise((y) => {
|
|
1252
|
+
const o = () => {
|
|
1253
|
+
p ? y() : requestAnimationFrame(o);
|
|
1251
1254
|
};
|
|
1252
|
-
|
|
1253
|
-
}),
|
|
1255
|
+
o();
|
|
1256
|
+
}), me = async (y, o) => {
|
|
1254
1257
|
try {
|
|
1255
|
-
await
|
|
1256
|
-
const
|
|
1257
|
-
return $(
|
|
1258
|
-
} catch (
|
|
1259
|
-
throw console.error("加载模型失败:",
|
|
1258
|
+
await Se(), m.value && T(), V.value && oe();
|
|
1259
|
+
const U = await o(y);
|
|
1260
|
+
return $(Te), U;
|
|
1261
|
+
} catch (U) {
|
|
1262
|
+
throw console.error("加载模型失败:", U), U;
|
|
1260
1263
|
}
|
|
1261
|
-
},
|
|
1262
|
-
z.value = !0, O.value =
|
|
1263
|
-
},
|
|
1264
|
-
|
|
1265
|
-
},
|
|
1266
|
-
|
|
1267
|
-
var
|
|
1268
|
-
(
|
|
1264
|
+
}, r = async (y) => me(y, W), b = async (y) => me(y, te), c = (y) => {
|
|
1265
|
+
z.value = !0, O.value = y, y === "剖面视图" && !V.value && oe();
|
|
1266
|
+
}, M = (y) => {
|
|
1267
|
+
I.value = !0, h.value = y, y === "动画仿真" && (i("getAnimationData"), console.log("获取动画数据"));
|
|
1268
|
+
}, f = () => {
|
|
1269
|
+
Ne(() => {
|
|
1270
|
+
var y;
|
|
1271
|
+
(y = C.value) == null || y.startAnimation();
|
|
1269
1272
|
});
|
|
1270
1273
|
};
|
|
1271
|
-
return
|
|
1272
|
-
await
|
|
1274
|
+
return $e(async () => {
|
|
1275
|
+
await Ne();
|
|
1273
1276
|
try {
|
|
1274
|
-
w(),
|
|
1275
|
-
} catch (
|
|
1276
|
-
console.error("Three.js初始化失败:",
|
|
1277
|
+
w(), n = N().scene, p = !0, window.addEventListener("resize", j);
|
|
1278
|
+
} catch (y) {
|
|
1279
|
+
console.error("Three.js初始化失败:", y);
|
|
1277
1280
|
}
|
|
1278
|
-
}),
|
|
1279
|
-
p = !1, O.value = "",
|
|
1281
|
+
}), ot(() => {
|
|
1282
|
+
p = !1, O.value = "", h.value = "", window.removeEventListener("resize", j), m.value && T(), H();
|
|
1280
1283
|
}), e({
|
|
1281
|
-
addModelsFromUrls:
|
|
1282
|
-
loadModelByDefaultPath:
|
|
1283
|
-
}), (
|
|
1284
|
-
var q, ae, Q
|
|
1285
|
-
const
|
|
1284
|
+
addModelsFromUrls: r,
|
|
1285
|
+
loadModelByDefaultPath: b
|
|
1286
|
+
}), (y, o) => {
|
|
1287
|
+
var B, q, ae, Q;
|
|
1288
|
+
const U = Xe("el-scrollbar");
|
|
1286
1289
|
return X(), J("div", us, [
|
|
1287
1290
|
P("div", {
|
|
1288
1291
|
ref_key: "threejsContainer",
|
|
@@ -1315,7 +1318,7 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1315
1318
|
k(L, {
|
|
1316
1319
|
name: "viewReset",
|
|
1317
1320
|
size: "24",
|
|
1318
|
-
onClick:
|
|
1321
|
+
onClick: Ce,
|
|
1319
1322
|
title: "重置"
|
|
1320
1323
|
}),
|
|
1321
1324
|
k(L, {
|
|
@@ -1339,26 +1342,26 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1339
1342
|
k(L, {
|
|
1340
1343
|
name: "jiegoushu",
|
|
1341
1344
|
size: "24",
|
|
1342
|
-
onClick:
|
|
1345
|
+
onClick: o[0] || (o[0] = (S) => c("场景树")),
|
|
1343
1346
|
active: z.value && O.value === "场景树",
|
|
1344
1347
|
title: "场景树"
|
|
1345
1348
|
}, null, 8, ["active"]),
|
|
1346
1349
|
k(L, {
|
|
1347
1350
|
name: "clipping",
|
|
1348
1351
|
size: "24",
|
|
1349
|
-
onClick:
|
|
1352
|
+
onClick: o[1] || (o[1] = (S) => c("剖面视图")),
|
|
1350
1353
|
active: z.value && O.value === "剖面视图",
|
|
1351
1354
|
title: "剖面视图"
|
|
1352
1355
|
}, null, 8, ["active"]),
|
|
1353
1356
|
k(L, {
|
|
1354
1357
|
name: "donghuafangzhen",
|
|
1355
1358
|
size: "24",
|
|
1356
|
-
onClick:
|
|
1359
|
+
onClick: o[2] || (o[2] = (S) => c("场景树3"))
|
|
1357
1360
|
}),
|
|
1358
1361
|
k(L, {
|
|
1359
1362
|
name: "donghuafangzhen",
|
|
1360
1363
|
size: "24",
|
|
1361
|
-
onClick:
|
|
1364
|
+
onClick: o[3] || (o[3] = (S) => c("场景4"))
|
|
1362
1365
|
})
|
|
1363
1366
|
]),
|
|
1364
1367
|
P("div", fs, [
|
|
@@ -1373,16 +1376,16 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1373
1376
|
k(L, {
|
|
1374
1377
|
name: "guanjiekongzhi",
|
|
1375
1378
|
size: "24",
|
|
1376
|
-
onClick:
|
|
1377
|
-
active:
|
|
1379
|
+
onClick: o[4] || (o[4] = (S) => M("关节控制")),
|
|
1380
|
+
active: I.value && h.value === "关节控制",
|
|
1378
1381
|
title: "关节控制"
|
|
1379
1382
|
}, null, 8, ["active"]),
|
|
1380
1383
|
k(L, {
|
|
1381
1384
|
name: "donghuafangzhen",
|
|
1382
1385
|
size: "24",
|
|
1383
1386
|
title: "动画仿真",
|
|
1384
|
-
onClick:
|
|
1385
|
-
active:
|
|
1387
|
+
onClick: o[5] || (o[5] = (S) => M("动画仿真")),
|
|
1388
|
+
active: I.value && h.value === "动画仿真"
|
|
1386
1389
|
}, null, 8, ["active"]),
|
|
1387
1390
|
k(L, {
|
|
1388
1391
|
name: "donghuafangzhen",
|
|
@@ -1399,145 +1402,145 @@ const Nt = { class: "panel-content" }, Ut = {
|
|
|
1399
1402
|
size: "24",
|
|
1400
1403
|
backgroundColor: "#ffffff",
|
|
1401
1404
|
title: "快退",
|
|
1402
|
-
onClick: (
|
|
1405
|
+
onClick: (B = C.value) == null ? void 0 : B.fastBackward
|
|
1403
1406
|
}, null, 8, ["onClick"]),
|
|
1404
1407
|
k(L, {
|
|
1405
1408
|
name: "bofang",
|
|
1406
1409
|
size: "24",
|
|
1407
1410
|
backgroundColor: "#ffffff",
|
|
1408
1411
|
title: "播放",
|
|
1409
|
-
onClick:
|
|
1412
|
+
onClick: f
|
|
1410
1413
|
}),
|
|
1411
1414
|
k(L, {
|
|
1412
1415
|
name: "kuaijin",
|
|
1413
1416
|
size: "24",
|
|
1414
1417
|
backgroundColor: "#ffffff",
|
|
1415
1418
|
title: "快进",
|
|
1416
|
-
onClick: (
|
|
1419
|
+
onClick: (q = C.value) == null ? void 0 : q.fastForward
|
|
1417
1420
|
}, null, 8, ["onClick"]),
|
|
1418
1421
|
k(L, {
|
|
1419
1422
|
name: "zanting",
|
|
1420
1423
|
size: "24",
|
|
1421
1424
|
backgroundColor: "#ffffff",
|
|
1422
1425
|
title: "暂停",
|
|
1423
|
-
onClick: (
|
|
1426
|
+
onClick: (ae = C.value) == null ? void 0 : ae.pauseAnimation
|
|
1424
1427
|
}, null, 8, ["onClick"]),
|
|
1425
1428
|
k(L, {
|
|
1426
1429
|
name: "zhongzhi",
|
|
1427
1430
|
size: "24",
|
|
1428
1431
|
backgroundColor: "#ffffff",
|
|
1429
1432
|
title: "停止",
|
|
1430
|
-
onClick: (
|
|
1433
|
+
onClick: (Q = C.value) == null ? void 0 : Q.resetAll
|
|
1431
1434
|
}, null, 8, ["onClick"])
|
|
1432
1435
|
]),
|
|
1433
|
-
|
|
1436
|
+
le(P("div", gs, [
|
|
1434
1437
|
P("div", ys, [
|
|
1435
|
-
P("span", null,
|
|
1438
|
+
P("span", null, ne(O.value), 1),
|
|
1436
1439
|
P("span", {
|
|
1437
1440
|
class: "close",
|
|
1438
|
-
onClick:
|
|
1441
|
+
onClick: o[6] || (o[6] = (S) => z.value = !1)
|
|
1439
1442
|
}, " X ")
|
|
1440
1443
|
]),
|
|
1441
|
-
k(
|
|
1442
|
-
default:
|
|
1444
|
+
k(U, { "max-height": "650px" }, {
|
|
1445
|
+
default: Ue(() => [
|
|
1443
1446
|
O.value === "场景树" ? (X(), He(Ht, {
|
|
1444
1447
|
key: 0,
|
|
1445
1448
|
model: Z(de)
|
|
1446
|
-
}, null, 8, ["model"])) :
|
|
1449
|
+
}, null, 8, ["model"])) : Pe("", !0),
|
|
1447
1450
|
O.value === "剖面视图" ? (X(), J("div", vs, [
|
|
1448
1451
|
P("div", bs, [
|
|
1449
1452
|
P("label", ws, [
|
|
1450
|
-
|
|
1453
|
+
le(P("input", {
|
|
1451
1454
|
type: "radio",
|
|
1452
1455
|
name: "clipping-axis",
|
|
1453
1456
|
value: "none",
|
|
1454
|
-
"onUpdate:modelValue":
|
|
1455
|
-
onChange:
|
|
1457
|
+
"onUpdate:modelValue": o[7] || (o[7] = (S) => ge(R) ? R.value = S : null),
|
|
1458
|
+
onChange: o[8] || (o[8] = (...S) => Z(F) && Z(F)(...S))
|
|
1456
1459
|
}, null, 544), [
|
|
1457
|
-
[
|
|
1460
|
+
[ye, Z(R)]
|
|
1458
1461
|
]),
|
|
1459
|
-
|
|
1462
|
+
o[16] || (o[16] = P("span", { class: "radio-text" }, "无切割", -1))
|
|
1460
1463
|
]),
|
|
1461
1464
|
P("label", Ps, [
|
|
1462
|
-
|
|
1465
|
+
le(P("input", {
|
|
1463
1466
|
type: "radio",
|
|
1464
1467
|
name: "clipping-axis",
|
|
1465
1468
|
value: "x",
|
|
1466
|
-
"onUpdate:modelValue":
|
|
1467
|
-
onChange:
|
|
1469
|
+
"onUpdate:modelValue": o[9] || (o[9] = (S) => ge(R) ? R.value = S : null),
|
|
1470
|
+
onChange: o[10] || (o[10] = (...S) => Z(F) && Z(F)(...S))
|
|
1468
1471
|
}, null, 544), [
|
|
1469
|
-
[
|
|
1472
|
+
[ye, Z(R)]
|
|
1470
1473
|
]),
|
|
1471
|
-
|
|
1474
|
+
o[17] || (o[17] = P("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1472
1475
|
]),
|
|
1473
1476
|
P("label", Ms, [
|
|
1474
|
-
|
|
1477
|
+
le(P("input", {
|
|
1475
1478
|
type: "radio",
|
|
1476
1479
|
name: "clipping-axis",
|
|
1477
1480
|
value: "y",
|
|
1478
|
-
"onUpdate:modelValue":
|
|
1479
|
-
onChange:
|
|
1481
|
+
"onUpdate:modelValue": o[11] || (o[11] = (S) => ge(R) ? R.value = S : null),
|
|
1482
|
+
onChange: o[12] || (o[12] = (...S) => Z(F) && Z(F)(...S))
|
|
1480
1483
|
}, null, 544), [
|
|
1481
|
-
[
|
|
1484
|
+
[ye, Z(R)]
|
|
1482
1485
|
]),
|
|
1483
|
-
|
|
1486
|
+
o[18] || (o[18] = P("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1484
1487
|
]),
|
|
1485
1488
|
P("label", xs, [
|
|
1486
|
-
|
|
1489
|
+
le(P("input", {
|
|
1487
1490
|
type: "radio",
|
|
1488
1491
|
name: "clipping-axis",
|
|
1489
1492
|
value: "z",
|
|
1490
|
-
"onUpdate:modelValue":
|
|
1491
|
-
onChange:
|
|
1493
|
+
"onUpdate:modelValue": o[13] || (o[13] = (S) => ge(R) ? R.value = S : null),
|
|
1494
|
+
onChange: o[14] || (o[14] = (...S) => Z(F) && Z(F)(...S))
|
|
1492
1495
|
}, null, 544), [
|
|
1493
|
-
[
|
|
1496
|
+
[ye, Z(R)]
|
|
1494
1497
|
]),
|
|
1495
|
-
|
|
1498
|
+
o[19] || (o[19] = P("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1496
1499
|
])
|
|
1497
1500
|
])
|
|
1498
|
-
])) :
|
|
1501
|
+
])) : Pe("", !0)
|
|
1499
1502
|
]),
|
|
1500
1503
|
_: 1
|
|
1501
1504
|
})
|
|
1502
1505
|
], 512), [
|
|
1503
|
-
[
|
|
1506
|
+
[ve, z.value]
|
|
1504
1507
|
]),
|
|
1505
|
-
|
|
1508
|
+
le(P("div", Es, [
|
|
1506
1509
|
P("div", Ds, [
|
|
1507
|
-
P("span", null,
|
|
1510
|
+
P("span", null, ne(h.value), 1),
|
|
1508
1511
|
P("span", {
|
|
1509
1512
|
class: "close",
|
|
1510
|
-
onClick:
|
|
1513
|
+
onClick: o[15] || (o[15] = (S) => I.value = !1)
|
|
1511
1514
|
}, " X ")
|
|
1512
1515
|
]),
|
|
1513
|
-
k(
|
|
1514
|
-
default:
|
|
1515
|
-
|
|
1516
|
+
k(U, { "max-height": "650px" }, {
|
|
1517
|
+
default: Ue(() => [
|
|
1518
|
+
le(k(rs, {
|
|
1516
1519
|
ref_key: "jointRef",
|
|
1517
|
-
ref:
|
|
1520
|
+
ref: C,
|
|
1518
1521
|
model: Z(de),
|
|
1519
|
-
scene: Z(
|
|
1520
|
-
animationData:
|
|
1522
|
+
scene: Z(n),
|
|
1523
|
+
animationData: a.animationData
|
|
1521
1524
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1522
|
-
[
|
|
1525
|
+
[ve, h.value === "关节控制"]
|
|
1523
1526
|
]),
|
|
1524
|
-
|
|
1525
|
-
[
|
|
1527
|
+
le(k(Vt, { animationData: a.animationData }, null, 8, ["animationData"]), [
|
|
1528
|
+
[ve, h.value === "动画仿真"]
|
|
1526
1529
|
])
|
|
1527
1530
|
]),
|
|
1528
1531
|
_: 1
|
|
1529
1532
|
})
|
|
1530
1533
|
], 512), [
|
|
1531
|
-
[
|
|
1534
|
+
[ve, I.value]
|
|
1532
1535
|
]),
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
P("p", null,
|
|
1536
|
-
])) :
|
|
1536
|
+
l.value ? (X(), J("div", Ts, [
|
|
1537
|
+
o[20] || (o[20] = P("div", { class: "loading-spinner" }, null, -1)),
|
|
1538
|
+
P("p", null, ne(D.value), 1)
|
|
1539
|
+
])) : Pe("", !0)
|
|
1537
1540
|
]);
|
|
1538
1541
|
};
|
|
1539
1542
|
}
|
|
1540
|
-
}, zs = /* @__PURE__ */
|
|
1543
|
+
}, zs = /* @__PURE__ */ _e(Cs, [["__scopeId", "data-v-24606bcb"]]);
|
|
1541
1544
|
export {
|
|
1542
1545
|
zs as default
|
|
1543
1546
|
};
|