@realsee/dnalogel 3.48.5 → 3.48.7

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.
Files changed (46) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
  3. package/dist/Sculpt/Meshes/Line.d.ts +1 -0
  4. package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  5. package/dist/Sculpt/Meshes/Polyline.d.ts +2 -0
  6. package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
  7. package/dist/index.cjs.js +47 -47
  8. package/dist/index.js +2049 -1975
  9. package/dist/index.umd.js +41 -41
  10. package/dist/shared-utils/three/PointSelector/index.d.ts +12 -4
  11. package/dist/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
  12. package/dist/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
  13. package/libs/ModelMakerPlugin/Controller.js +3 -2
  14. package/libs/ModelMakerPlugin/index.js +3 -2
  15. package/libs/PanoMeasurePlugin/Components/Controller0.js +21 -20
  16. package/libs/PanoMeasurePlugin/Components/Controller1.js +4 -3
  17. package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -3
  18. package/libs/PanoMeasurePlugin/Controller/ViewController.js +32 -32
  19. package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
  20. package/libs/PanoMeasurePlugin/Controller/index.js +4 -3
  21. package/libs/PanoMeasurePlugin/Model/area.js +3 -2
  22. package/libs/PanoMeasurePlugin/Model/polygon.js +8 -7
  23. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +4 -3
  24. package/libs/PanoMeasurePlugin/index.js +15 -14
  25. package/libs/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
  26. package/libs/PanoMeasurePlugin/utils/isIntersecting.js +39 -16
  27. package/libs/Sculpt/Meshes/Line.d.ts +1 -0
  28. package/libs/Sculpt/Meshes/Line.js +64 -56
  29. package/libs/Sculpt/Meshes/Polygon.js +3 -3
  30. package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  31. package/libs/Sculpt/Meshes/Polyline.d.ts +2 -0
  32. package/libs/Sculpt/Meshes/Polyline.js +67 -66
  33. package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
  34. package/libs/Sculpt/Objects/Polygon/index.js +63 -64
  35. package/libs/Sculpt/Objects/Polyline/index.js +8 -9
  36. package/libs/Sculpt/index.js +1 -1
  37. package/libs/base/BasePlugin.js +1 -1
  38. package/libs/index.js +127 -126
  39. package/libs/shared-utils/logger.js +1 -1
  40. package/libs/shared-utils/three/PointSelector/index.d.ts +12 -4
  41. package/libs/shared-utils/three/PointSelector/index.js +83 -56
  42. package/libs/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
  43. package/libs/shared-utils/three/PointSelector/utils/contents.js +4 -0
  44. package/libs/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
  45. package/libs/shared-utils/three/generatePolygonGeometry.js +19 -8
  46. package/package.json +1 -1
