@realsee/dnalogel 3.48.6 → 3.49.0

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,155 +1,149 @@
1
- var v = Object.defineProperty;
2
- var w = (u, h, n) => h in u ? v(u, h, { enumerable: !0, configurable: !0, writable: !0, value: n }) : u[h] = n;
3
- var d = (u, h, n) => (w(u, typeof h != "symbol" ? h + "" : h, n), n);
4
- import { BaseController as C } from "../Base/BaseController.js";
5
- import * as a from "three";
6
- import { getMouseRaycaster as D } from "../utils/getMouseRaycaster.js";
7
- import { setObjectQuaternion as O } from "../utils/setObjectQuaternion.js";
8
- import { rad2Deg as k } from "../../math/rad2Deg.js";
1
+ var j = Object.defineProperty;
2
+ var w = (g, h, t) => h in g ? j(g, h, { enumerable: !0, configurable: !0, writable: !0, value: t }) : g[h] = t;
3
+ var d = (g, h, t) => (w(g, typeof h != "symbol" ? h + "" : h, t), t);
4
+ import { BaseController as D } from "../Base/BaseController.js";
5
+ import * as c from "three";
6
+ import { getMouseRaycaster as O } from "../utils/getMouseRaycaster.js";
7
+ import { setObjectQuaternion as C } from "../utils/setObjectQuaternion.js";
8
+ import { rad2Deg as L } from "../../math/rad2Deg.js";
9
9
  import { deg2Rad as f } from "../../math/deg2Rad.js";
