@realsee/dnalogel 3.46.0 → 3.47.0
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 +7 -0
- package/dist/Sculpt/Meshes/Polygon.d.ts +6 -0
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
- package/dist/Sculpt/Meshes/Polyline.d.ts +7 -0
- package/dist/Sculpt/utils/removeAllTag.d.ts +2 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
- package/dist/index.cjs.js +54 -54
- package/dist/index.js +3645 -3592
- package/dist/index.umd.js +46 -46
- package/dist/shared-utils/five/getPosition.d.ts +2 -0
- package/dist/shared-utils/three/PointSelector/index.d.ts +14 -10
- package/dist/typings/typings.d.ts +2 -0
- package/libs/AreaMakerPlugin/Controller.js +3 -2
- package/libs/AreaMakerPlugin/index.js +3 -2
- package/libs/AreaMakerPlugin/utils/Item.js +3 -2
- package/libs/CSS3DRenderPlugin/Controller.js +3 -2
- package/libs/CSS3DRenderPlugin/index.js +6 -5
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DObject.js +3 -2
- package/libs/CSS3DRenderPlugin/utils/three/CSS3DRender.js +3 -2
- package/libs/CruisePlugin/BaseController.js +5 -4
- package/libs/CruisePlugin/Move.js +3 -2
- package/libs/CruisePlugin/Work.js +3 -2
- package/libs/CruisePlugin/index.js +7 -6
- package/libs/CurrentPanoImagePlugin/Controller.js +3 -2
- package/libs/CurrentPanoImagePlugin/index.js +4 -3
- package/libs/GuideLinePlugin/Controller.js +5 -4
- package/libs/GuideLinePlugin/GuideLineItem.js +3 -2
- package/libs/GuideLinePlugin/GuideLineModeItem.js +3 -2
- package/libs/GuideLinePlugin/index.js +7 -6
- package/libs/ModelMakerPlugin/Controller.js +3 -2
- package/libs/ModelMakerPlugin/index.js +3 -2
- package/libs/ModelTVVideoPlugin/Plugin.js +4 -3
- package/libs/ModelTVVideoPlugin/index.js +3 -2
- package/libs/Object3DHelperPlugin/Controller.js +19 -18
- package/libs/Object3DHelperPlugin/index.js +6 -5
- package/libs/PanoCompassPlugin/Controller.js +3 -2
- package/libs/PanoCompassPlugin/index.js +4 -3
- package/libs/PanoDoorLabelPlugin/BaseController.js +3 -2
- package/libs/PanoDoorLabelPlugin/Controller.js +21 -20
- package/libs/PanoDoorLabelPlugin/index.js +4 -3
- package/libs/PanoMeasurePlugin/Components/Controller0.js +3 -2
- package/libs/PanoMeasurePlugin/Components/Controller1.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/EditController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/index.js +3 -2
- package/libs/PanoMeasurePlugin/Model/area.js +3 -2
- package/libs/PanoMeasurePlugin/Modules/Magnifier.js +1 -0
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +3 -2
- package/libs/PanoMeasurePlugin/index.js +14 -13
- package/libs/PanoMeasurePlugin/utils/dom/areaDom.js +3 -2
- package/libs/PanoSpatialTagPlugin/Plugin.js +4 -3
- package/libs/PanoSpatialTagPlugin/index.js +1 -0
- package/libs/PanoTagPlugin/Components/Common/TagPoint.js +34 -33
- package/libs/PanoTagPlugin/Components/Tag/MarketingTag.js +3 -2
- package/libs/PanoTagPlugin/Components/Tag/index.js +3 -2
- package/libs/PanoTagPlugin/Components/TagContainer.js +3 -2
- package/libs/PanoTagPlugin/Components/TagItem.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +62 -61
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +3 -2
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +3 -2
- package/libs/PanoTagPlugin/controller/TagRender.js +3 -2
- package/libs/PanoTagPlugin/controller/TagUtil.js +3 -2
- package/libs/PanoTagPlugin/controller/index.js +6 -5
- package/libs/PanoTagPlugin/index.js +12 -11
- package/libs/PanoTagPlugin/utils/tag/calculateTagConfig.js +3 -2
- package/libs/PanoVideoPlugin/Controller.js +3 -2
- package/libs/PanoVideoPlugin/VideoMeshController.js +3 -2
- package/libs/PanoVideoPlugin/index.js +6 -5
- package/libs/PipelinePlugin/Controller.js +3 -2
- package/libs/PipelinePlugin/index.js +4 -3
- package/libs/PipelinePlugin/utils/Objects/FlowPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/HighlightPipe.js +3 -2
- package/libs/PipelinePlugin/utils/Objects/Pipe.js +1 -0
- package/libs/Sculpt/Meshes/Line.js +17 -14
- package/libs/Sculpt/Meshes/Polygon.d.ts +6 -0
- package/libs/Sculpt/Meshes/Polygon.js +7 -4
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +8 -0
- package/libs/Sculpt/Meshes/PolygonWithEdge.js +38 -24
- package/libs/Sculpt/Meshes/Polyline.d.ts +7 -0
- package/libs/Sculpt/Meshes/Polyline.js +32 -23
- package/libs/Sculpt/Objects/Base/index.js +20 -17
- package/libs/Sculpt/Objects/Line/Editor.js +6 -6
- package/libs/Sculpt/Objects/Line/index.js +16 -16
- package/libs/Sculpt/Objects/Point/Editor.js +10 -10
- package/libs/Sculpt/Objects/Polygon/Editor.js +6 -6
- package/libs/Sculpt/Objects/Polygon/index.js +43 -37
- package/libs/Sculpt/Objects/Polyline/Editor.js +3 -3
- package/libs/Sculpt/Objects/Polyline/index.js +43 -43
- package/libs/Sculpt/utils/removeAllTag.d.ts +2 -0
- package/libs/Sculpt/utils/removeAllTag.js +10 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +6 -0
- package/libs/Sculpt/utils/three/ColoredMesh.js +39 -31
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/MapviewFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/ModelFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/ModelFloorplanPlugin/index.js +4 -3
- package/libs/floorplan/PanoFloorplanRadarPlugin/Controller.js +3 -2
- package/libs/floorplan/PanoFloorplanRadarPlugin/index.js +4 -3
- package/libs/floorplan/TopviewFloorplanPlugin/Controller.js +3 -2
- package/libs/floorplan/TopviewFloorplanPlugin/index.js +4 -3
- package/libs/index.js +126 -125
- package/libs/shared-utils/five/getPosition.d.ts +2 -0
- package/libs/shared-utils/five/getPosition.js +25 -30
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +14 -10
- package/libs/shared-utils/three/PointSelector/index.js +74 -57
- package/libs/typings/typings.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
var x = Object.defineProperty, B = Object.defineProperties;
|
|
2
2
|
var T = Object.getOwnPropertyDescriptors;
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var r = Object.getOwnPropertySymbols;
|
|
4
|
+
var D = Object.prototype.hasOwnProperty, w = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var p = (s, e, i) => e in s ? x(s, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[e] = i, a = (s, e) => {
|
|
6
6
|
for (var i in e || (e = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var i of
|
|
10
|
-
w.call(e, i) &&
|
|
7
|
+
D.call(e, i) && p(s, i, e[i]);
|
|
8
|
+
if (r)
|
|
9
|
+
for (var i of r(e))
|
|
10
|
+
w.call(e, i) && p(s, i, e[i]);
|
|
11
11
|
return s;
|
|
12
12
|
}, c = (s, e) => B(s, T(e));
|
|
13
13
|
var E = (s, e) => {
|
|
14
14
|
var i = {};
|
|
15
15
|
for (var t in s)
|
|
16
|
-
|
|
17
|
-
if (s != null &&
|
|
18
|
-
for (var t of
|
|
16
|
+
D.call(s, t) && e.indexOf(t) < 0 && (i[t] = s[t]);
|
|
17
|
+
if (s != null && r)
|
|
18
|
+
for (var t of r(s))
|
|
19
19
|
e.indexOf(t) < 0 && w.call(s, t) && (i[t] = s[t]);
|
|
20
20
|
return i;
|
|
21
21
|
};
|
|
22
|
-
var l = (s, e, i) => (
|
|
22
|
+
var l = (s, e, i) => (p(s, typeof e != "symbol" ? e + "" : e, i), i);
|
|
23
23
|
import { anyPositionToVector3 as j } from "../../shared-utils/positionToVector3.js";
|
|
24
24
|
import { IObject3D as F } from "../../shared-utils/three/IObject3D.js";
|
|
25
25
|
import * as H from "three";
|
|
@@ -40,8 +40,17 @@ class v extends F {
|
|
|
40
40
|
l(this, "lines", []);
|
|
41
41
|
l(this, "withDots");
|
|
42
42
|
l(this, "paramsStyle");
|
|
43
|
-
const n = i, { withDots: t, points: o } = n,
|
|
44
|
-
this.withDots = t != null ? t : !0, o && this.setPoints(o),
|
|
43
|
+
const n = i, { withDots: t, points: o } = n, h = E(n, ["withDots", "points"]);
|
|
44
|
+
this.withDots = t != null ? t : !0, o && this.setPoints(o), h && this.setStyle(h);
|
|
45
|
+
}
|
|
46
|
+
get style() {
|
|
47
|
+
return {
|
|
48
|
+
lineColor: this.lineColor,
|
|
49
|
+
lineWidth: this.lineWidth,
|
|
50
|
+
dashed: this.dashed,
|
|
51
|
+
occlusionVisibility: this.occlusionVisibility,
|
|
52
|
+
occlusionMode: this.occlusionMode
|
|
53
|
+
};
|
|
45
54
|
}
|
|
46
55
|
get lineColor() {
|
|
47
56
|
var i, t, o;
|
|
@@ -68,24 +77,24 @@ class v extends F {
|
|
|
68
77
|
return this.lines.map((t) => t.points[0]).concat((i = this.lines.at(-1)) == null ? void 0 : i.points[1]).filter(Boolean);
|
|
69
78
|
}
|
|
70
79
|
setPoints(i, t = { closed: !1 }) {
|
|
71
|
-
var n, u, y, f, S,
|
|
80
|
+
var n, u, y, f, g, S, M, P, V, W;
|
|
72
81
|
let o = i.map(j);
|
|
73
82
|
t.closed && (o = N(o));
|
|
74
|
-
const
|
|
83
|
+
const h = {
|
|
75
84
|
lineWidth: (u = (n = this.paramsStyle) == null ? void 0 : n.lineWidth) != null ? u : this.lineWidth,
|
|
76
85
|
lineColor: (f = (y = this.paramsStyle) == null ? void 0 : y.lineColor) != null ? f : this.lineColor,
|
|
77
|
-
dashed: (
|
|
78
|
-
occlusionVisibility: (
|
|
86
|
+
dashed: (S = (g = this.paramsStyle) == null ? void 0 : g.dashed) != null ? S : this.dashed,
|
|
87
|
+
occlusionVisibility: (P = (M = this.paramsStyle) == null ? void 0 : M.occlusionVisibility) != null ? P : this.occlusionVisibility,
|
|
79
88
|
occlusionMode: (W = (V = this.paramsStyle) == null ? void 0 : V.occlusionMode) != null ? W : this.occlusionMode
|
|
80
89
|
};
|
|
81
|
-
this.lines.length && this.lines.forEach((
|
|
82
|
-
const b = o[
|
|
83
|
-
if (
|
|
90
|
+
this.lines.length && this.lines.forEach((d) => d.removeFromParent()), this.lines = o.map((d, m) => {
|
|
91
|
+
const b = o[m + 1];
|
|
92
|
+
if (m !== 0 && b === void 0)
|
|
84
93
|
return null;
|
|
85
|
-
const
|
|
86
|
-
pointVisibility: this.withDots ? { startPoint:
|
|
94
|
+
const C = new L(c(a({}, h), {
|
|
95
|
+
pointVisibility: this.withDots ? { startPoint: m === 0, endPoint: !0 } : !1
|
|
87
96
|
}));
|
|
88
|
-
return
|
|
97
|
+
return C.setPoints([d, b]), C;
|
|
89
98
|
}).filter(I), this.add(...this.lines);
|
|
90
99
|
}
|
|
91
100
|
setStyle(i) {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
var
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
2
|
var u = Object.getOwnPropertySymbols;
|
|
3
|
-
var
|
|
4
|
-
var n = (s, t, e) => t in s ?
|
|
3
|
+
var a = Object.prototype.hasOwnProperty, g = Object.prototype.propertyIsEnumerable;
|
|
4
|
+
var n = (s, t, e) => t in s ? m(s, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[t] = e, d = (s, t) => {
|
|
5
5
|
for (var e in t || (t = {}))
|
|
6
|
-
|
|
6
|
+
a.call(t, e) && n(s, e, t[e]);
|
|
7
7
|
if (u)
|
|
8
8
|
for (var e of u(t))
|
|
9
|
-
|
|
9
|
+
g.call(t, e) && n(s, e, t[e]);
|
|
10
10
|
return s;
|
|
11
11
|
};
|
|
12
12
|
var o = (s, t, e) => (n(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
13
13
|
import { hotkeys as p } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
14
|
-
import { Sculpt as
|
|
15
|
-
import { IObject3D as
|
|
14
|
+
import { Sculpt as l } from "../../index.js";
|
|
15
|
+
import { IObject3D as b } from "../../../shared-utils/three/IObject3D.js";
|
|
16
16
|
import { applyObjectMatrixWorld as y } from "../../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
17
|
+
import { removeAllTag as v } from "../../utils/removeAllTag.js";
|
|
17
18
|
const f = /* @__PURE__ */ new Map();
|
|
18
|
-
class
|
|
19
|
-
constructor(e,
|
|
19
|
+
class D extends b {
|
|
20
|
+
constructor(e, r) {
|
|
20
21
|
super();
|
|
21
22
|
o(this, "name", "Sculpt");
|
|
22
23
|
o(this, "isSculptObject", !0);
|
|
@@ -30,9 +31,11 @@ class E extends m {
|
|
|
30
31
|
*/
|
|
31
32
|
o(this, "config");
|
|
32
33
|
o(this, "editor");
|
|
33
|
-
o(this, "on", (e,
|
|
34
|
-
o(this, "off", (...e) =>
|
|
35
|
-
e != null && e.id && (this.uuid = e.id), this.config = d({ canEdit: !0, occlusionVisibility: !0, occlusionMode: "translucence" },
|
|
34
|
+
o(this, "on", (e, r, i) => l.modules.fiveDomEvents.addEventListener(this, e, r, i));
|
|
35
|
+
o(this, "off", (...e) => l.modules.fiveDomEvents.removeEventListener(this, ...e));
|
|
36
|
+
e != null && e.id && (this.uuid = e.id), this.config = d({ canEdit: !0, occlusionVisibility: !0, occlusionMode: "translucence" }, r), e != null && e.style && (e.style.occlusionVisibility = this.config.occlusionVisibility, e.style.occlusionMode = this.config.occlusionMode), this.addEventListener("removed", () => {
|
|
37
|
+
v(this);
|
|
38
|
+
}), this.config.canEdit && (p("backspace, delete", () => {
|
|
36
39
|
this.selected && this.delete();
|
|
37
40
|
}), this.on("click", () => {
|
|
38
41
|
var c, h;
|
|
@@ -52,13 +55,13 @@ class E extends m {
|
|
|
52
55
|
};
|
|
53
56
|
}
|
|
54
57
|
get pointSelector() {
|
|
55
|
-
return
|
|
58
|
+
return l.modules.pointSelector;
|
|
56
59
|
}
|
|
57
60
|
/**
|
|
58
61
|
* @description 停止创建当前物体,等同于`esc`
|
|
59
62
|
*/
|
|
60
63
|
stopCreating() {
|
|
61
|
-
|
|
64
|
+
l.modules.pointSelector.disable();
|
|
62
65
|
}
|
|
63
66
|
/**
|
|
64
67
|
* @description 从场景中删除当前物体,并且移除事件监听
|
|
@@ -81,10 +84,10 @@ class E extends m {
|
|
|
81
84
|
return y(this, e);
|
|
82
85
|
}
|
|
83
86
|
applyObjectQuaternion(e) {
|
|
84
|
-
const
|
|
85
|
-
return Array.isArray(e) ? e.map((i) => i.clone().applyQuaternion(
|
|
87
|
+
const r = this.quaternion.clone();
|
|
88
|
+
return Array.isArray(e) ? e.map((i) => i.clone().applyQuaternion(r)) : e.clone().applyQuaternion(r);
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
export {
|
|
89
|
-
|
|
92
|
+
D as BaseObject
|
|
90
93
|
};
|
|
@@ -12,9 +12,9 @@ import "@realsee/five/line";
|
|
|
12
12
|
import "../../utils/Modules/Global.js";
|
|
13
13
|
import "../../../shared-utils/three/THREESphere.js";
|
|
14
14
|
import "animejs";
|
|
15
|
-
import { notNil as
|
|
15
|
+
import { notNil as m } from "../../../shared-utils/isNil.js";
|
|
16
16
|
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
17
|
-
class
|
|
17
|
+
class l extends p {
|
|
18
18
|
constructor(t) {
|
|
19
19
|
super(t);
|
|
20
20
|
o(this, "draggingPoints", []);
|
|
@@ -33,7 +33,7 @@ class m extends p {
|
|
|
33
33
|
return this.children;
|
|
34
34
|
}
|
|
35
35
|
enable() {
|
|
36
|
-
super.enable(), this.points.filter(
|
|
36
|
+
super.enable(), this.points.filter(m).forEach((t) => {
|
|
37
37
|
const i = new a();
|
|
38
38
|
i.visible = !1, i.position.copy(t), i.draggable = !0, n.modules.fiveDomEvents.addEventListener(i, "drag", this.onDrag), n.modules.fiveDomEvents.addEventListener(i, "dragstart", this.onDragstart), n.modules.fiveDomEvents.addEventListener(i, "dragend", this.onDragend), this.add(i);
|
|
39
39
|
});
|
|
@@ -42,13 +42,13 @@ class m extends p {
|
|
|
42
42
|
super.disable(), this.removeChildren();
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
class O extends
|
|
45
|
+
class O extends l {
|
|
46
46
|
constructor(t) {
|
|
47
47
|
super(t);
|
|
48
48
|
o(this, "onDrag", (t) => {
|
|
49
49
|
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
50
50
|
return;
|
|
51
|
-
const i = h(n.modules.five, t.raycaster
|
|
51
|
+
const i = h(n.modules.five, t.raycaster);
|
|
52
52
|
this.draggingPoints.forEach((r) => r.position.copy(i.point)), this.originObject.lineMesh.setPoints(this.pointMeshes.map((r) => r.position));
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -58,5 +58,5 @@ class O extends m {
|
|
|
58
58
|
}
|
|
59
59
|
export {
|
|
60
60
|
O as LineEditor,
|
|
61
|
-
|
|
61
|
+
l as LineEditorAbstract
|
|
62
62
|
};
|
|
@@ -15,27 +15,27 @@ var W = (i, t, e) => new Promise((n, a) => {
|
|
|
15
15
|
var h = (o) => {
|
|
16
16
|
try {
|
|
17
17
|
d(e.next(o));
|
|
18
|
-
} catch (
|
|
19
|
-
a(
|
|
18
|
+
} catch (p) {
|
|
19
|
+
a(p);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, f = (o) => {
|
|
22
22
|
try {
|
|
23
23
|
d(e.throw(o));
|
|
24
|
-
} catch (
|
|
25
|
-
a(
|
|
24
|
+
} catch (p) {
|
|
25
|
+
a(p);
|
|
26
26
|
}
|
|
27
|
-
}, d = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(h,
|
|
27
|
+
}, d = (o) => o.done ? n(o.value) : Promise.resolve(o.value).then(h, f);
|
|
28
28
|
d((e = e.apply(i, t)).next());
|
|
29
29
|
});
|
|
30
30
|
import { hotkeys as D } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
31
|
import { LineMesh as x } from "../../Meshes/Line.js";
|
|
32
32
|
import { BaseObject as U } from "../Base/index.js";
|
|
33
|
-
import * as
|
|
33
|
+
import * as m from "three";
|
|
34
34
|
import { LineEditor as k } from "./Editor.js";
|
|
35
35
|
import { vector3ToArray as z } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
36
|
import { LineWithDotsMesh as E } from "../../Meshes/LineWithDots.js";
|
|
37
37
|
import { rayOnLine as B } from "../../utils/three/rayOnLine.js";
|
|
38
|
-
const F = new
|
|
38
|
+
const F = new m.Vector3();
|
|
39
39
|
class Q extends U {
|
|
40
40
|
constructor(e, n) {
|
|
41
41
|
super(e, n);
|
|
@@ -49,7 +49,7 @@ class Q extends U {
|
|
|
49
49
|
return C(u({}, this.baseData), {
|
|
50
50
|
points: z(this.applyObjectMatrixWorld(this.lineMesh.points)),
|
|
51
51
|
style: {
|
|
52
|
-
lineColor: new
|
|
52
|
+
lineColor: new m.Color(this.lineMesh.color).getHex(),
|
|
53
53
|
lineWidth: this.lineMesh.lineWidth,
|
|
54
54
|
dashed: this.lineMesh.dashed
|
|
55
55
|
}
|
|
@@ -78,10 +78,10 @@ function H(i, t, e) {
|
|
|
78
78
|
return;
|
|
79
79
|
const a = (d = e == null ? void 0 : e.limit) != null ? d : "none", h = new x(i.style);
|
|
80
80
|
n.add(h);
|
|
81
|
-
const
|
|
82
|
-
return n.add(
|
|
81
|
+
const f = new x({ dashed: !0, lineColor: i.color, lineWidth: i.lineWidth });
|
|
82
|
+
return n.add(f), t.enable(), new Promise((o, p) => {
|
|
83
83
|
const s = [];
|
|
84
|
-
let r,
|
|
84
|
+
let r, c;
|
|
85
85
|
const g = (l) => {
|
|
86
86
|
const w = s.length === 0 ? l.point : r.clone();
|
|
87
87
|
s.push(w), i.setPoints(s), s.length === 2 && (M(), o());
|
|
@@ -89,15 +89,15 @@ function H(i, t, e) {
|
|
|
89
89
|
if (!(s != null && s.length) || !l)
|
|
90
90
|
return;
|
|
91
91
|
const w = s.at(-1).clone();
|
|
92
|
-
a === "none" ? (r = l.point, h.setPoints([w, r])) : a === "xoz" ? (
|
|
92
|
+
a === "none" ? (r = l.point, h.setPoints([w, r])) : a === "xoz" ? (t.plane = c, c = c != null ? c : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), s[0]), r = c.projectPoint(l.point, F), h.setPoints([w, r]), f.setPoints([r, l.point])) : a === "y" && (r = B({
|
|
93
93
|
raycaster: l.raycaster,
|
|
94
|
-
line: new
|
|
94
|
+
line: new m.Line3(s[0].clone(), new m.Vector3(0, 1, 0).add(s[0])),
|
|
95
95
|
clampToLine: !1
|
|
96
96
|
}), h.setPoints([w, r]));
|
|
97
97
|
}, M = () => {
|
|
98
|
-
t.off("select", g), t.off("intersectionUpdate", L), t.off("disable", v), t.disable(), n == null || n.remove(h,
|
|
98
|
+
t.off("select", g), t.off("intersectionUpdate", L), t.off("disable", v), t.plane = null, t.disable(), n == null || n.remove(h, f);
|
|
99
99
|
}, v = () => {
|
|
100
|
-
M(), s.length !== 2 && (n == null || n.remove(i)),
|
|
100
|
+
M(), s.length !== 2 && (n == null || n.remove(i)), p(new Error("Cancelled"));
|
|
101
101
|
};
|
|
102
102
|
t.on("select", g), t.on("intersectionUpdate", L), t.on("disable", v);
|
|
103
103
|
});
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
var
|
|
2
|
-
var a = (r,
|
|
3
|
-
var o = (r,
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var a = (r, t, i) => t in r ? n(r, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : r[t] = i;
|
|
3
|
+
var o = (r, t, i) => (a(r, typeof t != "symbol" ? t + "" : t, i), i);
|
|
4
4
|
import { BaseEditor as c } from "../Base/Editor.js";
|
|
5
5
|
import { Sculpt as g } from "../../index.js";
|
|
6
6
|
import { getIntersectByRaycaster as b } from "../../../shared-utils/five/getPosition.js";
|
|
7
|
-
class
|
|
8
|
-
constructor(
|
|
9
|
-
super(
|
|
10
|
-
o(this, "onDrag", (
|
|
7
|
+
class l extends c {
|
|
8
|
+
constructor(i) {
|
|
9
|
+
super(i);
|
|
10
|
+
o(this, "onDrag", (i) => {
|
|
11
11
|
var e;
|
|
12
|
-
const
|
|
13
|
-
(e = this.originObject.pointMesh) == null || e.position.copy(
|
|
12
|
+
const s = b(g.modules.five, i.raycaster);
|
|
13
|
+
(e = this.originObject.pointMesh) == null || e.position.copy(s.point);
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
16
|
enable() {
|
|
@@ -21,5 +21,5 @@ class u extends c {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
export {
|
|
24
|
-
|
|
24
|
+
l as PointEditor
|
|
25
25
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
var a = Object.defineProperty;
|
|
2
2
|
var c = (o, i, t) => i in o ? a(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
|
|
3
|
-
var
|
|
3
|
+
var r = (o, i, t) => (c(o, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
4
|
import { Sculpt as g } from "../../index.js";
|
|
5
5
|
import { getIntersectByRaycaster as p } from "../../../shared-utils/five/getPosition.js";
|
|
6
6
|
import { LineEditorAbstract as h } from "../Line/Editor.js";
|
|
7
|
-
class
|
|
7
|
+
class u extends h {
|
|
8
8
|
constructor(t) {
|
|
9
9
|
super(t);
|
|
10
|
-
|
|
10
|
+
r(this, "onDrag", (t) => {
|
|
11
11
|
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
12
12
|
return;
|
|
13
|
-
const e = p(g.modules.five, t.raycaster
|
|
14
|
-
this.draggingPoints.forEach((
|
|
13
|
+
const e = p(g.modules.five, t.raycaster), n = this.originObject.areaMesh.projectPoint(e.point);
|
|
14
|
+
this.draggingPoints.forEach((s) => s.position.copy(n)), this.originObject.areaMesh.setPoints(this.pointMeshes.map((s) => s.position));
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
get points() {
|
|
@@ -19,5 +19,5 @@ class f extends h {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
u as PolygonEditor
|
|
23
23
|
};
|
|
@@ -2,50 +2,50 @@ var F = Object.defineProperty, L = Object.defineProperties;
|
|
|
2
2
|
var N = Object.getOwnPropertyDescriptors;
|
|
3
3
|
var x = Object.getOwnPropertySymbols;
|
|
4
4
|
var O = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
-
var
|
|
5
|
+
var w = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, u = (o, e) => {
|
|
6
6
|
for (var t in e || (e = {}))
|
|
7
|
-
O.call(e, t) &&
|
|
7
|
+
O.call(e, t) && w(o, t, e[t]);
|
|
8
8
|
if (x)
|
|
9
9
|
for (var t of x(e))
|
|
10
|
-
U.call(e, t) &&
|
|
10
|
+
U.call(e, t) && w(o, t, e[t]);
|
|
11
11
|
return o;
|
|
12
|
-
},
|
|
13
|
-
var y = (o, e, t) => (
|
|
14
|
-
var
|
|
12
|
+
}, V = (o, e) => L(o, N(e));
|
|
13
|
+
var y = (o, e, t) => (w(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
var j = (o, e, t) => new Promise((c, d) => {
|
|
15
15
|
var n = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
17
|
+
r(t.next(l));
|
|
18
18
|
} catch (s) {
|
|
19
19
|
d(s);
|
|
20
20
|
}
|
|
21
21
|
}, p = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
23
|
+
r(t.throw(l));
|
|
24
24
|
} catch (s) {
|
|
25
25
|
d(s);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, r = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(n, p);
|
|
28
|
+
r((t = t.apply(o, e)).next());
|
|
29
29
|
});
|
|
30
30
|
import { hotkeys as k } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
31
|
import { BaseObject as z } from "../Base/index.js";
|
|
32
32
|
import * as P from "three";
|
|
33
|
-
import { PolylineMesh as
|
|
34
|
-
import { AreaMesh as
|
|
33
|
+
import { PolylineMesh as T } from "../../Meshes/Polyline.js";
|
|
34
|
+
import { AreaMesh as A } from "../../Meshes/Area.js";
|
|
35
35
|
import { PolygonEditor as B } from "./Editor.js";
|
|
36
36
|
import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
|
|
37
37
|
const D = new P.Vector3();
|
|
38
38
|
class X extends z {
|
|
39
|
-
constructor(t,
|
|
40
|
-
super(t,
|
|
39
|
+
constructor(t, c) {
|
|
40
|
+
super(t, c);
|
|
41
41
|
y(this, "type", "Polygon");
|
|
42
42
|
y(this, "areaMesh");
|
|
43
|
-
this.editor = new B(this), t && (this.areaMesh = new
|
|
43
|
+
this.editor = new B(this), t && (this.areaMesh = new A(u(u({}, t.style), t)), this.add(this.areaMesh)), k("esc", () => {
|
|
44
44
|
this.stopCreating();
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
get data() {
|
|
48
|
-
return
|
|
48
|
+
return V(u({}, this.baseData), {
|
|
49
49
|
points: H(this.applyObjectMatrixWorld(this.areaMesh.points)),
|
|
50
50
|
style: {
|
|
51
51
|
color: this.areaMesh.color.getHex(),
|
|
@@ -63,48 +63,54 @@ class X extends z {
|
|
|
63
63
|
(t = this.areaMesh) == null || t.unhighlight();
|
|
64
64
|
}
|
|
65
65
|
create(t) {
|
|
66
|
-
return
|
|
66
|
+
return j(this, null, function* () {
|
|
67
67
|
this.children.forEach((d) => {
|
|
68
68
|
d.parent === this && this.remove(d);
|
|
69
69
|
}), this.children.length = 0;
|
|
70
|
-
const
|
|
71
|
-
this.areaMesh =
|
|
70
|
+
const c = new A(t);
|
|
71
|
+
this.areaMesh = c, this.add(this.areaMesh), yield I(this.areaMesh, this.pointSelector, t), this.editor.enable();
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
function I(o, e, t) {
|
|
76
|
-
return new Promise((
|
|
76
|
+
return new Promise((c, d) => {
|
|
77
77
|
var M;
|
|
78
78
|
const n = o.parent;
|
|
79
79
|
if (!n) {
|
|
80
80
|
d(new Error("No container"));
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
const p = (M = t == null ? void 0 : t.limit) != null ? M : "none",
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
const p = (M = t == null ? void 0 : t.limit) != null ? M : "none", r = new T({
|
|
84
|
+
dashed: !1,
|
|
85
|
+
lineColor: o.lineColor,
|
|
86
|
+
lineWidth: o.lineWidth,
|
|
87
|
+
occlusionMode: o.occlusionMode,
|
|
88
|
+
occlusionVisibility: o.occlusionVisibility
|
|
89
|
+
});
|
|
90
|
+
n == null || n.add(r);
|
|
91
|
+
const l = new T({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
|
|
86
92
|
n == null || n.add(l), e.enable();
|
|
87
93
|
const s = [];
|
|
88
|
-
let i, a,
|
|
89
|
-
const C = (
|
|
90
|
-
const
|
|
91
|
-
s.push(
|
|
92
|
-
},
|
|
93
|
-
if (!(s != null && s.length) || !
|
|
94
|
+
let i, a, g = !1;
|
|
95
|
+
const C = (h) => {
|
|
96
|
+
const f = s.length === 0 ? h.point : i.clone();
|
|
97
|
+
s.push(f), o.setPoints(s, { closed: !1 }), g && (v(), c());
|
|
98
|
+
}, b = (h) => {
|
|
99
|
+
if (!(s != null && s.length) || !h)
|
|
94
100
|
return;
|
|
95
|
-
const
|
|
96
|
-
if (s.length < 3 && (p === "none" ? (i =
|
|
97
|
-
i = o.projectPoint(
|
|
101
|
+
const f = s.at(-1).clone();
|
|
102
|
+
if (s.length < 3 && (p === "none" ? (i = h.point, r.setPoints([f, i])) : p === "xoz" ? (a = a != null ? a : new P.Plane().setFromNormalAndCoplanarPoint(new P.Vector3(0, 1, 0), s[0]), e.plane = a, i = a.projectPoint(h.point, D), r.setPoints([f, i]), l.setPoints([i, h.point])) : p === "y" && (s.length === 1 ? (i = h.point, r.setPoints([f, i])) : (a = a != null ? a : new P.Plane().setFromCoplanarPoints(s[0], s[1], new P.Vector3(0, 1, 0).add(s[0])), e.plane = a, i = a.projectPoint(h.point, D), r.setPoints([f, i]), l.setPoints([i, h.point])))), s.length >= 3) {
|
|
103
|
+
i = o.projectPoint(h.point);
|
|
98
104
|
const m = s[0], W = 0.2;
|
|
99
|
-
m.distanceTo(i) < W || m.distanceTo(
|
|
105
|
+
m.distanceTo(i) < W || m.distanceTo(h.point) < W ? (i = m, h.point.copy(m), e.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 }), g = !0) : g = !1, r.setPoints([f, i]), l.setPoints([i, h.point]);
|
|
100
106
|
}
|
|
101
107
|
s.length >= 2 && o.setPoints([...s, i], { closed: !1 });
|
|
102
|
-
},
|
|
103
|
-
e.off("select", C), e.off("intersectionUpdate",
|
|
108
|
+
}, v = () => {
|
|
109
|
+
e.off("select", C), e.off("intersectionUpdate", b), e.off("disable", E), e.plane = null, e.disable(), n == null || n.remove(r, l);
|
|
104
110
|
}, E = () => {
|
|
105
|
-
|
|
111
|
+
v(), n == null || n.remove(o, l, r), d(new Error("Cancelled"));
|
|
106
112
|
};
|
|
107
|
-
e.on("select", C), e.on("intersectionUpdate",
|
|
113
|
+
e.on("select", C), e.on("intersectionUpdate", b), e.on("disable", E);
|
|
108
114
|
});
|
|
109
115
|
}
|
|
110
116
|
export {
|
|
@@ -4,13 +4,13 @@ var r = (o, i, t) => (p(o, typeof i != "symbol" ? i + "" : i, t), t);
|
|
|
4
4
|
import { Sculpt as g } from "../../index.js";
|
|
5
5
|
import { getIntersectByRaycaster as c } from "../../../shared-utils/five/getPosition.js";
|
|
6
6
|
import { LineEditorAbstract as a } from "../Line/Editor.js";
|
|
7
|
-
class
|
|
7
|
+
class y extends a {
|
|
8
8
|
constructor(t) {
|
|
9
9
|
super(t);
|
|
10
10
|
r(this, "onDrag", (t) => {
|
|
11
11
|
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
12
12
|
return;
|
|
13
|
-
const e = c(g.modules.five, t.raycaster
|
|
13
|
+
const e = c(g.modules.five, t.raycaster);
|
|
14
14
|
this.draggingPoints.forEach((s) => s.position.copy(e.point)), this.originObject.polyLineMesh.setPoints(this.pointMeshes.map((s) => s.position));
|
|
15
15
|
});
|
|
16
16
|
}
|
|
@@ -19,5 +19,5 @@ class d extends a {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
y as PolylineEditor
|
|
23
23
|
};
|