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.
@@ -1,8 +1,8 @@
1
- import { ref as E, watch as Ee, createElementBlock as J, openBlock as X, createBlock as He, computed as pe, resolveComponent as Xe, createVNode as k, onMounted as $e, onUnmounted as et, Fragment as tt, renderList as st, createElementVNode as P, createCommentVNode as Pe, toDisplayString as ne, defineComponent as it, normalizeStyle as Ie, normalizeClass as Fe, nextTick as Ne, onBeforeUnmount as ot, withDirectives as le, unref as Z, withCtx as Ue, isRef as ge, vModelRadio as ye, vShow as ve } from "vue";
2
- import { E as at, V as g, M as re, T as ue, Q as Ye, F as Ve, G as ie, R as nt, P as Me, H as Ge, J as De, K as lt, L as rt, N as ct, W as ht, O as ut, U as pt, X as dt, Y as mt, Z as ft, _ as xe, $ as _t, a0 as Le, a1 as gt, a2 as ke, a3 as yt, a4 as Be, a5 as Je, a6 as We, a7 as Ae, D as vt, a8 as fe, a9 as bt, aa as wt, ab as Pt } from "./index-Y9kXXuBJ.js";
3
- import { _ as _e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
- import { c as qe } from "./menu-BxkEScwt.js";
5
- const Ze = { type: "change" }, Oe = { type: "start" }, Qe = { type: "end" }, be = new nt(), Ke = new Me(), Mt = Math.cos(70 * Ge.DEG2RAD), Y = new g(), G = 2 * Math.PI, A = {
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
- }, Re = 1e-6;
15
- class xt extends at {
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 g(), this.cursor = new g(), this.minDistance = 0, this.maxDistance = 1 / 0, this.minZoom = 0, this.maxZoom = 1 / 0, this.minTargetRadius = 0, this.maxTargetRadius = 1 / 0, this.minPolarAngle = 0, this.maxPolarAngle = Math.PI, this.minAzimuthAngle = -1 / 0, this.maxAzimuthAngle = 1 / 0, this.enableDamping = !1, this.dampingFactor = 0.05, this.enableZoom = !0, this.zoomSpeed = 1, this.enableRotate = !0, this.rotateSpeed = 1, this.keyRotateSpeed = 1, this.enablePan = !0, this.panSpeed = 1, this.screenSpacePanning = !0, this.keyPanSpeed = 7, this.zoomToCursor = !1, this.autoRotate = !1, this.autoRotateSpeed = 2, this.keys = { LEFT: "ArrowLeft", UP: "ArrowUp", RIGHT: "ArrowRight", BOTTOM: "ArrowDown" }, this.mouseButtons = { LEFT: re.ROTATE, MIDDLE: re.DOLLY, RIGHT: re.PAN }, this.touches = { ONE: ue.ROTATE, TWO: ue.DOLLY_PAN }, this.target0 = this.target.clone(), this.position0 = this.object.position.clone(), this.zoom0 = this.object.zoom, this._domElementKeyEvents = null, this._lastPosition = new g(), this._lastQuaternion = new Ye(), this._lastTargetPosition = new g(), this._quat = new Ye().setFromUnitVectors(e.up, new g(0, 1, 0)), this._quatInverse = this._quat.clone().invert(), this._spherical = new Ve(), this._sphericalDelta = new Ve(), this._scale = 1, this._panOffset = new g(), this._rotateStart = new ie(), this._rotateEnd = new ie(), this._rotateDelta = new ie(), this._panStart = new ie(), this._panEnd = new ie(), this._panDelta = new ie(), this._dollyStart = new ie(), this._dollyEnd = new ie(), this._dollyDelta = new ie(), this._dollyDirection = new g(), this._mouse = new ie(), this._performCursorZoom = !1, this._pointers = [], this._pointerPositions = {}, this._controlActive = !1, this._onPointerMove = Dt.bind(this), this._onPointerDown = Et.bind(this), this._onPointerUp = Tt.bind(this), this._onContextMenu = Lt.bind(this), this._onMouseWheel = kt.bind(this), this._onKeyDown = At.bind(this), this._onTouchStart = Rt.bind(this), this._onTouchMove = zt.bind(this), this._onMouseDown = Ct.bind(this), this._onMouseMove = St.bind(this), this._interceptControlDown = Ot.bind(this), this._interceptControlUp = jt.bind(this), this.domElement !== null && this.connect(this.domElement), this.update();
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(Ze), this.update(), this.state = A.NONE;
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
- Y.copy(t).sub(this.target), Y.applyQuaternion(this._quat), this._spherical.setFromVector3(Y), this.autoRotate && this.state === A.NONE && this._rotateLeft(this._getAutoRotationAngle(e)), this.enableDamping ? (this._spherical.theta += this._sphericalDelta.theta * this.dampingFactor, this._spherical.phi += this._sphericalDelta.phi * this.dampingFactor) : (this._spherical.theta += this._sphericalDelta.theta, this._spherical.phi += this._sphericalDelta.phi);
89
- let i = this.minAzimuthAngle, n = this.maxAzimuthAngle;
90
- isFinite(i) && isFinite(n) && (i < -Math.PI ? i += G : i > Math.PI && (i -= G), n < -Math.PI ? n += G : n > Math.PI && (n -= G), i <= n ? this._spherical.theta = Math.max(i, Math.min(n, this._spherical.theta)) : this._spherical.theta = this._spherical.theta > (i + n) / 2 ? Math.max(i, this._spherical.theta) : Math.min(n, this._spherical.theta)), this._spherical.phi = Math.max(this.minPolarAngle, Math.min(this.maxPolarAngle, this._spherical.phi)), this._spherical.makeSafe(), this.enableDamping === !0 ? this.target.addScaledVector(this._panOffset, this.dampingFactor) : this.target.add(this._panOffset), this.target.sub(this.cursor), this.target.clampLength(this.minTargetRadius, this.maxTargetRadius), this.target.add(this.cursor);
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 (Y.setFromSpherical(this._spherical), Y.applyQuaternion(this._quatInverse), t.copy(this.target).add(Y), this.object.lookAt(this.target), this.enableDamping === !0 ? (this._sphericalDelta.theta *= 1 - this.dampingFactor, this._sphericalDelta.phi *= 1 - this.dampingFactor, this._panOffset.multiplyScalar(1 - this.dampingFactor)) : (this._sphericalDelta.set(0, 0, 0), this._panOffset.set(0, 0, 0)), this.zoomToCursor && this._performCursorZoom) {
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 l = Y.length();
102
- v = this._clampDistance(l * this._scale);
103
- const D = l - v;
104
- this.object.position.addScaledVector(this._dollyDirection, D), this.object.updateMatrixWorld(), p = !!D;
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 l = new g(this._mouse.x, this._mouse.y, 0);
107
- l.unproject(this.object);
108
- const D = this.object.zoom;
109
- this.object.zoom = Math.max(this.minZoom, Math.min(this.maxZoom, this.object.zoom / this._scale)), this.object.updateProjectionMatrix(), p = D !== this.object.zoom;
110
- const x = new g(this._mouse.x, this._mouse.y, 0);
111
- x.unproject(this.object), this.object.position.sub(x).add(l), this.object.updateMatrixWorld(), v = Y.length();
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) : (be.origin.copy(this.object.position), be.direction.set(0, 0, -1).transformDirection(this.object.matrix), Math.abs(this.object.up.dot(be.direction)) < Mt ? this.object.lookAt(this.target) : (Ke.setFromNormalAndCoplanarPoint(this.object.up, this.target), be.intersectPlane(Ke, this.target))));
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) > Re || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Re || this._lastTargetPosition.distanceToSquared(this.target) > Re ? (this.dispatchEvent(Ze), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
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
- Y.setFromMatrixColumn(t, 0), Y.multiplyScalar(-e), this._panOffset.add(Y);
135
+ V.setFromMatrixColumn(t, 0), V.multiplyScalar(-e), this._panOffset.add(V);
136
136
  }