10
- const y = new a.Quaternion();
11
- class P extends C {
12
- constructor(...n) {
13
- var l, c, m;
14
- super(...n);
10
+ const y = new c.Quaternion();
11
+ class x extends D {
12
+ constructor(...t) {
13
+ var l, a, m;
14
+ super(...t);
15
15
  d(this, "name", "RotateController");
16
16
  d(this, "startInfo");
17
17
  d(this, "removeListener");
18
- const e = this.helperObject3D;
19
- this.hoverListener([(l = e.xCircle) == null ? void 0 : l.circle, (c = e.yCircle) == null ? void 0 : c.circle, (m = e.zCircle) == null ? void 0 : m.circle].filter(Boolean));
20
- const t = this.dragStart.bind(this), i = this.dragging.bind(this), s = this.dragEnd.bind(this), r = this.show.bind(this), o = this.hide.bind(this);
21
- this.domEvents.addEventListener(this.helperObject3D, "mousedown", t), document.addEventListener("mousemove", i), document.addEventListener("mouseup", s), this.hooks.on("moveStart", o), this.hooks.on("moveEnd", r), this.hooks.on("scaleStart", o), this.hooks.on("scaleEnd", r), this.hooks.on("moveByMouseEnable", o), this.hooks.on("moveByMouseDisable", r), this.removeListener = () => {
22
- this.domEvents.removeEventListener(this.helperObject3D, "mousedown", t), document.removeEventListener("mousemove", i), document.removeEventListener("mouseup", s), this.hooks.off("moveStart", o), this.hooks.off("moveEnd", r), this.hooks.off("scaleStart", o), this.hooks.off("scaleEnd", r), this.hooks.off("moveByMouseEnable", o), this.hooks.off("moveByMouseDisable", r);
23
- };
18
+ const n = this.helperObject3D;
19
+ this.hoverListener([(l = n.xCircle) == null ? void 0 : l.circle, (a = n.yCircle) == null ? void 0 : a.circle, (m = n.zCircle) == null ? void 0 : m.circle].filter(Boolean));
20
+ const e = this.dragStart.bind(this), o = this.dragging.bind(this), s = this.dragEnd.bind(this), i = this.show.bind(this), r = this.hide.bind(this);
21
+ this.domEvents.addEventListener(this.helperObject3D, "mousedown", e), document.addEventListener("mousemove", o), document.addEventListener("mouseup", s), this.domEvents.addEventListener(this.helperObject3D, "touchstart", e), document.addEventListener("touchmove", o), document.addEventListener("touchend", s), this.hooks.on("moveStart", r), this.hooks.on("moveEnd", i), this.hooks.on("scaleStart", r), this.hooks.on("scaleEnd", i), this.hooks.on("moveByMouseEnable", r), this.hooks.on("moveByMouseDisable", i), this.disposers.push(() => {
22
+ this.domEvents.removeEventListener(this.helperObject3D, "mousedown", e), document.removeEventListener("mousemove", o), document.removeEventListener("mouseup", s), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", e), document.removeEventListener("touchmove", o), document.removeEventListener("touchend", s), this.hooks.off("moveStart", r), this.hooks.off("moveEnd", i), this.hooks.off("scaleStart", r), this.hooks.off("scaleEnd", i), this.hooks.off("moveByMouseEnable", r), this.hooks.off("moveByMouseDisable", i);
23
+ });
24
24
  }
25
25
  get rotateCenter() {
26
26
  return this.helperObject3D.position.clone();
27
27
  }
28
- // public initialHelperQuaternion() {
29
- // this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)
30
- // }
31
- setRotateAngle(n) {
32
- const { x: e = 0, y: t = 0, z: i = 0 } = n, s = new a.Euler(f(e), f(t), f(i)), r = new a.Quaternion().setFromEuler(s);
33
- if (this.hooks.emit("wantToRotate", r))
28
+ setRotateAngle(t) {
29
+ const { x: n = 0, y: e = 0, z: o = 0 } = t, s = new c.Euler(f(n), f(e), f(o)), i = new c.Quaternion().setFromEuler(s);
30
+ if (this.hooks.emit("wantToRotate", i))
34
31
  return;
35
- const { originObject3D: l, rotateCenter: c } = this;
36
- O(l, r, c), this.internalHooks.emit("setObjectRotate", r, c), this.hooks.emit("rotate", r), this.render();
32
+ const { originObject3D: l, rotateCenter: a } = this;
33
+ C(l, i, a), this.internalHooks.emit("setObjectRotate", i, a), this.hooks.emit("rotate", i), this.render();
37
34
  }
38
- dispose() {
39
- this.removeListener(), super.dispose();
35
+ onApplyOriginObjectRotate(t) {
36
+ this.isDragging || super.onApplyOriginObjectRotate(t);
40
37
  }
41
- onApplyOriginObjectRotate(n) {
42
- this.isDragging || super.onApplyOriginObjectRotate(n);
43
- }
44
- onApplyOriginObjectScale(n) {
38
+ onApplyOriginObjectScale(t) {
45
39
  }
46
40
  /**
47
41
  * @description: 拖动开始,找出拖的Direction
48
42
  */
49
- dragStart(n) {
43
+ dragStart(t) {
50
44
  if (this.isDragging)
51
45
  return;
52
- const e = n == null ? void 0 : n.intersect;
53
- if (!e)
46
+ const n = t == null ? void 0 : t.intersect;
47
+ if (!n)
54
48
  return this.dragEnd();
55
- const t = (e == null ? void 0 : e.object).direction;
56
- if (!t)
49
+ const e = (n == null ? void 0 : n.object).direction;
50
+ if (!e)
57
51
  return this.dragEnd();
58
- const i = e.point, s = this.getAngleHelper(t);
52
+ const o = n.point, s = this.getAngleHelper(e);
59
53
  this.setTipsAngle(0);
60
- const r = i.clone();
61
- r.y += 0.2, this.setTipsPosition(r);
62
- const o = this.helperObject3D.quaternion.clone(), l = (() => {
63
- if (t === "x")
64
- return new a.Vector3(1, 0, 0).applyQuaternion(o);
65
- if (t === "y")
66
- return new a.Vector3(0, 1, 0).applyQuaternion(o);
67
- if (t === "z")
68
- return new a.Vector3(0, 0, 1).applyQuaternion(o);
69
- })(), c = new a.Plane().setFromNormalAndCoplanarPoint(l, i), p = c.projectPoint(i.clone(), new a.Vector3()).clone().sub(this.rotateCenter), g = p.angleTo(s.baseAxes.clone().applyQuaternion(o));
70
- this.setAngleHelperStart(t, g), this.setAngleHelperLength(t, 0), this.startInfo = { direction: t, startVector: p, plane: c, angleHelper: s, angle: 0, helperQuaternion: o.clone() }, y.copy(o), this.helperObject3D.showDraggingHelper([t]), this.hooks.emit("rotateStart"), this.isDragging = !0;
54
+ const i = o.clone();
55
+ i.y += 0.2, this.setTipsPosition(i);
56
+ const r = this.helperObject3D.quaternion.clone(), l = (() => {
57
+ if (e === "x")
58
+ return new c.Vector3(1, 0, 0).applyQuaternion(r);
59
+ if (e === "y")
60
+ return new c.Vector3(0, 1, 0).applyQuaternion(r);
61
+ if (e === "z")
62
+ return new c.Vector3(0, 0, 1).applyQuaternion(r);
63
+ })(), a = new c.Plane().setFromNormalAndCoplanarPoint(l, o), p = a.projectPoint(o.clone(), new c.Vector3()).clone().sub(this.rotateCenter), u = p.angleTo(s.baseAxes.clone().applyQuaternion(r));
64
+ this.setAngleHelperStart(e, u), this.setAngleHelperLength(e, 0), this.startInfo = { direction: e, startVector: p, plane: a, angleHelper: s, angle: 0, helperQuaternion: r.clone() }, y.copy(r), this.helperObject3D.showDraggingHelper([e]), this.hooks.emit("rotateStart"), this.isDragging = !0;
71
65
  }
72
- dragging(n) {
66
+ dragging(t) {
73
67
  if (!this.isDragging)
74
68
  return;
75
- const e = D(this.camera, n, this.container);
76
- return e ? (this.rotate(e), !1) : this.dragEnd();
69
+ const n = "touches" in t ? t.touches[0].clientX : t.x, e = "touches" in t ? t.touches[0].clientY : t.y, o = O(this.camera, { x: n, y: e }, this.container);
70
+ return o ? (this.rotate(o), !1) : this.dragEnd();
77
71
  }
78
- rotate(n) {
72
+ rotate(t) {
79
73
  if (!this.startInfo)
80
74
  return this.dragEnd();
81
- const { startVector: e, plane: t, angleHelper: i, direction: s, helperQuaternion: r } = this.startInfo, { originObject3D: o } = this, l = n.ray.intersectPlane(t, new a.Vector3());
75
+ const { startVector: n, plane: e, angleHelper: o, direction: s, helperQuaternion: i } = this.startInfo, { originObject3D: r } = this, l = t.ray.intersectPlane(e, new c.Vector3());
82
76
  if (!l)
83
77
  return;
84
- const c = this.rotateCenter.clone(), p = t.projectPoint(l.clone(), new a.Vector3()).clone().sub(c);
85
- if (e.angleTo(p) === 0)
78
+ const a = this.rotateCenter.clone(), p = e.projectPoint(l.clone(), new c.Vector3()).clone().sub(a);
79
+ if (n.angleTo(p) === 0)
86
80
  return;
87
- const g = new a.Quaternion().setFromUnitVectors(e.clone().normalize(), p.clone().normalize()), b = o.quaternion.clone().premultiply(g);
88
- if (this.hooks.emit("wantToRotate", b))
81
+ const u = new c.Quaternion().setFromUnitVectors(n.clone().normalize(), p.clone().normalize()), v = r.quaternion.clone().premultiply(u);
82
+ if (this.hooks.emit("wantToRotate", v))
89
83
  return;
90
- const E = new a.Euler().setFromQuaternion(
91
- new a.Quaternion().setFromUnitVectors(
92
- e.clone().normalize().applyQuaternion(r.clone().inverse()),
93
- p.clone().normalize().applyQuaternion(r.clone().inverse())
84
+ const E = new c.Euler().setFromQuaternion(
85
+ new c.Quaternion().setFromUnitVectors(
86
+ n.clone().normalize().applyQuaternion(i.clone().inverse()),
87
+ p.clone().normalize().applyQuaternion(i.clone().inverse())
94
88
  ),
95
89
  `${s.toUpperCase()}${"XZY".replace(s.toUpperCase(), "")}`
96
- )[s] * i.angleDirection;
97
- if (this.startInfo.angle += E, this.setAngleHelperLength(s, this.startInfo.angle), this.setTipsAngle(k(this.startInfo.angle)), c) {
98
- const j = new a.Vector3().subVectors(o.position, c).applyQuaternion(g).add(c);
99
- o.position.copy(j);
90
+ )[s] * o.angleDirection;
91
+ if (this.startInfo.angle += E, this.setAngleHelperLength(s, this.startInfo.angle), this.setTipsAngle(L(this.startInfo.angle)), a) {
92
+ const b = new c.Vector3().subVectors(r.position, a).applyQuaternion(u).add(a);
93
+ r.position.copy(b);
100
94
  }
101
- o.applyQuaternion(g), y.premultiply(g), this.internalHooks.emit("applyObjectRotate", { quaternion: g, origin: c }), this.hooks.emit("rotate", o.quaternion), this.startInfo.startVector = p;
95
+ r.applyQuaternion(u), y.premultiply(u), this.internalHooks.emit("applyObjectRotate", { quaternion: u, origin: a }), this.hooks.emit("rotate", r.quaternion), this.startInfo.startVector = p;
102
96
  }
103
97
  dragEnd() {
104
98
  this.isDragging && (this.internalHooks.emit("setObjectRotate", y, this.rotateCenter), this.startInfo = void 0, this.isDragging = !1, this.helperObject3D.show(), this.hooks.emit("rotateEnd"));
105
99
  }
106
- getAngleHelper(n) {
107
- var e, t, i;
108
- switch (n) {
100
+ getAngleHelper(t) {
101
+ var n, e, o;
102
+ switch (t) {
109
103
  case "x":
110
- return (e = this.helperObject3D.xCircle) == null ? void 0 : e.angleSector;
104
+ return (n = this.helperObject3D.xCircle) == null ? void 0 : n.angleSector;
111
105
  case "y":
112
- return (t = this.helperObject3D.yCircle) == null ? void 0 : t.angleSector;
106
+ return (e = this.helperObject3D.yCircle) == null ? void 0 : e.angleSector;
113
107
  case "z":
114
- return (i = this.helperObject3D.zCircle) == null ? void 0 : i.angleSector;
108
+ return (o = this.helperObject3D.zCircle) == null ? void 0 : o.angleSector;
115
109
  }
116
110
  }
117
- setAngleHelperStart(n, e) {
118
- const t = this.getAngleHelper(n);
119
- if (!t) {
111
+ setAngleHelperStart(t, n) {
112
+ const e = this.getAngleHelper(t);
113
+ if (!e) {
120
114
  console.warn("angleHelper is undefined");
121
115
  return;
122
116
  }
123
- if (t instanceof a.Mesh && t.geometry instanceof a.CircleGeometry) {
124
- const { radius: i, segments: s, thetaLength: r } = t.geometry.parameters;
125
- t.geometry = new a.CircleGeometry(i, s, e, r);
117
+ if (e instanceof c.Mesh && e.geometry instanceof c.CircleGeometry) {
118
+ const { radius: o, segments: s, thetaLength: i } = e.geometry.parameters;
119
+ e.geometry = new c.CircleGeometry(o, s, n, i);
126
120
  } else
127
121
  console.warn("only support THREE.CircleGeometry");
128
122
  }
129
- setAngleHelperLength(n, e) {
130
- const i = e >= 0 ? Math.max(e, 1e-3) : Math.min(e, -1e-3), s = this.getAngleHelper(n);
131
- if (s instanceof a.Mesh && s.geometry instanceof a.CircleGeometry) {
132
- const { radius: r, thetaStart: o } = s.geometry.parameters, l = Math.ceil(Math.abs(i) * (40 / (2 * Math.PI)));
133
- s.geometry = new a.CircleGeometry(r, l, o, i);
123
+ setAngleHelperLength(t, n) {
124
+ const o = n >= 0 ? Math.max(n, 1e-3) : Math.min(n, -1e-3), s = this.getAngleHelper(t);
125
+ if (s instanceof c.Mesh && s.geometry instanceof c.CircleGeometry) {
126
+ const { radius: i, thetaStart: r } = s.geometry.parameters, l = Math.ceil(Math.abs(o) * (40 / (2 * Math.PI)));
127
+ s.geometry = new c.CircleGeometry(i, l, r, o);
134
128
  } else
135
129
  console.warn("only support THREE.CircleGeometry");
136
130
  }
137
- setTipsAngle(n) {
138
- var t;
139
- const e = (t = this.helperObject3D.angleTips) == null ? void 0 : t.element;
140
- e && (e.innerText = `${n.toFixed(0)}°`);
131
+ setTipsAngle(t) {
132
+ var e;
133
+ const n = (e = this.helperObject3D.angleTips) == null ? void 0 : e.element;
134
+ n && (n.innerText = `${t.toFixed(0)}°`);
141
135
  }
142
- setTipsPosition(n) {
143
- const e = this.helperObject3D.angleTips;
144
- if (!e)
136
+ setTipsPosition(t) {
137
+ const n = this.helperObject3D.angleTips;
138
+ if (!n)
145
139
  return;
146
- const t = n.project(this.camera), { x: i, y: s, z: r } = t;
147
- if (r > 1)
140
+ const e = t.project(this.camera), { x: o, y: s, z: i } = e;
141
+ if (i > 1)
148
142
  return;
149
- const o = (i + 1) / 2 * 100 + "%", l = (-s + 1) / 2 * 100 + "%";
150
- e.setLeftTop(o, l);
143
+ const r = (o + 1) / 2 * 100 + "%", l = (-s + 1) / 2 * 100 + "%";
144
+ n.setLeftTop(r, l);
151
145
  }
152
146
  }
153
147
  export {
154
- P as RotateController
148
+ x as RotateController
155
149
  };
@@ -13,7 +13,7 @@ export declare class ScaleController<T extends ScaleHelperAbstract = ScaleHelper
13
13
  dragging: (point: {
14
14
  x: number;
15
15
  y: number;
16
- }) => false | void;
16
+ } | TouchEvent) => false | void;
17
17
  setScale(scale: number | {
18
18
  x?: number;
19
19
  y?: number;
@@ -1,45 +1,48 @@
1
- var p = Object.defineProperty;
2
- var u = (h, r, t) => r in h ? p(h, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[r] = t;
3
- var l = (h, r, t) => (u(h, typeof r != "symbol" ? r + "" : r, t), t);
4
- import { BaseController as b } from "../Base/BaseController.js";
5
- import * as g from "three";
6
- import { getMouseRaycaster as P } from "../utils/getMouseRaycaster.js";
7
- import { rayOnLine as f } from "../../../Sculpt/utils/three/rayOnLine.js";
8
- class H extends b {
1
+ var f = Object.defineProperty;
2
+ var v = (d, a, t) => a in d ? f(d, a, { enumerable: !0, configurable: !0, writable: !0, value: t }) : d[a] = t;
3
+ var c = (d, a, t) => (v(d, typeof a != "symbol" ? a + "" : a, t), t);
4
+ import { BaseController as p } from "../Base/BaseController.js";
5
+ import * as m from "three";
6
+ import { getMouseRaycaster as E } from "../utils/getMouseRaycaster.js";
7
+ import { rayOnLine as g } from "../../../Sculpt/utils/three/rayOnLine.js";
8
+ class S extends p {
9
9
  constructor(...t) {
10
10
  super(...t);
11
- l(this, "name", "ScaleController");
12
- l(this, "startInfo");
13
- l(this, "dragStart", (t) => {
11
+ c(this, "name", "ScaleController");
12
+ c(this, "startInfo");
13
+ c(this, "dragStart", (t) => {
14
14
  if (this.isDragging)
15
15
  return;
16
16
  this.isDragging = !0;
17
- const { intersect: e } = t, a = this.camera.position, o = e.object, i = o.scalePosition.basePosition.clone(), s = o.scalePosition.handlePosition.clone().clone().sub(i).clone(), n = new g.Line3(i, i.clone().add(s.normalize().multiplyScalar(5)));
17
+ const { intersect: e } = t, o = this.camera.position, s = e.object, i = s.scalePosition.basePosition.clone(), r = s.scalePosition.handlePosition.clone().clone().sub(i).clone(), n = new m.Line3(i, i.clone().add(r.normalize().multiplyScalar(5)));
18
18
  n.applyMatrix4(this.helperObject3D.matrixWorld);
19
- const c = new g.Raycaster(a, e.point.clone().sub(a)), m = f({ raycaster: c, line: n });
20
- this.startInfo = { line: n, scaleStartPoint: m, draggingObject: o }, this.hooks.emit("scaleStart");
19
+ const h = new m.Raycaster(o, e.point.clone().sub(o)), u = g({ raycaster: h, line: n });
20
+ this.startInfo = { line: n, scaleStartPoint: u, draggingObject: s }, this.hooks.emit("scaleStart");
21
21
  });
22
- l(this, "dragging", (t) => {
22
+ c(this, "dragging", (t) => {
23
23
  if (!this.isDragging || !this.startInfo)
24
24
  return;
25
- const e = P(this.camera, t, this.container);
26
- return e ? (this.scale(e), !1) : this.dragEnd();
25
+ const e = "touches" in t ? t.touches[0].clientX : t.x, o = "touches" in t ? t.touches[0].clientY : t.y, s = E(this.camera, { x: e, y: o }, this.container);
26
+ return s ? (this.scale(s), !1) : this.dragEnd();
27
27
  });
28
- l(this, "scale", (t) => {
29
- var n, c;
28
+ c(this, "scale", (t) => {
29
+ var n, h;
30
30
  if (!this.startInfo)
31
31
  return;
32
- const { line: e, scaleStartPoint: a, draggingObject: o } = this.startInfo, { scalePosition: i } = o, { basePosition: d } = i, s = f({ raycaster: t, line: e });
33
- s.applyMatrix4(new g.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (c = (n = this.config) == null ? void 0 : n.scaleCallback) == null || c.call(n, {
34
- ratio: s.distanceTo(d) / a.distanceTo(d),
35
- intersectPoint: s,
32
+ const { line: e, scaleStartPoint: o, draggingObject: s } = this.startInfo, { scalePosition: i } = s, { basePosition: l } = i, r = g({ raycaster: t, line: e });
33
+ r.applyMatrix4(new m.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (h = (n = this.config) == null ? void 0 : n.scaleCallback) == null || h.call(n, {
34
+ ratio: r.distanceTo(l) / o.distanceTo(l),
35
+ intersectPoint: r,
36
36
  scalePosition: i
37
- }), o.position.copy(s.clone());
37
+ }), s.position.copy(r.clone());
38
38
  });
39
- l(this, "dragEnd", () => {
39
+ c(this, "dragEnd", () => {
40
40
  this.isDragging && (this.startInfo = void 0, this.isDragging = !1, this.internalHooks.emit("initialHelperPosition"), this.hooks.emit("scaleEnd"));
41
41
  });
42
- this.domEvents.addEventListener(this.helperObject3D, "mousedown", this.dragStart), document.addEventListener("mousemove", this.dragging), document.addEventListener("mouseup", this.dragEnd);
42
+ const e = this.show.bind(this), o = this.hide.bind(this);
43
+ this.domEvents.addEventListener(this.helperObject3D, "mousedown", this.dragStart), document.addEventListener("mousemove", this.dragging), document.addEventListener("mouseup", this.dragEnd), this.domEvents.addEventListener(this.helperObject3D, "touchstart", this.dragStart), document.addEventListener("touchmove", this.dragging), document.addEventListener("touchend", this.dragEnd), this.hooks.on("rotateStart", o), this.hooks.on("rotateEnd", e), this.hooks.on("moveStart", o), this.hooks.on("moveEnd", e), this.hooks.on("moveByMouseEnable", o), this.hooks.on("moveByMouseDisable", e), this.disposers.push(() => {
44
+ this.domEvents.removeEventListener(this.helperObject3D, "mousedown", this.dragStart), document.removeEventListener("mousemove", this.dragging), document.removeEventListener("mouseup", this.dragEnd), this.domEvents.removeEventListener(this.helperObject3D, "touchstart", this.dragStart), document.removeEventListener("touchmove", this.dragging), document.removeEventListener("touchend", this.dragEnd), this.hooks.off("rotateStart", o), this.hooks.off("rotateEnd", e), this.hooks.off("moveStart", o), this.hooks.off("moveEnd", e), this.hooks.off("moveByMouseEnable", o), this.hooks.off("moveByMouseDisable", e);
45
+ });
43
46
  }
44
47
  initialHelperQuaternion() {
45
48
  this.helperObject3D.initQuaternion();
@@ -50,13 +53,13 @@ class H extends b {
50
53
  t.offHoverListener && t.offHoverListener(), t.offHoverListener = this.hoverListener(this.helperObject3D.scaleMeshes);
51
54
  }
52
55
  setScale(t) {
53
- var s, n, c;
54
- let e = 1, a = 1, o = 1;
55
- typeof t == "number" ? (e = t, a = t, o = t) : typeof t == "object" && (e = (s = t.x) != null ? s : 1, a = (n = t.y) != null ? n : 1, o = (c = t.z) != null ? c : 1);
56
- const i = new g.Vector3(e, a, o);
56
+ var r, n, h;
57
+ let e = 1, o = 1, s = 1;
58
+ typeof t == "number" ? (e = t, o = t, s = t) : typeof t == "object" && (e = (r = t.x) != null ? r : 1, o = (n = t.y) != null ? n : 1, s = (h = t.z) != null ? h : 1);
59
+ const i = new m.Vector3(e, o, s);
57
60
  this.hooks.emit("wantToScale", i) || (this.originObject3D.scale.copy(i), this.internalHooks.emit("setObjectScale", i), this.hooks.emit("scale", i), this.render());
58
61
  }
59
62
  }
60
63
  export {
61
- H as ScaleController
64
+ S as ScaleController
62
65
  };
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.48.6",
3
+ "%c %c@realsee/dnalogel %cv3.49.0",
4
4
  [
5
5
  "background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
6
6
  "background-repeat: no-repeat",
@@ -6,12 +6,13 @@ import { Subscribe } from '../../Subscribe';
6
6
  import type { LiteralString } from '../../../typings/utils.type';
7
7
  export type { PointIntersection };
8
8
  export type ActionIfNoModelUnderMouse = LiteralString<'virtualPoint' | 'lastPoint' | 'disable'>;
9
+ type PointerSelectorMode = 'fixed' | 'cursor';
9
10
  interface Config {
10
11
  /**
11
12
  * @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
12
13
  * @default: 'auto'
13
14
  */
14
- mode: 'fixed' | 'cursor' | 'auto';
15
+ mode: PointerSelectorMode | 'auto';
15
16
  /**
16
17
  * @description 当鼠标位置没有模型时的行为
17
18
  * ```markdown
@@ -1,7 +1,7 @@
1
1
  import type { Vector3 } from 'three';
2
2
  import * as THREE from 'three';
3
3
  /**
4
- * @description: 根据多边形的顶点数组生成多边形的 BufferGeometry
4
+ * @description 根据多边形的顶点数组生成多边形的 BufferGeometry
5
5
  * @param checkLinesIntersect 检查多边形边线是否相交,需要保证传入的顶点是有序的
6
6
  */
7
7
  export default function generatePolygonGeometry(_points: Vector3[], config?: {
@@ -1,23 +1,21 @@
1
1
  import * as i from "three";
2
- import { earcut3D as c } from "./earcut3D.js";
2
+ import { earcut3D as f } from "./earcut3D.js";
3
3
  import { isIntersecting as m } from "../../PanoMeasurePlugin/utils/isIntersecting.js";
4
4
  function h(a, s) {
5
5
  const t = [...new Set(a)];
6
6
  if (t.length < 3)
7
7
  return;
8
8
  if (t.at(-1).equals(t[0]) || t.push(t[0]), s != null && s.checkLinesIntersect && t.length >= 5) {
9
- const e = t.map((r, n) => {
10
- if (n !== 0)
11
- return { start: t[n - 1], end: t[n] };
9
+ const e = t.map((r, o) => {
10
+ if (o !== 0)
11
+ return { start: t[o - 1], end: t[o] };
12
12
  }).filter(Boolean);
13
- for (let r = 0; r < e.length; r++) {
14
- const n = m(e[r], e.slice(r));
15
- if (n && console.log("多边形边线相交", r, t), n)
13
+ for (let r = 0; r < e.length; r++)
14
+ if (m(e[r], e.slice(r)))
16
15
  return;
17
- }
18
16
  }
19
- const l = t.flatMap((e) => [e.x, e.y, e.z]), u = new i.Float32BufferAttribute(l, 3), f = c(t), o = new i.BufferGeometry();
20
- return o.setAttribute("position", u), o.setIndex(f), o.name = "PolygonGeometry", o;
17
+ const u = t.flatMap((e) => [e.x, e.y, e.z]), l = new i.Float32BufferAttribute(u, 3), c = f(t), n = new i.BufferGeometry();
18
+ return n.setAttribute("position", l), n.setIndex(c), n.name = "PolygonGeometry", n;
21
19
  }
22
20
  export {
23
21
  h as generatePolygonGeometry
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.48.6",
3
+ "version": "3.49.0",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",