@realsee/dnalogel 3.47.16 → 3.48.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.
- package/CHANGELOG.md +6 -0
- package/dist/Sculpt/Objects/Base/index.d.ts +16 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +12 -1
- package/dist/Sculpt/index.d.ts +5 -2
- package/dist/index.cjs.js +53 -53
- package/dist/index.js +4012 -3963
- package/dist/index.umd.js +46 -46
- package/dist/shared-utils/promise/withResolvers.d.ts +10 -0
- package/dist/shared-utils/three/Magnifier.d.ts +1 -1
- package/dist/shared-utils/three/PointSelector/utils/PointSelectorHelper.d.ts +4 -1
- package/libs/PanoTagPlugin/Components/Common/Media.js +256 -272
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +1 -1
- package/libs/Sculpt/Meshes/Line.js +15 -15
- package/libs/Sculpt/Objects/Base/index.d.ts +16 -0
- package/libs/Sculpt/Objects/Base/index.js +58 -32
- package/libs/Sculpt/Objects/Box/index.js +31 -34
- package/libs/Sculpt/Objects/Circle/index.js +36 -39
- package/libs/Sculpt/Objects/Line/index.d.ts +12 -1
- package/libs/Sculpt/Objects/Line/index.js +104 -75
- package/libs/Sculpt/Objects/Point/index.js +13 -16
- package/libs/Sculpt/Objects/Polygon/index.js +18 -21
- package/libs/Sculpt/Objects/Polyline/index.js +27 -30
- package/libs/Sculpt/Objects/Prism/index.js +16 -19
- package/libs/Sculpt/Objects/Rectangle/index.js +36 -39
- package/libs/Sculpt/index.d.ts +5 -2
- package/libs/Sculpt/index.js +80 -65
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +127 -126
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/promise/withResolvers.d.ts +10 -0
- package/libs/shared-utils/promise/withResolvers.js +13 -0
- package/libs/shared-utils/tag.js +9 -9
- package/libs/shared-utils/three/Magnifier.d.ts +1 -1
- package/libs/shared-utils/three/Magnifier.js +12 -12
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.d.ts +4 -1
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +9 -9
- package/libs/vendor/svelte/transition/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,55 +1,54 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var k = Object.defineProperty, z = Object.defineProperties;
|
|
2
|
+
var B = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var j = Object.getOwnPropertySymbols;
|
|
4
|
+
var F = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var b = (n, t, e) => t in n ? k(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, f = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
7
|
+
F.call(t, e) && b(n, e, t[e]);
|
|
8
|
+
if (j)
|
|
9
|
+
for (var e of j(t))
|
|
10
|
+
I.call(t, e) && b(n, e, t[e]);
|
|
11
|
+
return n;
|
|
12
|
+
}, M = (n, t) => z(n, B(t));
|
|
13
|
+
var w = (n, t, e) => (b(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var H = (n, t, e) => new Promise((s, p) => {
|
|
15
|
+
var P = (o) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
c(e.next(o));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
p(l);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, L = (o) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
c(e.throw(o));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
p(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, c = (o) => o.done ? s(o.value) : Promise.resolve(o.value).then(P, L);
|
|
28
|
+
c((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
const
|
|
39
|
-
class
|
|
40
|
-
constructor(e,
|
|
41
|
-
super(e,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
});
|
|
30
|
+
import { LineMesh as T } from "../../Meshes/Line.js";
|
|
31
|
+
import { BaseObject as N } from "../Base/index.js";
|
|
32
|
+
import * as a from "three";
|
|
33
|
+
import { LineEditor as _ } from "./Editor.js";
|
|
34
|
+
import { vector3ToArray as q } from "../../../shared-utils/three/vector3ToArray.js";
|
|
35
|
+
import { LineWithDotsMesh as W } from "../../Meshes/LineWithDots.js";
|
|
36
|
+
import { rayOnLine as G } from "../../utils/three/rayOnLine.js";
|
|
37
|
+
import { withResolvers as J } from "../../../shared-utils/promise/withResolvers.js";
|
|
38
|
+
const O = new a.Vector3();
|
|
39
|
+
class ie extends N {
|
|
40
|
+
constructor(e, s) {
|
|
41
|
+
super(e, s);
|
|
42
|
+
w(this, "type", "Line");
|
|
43
|
+
w(this, "lineMesh");
|
|
44
|
+
w(this, "creatingLine");
|
|
45
|
+
e && (this.lineMesh = new W(f(f({}, e.style), e)), this.add(this.lineMesh)), this.editor = new _(this);
|
|
47
46
|
}
|
|
48
47
|
get data() {
|
|
49
|
-
return
|
|
50
|
-
points:
|
|
48
|
+
return M(f({}, this.baseData), {
|
|
49
|
+
points: q(this.applyObjectMatrixWorld(this.lineMesh.points)),
|
|
51
50
|
style: {
|
|
52
|
-
lineColor: new
|
|
51
|
+
lineColor: new a.Color(this.lineMesh.color).getHex(),
|
|
53
52
|
lineWidth: this.lineMesh.lineWidth,
|
|
54
53
|
dashed: this.lineMesh.dashed
|
|
55
54
|
}
|
|
@@ -63,45 +62,75 @@ class X extends k {
|
|
|
63
62
|
var e;
|
|
64
63
|
(e = this.lineMesh) == null || e.unhighlight();
|
|
65
64
|
}
|
|
65
|
+
canUndo() {
|
|
66
|
+
var e;
|
|
67
|
+
(e = this.creatingLine) == null || e.canUndo();
|
|
68
|
+
}
|
|
69
|
+
canRedo() {
|
|
70
|
+
var e;
|
|
71
|
+
(e = this.creatingLine) == null || e.canRedo();
|
|
72
|
+
}
|
|
73
|
+
undo() {
|
|
74
|
+
var e;
|
|
75
|
+
(e = this.creatingLine) == null || e.undo();
|
|
76
|
+
}
|
|
77
|
+
redo() {
|
|
78
|
+
var e;
|
|
79
|
+
(e = this.creatingLine) == null || e.redo();
|
|
80
|
+
}
|
|
66
81
|
create(e) {
|
|
67
|
-
return
|
|
82
|
+
return H(this, null, function* () {
|
|
68
83
|
this.removeChildren();
|
|
69
|
-
const
|
|
70
|
-
this.lineMesh =
|
|
84
|
+
const s = new W(e);
|
|
85
|
+
this.lineMesh = s, this.add(this.lineMesh), this.creatingLine = K(s, this.pointSelector, e), yield this.creatingLine.finished, this.editor.enable();
|
|
71
86
|
});
|
|
72
87
|
}
|
|
73
88
|
}
|
|
74
|
-
function
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
if (!
|
|
89
|
+
function K(n, t, e) {
|
|
90
|
+
var V;
|
|
91
|
+
const s = n.parent;
|
|
92
|
+
if (!s)
|
|
78
93
|
return;
|
|
79
|
-
const c = (
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}), d.setPoints([])) : (o = new r.Line3(n[0].clone(), new r.Vector3(0, 1, 0).add(n[0])).closestPointToPoint(l.point, !1, T), d.setPoints([o, l.point])), a.setPoints([w, o]));
|
|
97
|
-
}, b = () => {
|
|
98
|
-
t.off("select", L), t.off("intersectionUpdate", M), t.off("disable", v), t.plane = null, t.disable(), i == null || i.remove(a, d);
|
|
99
|
-
}, v = () => {
|
|
100
|
-
b(), n.length !== 2 && (i == null || i.remove(s)), p(new Error("Cancelled"));
|
|
94
|
+
const { promise: p, resolve: P, reject: L } = J(), c = (V = e == null ? void 0 : e.limit) != null ? V : "none", o = new T(n.style);
|
|
95
|
+
s.add(o);
|
|
96
|
+
const l = new T(M(f({}, n.style), { dashed: !0, lengthEnable: !1 }));
|
|
97
|
+
s.add(l), t.enable();
|
|
98
|
+
const i = [];
|
|
99
|
+
let h, d, v;
|
|
100
|
+
const m = [], E = () => i.length > 0, x = () => m.length > 0, A = () => {
|
|
101
|
+
E() && (m.push(i.pop()), n.setPoints(i), g(v), t.pointSelectorHelper.magnifier.render());
|
|
102
|
+
}, D = () => {
|
|
103
|
+
x() && (i.push(m.pop()), n.setPoints(i), g(v), t.pointSelectorHelper.magnifier.render());
|
|
104
|
+
}, C = (r) => {
|
|
105
|
+
m.length = 0;
|
|
106
|
+
const u = i.length === 0 ? r.point : h.clone();
|
|
107
|
+
i.push(u), n.setPoints(i), i.length === 2 && (R(), P());
|
|
108
|
+
}, g = (r) => {
|
|
109
|
+
const u = () => {
|
|
110
|
+
o.setPoints([]), l.setPoints([]), t.pointSelectorHelper.magnifier.render();
|
|
101
111
|
};
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
if (!(i != null && i.length) || !r)
|
|
113
|
+
return u();
|
|
114
|
+
v = r;
|
|
115
|
+
const y = i.at(-1).clone();
|
|
116
|
+
c === "none" ? (h = r.point, o.setPoints([y, h])) : c === "xoz" ? (t.plane = d, d = d != null ? d : new a.Plane().setFromNormalAndCoplanarPoint(new a.Vector3(0, 1, 0), i[0]), h = d.projectPoint(r.point, O), o.setPoints([y, h]), l.setPoints([h, r.point])) : c === "y" && (r.isVirtual ? (h = G({
|
|
117
|
+
raycaster: r.raycaster,
|
|
118
|
+
line: new a.Line3(i[0].clone(), new a.Vector3(0, 1, 0).add(i[0])),
|
|
119
|
+
clampToLine: !1
|
|
120
|
+
}), l.setPoints([])) : (h = new a.Line3(i[0].clone(), new a.Vector3(0, 1, 0).add(i[0])).closestPointToPoint(r.point, !1, O), l.setPoints([h, r.point])), o.setPoints([y, h]));
|
|
121
|
+
}, R = () => {
|
|
122
|
+
t.off("select", C), t.off("intersectionUpdate", g), t.off("disable", U), t.plane = null, t.disable(), s == null || s.remove(o, l);
|
|
123
|
+
}, U = () => {
|
|
124
|
+
R(), i.length !== 2 && (s == null || s.remove(n)), L(new Error("Cancelled"));
|
|
125
|
+
};
|
|
126
|
+
return t.on("select", C), t.on("intersectionUpdate", g), t.on("disable", U), {
|
|
127
|
+
finished: p,
|
|
128
|
+
canUndo: E,
|
|
129
|
+
canRedo: x,
|
|
130
|
+
undo: A,
|
|
131
|
+
redo: D
|
|
132
|
+
};
|
|
104
133
|
}
|
|
105
134
|
export {
|
|
106
|
-
|
|
135
|
+
ie as Line
|
|
107
136
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var y = Object.defineProperty, b = Object.defineProperties;
|
|
2
2
|
var u = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var d = Object.getOwnPropertySymbols;
|
|
4
4
|
var w = Object.prototype.hasOwnProperty, P = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var a = (e, i, t) => i in e ? y(e, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[i] = t, n = (e, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
7
|
w.call(i, t) && a(e, t, i[t]);
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
8
|
+
if (d)
|
|
9
|
+
for (var t of d(i))
|
|
10
10
|
P.call(i, t) && a(e, t, i[t]);
|
|
11
11
|
return e;
|
|
12
12
|
}, g = (e, i) => b(e, u(i));
|
|
13
13
|
var M = (e, i, t) => (a(e, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
|
-
var
|
|
14
|
+
var m = (e, i, t) => new Promise((o, h) => {
|
|
15
15
|
var r = (s) => {
|
|
16
16
|
try {
|
|
17
17
|
l(t.next(s));
|
|
@@ -29,21 +29,18 @@ var d = (e, i, t) => new Promise((o, h) => {
|
|
|
29
29
|
});
|
|
30
30
|
import { PointMesh as f } from "../../Meshes/Point.js";
|
|
31
31
|
import { BaseObject as x } from "../Base/index.js";
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
class H extends x {
|
|
32
|
+
import { PointEditor as j } from "./Editor.js";
|
|
33
|
+
import { vector3ToArray as v } from "../../../shared-utils/three/vector3ToArray.js";
|
|
34
|
+
class D extends x {
|
|
36
35
|
constructor(t, o) {
|
|
37
36
|
super(t, o);
|
|
38
37
|
M(this, "type", "Point");
|
|
39
38
|
M(this, "pointMesh");
|
|
40
|
-
this.editor = new
|
|
41
|
-
this.stopCreating();
|
|
42
|
-
});
|
|
39
|
+
this.editor = new j(this), t && (this.pointMesh = new f(n(n({}, t.style), t)), this.add(this.pointMesh));
|
|
43
40
|
}
|
|
44
41
|
get data() {
|
|
45
42
|
return g(n({}, this.baseData), {
|
|
46
|
-
point:
|
|
43
|
+
point: v(this.applyObjectMatrixWorld(this.pointMesh.position)),
|
|
47
44
|
style: {
|
|
48
45
|
color: this.pointMesh.color.getHex(),
|
|
49
46
|
size: this.pointMesh.size
|
|
@@ -70,12 +67,12 @@ class H extends x {
|
|
|
70
67
|
* @description: 创建点
|
|
71
68
|
*/
|
|
72
69
|
create(t) {
|
|
73
|
-
return
|
|
74
|
-
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new f(t)), yield
|
|
70
|
+
return m(this, null, function* () {
|
|
71
|
+
this.pointMesh && this.remove(this.pointMesh), this.add(this.pointMesh = new f(t)), yield z(this.pointMesh, this.pointSelector), this.editor.enable();
|
|
75
72
|
});
|
|
76
73
|
}
|
|
77
74
|
}
|
|
78
|
-
function
|
|
75
|
+
function z(e, i) {
|
|
79
76
|
return new Promise((t, o) => {
|
|
80
77
|
i.enable();
|
|
81
78
|
const h = (r) => {
|
|
@@ -88,5 +85,5 @@ function C(e, i) {
|
|
|
88
85
|
});
|
|
89
86
|
}
|
|
90
87
|
export {
|
|
91
|
-
|
|
88
|
+
D as Point
|
|
92
89
|
};
|
|
@@ -14,20 +14,19 @@ var M = (s, e, t) => (w(s, typeof e != "symbol" ? e + "" : e, t), t);
|
|
|
14
14
|
var T = (s, e, t) => new Promise((f, d) => {
|
|
15
15
|
var n = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
h(t.next(l));
|
|
18
18
|
} catch (o) {
|
|
19
19
|
d(o);
|
|
20
20
|
}
|
|
21
21
|
}, P = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
h(t.throw(l));
|
|
24
24
|
} catch (o) {
|
|
25
25
|
d(o);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, h = (l) => l.done ? f(l.value) : Promise.resolve(l.value).then(n, P);
|
|
28
|
+
h((t = t.apply(s, e)).next());
|
|
29
29
|
});
|
|
30
|
-
import { hotkeys as k } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
30
|
import { BaseObject as z } from "../Base/index.js";
|
|
32
31
|
import * as m from "three";
|
|
33
32
|
import { PolylineMesh as A } from "../../Meshes/Polyline.js";
|
|
@@ -35,14 +34,12 @@ import { AreaMesh as V } from "../../Meshes/Area.js";
|
|
|
35
34
|
import { PolygonEditor as B } from "./Editor.js";
|
|
36
35
|
import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
|
|
37
36
|
const D = new m.Vector3();
|
|
38
|
-
class
|
|
37
|
+
class K extends z {
|
|
39
38
|
constructor(t, f) {
|
|
40
39
|
super(t, f);
|
|
41
40
|
M(this, "type", "Polygon");
|
|
42
41
|
M(this, "areaMesh");
|
|
43
|
-
this.editor = new B(this), t && (this.areaMesh = new V(c(c({}, t.style), t)), this.add(this.areaMesh))
|
|
44
|
-
this.stopCreating();
|
|
45
|
-
});
|
|
42
|
+
this.editor = new B(this), t && (this.areaMesh = new V(c(c({}, t.style), t)), this.add(this.areaMesh));
|
|
46
43
|
}
|
|
47
44
|
get data() {
|
|
48
45
|
return this.updateMatrixWorld(), y(c({}, this.baseData), {
|
|
@@ -80,34 +77,34 @@ function I(s, e, t) {
|
|
|
80
77
|
d(new Error("No container"));
|
|
81
78
|
return;
|
|
82
79
|
}
|
|
83
|
-
const P = (C = t == null ? void 0 : t.limit) != null ? C : "none",
|
|
84
|
-
n == null || n.add(
|
|
80
|
+
const P = (C = t == null ? void 0 : t.limit) != null ? C : "none", h = new A(s.style);
|
|
81
|
+
n == null || n.add(h);
|
|
85
82
|
const l = new A(y(c({}, s.style), { dashed: !0, lengthEnable: !1 }));
|
|
86
83
|
n == null || n.add(l), e.enable();
|
|
87
84
|
const o = [];
|
|
88
85
|
let i, r, u = !1;
|
|
89
|
-
const v = (
|
|
90
|
-
const p = o.length === 0 ?
|
|
86
|
+
const v = (a) => {
|
|
87
|
+
const p = o.length === 0 ? a.point : i.clone();
|
|
91
88
|
o.push(p), s.setPoints(o, { closed: !1 }), u && (E(), f());
|
|
92
|
-
}, b = (
|
|
93
|
-
if (!(o != null && o.length) || !
|
|
89
|
+
}, b = (a) => {
|
|
90
|
+
if (!(o != null && o.length) || !a)
|
|
94
91
|
return;
|
|
95
92
|
const p = o.at(-1).clone();
|
|
96
|
-
if (o.length < 3 && (P === "none" ? (i =
|
|
97
|
-
i = s.projectPoint(
|
|
93
|
+
if (o.length < 3 && (P === "none" ? (i = a.point, h.setPoints([p, i])) : P === "xoz" ? (r = r != null ? r : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), o[0]), e.plane = r, i = r.projectPoint(a.point, D), h.setPoints([p, i]), l.setPoints([i, a.point])) : P === "y" && (o.length === 1 ? (i = a.point, h.setPoints([p, i])) : (r = r != null ? r : new m.Plane().setFromCoplanarPoints(o[0], o[1], new m.Vector3(0, 1, 0).add(o[0])), e.plane = r, i = r.projectPoint(a.point, D), h.setPoints([p, i]), l.setPoints([i, a.point])))), o.length >= 3) {
|
|
94
|
+
i = s.projectPoint(a.point);
|
|
98
95
|
const g = o[0], W = 0.2;
|
|
99
|
-
g.distanceTo(i) < W || g.distanceTo(
|
|
96
|
+
g.distanceTo(i) < W || g.distanceTo(a.point) < W ? (i = g, a.point.copy(g), e.pointSelectorHelper.updateWithIntersect(a, { emitEvent: !1 }), u = !0) : u = !1, h.setPoints([p, i]), l.setPoints([i, a.point]);
|
|
100
97
|
}
|
|
101
98
|
o.length >= 2 && s.setPoints([...o, i], { closed: !1 });
|
|
102
99
|
}, E = () => {
|
|
103
|
-
e.off("select", v), e.off("intersectionUpdate", b), e.off("disable", x), e.plane = null, e.disable(), n == null || n.remove(
|
|
100
|
+
e.off("select", v), e.off("intersectionUpdate", b), e.off("disable", x), e.plane = null, e.disable(), n == null || n.remove(h, l);
|
|
104
101
|
}, x = () => {
|
|
105
|
-
E(), n == null || n.remove(s, l,
|
|
102
|
+
E(), n == null || n.remove(s, l, h), d(new Error("Cancelled"));
|
|
106
103
|
};
|
|
107
104
|
e.on("select", v), e.on("intersectionUpdate", b), e.on("disable", x);
|
|
108
105
|
});
|
|
109
106
|
}
|
|
110
107
|
export {
|
|
111
|
-
|
|
108
|
+
K as Polygon,
|
|
112
109
|
I as createPolygon
|
|
113
110
|
};
|
|
@@ -2,50 +2,47 @@ var j = Object.defineProperty, W = Object.defineProperties;
|
|
|
2
2
|
var V = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var L = Object.getOwnPropertySymbols;
|
|
4
4
|
var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var f = (n, t, e) => t in n ? j(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, w = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
A.call(t, e) &&
|
|
7
|
+
A.call(t, e) && f(n, e, t[e]);
|
|
8
8
|
if (L)
|
|
9
9
|
for (var e of L(t))
|
|
10
|
-
D.call(t, e) &&
|
|
10
|
+
D.call(t, e) && f(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
12
|
}, u = (n, t) => W(n, V(t));
|
|
13
|
-
var g = (n, t, e) => (
|
|
14
|
-
var
|
|
13
|
+
var g = (n, t, e) => (f(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var b = (n, t, e) => new Promise((i, d) => {
|
|
15
15
|
var a = (h) => {
|
|
16
16
|
try {
|
|
17
17
|
y(e.next(h));
|
|
18
18
|
} catch (m) {
|
|
19
|
-
|
|
19
|
+
d(m);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, p = (h) => {
|
|
22
22
|
try {
|
|
23
23
|
y(e.throw(h));
|
|
24
24
|
} catch (m) {
|
|
25
|
-
|
|
25
|
+
d(m);
|
|
26
26
|
}
|
|
27
|
-
}, y = (h) => h.done ? i(h.value) : Promise.resolve(h.value).then(a,
|
|
27
|
+
}, y = (h) => h.done ? i(h.value) : Promise.resolve(h.value).then(a, p);
|
|
28
28
|
y((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import { BaseObject as O } from "../Base/index.js";
|
|
30
|
+
import { PolylineWithDotsMesh as C, PolylineMesh as x } from "../../Meshes/Polyline.js";
|
|
31
|
+
import { BaseObject as F } from "../Base/index.js";
|
|
33
32
|
import * as c from "three";
|
|
34
|
-
import { PolylineEditor as
|
|
35
|
-
import { vector3ToArray as
|
|
33
|
+
import { PolylineEditor as O } from "./Editor.js";
|
|
34
|
+
import { vector3ToArray as T } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
35
|
const E = new c.Vector3();
|
|
37
|
-
class
|
|
36
|
+
class k extends F {
|
|
38
37
|
constructor(e, i) {
|
|
39
38
|
super(e, i);
|
|
40
39
|
g(this, "type", "Polyline");
|
|
41
40
|
g(this, "polyLineMesh");
|
|
42
|
-
e && (this.polyLineMesh = new
|
|
43
|
-
this.stopCreating();
|
|
44
|
-
});
|
|
41
|
+
e && (this.polyLineMesh = new C(w(w({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new O(this);
|
|
45
42
|
}
|
|
46
43
|
get data() {
|
|
47
|
-
return u(
|
|
48
|
-
points:
|
|
44
|
+
return u(w({}, this.baseData), {
|
|
45
|
+
points: T(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
|
|
49
46
|
style: {
|
|
50
47
|
lineColor: new c.Color(this.polyLineMesh.lineColor).getHex(),
|
|
51
48
|
lineWidth: this.polyLineMesh.lineWidth,
|
|
@@ -62,22 +59,22 @@ class G extends O {
|
|
|
62
59
|
(e = this.polyLineMesh) == null || e.unhighlight();
|
|
63
60
|
}
|
|
64
61
|
create(e) {
|
|
65
|
-
return
|
|
62
|
+
return b(this, null, function* () {
|
|
66
63
|
this.removeChildren();
|
|
67
|
-
const i = new
|
|
68
|
-
this.polyLineMesh = i, this.add(this.polyLineMesh), yield
|
|
64
|
+
const i = new C(e);
|
|
65
|
+
this.polyLineMesh = i, this.add(this.polyLineMesh), yield U(i, this.pointSelector, e), this.editor.enable();
|
|
69
66
|
});
|
|
70
67
|
}
|
|
71
68
|
}
|
|
72
|
-
function
|
|
69
|
+
function U(n, t, e) {
|
|
73
70
|
var y;
|
|
74
71
|
const i = n.parent;
|
|
75
72
|
if (!i)
|
|
76
73
|
return;
|
|
77
|
-
const
|
|
74
|
+
const d = (y = e == null ? void 0 : e.limit) != null ? y : "none", a = new x(n.style);
|
|
78
75
|
i.add(a);
|
|
79
|
-
const
|
|
80
|
-
return i.add(
|
|
76
|
+
const p = new x(u(w({}, n.style), { dashed: !0, lengthEnable: !1 }));
|
|
77
|
+
return i.add(p), t.enable(), new Promise((h, m) => {
|
|
81
78
|
const o = [];
|
|
82
79
|
let l, s;
|
|
83
80
|
const M = (r) => {
|
|
@@ -87,15 +84,15 @@ function k(n, t, e) {
|
|
|
87
84
|
if (!(o != null && o.length) || !r)
|
|
88
85
|
return;
|
|
89
86
|
const P = o.at(-1).clone();
|
|
90
|
-
|
|
87
|
+
d === "none" ? (l = r.point, a.setPoints([P, l])) : d === "xoz" ? (s = s != null ? s : new c.Plane().setFromNormalAndCoplanarPoint(new c.Vector3(0, 1, 0), o[0]), t.plane = s, l = s.projectPoint(r.point, E), a.setPoints([P, l]), p.setPoints([l, r.point])) : d === "y" && (o.length === 1 ? (l = r.point, a.setPoints([P, l])) : (s = s != null ? s : new c.Plane().setFromCoplanarPoints(o[0], o[1], new c.Vector3(0, 1, 0).add(o[0])), t.plane = s, l = s.projectPoint(r.point, E), a.setPoints([P, l]), p.setPoints([l, r.point])));
|
|
91
88
|
};
|
|
92
89
|
t.on("select", M), t.on("intersectionUpdate", v), t.on("disable", () => {
|
|
93
|
-
if (t.off("select", M), t.off("intersectionUpdate", v), t.plane = null, i.remove(a), i.remove(
|
|
90
|
+
if (t.off("select", M), t.off("intersectionUpdate", v), t.plane = null, i.remove(a), i.remove(p), o.length < 2)
|
|
94
91
|
return i.remove(n), m(new Error("Cancelled"));
|
|
95
92
|
h();
|
|
96
93
|
});
|
|
97
94
|
});
|
|
98
95
|
}
|
|
99
96
|
export {
|
|
100
|
-
|
|
97
|
+
k as Polyline
|
|
101
98
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var E = Object.defineProperty, L = Object.defineProperties;
|
|
2
2
|
var O = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var u = Object.getOwnPropertySymbols;
|
|
4
|
-
var v = Object.prototype.hasOwnProperty,
|
|
4
|
+
var v = Object.prototype.hasOwnProperty, W = Object.prototype.propertyIsEnumerable;
|
|
5
5
|
var p = (i, e, t) => e in i ? E(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, c = (i, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
7
|
v.call(e, t) && p(i, t, e[t]);
|
|
8
8
|
if (u)
|
|
9
9
|
for (var t of u(e))
|
|
10
|
-
|
|
10
|
+
W.call(e, t) && p(i, t, e[t]);
|
|
11
11
|
return i;
|
|
12
12
|
}, w = (i, e) => L(i, O(e));
|
|
13
13
|
var d = (i, e, t) => (p(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
@@ -27,24 +27,21 @@ var g = (i, e, t) => new Promise((o, n) => {
|
|
|
27
27
|
}, r = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(l, m);
|
|
28
28
|
r((t = t.apply(i, e)).next());
|
|
29
29
|
});
|
|
30
|
-
import { BaseObject as
|
|
31
|
-
import * as
|
|
30
|
+
import { BaseObject as j } from "../Base/index.js";
|
|
31
|
+
import * as C from "three";
|
|
32
32
|
import { createPolygon as T } from "../Polygon/index.js";
|
|
33
33
|
import { PrismMesh as x } from "../../Meshes/Prism.js";
|
|
34
34
|
import { LineMesh as U } from "../../Meshes/Line.js";
|
|
35
|
-
import { PrismEditor as
|
|
36
|
-
import { hotkeys as z } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
35
|
+
import { PrismEditor as z } from "./Editor.js";
|
|
37
36
|
import { rayOnLine as A } from "../../utils/three/rayOnLine.js";
|
|
38
37
|
import { getNormal as B } from "../../../shared-utils/three/getNormal.js";
|
|
39
38
|
import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
|
|
40
|
-
class
|
|
39
|
+
class Q extends j {
|
|
41
40
|
constructor(t, o) {
|
|
42
41
|
super(t, o);
|
|
43
42
|
d(this, "type", "Prism");
|
|
44
43
|
d(this, "prismMesh");
|
|
45
|
-
this.editor = new
|
|
46
|
-
this.stopCreating();
|
|
47
|
-
});
|
|
44
|
+
this.editor = new z(this), t && (this.prismMesh = new x(c(c({}, t.style), t)), this.add(this.prismMesh));
|
|
48
45
|
}
|
|
49
46
|
get data() {
|
|
50
47
|
return w(c({}, this.baseData), {
|
|
@@ -79,25 +76,25 @@ function D(i, e) {
|
|
|
79
76
|
o.name = "LineHelper", t.add(o);
|
|
80
77
|
const n = i.bottomPolygon.points.at(-1), l = B(i.bottomPolygon.points).normalize(), m = n.clone().add(l.clone().multiplyScalar(10)), r = n.clone().sub(l.clone().multiplyScalar(10));
|
|
81
78
|
return o.setPoints([m, r]), e.enable(), new Promise((s, h) => {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
},
|
|
79
|
+
const P = (a) => {
|
|
80
|
+
y(), s();
|
|
81
|
+
}, f = (a) => {
|
|
85
82
|
if (!(a != null && a.raycaster))
|
|
86
83
|
return;
|
|
87
84
|
const M = A({
|
|
88
85
|
raycaster: a.raycaster,
|
|
89
|
-
line: new
|
|
86
|
+
line: new C.Line3(m, r)
|
|
90
87
|
});
|
|
91
88
|
M && i.setPoints({ heightPoint: M });
|
|
92
|
-
},
|
|
93
|
-
e.off("select",
|
|
89
|
+
}, y = () => {
|
|
90
|
+
e.off("select", P), e.off("intersectionUpdate", f), e.off("disable", b), t.remove(o), e.disable();
|
|
94
91
|
}, b = () => {
|
|
95
|
-
|
|
92
|
+
y(), t.remove(i), h(new Error("Cancelled"));
|
|
96
93
|
};
|
|
97
|
-
e.on("select",
|
|
94
|
+
e.on("select", P), e.on("intersectionUpdate", f), e.on("disable", b);
|
|
98
95
|
});
|
|
99
96
|
});
|
|
100
97
|
}
|
|
101
98
|
export {
|
|
102
|
-
|
|
99
|
+
Q as Prism
|
|
103
100
|
};
|