@@ -11,5 +11,5 @@ interface Line3D {
11
11
  * @description 判断线段是否相交
12
12
  * @todo ai写的一些变量名起的比较怪,懒得改了
13
13
  */
14
- export default function isIntersecting(line1: Line3D, line2: Line3D | Line3D[]): boolean;
14
+ export declare function isIntersecting(line1: Line3D, line2: Line3D | Line3D[]): boolean;
15
15
  export {};
@@ -1,25 +1,48 @@
1
- function m(t, n) {
2
- const e = Array.isArray(n) ? n : [n];
3
- for (let o = 0; o < e.length; o++) {
4
- const x = e[o], r = t.start, u = t.end, s = x.start, i = x.end;
5
- if (c(r, s) || c(r, i) || c(u, s) || c(u, i) || c(r, u))
6
- continue;
7
- const z = f(r, u, s), d = f(r, u, i), l = f(s, i, r), h = f(s, i, u);
8
- if (z !== d && l !== h || z === 0 && a(r, u, s) || d === 0 && a(r, u, i) || l === 0 && a(s, i, r) || h === 0 && a(s, i, u))
1
+ function a(n, t) {
2
+ const s = Array.isArray(t) ? t : [t];
3
+ for (let u = 0; u < s.length; u++) {
4
+ const r = n.start, e = n.end, c = s[u].start, o = s[u].end;
5
+ if (!(f(r, c) || f(r, o) || f(e, c) || f(e, o) || f(r, e)) && d([r.x, r.y, r.z], [e.x, e.y, e.z], [c.x, c.y, c.z], [o.x, o.y, o.z]))
9
6
  return !0;
10
7
  }
11
8
  return !1;
12
9
  }
13
- function c(t, n) {
14
- return t.x === n.x && t.z === n.z && t.y === n.y;
10
+ function d(n, t, s, u) {
11
+ const r = [t[0] - n[0], t[1] - n[1], t[2] - n[2]], e = [u[0] - s[0], u[1] - s[1], u[2] - s[2]], c = [
12
+ [r[0], -e[0]],
13
+ [r[1], -e[1]],
14
+ [r[2], -e[2]]
15
+ ], o = [s[0] - n[0], s[1] - n[1], s[2] - n[2]], i = g(c, o);
16
+ if (i === null)
17
+ return !1;
18
+ const [x, z] = i;
19
+ return !!(y(x) && y(z));
15
20
  }
16
- function f(t, n, e) {
17
- const o = (e.z - t.z) * (n.x - t.x) - (n.z - t.z) * (e.x - t.x);
18
- return o === 0 ? 0 : o < 0 ? 2 : 1;
21
+ function g(n, t) {
22
+ if (q(n) === 0)
23
+ return null;
24
+ const u = I(n);
25
+ return V(u, t);
19
26
  }
20
- function a(t, n, e) {
21
- return n.x <= Math.max(t.x, e.x) && n.x >= Math.min(t.x, e.x) && n.z <= Math.max(t.z, e.z) && n.z >= Math.min(t.z, e.z);
27
+ function q(n) {
28
+ return n[0][0] * n[1][1] - n[0][1] * n[1][0];
29
+ }
30
+ function I(n) {
31
+ const t = n[0][0] * n[1][1] - n[0][1] * n[1][0];
32
+ return [
33
+ [n[1][1] / t, -n[0][1] / t],
34
+ [-n[1][0] / t, n[0][0] / t]
35
+ ];
36
+ }
37
+ function V(n, t) {
38
+ return [n[0][0] * t[0] + n[0][1] * t[1], n[1][0] * t[0] + n[1][1] * t[1]];
39
+ }
40
+ function y(n) {
41
+ return n >= 0 && n <= 1;
42
+ }
43
+ function f(n, t) {
44
+ return n.x === t.x && n.y === t.y && n.z === t.z;
22
45
  }
23
46
  export {
24
- m as default
47
+ a as isIntersecting
25
48
  };
@@ -33,6 +33,7 @@ export declare class LineMesh extends IObject3D {
33
33
  points: THREE.Vector3[];
34
34
  lengthDoms: LightTag[];
35
35
  get style(): LineMeshStyle;
36
+ get opacity(): number;
36
37
  get lineWidth(): number;
37
38
  get color(): THREE.Color;
38
39
  get dashed(): boolean;
@@ -1,37 +1,37 @@
1
- var _ = Object.defineProperty;
1
+ var E = Object.defineProperty;
2
2
  var m = Object.getOwnPropertySymbols;
3
- var k = Object.prototype.hasOwnProperty, p = Object.prototype.propertyIsEnumerable;
4
- var f = (o, s, e) => s in o ? _(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, y = (o, s) => {
5
- for (var e in s || (s = {}))
6
- k.call(s, e) && f(o, e, s[e]);
3
+ var _ = Object.prototype.hasOwnProperty, T = Object.prototype.propertyIsEnumerable;
4
+ var f = (l, o, e) => o in l ? E(l, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[o] = e, y = (l, o) => {
5
+ for (var e in o || (o = {}))
6
+ _.call(o, e) && f(l, e, o[e]);
7
7
  if (m)
8
- for (var e of m(s))
9
- p.call(s, e) && f(o, e, s[e]);
10
- return o;
8
+ for (var e of m(o))
9
+ T.call(o, e) && f(l, e, o[e]);
10
+ return l;
11
11
  };
12
- var l = (o, s, e) => (f(o, typeof s != "symbol" ? s + "" : s, e), e);
12
+ var h = (l, o, e) => (f(l, typeof o != "symbol" ? o + "" : o, e), e);
13
13
  import * as u from "three";
14
- import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as S, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
14
+ import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as k, DEFAULT_HIGHLIGHT_OPACITY as p } from "../typings/style.js";
15
15
  import { LineGeometry as L, LineMaterial as w, THREE_Line2 as I } from "../../shared-utils/five/FiveLine.js";
16
16
  import { anyPositionToVector3 as H } from "../../shared-utils/positionToVector3.js";
17
- import { IObject3D as R } from "../../shared-utils/three/IObject3D.js";
17
+ import { IObject3D as C } from "../../shared-utils/three/IObject3D.js";
18
18
  import "hammerjs";
19
19
  import "three/examples/jsm/renderers/CSS3DRenderer";
20
- import { centerPoint as C } from "../../shared-utils/three/centerPoint.js";
20
+ import { centerPoint as R } from "../../shared-utils/three/centerPoint.js";
21
21
  import { LightTag as x } from "../../shared-utils/tag.js";
22
- import { removeAllTag as v } from "../utils/removeAllTag.js";
23
- import { getLengthHTML as W } from "../utils/Meshes/getLengthHTML.js";
24
- import { applyObjectMatrixWorld as T } from "../../shared-utils/three/applyObjectMatrixWorld.js";
22
+ import { removeAllTag as W } from "../utils/removeAllTag.js";
23
+ import { getLengthHTML as v } from "../utils/Meshes/getLengthHTML.js";
24
+ import { applyObjectMatrixWorld as D } from "../../shared-utils/three/applyObjectMatrixWorld.js";
25
25
  import "../../shared-utils/three/THREESphere.js";
26
26
  import "animejs";
27
- import { notNil as c } from "../../shared-utils/isNil.js";
27
+ import { notNil as d } from "../../shared-utils/isNil.js";
28
28
  import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
29
- class E extends w {
29
+ class S extends w {
30
30
  constructor(e) {
31
31
  var i, t;
32
32
  super(e);
33
- l(this, "_three_color");
34
- 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) => {
33
+ h(this, "_three_color");
34
+ d(e == null ? void 0 : e.color) && (this.three_color = (i = e == null ? void 0 : e.color) != null ? i : 16777215), Object.keys(e).forEach((n) => {
35
35
  ["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(n) || n in this && (this[n] = e[n]);
36
36
  }), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
37
37
  }
@@ -48,68 +48,76 @@ class E extends w {
48
48
  class M extends I {
49
49
  constructor(e, i) {
50
50
  super(e, i);
51
- l(this, "name", "Line3");
51
+ h(this, "name", "Line3");
52
52
  }
53
53
  }
54
- class Q extends R {
54
+ class Q extends C {
55
55
  constructor(e) {
56
- var h, r, d, a, g;
56
+ var s, r, c, a, g;
57
57
  super();
58
- l(this, "name", "LineMesh");
59
- l(this, "points");
60
- l(this, "lengthDoms", []);
61
- l(this, "highlighted", !1);
62
- l(this, "line");
63
- l(this, "backLine");
64
- l(this, "opacityBeforeHighlight");
65
- l(this, "paramsStyle", {});
66
- l(this, "lastRenderLengthItem");
58
+ h(this, "name", "LineMesh");
59
+ h(this, "points");
60
+ h(this, "lengthDoms", []);
61
+ h(this, "highlighted", !1);
62
+ h(this, "line");
63
+ h(this, "backLine");
64
+ h(this, "opacityBeforeHighlight");
65
+ h(this, "paramsStyle", {});
66
+ h(this, "lastRenderLengthItem");
67
67
  this.paramsStyle = e != null ? e : {};
68
- const i = new L(), t = new E({
69
- color: new u.Color((h = e == null ? void 0 : e.lineColor) != null ? h : b),
70
- linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : S,
68
+ const i = new L(), t = new S({
69
+ color: new u.Color((s = e == null ? void 0 : e.lineColor) != null ? s : b),
70
+ linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : k,
71
71
  dashScale: 40,
72
- opacity: (d = e == null ? void 0 : e.opacity) != null ? d : 1,
72
+ opacity: (c = e == null ? void 0 : e.opacity) != null ? c : 1,
73
73
  transparent: !0,
74
74
  dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
75
- }), n = new E({
75
+ }), n = new S({
76
76
  color: new u.Color((g = e == null ? void 0 : e.lineColor) != null ? g : b),
77
77
  linewidth: t.linewidth * 0.9,
78
78
  dashScale: t.dashScale,
79
- opacity: t.opacity * 0.8,
79
+ opacity: t.opacity * 0.7,
80
80
  depthTest: !1,
81
81
  depthWrite: !1,
82
82
  transparent: !0,
83
83
  resolution: t.resolution
84
84
  });
85
85
  this.line = new M(i, t), this.backLine = new M(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", () => {
86
- v(this);
86
+ W(this);
87
87
  });
88
88
  }
89
89
  get style() {
90
90
  return {
91
91
  lineColor: this.color,
92
92
  lineWidth: this.lineWidth,
93
+ opacity: this.opacity,
93
94
  dashed: this.dashed,
94
95
  occlusionVisibility: this.occlusionVisibility,
95
96
  occlusionMode: this.occlusionMode,
96
97
  lengthEnable: this.paramsStyle.lengthEnable
97
98
  };
98
99
  }
100
+ get opacity() {
101
+ var e;
102
+ return (e = this.line.material.opacity) != null ? e : this.paramsStyle.opacity;
103
+ }
99
104
  get lineWidth() {
100
- return this.line.material.linewidth;
105
+ var e;
106
+ return (e = this.line.material.linewidth) != null ? e : this.paramsStyle.lineWidth;
101
107
  }
102
108
  get color() {
103
- return new u.Color(this.line.material.three_color);
109
+ var e;
110
+ return new u.Color((e = this.line.material.three_color) != null ? e : this.paramsStyle.lineColor);
104
111
  }
105
112
  get dashed() {
106
- return this.line.material.dashed;
113
+ var e;
114
+ return (e = this.line.material.dashed) != null ? e : this.paramsStyle.dashed;
107
115
  }
108
116
  get occlusionVisibility() {
109
- return this.backLine.visible || this.line.material.depthTest === !1;
117
+ return this.paramsStyle.occlusionVisibility;
110
118
  }
111
119
  get occlusionMode() {
112
- return this.line.material.depthTest === !1 ? "depthTest" : "translucence";
120
+ return this.paramsStyle.occlusionMode;
113
121
  }
114
122
  get five() {
115
123
  var e, i;
@@ -118,12 +126,12 @@ class Q extends R {
118
126
  updateMatrixWorld(e) {
119
127
  var i;
120
128
  if (super.updateMatrixWorld(e), this.points) {
121
- const t = (i = T(this, this.points)) == null ? void 0 : i.map((n) => n.toArray().join(",")).join(",");
129
+ const t = (i = D(this, this.points)) == null ? void 0 : i.map((n) => n.toArray().join(",")).join(",");
122
130
  t !== this.lastRenderLengthItem && (this.updateLengthItems(), this.lastRenderLengthItem = t);
123
131
  }
124
132
  }
125
133
  setPoints(e) {
126
- const i = e.map(H).filter(c);
134
+ const i = e.map(H).filter(d);
127
135
  if (this.points = i, i.length < 2) {
128
136
  this.line.geometry = new L(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
129
137
  return;
@@ -139,13 +147,13 @@ class Q extends R {
139
147
  (n.x !== e || n.y !== i) && (n.set(e, i), this.needsRender = !0);
140
148
  }
141
149
  setStyle(e) {
142
- var n, h, r;
143
- this.paramsStyle = y(y({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new u.Color(e.lineColor), this.backLine.material.three_color = new u.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();
144
- const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (h = e.occlusionMode) != null ? h : this.paramsStyle.occlusionMode) != null ? r : "translucence";
150
+ var n, s, r;
151
+ this.paramsStyle = y(y({}, this.paramsStyle), e), d(e.lineColor) && (this.line.material.three_color = new u.Color(e.lineColor), this.backLine.material.three_color = new u.Color(e.lineColor)), d(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), d(e.dashed) && this.line.material.setDashed(e.dashed), d(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.7), this.updateLengthItems();
152
+ const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (s = e.occlusionMode) != null ? s : this.paramsStyle.occlusionMode) != null ? r : "translucence";
145
153
  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;
146
154
  }
147
155
  highlight() {
148
- 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);
156
+ this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * p, this.backLine.material.opacity = this.backLine.material.opacity * p, this.needsRender = !0);
149
157
  }
150
158
  unhighlight() {
151
159
  this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
@@ -161,16 +169,16 @@ class Q extends R {
161
169
  const i = this.points.map((t, n) => {
162
170
  if (n !== 0)
163
171
  return [this.points[n - 1], t];
164
- }).filter(c).map((t) => T(this, t));
165
- i.forEach(([t, n], h) => {
172
+ }).filter(d).map((t) => D(this, t));
173
+ i.forEach(([t, n], s) => {
166
174
  var a;
167
- const r = C(t, n);
168
- this.lengthDoms[h] = (a = this.lengthDoms[h]) != null ? a : (() => {
175
+ const r = R(t, n);
176
+ this.lengthDoms[s] = (a = this.lengthDoms[s]) != null ? a : (() => {
169
177
  const g = new x(this.five);
170
178
  return g.intersectCheck = !1, g;
171
- })(), this.lengthDoms[h].setPosition(r, [t, n]);
172
- const d = t.distanceTo(n).toFixed(2);
173
- d === "0.00" ? this.lengthDoms[h].container.innerHTML = "" : this.lengthDoms[h].container.innerHTML = W(d + "m");
179
+ })(), this.lengthDoms[s].setPosition(r, [t, n]);
180
+ const c = t.distanceTo(n).toFixed(2);
181
+ this.lengthDoms[s].lengthDom !== c && (this.lengthDoms[s].lengthDom = c, c === "0.00" ? this.lengthDoms[s].container.innerHTML = "" : this.lengthDoms[s].container.innerHTML = v(c + "m"));
174
182
  }), this.lengthDoms.length > i.length && (this.lengthDoms.slice(i.length).forEach((t) => t.destroy()), this.lengthDoms.length = i.length);
175
183
  }
176
184
  }
@@ -23,7 +23,7 @@ import { applyObjectMatrixWorld as B } from "../../shared-utils/three/applyObjec
23
23
  const p = new l.BufferGeometry();
24
24
  p.name = "blankGeometry";
25
25
  p.isBlank = !0;
26
- class L extends _ {
26
+ class G extends _ {
27
27
  constructor(e) {
28
28
  super(e);
29
29
  r(this, "name", "PolygonMesh");
@@ -68,7 +68,7 @@ class L extends _ {
68
68
  setPoints(e) {
69
69
  var o;
70
70
  const s = e.map(P);
71
- this.points = s, this.geometry = (o = I(this.points)) != null ? o : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
71
+ this.points = s, this.geometry = (o = I(this.points, { checkLinesIntersect: !0 })) != null ? o : p, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
72
72
  }
73
73
  /**
74
74
  * @description: 获取一个点投影在当前平面上的点
@@ -104,5 +104,5 @@ class L extends _ {
104
104
  }
105
105
  }
106
106
  export {
107
- L as PolygonMesh
107
+ G as PolygonMesh
108
108
  };
@@ -20,7 +20,7 @@ export declare class PolygonWithEdgeMesh extends PolygonMesh {
20
20
  };
21
21
  get lineWidth(): number;
22
22
  get lineColor(): THREE.Color;
23
- protected line: PolylineMesh;
23
+ line: PolylineMesh;
24
24
  constructor(params?: Partial<PolygonWithEdgeMeshStyle & PolygonData>);
25
25
  raycast(raycaster: THREE.Raycaster, intersects: THREE.Intersection[]): boolean;
26
26
  setPoints(points: AnyPositions, params?: {
@@ -11,11 +11,13 @@ export declare abstract class PolylineBaseMesh extends IObject3D {
11
11
  get style(): {
12
12
  lineColor: THREE.Color;
13
13
  lineWidth: number;
14
+ opacity: number;
14
15
  dashed: boolean;
15
16
  occlusionVisibility: boolean;
16
17
  occlusionMode: "translucence" | "depthTest";
17
18
  lengthEnable: boolean;
18
19
  };
20
+ get opacity(): number;
19
21
  get lineColor(): THREE.Color;
20
22
  get lineWidth(): number;
21
23
  get dashed(): boolean;
@@ -1,49 +1,41 @@
1
- var P = Object.defineProperty, S = Object.defineProperties;
2
- var M = Object.getOwnPropertyDescriptors;
1
+ var M = Object.defineProperty, E = Object.defineProperties;
2
+ var b = Object.getOwnPropertyDescriptors;
3
3
  var a = Object.getOwnPropertySymbols;
4
- var u = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
- var m = (s, e, t) => e in s ? P(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t, h = (s, e) => {
6
- for (var t in e || (e = {}))
7
- u.call(e, t) && m(s, t, e[t]);
4
+ var g = Object.prototype.hasOwnProperty, f = Object.prototype.propertyIsEnumerable;
5
+ var p = (e, o, t) => o in e ? M(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t, r = (e, o) => {
6
+ for (var t in o || (o = {}))
7
+ g.call(o, t) && p(e, t, o[t]);
8
8
  if (a)
9
- for (var t of a(e))
10
- y.call(e, t) && m(s, t, e[t]);
11
- return s;
12
- }, c = (s, e) => S(s, M(e));
13
- var f = (s, e) => {
9
+ for (var t of a(o))
10
+ f.call(o, t) && p(e, t, o[t]);
11
+ return e;
12
+ }, c = (e, o) => E(e, b(o));
13
+ var S = (e, o) => {
14
14
  var t = {};
15
- for (var i in s)
16
- u.call(s, i) && e.indexOf(i) < 0 && (t[i] = s[i]);
17
- if (s != null && a)
18
- for (var i of a(s))
19
- e.indexOf(i) < 0 && y.call(s, i) && (t[i] = s[i]);
15
+ for (var i in e)
16
+ g.call(e, i) && o.indexOf(i) < 0 && (t[i] = e[i]);
17
+ if (e != null && a)
18
+ for (var i of a(e))
19
+ o.indexOf(i) < 0 && f.call(e, i) && (t[i] = e[i]);
20
20
  return t;
21
21
  };
22
- var l = (s, e, t) => (m(s, typeof e != "symbol" ? e + "" : e, t), t);
23
- import { anyPositionToVector3 as b } from "../../shared-utils/positionToVector3.js";
24
- import { IObject3D as E } from "../../shared-utils/three/IObject3D.js";
25
- import * as D from "three";
26
- import "hammerjs";
27
- import "three/examples/jsm/renderers/CSS3DRenderer";
28
- import "@realsee/five/line";
29
- import "../../shared-utils/tag.js";
30
- import { removeAllTag as V } from "../utils/removeAllTag.js";
31
- import "../../shared-utils/three/THREESphere.js";
32
- import "animejs";
33
- import { notNil as W } from "../../shared-utils/isNil.js";
34
- import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
35
- import { LineWithDotsMesh as v } from "./LineWithDots.js";
22
+ var n = (e, o, t) => (p(e, typeof o != "symbol" ? o + "" : o, t), t);
23
+ import { anyPositionToVector3 as D } from "../../shared-utils/positionToVector3.js";
24
+ import { IObject3D as V } from "../../shared-utils/three/IObject3D.js";
25
+ import { LineWithDotsMesh as W } from "./LineWithDots.js";
26
+ import * as v from "three";
36
27
  import { closeVectors as w } from "../../shared-utils/three/closeVectors.js";
37
- class g extends E {
28
+ import { removeAllTag as C } from "../utils/removeAllTag.js";
29
+ class P extends V {
38
30
  constructor(t) {
39
31
  super();
40
- l(this, "name", "PolylineBaseMesh");
41
- l(this, "lines", []);
42
- l(this, "withDots");
43
- l(this, "paramsStyle");
44
- const r = t, { withDots: i, points: o } = r, n = f(r, ["withDots", "points"]);
45
- this.withDots = i != null ? i : !0, o && this.setPoints(o), n && this.setStyle(n), this.addEventListener("removed", () => {
46
- V(this);
32
+ n(this, "name", "PolylineBaseMesh");
33
+ n(this, "lines", []);
34
+ n(this, "withDots");
35
+ n(this, "paramsStyle");
36
+ const l = t, { withDots: i, points: s } = l, h = S(l, ["withDots", "points"]);
37
+ this.withDots = i != null ? i : !0, s && this.setPoints(s), h && this.setStyle(h), this.addEventListener("removed", () => {
38
+ C(this);
47
39
  });
48
40
  }
49
41
  get style() {
@@ -51,50 +43,59 @@ class g extends E {
51
43
  return {
52
44
  lineColor: this.lineColor,
53
45
  lineWidth: this.lineWidth,
46
+ opacity: this.opacity,
54
47
  dashed: this.dashed,
55
48
  occlusionVisibility: this.occlusionVisibility,
56
49
  occlusionMode: this.occlusionMode,
57
50
  lengthEnable: (t = this.paramsStyle) == null ? void 0 : t.lengthEnable
58
51
  };
59
52
  }
53
+ get opacity() {
54
+ var t, i, s;
55
+ return (s = (t = this.lines[0]) == null ? void 0 : t.opacity) != null ? s : (i = this.paramsStyle) == null ? void 0 : i.opacity;
56
+ }
60
57
  get lineColor() {
61
- var t, i, o;
62
- return (o = (t = this.lines[0]) == null ? void 0 : t.color) != null ? o : (i = this.paramsStyle) != null && i.lineColor ? new D.Color(this.paramsStyle.lineColor) : void 0;
58
+ var t, i, s;
59
+ return (s = (t = this.lines[0]) == null ? void 0 : t.color) != null ? s : (i = this.paramsStyle) != null && i.lineColor ? new v.Color(this.paramsStyle.lineColor) : void 0;
63
60
  }
64
61
  get lineWidth() {
65
- var t, i, o;
66
- return (o = (t = this.lines[0]) == null ? void 0 : t.lineWidth) != null ? o : (i = this.paramsStyle) == null ? void 0 : i.lineWidth;
62
+ var t, i, s;
63
+ return (s = (t = this.lines[0]) == null ? void 0 : t.lineWidth) != null ? s : (i = this.paramsStyle) == null ? void 0 : i.lineWidth;
67
64
  }
68
65
  get dashed() {
69
- var t, i, o;
70
- return (o = (t = this.lines[0]) == null ? void 0 : t.dashed) != null ? o : (i = this.paramsStyle) == null ? void 0 : i.dashed;
66
+ var t, i, s;
67
+ return (s = (t = this.lines[0]) == null ? void 0 : t.dashed) != null ? s : (i = this.paramsStyle) == null ? void 0 : i.dashed;
71
68
  }
72
69
  get occlusionVisibility() {
73
- var t, i, o;
74
- return (o = (t = this.lines[0]) == null ? void 0 : t.occlusionVisibility) != null ? o : (i = this.paramsStyle) == null ? void 0 : i.occlusionVisibility;
70
+ var t, i, s;
71
+ return (s = (t = this.lines[0]) == null ? void 0 : t.occlusionVisibility) != null ? s : (i = this.paramsStyle) == null ? void 0 : i.occlusionVisibility;
75
72
  }
76
73
  get occlusionMode() {
77
- var t, i, o;
78
- return (o = (t = this.lines[0]) == null ? void 0 : t.occlusionMode) != null ? o : (i = this.paramsStyle) == null ? void 0 : i.occlusionMode;
74
+ var t, i, s;
75
+ return (s = (t = this.lines[0]) == null ? void 0 : t.occlusionMode) != null ? s : (i = this.paramsStyle) == null ? void 0 : i.occlusionMode;
79
76
  }
80
77
  get points() {
81
78
  var t;
82
79
  return this.lines.map((i) => i.points[0]).concat((t = this.lines.at(-1)) == null ? void 0 : t.points[1]).filter(Boolean);
83
80
  }
84
81
  setPoints(t, i = { closed: !1 }) {
85
- let o = t.map(b);
86
- i.closed && (o = w(o)), this.lines.length && this.lines.forEach((n) => n.removeFromParent()), this.lines = o.map((n, r) => {
87
- const p = o[r + 1];
88
- if (r !== 0 && p === void 0)
82
+ let s = t.map(D);
83
+ i.closed && (s = w(s)), s.forEach((h, l) => {
84
+ var d;
85
+ const m = s[l + 1];
86
+ if (l !== 0 && m === void 0)
89
87
  return null;
90
- const d = new v(c(h({}, this.style), {
91
- pointVisibility: this.withDots ? { startPoint: r === 0, endPoint: !0 } : !1
92
- }));
93
- return d.setPoints([n, p]), d;
94
- }).filter(W), this.add(...this.lines);
88
+ const u = (d = this.lines[l]) != null ? d : (() => {
89
+ const y = new W(c(r({}, this.style), {
90
+ pointVisibility: this.withDots ? { startPoint: l === 0, endPoint: !0 } : !1
91
+ }));
92
+ return this.lines[l] = y, this.add(y), y;
93
+ })();
94
+ u.setStyle(this.style), u.setPoints([h, m]);
95
+ }), this.lines.length > s.length - 1 && this.lines.splice(s.length - 1).forEach((h) => h.removeFromParent());
95
96
  }
96
97
  setStyle(t) {
97
- this.paramsStyle = h(h({}, this.paramsStyle), t), this.lines.forEach((i) => i.setStyle(this.paramsStyle));
98
+ this.paramsStyle = r(r({}, this.paramsStyle), t), this.lines.forEach((i) => i.setStyle(this.paramsStyle));
98
99
  }
99
100
  highlight() {
100
101
  this.lines.forEach((t) => t.highlight());
@@ -103,19 +104,19 @@ class g extends E {
103
104
  this.lines.forEach((t) => t.unhighlight());
104
105
  }
105
106
  }
106
- class q extends g {
107
+ class F extends P {
107
108
  constructor(...t) {
108
- super(c(h({}, t[0]), { withDots: !1 }));
109
- l(this, "name", "PolylineMesh");
109
+ super(c(r({}, t[0]), { withDots: !1 }));
110
+ n(this, "name", "PolylineMesh");
110
111
  }
111
112
  }
112
- class z extends g {
113
+ class H extends P {
113
114
  constructor(...t) {
114
- super(c(h({}, t[0]), { withDots: !0 }));
115
- l(this, "name", "PolylineWithDotsMesh");
115
+ super(c(r({}, t[0]), { withDots: !0 }));
116
+ n(this, "name", "PolylineWithDotsMesh");
116
117
  }
117
118
  }
118
119
  export {
119
- q as PolylineMesh,
120
- z as PolylineWithDotsMesh
120
+ F as PolylineMesh,
121
+ H as PolylineWithDotsMesh
121
122
  };
@@ -11,12 +11,12 @@ export declare class RectangleWithEdgeMesh extends RectangleMesh {
11
11
  get style(): {
12
12
  lineColor: import("three").Color;
13
13
  lineWidth: number;
14
+ opacity: number;
14
15
  dashed: boolean;
15
16
  occlusionVisibility: boolean;
16
17
  occlusionMode: "translucence" | "depthTest";
17
18
  lengthEnable: boolean;
18
19
  color: import("three").Color;
19
- opacity: number;
20
20
  };
21
21
  get lineWidth(): number;
22
22
  get lineColor(): import("three").Color;