137
137
  _panUp(e, t) {
138
- this.screenSpacePanning === !0 ? Y.setFromMatrixColumn(t, 1) : (Y.setFromMatrixColumn(t, 0), Y.crossVectors(this.object.up, Y)), Y.multiplyScalar(e), this._panOffset.add(Y);
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 n = this.object.position;
145
- Y.copy(n).sub(this.target);
146
- let p = Y.length();
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(), n = e - i.left, p = t - i.top, v = i.width, l = i.height;
161
- this._mouse.x = n / v * 2 - 1, this._mouse.y = -(p / l) * 2 + 1, this._dollyDirection.set(this._mouse.x, this._mouse.y, 1).unproject(this.object).sub(this.object.position).normalize();
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), n = 0.5 * (e.pageY + t.y);
215
- this._rotateStart.set(i, n);
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), n = 0.5 * (e.pageY + t.y);
223
- this._panStart.set(i, n);
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, n = e.pageY - t.y, p = Math.sqrt(i * i + n * n);
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), n = 0.5 * (e.pageX + i.x), p = 0.5 * (e.pageY + i.y);
241
- this._rotateEnd.set(n, p);
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), n = 0.5 * (e.pageY + t.y);
252
- this._panEnd.set(i, n);
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, n = e.pageY - t.y, p = Math.sqrt(i * i + n * n);
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, l = (e.pageY + t.y) * 0.5;
260
- this._updateZoomParameters(v, l);
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 Et(a) {
312
- this.enabled !== !1 && (this._pointers.length === 0 && (this.domElement.setPointerCapture(a.pointerId), this.domElement.addEventListener("pointermove", this._onPointerMove), this.domElement.addEventListener("pointerup", this._onPointerUp)), !this._isTrackingPointer(a) && (this._addPointer(a), a.pointerType === "touch" ? this._onTouchStart(a) : this._onMouseDown(a)));
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 Dt(a) {
315
- this.enabled !== !1 && (a.pointerType === "touch" ? this._onTouchMove(a) : this._onMouseMove(a));
314
+ function Et(o) {
315
+ this.enabled !== !1 && (o.pointerType === "touch" ? this._onTouchMove(o) : this._onMouseMove(o));
316
316
  }
317
- function Tt(a) {
318
- switch (this._removePointer(a), this._pointers.length) {
317
+ function Dt(o) {
318
+ switch (this._removePointer(o), this._pointers.length) {
319
319
  case 0:
320
- this.domElement.releasePointerCapture(a.pointerId), this.domElement.removeEventListener("pointermove", this._onPointerMove), this.domElement.removeEventListener("pointerup", this._onPointerUp), this.dispatchEvent(Qe), this.state = A.NONE;
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 Ct(a) {
328
+ function Tt(o) {
329
329
  let e;
330
- switch (a.button) {
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 re.DOLLY:
344
+ case he.DOLLY:
345
345
  if (this.enableZoom === !1) return;
346
- this._handleMouseDownDolly(a), this.state = A.DOLLY;
346
+ this._handleMouseDownDolly(o), this.state = A.DOLLY;
347
347
  break;
348
- case re.ROTATE:
349
- if (a.ctrlKey || a.metaKey || a.shiftKey) {
348
+ case he.ROTATE:
349
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
350
350
  if (this.enablePan === !1) return;
351
- this._handleMouseDownPan(a), this.state = A.PAN;
351
+ this._handleMouseDownPan(o), this.state = A.PAN;
352
352
  } else {
353
353
  if (this.enableRotate === !1) return;
354
- this._handleMouseDownRotate(a), this.state = A.ROTATE;
354
+ this._handleMouseDownRotate(o), this.state = A.ROTATE;
355
355
  }
356
356
  break;
357
- case re.PAN:
358
- if (a.ctrlKey || a.metaKey || a.shiftKey) {
357
+ case he.PAN:
358
+ if (o.ctrlKey || o.metaKey || o.shiftKey) {
359
359
  if (this.enableRotate === !1) return;
360
- this._handleMouseDownRotate(a), this.state = A.ROTATE;
360
+ this._handleMouseDownRotate(o), this.state = A.ROTATE;
361
361
  } else {
362
362
  if (this.enablePan === !1) return;
363
- this._handleMouseDownPan(a), this.state = A.PAN;
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(Oe);
369
+ this.state !== A.NONE && this.dispatchEvent(Le);
370
370
  }
371
- function St(a) {
371
+ function Ct(o) {
372
372
  switch (this.state) {
373
373
  case A.ROTATE:
374
374
  if (this.enableRotate === !1) return;
375
- this._handleMouseMoveRotate(a);
375
+ this._handleMouseMoveRotate(o);
376
376
  break;
377
377
  case A.DOLLY:
378
378
  if (this.enableZoom === !1) return;
379
- this._handleMouseMoveDolly(a);
379
+ this._handleMouseMoveDolly(o);
380
380
  break;
381
381
  case A.PAN:
382
382
  if (this.enablePan === !1) return;
383
- this._handleMouseMovePan(a);
383
+ this._handleMouseMovePan(o);
384
384
  break;
385
385
  }
386
386
  }
387
- function kt(a) {
388
- this.enabled === !1 || this.enableZoom === !1 || this.state !== A.NONE || (a.preventDefault(), this.dispatchEvent(Oe), this._handleMouseWheel(this._customWheelEvent(a)), this.dispatchEvent(Qe));
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 At(a) {
391
- this.enabled !== !1 && this._handleKeyDown(a);
390
+ function kt(o) {
391
+ this.enabled !== !1 && this._handleKeyDown(o);
392
392
  }
393
- function Rt(a) {
394
- switch (this._trackPointer(a), this._pointers.length) {
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(a), this.state = A.TOUCH_ROTATE;
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(a), this.state = A.TOUCH_PAN;
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(a), this.state = A.TOUCH_DOLLY_PAN;
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(a), this.state = A.TOUCH_DOLLY_ROTATE;
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(Oe);
426
+ this.state !== A.NONE && this.dispatchEvent(Le);
427
427
  }
428
- function zt(a) {
429
- switch (this._trackPointer(a), this.state) {
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(a), this.update();
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(a), this.update();
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(a), this.update();
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(a), this.update();
444
+ this._handleTouchMoveDollyRotate(o), this.update();
445
445
  break;
446
446
  default:
447
447
  this.state = A.NONE;
448
448
  }
449
449
  }
450
- function Lt(a) {
451
- this.enabled !== !1 && a.preventDefault();
450
+ function zt(o) {
451
+ this.enabled !== !1 && o.preventDefault();
452
452
  }
453
- function Ot(a) {
454
- a.key === "Control" && (this._controlActive = !0, this.domElement.getRootNode().addEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
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 jt(a) {
457
- a.key === "Control" && (this._controlActive = !1, this.domElement.getRootNode().removeEventListener("keyup", this._interceptControlUp, { passive: !0, capture: !0 }));
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 It(a) {
460
- let e = null, t = null, i = null, n = null, p = null, v = null, l = null, D = null;
461
- const x = E([]), z = E(new g()), O = E(new g()), I = () => {
462
- if (!a.value) return;
463
- e = new lt(), e.background = new rt(15790320);
464
- const m = a.value;
465
- t = new ct(75, m.clientWidth / m.clientHeight, 0.1, 1e4), t.position.set(8, -8, 6), t.up.set(0, 0, 1), t.lookAt(0, 0, 0), i = new ht({
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 = ut, i.toneMapping = pt, i.toneMappingExposure = 1, i.outputColorSpace = dt, m.appendChild(i.domElement), n = new xt(t, i.domElement), n.enableDamping = !0, n.dampingFactor = 0.05, n.mouseButtons = {
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: re.PAN,
471
- RIGHT: re.ROTATE
472
- }, n.panSpeed = 0.7, p = new mt(t, i, {
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(n), _(), s();
503
- }, h = (m, u) => {
504
- l && (e.remove(l), l.dispose()), D && (e.remove(D), D.geometry.dispose(), D.material.dispose());
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
- l = new ft(m, T, 13421772, 14540253), l.rotateX(Math.PI / 2), l.position.copy(u), e.add(l);
507
- const V = new xe(m, m), R = new _t({
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
- D = new Le(V, R), D.position.copy(u), D.position.z -= 0.01, D.receiveShadow = !0, e.add(D);
513
- }, C = () => {
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 De();
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 te = modelBoundingBoxes.get(W.userData.modelId);
523
- m.union(te.box), u = !0;
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 g()), V = m.getCenter(new g()), R = Math.max(T.x, T.y, T.z), oe = Math.max(R * 8, 50), F = new g(
531
- V.x,
532
- V.y,
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
- h(oe, F);
537
- }, _ = () => {
538
- const m = new gt(4210752, 0.6);
536
+ r(oe, N);
537
+ }, g = () => {
538
+ const m = new _t(4210752, 0.6);
539
539
  e.add(m);
540
- const u = new ke(16777215, 2);
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 ke(16777215, 0.8);
542
+ const T = new Se(16777215, 0.8);
543
543
  T.position.set(-8, -8, 6), e.add(T);
544
- const V = new ke(16777215, 0.6);
545
- V.position.set(0, -15, 2), e.add(V);
546
- const R = new yt(16777215, 4473924, 0.8);
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 Be(16777215, 1, 50);
548
+ const oe = new Ve(16777215, 1, 50);
549
549
  oe.position.set(15, 15, 15), e.add(oe);
550
- const F = new Be(16777215, 0.5, 50);
551
- F.position.set(-15, -15, 15), e.add(F);
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), n && n.update(), i && e && t && i.render(e, t), p && p.render();
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: I,
583
+ initThreeJS: F,
584
584
  handleResize: () => {
585
- if (!a.value || !t || !i || !p) return;
586
- const m = a.value, u = m.clientWidth, T = m.clientHeight;
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 || !n || x.value.length === 0) return;
591
- const u = new De();
590
+ if (!t || !a || x.value.length === 0) return;
591
+ const u = new Ee();
592
592
  let T = !1;
593
- if (x.value.forEach((te) => {
594
- if (te.userData.boundingBox)
595
- u.union(te.userData.boundingBox), T = !0;
596
- else if (te.userData.modelId && m.has(te.userData.modelId)) {
597
- const de = m.get(te.userData.modelId);
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(te), T = !0;
600
+ u.expandByObject(ee), T = !0;
601
601
  }), !T) {
602
602
  console.warn("无法计算包围盒");
603
603
  return;
604
604
  }
605
- const V = u.getSize(new g()), R = u.getCenter(new g()), F = Math.max(V.x, V.y, V.z) * 0.8, W = new g(R.x + F, R.y - F, R.z + F);
606
- t.position.copy(W), t.lookAt(R), n.target.copy(R), n.update(), z.value.copy(W), O.value.copy(R), C();
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: n,
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 !== D && m.push(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 = [], C();
625
+ }), x.value = [], S();
626
626
  },
627
627
  cleanup: () => {
628
- v && cancelAnimationFrame(v), l && l.dispose(), D && (D.geometry.dispose(), D.material.dispose()), i && i.dispose(), n && n.dispose(), p && p.dispose();
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: C
630
+ updateGridForModels: S
631
631
  };
632
632
  }
633
- function Ft(a, e) {
634
- const t = E(!1);
635
- let i = null, n = 12700, p = new g(), v = new g(), l = new g(), D = 0, x = null;
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 g(), w = D * 1.2, j = new g(l.x + w, l.y, l.z), $ = new g(l.x, l.y + w, l.z), N = new g(l.x, l.y - w, l.z);
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 H = s / 0.567 * Math.PI * 2;
640
- d.x = l.x + Math.cos(H) * w, d.z = l.z + Math.sin(H) * w, d.y = l.y;
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 K = (s - 0.567) / 0.157, H = z(K);
643
- d.lerpVectors(j, $, H);
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 K = (s - 0.724) / 0.157, m = z(K) * Math.PI;
646
- d.x = l.x + Math.sin(m) * w, d.y = l.y + Math.cos(m) * w, d.z = l.z;
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 K = (s - 0.881) / 0.119, H = z(K);
649
- d.lerpVectors(N, p, H);
648
+ const H = (s - 0.881) / 0.119, K = z(H);
649
+ d.lerpVectors(Y, p, K);
650
650
  }
651
651
  return d;
652
- }, I = () => {
653
- const { camera: s, controls: d } = a();
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 / n, 1);
656
+ const w = Date.now() - i, j = Math.min(w / a, 1);
657
657
  if (j >= 1) {
658
- C();
658
+ S();
659
659
  return;
660
660
  }
661
661
  const $ = O(j);
662
- s.position.copy($), s.lookAt(l), d.target.copy(l), x = requestAnimationFrame(I);
663
- }, h = () => {
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 } = a();
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 De();
668
+ const w = new Ee();
669
669
  e.value.forEach((u) => {
670
670
  w.expandByObject(u);
671
671
  });
672
- const j = w.getSize(new g());
673
- l = w.getCenter(new g()), D = Math.max(j.x, j.y, j.z) * 1.2;
674
- const $ = new g(l.x + D * 1.2, l.y, l.z);
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 N = s.position.clone(), K = 1e3, H = Date.now(), m = () => {
677
- const u = Date.now() - H, T = Math.min(u / K, 1), V = z(T);
678
- s.position.lerpVectors(N, $, V), s.lookAt(l), d.target.copy(l), T < 1 ? requestAnimationFrame(m) : (t.value = !0, i = null, I());
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
- }, C = () => {
681
+ }, S = () => {
682
682
  t.value = !1, i = null, x && (cancelAnimationFrame(x), x = null);
683
- const { controls: s } = a();
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 } = a();
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, N = Date.now(), K = () => {
695
- const H = Date.now() - N, m = Math.min(H / $, 1), u = z(m);
696
- s.position.lerpVectors(w, p, u), d.target.lerpVectors(j, v, u), m < 1 && requestAnimationFrame(K);
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
- K();
698
+ H();
699
699
  } else
700
- h();
700
+ r();
701
701
  },
702
- startAnimation: h,
703
- stopAnimation: C
702
+ startAnimation: r,
703
+ stopAnimation: S
704
704
  };
705
705
  }
706
- function Nt(a, e) {
707
- const t = E(!1), i = E("none");
708
- let n = [], p = [], v = new De(), l = new g();
709
- const D = () => {
710
- n = [
711
- new Me(new g(1, 0, 0), 0),
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 Me(new g(0, 1, 0), 0),
713
+ new Pe(new y(0, 1, 0), 0),
714
714
  // Y轴平面
715
- new Me(new g(0, 0, 1), 0)
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
- }), l = v.getCenter(new g());
722
- }, z = (_) => {
723
- const s = v.getSize(new g());
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
- _ === "x" ? (d = new xe(s.z * 1.2, s.y * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(0, Math.PI / 2, 0)) : _ === "y" ? (d = new xe(s.x * 1.2, s.z * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(Math.PI / 2, 0, 0)) : _ === "z" && (d = new xe(s.x * 1.2, s.y * 1.2), w = new g(l.x, l.y, l.z), j = new Ae(0, 0, 0));
726
- const $ = new Je({
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: We,
730
+ side: Je,
731
731
  depthWrite: !1
732
- }), N = new Le(d, $);
733
- return N.position.copy(w), N.rotation.copy(j), N;
732
+ }), Y = new ze(d, $);
733
+ return Y.position.copy(w), Y.rotation.copy(j), Y;
734
734
  }, O = () => {
735
- if (I(), h(), i.value === "none")
735
+ if (F(), r(), i.value === "none")
736
736
  return;
737
737
  x();
738
- let _ = null;
739
- if (i.value === "x" ? (n[0].constant = -l.x, _ = n[0]) : i.value === "y" ? (n[1].constant = -l.y, _ = n[1]) : i.value === "z" && (n[2].constant = -l.z, _ = n[2]), _) {
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 } = a();
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
- }, I = () => {
754
- e.value.forEach((_) => {
755
- _.traverse((s) => {
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
- }, h = () => {
762
- const { scene: _ } = a();
763
- _ && p.forEach((s) => {
764
- _.remove(s), s.geometry.dispose(), s.material.dispose();
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 ? (D(), e.value.length > 0 && x()) : (i.value = "none", I(), h());
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: I,
775
- clearClippingMeshes: h
774
+ clearClippingPlanes: F,
775
+ clearClippingMeshes: r
776
776
  };
777
777
  }
778
- const Ut = { class: "panel-content" }, Yt = {
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(a) {
785
- const e = a;
786
- E();
787
- const t = E();
788
- return Ee(
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 n;
792
- let i = ((n = qe(e == null ? void 0 : e.animationData)) == null ? void 0 : n.动画输出Content) ?? [];
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, n) => {
797
- var p, v, l;
798
- return X(), J("div", Ut, [
799
- (X(), He(vt, {
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: (l = t.value) == null ? void 0 : l.id,
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
- }, Vt = /* @__PURE__ */ _e(Yt, [["__scopeId", "data-v-02b89b4b"]]), Bt = { class: "panel-content" }, Zt = "id", Kt = {
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: (a) => ["breadth", "firstLevel"].includes(a)
819
+ validator: (o) => ["breadth", "firstLevel"].includes(o)
820
820
  }
821
821
  },
822
822
  emits: ["nodeClick"],
823
- setup(a, { emit: e }) {
824
- const t = a, i = e, n = E([]), p = {
823
+ setup(o, { emit: e }) {
824
+ const t = o, i = e, a = D([]), p = {
825
825
  children: "children",
826
826
  label: "label"
827
- }, v = (h) => {
828
- i("nodeClick", h);
829
- }, l = (h, C = 0) => {
830
- const _ = [];
831
- return Array.isArray(h) && (h == null ? void 0 : h.length) > 0 && h.forEach((s) => {
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: C + 1,
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: l(s == null ? void 0 : s.children, C + 1),
842
+ children: n(s == null ? void 0 : s.children, S + 1),
843
843
  path: s == null ? void 0 : s.name
844
844
  };
845
- _.push(d);
845
+ g.push(d);
846
846
  }
847
- }), _;
848
- }, D = (h) => h ? [{
849
- name: h == null ? void 0 : h.name,
850
- label: h == null ? void 0 : h.name,
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: h == null ? void 0 : h.type,
855
- id: h == null ? void 0 : h.id,
856
- limit: (h == null ? void 0 : h.limit) ?? "",
857
- children: l(h == null ? void 0 : h.children, 1),
858
- path: h == null ? void 0 : h.name
859
- }] : [], x = (h, C) => {
860
- const _ = [], s = [...h];
861
- for (; s.length > 0 && _.length < C; ) {
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 && (_.push(d.id), s.push(...d.children));
863
+ d.children && d.children.length > 0 && (g.push(d.id), s.push(...d.children));
864
864
  }
865
- return _;
866
- }, z = (h, C) => {
867
- const _ = [];
868
- return h.forEach((s) => {
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
- _.push(s.id);
871
- const d = s.children.filter((w) => w.children && w.children.length > 0).slice(0, C).map((w) => w.id);
872
- _.push(...d);
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
- }), _.slice(0, C + 1);
875
- }, O = pe(() => !n.value || n.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? z(n.value, t.maxExpandCount) : x(n.value, t.maxExpandCount)), I = pe(() => t != null && t.model ? D(t.model) : []);
876
- return Ee(
877
- I,
878
- (h) => {
879
- n.value = JSON.parse(JSON.stringify(h));
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
- ), (h, C) => {
883
- const _ = Xe("el-tree");
884
- return X(), J("div", Bt, [
885
- k(_, {
886
- data: n.value,
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": Zt,
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__ */ _e(Kt, [["__scopeId", "data-v-fde9ea18"]]), Xt = {
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
- }, we = 1e-3, ns = 1e3, ze = 60, ls = {
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(a, { expose: e }) {
912
- const t = a;
913
- E(!0);
914
- const i = E([]), n = E(null), p = E(null), v = E(12.5), l = E(), D = E(1302), x = E(!1), z = E(!1), O = E(0), I = E(0), h = E(null), C = Ge.degToRad, _ = E(1), s = () => ns / ze / _.value;
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
- Ee(
916
+ xe(
917
917
  () => t.animationData,
918
- (r) => {
919
- var c;
920
- console.log(111, r), D.value = r.extra.管长, v.value = r.extra.外径 / 2;
921
- let b = ((c = qe(r)) == null ? void 0 : c.动画输出) ?? [];
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 = (r, b = !1) => r === "revolute" ? b ? Math.PI : -Math.PI : r === "prismatic" ? b ? 1 : -1 : 0, j = () => {
927
- if (!n.value)
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 r = null;
930
- return n.value.traverse((b) => {
931
- b.name === "Pipe_Link" && !r && b.traverse((c) => {
932
- c instanceof Le && !r && (r = c);
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
- }), r ? (l.value = r, r.material = new Je({
934
+ }), l ? (n.value = l, l.material = new Ge({
935
935
  color: 11184810,
936
936
  shininess: 80,
937
- side: We
937
+ side: Je
938
938
  }), !0) : (ElMessage.error("Pipe_Link 内未找到 Mesh"), !1);
939
- }, $ = (r) => {
940
- if (!r || !r.joints)
939
+ }, $ = (l) => {
940
+ if (!l || !l.joints)
941
941
  return console.warn("URDF模型没有关节信息"), [];
942
942
  let b = null;
943
- if (r.traverse((M) => {
943
+ if (l.traverse((M) => {
944
944
  M.name === "Pipe_Link" && !b && (b = M);
945
945
  }), b)
946
- l.value = b;
946
+ n.value = b;
947
947
  else
948
948
  return console.warn("未找到管子模型"), [];
949
- const c = [];
950
- return Object.keys(r.joints).forEach((M) => {
951
- const f = r.joints[M];
952
- if (f._jointType === "fixed")
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 y = f.limit ? {
955
- lower: f.limit.lower ?? w(f._jointType, !1),
956
- upper: f.limit.upper ?? w(f._jointType, !0)
954
+ const U = _.limit ? {
955
+ lower: _.limit.lower ?? w(_._jointType, !1),
956
+ upper: _.limit.upper ?? w(_._jointType, !0)
957
957
  } : {
958
- lower: w(f._jointType, !1),
959
- upper: w(f._jointType, !0)
958
+ lower: w(_._jointType, !1),
959
+ upper: w(_._jointType, !0)
960
960
  };
961
- c.push({
961
+ h.push({
962
962
  name: M,
963
- type: f._jointType || "unknown",
964
- limit: y,
965
- currentValue: f.angle || 0,
966
- urdfJoint: f
963
+ type: _._jointType || "unknown",
964
+ limit: U,
965
+ currentValue: _.angle || 0,
966
+ urdfJoint: _
967
967
  });
968
- }), c.sort((M, f) => M.name.localeCompare(f.name));
969
- }, N = (r, b) => {
970
- const c = i.value.find((f) => f.name === r);
971
- if (!c) return;
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 (c.limit) {
974
- const f = Math.max(c.limit.lower, Math.min(c.limit.upper, M));
975
- c.currentValue = f;
973
+ if (h.limit) {
974
+ const _ = Math.max(h.limit.lower, Math.min(h.limit.upper, M));
975
+ h.currentValue = _;
976
976
  } else
977
- c.currentValue = M;
978
- t.model && t.model.setJointValue ? t.model.setJointValue(r, c.currentValue) : c.urdfJoint && c.urdfJoint.setJointValue(c.currentValue);
979
- }, K = (r) => r.reduce((b, c) => {
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 f = c.Y ?? 0, y = c.C ?? 0, o = c.R ?? 0;
982
- return f > 0 && (M += f), y > 0 && o > 0 && (M += o * C(y)), b + M;
983
- }, 0), H = (r) => {
984
- const b = [], c = r.Y ?? 0, M = r.B ?? 0, f = r.C ?? 0, y = r.R ?? 0, o = {
985
- pos: new g(0, 0, 0),
986
- localY: new g(0, 1, 0),
987
- localX: new g(1, 0, 0),
988
- localZ: new g(0, 0, 1)
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 (!c && !f) return b;
991
- if (b.push(o.pos.clone()), M !== 0) {
992
- const U = new fe().makeRotationAxis(o.localY, C(M));
993
- o.localX.applyMatrix4(U), o.localZ.applyMatrix4(U);
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 (c > 0 && (o.pos.add(o.localY.clone().multiplyScalar(c * we)), b.push(o.pos.clone())), f > 0 && y > 0) {
996
- const U = C(f), B = y * we, q = o.pos.clone().add(o.localX.clone().multiplyScalar(-B)), ae = Math.max(16, Math.ceil(f / 5));
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 S = U * Q / ae, ee = new fe().makeRotationAxis(o.localZ, S), se = o.localX.clone().multiplyScalar(B).applyMatrix4(ee), ce = q.clone().add(se);
999
- b.push(ce);
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 = (r) => {
1004
- const b = d.slice(0, r + 1), c = K(b), M = Math.max(0, D.value - c), f = [];
1005
- f.push(new g(0, 0, 0));
1006
- const y = new g(0, M * we, 0);
1007
- M > 0 && f.push(y);
1008
- let o = {
1009
- pos: y.clone(),
1010
- localY: new g(0, 1, 0),
1011
- localX: new g(1, 0, 0),
1012
- localZ: new g(0, 0, 1)
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 U = [];
1015
- for (let B = b.length - 1; B >= 0; B--) {
1016
- const q = b[B], ae = H(q);
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 ce = se.clone(), je = new fe();
1020
- return je.makeBasis(o.localX, o.localY, o.localZ), ce.applyMatrix4(je), ce.add(o.pos);
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
- U.push(Q);
1023
- const S = Q[Q.length - 1];
1024
- o.pos = S.clone();
1025
- const ee = q.B ?? 0, he = q.C ?? 0;
1026
- if (ee !== 0) {
1027
- const se = new fe().makeRotationAxis(o.localY, C(ee));
1028
- o.localX.applyMatrix4(se), o.localZ.applyMatrix4(se);
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 (he > 0) {
1031
- const se = C(he), ce = new fe().makeRotationAxis(o.localZ, se);
1032
- o.localY.applyMatrix4(ce), o.localX.applyMatrix4(ce);
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 B of U)
1037
- B.length > 1 && f.push(...B.slice(1));
1038
- f.length < 2 && f.push(new g(0, 1e-3, 0));
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 B = new bt(f, !1, "catmullrom", 0.01), q = new wt(B, Math.max(2, f.length * 4), v.value * we, 18, !1);
1041
- l.value.geometry.dispose(), l.value.geometry = q;
1042
- } catch (B) {
1043
- console.error("管件更新失败", B);
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 = (r, b) => {
1046
- r && (Object.keys(r).forEach((c) => {
1047
- const M = r[c], f = i.value.find((y) => y.name === c);
1048
- f && (f.currentValue = M, t.model && t.model.setJointValue ? t.model.setJointValue(c, M) : f.urdfJoint && f.urdfJoint.setJointValue(M));
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 = (r, b, c) => r + (b - r) * c, V = (r, b, c) => {
1051
- if (!r || !b) return r || b;
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(r).forEach((f) => {
1054
- const y = r[f], o = b[f];
1055
- M[f] = T(y, o || y, c);
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 r = () => {
1063
+ const l = () => {
1064
1064
  if (!x.value || z.value) return;
1065
- const b = I.value / ze, c = O.value, M = d[O.value], f = d[O.value + 1];
1066
- if (f) {
1067
- const y = V(M, f, b);
1068
- u(y, c);
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, c);
1071
- if (I.value++, I.value >= ze && (I.value = 0, O.value++, O.value >= d.length - 1)) {
1072
- F();
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
- h.value = setTimeout(r, s());
1075
+ r.value = setTimeout(l, s());
1076
1076
  };
1077
- r();
1077
+ l();
1078
1078
  }, oe = () => {
1079
- z.value = !0, h.value && (clearTimeout(h.value), h.value = null);
1080
- }, F = () => {
1081
- x.value = !1, z.value = !1, _.value = 1, h.value && (clearTimeout(h.value), h.value = null);
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: F,
1086
+ stopAnimation: N,
1087
1087
  resetAll: () => {
1088
- F(), O.value = 0, I.value = 0, i.value.forEach((r) => {
1089
- (r.type === "revolute" || r.type === "prismatic") && N(r.name, 0);
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
- _.value < 4 && (_.value = Math.min(4, _.value * 2));
1093
+ g.value < 4 && (g.value = Math.min(4, g.value * 2));
1094
1094
  },
1095
1095
  fastBackward: () => {
1096
- _.value > 0.25 && (_.value = Math.max(0.25, _.value / 2));
1096
+ g.value > 0.25 && (g.value = Math.max(0.25, g.value / 2));
1097
1097
  }
1098
- }), Ee(
1098
+ }), xe(
1099
1099
  () => t.model,
1100
- (r) => {
1101
- r ? (n.value = r, i.value = $(r)) : i.value = [];
1100
+ (l) => {
1101
+ l ? (a.value = l, i.value = $(l)) : i.value = [];
1102
1102
  },
1103
1103
  { immediate: !0 }
1104
1104
  );
1105
- const Te = () => {
1106
- !t.model || x.value && !z.value || i.value.forEach((r) => {
1107
- r.urdfJoint && r.urdfJoint.angle !== void 0 && (r.currentValue = r.urdfJoint.angle);
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
- }, Ce = () => {
1110
- const r = () => {
1111
- Te(), p.value = requestAnimationFrame(r);
1109
+ }, Te = () => {
1110
+ const l = () => {
1111
+ De(), p.value = requestAnimationFrame(l);
1112
1112
  };
1113
- r();
1114
- }, Se = () => {
1113
+ l();
1114
+ }, Ce = () => {
1115
1115
  p.value && (cancelAnimationFrame(p.value), p.value = null);
1116
- }, me = E(Date.now());
1117
- return $e(() => {
1118
- Ce(), me.value = Date.now();
1119
- }), et(() => {
1120
- Se(), F();
1121
- }), (r, b) => (X(), J("div", {
1122
- class: "panel-content",
1123
- key: me.value
1124
- }, [
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(tt, null, st(i.value, (c) => {
1127
- var M, f, y, o;
1123
+ (X(!0), J(et, null, tt(i.value, (h) => {
1124
+ var M, _, U, f;
1128
1125
  return X(), J("div", {
1129
- key: c.name,
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, ne(c.name), 1),
1135
- P("span", Wt, " [" + ne(((M = c.limit) == null ? void 0 : M.lower.toFixed(2)) ?? (c.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ne(((f = c.limit) == null ? void 0 : f.upper.toFixed(2)) ?? (c.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
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, ne(c.type), 1)
1134
+ P("span", qt, le(h.type), 1)
1138
1135
  ]),
1139
- c.type === "revolute" || c.type === "prismatic" ? (X(), J("div", Qt, [
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: ((y = c.limit) == null ? void 0 : y.lower) ?? (c.type === "revolute" ? -Math.PI : -1),
1144
- max: ((o = c.limit) == null ? void 0 : o.upper) ?? (c.type === "revolute" ? Math.PI : 1),
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: c.currentValue,
1147
- onInput: (U) => N(c.name, U.target.value),
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, ne(c.currentValue ? Number(c.currentValue).toFixed(3) : "0.000"), 1),
1154
- P("span", os, ne(c.type === "revolute" ? "rad" : "m"), 1)
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
- ])) : Pe("", !0)
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__ */ _e(ls, [["__scopeId", "data-v-9a9fed3f"]]), cs = ["xlink:href"], hs = /* @__PURE__ */ it({
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(a) {
1175
- const e = a, t = pe(
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}`), n = pe(() => {
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: Fe(["container", { active: p.active }]),
1189
- style: Ie(t.value)
1185
+ class: Ie(["container", { active: p.active }]),
1186
+ style: je(t.value)
1190
1187
  }, [
1191
1188
  (X(), J("svg", {
1192
- class: Fe(["svg-icon", [p.$attrs.class, p.spin && "svg-icon-spin"]]),
1193
- style: Ie(n.value),
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__ */ _e(hs, [["__scopeId", "data-v-53bfc052"]]), us = { class: "obj-viewer-container" }, ps = { class: "buttonGroup-top" }, ds = { class: "buttonGroup-topLeft" }, ms = { class: "buttonGroup-left" }, fs = { class: "buttonGroup-right" }, _s = { class: "buttonGroup-bottom" }, gs = { class: "left-panel" }, ys = { class: "panel-header" }, vs = {
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(a, { expose: e, emit: t }) {
1213
+ setup(o, { expose: e, emit: t }) {
1217
1214
  const i = t;
1218
- let n = null, p = !1;
1219
- const v = E(null), l = E(!1), D = E("");
1220
- E(!1);
1221
- const x = E(!1), z = E(!1), O = E(""), I = E(!1), h = E(""), C = E(), {
1222
- currentModels: _,
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: N,
1229
- clearAllModels: K,
1230
- cleanup: H
1231
- } = It(v), { isAnimating: m, toggleAnimation: u, stopAnimation: T } = Ft(N, _), { isClipping: V, activeClippingAxis: R, toggleClipping: oe, updateClippingPlanes: F } = Nt(
1232
- N,
1233
- _
1234
- ), { addModelsFromUrls: W, loadModelByDefaultPath: te, urdfModel: de, modelBoundingBoxes: Te } = Pt(
1235
- N,
1236
- _,
1237
- l,
1238
- D,
1239
- K
1240
- ), Ce = () => {
1241
- if (x.value || _.value.length === 0) return;
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: y, controls: o } = N();
1244
- if (!y || !o) return;
1245
- o.enabled = !0;
1246
- const U = (ee) => ee < 0.5 ? 4 * ee * ee * ee : 1 - Math.pow(-2 * ee + 2, 3) / 2, B = y.position.clone(), q = o.target.clone(), ae = 1500, Q = Date.now(), S = () => {
1247
- const ee = Date.now() - Q, he = Math.min(ee / ae, 1), se = U(he);
1248
- y.position.lerpVectors(B, s.value, se), o.target.lerpVectors(q, d.value, se), he < 1 ? requestAnimationFrame(S) : x.value = !1;
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
- S();
1251
- }, Se = async () => p ? Promise.resolve() : new Promise((y) => {
1252
- const o = () => {
1253
- p ? y() : requestAnimationFrame(o);
1247
+ C();
1248
+ }, Ce = async () => p ? Promise.resolve() : new Promise((f) => {
1249
+ const c = () => {
1250
+ p ? f() : requestAnimationFrame(c);
1254
1251
  };
1255
- o();
1256
- }), me = async (y, o) => {
1252
+ c();
1253
+ }), l = async (f, c) => {
1257
1254
  try {
1258
- await Se(), m.value && T(), V.value && oe();
1259
- const U = await o(y);
1260
- return $(Te), U;
1261
- } catch (U) {
1262
- throw console.error("加载模型失败:", U), U;
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
- }, r = async (y) => me(y, W), b = async (y) => me(y, te), c = (y) => {
1265
- z.value = !0, O.value = y, y === "剖面视图" && !V.value && oe();
1266
- }, M = (y) => {
1267
- I.value = !0, h.value = y, y === "动画仿真" && (i("getAnimationData"), console.log("获取动画数据"));
1268
- }, f = () => {
1269
- Ne(() => {
1270
- var y;
1271
- (y = C.value) == null || y.startAnimation();
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 $e(async () => {
1275
- await Ne();
1271
+ return Xe(async () => {
1272
+ await Fe();
1276
1273
  try {
1277
- w(), n = N().scene, p = !0, window.addEventListener("resize", j);
1278
- } catch (y) {
1279
- console.error("Three.js初始化失败:", y);
1274
+ w(), a = Y().scene, p = !0, window.addEventListener("resize", j);
1275
+ } catch (f) {
1276
+ console.error("Three.js初始化失败:", f);
1280
1277
  }
1281
- }), ot(() => {
1282
- p = !1, O.value = "", h.value = "", window.removeEventListener("resize", j), m.value && T(), H();
1278
+ }), it(() => {
1279
+ p = !1, O.value = "", r.value = "", window.removeEventListener("resize", j), m.value && T(), K();
1283
1280
  }), e({
1284
- addModelsFromUrls: r,
1285
- loadModelByDefaultPath: b
1286
- }), (y, o) => {
1287
- var B, q, ae, Q;
1288
- const U = Xe("el-scrollbar");
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: Ce,
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: o[0] || (o[0] = (S) => c("场景树")),
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: o[1] || (o[1] = (S) => c("剖面视图")),
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: o[2] || (o[2] = (S) => c("场景树3"))
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: o[3] || (o[3] = (S) => c("场景4"))
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: o[4] || (o[4] = (S) => M("关节控制")),
1380
- active: I.value && h.value === "关节控制",
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: o[5] || (o[5] = (S) => M("动画仿真")),
1388
- active: I.value && h.value === "动画仿真"
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: (B = C.value) == null ? void 0 : B.fastBackward
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: f
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: (q = C.value) == null ? void 0 : q.fastForward
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: (ae = C.value) == null ? void 0 : ae.pauseAnimation
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: (Q = C.value) == null ? void 0 : Q.resetAll
1430
+ onClick: (re = S.value) == null ? void 0 : re.resetAll
1434
1431
  }, null, 8, ["onClick"])
1435
1432
  ]),
1436
- le(P("div", gs, [
1433
+ ce(P("div", gs, [
1437
1434
  P("div", ys, [
1438
- P("span", null, ne(O.value), 1),
1435
+ P("span", null, le(O.value), 1),
1439
1436
  P("span", {
1440
1437
  class: "close",
1441
- onClick: o[6] || (o[6] = (S) => z.value = !1)
1438
+ onClick: c[6] || (c[6] = (C) => z.value = !1)
1442
1439
  }, " X ")
1443
1440
  ]),
1444
- k(U, { "max-height": "650px" }, {
1445
- default: Ue(() => [
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"])) : Pe("", !0),
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
- le(P("input", {
1450
+ ce(P("input", {
1454
1451
  type: "radio",
1455
1452
  name: "clipping-axis",
1456
1453
  value: "none",
1457
- "onUpdate:modelValue": o[7] || (o[7] = (S) => ge(R) ? R.value = S : null),
1458
- onChange: o[8] || (o[8] = (...S) => Z(F) && Z(F)(...S))
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
- [ye, Z(R)]
1457
+ [ge, Z(R)]
1461
1458
  ]),
1462
- o[16] || (o[16] = P("span", { class: "radio-text" }, "无切割", -1))
1459
+ c[16] || (c[16] = P("span", { class: "radio-text" }, "无切割", -1))
1463
1460
  ]),
1464
1461
  P("label", Ps, [
1465
- le(P("input", {
1462
+ ce(P("input", {
1466
1463
  type: "radio",
1467
1464
  name: "clipping-axis",
1468
1465
  value: "x",
1469
- "onUpdate:modelValue": o[9] || (o[9] = (S) => ge(R) ? R.value = S : null),
1470
- onChange: o[10] || (o[10] = (...S) => Z(F) && Z(F)(...S))
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
- [ye, Z(R)]
1469
+ [ge, Z(R)]
1473
1470
  ]),
1474
- o[17] || (o[17] = P("span", { class: "radio-text" }, "X轴切割", -1))
1471
+ c[17] || (c[17] = P("span", { class: "radio-text" }, "X轴切割", -1))
1475
1472
  ]),
1476
1473
  P("label", Ms, [
1477
- le(P("input", {
1474
+ ce(P("input", {
1478
1475
  type: "radio",
1479
1476
  name: "clipping-axis",
1480
1477
  value: "y",
1481
- "onUpdate:modelValue": o[11] || (o[11] = (S) => ge(R) ? R.value = S : null),
1482
- onChange: o[12] || (o[12] = (...S) => Z(F) && Z(F)(...S))
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
- [ye, Z(R)]
1481
+ [ge, Z(R)]
1485
1482
  ]),
1486
- o[18] || (o[18] = P("span", { class: "radio-text" }, "Y轴切割", -1))
1483
+ c[18] || (c[18] = P("span", { class: "radio-text" }, "Y轴切割", -1))
1487
1484
  ]),
1488
1485
  P("label", xs, [
1489
- le(P("input", {
1486
+ ce(P("input", {
1490
1487
  type: "radio",
1491
1488
  name: "clipping-axis",
1492
1489
  value: "z",
1493
- "onUpdate:modelValue": o[13] || (o[13] = (S) => ge(R) ? R.value = S : null),
1494
- onChange: o[14] || (o[14] = (...S) => Z(F) && Z(F)(...S))
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
- [ye, Z(R)]
1493
+ [ge, Z(R)]
1497
1494
  ]),
1498
- o[19] || (o[19] = P("span", { class: "radio-text" }, "Z轴切割", -1))
1495
+ c[19] || (c[19] = P("span", { class: "radio-text" }, "Z轴切割", -1))
1499
1496
  ])
1500
1497
  ])
1501
- ])) : Pe("", !0)
1498
+ ])) : we("", !0)
1502
1499
  ]),
1503
1500
  _: 1
1504
1501
  })
1505
1502
  ], 512), [
1506
- [ve, z.value]
1503
+ [ye, z.value]
1507
1504
  ]),
1508
- le(P("div", Es, [
1505
+ ce(P("div", Es, [
1509
1506
  P("div", Ds, [
1510
- P("span", null, ne(h.value), 1),
1507
+ P("span", null, le(r.value), 1),
1511
1508
  P("span", {
1512
1509
  class: "close",
1513
- onClick: o[15] || (o[15] = (S) => I.value = !1)
1510
+ onClick: c[15] || (c[15] = (C) => F.value = !1)
1514
1511
  }, " X ")
1515
1512
  ]),
1516
- k(U, { "max-height": "650px" }, {
1517
- default: Ue(() => [
1518
- le(k(rs, {
1513
+ k(I, { "max-height": "650px" }, {
1514
+ default: Ne(() => [
1515
+ ce(k(rs, {
1519
1516
  ref_key: "jointRef",
1520
- ref: C,
1517
+ ref: S,
1521
1518
  model: Z(de),
1522
- scene: Z(n),
1523
- animationData: a.animationData
1519
+ scene: Z(a),
1520
+ animationData: o.animationData
1524
1521
  }, null, 8, ["model", "scene", "animationData"]), [
1525
- [ve, h.value === "关节控制"]
1522
+ [ye, r.value === "关节控制"]
1526
1523
  ]),
1527
- le(k(Vt, { animationData: a.animationData }, null, 8, ["animationData"]), [
1528
- [ve, h.value === "动画仿真"]
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
- [ve, I.value]
1531
+ [ye, F.value]
1535
1532
  ]),
1536
- l.value ? (X(), J("div", Ts, [
1537
- o[20] || (o[20] = P("div", { class: "loading-spinner" }, null, -1)),
1538
- P("p", null, ne(D.value), 1)
1539
- ])) : Pe("", !0)
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__ */ _e(Cs, [["__scopeId", "data-v-24606bcb"]]);
1540
+ }, zs = /* @__PURE__ */ fe(Cs, [["__scopeId", "data-v-24606bcb"]]);
1544
1541
  export {
1545
1542
  zs as default
1546
1543
  };