ss-component-new 1.1.548 → 1.1.550
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-CX--CK9W.js → index-B-LpOBDT.js} +2 -2
- package/dist/{index-DHzXS1Iy.cjs → index-B1Ym6yK-.cjs} +1 -1
- package/dist/{index-CBy0Wmr-.js → index-BDSvnw9H.js} +1 -1
- package/dist/{index-DOElpe7o.cjs → index-BINS4o5j.cjs} +1 -1
- package/dist/{index-DmEQ5rMj.cjs → index-BJOl0tWq.cjs} +1 -1
- package/dist/{index-DoK7bh85.cjs → index-BNie-hat.cjs} +1 -1
- package/dist/{index-D-mmTu6o.cjs → index-BiZ2ZTnh.cjs} +1 -1
- package/dist/{index-Buwm_HMT.cjs → index-BnQjIsIE.cjs} +1 -1
- package/dist/{index-Dimxaw7v.js → index-Bs2Gr0Fy.js} +1 -1
- package/dist/{index-RHKeqrca.cjs → index-C-_hjdfJ.cjs} +1 -1
- package/dist/{index-Ci-Jzm4O.cjs → index-C4m_4W5O.cjs} +1 -1
- package/dist/{index-CdTFgks3.js → index-C5wSDhcl.js} +1 -1
- package/dist/{index-DDUx9hJu.cjs → index-CG3UBl7o.cjs} +1 -1
- package/dist/{index-DS5aMp22.cjs → index-CT_76-PQ.cjs} +1 -1
- package/dist/{index-BtGkSSqq.js → index-CVJeodc-.js} +1 -1
- package/dist/{index-7EhdrGYQ.js → index-CV_vgV9a.js} +1 -1
- package/dist/{index-X2klfuIp.js → index-Cgc-DX9q.js} +1 -1
- package/dist/{index-YhTbPFhY.js → index-CqjuwXtz.js} +1 -1
- package/dist/{index-fCkjyUfU.cjs → index-D2V35IDN.cjs} +1 -1
- package/dist/{index-Blj1gMr9.js → index-DKAPyIzJ.js} +1 -1
- package/dist/{index-BweqqBIq.cjs → index-DSRou0iN.cjs} +1 -1
- package/dist/{index-HZltj8sF.js → index-DUoU0Edg.js} +5 -5
- package/dist/{index-DCDTqWhV.js → index-D_JSQo_I.js} +1 -1
- package/dist/{index-B9F0k3X6.js → index-DffAxKgW.js} +1 -1
- package/dist/{index-C0MryFa-.js → index-Dsep5_xJ.js} +7 -7
- package/dist/{index-Cz3_SMCC.cjs → index-DzkstraD.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_82f8c0ec_lang-UIjhdOZs.js → index.vue_vue_type_style_index_0_scoped_82f8c0ec_lang-BCSf0d8L.js} +4 -4
- package/dist/{index.vue_vue_type_style_index_0_scoped_82f8c0ec_lang-pS_4Mrx1.cjs → index.vue_vue_type_style_index_0_scoped_82f8c0ec_lang-jWX58keO.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_d888ede3_lang-hS31ouB0.cjs → index.vue_vue_type_style_index_0_scoped_d888ede3_lang-03raezMI.cjs} +1 -1
- package/dist/{index.vue_vue_type_style_index_0_scoped_d888ede3_lang-GwS-75w8.js → index.vue_vue_type_style_index_0_scoped_d888ede3_lang-DHjeIUnQ.js} +1 -1
- package/dist/{main-DaAvRrX9.cjs → main-BnM6BTFN.cjs} +1 -1
- package/dist/{main-DHTtRsVg.js → main-pHlV-zuf.js} +2 -2
- package/dist/ss-component.cjs +1 -1
- package/dist/ss-component.css +1 -1
- package/dist/ss-component.js +4 -4
- package/dist/ss-component2.cjs +1 -1
- package/dist/ss-component2.js +7 -7
- package/dist/{threeModel-CU0X1c55.js → threeModel-C0gjw1Od.js} +275 -275
- package/dist/{threeModel-Bsipl6Uv.cjs → threeModel-CWur_6HM.cjs} +1 -1
- package/package.json +1 -1
- /package/dist/{threeModel.vue_vue_type_style_index_0_scoped_4bd4d061_lang-C4kzFz9R.js → threeModel.vue_vue_type_style_index_0_scoped_e36a07b8_lang-C4kzFz9R.js} +0 -0
- /package/dist/{threeModel.vue_vue_type_style_index_0_scoped_4bd4d061_lang-CO6ZYvsh.cjs → threeModel.vue_vue_type_style_index_0_scoped_e36a07b8_lang-CO6ZYvsh.cjs} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ref as x,
|
|
2
|
-
import { C as qt, V as w, M as
|
|
1
|
+
import { ref as x, watch as ft, createElementBlock as B, openBlock as Z, createVNode as D, computed as st, resolveComponent as Ft, onMounted as Nt, onUnmounted as $t, Fragment as Xt, renderList as Jt, createElementVNode as y, createCommentVNode as it, toDisplayString as J, defineComponent as Gt, normalizeStyle as Ct, normalizeClass as St, nextTick as kt, onBeforeUnmount as Wt, withDirectives as tt, unref as F, withCtx as At, createBlock as zt, isRef as ct, vModelRadio as ut, vShow as yt } from "vue";
|
|
2
|
+
import { C as qt, V as w, M as W, T as et, Q as Rt, S as Ot, a as $, R as Qt, P as pt, b as te, B as _t, c as ee, d as ie, e as se, W as oe, f as ae, A as ne, g as le, X as re, G as he, h as mt, i as ce, j as Ut, k as ue, D as vt, H as de, l as Lt, m as pe, n as me, E as bt, u as fe } from "./threeModel.vue_vue_type_style_index_0_scoped_e36a07b8_lang-C4kzFz9R.js";
|
|
3
3
|
import { j as _e } from "./index-ffDSB4Kw.js";
|
|
4
|
+
import { _ as ot } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
4
5
|
import { c as Yt } from "./menu-DV47UKJo.js";
|
|
5
|
-
|
|
6
|
-
const Lt = { type: "change" }, Mt = { type: "start" }, Vt = { type: "end" }, dt = new Qt(), jt = new mt(), ge = Math.cos(70 * te.DEG2RAD), j = new w(), Z = 2 * Math.PI, T = {
|
|
6
|
+
const jt = { type: "change" }, Mt = { type: "start" }, Vt = { type: "end" }, dt = new Qt(), It = new pt(), ge = Math.cos(70 * te.DEG2RAD), j = new w(), K = 2 * Math.PI, T = {
|
|
7
7
|
NONE: -1,
|
|
8
8
|
ROTATE: 0,
|
|
9
9
|
DOLLY: 1,
|
|
@@ -21,7 +21,7 @@ class ye extends qt {
|
|
|
21
21
|
* @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
|
|
22
22
|
*/
|
|
23
23
|
constructor(t, e = null) {
|
|
24
|
-
super(t, e), this.state = T.NONE, this.target = new w(), this.cursor = new w(), 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:
|
|
24
|
+
super(t, e), this.state = T.NONE, this.target = new w(), this.cursor = new w(), 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: W.ROTATE, MIDDLE: W.DOLLY, RIGHT: W.PAN }, this.touches = { ONE: et.ROTATE, TWO: et.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new w(), this._lastQuaternion = new Rt(), this._lastTargetPosition = new w(), this._quat = new Rt().setFromUnitVectors(t.up, new w(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ot(), this._sphericalDelta = new Ot(), this._scale = 1, this._panOffset = new w(), this._rotateStart = new $(), this._rotateEnd = new $(), this._rotateDelta = new $(), this._panStart = new $(), this._panEnd = new $(), this._panDelta = new $(), this._dollyStart = new $(), this._dollyEnd = new $(), this._dollyDelta = new $(), this._dollyDirection = new w(), this._mouse = new $(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = be.bind(this), this._onPointerDown = ve.bind(this), this._onPointerUp = we.bind(this), this._onContextMenu = Ce.bind(this), this._onMouseWheel = Ee.bind(this), this._onKeyDown = De.bind(this), this._onTouchStart = xe.bind(this), this._onTouchMove = Te.bind(this), this._onMouseDown = Pe.bind(this), this._onMouseMove = Me.bind(this), this._interceptControlDown = Se.bind(this), this._interceptControlUp = ke.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
|
|
25
25
|
}
|
|
26
26
|
connect(t) {
|
|
27
27
|
super.connect(t), 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";
|
|
@@ -82,13 +82,13 @@ class ye extends qt {
|
|
|
82
82
|
* was called, or the initial state.
|
|
83
83
|
*/
|
|
84
84
|
reset() {
|
|
85
|
-
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(
|
|
85
|
+
this.target.copy(this.target0), this.object.position.copy(this.position0), this.object.zoom = this.zoom0, this.object.updateProjectionMatrix(), this.dispatchEvent(jt), this.update(), this.state = T.NONE;
|
|
86
86
|
}
|
|
87
87
|
update(t = null) {
|
|
88
88
|
const e = this.object.position;
|
|
89
89
|
j.copy(e).sub(this.target), j.applyQuaternion(this._quat), this._spherical.setFromVector3(j), this.autoRotate && this.state === T.NONE && this._rotateLeft(this._getAutoRotationAngle(t)), 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);
|
|
90
|
-
let
|
|
91
|
-
isFinite(
|
|
90
|
+
let s = this.minAzimuthAngle, a = this.maxAzimuthAngle;
|
|
91
|
+
isFinite(s) && isFinite(a) && (s < -Math.PI ? s += K : s > Math.PI && (s -= K), a < -Math.PI ? a += K : a > Math.PI && (a -= K), s <= a ? this._spherical.theta = Math.max(s, Math.min(a, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (s + a) / 2 ? Math.max(s, 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);
|
|
92
92
|
let c = !1;
|
|
93
93
|
if (this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera)
|
|
94
94
|
this._spherical.radius = this._clampDistance(this._spherical.radius);
|
|
@@ -99,28 +99,28 @@ class ye extends qt {
|
|
|
99
99
|
if (j.setFromSpherical(this._spherical), j.applyQuaternion(this._quatInverse), e.copy(this.target).add(j), 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) {
|
|
100
100
|
let _ = null;
|
|
101
101
|
if (this.object.isPerspectiveCamera) {
|
|
102
|
-
const
|
|
103
|
-
_ = this._clampDistance(
|
|
104
|
-
const P =
|
|
102
|
+
const n = j.length();
|
|
103
|
+
_ = this._clampDistance(n * this._scale);
|
|
104
|
+
const P = n - _;
|
|
105
105
|
this.object.position.addScaledVector(this._dollyDirection, P), this.object.updateMatrixWorld(), c = !!P;
|
|
106
106
|
} else if (this.object.isOrthographicCamera) {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const n = new w(this._mouse.x, this._mouse.y, 0);
|
|
108
|
+
n.unproject(this.object);
|
|
109
109
|
const P = this.object.zoom;
|
|
110
110
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), c = P !== this.object.zoom;
|
|
111
111
|
const M = new w(this._mouse.x, this._mouse.y, 0);
|
|
112
|
-
M.unproject(this.object), this.object.position.sub(M).add(
|
|
112
|
+
M.unproject(this.object), this.object.position.sub(M).add(n), this.object.updateMatrixWorld(), _ = j.length();
|
|
113
113
|
} else
|
|
114
114
|
console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."), this.zoomToCursor = !1;
|
|
115
|
-
_ !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(_).add(this.object.position) : (dt.origin.copy(this.object.position), dt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(dt.direction)) < ge ? this.object.lookAt(this.target) : (
|
|
115
|
+
_ !== null && (this.screenSpacePanning ? this.target.set(0, 0, -1).transformDirection(this.object.matrix).multiplyScalar(_).add(this.object.position) : (dt.origin.copy(this.object.position), dt.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(dt.direction)) < ge ? this.object.lookAt(this.target) : (It.setFromNormalAndCoplanarPoint(this.object.up, this.target), dt.intersectPlane(It, this.target))));
|
|
116
116
|
} else if (this.object.isOrthographicCamera) {
|
|
117
117
|
const _ = this.object.zoom;
|
|
118
118
|
this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), _ !== this.object.zoom && (this.object.updateProjectionMatrix(), c = !0);
|
|
119
119
|
}
|
|
120
|
-
return this._scale = 1, this._performCursorZoom = !1, c || this._lastPosition.distanceToSquared(this.object.position) > wt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > wt || this._lastTargetPosition.distanceToSquared(this.target) > wt ? (this.dispatchEvent(
|
|
120
|
+
return this._scale = 1, this._performCursorZoom = !1, c || this._lastPosition.distanceToSquared(this.object.position) > wt || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > wt || this._lastTargetPosition.distanceToSquared(this.target) > wt ? (this.dispatchEvent(jt), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
|
|
121
121
|
}
|
|
122
122
|
_getAutoRotationAngle(t) {
|
|
123
|
-
return t !== null ?
|
|
123
|
+
return t !== null ? K / 60 * this.autoRotateSpeed * t : K / 60 / 60 * this.autoRotateSpeed;
|
|
124
124
|
}
|
|
125
125
|
_getZoomScale(t) {
|
|
126
126
|
const e = Math.abs(t * 0.01);
|
|
@@ -140,13 +140,13 @@ class ye extends qt {
|
|
|
140
140
|
}
|
|
141
141
|
// deltaX and deltaY are in pixels; right and down are positive
|
|
142
142
|
_pan(t, e) {
|
|
143
|
-
const
|
|
143
|
+
const s = this.domElement;
|
|
144
144
|
if (this.object.isPerspectiveCamera) {
|
|
145
|
-
const
|
|
146
|
-
j.copy(
|
|
145
|
+
const a = this.object.position;
|
|
146
|
+
j.copy(a).sub(this.target);
|
|
147
147
|
let c = j.length();
|
|
148
|
-
c *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * c /
|
|
149
|
-
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom /
|
|
148
|
+
c *= Math.tan(this.object.fov / 2 * Math.PI / 180), this._panLeft(2 * t * c / s.clientHeight, this.object.matrix), this._panUp(2 * e * c / s.clientHeight, this.object.matrix);
|
|
149
|
+
} else this.object.isOrthographicCamera ? (this._panLeft(t * (this.object.right - this.object.left) / this.object.zoom / s.clientWidth, this.object.matrix), this._panUp(e * (this.object.top - this.object.bottom) / this.object.zoom / s.clientHeight, this.object.matrix)) : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."), this.enablePan = !1);
|
|
150
150
|
}
|
|
151
151
|
_dollyOut(t) {
|
|
152
152
|
this.object.isPerspectiveCamera || this.object.isOrthographicCamera ? this._scale /= t : (console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."), this.enableZoom = !1);
|
|
@@ -158,8 +158,8 @@ class ye extends qt {
|
|
|
158
158
|
if (!this.zoomToCursor)
|
|
159
159
|
return;
|
|
160
160
|
this._performCursorZoom = !0;
|
|
161
|
-
const
|
|
162
|
-
this._mouse.x =
|
|
161
|
+
const s = this.domElement.getBoundingClientRect(), a = t - s.left, c = e - s.top, _ = s.width, n = s.height;
|
|
162
|
+
this._mouse.x = a / _ * 2 - 1, this._mouse.y = -(c / n) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
|
|
163
163
|
}
|
|
164
164
|
_clampDistance(t) {
|
|
165
165
|
return Math.max(this.minDistance, Math.min(this.maxDistance, t));
|
|
@@ -179,7 +179,7 @@ class ye extends qt {
|
|
|
179
179
|
_handleMouseMoveRotate(t) {
|
|
180
180
|
this._rotateEnd.set(t.clientX, t.clientY), this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
181
181
|
const e = this.domElement;
|
|
182
|
-
this._rotateLeft(
|
|
182
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd), this.update();
|
|
183
183
|
}
|
|
184
184
|
_handleMouseMoveDolly(t) {
|
|
185
185
|
this._dollyEnd.set(t.clientX, t.clientY), this._dollyDelta.subVectors(this._dollyEnd, this._dollyStart), this._dollyDelta.y > 0 ? this._dollyOut(this._getZoomScale(this._dollyDelta.y)) : this._dollyDelta.y < 0 && this._dollyIn(this._getZoomScale(this._dollyDelta.y)), this._dollyStart.copy(this._dollyEnd), this.update();
|
|
@@ -194,16 +194,16 @@ class ye extends qt {
|
|
|
194
194
|
let e = !1;
|
|
195
195
|
switch (t.code) {
|
|
196
196
|
case this.keys.UP:
|
|
197
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(
|
|
197
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, this.keyPanSpeed), e = !0;
|
|
198
198
|
break;
|
|
199
199
|
case this.keys.BOTTOM:
|
|
200
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-
|
|
200
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateUp(-K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(0, -this.keyPanSpeed), e = !0;
|
|
201
201
|
break;
|
|
202
202
|
case this.keys.LEFT:
|
|
203
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(
|
|
203
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(this.keyPanSpeed, 0), e = !0;
|
|
204
204
|
break;
|
|
205
205
|
case this.keys.RIGHT:
|
|
206
|
-
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-
|
|
206
|
+
t.ctrlKey || t.metaKey || t.shiftKey ? this.enableRotate && this._rotateLeft(-K * this.keyRotateSpeed / this.domElement.clientHeight) : this.enablePan && this._pan(-this.keyPanSpeed, 0), e = !0;
|
|
207
207
|
break;
|
|
208
208
|
}
|
|
209
209
|
e && (t.preventDefault(), this.update());
|
|
@@ -212,20 +212,20 @@ class ye extends qt {
|
|
|
212
212
|
if (this._pointers.length === 1)
|
|
213
213
|
this._rotateStart.set(t.pageX, t.pageY);
|
|
214
214
|
else {
|
|
215
|
-
const e = this._getSecondPointerPosition(t),
|
|
216
|
-
this._rotateStart.set(
|
|
215
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
216
|
+
this._rotateStart.set(s, a);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
_handleTouchStartPan(t) {
|
|
220
220
|
if (this._pointers.length === 1)
|
|
221
221
|
this._panStart.set(t.pageX, t.pageY);
|
|
222
222
|
else {
|
|
223
|
-
const e = this._getSecondPointerPosition(t),
|
|
224
|
-
this._panStart.set(
|
|
223
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
224
|
+
this._panStart.set(s, a);
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
227
|
_handleTouchStartDolly(t) {
|
|
228
|
-
const e = this._getSecondPointerPosition(t),
|
|
228
|
+
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, c = Math.sqrt(s * s + a * a);
|
|
229
229
|
this._dollyStart.set(0, c);
|
|
230
230
|
}
|
|
231
231
|
_handleTouchStartDollyPan(t) {
|
|
@@ -238,27 +238,27 @@ class ye extends qt {
|
|
|
238
238
|
if (this._pointers.length == 1)
|
|
239
239
|
this._rotateEnd.set(t.pageX, t.pageY);
|
|
240
240
|
else {
|
|
241
|
-
const
|
|
242
|
-
this._rotateEnd.set(
|
|
241
|
+
const s = this._getSecondPointerPosition(t), a = 0.5 * (t.pageX + s.x), c = 0.5 * (t.pageY + s.y);
|
|
242
|
+
this._rotateEnd.set(a, c);
|
|
243
243
|
}
|
|
244
244
|
this._rotateDelta.subVectors(this._rotateEnd, this._rotateStart).multiplyScalar(this.rotateSpeed);
|
|
245
245
|
const e = this.domElement;
|
|
246
|
-
this._rotateLeft(
|
|
246
|
+
this._rotateLeft(K * this._rotateDelta.x / e.clientHeight), this._rotateUp(K * this._rotateDelta.y / e.clientHeight), this._rotateStart.copy(this._rotateEnd);
|
|
247
247
|
}
|
|
248
248
|
_handleTouchMovePan(t) {
|
|
249
249
|
if (this._pointers.length === 1)
|
|
250
250
|
this._panEnd.set(t.pageX, t.pageY);
|
|
251
251
|
else {
|
|
252
|
-
const e = this._getSecondPointerPosition(t),
|
|
253
|
-
this._panEnd.set(
|
|
252
|
+
const e = this._getSecondPointerPosition(t), s = 0.5 * (t.pageX + e.x), a = 0.5 * (t.pageY + e.y);
|
|
253
|
+
this._panEnd.set(s, a);
|
|
254
254
|
}
|
|
255
255
|
this._panDelta.subVectors(this._panEnd, this._panStart).multiplyScalar(this.panSpeed), this._pan(this._panDelta.x, this._panDelta.y), this._panStart.copy(this._panEnd);
|
|
256
256
|
}
|
|
257
257
|
_handleTouchMoveDolly(t) {
|
|
258
|
-
const e = this._getSecondPointerPosition(t),
|
|
258
|
+
const e = this._getSecondPointerPosition(t), s = t.pageX - e.x, a = t.pageY - e.y, c = Math.sqrt(s * s + a * a);
|
|
259
259
|
this._dollyEnd.set(0, c), this._dollyDelta.set(0, Math.pow(this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed)), this._dollyOut(this._dollyDelta.y), this._dollyStart.copy(this._dollyEnd);
|
|
260
|
-
const _ = (t.pageX + e.x) * 0.5,
|
|
261
|
-
this._updateZoomParameters(_,
|
|
260
|
+
const _ = (t.pageX + e.x) * 0.5, n = (t.pageY + e.y) * 0.5;
|
|
261
|
+
this._updateZoomParameters(_, n);
|
|
262
262
|
}
|
|
263
263
|
_handleTouchMoveDollyPan(t) {
|
|
264
264
|
this.enableZoom && this._handleTouchMoveDolly(t), this.enablePan && this._handleTouchMovePan(t);
|
|
@@ -293,20 +293,20 @@ class ye extends qt {
|
|
|
293
293
|
}
|
|
294
294
|
//
|
|
295
295
|
_customWheelEvent(t) {
|
|
296
|
-
const e = t.deltaMode,
|
|
296
|
+
const e = t.deltaMode, s = {
|
|
297
297
|
clientX: t.clientX,
|
|
298
298
|
clientY: t.clientY,
|
|
299
299
|
deltaY: t.deltaY
|
|
300
300
|
};
|
|
301
301
|
switch (e) {
|
|
302
302
|
case 1:
|
|
303
|
-
|
|
303
|
+
s.deltaY *= 16;
|
|
304
304
|
break;
|
|
305
305
|
case 2:
|
|
306
|
-
|
|
306
|
+
s.deltaY *= 100;
|
|
307
307
|
break;
|
|
308
308
|
}
|
|
309
|
-
return t.ctrlKey && !this._controlActive && (
|
|
309
|
+
return t.ctrlKey && !this._controlActive && (s.deltaY *= 10), s;
|
|
310
310
|
}
|
|
311
311
|
}
|
|
312
312
|
function ve(o) {
|
|
@@ -342,11 +342,11 @@ function Pe(o) {
|
|
|
342
342
|
t = -1;
|
|
343
343
|
}
|
|
344
344
|
switch (t) {
|
|
345
|
-
case
|
|
345
|
+
case W.DOLLY:
|
|
346
346
|
if (this.enableZoom === !1) return;
|
|
347
347
|
this._handleMouseDownDolly(o), this.state = T.DOLLY;
|
|
348
348
|
break;
|
|
349
|
-
case
|
|
349
|
+
case W.ROTATE:
|
|
350
350
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
|
351
351
|
if (this.enablePan === !1) return;
|
|
352
352
|
this._handleMouseDownPan(o), this.state = T.PAN;
|
|
@@ -355,7 +355,7 @@ function Pe(o) {
|
|
|
355
355
|
this._handleMouseDownRotate(o), this.state = T.ROTATE;
|
|
356
356
|
}
|
|
357
357
|
break;
|
|
358
|
-
case
|
|
358
|
+
case W.PAN:
|
|
359
359
|
if (o.ctrlKey || o.metaKey || o.shiftKey) {
|
|
360
360
|
if (this.enableRotate === !1) return;
|
|
361
361
|
this._handleMouseDownRotate(o), this.state = T.ROTATE;
|
|
@@ -458,19 +458,19 @@ function ke(o) {
|
|
|
458
458
|
o.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
|
|
459
459
|
}
|
|
460
460
|
function Ae(o) {
|
|
461
|
-
let t = null, e = null,
|
|
461
|
+
let t = null, e = null, s = null, a = null, c = null, _ = null, n = null, P = null;
|
|
462
462
|
const M = x([]), k = x(new w()), U = x(new w()), A = () => {
|
|
463
463
|
if (!o.value) return;
|
|
464
|
-
t = new ee(), t.background = new
|
|
464
|
+
t = new ee(), t.background = new ie(15790320);
|
|
465
465
|
const m = o.value;
|
|
466
|
-
e = new
|
|
466
|
+
e = new se(75, m.clientWidth / m.clientHeight, 0.1, 1e4), e.position.set(8, -8, 6), e.up.set(0, 0, 1), e.lookAt(0, 0, 0), s = new oe({
|
|
467
467
|
antialias: !0,
|
|
468
468
|
alpha: !0
|
|
469
|
-
}),
|
|
470
|
-
LEFT:
|
|
471
|
-
MIDDLE:
|
|
469
|
+
}), s.setSize(m.clientWidth, m.clientHeight), s.localClippingEnabled = !0, s.shadowMap.enabled = !0, s.shadowMap.type = ae, s.toneMapping = ne, s.toneMappingExposure = 1, s.outputColorSpace = le, m.appendChild(s.domElement), a = new ye(e, s.domElement), a.enableDamping = !0, a.dampingFactor = 0.05, a.mouseButtons = {
|
|
470
|
+
LEFT: W.ROTATE,
|
|
471
|
+
MIDDLE: W.PAN,
|
|
472
472
|
RIGHT: null
|
|
473
|
-
},
|
|
473
|
+
}, a.panSpeed = 0.7, c = new re(e, s, {
|
|
474
474
|
container: m,
|
|
475
475
|
type: "cube",
|
|
476
476
|
placement: "top-right",
|
|
@@ -500,12 +500,12 @@ function Ae(o) {
|
|
|
500
500
|
back: {
|
|
501
501
|
label: "Bottom"
|
|
502
502
|
}
|
|
503
|
-
}), c.attachControls(
|
|
503
|
+
}), c.attachControls(a), g(), i();
|
|
504
504
|
}, r = (m, l) => {
|
|
505
|
-
|
|
505
|
+
n && (t.remove(n), n.dispose()), P && (t.remove(P), P.geometry.dispose(), P.material.dispose());
|
|
506
506
|
const E = Math.min(Math.max(Math.floor(m / 20), 30), 40);
|
|
507
|
-
|
|
508
|
-
const H = new
|
|
507
|
+
n = new he(m, E, 13421772, 14540253), n.rotateX(Math.PI / 2), n.position.copy(l), t.add(n);
|
|
508
|
+
const H = new mt(m, m), u = new ce({
|
|
509
509
|
opacity: 0.3,
|
|
510
510
|
// 阴影透明度
|
|
511
511
|
color: 0
|
|
@@ -514,7 +514,7 @@ function Ae(o) {
|
|
|
514
514
|
}, C = () => {
|
|
515
515
|
if (M.value.length === 0)
|
|
516
516
|
return;
|
|
517
|
-
const m = new
|
|
517
|
+
const m = new _t();
|
|
518
518
|
M.value.forEach((h) => {
|
|
519
519
|
m.expandByObject(h);
|
|
520
520
|
});
|
|
@@ -536,12 +536,12 @@ function Ae(o) {
|
|
|
536
536
|
H.position.set(0, -15, 2), t.add(H);
|
|
537
537
|
const u = new de(16777215, 4473924, 0.8);
|
|
538
538
|
t.add(u);
|
|
539
|
-
const f = new
|
|
539
|
+
const f = new Lt(16777215, 1, 50);
|
|
540
540
|
f.position.set(15, 15, 15), t.add(f);
|
|
541
|
-
const h = new
|
|
541
|
+
const h = new Lt(16777215, 0.5, 50);
|
|
542
542
|
h.position.set(-15, -15, 15), t.add(h);
|
|
543
|
-
},
|
|
544
|
-
_ = requestAnimationFrame(
|
|
543
|
+
}, i = () => {
|
|
544
|
+
_ = requestAnimationFrame(i), a && a.update(), s && t && e && s.render(t, e), c && c.render();
|
|
545
545
|
}, p = (m) => {
|
|
546
546
|
[
|
|
547
547
|
"map",
|
|
@@ -573,24 +573,24 @@ function Ae(o) {
|
|
|
573
573
|
// 方法
|
|
574
574
|
initThreeJS: A,
|
|
575
575
|
handleResize: () => {
|
|
576
|
-
if (!o.value || !e || !
|
|
576
|
+
if (!o.value || !e || !s || !c) return;
|
|
577
577
|
const m = o.value, l = m.clientWidth, E = m.clientHeight;
|
|
578
|
-
e.aspect = l / E, e.updateProjectionMatrix(),
|
|
578
|
+
e.aspect = l / E, e.updateProjectionMatrix(), s.setSize(l, E), c.update();
|
|
579
579
|
},
|
|
580
580
|
fitCameraToAllModels: () => {
|
|
581
|
-
if (!e || !
|
|
582
|
-
const m = new
|
|
581
|
+
if (!e || !a || M.value.length === 0) return;
|
|
582
|
+
const m = new _t();
|
|
583
583
|
M.value.forEach((h) => {
|
|
584
584
|
m.expandByObject(h);
|
|
585
585
|
});
|
|
586
586
|
const l = m.getSize(new w()), E = m.getCenter(new w()), u = Math.max(l.x, l.y, l.z) * 0.8, f = new w(E.x + u, E.y - u, E.z + u);
|
|
587
|
-
e.position.copy(f), e.lookAt(E),
|
|
587
|
+
e.position.copy(f), e.lookAt(E), a.target.copy(E), a.update(), k.value.copy(f), U.value.copy(E), C();
|
|
588
588
|
},
|
|
589
589
|
getThreeJSObjects: () => ({
|
|
590
590
|
scene: t,
|
|
591
591
|
camera: e,
|
|
592
|
-
renderer:
|
|
593
|
-
controls:
|
|
592
|
+
renderer: s,
|
|
593
|
+
controls: a,
|
|
594
594
|
gizmo: c
|
|
595
595
|
}),
|
|
596
596
|
clearAllModels: () => {
|
|
@@ -606,75 +606,75 @@ function Ae(o) {
|
|
|
606
606
|
}), M.value = [], C();
|
|
607
607
|
},
|
|
608
608
|
cleanup: () => {
|
|
609
|
-
_ && cancelAnimationFrame(_),
|
|
609
|
+
_ && cancelAnimationFrame(_), n && n.dispose(), P && (P.geometry.dispose(), P.material.dispose()), s && s.dispose(), a && a.dispose(), c && c.dispose();
|
|
610
610
|
},
|
|
611
611
|
updateGridForModels: C
|
|
612
612
|
};
|
|
613
613
|
}
|
|
614
614
|
function ze(o, t) {
|
|
615
615
|
const e = x(!1);
|
|
616
|
-
let
|
|
617
|
-
const k = (
|
|
618
|
-
const p = new w(), b = P * 1.2, R = new w(
|
|
619
|
-
if (
|
|
620
|
-
const V =
|
|
621
|
-
p.x =
|
|
622
|
-
} else if (
|
|
623
|
-
const L = (
|
|
616
|
+
let s = null, a = 12700, c = new w(), _ = new w(), n = new w(), P = 0, M = null;
|
|
617
|
+
const k = (i) => i < 0.5 ? 4 * i * i * i : 1 - Math.pow(-2 * i + 2, 3) / 2, U = (i) => {
|
|
618
|
+
const p = new w(), b = P * 1.2, R = new w(n.x + b, n.y, n.z), Y = new w(n.x, n.y + b, n.z), N = new w(n.x, n.y - b, n.z);
|
|
619
|
+
if (i <= 0.567) {
|
|
620
|
+
const V = i / 0.567 * Math.PI * 2;
|
|
621
|
+
p.x = n.x + Math.cos(V) * b, p.z = n.z + Math.sin(V) * b, p.y = n.y;
|
|
622
|
+
} else if (i <= 0.724) {
|
|
623
|
+
const L = (i - 0.567) / 0.157, V = k(L);
|
|
624
624
|
p.lerpVectors(R, Y, V);
|
|
625
|
-
} else if (
|
|
626
|
-
const L = (
|
|
627
|
-
p.x =
|
|
625
|
+
} else if (i <= 0.881) {
|
|
626
|
+
const L = (i - 0.724) / 0.157, m = k(L) * Math.PI;
|
|
627
|
+
p.x = n.x + Math.sin(m) * b, p.y = n.y + Math.cos(m) * b, p.z = n.z;
|
|
628
628
|
} else {
|
|
629
|
-
const L = (
|
|
629
|
+
const L = (i - 0.881) / 0.119, V = k(L);
|
|
630
630
|
p.lerpVectors(N, c, V);
|
|
631
631
|
}
|
|
632
632
|
return p;
|
|
633
633
|
}, A = () => {
|
|
634
|
-
const { camera:
|
|
635
|
-
if (!
|
|
636
|
-
|
|
637
|
-
const b = Date.now() -
|
|
634
|
+
const { camera: i, controls: p } = o();
|
|
635
|
+
if (!i || !p) return;
|
|
636
|
+
s || (s = Date.now());
|
|
637
|
+
const b = Date.now() - s, R = Math.min(b / a, 1);
|
|
638
638
|
if (R >= 1) {
|
|
639
639
|
C();
|
|
640
640
|
return;
|
|
641
641
|
}
|
|
642
642
|
const Y = U(R);
|
|
643
|
-
|
|
643
|
+
i.position.copy(Y), i.lookAt(n), p.target.copy(n), M = requestAnimationFrame(A);
|
|
644
644
|
}, r = () => {
|
|
645
645
|
if (t.value.length === 0) return;
|
|
646
|
-
const { camera:
|
|
647
|
-
if (!
|
|
648
|
-
c.copy(
|
|
649
|
-
const b = new
|
|
646
|
+
const { camera: i, controls: p } = o();
|
|
647
|
+
if (!i || !p) return;
|
|
648
|
+
c.copy(i.position), _.copy(p.target);
|
|
649
|
+
const b = new _t();
|
|
650
650
|
t.value.forEach((l) => {
|
|
651
651
|
b.expandByObject(l);
|
|
652
652
|
});
|
|
653
653
|
const R = b.getSize(new w());
|
|
654
|
-
|
|
655
|
-
const Y = new w(
|
|
654
|
+
n = b.getCenter(new w()), P = Math.max(R.x, R.y, R.z) * 1.2;
|
|
655
|
+
const Y = new w(n.x + P * 1.2, n.y, n.z);
|
|
656
656
|
p.enabled = !1;
|
|
657
|
-
const N =
|
|
657
|
+
const N = i.position.clone(), L = 1e3, V = Date.now(), m = () => {
|
|
658
658
|
const l = Date.now() - V, E = Math.min(l / L, 1), H = k(E);
|
|
659
|
-
|
|
659
|
+
i.position.lerpVectors(N, Y, H), i.lookAt(n), p.target.copy(n), E < 1 ? requestAnimationFrame(m) : (e.value = !0, s = null, A());
|
|
660
660
|
};
|
|
661
661
|
m();
|
|
662
662
|
}, C = () => {
|
|
663
|
-
e.value = !1,
|
|
664
|
-
const { controls:
|
|
665
|
-
|
|
663
|
+
e.value = !1, s = null, M && (cancelAnimationFrame(M), M = null);
|
|
664
|
+
const { controls: i } = o();
|
|
665
|
+
i && (i.enabled = !0, i.target.copy(_));
|
|
666
666
|
};
|
|
667
667
|
return {
|
|
668
668
|
isAnimating: e,
|
|
669
669
|
toggleAnimation: () => {
|
|
670
670
|
if (e.value) {
|
|
671
|
-
e.value = !1,
|
|
672
|
-
const { camera:
|
|
673
|
-
if (!
|
|
671
|
+
e.value = !1, s = null, M && (cancelAnimationFrame(M), M = null);
|
|
672
|
+
const { camera: i, controls: p } = o();
|
|
673
|
+
if (!i || !p) return;
|
|
674
674
|
p.enabled = !0;
|
|
675
|
-
const b =
|
|
675
|
+
const b = i.position.clone(), R = p.target.clone(), Y = 1500, N = Date.now(), L = () => {
|
|
676
676
|
const V = Date.now() - N, m = Math.min(V / Y, 1), l = k(m);
|
|
677
|
-
|
|
677
|
+
i.position.lerpVectors(b, c, l), p.target.lerpVectors(R, _, l), m < 1 && requestAnimationFrame(L);
|
|
678
678
|
};
|
|
679
679
|
L();
|
|
680
680
|
} else
|
|
@@ -685,25 +685,25 @@ function ze(o, t) {
|
|
|
685
685
|
};
|
|
686
686
|
}
|
|
687
687
|
function Re(o, t) {
|
|
688
|
-
const e = x(!1),
|
|
689
|
-
let
|
|
688
|
+
const e = x(!1), s = x("none");
|
|
689
|
+
let a = [], c = [], _ = new _t(), n = new w();
|
|
690
690
|
const P = () => {
|
|
691
|
-
|
|
692
|
-
new
|
|
691
|
+
a = [
|
|
692
|
+
new pt(new w(1, 0, 0), 0),
|
|
693
693
|
// X轴平面
|
|
694
|
-
new
|
|
694
|
+
new pt(new w(0, 1, 0), 0),
|
|
695
695
|
// Y轴平面
|
|
696
|
-
new
|
|
696
|
+
new pt(new w(0, 0, 1), 0)
|
|
697
697
|
// Z轴平面
|
|
698
698
|
];
|
|
699
699
|
}, M = () => {
|
|
700
700
|
_.makeEmpty(), t.value.forEach((g) => {
|
|
701
701
|
_.expandByObject(g);
|
|
702
|
-
}),
|
|
702
|
+
}), n = _.getCenter(new w());
|
|
703
703
|
}, k = (g) => {
|
|
704
|
-
const
|
|
704
|
+
const i = _.getSize(new w());
|
|
705
705
|
let p, b, R;
|
|
706
|
-
g === "x" ? (p = new
|
|
706
|
+
g === "x" ? (p = new mt(i.z * 1.2, i.y * 1.2), b = new w(n.x, n.y, n.z), R = new bt(0, Math.PI / 2, 0)) : g === "y" ? (p = new mt(i.x * 1.2, i.z * 1.2), b = new w(n.x, n.y, n.z), R = new bt(Math.PI / 2, 0, 0)) : g === "z" && (p = new mt(i.x * 1.2, i.y * 1.2), b = new w(n.x, n.y, n.z), R = new bt(0, 0, 0));
|
|
707
707
|
const Y = new pe({
|
|
708
708
|
color: 8900331,
|
|
709
709
|
transparent: !0,
|
|
@@ -713,11 +713,11 @@ function Re(o, t) {
|
|
|
713
713
|
}), N = new Ut(p, Y);
|
|
714
714
|
return N.position.copy(b), N.rotation.copy(R), N;
|
|
715
715
|
}, U = () => {
|
|
716
|
-
if (A(), r(),
|
|
716
|
+
if (A(), r(), s.value === "none")
|
|
717
717
|
return;
|
|
718
718
|
M();
|
|
719
719
|
let g = null;
|
|
720
|
-
if (
|
|
720
|
+
if (s.value === "x" ? (a[0].constant = -n.x, g = a[0]) : s.value === "y" ? (a[1].constant = -n.y, g = a[1]) : s.value === "z" && (a[2].constant = -n.z, g = a[2]), g) {
|
|
721
721
|
t.value.forEach((p) => {
|
|
722
722
|
p.traverse((b) => {
|
|
723
723
|
b.isMesh && b.material && (Array.isArray(b.material) ? b.material.forEach((R) => {
|
|
@@ -725,38 +725,38 @@ function Re(o, t) {
|
|
|
725
725
|
}) : b.material.clippingPlanes = [g]);
|
|
726
726
|
});
|
|
727
727
|
});
|
|
728
|
-
const { scene:
|
|
729
|
-
if (
|
|
730
|
-
const p = k(
|
|
731
|
-
|
|
728
|
+
const { scene: i } = o();
|
|
729
|
+
if (i) {
|
|
730
|
+
const p = k(s.value);
|
|
731
|
+
i.add(p), c.push(p);
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
734
|
}, A = () => {
|
|
735
735
|
t.value.forEach((g) => {
|
|
736
|
-
g.traverse((
|
|
737
|
-
|
|
736
|
+
g.traverse((i) => {
|
|
737
|
+
i.isMesh && i.material && (Array.isArray(i.material) ? i.material.forEach((p) => {
|
|
738
738
|
p.clippingPlanes = [];
|
|
739
|
-
}) :
|
|
739
|
+
}) : i.material.clippingPlanes = []);
|
|
740
740
|
});
|
|
741
741
|
});
|
|
742
742
|
}, r = () => {
|
|
743
743
|
const { scene: g } = o();
|
|
744
|
-
g && c.forEach((
|
|
745
|
-
g.remove(
|
|
744
|
+
g && c.forEach((i) => {
|
|
745
|
+
g.remove(i), i.geometry.dispose(), i.material.dispose();
|
|
746
746
|
}), c = [];
|
|
747
747
|
};
|
|
748
748
|
return {
|
|
749
749
|
isClipping: e,
|
|
750
|
-
activeClippingAxis:
|
|
750
|
+
activeClippingAxis: s,
|
|
751
751
|
toggleClipping: () => {
|
|
752
|
-
e.value = !e.value, e.value ? (P(), t.value.length > 0 && M()) : (
|
|
752
|
+
e.value = !e.value, e.value ? (P(), t.value.length > 0 && M()) : (s.value = "none", A(), r());
|
|
753
753
|
},
|
|
754
754
|
updateClippingPlanes: U,
|
|
755
755
|
clearClippingPlanes: A,
|
|
756
756
|
clearClippingMeshes: r
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
|
-
const Oe = { class: "panel-content" }, Le =
|
|
759
|
+
const Oe = { class: "panel-content" }, Le = {
|
|
760
760
|
__name: "animationTable",
|
|
761
761
|
props: {
|
|
762
762
|
animationData: Object,
|
|
@@ -765,24 +765,24 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
765
765
|
setup(o) {
|
|
766
766
|
const t = o;
|
|
767
767
|
x([]);
|
|
768
|
-
const e = x(
|
|
769
|
-
return
|
|
768
|
+
const e = x(), s = x();
|
|
769
|
+
return ft(
|
|
770
770
|
() => [t == null ? void 0 : t.animationData, t == null ? void 0 : t.urdf],
|
|
771
771
|
() => {
|
|
772
772
|
var c;
|
|
773
|
-
let
|
|
774
|
-
|
|
773
|
+
let a = ((c = Yt(t == null ? void 0 : t.animationData)) == null ? void 0 : c.动画输出) ?? [];
|
|
774
|
+
console.log(232, a, t == null ? void 0 : t.animationData, t == null ? void 0 : t.urdf), a && a.length > 0 && (t != null && t.urdf);
|
|
775
775
|
},
|
|
776
|
-
{ deep: !0 }
|
|
777
|
-
), (
|
|
776
|
+
{ deep: !0, immediate: !0 }
|
|
777
|
+
), (a, c) => (Z(), B("div", Oe, [
|
|
778
778
|
D(_e, {
|
|
779
779
|
columns: e.value,
|
|
780
|
-
tableData:
|
|
780
|
+
tableData: s.value,
|
|
781
781
|
isShowPagination: !1
|
|
782
782
|
}, null, 8, ["columns", "tableData"])
|
|
783
783
|
]));
|
|
784
784
|
}
|
|
785
|
-
}
|
|
785
|
+
}, je = /* @__PURE__ */ ot(Le, [["__scopeId", "data-v-aba10aba"]]), Ie = { class: "panel-content" }, Fe = "id", Ne = {
|
|
786
786
|
__name: "urdfTree",
|
|
787
787
|
props: {
|
|
788
788
|
model: Object,
|
|
@@ -798,26 +798,26 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
798
798
|
},
|
|
799
799
|
emits: ["nodeClick"],
|
|
800
800
|
setup(o, { emit: t }) {
|
|
801
|
-
const e = o,
|
|
801
|
+
const e = o, s = t, a = x([]), c = {
|
|
802
802
|
children: "children",
|
|
803
803
|
label: "label"
|
|
804
804
|
}, _ = (r) => {
|
|
805
|
-
|
|
806
|
-
},
|
|
805
|
+
s("nodeClick", r);
|
|
806
|
+
}, n = (r, C = 0) => {
|
|
807
807
|
const g = [];
|
|
808
|
-
return Array.isArray(r) && (r == null ? void 0 : r.length) > 0 && r.forEach((
|
|
809
|
-
if (!(
|
|
808
|
+
return Array.isArray(r) && (r == null ? void 0 : r.length) > 0 && r.forEach((i) => {
|
|
809
|
+
if (!(i != null && i.isMesh) && ((i == null ? void 0 : i.type) === "URDFJoint" || (i == null ? void 0 : i.type) === "URDFLink")) {
|
|
810
810
|
const p = {
|
|
811
|
-
name:
|
|
812
|
-
label:
|
|
811
|
+
name: i == null ? void 0 : i.name,
|
|
812
|
+
label: i == null ? void 0 : i.name,
|
|
813
813
|
show: !0,
|
|
814
814
|
level: C + 1,
|
|
815
815
|
isPenultimate: !1,
|
|
816
|
-
type:
|
|
817
|
-
id:
|
|
818
|
-
limit: (
|
|
819
|
-
children:
|
|
820
|
-
path:
|
|
816
|
+
type: i == null ? void 0 : i.type,
|
|
817
|
+
id: i == null ? void 0 : i.id,
|
|
818
|
+
limit: (i == null ? void 0 : i.limit) ?? "",
|
|
819
|
+
children: n(i == null ? void 0 : i.children, C + 1),
|
|
820
|
+
path: i == null ? void 0 : i.name
|
|
821
821
|
};
|
|
822
822
|
g.push(p);
|
|
823
823
|
}
|
|
@@ -831,36 +831,36 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
831
831
|
type: r == null ? void 0 : r.type,
|
|
832
832
|
id: r == null ? void 0 : r.id,
|
|
833
833
|
limit: (r == null ? void 0 : r.limit) ?? "",
|
|
834
|
-
children:
|
|
834
|
+
children: n(r == null ? void 0 : r.children, 1),
|
|
835
835
|
path: r == null ? void 0 : r.name
|
|
836
836
|
}] : [], M = (r, C) => {
|
|
837
|
-
const g = [],
|
|
838
|
-
for (;
|
|
839
|
-
const p =
|
|
840
|
-
p.children && p.children.length > 0 && (g.push(p.id),
|
|
837
|
+
const g = [], i = [...r];
|
|
838
|
+
for (; i.length > 0 && g.length < C; ) {
|
|
839
|
+
const p = i.shift();
|
|
840
|
+
p.children && p.children.length > 0 && (g.push(p.id), i.push(...p.children));
|
|
841
841
|
}
|
|
842
842
|
return g;
|
|
843
843
|
}, k = (r, C) => {
|
|
844
844
|
const g = [];
|
|
845
|
-
return r.forEach((
|
|
846
|
-
if (
|
|
847
|
-
g.push(
|
|
848
|
-
const p =
|
|
845
|
+
return r.forEach((i) => {
|
|
846
|
+
if (i.children && i.children.length > 0) {
|
|
847
|
+
g.push(i.id);
|
|
848
|
+
const p = i.children.filter((b) => b.children && b.children.length > 0).slice(0, C).map((b) => b.id);
|
|
849
849
|
g.push(...p);
|
|
850
850
|
}
|
|
851
851
|
}), g.slice(0, C + 1);
|
|
852
|
-
}, U = st(() => !
|
|
853
|
-
return
|
|
852
|
+
}, U = st(() => !a.value || a.value.length === 0 ? [] : e.expandStrategy === "firstLevel" ? k(a.value, e.maxExpandCount) : M(a.value, e.maxExpandCount)), A = st(() => e != null && e.model ? P(e.model) : []);
|
|
853
|
+
return ft(
|
|
854
854
|
A,
|
|
855
855
|
(r) => {
|
|
856
|
-
|
|
856
|
+
a.value = JSON.parse(JSON.stringify(r));
|
|
857
857
|
},
|
|
858
858
|
{ immediate: !0 }
|
|
859
859
|
), (r, C) => {
|
|
860
860
|
const g = Ft("el-tree");
|
|
861
|
-
return
|
|
861
|
+
return Z(), B("div", Ie, [
|
|
862
862
|
D(g, {
|
|
863
|
-
data:
|
|
863
|
+
data: a.value,
|
|
864
864
|
props: c,
|
|
865
865
|
"default-expanded-keys": U.value,
|
|
866
866
|
"node-key": Fe,
|
|
@@ -869,28 +869,28 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
869
869
|
]);
|
|
870
870
|
};
|
|
871
871
|
}
|
|
872
|
-
}, Ue = /* @__PURE__ */
|
|
872
|
+
}, Ue = /* @__PURE__ */ ot(Ne, [["__scopeId", "data-v-290ff4e1"]]), Ye = { class: "panel-content" }, Ve = {
|
|
873
873
|
key: 0,
|
|
874
874
|
class: "joints-list"
|
|
875
875
|
}, He = { class: "joint-info-row" }, Ze = { class: "joint-left" }, Ke = { class: "joint-name" }, Be = { class: "joint-range" }, $e = { class: "joint-type" }, Xe = {
|
|
876
876
|
key: 0,
|
|
877
877
|
class: "joint-control-row"
|
|
878
|
-
}, Je = { class: "slider-container" }, Ge = ["min", "max", "value", "onInput", "disabled"], We = { class: "value-display" }, qe = { class: "joint-value" }, Qe = { class: "unit" },
|
|
878
|
+
}, Je = { class: "slider-container" }, Ge = ["min", "max", "value", "onInput", "disabled"], We = { class: "value-display" }, qe = { class: "joint-value" }, Qe = { class: "unit" }, ti = {
|
|
879
879
|
key: 1,
|
|
880
880
|
class: "empty-state"
|
|
881
|
-
},
|
|
881
|
+
}, ei = 1e3, Pt = 60, ii = {
|
|
882
882
|
__name: "jointPanel",
|
|
883
883
|
props: {
|
|
884
884
|
model: Object,
|
|
885
885
|
scene: Object,
|
|
886
|
-
animationData:
|
|
886
|
+
animationData: Object
|
|
887
887
|
},
|
|
888
888
|
setup(o, { expose: t }) {
|
|
889
889
|
const e = o;
|
|
890
890
|
x(!0);
|
|
891
|
-
const
|
|
891
|
+
const s = x([]), a = x(null), c = x(!1), _ = x(!1), n = x(0), P = x(0), M = x(null), k = x(1), U = () => ei / Pt / k.value;
|
|
892
892
|
let A = [];
|
|
893
|
-
|
|
893
|
+
ft(
|
|
894
894
|
() => e.animationData,
|
|
895
895
|
(u) => {
|
|
896
896
|
var h;
|
|
@@ -923,7 +923,7 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
923
923
|
});
|
|
924
924
|
}), f.sort((h, v) => h.name.localeCompare(v.name));
|
|
925
925
|
}, g = (u, f) => {
|
|
926
|
-
const h =
|
|
926
|
+
const h = s.value.find((I) => I.name === u);
|
|
927
927
|
if (!h) return;
|
|
928
928
|
const v = parseFloat(f);
|
|
929
929
|
if (h.limit) {
|
|
@@ -932,17 +932,17 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
932
932
|
} else
|
|
933
933
|
h.currentValue = v;
|
|
934
934
|
e.model && e.model.setJointValue ? e.model.setJointValue(u, h.currentValue) : h.urdfJoint && h.urdfJoint.setJointValue(h.currentValue);
|
|
935
|
-
},
|
|
935
|
+
}, i = (u) => {
|
|
936
936
|
u && Object.keys(u).forEach((f) => {
|
|
937
|
-
const h = u[f], v =
|
|
937
|
+
const h = u[f], v = s.value.find((I) => I.name === f);
|
|
938
938
|
v && (v.currentValue = h, e.model && e.model.setJointValue ? e.model.setJointValue(f, h) : v.urdfJoint && v.urdfJoint.setJointValue(h));
|
|
939
939
|
});
|
|
940
940
|
}, p = (u, f, h) => u + (f - u) * h, b = (u, f, h) => {
|
|
941
941
|
if (!u || !f) return u || f;
|
|
942
942
|
const v = {};
|
|
943
943
|
return Object.keys(u).forEach((I) => {
|
|
944
|
-
const
|
|
945
|
-
v[I] = p(
|
|
944
|
+
const q = u[I], G = f[I];
|
|
945
|
+
v[I] = p(q, G || q, h);
|
|
946
946
|
}), v;
|
|
947
947
|
}, R = () => {
|
|
948
948
|
if (A.length === 0) {
|
|
@@ -952,13 +952,13 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
952
952
|
c.value = !0, _.value = !1;
|
|
953
953
|
const u = () => {
|
|
954
954
|
if (!c.value || _.value) return;
|
|
955
|
-
const f = P.value / Pt, h = A[
|
|
955
|
+
const f = P.value / Pt, h = A[n.value], v = A[n.value + 1];
|
|
956
956
|
if (v) {
|
|
957
957
|
const I = b(h, v, f);
|
|
958
|
-
|
|
958
|
+
i(I);
|
|
959
959
|
} else
|
|
960
|
-
|
|
961
|
-
if (P.value++, P.value >= Pt && (P.value = 0,
|
|
960
|
+
i(h);
|
|
961
|
+
if (P.value++, P.value >= Pt && (P.value = 0, n.value++, n.value >= A.length - 1)) {
|
|
962
962
|
N();
|
|
963
963
|
return;
|
|
964
964
|
}
|
|
@@ -975,7 +975,7 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
975
975
|
pauseAnimation: Y,
|
|
976
976
|
stopAnimation: N,
|
|
977
977
|
resetAll: () => {
|
|
978
|
-
N(),
|
|
978
|
+
N(), n.value = 0, P.value = 0, s.value.forEach((u) => {
|
|
979
979
|
(u.type === "revolute" || u.type === "prismatic") && g(u.name, 0);
|
|
980
980
|
});
|
|
981
981
|
},
|
|
@@ -985,34 +985,34 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
985
985
|
fastBackward: () => {
|
|
986
986
|
k.value > 0.25 && (k.value = Math.max(0.25, k.value / 2));
|
|
987
987
|
}
|
|
988
|
-
}),
|
|
988
|
+
}), ft(
|
|
989
989
|
() => e.model,
|
|
990
990
|
(u) => {
|
|
991
|
-
u ?
|
|
991
|
+
u ? s.value = C(u) : s.value = [];
|
|
992
992
|
},
|
|
993
993
|
{ immediate: !0 }
|
|
994
994
|
);
|
|
995
995
|
const l = () => {
|
|
996
|
-
!e.model || c.value && !_.value ||
|
|
996
|
+
!e.model || c.value && !_.value || s.value.forEach((u) => {
|
|
997
997
|
u.urdfJoint && u.urdfJoint.angle !== void 0 && (u.currentValue = u.urdfJoint.angle);
|
|
998
998
|
});
|
|
999
999
|
}, E = () => {
|
|
1000
1000
|
const u = () => {
|
|
1001
|
-
l(),
|
|
1001
|
+
l(), a.value = requestAnimationFrame(u);
|
|
1002
1002
|
};
|
|
1003
1003
|
u();
|
|
1004
1004
|
}, H = () => {
|
|
1005
|
-
|
|
1005
|
+
a.value && (cancelAnimationFrame(a.value), a.value = null);
|
|
1006
1006
|
};
|
|
1007
1007
|
return Nt(() => {
|
|
1008
1008
|
E();
|
|
1009
1009
|
}), $t(() => {
|
|
1010
1010
|
H(), N();
|
|
1011
|
-
}), (u, f) => (
|
|
1012
|
-
|
|
1013
|
-
(
|
|
1014
|
-
var v, I,
|
|
1015
|
-
return
|
|
1011
|
+
}), (u, f) => (Z(), B("div", Ye, [
|
|
1012
|
+
s.value.length > 0 ? (Z(), B("div", Ve, [
|
|
1013
|
+
(Z(!0), B(Xt, null, Jt(s.value, (h) => {
|
|
1014
|
+
var v, I, q, G;
|
|
1015
|
+
return Z(), B("div", {
|
|
1016
1016
|
key: h.name,
|
|
1017
1017
|
class: "joint-item"
|
|
1018
1018
|
}, [
|
|
@@ -1023,15 +1023,15 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1023
1023
|
]),
|
|
1024
1024
|
y("span", $e, J(h.type), 1)
|
|
1025
1025
|
]),
|
|
1026
|
-
h.type === "revolute" || h.type === "prismatic" ? (
|
|
1026
|
+
h.type === "revolute" || h.type === "prismatic" ? (Z(), B("div", Xe, [
|
|
1027
1027
|
y("div", Je, [
|
|
1028
1028
|
y("input", {
|
|
1029
1029
|
type: "range",
|
|
1030
|
-
min: ((
|
|
1030
|
+
min: ((q = h.limit) == null ? void 0 : q.lower) ?? (h.type === "revolute" ? -Math.PI : -1),
|
|
1031
1031
|
max: ((G = h.limit) == null ? void 0 : G.upper) ?? (h.type === "revolute" ? Math.PI : 1),
|
|
1032
1032
|
step: 0.01,
|
|
1033
1033
|
value: h.currentValue,
|
|
1034
|
-
onInput: (
|
|
1034
|
+
onInput: (gt) => g(h.name, gt.target.value),
|
|
1035
1035
|
class: "joint-slider",
|
|
1036
1036
|
disabled: c.value && !_.value
|
|
1037
1037
|
}, null, 40, Ge)
|
|
@@ -1040,15 +1040,15 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1040
1040
|
y("span", qe, J(h.currentValue.toFixed(3)), 1),
|
|
1041
1041
|
y("span", Qe, J(h.type === "revolute" ? "rad" : "m"), 1)
|
|
1042
1042
|
])
|
|
1043
|
-
])) :
|
|
1043
|
+
])) : it("", !0)
|
|
1044
1044
|
]);
|
|
1045
1045
|
}), 128))
|
|
1046
|
-
])) : (
|
|
1046
|
+
])) : (Z(), B("div", ti, f[0] || (f[0] = [
|
|
1047
1047
|
y("p", null, "未检测到可控制的关节", -1)
|
|
1048
1048
|
])))
|
|
1049
1049
|
]));
|
|
1050
1050
|
}
|
|
1051
|
-
},
|
|
1051
|
+
}, si = /* @__PURE__ */ ot(ii, [["__scopeId", "data-v-603b87bc"]]), oi = ["xlink:href"], ai = /* @__PURE__ */ Gt({
|
|
1052
1052
|
__name: "svgIcon",
|
|
1053
1053
|
props: {
|
|
1054
1054
|
backgroundColor: { default: "#f0f0f0" },
|
|
@@ -1063,7 +1063,7 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1063
1063
|
() => ({
|
|
1064
1064
|
backgroundColor: t.backgroundColor
|
|
1065
1065
|
})
|
|
1066
|
-
),
|
|
1066
|
+
), s = st(() => `#${t.prefix}-${t.name}`), a = st(() => {
|
|
1067
1067
|
const { size: c } = t;
|
|
1068
1068
|
let _ = `${c}`;
|
|
1069
1069
|
return _ = `${_.replace("px", "")}px`, {
|
|
@@ -1071,41 +1071,42 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1071
1071
|
height: _
|
|
1072
1072
|
};
|
|
1073
1073
|
});
|
|
1074
|
-
return (c, _) => (
|
|
1074
|
+
return (c, _) => (Z(), B("div", {
|
|
1075
1075
|
class: St(["container", { active: c.active }]),
|
|
1076
1076
|
style: Ct(e.value)
|
|
1077
1077
|
}, [
|
|
1078
|
-
(
|
|
1078
|
+
(Z(), B("svg", {
|
|
1079
1079
|
class: St(["svg-icon", [c.$attrs.class, c.spin && "svg-icon-spin"]]),
|
|
1080
|
-
style: Ct(
|
|
1080
|
+
style: Ct(a.value),
|
|
1081
1081
|
"aria-hidden": "true"
|
|
1082
1082
|
}, [
|
|
1083
|
-
y("use", { "xlink:href":
|
|
1083
|
+
y("use", { "xlink:href": s.value }, null, 8, oi)
|
|
1084
1084
|
], 6))
|
|
1085
1085
|
], 6));
|
|
1086
1086
|
}
|
|
1087
|
-
}), z = /* @__PURE__ */
|
|
1087
|
+
}), z = /* @__PURE__ */ ot(ai, [["__scopeId", "data-v-3150a90b"]]), ni = { class: "obj-viewer-container" }, li = { class: "buttonGroup-top" }, ri = { class: "buttonGroup-topLeft" }, hi = { class: "buttonGroup-left" }, ci = { class: "buttonGroup-right" }, ui = { class: "buttonGroup-bottom" }, di = { class: "left-panel" }, pi = { class: "panel-header" }, mi = {
|
|
1088
1088
|
key: 1,
|
|
1089
1089
|
class: "clipping-content"
|
|
1090
|
-
},
|
|
1090
|
+
}, fi = { class: "radio-group" }, _i = { class: "radio-label" }, gi = { class: "radio-label" }, yi = { class: "radio-label" }, vi = { class: "radio-label" }, bi = { class: "right-panel" }, wi = { class: "panel-header" }, Pi = {
|
|
1091
1091
|
key: 0,
|
|
1092
1092
|
class: "loading-overlay"
|
|
1093
|
-
},
|
|
1093
|
+
}, Mi = {
|
|
1094
1094
|
__name: "threeModel",
|
|
1095
1095
|
props: {
|
|
1096
1096
|
animationData: {
|
|
1097
|
-
type:
|
|
1098
|
-
default:
|
|
1097
|
+
type: Object,
|
|
1098
|
+
default: () => {
|
|
1099
|
+
}
|
|
1099
1100
|
}
|
|
1100
1101
|
},
|
|
1101
1102
|
emits: ["getAnimationData"],
|
|
1102
1103
|
setup(o, { expose: t, emit: e }) {
|
|
1103
|
-
const
|
|
1104
|
+
const s = e, a = o;
|
|
1104
1105
|
let c = null, _ = !1;
|
|
1105
|
-
const
|
|
1106
|
+
const n = x(null), P = x(!1), M = x("");
|
|
1106
1107
|
x(!1);
|
|
1107
1108
|
const k = x(!1), U = x(!1), A = x(""), r = x(!1), C = x(""), g = x(), {
|
|
1108
|
-
currentModels:
|
|
1109
|
+
currentModels: i,
|
|
1109
1110
|
initialCameraPosition: p,
|
|
1110
1111
|
initialTargetPosition: b,
|
|
1111
1112
|
initThreeJS: R,
|
|
@@ -1114,24 +1115,24 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1114
1115
|
getThreeJSObjects: L,
|
|
1115
1116
|
clearAllModels: V,
|
|
1116
1117
|
cleanup: m
|
|
1117
|
-
} = Ae(
|
|
1118
|
+
} = Ae(n), { isAnimating: l, toggleAnimation: E, stopAnimation: H } = ze(L, i), { isClipping: u, activeClippingAxis: f, toggleClipping: h, updateClippingPlanes: v } = Re(
|
|
1118
1119
|
L,
|
|
1119
|
-
|
|
1120
|
-
), { addModelsFromUrls: I, loadModelByDefaultPath:
|
|
1120
|
+
i
|
|
1121
|
+
), { addModelsFromUrls: I, loadModelByDefaultPath: q, urdfModel: G } = fe(
|
|
1121
1122
|
L,
|
|
1122
|
-
|
|
1123
|
+
i,
|
|
1123
1124
|
P,
|
|
1124
1125
|
M,
|
|
1125
1126
|
V
|
|
1126
|
-
),
|
|
1127
|
-
if (k.value ||
|
|
1127
|
+
), gt = () => {
|
|
1128
|
+
if (k.value || i.value.length === 0) return;
|
|
1128
1129
|
k.value = !0, l.value && H();
|
|
1129
1130
|
const { camera: O, controls: d } = L();
|
|
1130
1131
|
if (!O || !d) return;
|
|
1131
1132
|
d.enabled = !0;
|
|
1132
|
-
const X = (
|
|
1133
|
-
const
|
|
1134
|
-
O.position.lerpVectors(nt, p.value, Tt), d.target.lerpVectors(
|
|
1133
|
+
const X = (Q) => Q < 0.5 ? 4 * Q * Q * Q : 1 - Math.pow(-2 * Q + 2, 3) / 2, nt = O.position.clone(), lt = d.target.clone(), rt = 1500, ht = Date.now(), S = () => {
|
|
1134
|
+
const Q = Date.now() - ht, xt = Math.min(Q / rt, 1), Tt = X(xt);
|
|
1135
|
+
O.position.lerpVectors(nt, p.value, Tt), d.target.lerpVectors(lt, b.value, Tt), xt < 1 ? requestAnimationFrame(S) : k.value = !1;
|
|
1135
1136
|
};
|
|
1136
1137
|
S();
|
|
1137
1138
|
}, Ht = async () => _ ? Promise.resolve() : new Promise((O) => {
|
|
@@ -1147,12 +1148,12 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1147
1148
|
} catch (X) {
|
|
1148
1149
|
throw console.error("加载模型失败:", X), X;
|
|
1149
1150
|
}
|
|
1150
|
-
}, Zt = async (O) => Et(O, I), Kt = async (O) => Et(O,
|
|
1151
|
+
}, Zt = async (O) => Et(O, I), Kt = async (O) => Et(O, q), at = (O) => {
|
|
1151
1152
|
U.value = !0, A.value = O, O === "剖面视图" && !u.value && h();
|
|
1152
1153
|
}, Dt = (O) => {
|
|
1153
1154
|
r.value = !0, C.value = O;
|
|
1154
1155
|
}, Bt = () => {
|
|
1155
|
-
|
|
1156
|
+
s("getAnimationData"), kt(() => {
|
|
1156
1157
|
var O;
|
|
1157
1158
|
(O = g.value) == null || O.startAnimation();
|
|
1158
1159
|
});
|
|
@@ -1164,21 +1165,21 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1164
1165
|
} catch (O) {
|
|
1165
1166
|
console.error("Three.js初始化失败:", O);
|
|
1166
1167
|
}
|
|
1167
|
-
}),
|
|
1168
|
+
}), Wt(() => {
|
|
1168
1169
|
_ = !1, A.value = "", C.value = "", window.removeEventListener("resize", Y), l.value && H(), m();
|
|
1169
1170
|
}), t({
|
|
1170
1171
|
addModelsFromUrls: Zt,
|
|
1171
1172
|
loadModelByDefaultPath: Kt
|
|
1172
1173
|
}), (O, d) => {
|
|
1173
|
-
var nt,
|
|
1174
|
+
var nt, lt, rt, ht;
|
|
1174
1175
|
const X = Ft("el-scrollbar");
|
|
1175
|
-
return
|
|
1176
|
+
return Z(), B("div", ni, [
|
|
1176
1177
|
y("div", {
|
|
1177
1178
|
ref_key: "threejsContainer",
|
|
1178
|
-
ref:
|
|
1179
|
+
ref: n,
|
|
1179
1180
|
class: "threejs-container"
|
|
1180
1181
|
}, null, 512),
|
|
1181
|
-
y("div",
|
|
1182
|
+
y("div", li, [
|
|
1182
1183
|
D(z, {
|
|
1183
1184
|
name: "guanjianjiexi",
|
|
1184
1185
|
size: "34"
|
|
@@ -1200,11 +1201,11 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1200
1201
|
size: "34"
|
|
1201
1202
|
})
|
|
1202
1203
|
]),
|
|
1203
|
-
y("div",
|
|
1204
|
+
y("div", ri, [
|
|
1204
1205
|
D(z, {
|
|
1205
1206
|
name: "viewReset",
|
|
1206
1207
|
size: "24",
|
|
1207
|
-
onClick:
|
|
1208
|
+
onClick: gt,
|
|
1208
1209
|
title: "重置"
|
|
1209
1210
|
}),
|
|
1210
1211
|
D(z, {
|
|
@@ -1224,33 +1225,33 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1224
1225
|
title: F(l) ? "停止动画" : "动画视图"
|
|
1225
1226
|
}, null, 8, ["onClick", "title"])
|
|
1226
1227
|
]),
|
|
1227
|
-
y("div",
|
|
1228
|
+
y("div", hi, [
|
|
1228
1229
|
D(z, {
|
|
1229
1230
|
name: "jiegoushu",
|
|
1230
1231
|
size: "24",
|
|
1231
|
-
onClick: d[0] || (d[0] = (S) =>
|
|
1232
|
+
onClick: d[0] || (d[0] = (S) => at("场景树")),
|
|
1232
1233
|
active: U.value && A.value === "场景树",
|
|
1233
1234
|
title: "场景树"
|
|
1234
1235
|
}, null, 8, ["active"]),
|
|
1235
1236
|
D(z, {
|
|
1236
1237
|
name: "clipping",
|
|
1237
1238
|
size: "24",
|
|
1238
|
-
onClick: d[1] || (d[1] = (S) =>
|
|
1239
|
+
onClick: d[1] || (d[1] = (S) => at("剖面视图")),
|
|
1239
1240
|
active: U.value && A.value === "剖面视图",
|
|
1240
1241
|
title: "剖面视图"
|
|
1241
1242
|
}, null, 8, ["active"]),
|
|
1242
1243
|
D(z, {
|
|
1243
1244
|
name: "donghuafangzhen",
|
|
1244
1245
|
size: "24",
|
|
1245
|
-
onClick: d[2] || (d[2] = (S) =>
|
|
1246
|
+
onClick: d[2] || (d[2] = (S) => at("场景树3"))
|
|
1246
1247
|
}),
|
|
1247
1248
|
D(z, {
|
|
1248
1249
|
name: "donghuafangzhen",
|
|
1249
1250
|
size: "24",
|
|
1250
|
-
onClick: d[3] || (d[3] = (S) =>
|
|
1251
|
+
onClick: d[3] || (d[3] = (S) => at("场景4"))
|
|
1251
1252
|
})
|
|
1252
1253
|
]),
|
|
1253
|
-
y("div",
|
|
1254
|
+
y("div", ci, [
|
|
1254
1255
|
D(z, {
|
|
1255
1256
|
name: "donghuafangzhen",
|
|
1256
1257
|
size: "24"
|
|
@@ -1282,7 +1283,7 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1282
1283
|
size: "24"
|
|
1283
1284
|
})
|
|
1284
1285
|
]),
|
|
1285
|
-
y("div",
|
|
1286
|
+
y("div", ui, [
|
|
1286
1287
|
D(z, {
|
|
1287
1288
|
name: "kuaitui",
|
|
1288
1289
|
size: "24",
|
|
@@ -1302,25 +1303,25 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1302
1303
|
size: "24",
|
|
1303
1304
|
backgroundColor: "#ffffff",
|
|
1304
1305
|
title: "快进",
|
|
1305
|
-
onClick: (
|
|
1306
|
+
onClick: (lt = g.value) == null ? void 0 : lt.fastForward
|
|
1306
1307
|
}, null, 8, ["onClick"]),
|
|
1307
1308
|
D(z, {
|
|
1308
1309
|
name: "zanting",
|
|
1309
1310
|
size: "24",
|
|
1310
1311
|
backgroundColor: "#ffffff",
|
|
1311
1312
|
title: "暂停",
|
|
1312
|
-
onClick: (
|
|
1313
|
+
onClick: (rt = g.value) == null ? void 0 : rt.pauseAnimation
|
|
1313
1314
|
}, null, 8, ["onClick"]),
|
|
1314
1315
|
D(z, {
|
|
1315
1316
|
name: "zhongzhi",
|
|
1316
1317
|
size: "24",
|
|
1317
1318
|
backgroundColor: "#ffffff",
|
|
1318
1319
|
title: "停止",
|
|
1319
|
-
onClick: (
|
|
1320
|
+
onClick: (ht = g.value) == null ? void 0 : ht.resetAll
|
|
1320
1321
|
}, null, 8, ["onClick"])
|
|
1321
1322
|
]),
|
|
1322
|
-
|
|
1323
|
-
y("div",
|
|
1323
|
+
tt(y("div", di, [
|
|
1324
|
+
y("div", pi, [
|
|
1324
1325
|
y("span", null, J(A.value), 1),
|
|
1325
1326
|
y("span", {
|
|
1326
1327
|
class: "close",
|
|
@@ -1329,70 +1330,70 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1329
1330
|
]),
|
|
1330
1331
|
D(X, { "max-height": "650px" }, {
|
|
1331
1332
|
default: At(() => [
|
|
1332
|
-
A.value === "场景树" ? (
|
|
1333
|
+
A.value === "场景树" ? (Z(), zt(Ue, {
|
|
1333
1334
|
key: 0,
|
|
1334
1335
|
model: F(G)
|
|
1335
|
-
}, null, 8, ["model"])) :
|
|
1336
|
-
A.value === "剖面视图" ? (
|
|
1337
|
-
y("div",
|
|
1338
|
-
y("label",
|
|
1339
|
-
|
|
1336
|
+
}, null, 8, ["model"])) : it("", !0),
|
|
1337
|
+
A.value === "剖面视图" ? (Z(), B("div", mi, [
|
|
1338
|
+
y("div", fi, [
|
|
1339
|
+
y("label", _i, [
|
|
1340
|
+
tt(y("input", {
|
|
1340
1341
|
type: "radio",
|
|
1341
1342
|
name: "clipping-axis",
|
|
1342
1343
|
value: "none",
|
|
1343
|
-
"onUpdate:modelValue": d[7] || (d[7] = (S) =>
|
|
1344
|
+
"onUpdate:modelValue": d[7] || (d[7] = (S) => ct(f) ? f.value = S : null),
|
|
1344
1345
|
onChange: d[8] || (d[8] = (...S) => F(v) && F(v)(...S))
|
|
1345
1346
|
}, null, 544), [
|
|
1346
|
-
[
|
|
1347
|
+
[ut, F(f)]
|
|
1347
1348
|
]),
|
|
1348
1349
|
d[16] || (d[16] = y("span", { class: "radio-text" }, "无切割", -1))
|
|
1349
1350
|
]),
|
|
1350
|
-
y("label",
|
|
1351
|
-
|
|
1351
|
+
y("label", gi, [
|
|
1352
|
+
tt(y("input", {
|
|
1352
1353
|
type: "radio",
|
|
1353
1354
|
name: "clipping-axis",
|
|
1354
1355
|
value: "x",
|
|
1355
|
-
"onUpdate:modelValue": d[9] || (d[9] = (S) =>
|
|
1356
|
+
"onUpdate:modelValue": d[9] || (d[9] = (S) => ct(f) ? f.value = S : null),
|
|
1356
1357
|
onChange: d[10] || (d[10] = (...S) => F(v) && F(v)(...S))
|
|
1357
1358
|
}, null, 544), [
|
|
1358
|
-
[
|
|
1359
|
+
[ut, F(f)]
|
|
1359
1360
|
]),
|
|
1360
1361
|
d[17] || (d[17] = y("span", { class: "radio-text" }, "X轴切割", -1))
|
|
1361
1362
|
]),
|
|
1362
|
-
y("label",
|
|
1363
|
-
|
|
1363
|
+
y("label", yi, [
|
|
1364
|
+
tt(y("input", {
|
|
1364
1365
|
type: "radio",
|
|
1365
1366
|
name: "clipping-axis",
|
|
1366
1367
|
value: "y",
|
|
1367
|
-
"onUpdate:modelValue": d[11] || (d[11] = (S) =>
|
|
1368
|
+
"onUpdate:modelValue": d[11] || (d[11] = (S) => ct(f) ? f.value = S : null),
|
|
1368
1369
|
onChange: d[12] || (d[12] = (...S) => F(v) && F(v)(...S))
|
|
1369
1370
|
}, null, 544), [
|
|
1370
|
-
[
|
|
1371
|
+
[ut, F(f)]
|
|
1371
1372
|
]),
|
|
1372
1373
|
d[18] || (d[18] = y("span", { class: "radio-text" }, "Y轴切割", -1))
|
|
1373
1374
|
]),
|
|
1374
|
-
y("label",
|
|
1375
|
-
|
|
1375
|
+
y("label", vi, [
|
|
1376
|
+
tt(y("input", {
|
|
1376
1377
|
type: "radio",
|
|
1377
1378
|
name: "clipping-axis",
|
|
1378
1379
|
value: "z",
|
|
1379
|
-
"onUpdate:modelValue": d[13] || (d[13] = (S) =>
|
|
1380
|
+
"onUpdate:modelValue": d[13] || (d[13] = (S) => ct(f) ? f.value = S : null),
|
|
1380
1381
|
onChange: d[14] || (d[14] = (...S) => F(v) && F(v)(...S))
|
|
1381
1382
|
}, null, 544), [
|
|
1382
|
-
[
|
|
1383
|
+
[ut, F(f)]
|
|
1383
1384
|
]),
|
|
1384
1385
|
d[19] || (d[19] = y("span", { class: "radio-text" }, "Z轴切割", -1))
|
|
1385
1386
|
])
|
|
1386
1387
|
])
|
|
1387
|
-
])) :
|
|
1388
|
+
])) : it("", !0)
|
|
1388
1389
|
]),
|
|
1389
1390
|
_: 1
|
|
1390
1391
|
})
|
|
1391
1392
|
], 512), [
|
|
1392
|
-
[
|
|
1393
|
+
[yt, U.value]
|
|
1393
1394
|
]),
|
|
1394
|
-
|
|
1395
|
-
y("div",
|
|
1395
|
+
tt(y("div", bi, [
|
|
1396
|
+
y("div", wi, [
|
|
1396
1397
|
y("span", null, J(C.value), 1),
|
|
1397
1398
|
y("span", {
|
|
1398
1399
|
class: "close",
|
|
@@ -1401,35 +1402,34 @@ const Oe = { class: "panel-content" }, Le = /* @__PURE__ */ It({
|
|
|
1401
1402
|
]),
|
|
1402
1403
|
D(X, { "max-height": "650px" }, {
|
|
1403
1404
|
default: At(() => [
|
|
1404
|
-
|
|
1405
|
+
tt(D(si, {
|
|
1405
1406
|
ref_key: "jointRef",
|
|
1406
1407
|
ref: g,
|
|
1407
1408
|
model: F(G),
|
|
1408
1409
|
scene: F(c),
|
|
1409
|
-
animationData:
|
|
1410
|
+
animationData: a == null ? void 0 : a.animationData
|
|
1410
1411
|
}, null, 8, ["model", "scene", "animationData"]), [
|
|
1411
|
-
[
|
|
1412
|
+
[yt, C.value === "关节控制"]
|
|
1412
1413
|
]),
|
|
1413
|
-
|
|
1414
|
-
|
|
1414
|
+
C.value === "动画仿真" ? (Z(), zt(je, {
|
|
1415
|
+
key: 0,
|
|
1416
|
+
animationData: a == null ? void 0 : a.animationData,
|
|
1415
1417
|
urdf: F(G)
|
|
1416
|
-
}, null, 8, ["animationData", "urdf"]),
|
|
1417
|
-
[ut, C.value === "动画仿真"]
|
|
1418
|
-
])
|
|
1418
|
+
}, null, 8, ["animationData", "urdf"])) : it("", !0)
|
|
1419
1419
|
]),
|
|
1420
1420
|
_: 1
|
|
1421
1421
|
})
|
|
1422
1422
|
], 512), [
|
|
1423
|
-
[
|
|
1423
|
+
[yt, r.value]
|
|
1424
1424
|
]),
|
|
1425
|
-
P.value ? (
|
|
1425
|
+
P.value ? (Z(), B("div", Pi, [
|
|
1426
1426
|
d[20] || (d[20] = y("div", { class: "loading-spinner" }, null, -1)),
|
|
1427
1427
|
y("p", null, J(M.value), 1)
|
|
1428
|
-
])) :
|
|
1428
|
+
])) : it("", !0)
|
|
1429
1429
|
]);
|
|
1430
1430
|
};
|
|
1431
1431
|
}
|
|
1432
|
-
},
|
|
1432
|
+
}, Si = /* @__PURE__ */ ot(Mi, [["__scopeId", "data-v-e36a07b8"]]);
|
|
1433
1433
|
export {
|
|
1434
|
-
|
|
1434
|
+
Si as default
|
|
1435
1435
|
};
|