@realsee/dnalogel 3.52.0 → 3.52.2
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/Meshes/Rectangle.d.ts +0 -4
- package/dist/Sculpt/Objects/Base/index.d.ts +1 -2
- package/dist/Sculpt/Objects/Rectangle/index.d.ts +1 -2
- package/dist/Sculpt/index.d.ts +0 -10
- package/dist/index.cjs.js +19 -19
- package/dist/index.js +62 -84
- package/dist/index.umd.js +21 -21
- package/dist/shared-utils/tag.d.ts +1 -1
- package/libs/Sculpt/Meshes/Rectangle.d.ts +0 -4
- package/libs/Sculpt/Meshes/Rectangle.js +8 -15
- package/libs/Sculpt/Objects/Base/index.d.ts +1 -2
- package/libs/Sculpt/Objects/Base/index.js +30 -34
- package/libs/Sculpt/Objects/Box/index.js +14 -14
- package/libs/Sculpt/Objects/Circle/index.js +49 -49
- package/libs/Sculpt/Objects/Cylinder/index.js +41 -41
- package/libs/Sculpt/Objects/Prism/index.js +23 -23
- package/libs/Sculpt/Objects/Rectangle/index.d.ts +1 -2
- package/libs/Sculpt/Objects/Rectangle/index.js +61 -60
- package/libs/Sculpt/index.d.ts +0 -10
- package/libs/base/BasePlugin.js +1 -1
- package/libs/components/AreaLabel/LabelItem.js +63 -74
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/tag.d.ts +1 -1
- package/libs/shared-utils/tag.js +1 -1
- package/package.json +1 -1
|
@@ -14,10 +14,6 @@ export declare class RectangleMesh extends PolygonMesh {
|
|
|
14
14
|
meshFont: THREE.Mesh<RectangleGeometry, THREE.MeshBasicMaterial>;
|
|
15
15
|
meshBackground: THREE.Mesh<RectangleGeometry, THREE.MeshBasicMaterial>;
|
|
16
16
|
get color(): THREE.Color;
|
|
17
|
-
/**
|
|
18
|
-
* @description: 构造矩形所需的三个点
|
|
19
|
-
*/
|
|
20
|
-
get builtPoints(): THREE.Vector3[];
|
|
21
17
|
constructor(params?: Partial<RectangleStyle & RectangleData>);
|
|
22
18
|
setPoints(points: AnyPositions): void;
|
|
23
19
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var l = Object.defineProperty;
|
|
2
|
-
var c = (
|
|
3
|
-
var i = (
|
|
2
|
+
var c = (e, o, t) => o in e ? l(e, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[o] = t;
|
|
3
|
+
var i = (e, o, t) => (c(e, typeof o != "symbol" ? o + "" : o, t), t);
|
|
4
4
|
import { anyPositionToVector3 as a } from "../../shared-utils/positionToVector3.js";
|
|
5
5
|
import "../../shared-utils/tag.js";
|
|
6
6
|
import "three";
|
|
@@ -13,7 +13,7 @@ import "../../shared-utils/three/core/Sphere.js";
|
|
|
13
13
|
import "animejs";
|
|
14
14
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
15
15
|
import { PolygonMesh as g } from "./Polygon.js";
|
|
16
|
-
import { RectangleGeometry as
|
|
16
|
+
import { RectangleGeometry as d } from "../utils/three/RectangleGeometry.js";
|
|
17
17
|
class G extends g {
|
|
18
18
|
constructor(t) {
|
|
19
19
|
super(t);
|
|
@@ -22,24 +22,17 @@ class G extends g {
|
|
|
22
22
|
get color() {
|
|
23
23
|
return this.meshFont.material.color;
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* @description: 构造矩形所需的三个点
|
|
27
|
-
*/
|
|
28
|
-
get builtPoints() {
|
|
29
|
-
var t, o;
|
|
30
|
-
return (o = (t = this.meshFont) == null ? void 0 : t.geometry) == null ? void 0 : o.points.slice(0, 3);
|
|
31
|
-
}
|
|
32
25
|
setPoints(t) {
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
26
|
+
const r = t.map(a).filter(h);
|
|
27
|
+
if (r.length < 3) {
|
|
35
28
|
console.error("Invalid position");
|
|
36
29
|
return;
|
|
37
30
|
}
|
|
38
31
|
if (t.length === 3) {
|
|
39
|
-
const [n, s, m] =
|
|
40
|
-
|
|
32
|
+
const [n, s, m] = r, p = n.clone().add(m).sub(s);
|
|
33
|
+
r.push(p);
|
|
41
34
|
}
|
|
42
|
-
this.points =
|
|
35
|
+
this.points = r, this.geometry = new d(r), this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0;
|
|
43
36
|
}
|
|
44
37
|
}
|
|
45
38
|
export {
|
|
@@ -102,7 +102,6 @@ Config extends BaseObjectConfig = BaseObjectConfig> extends IObject3D {
|
|
|
102
102
|
* @description 显示删除按钮
|
|
103
103
|
*/
|
|
104
104
|
showDeleteButton(clientX: number, clientY: number): void;
|
|
105
|
-
protected applyObjectMatrixWorld<P extends THREE.Vector3 | THREE.Vector3[]>(point: P): P;
|
|
106
|
-
protected applyObjectQuaternion<P extends THREE.Vector3 | THREE.Vector3[]>(point: P): P;
|
|
105
|
+
protected applyObjectMatrixWorld<P extends THREE.Vector3 | THREE.Vector3[]>(point: P, fromObject?: THREE.Object3D): P;
|
|
107
106
|
abstract create(...args: any): Promise<void>;
|
|
108
107
|
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
var
|
|
1
|
+
var p = Object.defineProperty;
|
|
2
2
|
var d = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var l = (
|
|
3
|
+
var f = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var l = (i, t, e) => t in i ? p(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, u = (i, t) => {
|
|
5
5
|
for (var e in t || (t = {}))
|
|
6
|
-
|
|
6
|
+
f.call(t, e) && l(i, e, t[e]);
|
|
7
7
|
if (d)
|
|
8
8
|
for (var e of d(t))
|
|
9
|
-
|
|
10
|
-
return
|
|
9
|
+
g.call(t, e) && l(i, e, t[e]);
|
|
10
|
+
return i;
|
|
11
11
|
};
|
|
12
|
-
var
|
|
12
|
+
var r = (i, t, e) => (l(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
13
13
|
import { hotkeys as c } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
14
14
|
import { Sculpt as n } from "../../index.js";
|
|
15
|
-
import { IObject3D as
|
|
15
|
+
import { IObject3D as a } from "../../../shared-utils/three/IObject3D.js";
|
|
16
16
|
import { applyObjectMatrixWorld as b } from "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
17
|
-
import { removeAllTag as
|
|
18
|
-
const
|
|
19
|
-
class
|
|
20
|
-
constructor(e,
|
|
17
|
+
import { removeAllTag as v } from "../../utils/removeAllTag.js";
|
|
18
|
+
const m = /* @__PURE__ */ new Map();
|
|
19
|
+
class j extends a {
|
|
20
|
+
constructor(e, s) {
|
|
21
21
|
super();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
r(this, "name", "Sculpt");
|
|
23
|
+
r(this, "isSculptObject", !0);
|
|
24
|
+
r(this, "draggable");
|
|
25
25
|
/**
|
|
26
26
|
* @description 是否被选中
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
r(this, "selected");
|
|
29
29
|
/**
|
|
30
30
|
* @description 配置
|
|
31
31
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
e != null && e.id && (this.uuid = e.id), this.config = u({ canEdit: !0, occlusionVisibility: !0, occlusionMode: "translucence" },
|
|
36
|
-
|
|
32
|
+
r(this, "config");
|
|
33
|
+
r(this, "on", (e, s, o) => n.modules.fiveDomEvents.addEventListener(this, e, s, o));
|
|
34
|
+
r(this, "off", (...e) => n.modules.fiveDomEvents.removeEventListener(this, ...e));
|
|
35
|
+
e != null && e.id && (this.uuid = e.id), this.config = u({ canEdit: !0, occlusionVisibility: !0, occlusionMode: "translucence" }, s), e != null && e.style && (e.style.occlusionVisibility = this.config.occlusionVisibility, e.style.occlusionMode = this.config.occlusionMode), this.addEventListener("removed", () => {
|
|
36
|
+
v(this);
|
|
37
37
|
}), c("esc", () => {
|
|
38
38
|
this.stopCreating();
|
|
39
39
|
}), this.config.canEdit && (c("backspace, delete", () => {
|
|
@@ -42,11 +42,11 @@ class O extends g {
|
|
|
42
42
|
var h;
|
|
43
43
|
if (this.pointSelector.enabled)
|
|
44
44
|
return;
|
|
45
|
-
let
|
|
46
|
-
|
|
45
|
+
let o = m.get(this.parent.uuid);
|
|
46
|
+
o && (o.selected = !1, o.unhighlight(), (h = o._editor) == null || h.disable()), m.set(this.parent.uuid, this), this.selected = !0, this.highlight();
|
|
47
47
|
}), c("esc", () => {
|
|
48
|
-
var
|
|
49
|
-
this.selected = !1, this.unhighlight(), !this.pointSelector.enabled && ((
|
|
48
|
+
var o;
|
|
49
|
+
this.selected = !1, this.unhighlight(), !this.pointSelector.enabled && ((o = this._editor) == null || o.disable());
|
|
50
50
|
}));
|
|
51
51
|
}
|
|
52
52
|
get editing() {
|
|
@@ -111,19 +111,15 @@ class O extends g {
|
|
|
111
111
|
/**
|
|
112
112
|
* @description 显示删除按钮
|
|
113
113
|
*/
|
|
114
|
-
showDeleteButton(e,
|
|
115
|
-
n.modules.cursor.showDeleteButton({ clientX: e, clientY:
|
|
114
|
+
showDeleteButton(e, s) {
|
|
115
|
+
n.modules.cursor.showDeleteButton({ clientX: e, clientY: s, container: document.body, onClick: () => this.delete() }), n.modules.five.once("cameraUpdate", () => {
|
|
116
116
|
n.modules.cursor.removeDeleteButton();
|
|
117
117
|
});
|
|
118
118
|
}
|
|
119
|
-
applyObjectMatrixWorld(e) {
|
|
120
|
-
return
|
|
121
|
-
}
|
|
122
|
-
applyObjectQuaternion(e) {
|
|
123
|
-
const r = this.quaternion.clone();
|
|
124
|
-
return Array.isArray(e) ? e.map((i) => i.clone().applyQuaternion(r)) : e.clone().applyQuaternion(r);
|
|
119
|
+
applyObjectMatrixWorld(e, s) {
|
|
120
|
+
return s.updateMatrixWorld(), b(s, e);
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
export {
|
|
128
|
-
|
|
124
|
+
j as BaseObject
|
|
129
125
|
};
|
|
@@ -51,8 +51,8 @@ class S extends _ {
|
|
|
51
51
|
}
|
|
52
52
|
get data() {
|
|
53
53
|
return E(m({}, this.baseData), {
|
|
54
|
-
points: B(this.applyObjectMatrixWorld(this.boxMesh.bottomPositions)),
|
|
55
|
-
heightPoint: B(this.applyObjectMatrixWorld(this.boxMesh.topPosition)),
|
|
54
|
+
points: B(this.applyObjectMatrixWorld(this.boxMesh.bottomPositions, this.boxMesh)),
|
|
55
|
+
heightPoint: B(this.applyObjectMatrixWorld(this.boxMesh.topPosition, this.boxMesh)),
|
|
56
56
|
style: {
|
|
57
57
|
color: this.boxMesh.color.getHex(),
|
|
58
58
|
opacity: this.boxMesh.opacity,
|
|
@@ -85,27 +85,27 @@ function z(e, o, t) {
|
|
|
85
85
|
}
|
|
86
86
|
const h = new k(e.style);
|
|
87
87
|
i.add(h), yield T(h, o, t), i.remove(h), e.setPoints({ points: h.points });
|
|
88
|
-
const n = new U(), s = A(e.bottomPositions), r = q(...e.bottomPositions), p = r.clone().add(s.clone().multiplyScalar(10)),
|
|
89
|
-
n.setPoints([p,
|
|
90
|
-
const
|
|
91
|
-
|
|
88
|
+
const n = new U(), s = A(e.bottomPositions), r = q(...e.bottomPositions), p = r.clone().add(s.clone().multiplyScalar(10)), x = r.clone().sub(s.clone().multiplyScalar(10));
|
|
89
|
+
n.setPoints([p, x]), i.add(n), o.enable();
|
|
90
|
+
const g = (c) => {
|
|
91
|
+
M(), a();
|
|
92
92
|
}, y = (c) => {
|
|
93
93
|
if (!(c != null && c.raycaster))
|
|
94
94
|
return;
|
|
95
|
-
const
|
|
95
|
+
const u = D({
|
|
96
96
|
raycaster: c.raycaster,
|
|
97
|
-
line: new j.Line3(p,
|
|
97
|
+
line: new j.Line3(p, x)
|
|
98
98
|
});
|
|
99
|
-
if (
|
|
100
|
-
const C =
|
|
99
|
+
if (u) {
|
|
100
|
+
const C = u.clone().sub(r);
|
|
101
101
|
e.setPoints({ heightPoint: e.bottomPositions[0].clone().add(C) });
|
|
102
102
|
}
|
|
103
|
+
}, M = () => {
|
|
104
|
+
o.off("select", g), o.off("intersectionUpdate", y), o.off("disable", P), o.disable(), i == null || i.remove(n);
|
|
103
105
|
}, P = () => {
|
|
104
|
-
|
|
105
|
-
}, u = () => {
|
|
106
|
-
P(), i == null || i.remove(e), l(new Error("Cancelled"));
|
|
106
|
+
M(), i == null || i.remove(e), l(new Error("Cancelled"));
|
|
107
107
|
};
|
|
108
|
-
o.on("select",
|
|
108
|
+
o.on("select", g), o.on("intersectionUpdate", y), o.on("disable", P);
|
|
109
109
|
}));
|
|
110
110
|
});
|
|
111
111
|
}
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
var C = Object.defineProperty, x = Object.defineProperties;
|
|
2
2
|
var _ = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var M = Object.getOwnPropertySymbols;
|
|
4
|
-
var
|
|
5
|
-
var m = (
|
|
6
|
-
for (var e in
|
|
7
|
-
|
|
4
|
+
var T = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var m = (r, i, e) => i in r ? C(r, i, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[i] = e, d = (r, i) => {
|
|
6
|
+
for (var e in i || (i = {}))
|
|
7
|
+
T.call(i, e) && m(r, e, i[e]);
|
|
8
8
|
if (M)
|
|
9
|
-
for (var e of M(
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, g = (
|
|
13
|
-
var f = (
|
|
14
|
-
var w = (
|
|
9
|
+
for (var e of M(i))
|
|
10
|
+
A.call(i, e) && m(r, e, i[e]);
|
|
11
|
+
return r;
|
|
12
|
+
}, g = (r, i) => x(r, _(i));
|
|
13
|
+
var f = (r, i, e) => (m(r, typeof i != "symbol" ? i + "" : i, e), e);
|
|
14
|
+
var w = (r, i, e) => new Promise((c, t) => {
|
|
15
15
|
var a = (n) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
o(e.next(n));
|
|
18
18
|
} catch (h) {
|
|
19
|
-
|
|
19
|
+
t(h);
|
|
20
20
|
}
|
|
21
21
|
}, s = (n) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
o(e.throw(n));
|
|
24
24
|
} catch (h) {
|
|
25
|
-
|
|
25
|
+
t(h);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, o = (n) => n.done ? c(n.value) : Promise.resolve(n.value).then(a, s);
|
|
28
|
+
o((e = e.apply(r, i)).next());
|
|
29
29
|
});
|
|
30
|
-
import { BaseObject as
|
|
30
|
+
import { BaseObject as H } from "../Base/index.js";
|
|
31
31
|
import * as y from "three";
|
|
32
|
-
import { PolylineMesh as
|
|
33
|
-
import { CircleMeshEditor as
|
|
34
|
-
import { CircleWithEdgeMesh as
|
|
35
|
-
import { vector3ToArray as
|
|
36
|
-
class
|
|
37
|
-
constructor(e,
|
|
38
|
-
super(e,
|
|
32
|
+
import { PolylineMesh as N } from "../../Meshes/Polyline.js";
|
|
33
|
+
import { CircleMeshEditor as O } from "../../Editors/CircleMeshEditor.js";
|
|
34
|
+
import { CircleWithEdgeMesh as E } from "../../Meshes/CircleWithEdge.js";
|
|
35
|
+
import { vector3ToArray as b } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
|
+
class L extends H {
|
|
37
|
+
constructor(e, c) {
|
|
38
|
+
super(e, c);
|
|
39
39
|
f(this, "type", "Circle");
|
|
40
40
|
f(this, "circleMesh");
|
|
41
41
|
f(this, "_editor");
|
|
42
|
-
e && (this.circleMesh = new
|
|
42
|
+
e && (this.circleMesh = new E(d(d({}, e.style), e)), this.add(this.circleMesh));
|
|
43
43
|
}
|
|
44
44
|
get editor() {
|
|
45
|
-
return this._editor || (this._editor = new
|
|
45
|
+
return this._editor || (this._editor = new O(this.circleMesh)), this._editor;
|
|
46
46
|
}
|
|
47
47
|
get data() {
|
|
48
48
|
return g(d({}, this.baseData), {
|
|
49
|
-
center:
|
|
50
|
-
normal:
|
|
49
|
+
center: b(this.applyObjectMatrixWorld(this.circleMesh.center, this.circleMesh)),
|
|
50
|
+
normal: b(this.circleMesh.normal.clone().applyQuaternion(this.circleMesh.quaternion)),
|
|
51
51
|
radius: this.circleMesh.radius,
|
|
52
52
|
style: {
|
|
53
53
|
color: this.circleMesh.color.getHex()
|
|
@@ -64,24 +64,24 @@ class Q extends j {
|
|
|
64
64
|
}
|
|
65
65
|
create(e) {
|
|
66
66
|
return w(this, null, function* () {
|
|
67
|
-
this.children.forEach((
|
|
68
|
-
|
|
67
|
+
this.children.forEach((t) => {
|
|
68
|
+
t.parent === this && this.remove(t);
|
|
69
69
|
}), this.children.length = 0;
|
|
70
|
-
const
|
|
71
|
-
this.circleMesh =
|
|
70
|
+
const c = new E(e);
|
|
71
|
+
this.circleMesh = c, this.add(this.circleMesh), yield U(this.circleMesh, this.pointSelector), this.config.canEdit && this.editor.enable();
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
function
|
|
76
|
-
return new Promise((e,
|
|
77
|
-
const
|
|
78
|
-
if (!
|
|
79
|
-
|
|
75
|
+
function U(r, i) {
|
|
76
|
+
return new Promise((e, c) => {
|
|
77
|
+
const t = r.parent;
|
|
78
|
+
if (!t) {
|
|
79
|
+
c(new Error("No container"));
|
|
80
80
|
return;
|
|
81
81
|
}
|
|
82
|
-
const a = new
|
|
83
|
-
|
|
84
|
-
let s,
|
|
82
|
+
const a = new N({ dashed: !0 });
|
|
83
|
+
t.add(a), i.enable();
|
|
84
|
+
let s, o;
|
|
85
85
|
const n = (l) => {
|
|
86
86
|
if (l) {
|
|
87
87
|
if (!s) {
|
|
@@ -91,25 +91,25 @@ function N(t, r) {
|
|
|
91
91
|
};
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
s &&
|
|
94
|
+
s && o && (p(), e());
|
|
95
95
|
}
|
|
96
96
|
}, h = (l) => {
|
|
97
97
|
if (!l || !s)
|
|
98
98
|
return;
|
|
99
99
|
const P = new y.Plane().setFromNormalAndCoplanarPoint(s.normal, s.point);
|
|
100
|
-
if (
|
|
101
|
-
const v = s.point.distanceTo(
|
|
102
|
-
|
|
100
|
+
if (o = l.raycaster.ray.intersectPlane(P, new y.Vector3()), o) {
|
|
101
|
+
const v = s.point.distanceTo(o);
|
|
102
|
+
r.setPoints({ center: s.point, normal: s.normal, radius: v });
|
|
103
103
|
}
|
|
104
104
|
}, p = () => {
|
|
105
|
-
|
|
105
|
+
i.off("select", n), i.off("intersectionUpdate", h), i.off("disable", u), i.disable(), t == null || t.remove(a);
|
|
106
106
|
}, u = () => {
|
|
107
|
-
p(),
|
|
107
|
+
p(), t == null || t.remove(r, a), c(new Error("Cancelled"));
|
|
108
108
|
};
|
|
109
|
-
|
|
109
|
+
i.on("select", n), i.on("intersectionUpdate", h), i.on("disable", u);
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
export {
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
L as Circle,
|
|
114
|
+
U as createCircle
|
|
115
115
|
};
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
var L = Object.defineProperty, j = Object.defineProperties;
|
|
2
2
|
var _ = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
3
|
+
var w = Object.getOwnPropertySymbols;
|
|
4
4
|
var T = Object.prototype.hasOwnProperty, A = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var p = (n, t, e) => t in n ? L(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e, d = (n, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
T.call(t, e) &&
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
A.call(t, e) &&
|
|
7
|
+
T.call(t, e) && p(n, e, t[e]);
|
|
8
|
+
if (w)
|
|
9
|
+
for (var e of w(t))
|
|
10
|
+
A.call(t, e) && p(n, e, t[e]);
|
|
11
11
|
return n;
|
|
12
|
-
},
|
|
13
|
-
var m = (n, t, e) => (
|
|
14
|
-
var f = (n, t, e) => new Promise((
|
|
15
|
-
var c = (
|
|
12
|
+
}, P = (n, t) => j(n, _(t));
|
|
13
|
+
var m = (n, t, e) => (p(n, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var f = (n, t, e) => new Promise((i, s) => {
|
|
15
|
+
var c = (r) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
s(
|
|
17
|
+
o(e.next(r));
|
|
18
|
+
} catch (l) {
|
|
19
|
+
s(l);
|
|
20
20
|
}
|
|
21
|
-
}, h = (
|
|
21
|
+
}, h = (r) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
s(
|
|
23
|
+
o(e.throw(r));
|
|
24
|
+
} catch (l) {
|
|
25
|
+
s(l);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, o = (r) => r.done ? i(r.value) : Promise.resolve(r.value).then(c, h);
|
|
28
|
+
o((e = e.apply(n, t)).next());
|
|
29
29
|
});
|
|
30
30
|
import { CylinderMesh as E } from "../../Meshes/Cylinder.js";
|
|
31
31
|
import { LineMesh as U } from "../../Meshes/Line.js";
|
|
@@ -36,8 +36,8 @@ import * as b from "three";
|
|
|
36
36
|
import { vector3ToArray as O } from "../../../shared-utils/three/vector3ToArray.js";
|
|
37
37
|
import { CylinderMeshEditor as D } from "../../Editors/CylinderMeshEditor.js";
|
|
38
38
|
class Q extends z {
|
|
39
|
-
constructor(e,
|
|
40
|
-
super(e,
|
|
39
|
+
constructor(e, i) {
|
|
40
|
+
super(e, i);
|
|
41
41
|
m(this, "type", "Cylinder");
|
|
42
42
|
m(this, "cylinderMesh");
|
|
43
43
|
m(this, "_editor");
|
|
@@ -47,9 +47,9 @@ class Q extends z {
|
|
|
47
47
|
return this._editor || (this._editor = new D(this.cylinderMesh)), this._editor;
|
|
48
48
|
}
|
|
49
49
|
get data() {
|
|
50
|
-
return
|
|
51
|
-
bottomCenter: O(this.applyObjectMatrixWorld(this.cylinderMesh.bottomCenter)),
|
|
52
|
-
topCenter: O(this.applyObjectMatrixWorld(this.cylinderMesh.topCenter)),
|
|
50
|
+
return P(d({}, this.baseData), {
|
|
51
|
+
bottomCenter: O(this.applyObjectMatrixWorld(this.cylinderMesh.bottomCenter, this.cylinderMesh)),
|
|
52
|
+
topCenter: O(this.applyObjectMatrixWorld(this.cylinderMesh.topCenter, this.cylinderMesh)),
|
|
53
53
|
radius: this.cylinderMesh.radius,
|
|
54
54
|
style: {
|
|
55
55
|
color: this.cylinderMesh.color.getHex()
|
|
@@ -74,26 +74,26 @@ function F(n, t) {
|
|
|
74
74
|
return f(this, null, function* () {
|
|
75
75
|
const e = n.parent;
|
|
76
76
|
yield B(n.bottomCircle, t);
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const s = t.position.point, c = n.normal.clone().normalize(), h = s.clone().add(c.clone().multiplyScalar(10)),
|
|
80
|
-
return
|
|
81
|
-
const C = (
|
|
82
|
-
|
|
83
|
-
}, u = (
|
|
84
|
-
if (!(
|
|
77
|
+
const i = new U();
|
|
78
|
+
i.name = "LineHelper", e.add(i);
|
|
79
|
+
const s = t.position.point, c = n.normal.clone().normalize(), h = s.clone().add(c.clone().multiplyScalar(10)), o = s.clone().sub(c.clone().multiplyScalar(10));
|
|
80
|
+
return i.setPoints([h, o]), t.enable(), new Promise((r, l) => {
|
|
81
|
+
const C = (a) => {
|
|
82
|
+
M(), r();
|
|
83
|
+
}, u = (a) => {
|
|
84
|
+
if (!(a != null && a.raycaster))
|
|
85
85
|
return;
|
|
86
|
-
const
|
|
87
|
-
raycaster:
|
|
88
|
-
line: new b.Line3(h,
|
|
89
|
-
}), v = new b.Plane().setFromNormalAndCoplanarPoint(n.normal, n.bottomCenter).projectPoint(
|
|
90
|
-
|
|
86
|
+
const y = W({
|
|
87
|
+
raycaster: a.raycaster,
|
|
88
|
+
line: new b.Line3(h, o)
|
|
89
|
+
}), v = new b.Plane().setFromNormalAndCoplanarPoint(n.normal, n.bottomCenter).projectPoint(y, new b.Vector3()), x = y.clone().sub(v), H = n.bottomCenter.clone().add(x);
|
|
90
|
+
y && n.setTopCenter(H);
|
|
91
|
+
}, M = () => {
|
|
92
|
+
t.off("select", C), t.off("intersectionUpdate", u), t.off("disable", g), e.remove(i), t.disable();
|
|
91
93
|
}, g = () => {
|
|
92
|
-
|
|
93
|
-
}, w = () => {
|
|
94
|
-
g(), e.remove(n), a(new Error("Cancelled"));
|
|
94
|
+
M(), e.remove(n), l(new Error("Cancelled"));
|
|
95
95
|
};
|
|
96
|
-
t.on("select", C), t.on("intersectionUpdate", u), t.on("disable",
|
|
96
|
+
t.on("select", C), t.on("intersectionUpdate", u), t.on("disable", g);
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
}
|
|
@@ -2,16 +2,16 @@ var v = Object.defineProperty, L = Object.defineProperties;
|
|
|
2
2
|
var O = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var u = Object.getOwnPropertySymbols;
|
|
4
4
|
var W = Object.prototype.hasOwnProperty, _ = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var d = (
|
|
5
|
+
var d = (s, i, t) => i in s ? v(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t, c = (s, i) => {
|
|
6
6
|
for (var t in i || (i = {}))
|
|
7
|
-
W.call(i, t) && d(
|
|
7
|
+
W.call(i, t) && d(s, t, i[t]);
|
|
8
8
|
if (u)
|
|
9
9
|
for (var t of u(i))
|
|
10
|
-
_.call(i, t) && d(
|
|
11
|
-
return
|
|
12
|
-
}, w = (
|
|
13
|
-
var p = (
|
|
14
|
-
var f = (
|
|
10
|
+
_.call(i, t) && d(s, t, i[t]);
|
|
11
|
+
return s;
|
|
12
|
+
}, w = (s, i) => L(s, O(i));
|
|
13
|
+
var p = (s, i, t) => (d(s, typeof i != "symbol" ? i + "" : i, t), t);
|
|
14
|
+
var f = (s, i, t) => new Promise((e, r) => {
|
|
15
15
|
var m = (o) => {
|
|
16
16
|
try {
|
|
17
17
|
n(t.next(o));
|
|
@@ -24,8 +24,8 @@ var f = (e, i, t) => new Promise((s, r) => {
|
|
|
24
24
|
} catch (h) {
|
|
25
25
|
r(h);
|
|
26
26
|
}
|
|
27
|
-
}, n = (o) => o.done ?
|
|
28
|
-
n((t = t.apply(
|
|
27
|
+
}, n = (o) => o.done ? e(o.value) : Promise.resolve(o.value).then(m, l);
|
|
28
|
+
n((t = t.apply(s, i)).next());
|
|
29
29
|
});
|
|
30
30
|
import { BaseObject as j } from "../Base/index.js";
|
|
31
31
|
import * as C from "three";
|
|
@@ -38,8 +38,8 @@ import { getNormal as D } from "../../../shared-utils/three/getNormal.js";
|
|
|
38
38
|
import { vector3ToArray as E } from "../../../shared-utils/three/vector3ToArray.js";
|
|
39
39
|
import { AreaMesh as N } from "../../Meshes/Area.js";
|
|
40
40
|
class X extends j {
|
|
41
|
-
constructor(t,
|
|
42
|
-
super(t,
|
|
41
|
+
constructor(t, e) {
|
|
42
|
+
super(t, e);
|
|
43
43
|
p(this, "type", "Prism");
|
|
44
44
|
p(this, "prismMesh");
|
|
45
45
|
p(this, "_editor");
|
|
@@ -50,8 +50,8 @@ class X extends j {
|
|
|
50
50
|
}
|
|
51
51
|
get data() {
|
|
52
52
|
return w(c({}, this.baseData), {
|
|
53
|
-
points: E(this.applyObjectMatrixWorld(this.prismMesh.bottomPositions)),
|
|
54
|
-
heightPoint: E(this.applyObjectMatrixWorld(this.prismMesh.topPosition)),
|
|
53
|
+
points: E(this.applyObjectMatrixWorld(this.prismMesh.bottomPositions, this.prismMesh)),
|
|
54
|
+
heightPoint: E(this.applyObjectMatrixWorld(this.prismMesh.topPosition, this.prismMesh)),
|
|
55
55
|
style: {
|
|
56
56
|
color: this.prismMesh.color.getHex(),
|
|
57
57
|
lineWidth: this.prismMesh.lineWidth,
|
|
@@ -73,16 +73,16 @@ class X extends j {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function R(
|
|
76
|
+
function R(s, i) {
|
|
77
77
|
return f(this, null, function* () {
|
|
78
|
-
const t =
|
|
79
|
-
t.add(
|
|
78
|
+
const t = s.parent, e = new N(s.style);
|
|
79
|
+
t.add(e), yield A(e, i).finished, t.remove(e), s.setPoints({ points: e.points });
|
|
80
80
|
const r = new T();
|
|
81
81
|
r.name = "LineHelper", t.add(r);
|
|
82
|
-
const m =
|
|
82
|
+
const m = e.points.at(-1), l = D(e.points), n = m.clone().add(l.clone().multiplyScalar(10)), o = m.clone().sub(l.clone().multiplyScalar(10));
|
|
83
83
|
return r.setPoints([n, o]), i.enable(), new Promise((h, H) => {
|
|
84
84
|
const P = (a) => {
|
|
85
|
-
|
|
85
|
+
M(), h();
|
|
86
86
|
}, g = (a) => {
|
|
87
87
|
if (!(a != null && a.raycaster))
|
|
88
88
|
return;
|
|
@@ -90,13 +90,13 @@ function R(e, i) {
|
|
|
90
90
|
raycaster: a.raycaster,
|
|
91
91
|
line: new C.Line3(n, o)
|
|
92
92
|
});
|
|
93
|
-
b &&
|
|
94
|
-
}, y = () => {
|
|
95
|
-
i.off("select", P), i.off("intersectionUpdate", g), i.off("disable", M), t.remove(r), i.disable();
|
|
93
|
+
b && s.setPoints({ heightPoint: b });
|
|
96
94
|
}, M = () => {
|
|
97
|
-
|
|
95
|
+
i.off("select", P), i.off("intersectionUpdate", g), i.off("disable", y), t.remove(r), i.disable();
|
|
96
|
+
}, y = () => {
|
|
97
|
+
M(), t.remove(s), H(new Error("Cancelled"));
|
|
98
98
|
};
|
|
99
|
-
i.on("select", P), i.on("intersectionUpdate", g), i.on("disable",
|
|
99
|
+
i.on("select", P), i.on("intersectionUpdate", g), i.on("disable", y);
|
|
100
100
|
});
|
|
101
101
|
});
|
|
102
102
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseObject, type BaseImportData, type BaseObjectConfig } from '../Base';
|
|
2
2
|
import type { PointSelector } from '../../../shared-utils/three/PointSelector';
|
|
3
3
|
import { RectangleMeshEditor } from '../../Editors/RectangleMeshEditor';
|
|
4
|
-
import type { ArrayPosition } from '../../../PanoTagPlugin';
|
|
5
4
|
import type { RectangleData, RectangleMesh } from '../../Meshes/Rectangle';
|
|
6
5
|
import { RectangleWithEdgeMesh, type RectangleWithEdgeMeshStyle } from '../../Meshes/RectangleWithEdge';
|
|
7
6
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
@@ -16,7 +15,7 @@ export declare class Rectangle extends BaseObject<RectangleImportData> {
|
|
|
16
15
|
get editor(): RectangleMeshEditor;
|
|
17
16
|
_editor: RectangleMeshEditor;
|
|
18
17
|
get data(): {
|
|
19
|
-
points: [
|
|
18
|
+
points: [number, number, number][];
|
|
20
19
|
style: {
|
|
21
20
|
color: number;
|
|
22
21
|
opacity: number;
|