ss-component-new 1.1.591 → 1.1.593

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,5 +1,5 @@
1
- import { ref as E, watch as ke, createElementBlock as W, openBlock as B, createBlock as Ke, computed as ue, resolveComponent as Xe, createVNode as k, onMounted as Be, onUnmounted as Qe, Fragment as et, renderList as tt, createElementVNode as w, createCommentVNode as be, toDisplayString as ne, defineComponent as st, normalizeStyle as je, normalizeClass as Ie, nextTick as Fe, onBeforeUnmount as it, withDirectives as re, unref as V, withCtx as Ne, isRef as fe, vModelRadio as _e, vShow as ge } from "vue";
2
- import { D as ot, V as y, M as ce, T as he, Q as Ue, E as Ye, F as se, R as at, P as we, G as $e, H as Me, J as nt, K as lt, L as rt, W as ct, N as ht, O as ut, U as pt, X as dt, Y as mt, Z as Pe, _ as ft, $ as Ae, a0 as _t, a1 as De, a2 as gt, a3 as Ve, a4 as Ge, a5 as Je, a6 as Te, C as yt, a7 as pe, a8 as vt, a9 as bt, aa as wt } from "./index-D-GfvBb0.js";
1
+ import { ref as E, watch as Me, createElementBlock as W, openBlock as $, createBlock as Ke, computed as ue, resolveComponent as Xe, createVNode as k, onMounted as Be, onUnmounted as Qe, Fragment as et, renderList as tt, createElementVNode as P, createCommentVNode as be, toDisplayString as ne, defineComponent as st, normalizeStyle as je, normalizeClass as Ie, nextTick as Fe, onBeforeUnmount as it, withDirectives as re, unref as V, withCtx as Ne, isRef as fe, vModelRadio as _e, vShow as ge } from "vue";
2
+ import { D as ot, V as y, M as ce, T as he, Q as Ue, E as Ye, F as se, R as at, P as we, G as $e, H as xe, J as nt, K as lt, L as rt, W as ct, N as ht, O as ut, U as pt, X as dt, Y as mt, Z as Pe, _ as ft, $ as Ae, a0 as _t, a1 as Te, a2 as gt, a3 as Ve, a4 as Ge, a5 as Je, a6 as Ce, C as yt, a7 as pe, a8 as vt, a9 as bt, aa as wt } from "./index-D-GfvBb0.js";
3
3
  import { _ as de } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
4
  import { c as We } from "./menu-Qw1eGtzq.js";
