@realsee/dnalogel 3.44.5 → 3.45.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 +3 -0
- package/dist/Sculpt/Meshes/Area.d.ts +1 -1
- package/dist/Sculpt/Meshes/Box.d.ts +1 -1
- package/dist/Sculpt/Meshes/Circle.d.ts +1 -1
- package/dist/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +2 -1
- package/dist/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/dist/Sculpt/Meshes/Point.d.ts +1 -1
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Prism.d.ts +1 -1
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/dist/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/dist/Sculpt/Objects/Line/index.d.ts +33 -0
- package/dist/Sculpt/Objects/Point/index.d.ts +1 -1
- package/dist/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/dist/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/dist/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/dist/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/dist/Sculpt/index.d.ts +5 -0
- package/dist/Sculpt/typings/index.d.ts +11 -6
- package/dist/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/dist/Sculpt/typings/utils.type.d.ts +2 -0
- package/dist/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/dist/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/dist/index.cjs.js +56 -56
- package/dist/index.js +4272 -4171
- package/dist/index.umd.js +45 -45
- package/dist/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/ModelMakerPlugin/Controller.js +1 -1
- package/libs/ModelMakerPlugin/index.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller0.js +1 -1
- package/libs/PanoMeasurePlugin/Components/Controller1.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/EditController.js +1 -1
- package/libs/PanoMeasurePlugin/Controller/index.js +1 -1
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +1 -1
- package/libs/PanoMeasurePlugin/index.js +1 -1
- package/libs/Sculpt/Meshes/Area.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.d.ts +1 -1
- package/libs/Sculpt/Meshes/Box.js +10 -10
- package/libs/Sculpt/Meshes/Circle.d.ts +1 -1
- package/libs/Sculpt/Meshes/Circle.js +1 -1
- package/libs/Sculpt/Meshes/CircleWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Cylinder.js +1 -1
- package/libs/Sculpt/Meshes/Line.d.ts +2 -1
- package/libs/Sculpt/Meshes/Line.js +55 -47
- package/libs/Sculpt/Meshes/LineWithDots.d.ts +1 -1
- package/libs/Sculpt/Meshes/LineWithDots.js +26 -26
- package/libs/Sculpt/Meshes/Point.d.ts +1 -1
- package/libs/Sculpt/Meshes/Point.js +1 -1
- package/libs/Sculpt/Meshes/Polygon.js +1 -1
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Prism.d.ts +1 -1
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +3 -4
- package/libs/Sculpt/Objects/Box/index.js +41 -43
- package/libs/Sculpt/Objects/Cylinder/index.js +35 -37
- package/libs/Sculpt/Objects/Line/Editor.d.ts +22 -0
- package/libs/Sculpt/Objects/Line/Editor.js +61 -0
- package/libs/Sculpt/Objects/Line/index.d.ts +33 -0
- package/libs/Sculpt/Objects/Line/index.js +107 -0
- package/libs/Sculpt/Objects/Point/index.d.ts +1 -1
- package/libs/Sculpt/Objects/Polygon/Editor.d.ts +2 -2
- package/libs/Sculpt/Objects/Polygon/Editor.js +5 -5
- package/libs/Sculpt/Objects/Polygon/index.d.ts +3 -2
- package/libs/Sculpt/Objects/Polygon/index.js +80 -80
- package/libs/Sculpt/Objects/Polyline/Editor.d.ts +3 -17
- package/libs/Sculpt/Objects/Polyline/Editor.js +10 -48
- package/libs/Sculpt/Objects/Polyline/index.d.ts +7 -6
- package/libs/Sculpt/Objects/Polyline/index.js +63 -58
- package/libs/Sculpt/Objects/Prism/index.js +56 -58
- package/libs/Sculpt/index.d.ts +5 -0
- package/libs/Sculpt/index.js +58 -48
- package/libs/Sculpt/typings/index.d.ts +11 -6
- package/libs/Sculpt/{utils/color.d.ts → typings/style.d.ts} +7 -0
- package/libs/Sculpt/typings/utils.type.d.ts +2 -0
- package/libs/Sculpt/utils/three/ColoredMesh.d.ts +1 -1
- package/libs/Sculpt/utils/three/ColoredMesh.js +1 -1
- package/libs/Sculpt/utils/three/rayOnLine.d.ts +3 -5
- package/libs/Sculpt/utils/three/rayOnLine.js +15 -14
- package/libs/base/BasePlugin.js +1 -1
- package/libs/floorplan/MapviewFloorplanPlugin/Controller.js +3 -2
- package/libs/index.js +128 -126
- package/libs/shared-utils/Object3DHelper/Controller/MoveController.js +1 -1
- package/libs/shared-utils/Object3DHelper/Controller/ScaleController.js +23 -23
- package/libs/shared-utils/Utils/WorkUtil.d.ts +6 -6
- package/libs/shared-utils/Utils/WorkUtil.js +8 -7
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/utils/PointSelectorHelper.js +15 -15
- package/package.json +1 -1
- package/dist/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- package/libs/Sculpt/typings/SimplifyDeep.d.ts +0 -3
- /package/libs/Sculpt/{utils/color.js → typings/style.js} +0 -0
|
@@ -1,50 +1,52 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
for (var
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
1
|
+
var F = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var N = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var x = Object.getOwnPropertySymbols;
|
|
4
|
+
var O = Object.prototype.hasOwnProperty, U = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var u = (o, e, t) => e in o ? F(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t, g = (o, e) => {
|
|
6
|
+
for (var t in e || (e = {}))
|
|
7
|
+
O.call(e, t) && u(o, t, e[t]);
|
|
8
|
+
if (x)
|
|
9
|
+
for (var t of x(e))
|
|
10
|
+
U.call(e, t) && u(o, t, e[t]);
|
|
11
|
+
return o;
|
|
12
|
+
}, j = (o, e) => L(o, N(e));
|
|
13
|
+
var y = (o, e, t) => (u(o, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
var T = (o, e, t) => new Promise((f, d) => {
|
|
15
|
+
var n = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
s
|
|
17
|
+
h(t.next(l));
|
|
18
|
+
} catch (s) {
|
|
19
|
+
d(s);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, p = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
s
|
|
23
|
+
h(t.throw(l));
|
|
24
|
+
} catch (s) {
|
|
25
|
+
d(s);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, h = (l) => l.done ? f(l.value) : Promise.resolve(l.value).then(n, p);
|
|
28
|
+
h((t = t.apply(o, e)).next());
|
|
29
29
|
});
|
|
30
|
-
import { hotkeys as
|
|
31
|
-
import { BaseObject as
|
|
32
|
-
import
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
import { hotkeys as k } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
|
+
import { BaseObject as z } from "../Base/index.js";
|
|
32
|
+
import * as P from "three";
|
|
33
|
+
import { PolylineMesh as A } from "../../Meshes/Polyline.js";
|
|
34
|
+
import { AreaMesh as V } from "../../Meshes/Area.js";
|
|
35
|
+
import { PolygonEditor as B } from "./Editor.js";
|
|
36
|
+
import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
|
|
37
|
+
const D = new P.Vector3();
|
|
38
|
+
class X extends z {
|
|
39
|
+
constructor(t, f) {
|
|
40
|
+
super(t, f);
|
|
41
|
+
y(this, "type", "Polygon");
|
|
42
|
+
y(this, "areaMesh");
|
|
43
|
+
this.editor = new B(this), t && (this.areaMesh = new V(g(g({}, t.style), t)), this.add(this.areaMesh)), k("esc", () => {
|
|
42
44
|
this.stopCreating();
|
|
43
45
|
});
|
|
44
46
|
}
|
|
45
47
|
get data() {
|
|
46
|
-
return
|
|
47
|
-
points:
|
|
48
|
+
return j(g({}, this.baseData), {
|
|
49
|
+
points: H(this.applyObjectMatrixWorld(this.areaMesh.points)),
|
|
48
50
|
style: {
|
|
49
51
|
color: this.areaMesh.color.getHex(),
|
|
50
52
|
lineColor: this.areaMesh.lineColor.getHex(),
|
|
@@ -53,61 +55,59 @@ class K extends O {
|
|
|
53
55
|
});
|
|
54
56
|
}
|
|
55
57
|
highlight() {
|
|
56
|
-
var
|
|
57
|
-
(
|
|
58
|
+
var t;
|
|
59
|
+
(t = this.areaMesh) == null || t.highlight();
|
|
58
60
|
}
|
|
59
61
|
unhighlight() {
|
|
60
|
-
var
|
|
61
|
-
(
|
|
62
|
+
var t;
|
|
63
|
+
(t = this.areaMesh) == null || t.unhighlight();
|
|
62
64
|
}
|
|
63
|
-
create(
|
|
64
|
-
return
|
|
65
|
-
this.children.forEach((
|
|
66
|
-
|
|
65
|
+
create(t) {
|
|
66
|
+
return T(this, null, function* () {
|
|
67
|
+
this.children.forEach((d) => {
|
|
68
|
+
d.parent === this && this.remove(d);
|
|
67
69
|
}), this.children.length = 0;
|
|
68
|
-
const
|
|
69
|
-
this.areaMesh =
|
|
70
|
+
const f = new V(t);
|
|
71
|
+
this.areaMesh = f, this.add(this.areaMesh), yield I(this.areaMesh, this.pointSelector, t), this.editor.enable();
|
|
70
72
|
});
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
|
-
function
|
|
74
|
-
return new Promise((
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
function I(o, e, t) {
|
|
76
|
+
return new Promise((f, d) => {
|
|
77
|
+
var M;
|
|
78
|
+
const n = o.parent;
|
|
79
|
+
if (!n) {
|
|
80
|
+
d(new Error("No container"));
|
|
78
81
|
return;
|
|
79
82
|
}
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
const l = new
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
let
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
if (!((v = i.points) != null && v.length) || !h)
|
|
83
|
+
const p = (M = t == null ? void 0 : t.limit) != null ? M : "none", h = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
|
|
84
|
+
n == null || n.add(h);
|
|
85
|
+
const l = new A({ dashed: !0, lineColor: o.lineColor, lineWidth: o.lineWidth });
|
|
86
|
+
n == null || n.add(l), e.enable();
|
|
87
|
+
const s = [];
|
|
88
|
+
let i, a, w = !1;
|
|
89
|
+
const C = (r) => {
|
|
90
|
+
const c = s.length === 0 ? r.point : i.clone();
|
|
91
|
+
s.push(c), o.setPoints(s, { closed: !1 }), w && (b(), f());
|
|
92
|
+
}, v = (r) => {
|
|
93
|
+
if (!(s != null && s.length) || !r)
|
|
92
94
|
return;
|
|
93
|
-
const
|
|
94
|
-
if (i.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const p = i.points[0], C = 0.2;
|
|
99
|
-
p.distanceTo(o) < C || p.distanceTo(h.point) < C ? (o = p, h.point.copy(p), t.pointSelectorHelper.updateWithIntersect(h, { emitEvent: !1 }), a = !0) : a = !1, l.setPoints([o, h.point]), s != null && s.children.includes(l) || s == null || s.add(l);
|
|
95
|
+
const c = s.at(-1).clone();
|
|
96
|
+
if (s.length < 3 && (p === "none" ? (i = r.point, h.setPoints([c, i])) : p === "xoz" ? (a = a != null ? a : new P.Plane().setFromNormalAndCoplanarPoint(new P.Vector3(0, 1, 0), s[0]), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])) : p === "y" && (s.length === 1 ? (i = r.point, h.setPoints([c, i])) : (a = a != null ? a : new P.Plane().setFromCoplanarPoints(s[0], s[1], new P.Vector3(0, 1, 0).add(s[0])), i = a.projectPoint(r.point, D), h.setPoints([c, i]), l.setPoints([i, r.point])))), s.length >= 3) {
|
|
97
|
+
i = o.projectPoint(r.point);
|
|
98
|
+
const m = s[0], W = 0.2;
|
|
99
|
+
m.distanceTo(i) < W || m.distanceTo(r.point) < W ? (i = m, r.point.copy(m), e.pointSelectorHelper.updateWithIntersect(r, { emitEvent: !1 }), w = !0) : w = !1, h.setPoints([c, i]), l.setPoints([i, r.point]);
|
|
100
100
|
}
|
|
101
|
-
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
},
|
|
105
|
-
|
|
101
|
+
s.length >= 2 && o.setPoints([...s, i], { closed: !1 });
|
|
102
|
+
}, b = () => {
|
|
103
|
+
e.off("select", C), e.off("intersectionUpdate", v), e.off("disable", E), e.disable(), n == null || n.remove(h, l);
|
|
104
|
+
}, E = () => {
|
|
105
|
+
b(), n == null || n.remove(o, l, h), d(new Error("Cancelled"));
|
|
106
106
|
};
|
|
107
|
-
|
|
107
|
+
e.on("select", C), e.on("intersectionUpdate", v), e.on("disable", E);
|
|
108
108
|
});
|
|
109
109
|
}
|
|
110
110
|
export {
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
X as Polygon,
|
|
112
|
+
I as createPolygon
|
|
113
113
|
};
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import { BaseEditor } from '../Base/Editor';
|
|
2
1
|
import type { FiveDomEvent } from '../../../shared-utils/five/FiveDomEvents';
|
|
3
2
|
import type { Polyline } from '.';
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
protected draggingPoints: PointMesh[];
|
|
8
|
-
protected get pointMeshes(): PointMesh[];
|
|
9
|
-
abstract get points(): THREE.Vector3[];
|
|
10
|
-
get pointHandles(): PointMesh[];
|
|
11
|
-
constructor(originObject: OriginObject);
|
|
12
|
-
enable(): void;
|
|
13
|
-
disable(): void;
|
|
14
|
-
protected onDragstart: (event: FiveDomEvent) => void;
|
|
15
|
-
protected onDragend: (event: FiveDomEvent) => void;
|
|
16
|
-
protected abstract onDrag(event: FiveDomEvent): void;
|
|
17
|
-
}
|
|
18
|
-
export declare class PolylineEditor extends LineEditor<Polyline> {
|
|
19
|
-
get points(): THREE.Vector3[];
|
|
3
|
+
import { LineEditorAbstract } from '../Line/Editor';
|
|
4
|
+
export declare class PolylineEditor extends LineEditorAbstract<Polyline> {
|
|
5
|
+
get points(): import("three").Vector3[];
|
|
20
6
|
constructor(originObject: Polyline);
|
|
21
7
|
protected onDrag: (event: FiveDomEvent) => void;
|
|
22
8
|
}
|
|
@@ -1,54 +1,17 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var r = (
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
import "three";
|
|
9
|
-
import "hammerjs";
|
|
10
|
-
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
11
|
-
import "@realsee/five/line";
|
|
12
|
-
import "../../../shared-utils/three/THREESphere.js";
|
|
13
|
-
import "animejs";
|
|
14
|
-
import { notNil as l } from "../../../shared-utils/isNil.js";
|
|
15
|
-
import "../../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
16
|
-
class m extends p {
|
|
17
|
-
constructor(t) {
|
|
18
|
-
super(t);
|
|
19
|
-
r(this, "draggingPoints", []);
|
|
20
|
-
r(this, "onDragstart", (t) => {
|
|
21
|
-
const i = t.target;
|
|
22
|
-
this.draggingPoints = this.pointMeshes.filter((o) => o.position.equals(i.position));
|
|
23
|
-
});
|
|
24
|
-
r(this, "onDragend", (t) => {
|
|
25
|
-
this.draggingPoints = [];
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
get pointMeshes() {
|
|
29
|
-
return this.children.filter((t) => t instanceof a);
|
|
30
|
-
}
|
|
31
|
-
get pointHandles() {
|
|
32
|
-
return this.children;
|
|
33
|
-
}
|
|
34
|
-
enable() {
|
|
35
|
-
super.enable(), this.points.filter(l).forEach((t) => {
|
|
36
|
-
const i = new a();
|
|
37
|
-
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);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
disable() {
|
|
41
|
-
super.disable(), this.removeChildren();
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
class B extends m {
|
|
1
|
+
var n = Object.defineProperty;
|
|
2
|
+
var p = (o, i, t) => i in o ? n(o, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[i] = t;
|
|
3
|
+
var r = (o, i, t) => (p(o, typeof i != "symbol" ? i + "" : i, t), t);
|
|
4
|
+
import { Sculpt as g } from "../../index.js";
|
|
5
|
+
import { getIntersectByRaycaster as c } from "../../../shared-utils/five/getPosition.js";
|
|
6
|
+
import { LineEditorAbstract as a } from "../Line/Editor.js";
|
|
7
|
+
class d extends a {
|
|
45
8
|
constructor(t) {
|
|
46
9
|
super(t);
|
|
47
10
|
r(this, "onDrag", (t) => {
|
|
48
11
|
if (!this.draggingPoints || this.draggingPoints.length === 0)
|
|
49
12
|
return;
|
|
50
|
-
const
|
|
51
|
-
this.draggingPoints.forEach((
|
|
13
|
+
const e = c(g.modules.five, t.raycaster, { virtualPoint: !0 });
|
|
14
|
+
this.draggingPoints.forEach((s) => s.position.copy(e.point)), this.originObject.polyLineMesh.setPoints(this.pointMeshes.map((s) => s.position));
|
|
52
15
|
});
|
|
53
16
|
}
|
|
54
17
|
get points() {
|
|
@@ -56,6 +19,5 @@ class B extends m {
|
|
|
56
19
|
}
|
|
57
20
|
}
|
|
58
21
|
export {
|
|
59
|
-
|
|
60
|
-
B as PolylineEditor
|
|
22
|
+
d as PolylineEditor
|
|
61
23
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { Color } from '../../../Object3DHelperPlugin';
|
|
2
1
|
import { PolylineMesh, PolylineWithDotsMesh, type PolylineData, type PolylineStyle } from '../../Meshes/Polyline';
|
|
3
2
|
import { BaseObject, type BaseImportData, type BaseObjectConfig } from '../Base';
|
|
4
3
|
import type { PointSelector } from '../../../shared-utils/three/PointSelector';
|
|
5
4
|
import type { LiteralString } from '../../../typings/utils.type';
|
|
5
|
+
import type { LimitPlaneConfig } from '../../typings/style';
|
|
6
6
|
export interface PolylineImportData extends BaseImportData, PolylineData {
|
|
7
7
|
type: LiteralString<'Polyline'>;
|
|
8
8
|
style?: Partial<PolylineStyle>;
|
|
@@ -23,9 +23,10 @@ export declare class Polyline extends BaseObject<PolylineImportData> {
|
|
|
23
23
|
constructor(data?: PolylineImportData, config?: Partial<BaseObjectConfig>);
|
|
24
24
|
highlight(): void;
|
|
25
25
|
unhighlight(): void;
|
|
26
|
-
create(params?:
|
|
27
|
-
color?: Color;
|
|
28
|
-
lineWidth?: number;
|
|
29
|
-
}): Promise<void>;
|
|
26
|
+
create(params?: Partial<PolylineStyle & LimitPlaneConfig>): Promise<void>;
|
|
30
27
|
}
|
|
31
|
-
|
|
28
|
+
/**
|
|
29
|
+
* @description 绘制折线
|
|
30
|
+
* @param config.limit 限制折线绘制的平面; `xoz` 限制在水平面; `y` 限制垂直面; `none` 不限制;默认 `none`
|
|
31
|
+
*/
|
|
32
|
+
export declare function createPolyline(polyLineMesh: PolylineMesh, pointSelector: PointSelector, config?: Partial<LimitPlaneConfig>): Promise<void>;
|
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var j = Object.defineProperty, E = Object.defineProperties;
|
|
2
|
+
var V = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var v = Object.getOwnPropertySymbols;
|
|
4
|
+
var A = Object.prototype.hasOwnProperty, D = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (i, t, e) => t in i ? j(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, w = (i, t) => {
|
|
6
6
|
for (var e in t || (t = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
7
|
+
A.call(t, e) && f(i, e, t[e]);
|
|
8
|
+
if (v)
|
|
9
|
+
for (var e of v(t))
|
|
10
|
+
D.call(t, e) && f(i, e, t[e]);
|
|
11
11
|
return i;
|
|
12
|
-
},
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var a = (
|
|
12
|
+
}, M = (i, t) => E(i, V(t));
|
|
13
|
+
var u = (i, t, e) => (f(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
var L = (i, t, e) => new Promise((o, d) => {
|
|
15
|
+
var a = (r) => {
|
|
16
16
|
try {
|
|
17
|
-
|
|
18
|
-
} catch (
|
|
19
|
-
|
|
17
|
+
c(e.next(r));
|
|
18
|
+
} catch (y) {
|
|
19
|
+
d(y);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, p = (r) => {
|
|
22
22
|
try {
|
|
23
|
-
|
|
24
|
-
} catch (
|
|
25
|
-
|
|
23
|
+
c(e.throw(r));
|
|
24
|
+
} catch (y) {
|
|
25
|
+
d(y);
|
|
26
26
|
}
|
|
27
|
-
},
|
|
28
|
-
|
|
27
|
+
}, c = (r) => r.done ? o(r.value) : Promise.resolve(r.value).then(a, p);
|
|
28
|
+
c((e = e.apply(i, t)).next());
|
|
29
29
|
});
|
|
30
|
-
import { hotkeys as
|
|
31
|
-
import { PolylineWithDotsMesh as
|
|
32
|
-
import { BaseObject as
|
|
33
|
-
import * as
|
|
34
|
-
import { PolylineEditor as
|
|
35
|
-
import { vector3ToArray as
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
import { hotkeys as F } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
|
+
import { PolylineWithDotsMesh as W, PolylineMesh as b } from "../../Meshes/Polyline.js";
|
|
32
|
+
import { BaseObject as O } from "../Base/index.js";
|
|
33
|
+
import * as m from "three";
|
|
34
|
+
import { PolylineEditor as T } from "./Editor.js";
|
|
35
|
+
import { vector3ToArray as U } from "../../../shared-utils/three/vector3ToArray.js";
|
|
36
|
+
const x = new m.Vector3();
|
|
37
|
+
class G extends O {
|
|
38
|
+
constructor(e, o) {
|
|
39
|
+
super(e, o);
|
|
40
|
+
u(this, "type", "Polyline");
|
|
41
|
+
u(this, "polyLineMesh");
|
|
42
|
+
e && (this.polyLineMesh = new W(w(w({}, e.style), e)), this.add(this.polyLineMesh)), this.editor = new T(this), F("esc", () => {
|
|
42
43
|
this.stopCreating();
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
get data() {
|
|
46
|
-
return
|
|
47
|
-
points:
|
|
47
|
+
return M(w({}, this.baseData), {
|
|
48
|
+
points: U(this.applyObjectMatrixWorld(this.polyLineMesh.points)),
|
|
48
49
|
style: {
|
|
49
|
-
lineColor: new
|
|
50
|
+
lineColor: new m.Color(this.polyLineMesh.lineColor).getHex(),
|
|
50
51
|
lineWidth: this.polyLineMesh.lineWidth,
|
|
51
52
|
dashed: this.polyLineMesh.dashed
|
|
52
53
|
}
|
|
@@ -61,36 +62,40 @@ class q extends E {
|
|
|
61
62
|
(e = this.polyLineMesh) == null || e.unhighlight();
|
|
62
63
|
}
|
|
63
64
|
create(e) {
|
|
64
|
-
return
|
|
65
|
+
return L(this, null, function* () {
|
|
65
66
|
this.removeChildren();
|
|
66
|
-
const
|
|
67
|
-
this.polyLineMesh =
|
|
67
|
+
const o = new W(e);
|
|
68
|
+
this.polyLineMesh = o, this.add(this.polyLineMesh), yield k(o, this.pointSelector, e), this.editor.enable();
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
function k(i, t, e) {
|
|
73
|
+
var c;
|
|
74
|
+
const o = i.parent;
|
|
75
|
+
if (!o)
|
|
74
76
|
return;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
const d = (c = e == null ? void 0 : e.limit) != null ? c : "none", a = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
|
|
78
|
+
o.add(a);
|
|
79
|
+
const p = new b({ dashed: !0, lineColor: i.lineColor, lineWidth: i.lineWidth });
|
|
80
|
+
return o.add(p), t.enable(), new Promise((r, y) => {
|
|
81
|
+
const n = [];
|
|
82
|
+
let s, l;
|
|
83
|
+
const C = (h) => {
|
|
84
|
+
const P = n.length === 0 ? h.point : s.clone();
|
|
85
|
+
n.push(P), i.setPoints(n);
|
|
86
|
+
}, g = (h) => {
|
|
87
|
+
if (!(n != null && n.length) || !h)
|
|
83
88
|
return;
|
|
84
|
-
const
|
|
85
|
-
n.setPoints([
|
|
89
|
+
const P = n.at(-1).clone();
|
|
90
|
+
d === "none" ? (s = h.point, a.setPoints([P, s])) : d === "xoz" ? (l = l != null ? l : new m.Plane().setFromNormalAndCoplanarPoint(new m.Vector3(0, 1, 0), n[0]), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])) : d === "y" && (n.length === 1 ? (s = h.point, a.setPoints([P, s])) : (l = l != null ? l : new m.Plane().setFromCoplanarPoints(n[0], n[1], new m.Vector3(0, 1, 0).add(n[0])), s = l.projectPoint(h.point, x), a.setPoints([P, s]), p.setPoints([s, h.point])));
|
|
86
91
|
};
|
|
87
|
-
t.on("select",
|
|
88
|
-
if (t.off("select",
|
|
89
|
-
return
|
|
90
|
-
|
|
92
|
+
t.on("select", C), t.on("intersectionUpdate", g), t.on("disable", () => {
|
|
93
|
+
if (t.off("select", C), t.off("intersectionUpdate", g), o.remove(a), o.remove(p), n.length < 2)
|
|
94
|
+
return o.remove(i), y(new Error("Cancelled"));
|
|
95
|
+
r();
|
|
91
96
|
});
|
|
92
97
|
});
|
|
93
98
|
}
|
|
94
99
|
export {
|
|
95
|
-
|
|
100
|
+
G as Polyline
|
|
96
101
|
};
|
|
@@ -1,49 +1,48 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var p = (
|
|
6
|
-
for (var t in
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var t of
|
|
10
|
-
C.call(
|
|
11
|
-
return
|
|
12
|
-
}, w = (
|
|
13
|
-
var d = (
|
|
14
|
-
var
|
|
15
|
-
var
|
|
1
|
+
var E = Object.defineProperty, L = Object.defineProperties;
|
|
2
|
+
var O = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var u = Object.getOwnPropertySymbols;
|
|
4
|
+
var v = Object.prototype.hasOwnProperty, C = Object.prototype.propertyIsEnumerable;
|
|
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
|
+
for (var t in e || (e = {}))
|
|
7
|
+
v.call(e, t) && p(i, t, e[t]);
|
|
8
|
+
if (u)
|
|
9
|
+
for (var t of u(e))
|
|
10
|
+
C.call(e, t) && p(i, t, e[t]);
|
|
11
|
+
return i;
|
|
12
|
+
}, w = (i, e) => L(i, O(e));
|
|
13
|
+
var d = (i, e, t) => (p(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
14
|
+
var g = (i, e, t) => new Promise((o, n) => {
|
|
15
|
+
var l = (s) => {
|
|
16
16
|
try {
|
|
17
|
-
r(t.next(
|
|
18
|
-
} catch (
|
|
19
|
-
n(
|
|
17
|
+
r(t.next(s));
|
|
18
|
+
} catch (h) {
|
|
19
|
+
n(h);
|
|
20
20
|
}
|
|
21
|
-
},
|
|
21
|
+
}, m = (s) => {
|
|
22
22
|
try {
|
|
23
|
-
r(t.throw(
|
|
24
|
-
} catch (
|
|
25
|
-
n(
|
|
23
|
+
r(t.throw(s));
|
|
24
|
+
} catch (h) {
|
|
25
|
+
n(h);
|
|
26
26
|
}
|
|
27
|
-
}, r = (
|
|
28
|
-
r((t = t.apply(
|
|
27
|
+
}, r = (s) => s.done ? o(s.value) : Promise.resolve(s.value).then(l, m);
|
|
28
|
+
r((t = t.apply(i, e)).next());
|
|
29
29
|
});
|
|
30
30
|
import { BaseObject as W } from "../Base/index.js";
|
|
31
31
|
import * as j from "three";
|
|
32
32
|
import { createPolygon as T } from "../Polygon/index.js";
|
|
33
33
|
import { PrismMesh as x } from "../../Meshes/Prism.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import { getNormal as D } from "../../../shared-utils/three/getNormal.js";
|
|
34
|
+
import { LineMesh as U } from "../../Meshes/Line.js";
|
|
35
|
+
import { PrismEditor as k } from "./Editor.js";
|
|
36
|
+
import { hotkeys as z } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
37
|
+
import { rayOnLine as A } from "../../utils/three/rayOnLine.js";
|
|
38
|
+
import { getNormal as B } from "../../../shared-utils/three/getNormal.js";
|
|
40
39
|
import { vector3ToArray as H } from "../../../shared-utils/three/vector3ToArray.js";
|
|
41
|
-
class
|
|
42
|
-
constructor(t,
|
|
43
|
-
super(t,
|
|
40
|
+
class X extends W {
|
|
41
|
+
constructor(t, o) {
|
|
42
|
+
super(t, o);
|
|
44
43
|
d(this, "type", "Prism");
|
|
45
44
|
d(this, "prismMesh");
|
|
46
|
-
this.editor = new
|
|
45
|
+
this.editor = new k(this), t && (this.prismMesh = new x(c(c({}, t.style), t)), this.add(this.prismMesh)), z("esc", () => {
|
|
47
46
|
this.stopCreating();
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -67,39 +66,38 @@ class Z extends W {
|
|
|
67
66
|
(t = this.prismMesh) == null || t.unhighlight();
|
|
68
67
|
}
|
|
69
68
|
create(t) {
|
|
70
|
-
return
|
|
71
|
-
this.prismMesh = new x(t), this.add(this.prismMesh), yield
|
|
69
|
+
return g(this, null, function* () {
|
|
70
|
+
this.prismMesh = new x(t), this.add(this.prismMesh), yield D(this.prismMesh, this.pointSelector), this.editor.enable();
|
|
72
71
|
});
|
|
73
72
|
}
|
|
74
73
|
}
|
|
75
|
-
function
|
|
76
|
-
return
|
|
77
|
-
const t =
|
|
78
|
-
yield T(
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
const n =
|
|
82
|
-
return
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
},
|
|
86
|
-
if (!(
|
|
74
|
+
function D(i, e) {
|
|
75
|
+
return g(this, null, function* () {
|
|
76
|
+
const t = i.parent;
|
|
77
|
+
yield T(i.bottomPolygon, e);
|
|
78
|
+
const o = new U();
|
|
79
|
+
o.name = "LineHelper", t.add(o);
|
|
80
|
+
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
|
+
return o.setPoints([m, r]), e.enable(), new Promise((s, h) => {
|
|
82
|
+
const f = (a) => {
|
|
83
|
+
P(), s();
|
|
84
|
+
}, y = (a) => {
|
|
85
|
+
if (!(a != null && a.raycaster))
|
|
87
86
|
return;
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
line: new j.Line3(l, r)
|
|
87
|
+
const M = A({
|
|
88
|
+
raycaster: a.raycaster,
|
|
89
|
+
line: new j.Line3(m, r)
|
|
92
90
|
});
|
|
93
|
-
|
|
94
|
-
},
|
|
95
|
-
|
|
91
|
+
M && i.setPoints({ heightPoint: M });
|
|
92
|
+
}, P = () => {
|
|
93
|
+
e.off("select", f), e.off("intersectionUpdate", y), e.off("disable", b), t.remove(o), e.disable();
|
|
96
94
|
}, b = () => {
|
|
97
|
-
|
|
95
|
+
P(), t.remove(i), h(new Error("Cancelled"));
|
|
98
96
|
};
|
|
99
|
-
|
|
97
|
+
e.on("select", f), e.on("intersectionUpdate", y), e.on("disable", b);
|
|
100
98
|
});
|
|
101
99
|
});
|
|
102
100
|
}
|
|
103
101
|
export {
|
|
104
|
-
|
|
102
|
+
X as Prism
|
|
105
103
|
};
|