@realsee/dnalogel 3.52.0 → 3.52.1

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,53 +1,54 @@
1
1
  var _ = Object.defineProperty, H = Object.defineProperties;
2
2
  var I = Object.getOwnPropertyDescriptors;
3
- var F = Object.getOwnPropertySymbols;
4
- var k = Object.prototype.hasOwnProperty, q = Object.prototype.propertyIsEnumerable;
5
- var A = (o, n, t) => n in o ? _(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t, P = (o, n) => {
3
+ var T = Object.getOwnPropertySymbols;
4
+ var j = Object.prototype.hasOwnProperty, k = Object.prototype.propertyIsEnumerable;
5
+ var O = (o, n, t) => n in o ? _(o, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[n] = t, P = (o, n) => {
6
6
  for (var t in n || (n = {}))
7
- k.call(n, t) && A(o, t, n[t]);
8
- if (F)
9
- for (var t of F(n))
10
- q.call(n, t) && A(o, t, n[t]);
7
+ j.call(n, t) && O(o, t, n[t]);
8
+ if (T)
9
+ for (var t of T(n))
10
+ k.call(n, t) && O(o, t, n[t]);
11
11
  return o;
12
- }, u = (o, n) => H(o, I(n));
13
- var R = (o, n, t) => (A(o, typeof n != "symbol" ? n + "" : n, t), t);
14
- var O = (o, n, t) => new Promise((f, m) => {
12
+ }, p = (o, n) => H(o, I(n));
13
+ var R = (o, n, t) => (O(o, typeof n != "symbol" ? n + "" : n, t), t);
14
+ var A = (o, n, t) => new Promise((f, m) => {
15
15
  var a = (c) => {
16
16
  try {
17
- d(t.next(c));
17
+ h(t.next(c));
18
18
  } catch (w) {
19
19
  m(w);
20
20
  }
21
21
  }, i = (c) => {
22
22
  try {
23
- d(t.throw(c));
23
+ h(t.throw(c));
24
24
  } catch (w) {
25
25
  m(w);
26
26
  }
27
- }, d = (c) => c.done ? f(c.value) : Promise.resolve(c.value).then(a, i);
28
- d((t = t.apply(o, n)).next());
27
+ }, h = (c) => c.done ? f(c.value) : Promise.resolve(c.value).then(a, i);
28
+ h((t = t.apply(o, n)).next());
29
29
  });
30
- import { BaseObject as G } from "../Base/index.js";
30
+ import { BaseObject as q } from "../Base/index.js";
31
31
  import * as s from "three";
32
32
  import { PolylineWithDotsMesh as b } from "../../Meshes/Polyline.js";
33
- import { RectangleMeshEditor as J } from "../../Editors/RectangleMeshEditor.js";
34
- import { RectangleWithEdgeMesh as T } from "../../Meshes/RectangleWithEdge.js";
35
- import { sortPositionsByCameraPosition as B } from "../../utils/sortPositionsByCameraPosition.js";
36
- import { Sculpt as D } from "../../index.js";
37
- class ne extends G {
33
+ import { RectangleMeshEditor as G } from "../../Editors/RectangleMeshEditor.js";
34
+ import { RectangleWithEdgeMesh as F } from "../../Meshes/RectangleWithEdge.js";
35
+ import { sortPositionsByCameraPosition as W } from "../../utils/sortPositionsByCameraPosition.js";
36
+ import { Sculpt as B } from "../../index.js";
37
+ import { vector3ToArray as J } from "../../../shared-utils/three/vector3ToArray.js";
38
+ class se extends q {
38
39
  constructor(t, f) {
39
40
  super(t, f);
40
41
  R(this, "type", "Rectangle");
41
42
  R(this, "rectangleMesh");
42
43
  R(this, "_editor");
43
- t && (this.rectangleMesh = new T(P(P({}, t.style), t)), this.add(this.rectangleMesh));
44
+ t && (this.rectangleMesh = new F(P(P({}, t.style), t)), this.add(this.rectangleMesh));
44
45
  }
45
46
  get editor() {
46
- return this._editor || (this._editor = new J(this.rectangleMesh)), this._editor;
47
+ return this._editor || (this._editor = new G(this.rectangleMesh)), this._editor;
47
48
  }
48
49
  get data() {
49
- return u(P({}, this.baseData), {
50
- points: this.rectangleMesh.builtPoints.map((t) => t.toArray()),
50
+ return p(P({}, this.baseData), {
51
+ points: J(this.applyObjectMatrixWorld(this.rectangleMesh.points, this.rectangleMesh)),
51
52
  style: {
52
53
  color: this.rectangleMesh.color.getHex(),
53
54
  opacity: this.rectangleMesh.opacity,
@@ -65,9 +66,9 @@ class ne extends G {
65
66
  (t = this.rectangleMesh) == null || t.unhighlight();
66
67
  }
67
68
  create(t) {
68
- return O(this, null, function* () {
69
+ return A(this, null, function* () {
69
70
  this.removeChildren();
70
- const f = new T(t);
71
+ const f = new F(t);
71
72
  this.rectangleMesh = f, this.add(this.rectangleMesh), yield K(this.rectangleMesh, this.pointSelector, t), this.config.canEdit && this.editor.enable();
72
73
  });
73
74
  }
@@ -78,23 +79,23 @@ function K(o, n, t) {
78
79
  }
79
80
  function Q(o, n, t) {
80
81
  return new Promise((f, m) => {
81
- var x;
82
+ var C;
82
83
  const a = o.parent;
83
84
  if (!a)
84
85
  return m(new Error("No container"));
85
- const i = (x = t == null ? void 0 : t.limit) != null ? x : "none", d = new b(u(P({}, o.style), { dashed: !0, lengthEnable: !0 })), c = new b(u(P({}, o.style), { dashed: !0, lengthEnable: !1 })), w = new b(u(P({}, o.style), { dashed: !1, lengthEnable: !1 }));
86
- a.add(d, w, c), n.enable();
86
+ const i = (C = t == null ? void 0 : t.limit) != null ? C : "none", h = new b(p(P({}, o.style), { dashed: !0, lengthEnable: !0 })), c = new b(p(P({}, o.style), { dashed: !0, lengthEnable: !1 })), w = new b(p(P({}, o.style), { dashed: !1, lengthEnable: !1 }));
87
+ a.add(h, w, c), n.enable();
87
88
  const e = [];
88
- let l = new s.Vector3(), E = new s.Vector3();
89
- const h = new s.Plane(), v = () => {
90
- e.push(l.clone()), e.length === 1 ? (i === "xoz" && h.setFromNormalAndCoplanarPoint(new s.Vector3(0, 1, 0), e[0]), i === "none" && h.setFromNormalAndCoplanarPoint(E, e[0])) : e.length === 2 ? i === "y" || i === "xoz" ? (y(), f()) : w.setPoints([e[0], e[1]]) : e.length === 3 && (y(), f());
89
+ let l = new s.Vector3(), v = new s.Vector3();
90
+ const d = new s.Plane(), E = () => {
91
+ e.push(l.clone()), e.length === 1 ? (i === "xoz" && d.setFromNormalAndCoplanarPoint(new s.Vector3(0, 1, 0), e[0]), i === "none" && d.setFromNormalAndCoplanarPoint(v, e[0])) : e.length === 2 ? i === "y" || i === "xoz" ? (y(), f()) : w.setPoints([e[0], e[1]]) : e.length === 3 && (y(), f());
91
92
  }, L = (r) => {
92
93
  var N;
93
94
  if (!(r != null && r.raycaster))
94
95
  return;
95
96
  const M = (N = e.at(-1)) == null ? void 0 : N.clone();
96
97
  if (e.length === 0) {
97
- l = r.point.clone(), E = r.face.normal;
98
+ l = r.point.clone(), v = r.face.normal;
98
99
  return;
99
100
  }
100
101
  if (e.length === 1 && i === "y") {
@@ -103,80 +104,80 @@ function Q(o, n, t) {
103
104
  return;
104
105
  }
105
106
  if (e.length === 1 && i === "xoz") {
106
- const p = new s.Line3(new s.Vector3(1, 0, 0).add(e[0]), new s.Vector3(-1, 0, 0).add(e[0])), g = r.raycaster.ray.intersectPlane(h, new s.Vector3()), V = p.closestPointToPoint(g, !1, new s.Vector3());
107
+ const u = new s.Line3(new s.Vector3(1, 0, 0).add(e[0]), new s.Vector3(-1, 0, 0).add(e[0])), g = r.raycaster.ray.intersectPlane(d, new s.Vector3()), V = u.closestPointToPoint(g, !1, new s.Vector3());
107
108
  o.setPoints([e[0], V, g]);
108
109
  return;
109
110
  }
110
111
  if (e.length === 1 && i === "none") {
111
- h ? (l = r.raycaster.ray.intersectPlane(h, new s.Vector3()), c.setPoints([l, r.point])) : l = r.point.clone(), d.setPoints([M, l]);
112
+ d ? (l = r.raycaster.ray.intersectPlane(d, new s.Vector3()), c.setPoints([l, r.point])) : l = r.point.clone(), h.setPoints([M, l]);
112
113
  return;
113
114
  }
114
115
  if (e.length === 2 && i === "none") {
115
- a.remove(d);
116
- const p = r.raycaster.ray.intersectPlane(h, new s.Vector3()), g = e[0].distanceTo(e[1]) / 2, V = new s.Vector3().lerpVectors(e[0], e[1], 0.5), z = new s.Vector3().subVectors(p, V).normalize();
116
+ a.remove(h);
117
+ const u = r.raycaster.ray.intersectPlane(d, new s.Vector3()), g = e[0].distanceTo(e[1]) / 2, V = new s.Vector3().lerpVectors(e[0], e[1], 0.5), z = new s.Vector3().subVectors(u, V).normalize();
117
118
  l = new s.Vector3().addVectors(V, z.multiplyScalar(g));
118
- const U = [e[0], l, e[1]], W = B(U, D.modules.five.camera.position);
119
- o.setPoints(W);
119
+ const D = [e[0], l, e[1]], U = W(D, B.modules.five.camera.position);
120
+ o.setPoints(U);
120
121
  return;
121
122
  }
122
123
  }, y = () => {
123
- n.off("select", v), n.off("intersectionUpdate", L), n.off("disable", C), n.disable(), a == null || a.remove(d, w, c);
124
- }, C = () => {
124
+ n.off("select", E), n.off("intersectionUpdate", L), n.off("disable", x), n.disable(), a == null || a.remove(h, w, c);
125
+ }, x = () => {
125
126
  y(), a == null || a.remove(o), m(new Error("Cancelled"));
126
127
  };
127
- n.on("select", v), n.on("intersectionUpdate", L), n.on("disable", C);
128
+ n.on("select", E), n.on("intersectionUpdate", L), n.on("disable", x);
128
129
  });
129
130
  }
130
131
  function X(o, n, t) {
131
132
  return new Promise((f, m) => {
132
- var x;
133
+ var C;
133
134
  const a = o.parent;
134
135
  if (!a)
135
136
  return m(new Error("No container"));
136
- const i = (x = t == null ? void 0 : t.limit) != null ? x : "none", d = new b(u(P({}, o.style), { dashed: !0, lengthEnable: !0 })), c = new b(u(P({}, o.style), { dashed: !0, lengthEnable: !1 })), w = new b(u(P({}, o.style), { dashed: !1, lengthEnable: !1 }));
137
- a.add(d, w, c), n.enable();
137
+ const i = (C = t == null ? void 0 : t.limit) != null ? C : "none", h = new b(p(P({}, o.style), { dashed: !0, lengthEnable: !0 })), c = new b(p(P({}, o.style), { dashed: !0, lengthEnable: !1 })), w = new b(p(P({}, o.style), { dashed: !1, lengthEnable: !1 }));
138
+ a.add(h, w, c), n.enable();
138
139
  const e = [];
139
- let l = new s.Vector3(), E = new s.Vector3();
140
- const h = new s.Plane(), v = () => {
141
- e.push(l.clone()), e.length === 1 ? (i === "xoz" && h.setFromNormalAndCoplanarPoint(new s.Vector3(0, 1, 0), e[0]), i === "none" && h.setFromNormalAndCoplanarPoint(E, e[0])) : e.length === 2 ? (i === "y" && h.setFromCoplanarPoints(e[0], e[1], new s.Vector3(0, 1, 0).add(e[0])), w.setPoints([e[0], e[1]])) : e.length === 3 && (y(), f());
140
+ let l = new s.Vector3(), v = new s.Vector3();
141
+ const d = new s.Plane(), E = () => {
142
+ e.push(l.clone()), e.length === 1 ? (i === "xoz" && d.setFromNormalAndCoplanarPoint(new s.Vector3(0, 1, 0), e[0]), i === "none" && d.setFromNormalAndCoplanarPoint(v, e[0])) : e.length === 2 ? (i === "y" && d.setFromCoplanarPoints(e[0], e[1], new s.Vector3(0, 1, 0).add(e[0])), w.setPoints([e[0], e[1]])) : e.length === 3 && (y(), f());
142
143
  }, L = (r) => {
143
144
  var N;
144
145
  if (!(r != null && r.raycaster))
145
146
  return;
146
147
  const M = (N = e.at(-1)) == null ? void 0 : N.clone();
147
148
  if (e.length === 0) {
148
- l = r.point.clone(), E = r.face.normal;
149
+ l = r.point.clone(), v = r.face.normal;
149
150
  return;
150
151
  }
151
152
  if (e.length === 1 && i === "y") {
152
- l = r.point, c.setPoints([]), d.setPoints([M, l]);
153
+ l = r.point, c.setPoints([]), h.setPoints([M, l]);
153
154
  return;
154
155
  }
155
156
  if (e.length === 1 && i === "xoz") {
156
- l = r.raycaster.ray.intersectPlane(h, new s.Vector3()), c.setPoints([l, r.point]), d.setPoints([M, l]);
157
+ l = r.raycaster.ray.intersectPlane(d, new s.Vector3()), c.setPoints([l, r.point]), h.setPoints([M, l]);
157
158
  return;
158
159
  }
159
160
  if (e.length === 1 && i === "none") {
160
- l = r.raycaster.ray.intersectPlane(h, new s.Vector3()), c.setPoints([l, r.point]), d.setPoints([M, l]);
161
+ l = r.raycaster.ray.intersectPlane(d, new s.Vector3()), c.setPoints([l, r.point]), h.setPoints([M, l]);
161
162
  return;
162
163
  }
163
164
  if (e.length === 2) {
164
- a.remove(d);
165
- const p = new s.Vector3().crossVectors(e[0].clone().sub(e[1]), h.normal).normalize();
166
- l = new s.Line3(e[1].clone().add(p), e[1].clone().sub(p)).closestPointToPoint(r.point, !1, new s.Vector3());
167
- const V = [e[0], e[1], l], z = B(V, D.modules.five.camera.position);
165
+ a.remove(h);
166
+ const u = new s.Vector3().crossVectors(e[0].clone().sub(e[1]), d.normal).normalize();
167
+ l = new s.Line3(e[1].clone().add(u), e[1].clone().sub(u)).closestPointToPoint(r.point, !1, new s.Vector3());
168
+ const V = [e[0], e[1], l], z = W(V, B.modules.five.camera.position);
168
169
  o.setPoints(z);
169
170
  return;
170
171
  }
171
172
  }, y = () => {
172
- n.off("select", v), n.off("intersectionUpdate", L), n.off("disable", C), n.disable(), a == null || a.remove(d, w, c);
173
- }, C = () => {
173
+ n.off("select", E), n.off("intersectionUpdate", L), n.off("disable", x), n.disable(), a == null || a.remove(h, w, c);
174
+ }, x = () => {
174
175
  y(), a == null || a.remove(o), m(new Error("Cancelled"));
175
176
  };
176
- n.on("select", v), n.on("intersectionUpdate", L), n.on("disable", C);
177
+ n.on("select", E), n.on("intersectionUpdate", L), n.on("disable", x);
177
178
  });
178
179
  }
179
180
  export {
180
- ne as Rectangle,
181
+ se as Rectangle,
181
182
  K as createRectangle
182
183
  };
@@ -86,16 +86,6 @@ export declare class Sculpt extends Subscribe<Event> {
86
86
  };
87
87
  readonly id: string;
88
88
  readonly type: string;
89
- } | {
90
- points: [import("..").ArrayPosition, import("..").ArrayPosition, import("..").ArrayPosition];
91
- style: {
92
- color: number;
93
- opacity: number;
94
- lineWidth: number;
95
- lineColor: number;
96
- };
97
- id: string;
98
- type: string;
99
89
  } | {
100
90
  center: [number, number, number];
101
91
  normal: [number, number, number];
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.52.0");
21
+ i(this, "VERSION", "3.52.1");
22
22
  i(this, "NAME");
23
23
  i(this, "five");
24
24
  i(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.52.0",
3
+ "%c %c@realsee/dnalogel %cv3.52.1",
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.52.0",
3
+ "version": "3.52.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",