5
5
  const Ze = { type: "change" }, Re = { type: "start" }, qe = { type: "end" }, ye = new at(), He = new we(), Pt = Math.cos(70 * $e.DEG2RAD), Y = new y(), J = 2 * Math.PI, A = {
@@ -11,7 +11,7 @@ const Ze = { type: "change" }, Re = { type: "start" }, qe = { type: "end" }, ye
11
11
  TOUCH_PAN: 4,
12
12
  TOUCH_DOLLY_PAN: 5,
13
13
  TOUCH_DOLLY_ROTATE: 6
14
- }, Ce = 1e-6;
14
+ }, Se = 1e-6;
15
15
  class Mt extends ot {
16
16
  /**
17
17
  * Constructs a new controls instance.
@@ -116,7 +116,7 @@ class Mt extends ot {
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(), d = !0);
118
118
  }
119
- return this._scale = 1, this._performCursorZoom = !1, d || this._lastPosition.distanceToSquared(this.object.position) > Ce || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Ce || this._lastTargetPosition.distanceToSquared(this.target) > Ce ? (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, d || this._lastPosition.distanceToSquared(this.object.position) > Se || 8 * (1 - this._lastQuaternion.dot(this.object.quaternion)) > Se || this._lastTargetPosition.distanceToSquared(this.target) > Se ? (this.dispatchEvent(Ze), this._lastPosition.copy(this.object.position), this._lastQuaternion.copy(this.object.quaternion), this._lastTargetPosition.copy(this.target), !0) : !1;
120
120
  }
121
121
  _getAutoRotationAngle(e) {
122
122
  return e !== null ? J / 60 * this.autoRotateSpeed * e : J / 60 / 60 * this.autoRotateSpeed;
@@ -504,37 +504,37 @@ function jt(o) {
504
504
  n && (e.remove(n), n.dispose()), D && (e.remove(D), D.geometry.dispose(), D.material.dispose());
505
505
  const S = Math.min(Math.max(Math.floor(f / 20), 30), 40);
506
506
  n = new mt(f, S, 13421772, 14540253), n.rotateX(Math.PI / 2), n.position.copy(h), e.add(n);
507
- const X = new Pe(f, f), $ = new ft({
507
+ const X = new Pe(f, f), B = new ft({
508
508
  opacity: 0.3,
509
509
  // 阴影透明度
510
510
  color: 0
511
511
  });
512
- D = new Ae(X, $), D.position.copy(h), D.position.z -= 0.01, D.receiveShadow = !0, e.add(D);
512
+ D = new Ae(X, B), D.position.copy(h), D.position.z -= 0.01, D.receiveShadow = !0, e.add(D);
513
513
  }, T = () => {
514
514
  if (x.value.length === 0)
515
515
  return;
516
- const f = new Me();
516
+ const f = new xe();
517
517
  x.value.forEach((G) => {
518
518
  f.expandByObject(G);
519
519
  });
520
- const h = f.getSize(new y()), S = f.getCenter(new y()), X = Math.max(h.x, h.y, h.z), $ = Math.max(X * 8, 50), I = new y(
520
+ const h = f.getSize(new y()), S = f.getCenter(new y()), X = Math.max(h.x, h.y, h.z), B = Math.max(X * 8, 50), I = new y(
521
521
  S.x,
522
522
  S.y,
523
523
  f.min.z
524
524
  // 模型的最底部
525
525
  );
526
- c($, I);
526
+ c(B, I);
527
527
  }, g = () => {
528
528
  const f = new _t(4210752, 0.6);
529
529
  e.add(f);
530
- const h = new De(16777215, 2);
530
+ const h = new Te(16777215, 2);
531
531
  h.position.set(10, 10, 8), h.castShadow = !0, h.shadow.mapSize.width = 4096, h.shadow.mapSize.height = 4096, h.shadow.camera.near = 0.5, h.shadow.camera.far = 50, h.shadow.camera.left = -50, h.shadow.camera.right = 50, h.shadow.camera.top = 50, h.shadow.camera.bottom = -50, e.add(h);
532
- const S = new De(16777215, 0.8);
532
+ const S = new Te(16777215, 0.8);
533
533
  S.position.set(-8, -8, 6), e.add(S);
534
- const X = new De(16777215, 0.6);
534
+ const X = new Te(16777215, 0.6);
535
535
  X.position.set(0, -15, 2), e.add(X);
536
- const $ = new gt(16777215, 4473924, 0.8);
537
- e.add($);
536
+ const B = new gt(16777215, 4473924, 0.8);
537
+ e.add(B);
538
538
  const I = new Ve(16777215, 1, 50);
539
539
  I.position.set(15, 15, 15), e.add(I);
540
540
  const G = new Ve(16777215, 0.5, 50);
@@ -557,7 +557,7 @@ function jt(o) {
557
557
  ].forEach((S) => {
558
558
  f[S] && f[S].dispose && f[S].dispose();
559
559
  }), f.dispose && f.dispose();
560
- }, b = (f) => {
560
+ }, w = (f) => {
561
561
  f == null || f.traverse((h) => {
562
562
  h.geometry && h.geometry.dispose(), h.material && (Array.isArray(h.material) ? h.material.forEach((S) => {
563
563
  p(S);
@@ -578,11 +578,11 @@ function jt(o) {
578
578
  },
579
579
  fitCameraToAllModels: () => {
580
580
  if (!t || !a || x.value.length === 0) return;
581
- const f = new Me();
581
+ const f = new xe();
582
582
  x.value.forEach((G) => {
583
583
  f.expandByObject(G);
584
584
  });
585
- const h = f.getSize(new y()), S = f.getCenter(new y()), $ = Math.max(h.x, h.y, h.z) * 0.8, I = new y(S.x + $, S.y - $, S.z + $);
585
+ const h = f.getSize(new y()), S = f.getCenter(new y()), B = Math.max(h.x, h.y, h.z) * 0.8, I = new y(S.x + B, S.y - B, S.z + B);
586
586
  t.position.copy(I), t.lookAt(S), a.target.copy(S), a.update(), L.value.copy(I), N.value.copy(S), T();
587
587
  },
588
588
  getThreeJSObjects: () => ({
@@ -595,13 +595,13 @@ function jt(o) {
595
595
  clearAllModels: () => {
596
596
  if (!e) return;
597
597
  x.value.forEach((h) => {
598
- e.remove(h), b(h);
598
+ e.remove(h), w(h);
599
599
  });
600
600
  const f = [];
601
601
  e.children.forEach((h) => {
602
602
  !h.isLight && !h.isCamera && h.type !== "GridHelper" && h !== D && f.push(h);
603
603
  }), f.forEach((h) => {
604
- e.remove(h), b(h);
604
+ e.remove(h), w(h);
605
605
  }), x.value = [], T();
606
606
  },
607
607
  cleanup: () => {
@@ -614,16 +614,16 @@ function It(o, e) {
614
614
  const t = E(!1);
615
615
  let i = null, a = 12700, d = new y(), v = new y(), n = new y(), D = 0, x = null;
616
616
  const L = (s) => s < 0.5 ? 4 * s * s * s : 1 - Math.pow(-2 * s + 2, 3) / 2, N = (s) => {
617
- const p = new y(), b = D * 1.2, j = new y(n.x + b, n.y, n.z), H = new y(n.x, n.y + b, n.z), K = new y(n.x, n.y - b, n.z);
617
+ const p = new y(), w = D * 1.2, j = new y(n.x + w, n.y, n.z), H = new y(n.x, n.y + w, n.z), K = new y(n.x, n.y - w, n.z);
618
618
  if (s <= 0.567) {
619
619
  const Z = s / 0.567 * Math.PI * 2;
620
- p.x = n.x + Math.cos(Z) * b, p.z = n.z + Math.sin(Z) * b, p.y = n.y;
620
+ p.x = n.x + Math.cos(Z) * w, p.z = n.z + Math.sin(Z) * w, p.y = n.y;
621
621
  } else if (s <= 0.724) {
622
622
  const U = (s - 0.567) / 0.157, Z = L(U);
623
623
  p.lerpVectors(j, H, Z);
624
624
  } else if (s <= 0.881) {
625
625
  const U = (s - 0.724) / 0.157, f = L(U) * Math.PI;
626
- p.x = n.x + Math.sin(f) * b, p.y = n.y + Math.cos(f) * b, p.z = n.z;
626
+ p.x = n.x + Math.sin(f) * w, p.y = n.y + Math.cos(f) * w, p.z = n.z;
627
627
  } else {
628
628
  const U = (s - 0.881) / 0.119, Z = L(U);
629
629
  p.lerpVectors(K, d, Z);
@@ -633,7 +633,7 @@ function It(o, e) {
633
633
  const { camera: s, controls: p } = o();
634
634
  if (!s || !p) return;
635
635
  i || (i = Date.now());
636
- const b = Date.now() - i, j = Math.min(b / a, 1);
636
+ const w = Date.now() - i, j = Math.min(w / a, 1);
637
637
  if (j >= 1) {
638
638
  T();
639
639
  return;
@@ -645,12 +645,12 @@ function It(o, e) {
645
645
  const { camera: s, controls: p } = o();
646
646
  if (!s || !p) return;
647
647
  d.copy(s.position), v.copy(p.target);
648
- const b = new Me();
648
+ const w = new xe();
649
649
  e.value.forEach((h) => {
650
- b.expandByObject(h);
650
+ w.expandByObject(h);
651
651
  });
652
- const j = b.getSize(new y());
653
- n = b.getCenter(new y()), D = Math.max(j.x, j.y, j.z) * 1.2;
652
+ const j = w.getSize(new y());
653
+ n = w.getCenter(new y()), D = Math.max(j.x, j.y, j.z) * 1.2;
654
654
  const H = new y(n.x + D * 1.2, n.y, n.z);
655
655
  p.enabled = !1;
656
656
  const K = s.position.clone(), U = 1e3, Z = Date.now(), f = () => {
@@ -671,9 +671,9 @@ function It(o, e) {
671
671
  const { camera: s, controls: p } = o();
672
672
  if (!s || !p) return;
673
673
  p.enabled = !0;
674
- const b = s.position.clone(), j = p.target.clone(), H = 1500, K = Date.now(), U = () => {
674
+ const w = s.position.clone(), j = p.target.clone(), H = 1500, K = Date.now(), U = () => {
675
675
  const Z = Date.now() - K, f = Math.min(Z / H, 1), h = L(f);
676
- s.position.lerpVectors(b, d, h), p.target.lerpVectors(j, v, h), f < 1 && requestAnimationFrame(U);
676
+ s.position.lerpVectors(w, d, h), p.target.lerpVectors(j, v, h), f < 1 && requestAnimationFrame(U);
677
677
  };
678
678
  U();
679
679
  } else
@@ -685,7 +685,7 @@ function It(o, e) {
685
685
  }
686
686
  function Ft(o, e) {
687
687
  const t = E(!1), i = E("none");
688
- let a = [], d = [], v = new Me(), n = new y();
688
+ let a = [], d = [], v = new xe(), n = new y();
689
689
  const D = () => {
690
690
  a = [
691
691
  new we(new y(1, 0, 0), 0),
@@ -701,8 +701,8 @@ function Ft(o, e) {
701
701
  }), n = v.getCenter(new y());
702
702
  }, L = (g) => {
703
703
  const s = v.getSize(new y());
704
- let p, b, j;
705
- g === "x" ? (p = new Pe(s.z * 1.2, s.y * 1.2), b = new y(n.x, n.y, n.z), j = new Te(0, Math.PI / 2, 0)) : g === "y" ? (p = new Pe(s.x * 1.2, s.z * 1.2), b = new y(n.x, n.y, n.z), j = new Te(Math.PI / 2, 0, 0)) : g === "z" && (p = new Pe(s.x * 1.2, s.y * 1.2), b = new y(n.x, n.y, n.z), j = new Te(0, 0, 0));
704
+ let p, w, j;
705
+ g === "x" ? (p = new Pe(s.z * 1.2, s.y * 1.2), w = new y(n.x, n.y, n.z), j = new Ce(0, Math.PI / 2, 0)) : g === "y" ? (p = new Pe(s.x * 1.2, s.z * 1.2), w = new y(n.x, n.y, n.z), j = new Ce(Math.PI / 2, 0, 0)) : g === "z" && (p = new Pe(s.x * 1.2, s.y * 1.2), w = new y(n.x, n.y, n.z), j = new Ce(0, 0, 0));
706
706
  const H = new Ge({
707
707
  color: 8900331,
708
708
  transparent: !0,
@@ -710,7 +710,7 @@ function Ft(o, e) {
710
710
  side: Je,
711
711
  depthWrite: !1
712
712
  }), K = new Ae(p, H);
713
- return K.position.copy(b), K.rotation.copy(j), K;
713
+ return K.position.copy(w), K.rotation.copy(j), K;
714
714
  }, N = () => {
715
715
  if (R(), c(), i.value === "none")
716
716
  return;
@@ -718,10 +718,10 @@ function Ft(o, e) {
718
718
  let g = null;
719
719
  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) {
720
720
  e.value.forEach((p) => {
721
- p.traverse((b) => {
722
- b.isMesh && b.material && (Array.isArray(b.material) ? b.material.forEach((j) => {
721
+ p.traverse((w) => {
722
+ w.isMesh && w.material && (Array.isArray(w.material) ? w.material.forEach((j) => {
723
723
  j.clippingPlanes = [g];
724
- }) : b.material.clippingPlanes = [g]);
724
+ }) : w.material.clippingPlanes = [g]);
725
725
  });
726
726
  });
727
727
  const { scene: s } = o();
@@ -765,7 +765,7 @@ const Nt = { class: "panel-content" }, Ut = {
765
765
  const e = o;
766
766
  E();
767
767
  const t = E();
768
- return ke(
768
+ return Me(
769
769
  () => [e == null ? void 0 : e.animationData],
770
770
  () => {
771
771
  var a;
@@ -775,8 +775,8 @@ const Nt = { class: "panel-content" }, Ut = {
775
775
  { deep: !0, immediate: !0 }
776
776
  ), (i, a) => {
777
777
  var d, v, n;
778
- return B(), W("div", Nt, [
779
- (B(), Ke(yt, {
778
+ return $(), W("div", Nt, [
779
+ ($(), Ke(yt, {
780
780
  itemData: (d = t.value) == null ? void 0 : d.compData,
781
781
  key: (v = t.value) == null ? void 0 : v.id,
782
782
  index: (n = t.value) == null ? void 0 : n.id,
@@ -848,12 +848,12 @@ const Nt = { class: "panel-content" }, Ut = {
848
848
  return c.forEach((s) => {
849
849
  if (s.children && s.children.length > 0) {
850
850
  g.push(s.id);
851
- const p = s.children.filter((b) => b.children && b.children.length > 0).slice(0, T).map((b) => b.id);
851
+ const p = s.children.filter((w) => w.children && w.children.length > 0).slice(0, T).map((w) => w.id);
852
852
  g.push(...p);
853
853
  }
854
854
  }), g.slice(0, T + 1);
855
855
  }, N = ue(() => !a.value || a.value.length === 0 ? [] : t.expandStrategy === "firstLevel" ? L(a.value, t.maxExpandCount) : x(a.value, t.maxExpandCount)), R = ue(() => t != null && t.model ? D(t.model) : []);
856
- return ke(
856
+ return Me(
857
857
  R,
858
858
  (c) => {
859
859
  a.value = JSON.parse(JSON.stringify(c));
@@ -861,7 +861,7 @@ const Nt = { class: "panel-content" }, Ut = {
861
861
  { immediate: !0 }
862
862
  ), (c, T) => {
863
863
  const g = Xe("el-tree");
864
- return B(), W("div", Vt, [
864
+ return $(), W("div", Vt, [
865
865
  k(g, {
866
866
  data: a.value,
867
867
  props: d,
@@ -881,7 +881,7 @@ const Nt = { class: "panel-content" }, Ut = {
881
881
  }, es = { class: "slider-container" }, ts = ["min", "max", "value", "onInput", "disabled"], ss = { class: "value-display" }, is = { class: "joint-value" }, os = { class: "unit" }, as = {
882
882
  key: 1,
883
883
  class: "empty-state"
884
- }, ve = 1e-3, ns = 1e3, Se = 60, ls = {
884
+ }, ve = 1e-3, ns = 1e3, ke = 60, ls = {
885
885
  __name: "jointPanel",
886
886
  props: {
887
887
  model: Object,
@@ -891,15 +891,23 @@ const Nt = { class: "panel-content" }, Ut = {
891
891
  setup(o, { expose: e }) {
892
892
  const t = o;
893
893
  E(!0);
894
- const i = E([]), a = E(null), d = E(null), v = E(12.5), n = E(), D = E(1302), x = E(!1), L = E(!1), N = E(0), R = E(0), c = E(null), T = $e.degToRad, g = E(1), s = () => ns / Se / g.value;
894
+ const i = E([]), a = E(null), d = E(null), v = E(12.5), n = E(), D = E(1302), x = E(!1), L = E(!1), N = E(0), R = E(0), c = E(null), T = $e.degToRad, g = E(1), s = () => ns / ke / g.value;
895
895
  let p = [];
896
- p.value = We(presetAnimationData2), ue(() => p.length > 0);
897
- const b = (l, P = !1) => l === "revolute" ? P ? Math.PI : -Math.PI : l === "prismatic" ? P ? 1 : -1 : 0, j = () => {
896
+ Me(
897
+ () => t.animationData,
898
+ (l) => {
899
+ var u;
900
+ let b = ((u = We(l)) == null ? void 0 : u.动画输出) ?? [];
901
+ b && b.length > 0 && (p = b, B());
902
+ },
903
+ { deep: !0 }
904
+ ), ue(() => p.length > 0);
905
+ const w = (l, b = !1) => l === "revolute" ? b ? Math.PI : -Math.PI : l === "prismatic" ? b ? 1 : -1 : 0, j = () => {
898
906
  if (!a.value)
899
907
  return ElMessage.error("未加载 URDF"), !1;
900
908
  let l = null;
901
- return a.value.traverse((P) => {
902
- P.name === "Pipe_Link" && !l && P.traverse((u) => {
909
+ return a.value.traverse((b) => {
910
+ b.name === "Pipe_Link" && !l && b.traverse((u) => {
903
911
  u instanceof Ae && !l && (l = u);
904
912
  });
905
913
  }), l ? (n.value = l, l.material = new Ge({
@@ -910,11 +918,11 @@ const Nt = { class: "panel-content" }, Ut = {
910
918
  }, H = (l) => {
911
919
  if (!l || !l.joints)
912
920
  return console.warn("URDF模型没有关节信息"), [];
913
- let P = null;
921
+ let b = null;
914
922
  if (l.traverse((M) => {
915
- M.name === "Pipe_Link" && !P && (P = M);
916
- }), P)
917
- n.value = P;
923
+ M.name === "Pipe_Link" && !b && (b = M);
924
+ }), b)
925
+ n.value = b;
918
926
  else
919
927
  return console.warn("未找到管子模型"), [];
920
928
  const u = [];
@@ -923,11 +931,11 @@ const Nt = { class: "panel-content" }, Ut = {
923
931
  if (_._jointType === "fixed")
924
932
  return;
925
933
  const F = _.limit ? {
926
- lower: _.limit.lower ?? b(_._jointType, !1),
927
- upper: _.limit.upper ?? b(_._jointType, !0)
934
+ lower: _.limit.lower ?? w(_._jointType, !1),
935
+ upper: _.limit.upper ?? w(_._jointType, !0)
928
936
  } : {
929
- lower: b(_._jointType, !1),
930
- upper: b(_._jointType, !0)
937
+ lower: w(_._jointType, !1),
938
+ upper: w(_._jointType, !0)
931
939
  };
932
940
  u.push({
933
941
  name: M,
@@ -937,42 +945,42 @@ const Nt = { class: "panel-content" }, Ut = {
937
945
  urdfJoint: _
938
946
  });
939
947
  }), u.sort((M, _) => M.name.localeCompare(_.name));
940
- }, K = (l, P) => {
948
+ }, K = (l, b) => {
941
949
  const u = i.value.find((_) => _.name === l);
942
950
  if (!u) return;
943
- const M = parseFloat(P);
951
+ const M = parseFloat(b);
944
952
  if (u.limit) {
945
953
  const _ = Math.max(u.limit.lower, Math.min(u.limit.upper, M));
946
954
  u.currentValue = _;
947
955
  } else
948
956
  u.currentValue = M;
949
957
  t.model && t.model.setJointValue ? t.model.setJointValue(l, u.currentValue) : u.urdfJoint && u.urdfJoint.setJointValue(u.currentValue);
950
- }, U = (l) => l.reduce((P, u) => {
958
+ }, U = (l) => l.reduce((b, u) => {
951
959
  let M = 0;
952
960
  const _ = u.Y ?? 0, F = u.C ?? 0, m = u.R ?? 0;
953
- return _ > 0 && (M += _), F > 0 && m > 0 && (M += m * T(F)), P + M;
961
+ return _ > 0 && (M += _), F > 0 && m > 0 && (M += m * T(F)), b + M;
954
962
  }, 0), Z = (l) => {
955
- const P = [], u = l.Y ?? 0, M = l.B ?? 0, _ = l.C ?? 0, F = l.R ?? 0, m = {
963
+ const b = [], u = l.Y ?? 0, M = l.B ?? 0, _ = l.C ?? 0, F = l.R ?? 0, m = {
956
964
  pos: new y(0, 0, 0),
957
965
  localY: new y(0, 1, 0),
958
966
  localX: new y(1, 0, 0),
959
967
  localZ: new y(0, 0, 1)
960
968
  };
961
- if (!u && !_) return P;
962
- if (P.push(m.pos.clone()), M !== 0) {
969
+ if (!u && !_) return b;
970
+ if (b.push(m.pos.clone()), M !== 0) {
963
971
  const r = new pe().makeRotationAxis(m.localY, T(M));
964
972
  m.localX.applyMatrix4(r), m.localZ.applyMatrix4(r);
965
973
  }
966
- if (u > 0 && (m.pos.add(m.localY.clone().multiplyScalar(u * ve)), P.push(m.pos.clone())), _ > 0 && F > 0) {
974
+ if (u > 0 && (m.pos.add(m.localY.clone().multiplyScalar(u * ve)), b.push(m.pos.clone())), _ > 0 && F > 0) {
967
975
  const r = T(_), O = F * ve, q = m.pos.clone().add(m.localX.clone().multiplyScalar(-O)), ie = Math.max(16, Math.ceil(_ / 5));
968
976
  for (let Q = 1; Q <= ie; Q++) {
969
977
  const le = r * Q / ie, C = new pe().makeRotationAxis(m.localZ, le), te = m.localX.clone().multiplyScalar(O).applyMatrix4(C), oe = q.clone().add(te);
970
- P.push(oe);
978
+ b.push(oe);
971
979
  }
972
980
  }
973
- return P;
981
+ return b;
974
982
  }, f = (l) => {
975
- const P = p.value.slice(0, l + 1), u = U(P), M = Math.max(0, D.value - u), _ = [];
983
+ const b = p.slice(0, l + 1), u = U(b), M = Math.max(0, D.value - u), _ = [];
976
984
  _.push(new y(0, 0, 0));
977
985
  const F = new y(0, M * ve, 0);
978
986
  M > 0 && _.push(F);
@@ -983,8 +991,8 @@ const Nt = { class: "panel-content" }, Ut = {
983
991
  localZ: new y(0, 0, 1)
984
992
  };
985
993
  const r = [];
986
- for (let O = P.length - 1; O >= 0; O--) {
987
- const q = P[O], ie = Z(q);
994
+ for (let O = b.length - 1; O >= 0; O--) {
995
+ const q = b[O], ie = Z(q);
988
996
  if (ie.length > 0) {
989
997
  const Q = ie.map((te) => {
990
998
  const oe = te.clone(), Oe = new pe();
@@ -1013,19 +1021,19 @@ const Nt = { class: "panel-content" }, Ut = {
1013
1021
  } catch (O) {
1014
1022
  console.error("管件更新失败", O);
1015
1023
  }
1016
- }, h = (l, P) => {
1024
+ }, h = (l, b) => {
1017
1025
  l && (Object.keys(l).forEach((u) => {
1018
1026
  const M = l[u], _ = i.value.find((F) => F.name === u);
1019
1027
  _ && (_.currentValue = M, t.model && t.model.setJointValue ? t.model.setJointValue(u, M) : _.urdfJoint && _.urdfJoint.setJointValue(M));
1020
- }), f(P));
1021
- }, S = (l, P, u) => l + (P - l) * u, X = (l, P, u) => {
1022
- if (!l || !P) return l || P;
1028
+ }), f(b));
1029
+ }, S = (l, b, u) => l + (b - l) * u, X = (l, b, u) => {
1030
+ if (!l || !b) return l || b;
1023
1031
  const M = {};
1024
1032
  return Object.keys(l).forEach((_) => {
1025
- const F = l[_], m = P[_];
1033
+ const F = l[_], m = b[_];
1026
1034
  M[_] = S(F, m || F, u);
1027
1035
  }), M;
1028
- }, $ = () => {
1036
+ }, B = () => {
1029
1037
  if (p.length === 0) {
1030
1038
  console.warn("没有动画数据");
1031
1039
  return;
@@ -1033,13 +1041,13 @@ const Nt = { class: "panel-content" }, Ut = {
1033
1041
  j(), x.value = !0, L.value = !1;
1034
1042
  const l = () => {
1035
1043
  if (!x.value || L.value) return;
1036
- const P = R.value / Se, u = N.value, M = p[N.value], _ = p[N.value + 1];
1044
+ const b = R.value / ke, u = N.value, M = p[N.value], _ = p[N.value + 1];
1037
1045
  if (_) {
1038
- const F = X(M, _, P);
1046
+ const F = X(M, _, b);
1039
1047
  h(F, u);
1040
1048
  } else
1041
1049
  h(M, u);
1042
- if (R.value++, R.value >= Se && (R.value = 0, N.value++, N.value >= p.length - 1)) {
1050
+ if (R.value++, R.value >= ke && (R.value = 0, N.value++, N.value >= p.length - 1)) {
1043
1051
  G();
1044
1052
  return;
1045
1053
  }
@@ -1052,7 +1060,7 @@ const Nt = { class: "panel-content" }, Ut = {
1052
1060
  x.value = !1, L.value = !1, g.value = 1, c.value && (clearTimeout(c.value), c.value = null);
1053
1061
  };
1054
1062
  e({
1055
- startAnimation: $,
1063
+ startAnimation: B,
1056
1064
  pauseAnimation: I,
1057
1065
  stopAnimation: G,
1058
1066
  resetAll: () => {
@@ -1066,7 +1074,7 @@ const Nt = { class: "panel-content" }, Ut = {
1066
1074
  fastBackward: () => {
1067
1075
  g.value > 0.25 && (g.value = Math.max(0.25, g.value / 2));
1068
1076
  }
1069
- }), ke(
1077
+ }), Me(
1070
1078
  () => t.model,
1071
1079
  (l) => {
1072
1080
  l ? (a.value = l, i.value = H(l)) : i.value = [];
@@ -1077,36 +1085,36 @@ const Nt = { class: "panel-content" }, Ut = {
1077
1085
  !t.model || x.value && !L.value || i.value.forEach((l) => {
1078
1086
  l.urdfJoint && l.urdfJoint.angle !== void 0 && (l.currentValue = l.urdfJoint.angle);
1079
1087
  });
1080
- }, xe = () => {
1088
+ }, Ee = () => {
1081
1089
  const l = () => {
1082
1090
  me(), d.value = requestAnimationFrame(l);
1083
1091
  };
1084
1092
  l();
1085
- }, Ee = () => {
1093
+ }, De = () => {
1086
1094
  d.value && (cancelAnimationFrame(d.value), d.value = null);
1087
1095
  };
1088
1096
  return Be(() => {
1089
- xe();
1097
+ Ee();
1090
1098
  }), Qe(() => {
1091
- Ee(), G();
1092
- }), (l, P) => (B(), W("div", Xt, [
1093
- i.value.length > 0 ? (B(), W("div", Bt, [
1094
- (B(!0), W(et, null, tt(i.value, (u) => {
1099
+ De(), G();
1100
+ }), (l, b) => ($(), W("div", Xt, [
1101
+ i.value.length > 0 ? ($(), W("div", Bt, [
1102
+ ($(!0), W(et, null, tt(i.value, (u) => {
1095
1103
  var M, _, F, m;
1096
- return B(), W("div", {
1104
+ return $(), W("div", {
1097
1105
  key: u.name,
1098
1106
  class: "joint-item"
1099
1107
  }, [
1100
- w("div", $t, [
1101
- w("div", Gt, [
1102
- w("span", Jt, ne(u.name), 1),
1103
- w("span", Wt, " [" + ne(((M = u.limit) == null ? void 0 : M.lower.toFixed(2)) ?? (u.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ne(((_ = u.limit) == null ? void 0 : _.upper.toFixed(2)) ?? (u.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
1108
+ P("div", $t, [
1109
+ P("div", Gt, [
1110
+ P("span", Jt, ne(u.name), 1),
1111
+ P("span", Wt, " [" + ne(((M = u.limit) == null ? void 0 : M.lower.toFixed(2)) ?? (u.type === "revolute" ? "-3.14" : "-1.00")) + ", " + ne(((_ = u.limit) == null ? void 0 : _.upper.toFixed(2)) ?? (u.type === "revolute" ? "3.14" : "1.00")) + "] ", 1)
1104
1112
  ]),
1105
- w("span", qt, ne(u.type), 1)
1113
+ P("span", qt, ne(u.type), 1)
1106
1114
  ]),
1107
- u.type === "revolute" || u.type === "prismatic" ? (B(), W("div", Qt, [
1108
- w("div", es, [
1109
- w("input", {
1115
+ u.type === "revolute" || u.type === "prismatic" ? ($(), W("div", Qt, [
1116
+ P("div", es, [
1117
+ P("input", {
1110
1118
  type: "range",
1111
1119
  min: ((F = u.limit) == null ? void 0 : F.lower) ?? (u.type === "revolute" ? -Math.PI : -1),
1112
1120
  max: ((m = u.limit) == null ? void 0 : m.upper) ?? (u.type === "revolute" ? Math.PI : 1),
@@ -1117,19 +1125,19 @@ const Nt = { class: "panel-content" }, Ut = {
1117
1125
  disabled: x.value && !L.value
1118
1126
  }, null, 40, ts)
1119
1127
  ]),
1120
- w("div", ss, [
1121
- w("span", is, ne(u.currentValue.toFixed(3)), 1),
1122
- w("span", os, ne(u.type === "revolute" ? "rad" : "m"), 1)
1128
+ P("div", ss, [
1129
+ P("span", is, ne(u.currentValue.toFixed(3)), 1),
1130
+ P("span", os, ne(u.type === "revolute" ? "rad" : "m"), 1)
1123
1131
  ])
1124
1132
  ])) : be("", !0)
1125
1133
  ]);
1126
1134
  }), 128))
1127
- ])) : (B(), W("div", as, P[0] || (P[0] = [
1128
- w("p", null, "未检测到可控制的关节", -1)
1135
+ ])) : ($(), W("div", as, b[0] || (b[0] = [
1136
+ P("p", null, "未检测到可控制的关节", -1)
1129
1137
  ])))
1130
1138
  ]));
1131
1139
  }
1132
- }, rs = /* @__PURE__ */ de(ls, [["__scopeId", "data-v-29cb0a79"]]), cs = ["xlink:href"], hs = /* @__PURE__ */ st({
1140
+ }, rs = /* @__PURE__ */ de(ls, [["__scopeId", "data-v-efaa40d4"]]), cs = ["xlink:href"], hs = /* @__PURE__ */ st({
1133
1141
  __name: "svgIcon",
1134
1142
  props: {
1135
1143
  backgroundColor: { default: "#f0f0f0" },
@@ -1152,16 +1160,16 @@ const Nt = { class: "panel-content" }, Ut = {
1152
1160
  height: v
1153
1161
  };
1154
1162
  });
1155
- return (d, v) => (B(), W("div", {
1163
+ return (d, v) => ($(), W("div", {
1156
1164
  class: Ie(["container", { active: d.active }]),
1157
1165
  style: je(t.value)
1158
1166
  }, [
1159
- (B(), W("svg", {
1167
+ ($(), W("svg", {
1160
1168
  class: Ie(["svg-icon", [d.$attrs.class, d.spin && "svg-icon-spin"]]),
1161
1169
  style: je(a.value),
1162
1170
  "aria-hidden": "true"
1163
1171
  }, [
1164
- w("use", { "xlink:href": i.value }, null, 8, cs)
1172
+ P("use", { "xlink:href": i.value }, null, 8, cs)
1165
1173
  ], 6))
1166
1174
  ], 6));
1167
1175
  }
@@ -1189,14 +1197,14 @@ const Nt = { class: "panel-content" }, Ut = {
1189
1197
  const L = E(!1), N = E(!1), R = E(""), c = E(!1), T = E(""), g = E(), {
1190
1198
  currentModels: s,
1191
1199
  initialCameraPosition: p,
1192
- initialTargetPosition: b,
1200
+ initialTargetPosition: w,
1193
1201
  initThreeJS: j,
1194
1202
  handleResize: H,
1195
1203
  fitCameraToAllModels: K,
1196
1204
  getThreeJSObjects: U,
1197
1205
  clearAllModels: Z,
1198
1206
  cleanup: f
1199
- } = jt(n), { isAnimating: h, toggleAnimation: S, stopAnimation: X } = It(U, s), { isClipping: $, activeClippingAxis: I, toggleClipping: G, updateClippingPlanes: ae } = Ft(
1207
+ } = jt(n), { isAnimating: h, toggleAnimation: S, stopAnimation: X } = It(U, s), { isClipping: B, activeClippingAxis: I, toggleClipping: G, updateClippingPlanes: ae } = Ft(
1200
1208
  U,
1201
1209
  s
1202
1210
  ), { addModelsFromUrls: ze, loadModelByDefaultPath: Le, urdfModel: me } = wt(
@@ -1205,7 +1213,7 @@ const Nt = { class: "panel-content" }, Ut = {
1205
1213
  D,
1206
1214
  x,
1207
1215
  Z
1208
- ), xe = () => {
1216
+ ), Ee = () => {
1209
1217
  if (L.value || s.value.length === 0) return;
1210
1218
  L.value = !0, h.value && X();
1211
1219
  const { camera: m, controls: r } = U();
@@ -1213,24 +1221,24 @@ const Nt = { class: "panel-content" }, Ut = {
1213
1221
  r.enabled = !0;
1214
1222
  const O = (ee) => ee < 0.5 ? 4 * ee * ee * ee : 1 - Math.pow(-2 * ee + 2, 3) / 2, q = m.position.clone(), ie = r.target.clone(), Q = 1500, le = Date.now(), C = () => {
1215
1223
  const ee = Date.now() - le, te = Math.min(ee / Q, 1), oe = O(te);
1216
- m.position.lerpVectors(q, p.value, oe), r.target.lerpVectors(ie, b.value, oe), te < 1 ? requestAnimationFrame(C) : L.value = !1;
1224
+ m.position.lerpVectors(q, p.value, oe), r.target.lerpVectors(ie, w.value, oe), te < 1 ? requestAnimationFrame(C) : L.value = !1;
1217
1225
  };
1218
1226
  C();
1219
- }, Ee = async () => v ? Promise.resolve() : new Promise((m) => {
1227
+ }, De = async () => v ? Promise.resolve() : new Promise((m) => {
1220
1228
  const r = () => {
1221
1229
  v ? m() : requestAnimationFrame(r);
1222
1230
  };
1223
1231
  r();
1224
1232
  }), l = async (m, r) => {
1225
1233
  try {
1226
- await Ee(), h.value && X(), $.value && G();
1234
+ await De(), h.value && X(), B.value && G();
1227
1235
  const O = await r(m);
1228
1236
  return K(), O;
1229
1237
  } catch (O) {
1230
1238
  throw console.error("加载模型失败:", O), O;
1231
1239
  }
1232
- }, P = async (m) => l(m, ze), u = async (m) => l(m, Le), M = (m) => {
1233
- N.value = !0, R.value = m, m === "剖面视图" && !$.value && G();
1240
+ }, b = async (m) => l(m, ze), u = async (m) => l(m, Le), M = (m) => {
1241
+ N.value = !0, R.value = m, m === "剖面视图" && !B.value && G();
1234
1242
  }, _ = (m) => {
1235
1243
  c.value = !0, T.value = m;
1236
1244
  }, F = () => {
@@ -1249,18 +1257,18 @@ const Nt = { class: "panel-content" }, Ut = {
1249
1257
  }), it(() => {
1250
1258
  v = !1, R.value = "", T.value = "", window.removeEventListener("resize", H), h.value && X(), f();
1251
1259
  }), e({
1252
- addModelsFromUrls: P,
1260
+ addModelsFromUrls: b,
1253
1261
  loadModelByDefaultPath: u
1254
1262
  }), (m, r) => {
1255
1263
  var q, ie, Q, le;
1256
1264
  const O = Xe("el-scrollbar");
1257
- return B(), W("div", us, [
1258
- w("div", {
1265
+ return $(), W("div", us, [
1266
+ P("div", {
1259
1267
  ref_key: "threejsContainer",
1260
1268
  ref: n,
1261
1269
  class: "threejs-container"
1262
1270
  }, null, 512),
1263
- w("div", ps, [
1271
+ P("div", ps, [
1264
1272
  k(z, {
1265
1273
  name: "guanjianjiexi",
1266
1274
  size: "34"
@@ -1282,11 +1290,11 @@ const Nt = { class: "panel-content" }, Ut = {
1282
1290
  size: "34"
1283
1291
  })
1284
1292
  ]),
1285
- w("div", ds, [
1293
+ P("div", ds, [
1286
1294
  k(z, {
1287
1295
  name: "viewReset",
1288
1296
  size: "24",
1289
- onClick: xe,
1297
+ onClick: Ee,
1290
1298
  title: "重置"
1291
1299
  }),
1292
1300
  k(z, {
@@ -1306,7 +1314,7 @@ const Nt = { class: "panel-content" }, Ut = {
1306
1314
  title: V(h) ? "停止动画" : "动画视图"
1307
1315
  }, null, 8, ["onClick", "title"])
1308
1316
  ]),
1309
- w("div", ms, [
1317
+ P("div", ms, [
1310
1318
  k(z, {
1311
1319
  name: "jiegoushu",
1312
1320
  size: "24",
@@ -1332,7 +1340,7 @@ const Nt = { class: "panel-content" }, Ut = {
1332
1340
  onClick: r[3] || (r[3] = (C) => M("场景4"))
1333
1341
  })
1334
1342
  ]),
1335
- w("div", fs, [
1343
+ P("div", fs, [
1336
1344
  k(z, {
1337
1345
  name: "donghuafangzhen",
1338
1346
  size: "24"
@@ -1364,7 +1372,7 @@ const Nt = { class: "panel-content" }, Ut = {
1364
1372
  size: "24"
1365
1373
  })
1366
1374
  ]),
1367
- w("div", _s, [
1375
+ P("div", _s, [
1368
1376
  k(z, {
1369
1377
  name: "kuaitui",
1370
1378
  size: "24",
@@ -1401,24 +1409,24 @@ const Nt = { class: "panel-content" }, Ut = {
1401
1409
  onClick: (le = g.value) == null ? void 0 : le.resetAll
1402
1410
  }, null, 8, ["onClick"])
1403
1411
  ]),
1404
- re(w("div", gs, [
1405
- w("div", ys, [
1406
- w("span", null, ne(R.value), 1),
1407
- w("span", {
1412
+ re(P("div", gs, [
1413
+ P("div", ys, [
1414
+ P("span", null, ne(R.value), 1),
1415
+ P("span", {
1408
1416
  class: "close",
1409
1417
  onClick: r[6] || (r[6] = (C) => N.value = !1)
1410
1418
  }, " X ")
1411
1419
  ]),
1412
1420
  k(O, { "max-height": "650px" }, {
1413
1421
  default: Ne(() => [
1414
- R.value === "场景树" ? (B(), Ke(Kt, {
1422
+ R.value === "场景树" ? ($(), Ke(Kt, {
1415
1423
  key: 0,
1416
1424
  model: V(me)
1417
1425
  }, null, 8, ["model"])) : be("", !0),
1418
- R.value === "剖面视图" ? (B(), W("div", vs, [
1419
- w("div", bs, [
1420
- w("label", ws, [
1421
- re(w("input", {
1426
+ R.value === "剖面视图" ? ($(), W("div", vs, [
1427
+ P("div", bs, [
1428
+ P("label", ws, [
1429
+ re(P("input", {
1422
1430
  type: "radio",
1423
1431
  name: "clipping-axis",
1424
1432
  value: "none",
@@ -1427,10 +1435,10 @@ const Nt = { class: "panel-content" }, Ut = {
1427
1435
  }, null, 544), [
1428
1436
  [_e, V(I)]
1429
1437
  ]),
1430
- r[16] || (r[16] = w("span", { class: "radio-text" }, "无切割", -1))
1438
+ r[16] || (r[16] = P("span", { class: "radio-text" }, "无切割", -1))
1431
1439
  ]),
1432
- w("label", Ps, [
1433
- re(w("input", {
1440
+ P("label", Ps, [
1441
+ re(P("input", {
1434
1442
  type: "radio",
1435
1443
  name: "clipping-axis",
1436
1444
  value: "x",
@@ -1439,10 +1447,10 @@ const Nt = { class: "panel-content" }, Ut = {
1439
1447
  }, null, 544), [
1440
1448
  [_e, V(I)]
1441
1449
  ]),
1442
- r[17] || (r[17] = w("span", { class: "radio-text" }, "X轴切割", -1))
1450
+ r[17] || (r[17] = P("span", { class: "radio-text" }, "X轴切割", -1))
1443
1451
  ]),
1444
- w("label", Ms, [
1445
- re(w("input", {
1452
+ P("label", Ms, [
1453
+ re(P("input", {
1446
1454
  type: "radio",
1447
1455
  name: "clipping-axis",
1448
1456
  value: "y",
@@ -1451,10 +1459,10 @@ const Nt = { class: "panel-content" }, Ut = {
1451
1459
  }, null, 544), [
1452
1460
  [_e, V(I)]
1453
1461
  ]),
1454
- r[18] || (r[18] = w("span", { class: "radio-text" }, "Y轴切割", -1))
1462
+ r[18] || (r[18] = P("span", { class: "radio-text" }, "Y轴切割", -1))
1455
1463
  ]),
1456
- w("label", xs, [
1457
- re(w("input", {
1464
+ P("label", xs, [
1465
+ re(P("input", {
1458
1466
  type: "radio",
1459
1467
  name: "clipping-axis",
1460
1468
  value: "z",
@@ -1463,7 +1471,7 @@ const Nt = { class: "panel-content" }, Ut = {
1463
1471
  }, null, 544), [
1464
1472
  [_e, V(I)]
1465
1473
  ]),
1466
- r[19] || (r[19] = w("span", { class: "radio-text" }, "Z轴切割", -1))
1474
+ r[19] || (r[19] = P("span", { class: "radio-text" }, "Z轴切割", -1))
1467
1475
  ])
1468
1476
  ])
1469
1477
  ])) : be("", !0)
@@ -1473,10 +1481,10 @@ const Nt = { class: "panel-content" }, Ut = {
1473
1481
  ], 512), [
1474
1482
  [ge, N.value]
1475
1483
  ]),
1476
- re(w("div", Es, [
1477
- w("div", Ds, [
1478
- w("span", null, ne(T.value), 1),
1479
- w("span", {
1484
+ re(P("div", Es, [
1485
+ P("div", Ds, [
1486
+ P("span", null, ne(T.value), 1),
1487
+ P("span", {
1480
1488
  class: "close",
1481
1489
  onClick: r[15] || (r[15] = (C) => c.value = !1)
1482
1490
  }, " X ")
@@ -1503,9 +1511,9 @@ const Nt = { class: "panel-content" }, Ut = {
1503
1511
  ], 512), [
1504
1512
  [ge, c.value]
1505
1513
  ]),
1506
- D.value ? (B(), W("div", Ts, [
1507
- r[20] || (r[20] = w("div", { class: "loading-spinner" }, null, -1)),
1508
- w("p", null, ne(x.value), 1)
1514
+ D.value ? ($(), W("div", Ts, [
1515
+ r[20] || (r[20] = P("div", { class: "loading-spinner" }, null, -1)),
1516
+ P("p", null, ne(x.value), 1)
1509
1517
  ])) : be("", !0)
1510
1518
  ]);
1511
1519
  };