@realsee/dnalogel 3.72.5-alpha.2 → 3.72.5-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.
@@ -2,39 +2,39 @@ var pt = Object.defineProperty, Pt = Object.defineProperties;
2
2
  var yt = Object.getOwnPropertyDescriptors;
3
3
  var it = Object.getOwnPropertySymbols;
4
4
  var mt = Object.prototype.hasOwnProperty, ft = Object.prototype.propertyIsEnumerable;
5
- var M = Math.pow, A = (s, e, t) => e in s ? pt(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, w = (s, e) => {
6
- for (var t in e || (e = {}))
7
- mt.call(e, t) && A(s, t, e[t]);
5
+ var M = Math.pow, A = (e, s, t) => s in e ? pt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t, H = (e, s) => {
6
+ for (var t in s || (s = {}))
7
+ mt.call(s, t) && A(e, t, s[t]);
8
8
  if (it)
9
- for (var t of it(e))
10
- ft.call(e, t) && A(s, t, e[t]);
11
- return s;
12
- }, _ = (s, e) => Pt(s, yt(e));
13
- var C = (s, e, t) => (A(s, typeof e != "symbol" ? e + "" : e, t), t);
14
- var ot = (s, e, t) => new Promise((o, r) => {
9
+ for (var t of it(s))
10
+ ft.call(s, t) && A(e, t, s[t]);
11
+ return e;
12
+ }, I = (e, s) => Pt(e, yt(s));
13
+ var C = (e, s, t) => (A(e, typeof s != "symbol" ? s + "" : s, t), t);
14
+ var ot = (e, s, t) => new Promise((o, r) => {
15
15
  var f = (u) => {
16
16
  try {
17
- D(t.next(u));
17
+ w(t.next(u));
18
18
  } catch (h) {
19
19
  r(h);
20
20
  }
21
21
  }, a = (u) => {
22
22
  try {
23
- D(t.throw(u));
23
+ w(t.throw(u));
24
24
  } catch (h) {
25
25
  r(h);
26
26
  }
27
- }, D = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(f, a);
28
- D((t = t.apply(s, e)).next());
27
+ }, w = (u) => u.done ? o(u.value) : Promise.resolve(u.value).then(f, a);
28
+ w((t = t.apply(e, s)).next());
29
29
  });
30
30
  import { BaseObject as xt } from "../Base/index.js";
31
- import * as H from "three";
31
+ import * as v from "three";
32
32
  import { PolylineMesh as nt } from "../../Meshes/Polyline.js";
33
33
  import { AreaMesh as rt } from "../../Meshes/Area.js";
34
34
  import { PolygonEditor as bt } from "./Editor.js";
35
35
  import { vector3ToArray as Ct } from "../../../shared-utils/three/vector3ToArray.js";
36
- import { withResolvers as Dt } from "../../../shared-utils/promise/withResolvers.js";
37
- import { anyPositionToVector3 as wt } from "../../../shared-utils/positionToVector3.js";
36
+ import { withResolvers as wt } from "../../../shared-utils/promise/withResolvers.js";
37
+ import { anyPositionToVector3 as Dt } from "../../../shared-utils/positionToVector3.js";
38
38
  import { PointMesh as Ht } from "../../Meshes/Point.js";
39
39
  class Rt extends xt {
40
40
  constructor(t, o) {
@@ -48,7 +48,7 @@ class Rt extends xt {
48
48
  C(this, "maxHistorySize", 50);
49
49
  C(this, "_editor");
50
50
  C(this, "creatingObject");
51
- t && (this.areaMesh = new rt(w(w({}, t.style), t)), this.areaMesh.userData = (r = this.areaMesh.userData) != null ? r : {}, typeof this.areaMesh.userData.dragSelectPixelDistance != "number" && (this.areaMesh.userData.dragSelectPixelDistance = 10), this.add(this.areaMesh));
51
+ t && (this.areaMesh = new rt(H(H({}, t.style), t)), this.areaMesh.userData = (r = this.areaMesh.userData) != null ? r : {}, typeof this.areaMesh.userData.dragSelectPixelDistance != "number" && (this.areaMesh.userData.dragSelectPixelDistance = 10), this.add(this.areaMesh));
52
52
  }
53
53
  get editor() {
54
54
  return this._editor || (this._editor = new bt(this)), this._editor;
@@ -59,7 +59,7 @@ class Rt extends xt {
59
59
  typeof t == "function" && t(), this._editor && this._editor.updatePointMeshes();
60
60
  }
61
61
  get data() {
62
- return this.updateMatrixWorld(), _(w({}, this.baseData), {
62
+ return this.updateMatrixWorld(), I(H({}, this.baseData), {
63
63
  points: Ct(this.applyObjectMatrixWorld(this.areaMesh.points)),
64
64
  style: {
65
65
  color: this.areaMesh.color.getHex(),
@@ -69,7 +69,7 @@ class Rt extends xt {
69
69
  });
70
70
  }
71
71
  setData(t) {
72
- t.points && this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(t.points.map(wt))), this.areaMesh.setStyle(t.style), this.updateCreationPointMeshes();
72
+ t.points && this.areaMesh.setPoints(this.applyObjectReversalMatrixWorld(t.points.map(Dt))), this.areaMesh.setStyle(t.style), this.updateCreationPointMeshes();
73
73
  }
74
74
  highlight() {
75
75
  var t;
@@ -137,38 +137,38 @@ class Rt extends xt {
137
137
  });
138
138
  }
139
139
  }
140
- function vt(s, e, t) {
140
+ function vt(e, s, t) {
141
141
  var L, N, $, G, J, K, Q, X, Z;
142
- const { promise: o, resolve: r, reject: f } = Dt(), a = s.parent;
142
+ const { promise: o, resolve: r, reject: f } = wt(), a = e.parent;
143
143
  if (!a) {
144
144
  f(new Error("No container"));
145
145
  return;
146
146
  }
147
- const D = (L = t == null ? void 0 : t.limit) != null ? L : "none", u = t == null ? void 0 : t.simpleMode, h = (K = (J = ($ = s.five) != null ? $ : (N = s.get) == null ? void 0 : N.call(s, "five")) != null ? J : (G = window.globalModules) == null ? void 0 : G.five) != null ? K : window.$five, T = (Q = t == null ? void 0 : t.autoClosePixelDistance) != null ? Q : 10;
148
- s.userData = (X = s.userData) != null ? X : {}, s.userData.dragSelectPixelDistance = T;
149
- let g = 0;
150
- u && h && h.model && h.model.bounding && typeof ((Z = h.model.bounding.max) == null ? void 0 : Z.y) == "number" && (g = h.model.bounding.max.y + 1);
151
- const P = new nt(s.style);
147
+ const w = (L = t == null ? void 0 : t.limit) != null ? L : "none", u = t == null ? void 0 : t.simpleMode, h = (K = (J = ($ = e.five) != null ? $ : (N = e.get) == null ? void 0 : N.call(e, "five")) != null ? J : (G = window.globalModules) == null ? void 0 : G.five) != null ? K : window.$five, T = (Q = t == null ? void 0 : t.autoClosePixelDistance) != null ? Q : 10;
148
+ e.userData = (X = e.userData) != null ? X : {}, e.userData.dragSelectPixelDistance = T;
149
+ let E = 0;
150
+ u && h && h.model && h.model.bounding && typeof ((Z = h.model.bounding.max) == null ? void 0 : Z.y) == "number" && (E = h.model.bounding.max.y + 1);
151
+ const P = new nt(e.style);
152
152
  a == null || a.add(P);
153
- const y = new nt(_(w({}, s.style), { dashed: !0, lengthEnable: !1 }));
153
+ const y = new nt(I(H({}, e.style), { dashed: !0, lengthEnable: !1 }));
154
154
  a == null || a.add(y);
155
- let v = [];
155
+ let j = [];
156
156
  const lt = (i = n) => {
157
- v.forEach((d, c) => {
157
+ j.forEach((d, c) => {
158
158
  const p = i[c];
159
159
  p && d.position.copy(p);
160
160
  });
161
161
  };
162
- function j() {
162
+ function D() {
163
163
  var d, c;
164
- v.forEach((p) => {
164
+ j.forEach((p) => {
165
165
  var b;
166
166
  return (b = p.parent) == null ? void 0 : b.remove(p);
167
167
  });
168
- const i = (c = (d = s.line) == null ? void 0 : d.style) != null ? c : s.style;
169
- v = n.map((p, b) => {
168
+ const i = (c = (d = e.line) == null ? void 0 : d.style) != null ? c : e.style;
169
+ j = n.map((p, b) => {
170
170
  var S, k;
171
- const x = new Ht(_(w({}, i), {
171
+ const x = new Ht(I(H({}, i), {
172
172
  color: (S = i.pointColor) != null ? S : i.lineColor,
173
173
  tip: void 0,
174
174
  point: p
@@ -177,38 +177,42 @@ function vt(s, e, t) {
177
177
  }), lt();
178
178
  }
179
179
  function V() {
180
- v.forEach((i) => {
180
+ j.forEach((i) => {
181
181
  var d;
182
182
  return (d = i.parent) == null ? void 0 : d.remove(i);
183
- }), v = [], s.userData && (delete s.userData.creationPointMeshes, delete s.userData.syncCreationPointMeshes, delete s.userData.disposeCreationPointMeshes);
183
+ }), j = [], e.userData && (delete e.userData.creationPointMeshes, delete e.userData.syncCreationPointMeshes, delete e.userData.disposeCreationPointMeshes);
184
184
  }
185
- e.enable(), u && e.setAdherePoints([]);
185
+ s.enable(), u && s.setAdherePoints([]);
186
186
  const n = [];
187
187
  let l, m, R = !1, U;
188
- const E = [], Y = () => n.length > 0, z = () => E.length > 0, at = () => {
188
+ const O = [], Y = () => n.length > 0, z = () => O.length > 0, at = () => {
189
189
  var i;
190
- Y() && (E.push(n.pop()), O(U), j(), (i = t == null ? void 0 : t.onUndo) == null || i.call(t), e.pointSelectorHelper && e.pointSelectorHelper.magnifier && e.pointSelectorHelper.magnifier.render());
190
+ Y() && (O.push(n.pop()), g(U), D(), (i = t == null ? void 0 : t.onUndo) == null || i.call(t), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render());
191
191
  }, ht = () => {
192
192
  var i;
193
- z() && (n.push(E.pop()), O(U), j(), (i = t == null ? void 0 : t.onRedo) == null || i.call(t), e.pointSelectorHelper && e.pointSelectorHelper.magnifier && e.pointSelectorHelper.magnifier.render());
194
- }, q = (i) => {
193
+ z() && (n.push(O.pop()), g(U), D(), (i = t == null ? void 0 : t.onRedo) == null || i.call(t), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render());
194
+ }, B = (i) => {
195
195
  var c;
196
- E.length = 0;
196
+ O.length = 0;
197
197
  let d = n.length === 0 ? i.point : l.clone();
198
- u && (d = d.clone().setY(g)), n.push(d), s.setPoints(n, { closed: !1 }), j(), (c = t == null ? void 0 : t.onPointPlaced) == null || c.call(t, n), R && (B(), r());
199
- }, O = (i) => {
198
+ if (u && (d = d.clone().setY(E)), n.push(d), e.setPoints(n, { closed: !1 }), t != null && t.experimental_self_intersect_check && n.length > 2 && e.isBlank) {
199
+ n.pop(), e.setPoints(n, { closed: !1 }), D(), console.warn("[Polygon] 检测到自相交,无法添加该点");
200
+ return;
201
+ }
202
+ D(), (c = t == null ? void 0 : t.onPointPlaced) == null || c.call(t, n), R && (q(), r());
203
+ }, g = (i) => {
200
204
  const d = () => {
201
- P.setPoints([]), y.setPoints([]), s.setPoints(n), e.pointSelectorHelper && e.pointSelectorHelper.magnifier && e.pointSelectorHelper.magnifier.render();
205
+ P.setPoints([]), y.setPoints([]), e.setPoints(n), s.pointSelectorHelper && s.pointSelectorHelper.magnifier && s.pointSelectorHelper.magnifier.render();
202
206
  };
203
207
  if (!i) {
204
- d(), j();
208
+ d(), D();
205
209
  return;
206
210
  }
207
211
  if (U = i, !(n != null && n.length))
208
212
  return d();
209
213
  const c = n.at(-1).clone();
210
- if (n.length < 3 && (u ? (l = i.point.clone().setY(g), P.setPoints([c, l]), y.setPoints([])) : D === "none" ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : D === "xoz" ? (m = m != null ? m : new H.Plane().setFromNormalAndCoplanarPoint(new H.Vector3(0, 1, 0), n[0]), e.plane = m, l = m.projectPoint(i.point, new H.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])) : D === "y" && (n.length === 1 ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : (m = m != null ? m : new H.Plane().setFromCoplanarPoints(n[0], n[1], new H.Vector3(0, 1, 0).add(n[0])), e.plane = m, l = m.projectPoint(i.point, new H.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])))), n.length >= 3) {
211
- u ? l = i.point.clone().setY(g) : l = s.projectPoint(i.point);
214
+ if (n.length < 3 && (u ? (l = i.point.clone().setY(E), P.setPoints([c, l]), y.setPoints([])) : w === "none" ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : w === "xoz" ? (m = m != null ? m : new v.Plane().setFromNormalAndCoplanarPoint(new v.Vector3(0, 1, 0), n[0]), s.plane = m, l = m.projectPoint(i.point, new v.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])) : w === "y" && (n.length === 1 ? (l = i.point, P.setPoints([c, l]), y.setPoints([])) : (m = m != null ? m : new v.Plane().setFromCoplanarPoints(n[0], n[1], new v.Vector3(0, 1, 0).add(n[0])), s.plane = m, l = m.projectPoint(i.point, new v.Vector3()), P.setPoints([c, l]), y.setPoints([l, i.point])))), n.length >= 3) {
215
+ u ? l = i.point.clone().setY(E) : l = e.projectPoint(i.point);
212
216
  const p = n[0];
213
217
  let b = !1;
214
218
  if (typeof (t == null ? void 0 : t.autoClosePixelDistance) == "number") {
@@ -219,20 +223,20 @@ function vt(s, e, t) {
219
223
  x: (st.x * 0.5 + 0.5) * S,
220
224
  y: (1 - (st.y * 0.5 + 0.5)) * k
221
225
  };
222
- }, I = W(p), tt = W(l), et = W(i.point), dt = Math.sqrt(M(I.x - tt.x, 2) + M(I.y - tt.y, 2)), ct = Math.sqrt(M(I.x - et.x, 2) + M(I.y - et.y, 2));
226
+ }, _ = W(p), tt = W(l), et = W(i.point), dt = Math.sqrt(M(_.x - tt.x, 2) + M(_.y - tt.y, 2)), ct = Math.sqrt(M(_.x - et.x, 2) + M(_.y - et.y, 2));
223
227
  (dt < t.autoClosePixelDistance || ct < t.autoClosePixelDistance) && (b = !0);
224
228
  }
225
229
  } else
226
230
  (p.distanceTo(l) < 0.2 || p.distanceTo(i.point) < 0.2) && (b = !0);
227
- b ? (l = p, i.point.copy(p), e.pointSelectorHelper.updateWithIntersect(i, { emitEvent: !1 }), R = !0) : R = !1, P.setPoints([c, l]), y.setPoints([l, i.point]);
231
+ b ? (l = p, i.point.copy(p), s.pointSelectorHelper.updateWithIntersect(i, { emitEvent: !1 }), R = !0) : R = !1, P.setPoints([c, l]), y.setPoints([l, i.point]);
228
232
  }
229
- n.length >= 2 ? (s.setPoints([...n, l], { closed: !1 }), s.line.setPoints(s.points.slice(0, -1)), s.isBlank ? (e.cursorError = !0, P.setStyle({ lineColor: 16734553 }), y.setStyle({ lineColor: 16734553 })) : (e.cursorError = !1, P.setStyle({ lineColor: s.lineColor }), y.setStyle({ lineColor: s.lineColor }))) : s.setPoints([]), j();
230
- }, B = () => {
231
- e.off("select", q), e.off("intersectionUpdate", O), e.off("disable", F), e.plane = null, e.disable(), a == null || a.remove(P, y), V();
233
+ n.length >= 2 ? (e.setPoints([...n, l], { closed: !1 }), e.line.setPoints(e.points.slice(0, -1)), e.isBlank ? (s.cursorError = !0, P.setStyle({ lineColor: 16734553 }), y.setStyle({ lineColor: 16734553 })) : (s.cursorError = !1, P.setStyle({ lineColor: e.lineColor }), y.setStyle({ lineColor: e.lineColor }))) : e.setPoints([]), D();
234
+ }, q = () => {
235
+ s.off("select", B), s.off("intersectionUpdate", g), s.off("disable", F), s.plane = null, s.disable(), a == null || a.remove(P, y), V();
232
236
  }, F = () => {
233
- B(), a == null || a.remove(s, y, P), V(), f(new Error("Cancelled"));
237
+ q(), a == null || a.remove(e, y, P), V(), f(new Error("Cancelled"));
234
238
  };
235
- return e.on("select", q), e.on("intersectionUpdate", O), e.on("disable", F), {
239
+ return s.on("select", B), s.on("intersectionUpdate", g), s.on("disable", F), {
236
240
  finished: o,
237
241
  canUndo: Y,
238
242
  canRedo: z,
@@ -22,7 +22,7 @@ let A = class {
22
22
  /**
23
23
  * @realsee/dnalogel 版本号
24
24
  */
25
- r(this, "VERSION", "3.72.5-alpha.2");
25
+ r(this, "VERSION", "3.72.5-alpha.4");
26
26
  r(this, "NAME");
27
27
  r(this, "five");
28
28
  r(this, "workUtil");
@@ -1,6 +1,6 @@
1
1
  function A() {
2
2
  console.debug(
3
- "%c %c@realsee/dnalogel %cv3.72.5-alpha.2",
3
+ "%c %c@realsee/dnalogel %cv3.72.5-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.72.5-alpha.2",
3
+ "version": "3.72.5-alpha.4",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",