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