@realsee/dnalogel 3.47.11 → 3.47.13

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.
@@ -43,6 +43,7 @@ export declare class LineMesh extends IObject3D {
43
43
  private backLine;
44
44
  private opacityBeforeHighlight;
45
45
  private paramsStyle;
46
+ private lastRenderLengthItem;
46
47
  constructor(params?: Partial<LineMeshStyle & LineData>);
47
48
  updateMatrixWorld(force?: boolean): void;
48
49
  setPoints(points: AnyPositions): void;
@@ -50,5 +51,5 @@ export declare class LineMesh extends IObject3D {
50
51
  setStyle(params: Partial<LineMeshStyle>): void;
51
52
  highlight(): void;
52
53
  unhighlight(): void;
53
- updateLengthItems(): void;
54
+ private updateLengthItems;
54
55
  }
@@ -1,40 +1,40 @@
1
1
  var M = Object.defineProperty;
2
- var b = Object.getOwnPropertySymbols;
2
+ var m = Object.getOwnPropertySymbols;
3
3
  var k = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
4
- var g = (s, o, e) => o in s ? M(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e, u = (s, o) => {
5
- for (var e in o || (o = {}))
6
- k.call(o, e) && g(s, e, o[e]);
7
- if (b)
8
- for (var e of b(o))
9
- S.call(o, e) && g(s, e, o[e]);
10
- return s;
4
+ var u = (o, s, e) => s in o ? M(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, f = (o, s) => {
5
+ for (var e in s || (s = {}))
6
+ k.call(s, e) && u(o, e, s[e]);
7
+ if (m)
8
+ for (var e of m(s))
9
+ S.call(s, e) && u(o, e, s[e]);
10
+ return o;
11
11
  };
12
- var l = (s, o, e) => (g(s, typeof o != "symbol" ? o + "" : o, e), e);
13
- import * as a from "three";
14
- import { DEFAULT_LINE_COLOR as m, DEFAULT_LINE_WIDTH as p, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
15
- import { LineGeometry as f, LineMaterial as w, THREE_Line2 as H } from "../../shared-utils/five/FiveLine.js";
16
- import { anyPositionToVector3 as C } from "../../shared-utils/positionToVector3.js";
17
- import { IObject3D as I } from "../../shared-utils/three/IObject3D.js";
12
+ var l = (o, s, e) => (u(o, typeof s != "symbol" ? s + "" : s, e), e);
13
+ import * as g from "three";
14
+ import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as p, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
15
+ import { LineGeometry as y, LineMaterial as I, THREE_Line2 as w } from "../../shared-utils/five/FiveLine.js";
16
+ import { anyPositionToVector3 as H } from "../../shared-utils/positionToVector3.js";
17
+ import { IObject3D as R } from "../../shared-utils/three/IObject3D.js";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
- import { centerPoint as x } from "../../shared-utils/three/centerPoint.js";
21
- import { LightTag as R } from "../../shared-utils/tag.js";
20
+ import { centerPoint as C } from "../../shared-utils/three/centerPoint.js";
21
+ import { LightTag as x } from "../../shared-utils/tag.js";
22
22
  import { globalModules as W } from "../utils/Modules/Global.js";
23
- import { removeAllTag as O } from "../utils/removeAllTag.js";
24
- import { getLengthHTML as P } from "../utils/Meshes/getLengthHTML.js";
25
- import { applyObjectMatrixWorld as E } from "../../shared-utils/three/applyObjectMatrixWorld.js";
23
+ import { removeAllTag as A } from "../utils/removeAllTag.js";
24
+ import { getLengthHTML as O } from "../utils/Meshes/getLengthHTML.js";
25
+ import { applyObjectMatrixWorld as T } from "../../shared-utils/three/applyObjectMatrixWorld.js";
26
26
  import "../../shared-utils/three/THREESphere.js";
27
27
  import "animejs";
28
28
  import { notNil as c } from "../../shared-utils/isNil.js";
29
29
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
30
- class T extends w {
30
+ class E extends I {
31
31
  constructor(e) {
32
- var t, i;
32
+ var i, t;
33
33
  super(e);
34
34
  l(this, "_three_color");
35
- c(e == null ? void 0 : e.color) && (this.three_color = (t = e == null ? void 0 : e.color) != null ? t : 16777215), Object.keys(e).forEach((n) => {
35
+ c(e == null ? void 0 : e.color) && (this.three_color = (i = e == null ? void 0 : e.color) != null ? i : 16777215), Object.keys(e).forEach((n) => {
36
36
  ["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(n) || n in this && (this[n] = e[n]);
37
- }), this.setDashed((i = e == null ? void 0 : e.dashed) != null ? i : !1);
37
+ }), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
38
38
  }
39
39
  get three_color() {
40
40
  return this._three_color;
@@ -46,15 +46,15 @@ class T extends w {
46
46
  this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
47
47
  }
48
48
  }
49
- class _ extends H {
50
- constructor(e, t) {
51
- super(e, t);
49
+ class _ extends w {
50
+ constructor(e, i) {
51
+ super(e, i);
52
52
  l(this, "name", "Line3");
53
53
  }
54
54
  }
55
- class $ extends I {
55
+ class $ extends R {
56
56
  constructor(e) {
57
- var r, h, d, y, L;
57
+ var h, r, d, a, L;
58
58
  super();
59
59
  l(this, "name", "LineMesh");
60
60
  l(this, "points");
@@ -64,26 +64,27 @@ class $ extends I {
64
64
  l(this, "backLine");
65
65
  l(this, "opacityBeforeHighlight");
66
66
  l(this, "paramsStyle", {});
67
+ l(this, "lastRenderLengthItem");
67
68
  this.paramsStyle = e != null ? e : {};
68
- const t = new f(), i = new T({
69
- color: new a.Color((r = e == null ? void 0 : e.lineColor) != null ? r : m),
70
- linewidth: (h = e == null ? void 0 : e.lineWidth) != null ? h : p,
69
+ const i = new y(), t = new E({
70
+ color: new g.Color((h = e == null ? void 0 : e.lineColor) != null ? h : b),
71
+ linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : p,
71
72
  dashScale: 40,
72
73
  opacity: (d = e == null ? void 0 : e.opacity) != null ? d : 1,
73
74
  transparent: !0,
74
- dashed: (y = e == null ? void 0 : e.dashed) != null ? y : !1
75
- }), n = new T({
76
- color: new a.Color((L = e == null ? void 0 : e.lineColor) != null ? L : m),
77
- linewidth: i.linewidth * 0.9,
78
- dashScale: i.dashScale,
79
- opacity: i.opacity * 0.8,
75
+ dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
76
+ }), n = new E({
77
+ color: new g.Color((L = e == null ? void 0 : e.lineColor) != null ? L : b),
78
+ linewidth: t.linewidth * 0.9,
79
+ dashScale: t.dashScale,
80
+ opacity: t.opacity * 0.8,
80
81
  depthTest: !1,
81
82
  depthWrite: !1,
82
83
  transparent: !0,
83
- resolution: i.resolution
84
+ resolution: t.resolution
84
85
  });
85
- this.line = new _(t, i), this.backLine = new _(t, n), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
86
- O(this);
86
+ this.line = new _(i, t), this.backLine = new _(i, n), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
87
+ A(this);
87
88
  });
88
89
  }
89
90
  get style() {
@@ -100,7 +101,7 @@ class $ extends I {
100
101
  return this.line.material.linewidth;
101
102
  }
102
103
  get color() {
103
- return new a.Color(this.line.material.three_color);
104
+ return new g.Color(this.line.material.three_color);
104
105
  }
105
106
  get dashed() {
106
107
  return this.line.material.dashed;
@@ -112,29 +113,32 @@ class $ extends I {
112
113
  return this.line.material.depthTest === !1 ? "depthTest" : "translucence";
113
114
  }
114
115
  updateMatrixWorld(e) {
115
- super.updateMatrixWorld(e), this.updateLengthItems();
116
+ var t;
117
+ super.updateMatrixWorld(e);
118
+ const i = (t = this.points) == null ? void 0 : t.map((n) => n.toArray().join(",")).join(",");
119
+ i !== this.lastRenderLengthItem && (this.updateLengthItems(), this.lastRenderLengthItem = i);
116
120
  }
117
121
  setPoints(e) {
118
- const t = e.map(C).filter(c);
119
- if (this.points = t, t.length < 2) {
120
- this.line.geometry = new f(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
122
+ const i = e.map(H).filter(c);
123
+ if (this.points = i, i.length < 2) {
124
+ this.line.geometry = new y(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
121
125
  return;
122
126
  }
123
127
  this.addIfNotExists(this.line, this.backLine);
124
- const i = t.flatMap((n) => [n.x, n.y, n.z]);
125
- i.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new f(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(i), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
128
+ const t = i.flatMap((n) => [n.x, n.y, n.z]);
129
+ t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new y(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
126
130
  }
127
- setResolution(e, t) {
128
- const i = this.line.material.resolution;
129
- (i.x !== e || i.y !== t) && (i.set(e, t), this.needsRender = !0);
131
+ setResolution(e, i) {
132
+ const t = this.line.material.resolution;
133
+ (t.x !== e || t.y !== i) && (t.set(e, i), this.needsRender = !0);
130
134
  const n = this.backLine.material.resolution;
131
- (n.x !== e || n.y !== t) && (n.set(e, t), this.needsRender = !0);
135
+ (n.x !== e || n.y !== i) && (n.set(e, i), this.needsRender = !0);
132
136
  }
133
137
  setStyle(e) {
134
- var n, r, h;
135
- this.paramsStyle = u(u({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new a.Color(e.lineColor), this.backLine.material.three_color = new a.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
136
- const t = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, i = (h = (r = e.occlusionMode) != null ? r : this.paramsStyle.occlusionMode) != null ? h : "translucence";
137
- t ? i === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : i === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
138
+ var n, h, r;
139
+ this.paramsStyle = f(f({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new g.Color(e.lineColor), this.backLine.material.three_color = new g.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
140
+ const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (h = e.occlusionMode) != null ? h : this.paramsStyle.occlusionMode) != null ? r : "translucence";
141
+ i ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
138
142
  }
139
143
  highlight() {
140
144
  this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
@@ -143,25 +147,26 @@ class $ extends I {
143
147
  this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
144
148
  }
145
149
  updateLengthItems() {
146
- if (!this.points || this.points.length < 2) {
147
- this.lengthDoms.forEach((e) => e.destroy()), this.lengthDoms = [];
148
- return;
149
- }
150
+ const e = () => {
151
+ this.lengthDoms.forEach((i) => i.destroy()), this.lengthDoms = [];
152
+ };
153
+ if (!this.points || this.points.length < 2)
154
+ return e();
150
155
  if (this.paramsStyle.lengthEnable) {
151
- const e = E(this, this.points).map((t, i) => {
152
- if (i !== 0)
153
- return [E(this, this.points[i - 1]), t];
156
+ const i = T(this, this.points).map((t, n) => {
157
+ if (n !== 0)
158
+ return [T(this, this.points[n - 1]), t];
154
159
  }).filter(c);
155
- e.forEach(([t, i], n) => {
156
- var h;
157
- const r = x(t, i);
158
- this.lengthDoms[n] = (h = this.lengthDoms[n]) != null ? h : (() => {
159
- const d = new R(W.five);
160
- return d.intersectCheck = !1, d;
161
- })(), this.lengthDoms[n].setPosition(r, [t, i]), this.lengthDoms[n].container.innerHTML = P(t.distanceTo(i).toFixed(2) + "m");
162
- }), this.lengthDoms.length > e.length && (this.lengthDoms.slice(e.length).forEach((t) => t.destroy()), this.lengthDoms.length = e.length);
160
+ i.forEach(([t, n], h) => {
161
+ var d;
162
+ const r = C(t, n);
163
+ this.lengthDoms[h] = (d = this.lengthDoms[h]) != null ? d : (() => {
164
+ const a = new x(W.five);
165
+ return a.intersectCheck = !1, a;
166
+ })(), this.lengthDoms[h].setPosition(r, [t, n]), this.lengthDoms[h].container.innerHTML = O(t.distanceTo(n).toFixed(2) + "m");
167
+ }), this.lengthDoms.length > i.length && (this.lengthDoms.slice(i.length).forEach((t) => t.destroy()), this.lengthDoms.length = i.length);
163
168
  } else
164
- this.lengthDoms.forEach((e) => e.destroy()), this.lengthDoms = [];
169
+ e();
165
170
  }
166
171
  }
167
172
  export {
@@ -5,11 +5,14 @@ import type { PointsData } from '../utils/data';
5
5
  export declare const blankGeometry: THREE.BufferGeometry & {
6
6
  isBlank: true;
7
7
  };
8
- export type PolygonStyle = ColoredMeshStyle;
8
+ export type PolygonStyle = ColoredMeshStyle & {
9
+ lengthEnable: boolean;
10
+ };
9
11
  export type PolygonData = PointsData;
10
12
  export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
11
13
  name: string;
12
14
  get style(): {
15
+ lengthEnable: boolean;
13
16
  color: THREE.Color;
14
17
  opacity: number;
15
18
  occlusionVisibility: boolean;
@@ -17,19 +20,24 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
17
20
  };
18
21
  get isBlank(): boolean;
19
22
  get center(): THREE.Vector3;
23
+ get geometryInfo(): {
24
+ area: number;
25
+ center: THREE.Vector3;
26
+ };
20
27
  points: THREE.Vector3[];
21
28
  planeHelperNeedUpdate: boolean;
22
- private geometryInfoNeedUpdate;
29
+ geometryInfoNeedUpdate: boolean;
30
+ _paramsStyle: Partial<PolygonStyle>;
23
31
  private planeHelper;
24
- private geometryInfo;
32
+ private _geometryInfo;
25
33
  private opacityBeforeHighlight;
26
34
  private highlighted;
35
+ private lastRenderLengthItem;
36
+ private areaDom?;
27
37
  constructor(params?: Partial<PolygonStyle & PolygonData>);
38
+ updateMatrixWorld(force?: boolean): void;
39
+ setStyle(params: Partial<ColoredMeshStyle>): void;
28
40
  setPoints(points: AnyPositions): void;
29
- getGeometryInfo(): {
30
- center: THREE.Vector3;
31
- area: number;
32
- };
33
41
  /**
34
42
  * @description: 获取一个点投影在当前平面上的点
35
43
  */
@@ -37,4 +45,5 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
37
45
  highlight(): void;
38
46
  unhighlight(): void;
39
47
  private updatePlaneHelper;
48
+ private updateAreaItems;
40
49
  }
@@ -1,61 +1,99 @@
1
- var l = Object.defineProperty;
2
- var p = (o, i, e) => i in o ? l(o, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[i] = e;
3
- var t = (o, i, e) => (p(o, typeof i != "symbol" ? i + "" : i, e), e);
4
- import * as r from "three";
5
- import { generatePolygonGeometry as g } from "../../shared-utils/three/generatePolygonGeometry.js";
6
- import { DEFAULT_HIGHLIGHT_OPACITY as a } from "../typings/style.js";
7
- import { anyPositionToVector3 as y } from "../../shared-utils/positionToVector3.js";
8
- import { ColoredMesh as f } from "../utils/three/ColoredMesh.js";
9
- import { getGeometryInfo as d } from "../../shared-utils/three/geometryUtil.js";
10
- const n = new r.BufferGeometry();
11
- n.name = "blankGeometry";
12
- n.isBlank = !0;
13
- class G extends f {
1
+ var d = Object.defineProperty, y = Object.defineProperties;
2
+ var f = Object.getOwnPropertyDescriptors;
3
+ var p = Object.getOwnPropertySymbols;
4
+ var u = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
5
+ var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, n = (i, t) => {
6
+ for (var e in t || (t = {}))
7
+ u.call(t, e) && h(i, e, t[e]);
8
+ if (p)
9
+ for (var e of p(t))
10
+ c.call(t, e) && h(i, e, t[e]);
11
+ return i;
12
+ }, g = (i, t) => y(i, f(t));
13
+ var r = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e);
14
+ import * as l from "three";
15
+ import { generatePolygonGeometry as I } from "../../shared-utils/three/generatePolygonGeometry.js";
16
+ import { DEFAULT_HIGHLIGHT_OPACITY as H } from "../typings/style.js";
17
+ import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.js";
18
+ import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
19
+ import { getGeometryInfo as S } from "../../shared-utils/three/geometryUtil.js";
20
+ import { LightTag as L } from "../../shared-utils/tag.js";
21
+ import { globalModules as U } from "../utils/Modules/Global.js";
22
+ import { getLengthHTML as A } from "../utils/Meshes/getLengthHTML.js";
23
+ const a = new l.BufferGeometry();
24
+ a.name = "blankGeometry";
25
+ a.isBlank = !0;
26
+ class E extends _ {
14
27
  constructor(e) {
15
28
  super(e);
16
- t(this, "name", "PolygonMesh");
17
- t(this, "points", []);
18
- t(this, "planeHelperNeedUpdate", !0);
19
- t(this, "geometryInfoNeedUpdate", !0);
20
- t(this, "planeHelper", null);
21
- t(this, "geometryInfo", null);
22
- t(this, "opacityBeforeHighlight");
23
- t(this, "highlighted", !1);
24
- e != null && e.points && this.setPoints(e.points);
29
+ r(this, "name", "PolygonMesh");
30
+ r(this, "points", []);
31
+ r(this, "planeHelperNeedUpdate", !0);
32
+ r(this, "geometryInfoNeedUpdate", !0);
33
+ r(this, "_paramsStyle");
34
+ r(this, "planeHelper", null);
35
+ r(this, "_geometryInfo", null);
36
+ r(this, "opacityBeforeHighlight");
37
+ r(this, "highlighted", !1);
38
+ r(this, "lastRenderLengthItem");
39
+ r(this, "areaDom");
40
+ e != null && e.points && this.setPoints(e.points), this._paramsStyle = e != null ? e : {}, this.updateAreaItems();
25
41
  }
26
42
  get style() {
27
- return super.style;
43
+ return g(n({}, super.style), { lengthEnable: this._paramsStyle.lengthEnable });
28
44
  }
29
45
  get isBlank() {
30
46
  return !!this.geometry.isBlank;
31
47
  }
32
48
  get center() {
33
- return this.getGeometryInfo().center;
49
+ return this.geometryInfo.center;
34
50
  }
35
- setPoints(e) {
51
+ get geometryInfo() {
52
+ return this.geometryInfoNeedUpdate && (this._geometryInfo = S(this.geometry), this.geometryInfoNeedUpdate = !1), this._geometryInfo;
53
+ }
54
+ updateMatrixWorld(e) {
36
55
  var s;
37
- const h = e.map(y);
38
- this.points = h, this.geometry = (s = g(this.points)) != null ? s : n, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0;
56
+ super.updateMatrixWorld(e);
57
+ const o = (s = this.points) == null ? void 0 : s.map((m) => m.toArray().join(",")).join(",");
58
+ o !== this.lastRenderLengthItem && (this.updateAreaItems(), this.lastRenderLengthItem = o);
59
+ }
60
+ setStyle(e) {
61
+ this._paramsStyle = n(n({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
39
62
  }
40
- getGeometryInfo() {
41
- return this.geometryInfoNeedUpdate ? d(this.geometry) : this.geometryInfo;
63
+ setPoints(e) {
64
+ var s;
65
+ const o = e.map(P);
66
+ this.points = o, this.geometry = (s = I(this.points)) != null ? s : a, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
42
67
  }
43
68
  /**
44
69
  * @description: 获取一个点投影在当前平面上的点
45
70
  */
46
71
  projectPoint(e) {
47
- return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new r.Vector3()) : e);
72
+ return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new l.Vector3()) : e);
48
73
  }
49
74
  highlight() {
50
- this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity * a }), this.needsRender = !0);
75
+ this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity * H }), this.needsRender = !0);
51
76
  }
52
77
  unhighlight() {
53
78
  this.highlighted && (this.highlighted = !1, this.setStyle({ opacity: this.opacityBeforeHighlight }), this.needsRender = !0);
54
79
  }
55
80
  updatePlaneHelper() {
56
- this.points.length >= 3 ? this.planeHelper = new r.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
81
+ this.points.length >= 3 ? this.planeHelper = new l.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
82
+ }
83
+ updateAreaItems() {
84
+ var o;
85
+ const e = () => {
86
+ var s;
87
+ (s = this.areaDom) == null || s.destroy(), this.areaDom = void 0;
88
+ };
89
+ if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
90
+ return e();
91
+ this.areaDom = (o = this.areaDom) != null ? o : (() => {
92
+ const s = new L(U.five);
93
+ return s.intersectCheck = !1, s;
94
+ })(), this.areaDom.setPosition(this.center), this.areaDom.container.innerHTML = A(this.geometryInfo.area.toFixed(2) + "m²");
57
95
  }
58
96
  }
59
97
  export {
60
- G as PolygonMesh
98
+ E as PolygonMesh
61
99
  };
@@ -12,6 +12,7 @@ export declare class PolygonWithEdgeMesh extends PolygonMesh {
12
12
  get style(): {
13
13
  lineWidth: number;
14
14
  lineColor: THREE.Color;
15
+ lengthEnable: boolean;
15
16
  color: THREE.Color;
16
17
  opacity: number;
17
18
  occlusionVisibility: boolean;
@@ -16,7 +16,7 @@ import { PolygonMesh as u } from "./Polygon.js";
16
16
  import { RectangleGeometry as g } from "../utils/three/RectangleGeometry.js";
17
17
  import { getBetterNormal as f } from "../utils/getBetterNormal.js";
18
18
  import { Sculpt as d } from "../index.js";
19
- class U extends u {
19
+ class T extends u {
20
20
  constructor(t) {
21
21
  super(t);
22
22
  i(this, "name", "RectangleMesh");
@@ -41,9 +41,9 @@ class U extends u {
41
41
  const [m, s, n] = o, p = m.clone().add(n).sub(s);
42
42
  o.push(p);
43
43
  }
44
- this.up.copy(f(o, d.modules.five.camera.position)), this.points = o, this.geometry = new g(o), this.planeHelperNeedUpdate = !0;
44
+ this.up.copy(f(o, d.modules.five.camera.position)), this.points = o, this.geometry = new g(o), this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0;
45
45
  }
46
46
  }
47
47
  export {
48
- U as RectangleMesh
48
+ T as RectangleMesh
49
49
  };
@@ -11,29 +11,29 @@ var E = (s, t, e) => t in s ? U(s, t, { enumerable: !0, configurable: !0, writab
11
11
  return s;
12
12
  }, u = (s, t) => k(s, B(t));
13
13
  var L = (s, t, e) => (E(s, typeof t != "symbol" ? t + "" : t, e), e);
14
- var D = (s, t, e) => new Promise((c, w) => {
15
- var a = (o) => {
14
+ var D = (s, t, e) => new Promise((c, p) => {
15
+ var a = (l) => {
16
16
  try {
17
- g(e.next(o));
17
+ g(e.next(l));
18
18
  } catch (h) {
19
- w(h);
19
+ p(h);
20
20
  }
21
- }, m = (o) => {
21
+ }, m = (l) => {
22
22
  try {
23
- g(e.throw(o));
23
+ g(e.throw(l));
24
24
  } catch (h) {
25
- w(h);
25
+ p(h);
26
26
  }
27
- }, g = (o) => o.done ? c(o.value) : Promise.resolve(o.value).then(a, m);
27
+ }, g = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(a, m);
28
28
  g((e = e.apply(s, t)).next());
29
29
  });
30
30
  import { hotkeys as j } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
31
31
  import { BaseObject as q } from "../Base/index.js";
32
- import * as r from "three";
32
+ import * as o from "three";
33
33
  import { PolylineWithDotsMesh as M } from "../../Meshes/Polyline.js";
34
34
  import { RectangleEditor as G } from "./Editor.js";
35
35
  import { RectangleWithEdgeMesh as H } from "../../Meshes/RectangleWithEdge.js";
36
- const P = new r.Vector3();
36
+ const P = new o.Vector3();
37
37
  class S extends q {
38
38
  constructor(e, c) {
39
39
  super(e, c);
@@ -70,51 +70,51 @@ class S extends q {
70
70
  }
71
71
  }
72
72
  function J(s, t, e) {
73
- return new Promise((c, w) => {
73
+ return new Promise((c, p) => {
74
74
  var N, T;
75
75
  const a = s.parent;
76
76
  if (!a)
77
- return w(new Error("No container"));
78
- const m = (N = e == null ? void 0 : e.limit) != null ? N : "none", g = (T = e == null ? void 0 : e.drawMethod) != null ? T : "diagonal", o = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), h = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(d({}, s.style), { dashed: !1, lengthEnable: !1 }));
79
- a.add(o, y, h), t.enable();
77
+ return p(new Error("No container"));
78
+ const m = (N = e == null ? void 0 : e.limit) != null ? N : "none", g = (T = e == null ? void 0 : e.drawMethod) != null ? T : "diagonal", l = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), h = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(d({}, s.style), { dashed: !1, lengthEnable: !1 }));
79
+ a.add(l, y, h), t.enable();
80
80
  const n = [];
81
- let i = new r.Vector3(), v = new r.Vector3();
82
- const f = new r.Plane(), C = () => {
83
- n.push(i.clone()), n.length === 1 ? (m === "xoz" && f.setFromNormalAndCoplanarPoint(new r.Vector3(0, 1, 0), n[0]), m === "none" && f.setFromNormalAndCoplanarPoint(v, n[0])) : n.length === 2 ? m === "y" ? (b(), c()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (b(), c());
84
- }, x = (l) => {
81
+ let i = new o.Vector3(), v = new o.Vector3();
82
+ const f = new o.Plane(), C = () => {
83
+ n.push(i.clone()), n.length === 1 ? (m === "xoz" && f.setFromNormalAndCoplanarPoint(new o.Vector3(0, 1, 0), n[0]), m === "none" && f.setFromNormalAndCoplanarPoint(v, n[0])) : n.length === 2 ? m === "y" ? (V(), c()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (V(), c());
84
+ }, x = (r) => {
85
85
  var W;
86
- if (!(l != null && l.raycaster))
86
+ if (!(r != null && r.raycaster))
87
87
  return;
88
88
  const O = (W = n.at(-1)) == null ? void 0 : W.clone();
89
89
  if (n.length === 0) {
90
- i = l.point.clone(), v = l.face.normal;
90
+ i = r.point.clone(), v = r.face.normal;
91
91
  return;
92
92
  }
93
93
  if (n.length === 1 && m === "y") {
94
- const p = new r.Line3(new r.Vector3(0, 1, 0).add(n[0]), new r.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(l.point, !1, P);
95
- s.setPoints([n[0], p, l.point]);
94
+ const w = new o.Line3(new o.Vector3(0, 1, 0).add(n[0]), new o.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(r.point, !1, new o.Vector3());
95
+ s.setPoints([n[0], w, r.point]);
96
96
  return;
97
97
  }
98
98
  if (n.length === 1) {
99
- f ? (i = l.raycaster.ray.intersectPlane(f, P), h.setPoints([i, l.point])) : i = l.point.clone(), o.setPoints([O, i]);
99
+ f ? (i = r.raycaster.ray.intersectPlane(f, P), h.setPoints([i, r.point])) : i = r.point.clone(), l.setPoints([O, i]);
100
100
  return;
101
101
  }
102
102
  if (n.length === 2) {
103
- a.remove(o);
104
- const z = l.raycaster.ray.intersectPlane(f, P);
103
+ a.remove(l);
104
+ const z = r.raycaster.ray.intersectPlane(f, P);
105
105
  if (g === "diagonal") {
106
- const p = n[0].distanceTo(n[1]) / 2, V = new r.Vector3().lerpVectors(n[0], n[1], 0.5), F = new r.Vector3().subVectors(z, V).normalize();
107
- i = new r.Vector3().addVectors(V, F.multiplyScalar(p)), s.setPoints([n[0], i, n[1]]);
106
+ const w = n[0].distanceTo(n[1]) / 2, b = new o.Vector3().lerpVectors(n[0], n[1], 0.5), F = new o.Vector3().subVectors(z, b).normalize();
107
+ i = new o.Vector3().addVectors(b, F.multiplyScalar(w)), s.setPoints([n[0], i, n[1]]);
108
108
  } else if (g === "vertex") {
109
- const p = P.crossVectors(n[0].clone().sub(n[1]), f.normal).normalize();
110
- i = new r.Line3(n[1].clone().add(p), n[1].clone().sub(p)).closestPointToPoint(l.point, !1, P), s.setPoints([n[0], n[1], i]);
109
+ const w = P.crossVectors(n[0].clone().sub(n[1]), f.normal).normalize();
110
+ i = new o.Line3(n[1].clone().add(w), n[1].clone().sub(w)).closestPointToPoint(r.point, !1, P), s.setPoints([n[0], n[1], i]);
111
111
  }
112
112
  return;
113
113
  }
114
- }, b = () => {
115
- t.off("select", C), t.off("intersectionUpdate", x), t.off("disable", R), t.disable(), a == null || a.remove(o, y, h);
114
+ }, V = () => {
115
+ t.off("select", C), t.off("intersectionUpdate", x), t.off("disable", R), t.disable(), a == null || a.remove(l, y, h);
116
116
  }, R = () => {
117
- b(), a == null || a.remove(s), w(new Error("Cancelled"));
117
+ V(), a == null || a.remove(s), p(new Error("Cancelled"));
118
118
  };
119
119
  t.on("select", C), t.on("intersectionUpdate", x), t.on("disable", R);
120
120
  });
@@ -18,7 +18,7 @@ let P = class {
18
18
  /**
19
19
  * @realsee/dnalogel 版本号
20
20
  */
21
- i(this, "VERSION", "3.47.11");
21
+ i(this, "VERSION", "3.47.13");
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.47.11",
3
+ "%c %c@realsee/dnalogel %cv3.47.13",
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.47.11",
3
+ "version": "3.47.13",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",