@realsee/dnalogel 3.73.4 → 3.73.5

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.
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.73.4");
26
+ r(this, "VERSION", "3.73.5");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -1,16 +1,16 @@
1
- var S = Object.defineProperty;
2
- var G = (f, m, e) => m in f ? S(f, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : f[m] = e;
3
- var g = (f, m, e) => (G(f, typeof m != "symbol" ? m + "" : m, e), e);
4
- import { BaseController as A } from "../Base/BaseController.js";
5
- import { RENDER_ORDER as L } from "../Constants/RenderOrder.js";
1
+ var C = Object.defineProperty;
2
+ var S = (v, m, e) => m in v ? C(v, m, { enumerable: !0, configurable: !0, writable: !0, value: e }) : v[m] = e;
3
+ var g = (v, m, e) => (S(v, typeof m != "symbol" ? m + "" : m, e), e);
4
+ import { BaseController as G } from "../Base/BaseController.js";
5
+ import { RENDER_ORDER as E } from "../Constants/RenderOrder.js";
6
6
  import * as c from "three";
7
- import { getMouseRaycaster as k } from "../utils/getMouseRaycaster.js";
8
- import { SolidGuideLine as H } from "../utils/solidGuide.js";
9
- import { rayOnLine as w } from "../../../Sculpt/utils/three/rayOnLine.js";
7
+ import { getMouseRaycaster as A } from "../utils/getMouseRaycaster.js";
8
+ import { SolidGuideLine as k } from "../utils/solidGuide.js";
9
+ import { rayOnLine as P } from "../../../Sculpt/utils/three/rayOnLine.js";
10
10
  import { worldBoundingBox as I } from "../../three/boundingBox.js";
11
- import { getNormal as z } from "../../three/getNormal.js";
12
- var F, x;
13
- class Y extends A {
11
+ import { getNormal as H } from "../../three/getNormal.js";
12
+ var L, w;
13
+ class Y extends G {
14
14
  constructor(...e) {
15
15
  super(...e);
16
16
  g(this, "name", "ScaleController");
@@ -18,7 +18,7 @@ class Y extends A {
18
18
  g(this, "dragGuideLine");
19
19
  /** 当前拖拽时显示的面片 */
20
20
  g(this, "currentFacePatch");
21
- g(this, "solidGuide", new H(this.camera, this.container, (x = (F = this.config) == null ? void 0 : F.solidGuide) != null ? x : {}));
21
+ g(this, "solidGuide", new k(this.camera, this.container, (w = (L = this.config) == null ? void 0 : L.solidGuide) != null ? w : {}));
22
22
  g(this, "startInfo");
23
23
  g(this, "dragStart", (e) => {
24
24
  if (this.isDragging)
@@ -30,20 +30,20 @@ class Y extends A {
30
30
  i = i.parent;
31
31
  const n = i, o = n.scalePosition.basePosition.clone(), h = n.scalePosition.handlePosition.clone(), l = h.clone().sub(o).clone(), a = new c.Line3(o, o.clone().add(l.normalize().multiplyScalar(5)));
32
32
  a.applyMatrix4(this.helperObject3D.matrixWorld);
33
- const d = new c.Raycaster(r, t.point.clone().sub(r)), p = w({ raycaster: d, line: a });
33
+ const d = new c.Raycaster(r, t.point.clone().sub(r)), p = P({ raycaster: d, line: a });
34
34
  this.startInfo = { line: a, scaleStartPoint: p, draggingObject: n }, this.helperObject3D.scaleMeshes.forEach((u) => {
35
35
  u.uuid !== n.uuid && (u.visible = !1);
36
36
  }), "hideLineConnections" in this.helperObject3D && typeof this.helperObject3D.hideLineConnections == "function" && this.helperObject3D.hideLineConnections();
37
37
  try {
38
38
  this.originObject3D.updateMatrixWorld(!0), this.helperObject3D.updateMatrixWorld(!0);
39
- const u = this.getObjectWorldCenter(), y = h.clone().applyMatrix4(this.helperObject3D.matrixWorld).clone().sub(u).normalize(), v = u, D = this.solidGuide.createSolidLine(v, y, { color: 16777215, renderOrder: L.DRAG_GUIDE_LINE });
40
- this.isRectangleWithEdgeMesh() || this.scene.add(D), this.dragGuideLine = D, this.addFaceMesh();
39
+ const u = this.getObjectWorldCenter(), M = h.clone().applyMatrix4(this.helperObject3D.matrixWorld).clone().sub(u).normalize(), b = u, y = this.solidGuide.createSolidLine(b, M, { color: 16777215, renderOrder: E.DRAG_GUIDE_LINE });
40
+ this.isRectangleWithEdgeMesh() || this.scene.add(y), this.dragGuideLine = y, this.addFaceMesh();
41
41
  } catch (u) {
42
42
  }
43
43
  n.visible = !0, this.hooks.emit("scaleStart");
44
44
  });
45
45
  g(this, "dragging", (e) => {
46
- const t = "touches" in e ? e.touches[0].clientX : e.x, r = "touches" in e ? e.touches[0].clientY : e.y, s = k(this.camera, { x: t, y: r }, this.container), i = this.isMoveControllerDragging();
46
+ const t = "touches" in e ? e.touches[0].clientX : e.x, r = "touches" in e ? e.touches[0].clientY : e.y, s = A(this.camera, { x: t, y: r }, this.container), i = this.isMoveControllerDragging();
47
47
  if (!this.isDragging && !i && s) {
48
48
  this.addHoverFaceMesh(s);
49
49
  return;
@@ -61,26 +61,34 @@ class Y extends A {
61
61
  const d = this.originObject3D, u = d.geometry.attributes.position;
62
62
  if (!u)
63
63
  return [];
64
- const b = [], y = u.count;
65
- for (let M = 0; M < y; M++) {
66
- const E = new c.Vector3().fromBufferAttribute(u, M);
67
- d.updateMatrixWorld(!0), E.applyMatrix4(d.matrixWorld), b.push(E);
64
+ const D = [], M = u.count;
65
+ for (let f = 0; f < M; f++) {
66
+ const j = new c.Vector3().fromBufferAttribute(u, f);
67
+ d.updateMatrixWorld(!0), j.applyMatrix4(d.matrixWorld), D.push(j);
68
68
  }
69
- const v = b.slice(0, 4);
70
- if (!v || v.length < 4)
69
+ const b = D.slice(0, 4);
70
+ if (!b || b.length < 4)
71
71
  return;
72
- const D = z(v).normalize(), W = new c.Plane().setFromNormalAndCoplanarPoint(D, v[0]), O = new c.Vector3();
73
- if (e.ray.intersectPlane(W, O), !O)
74
- return;
75
- const P = new c.Matrix4().getInverse(this.helperObject3D.matrixWorld), j = O.clone().applyMatrix4(P), C = r.clone().applyMatrix4(P);
72
+ const y = H(b).normalize(), x = new c.Plane().setFromNormalAndCoplanarPoint(y, b[0]), F = Math.abs(e.ray.direction.dot(y)) < 0.1;
73
+ let O;
74
+ if (F)
75
+ O = P({ raycaster: e, line: t, clampToLine: !1 }).applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone()));
76
+ else {
77
+ const f = new c.Vector3();
78
+ if (e.ray.intersectPlane(x, f), !f)
79
+ return;
80
+ const j = new c.Matrix4().getInverse(this.helperObject3D.matrixWorld);
81
+ O = f.clone().applyMatrix4(j);
82
+ }
83
+ const W = r.clone().applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld));
76
84
  (h = (o = this.config) == null ? void 0 : o.scaleCallback) == null || h.call(o, {
77
- intersectPoint: j,
85
+ intersectPoint: O,
78
86
  scalePosition: i,
79
- offset: j.clone().sub(C)
80
- }), s.position.copy(j), this.hooks.emit("scale", new c.Vector3(1, 1, 1));
87
+ offset: O.clone().sub(W)
88
+ }), s.position.copy(O), this.hooks.emit("scale", new c.Vector3(1, 1, 1));
81
89
  return;
82
90
  }
83
- const n = w({ raycaster: e, line: t, clampToLine: !1 });
91
+ const n = P({ raycaster: e, line: t, clampToLine: !1 });
84
92
  n.applyMatrix4(new c.Matrix4().getInverse(this.helperObject3D.matrixWorld.clone())), (a = (l = this.config) == null ? void 0 : l.scaleCallback) == null || a.call(l, {
85
93
  intersectPoint: n,
86
94
  scalePosition: i,
@@ -159,8 +167,8 @@ class Y extends A {
159
167
  if (!d.vertices || d.vertices.length < 3)
160
168
  continue;
161
169
  const p = new c.Vector3();
162
- for (const b of d.vertices)
163
- p.add(b);
170
+ for (const D of d.vertices)
171
+ p.add(D);
164
172
  p.divideScalar(d.vertices.length);
165
173
  const u = n.distanceTo(p);
166
174
  u < a && (a = u, l = d);
@@ -290,7 +298,7 @@ class Y extends A {
290
298
  transparent: !0,
291
299
  opacity: 0.45
292
300
  }), s = new c.Mesh(t, r);
293
- return s.renderOrder = L.DRAG_FACE_PATCH, this.scene.add(s), this.currentFacePatch = s, this.render(), s;
301
+ return s.renderOrder = E.DRAG_FACE_PATCH, this.scene.add(s), this.currentFacePatch = s, this.render(), s;
294
302
  }
295
303
  }
296
304
  export {
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.73.4",
3
+ "%c %c@realsee/dnalogel %cv3.73.5",
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@realsee/dnalogel",
3
- "version": "3.73.4",
3
+ "version": "3.73.5",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",