@realsee/dnalogel 3.46.1 → 3.47.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 +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/three/ColoredMesh.d.ts +6 -0
- package/dist/index.cjs.js +39 -39
- package/dist/index.js +2162 -2120
- package/dist/index.umd.js +34 -34
- 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/PanoTagPlugin/tag.config.js +1 -2
- 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/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/three/ColoredMesh.d.ts +6 -0
- package/libs/Sculpt/utils/three/ColoredMesh.js +39 -31
- package/libs/base/BasePlugin.js +1 -1
- 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
|
@@ -19,4 +19,6 @@ export declare function getIntersectByNdcPosition(five: Five, position: {
|
|
|
19
19
|
export declare function getIntersectByRaycaster(five: Five, raycaster: THREE.Raycaster, config?: {
|
|
20
20
|
virtualPoint?: boolean;
|
|
21
21
|
}): IIntersection | undefined;
|
|
22
|
+
export declare function getVirtualIntersectByRaycaster(raycaster: THREE.Raycaster, distance?: number): IIntersection;
|
|
23
|
+
export declare function getRealIntersectByRaycaster(five: Five, raycaster: THREE.Raycaster): IIntersection;
|
|
22
24
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { Five
|
|
1
|
+
import type { Five } from '@realsee/five';
|
|
2
2
|
import { PointSelectorHelper, type PointIntersection, type PointSelectorHelperConfig } from './utils/PointSelectorHelper';
|
|
3
|
-
import type
|
|
3
|
+
import { type Vector3 } from 'three';
|
|
4
|
+
import * as THREE from 'three';
|
|
4
5
|
import { Subscribe } from '../../Subscribe';
|
|
5
6
|
export type { PointIntersection };
|
|
7
|
+
type ActionIfNoModelUnderMouse = 'virtualPoint' | 'lastPoint' | 'disable';
|
|
6
8
|
interface Config {
|
|
7
9
|
/**
|
|
8
10
|
* @description: 选点的两种模式, 'fixed' 为固定选点为屏幕中心点,拖动five画布来更新点,'cursor' 为跟随鼠标移动来更新点, 'auto' 则根据设备类型自动选择
|
|
@@ -10,15 +12,15 @@ interface Config {
|
|
|
10
12
|
*/
|
|
11
13
|
mode: 'fixed' | 'cursor' | 'auto';
|
|
12
14
|
/**
|
|
13
|
-
* @description
|
|
15
|
+
* @description 当鼠标位置没有模型时的行为
|
|
14
16
|
* ```markdown
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* virtualPoint: 生成一个虚拟点
|
|
18
|
+
* lastPoint: 选点器停留在上一个点处
|
|
19
|
+
* disable: 禁止选点
|
|
18
20
|
* ```
|
|
19
|
-
* @default
|
|
21
|
+
* @default 'virtualPoint'
|
|
20
22
|
*/
|
|
21
|
-
|
|
23
|
+
actionIfNoModelUnderMouse: ActionIfNoModelUnderMouse;
|
|
22
24
|
helper: PointSelectorHelperConfig;
|
|
23
25
|
}
|
|
24
26
|
export type PointSelectorConfig = Partial<Config>;
|
|
@@ -55,6 +57,8 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
55
57
|
*/
|
|
56
58
|
outOfFive: boolean;
|
|
57
59
|
enabled: boolean;
|
|
60
|
+
actionIfNoModelUnderMouse: ActionIfNoModelUnderMouse;
|
|
61
|
+
plane?: THREE.Plane | null;
|
|
58
62
|
pointSelectorHelper: PointSelectorHelper;
|
|
59
63
|
/** @deprecated directly use `pointSelector.on/off` instead */
|
|
60
64
|
hook: this;
|
|
@@ -68,10 +72,10 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
68
72
|
/** 吸附点的半径 */
|
|
69
73
|
private adherePointsRadius;
|
|
70
74
|
private lastFiveHelperVisible?;
|
|
75
|
+
private lastIntersection?;
|
|
71
76
|
private mousePosition;
|
|
72
77
|
private config;
|
|
73
78
|
private get mouseNdcPosition();
|
|
74
|
-
private get virtualPoint();
|
|
75
79
|
constructor(five: Five, config?: PointSelectorConfig);
|
|
76
80
|
enable(): void;
|
|
77
81
|
disable(): void;
|
|
@@ -109,7 +113,7 @@ export declare class PointSelector extends Subscribe<EventMap> {
|
|
|
109
113
|
private onPanEnd;
|
|
110
114
|
private updateByMousePosition;
|
|
111
115
|
/**
|
|
112
|
-
* @description:
|
|
116
|
+
* @description: 根据鼠标位置计算焦点位置并更新
|
|
113
117
|
*/
|
|
114
118
|
private updateByNdcPosition;
|
|
115
119
|
/**
|
|
@@ -9,6 +9,12 @@ export type PolygonStyle = ColoredMeshStyle;
|
|
|
9
9
|
export type PolygonData = PointsData;
|
|
10
10
|
export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
11
11
|
name: string;
|
|
12
|
+
get style(): {
|
|
13
|
+
color: THREE.Color;
|
|
14
|
+
opacity: number;
|
|
15
|
+
occlusionVisibility: boolean;
|
|
16
|
+
occlusionMode: string;
|
|
17
|
+
};
|
|
12
18
|
get isBlank(): boolean;
|
|
13
19
|
get center(): THREE.Vector3;
|
|
14
20
|
points: THREE.Vector3[];
|
|
@@ -4,13 +4,13 @@ var t = (o, i, e) => (p(o, typeof i != "symbol" ? i + "" : i, e), e);
|
|
|
4
4
|
import * as r from "three";
|
|
5
5
|
import { generatePolygonGeometry as g } from "../../shared-utils/three/generatePolygonGeometry.js";
|
|
6
6
|
import { DEFAULT_HIGHLIGHT_OPACITY as a } from "../typings/style.js";
|
|
7
|
-
import { anyPositionToVector3 as
|
|
8
|
-
import { ColoredMesh as
|
|
7
|
+
import { anyPositionToVector3 as y } from "../../shared-utils/positionToVector3.js";
|
|
8
|
+
import { ColoredMesh as f } from "../utils/three/ColoredMesh.js";
|
|
9
9
|
import { getGeometryInfo as d } from "../../shared-utils/three/geometryUtil.js";
|
|
10
10
|
const n = new r.BufferGeometry();
|
|
11
11
|
n.name = "blankGeometry";
|
|
12
12
|
n.isBlank = !0;
|
|
13
|
-
class G extends
|
|
13
|
+
class G extends f {
|
|
14
14
|
constructor(e) {
|
|
15
15
|
super(e);
|
|
16
16
|
t(this, "name", "PolygonMesh");
|
|
@@ -23,6 +23,9 @@ class G extends y {
|
|
|
23
23
|
t(this, "highlighted", !1);
|
|
24
24
|
e != null && e.points && this.setPoints(e.points);
|
|
25
25
|
}
|
|
26
|
+
get style() {
|
|
27
|
+
return super.style;
|
|
28
|
+
}
|
|
26
29
|
get isBlank() {
|
|
27
30
|
return !!this.geometry.isBlank;
|
|
28
31
|
}
|
|
@@ -31,7 +34,7 @@ class G extends y {
|
|
|
31
34
|
}
|
|
32
35
|
setPoints(e) {
|
|
33
36
|
var s;
|
|
34
|
-
const h = e.map(
|
|
37
|
+
const h = e.map(y);
|
|
35
38
|
this.points = h, this.geometry = (s = g(this.points)) != null ? s : n, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0;
|
|
36
39
|
}
|
|
37
40
|
getGeometryInfo() {
|
|
@@ -9,6 +9,14 @@ export type PolygonWithEdgeMeshStyle = PolygonStyle & LineStyle;
|
|
|
9
9
|
*/
|
|
10
10
|
export declare class PolygonWithEdgeMesh extends PolygonMesh {
|
|
11
11
|
name: string;
|
|
12
|
+
get style(): {
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
lineColor: THREE.Color;
|
|
15
|
+
color: THREE.Color;
|
|
16
|
+
opacity: number;
|
|
17
|
+
occlusionVisibility: boolean;
|
|
18
|
+
occlusionMode: string;
|
|
19
|
+
};
|
|
12
20
|
get lineWidth(): number;
|
|
13
21
|
get lineColor(): THREE.Color;
|
|
14
22
|
protected line: PolylineMesh;
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var f = Object.defineProperty, p = Object.defineProperties;
|
|
2
|
+
var P = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var n = Object.getOwnPropertySymbols;
|
|
4
|
+
var g = Object.prototype.hasOwnProperty, u = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var l = (i, e, t) => e in i ? f(i, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[e] = t, d = (i, e) => {
|
|
6
|
+
for (var t in e || (e = {}))
|
|
7
|
+
g.call(e, t) && l(i, t, e[t]);
|
|
8
|
+
if (n)
|
|
9
|
+
for (var t of n(e))
|
|
10
|
+
u.call(e, t) && l(i, t, e[t]);
|
|
11
|
+
return i;
|
|
12
|
+
}, y = (i, e) => p(i, P(e));
|
|
13
|
+
var c = (i, e) => {
|
|
6
14
|
var t = {};
|
|
7
|
-
for (var
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
for (var
|
|
11
|
-
|
|
15
|
+
for (var s in i)
|
|
16
|
+
g.call(i, s) && e.indexOf(s) < 0 && (t[s] = i[s]);
|
|
17
|
+
if (i != null && n)
|
|
18
|
+
for (var s of n(i))
|
|
19
|
+
e.indexOf(s) < 0 && u.call(i, s) && (t[s] = i[s]);
|
|
12
20
|
return t;
|
|
13
21
|
};
|
|
14
|
-
var
|
|
15
|
-
import { PolylineMesh as
|
|
16
|
-
import { PolygonMesh as
|
|
17
|
-
import { intersectWithoutLine as
|
|
18
|
-
class
|
|
22
|
+
var o = (i, e, t) => (l(i, typeof e != "symbol" ? e + "" : e, t), t);
|
|
23
|
+
import { PolylineMesh as W } from "./Polyline.js";
|
|
24
|
+
import { PolygonMesh as C } from "./Polygon.js";
|
|
25
|
+
import { intersectWithoutLine as E } from "../../shared-utils/three/THREERaycaster.js";
|
|
26
|
+
class w extends C {
|
|
19
27
|
constructor(t) {
|
|
20
|
-
const
|
|
28
|
+
const r = t != null ? t : {}, { points: s } = r, h = c(r, ["points"]);
|
|
21
29
|
super();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
o(this, "name", "PolygonWithEdgeMesh");
|
|
31
|
+
o(this, "line", new W());
|
|
32
|
+
s && this.setPoints(s), h && this.setStyle(h);
|
|
33
|
+
}
|
|
34
|
+
get style() {
|
|
35
|
+
return y(d({}, super.style), {
|
|
36
|
+
lineWidth: this.lineWidth,
|
|
37
|
+
lineColor: this.lineColor
|
|
38
|
+
});
|
|
25
39
|
}
|
|
26
40
|
get lineWidth() {
|
|
27
41
|
return this.line.lineWidth;
|
|
@@ -29,13 +43,13 @@ class S extends y {
|
|
|
29
43
|
get lineColor() {
|
|
30
44
|
return this.line.lineColor;
|
|
31
45
|
}
|
|
32
|
-
raycast(t,
|
|
46
|
+
raycast(t, s) {
|
|
33
47
|
return this.children.forEach((h) => {
|
|
34
|
-
|
|
48
|
+
E(h, t, s, !0);
|
|
35
49
|
}), !1;
|
|
36
50
|
}
|
|
37
|
-
setPoints(t,
|
|
38
|
-
super.setPoints(t), this.points && (this.line.setPoints(this.points,
|
|
51
|
+
setPoints(t, s = { closed: !0 }) {
|
|
52
|
+
super.setPoints(t), this.points && (this.line.setPoints(this.points, s), this.addIfNotExists(this.line));
|
|
39
53
|
}
|
|
40
54
|
setStyle(t) {
|
|
41
55
|
super.setStyle(t), this.line.setStyle(t);
|
|
@@ -48,5 +62,5 @@ class S extends y {
|
|
|
48
62
|
}
|
|
49
63
|
}
|
|
50
64
|
export {
|
|
51
|
-
|
|
65
|
+
w as PolygonWithEdgeMesh
|
|
52
66
|
};
|
|
@@ -8,6 +8,13 @@ export type PolylineStyle = LineMeshStyle;
|
|
|
8
8
|
export type PolylineData = PointsData;
|
|
9
9
|
export declare abstract class PolylineBaseMesh extends IObject3D {
|
|
10
10
|
name: string;
|
|
11
|
+
get style(): {
|
|
12
|
+
lineColor: THREE.Color;
|
|
13
|
+
lineWidth: number;
|
|
14
|
+
dashed: boolean;
|
|
15
|
+
occlusionVisibility: boolean;
|
|
16
|
+
occlusionMode: "translucence" | "depthTest";
|
|
17
|
+
};
|
|
11
18
|
get lineColor(): THREE.Color;
|
|
12
19
|
get lineWidth(): number;
|
|
13
20
|
get dashed(): boolean;
|
|
@@ -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) {
|
|
@@ -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
|
};
|