@realsee/dnalogel 3.78.0-alpha.3 → 3.78.0-alpha.4

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,9 +1,10 @@
1
- import { Euler as y, Vector3 as t, Matrix4 as a } from "three";
2
- import { centerPoint as w } from "../../shared-utils/three/centerPoint.js";
3
- import { is3DBoxTag as x, isPolygonTag as M, isMediaModelTag as d, isMaskTag as T } from "./tag/tagCheck.js";
4
- import { anyPositionToVector3 as e, vector3Position as P } from "../../shared-utils/positionToVector3.js";
5
- function z(o) {
6
- const n = e(o.start), r = e(o.end), i = new y().fromArray(o.rotation), c = new t((n.x + r.x) / 2, (n.y + r.y) / 2, (n.z + r.z) / 2), p = new t(Math.abs(r.x - n.x) / 2, Math.abs(r.y - n.y) / 2, Math.abs(r.z - n.z) / 2), m = new a().makeRotationFromEuler(i), u = [
1
+ import { Euler as y, Vector3 as t, Matrix4 as p } from "three";
2
+ import { centerPoint as x } from "../../shared-utils/three/centerPoint.js";
3
+ import { is3DBoxTag as M, isPolygonTag as d, isMediaModelTag as P, isMaskTag as T } from "./tag/tagCheck.js";
4
+ import { anyPositionToVector3 as a, vector3Position as z } from "../../shared-utils/positionToVector3.js";
5
+ import { transformPosition as A } from "../../shared-utils/five/transformPosition.js";
6
+ function h(o, i) {
7
+ const n = a(o.start), r = a(o.end), e = new y().fromArray(o.rotation), s = A(new t((n.x + r.x) / 2, (n.y + r.y) / 2, (n.z + r.z) / 2), i), m = new t(Math.abs(r.x - n.x) / 2, Math.abs(r.y - n.y) / 2, Math.abs(r.z - n.z) / 2), u = new p().makeRotationFromEuler(e), f = [
7
8
  // 底面4个点 (y = -0.5)
8
9
  new t(-0.5, -0.5, -0.5),
9
10
  new t(0.5, -0.5, -0.5),
@@ -14,40 +15,41 @@ function z(o) {
14
15
  new t(0.5, 0.5, -0.5),
15
16
  new t(0.5, 0.5, 0.5),
16
17
  new t(-0.5, 0.5, 0.5)
17
- ], f = p.clone().multiplyScalar(2);
18
- return u.map((l) => l.clone().multiply(f).applyMatrix4(m).add(c));
18
+ ], l = m.clone().multiplyScalar(2);
19
+ return f.map((w) => w.clone().multiply(l).applyMatrix4(u).add(s));
19
20
  }
20
- function s(o, n) {
21
- if (!n)
21
+ function c(o, i) {
22
+ if (!i)
22
23
  return o;
23
- const r = new a().fromArray(n);
24
- return o.map((i) => i.clone().applyMatrix4(r));
24
+ const n = new p().fromArray(i);
25
+ return o.map((r) => r.clone().applyMatrix4(n));
25
26
  }
26
- function A(o) {
27
- const n = (() => {
28
- if (x(o) && o.position) {
29
- const r = z(o.position);
30
- return s(r, o.matrix);
31
- }
27
+ function k(o) {
28
+ const i = (() => {
29
+ var n, r;
32
30
  if (M(o) && o.position) {
33
- const r = o.position.map((i) => e(i));
34
- return s(r, o.matrix);
31
+ const e = h(o.position, (r = (n = o.plugin) == null ? void 0 : n.workUtil) == null ? void 0 : r.transform);
32
+ return c(e, o.matrix);
33
+ }
34
+ if (d(o) && o.position) {
35
+ const e = o.position.map((s) => a(s));
36
+ return c(e, o.matrix);
35
37
  }
36
- if (d(o) && o.matrix) {
37
- const r = o.data.mediaPosition.map((i) => e(i));
38
- return s(r, o.matrix);
38
+ if (P(o) && o.matrix) {
39
+ const e = o.data.mediaPosition.map((s) => a(s));
40
+ return c(e, o.matrix);
39
41
  }
40
- return T(o) ? o.position && Array.isArray(o.position) ? e(o.position) : (console.warn("[getTagPosition] Mask tag without position, tag id:", o.id), new t(0, 0, 0)) : o.position;
42
+ return T(o) ? o.position && Array.isArray(o.position) ? a(o.position) : (console.warn("[getTagPosition] Mask tag without position, tag id:", o.id), new t(0, 0, 0)) : o.position;
41
43
  })();
42
- return P(n);
44
+ return z(i);
43
45
  }
44
- function S(o) {
45
- const n = A(o);
46
- return w(...Array.isArray(n) ? n : [n]);
46
+ function v(o) {
47
+ const i = k(o);
48
+ return x(...Array.isArray(i) ? i : [i]);
47
49
  }
48
50
  export {
49
- s as applyMatrixToPoints,
50
- z as getBoxCorners,
51
- S as getTagCenterPosition,
52
- A as getTagPosition
51
+ c as applyMatrixToPoints,
52
+ h as getBoxCorners,
53
+ v as getTagCenterPosition,
54
+ k as getTagPosition
53
55
  };
@@ -23,7 +23,7 @@ let I = class {
23
23
  /**
24
24
  * @realsee/dnalogel 版本号
25
25
  */
26
- r(this, "VERSION", "3.78.0-alpha.3");
26
+ r(this, "VERSION", "3.78.0-alpha.4");
27
27
  r(this, "NAME");
28
28
  r(this, "five");
29
29
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.78.0-alpha.3",
3
+ "%c %c@realsee/dnalogel %cv3.78.0-alpha.4",
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.78.0-alpha.3",
3
+ "version": "3.78.0-alpha.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",