@realsee/dnalogel 3.47.11 → 3.47.13
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/Line.d.ts +2 -1
- package/dist/Sculpt/Meshes/Polygon.d.ts +16 -7
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -0
- package/dist/index.cjs.js +28 -28
- package/dist/index.js +1230 -1200
- package/dist/index.umd.js +36 -36
- package/libs/Sculpt/Meshes/Line.d.ts +2 -1
- package/libs/Sculpt/Meshes/Line.js +76 -71
- package/libs/Sculpt/Meshes/Polygon.d.ts +16 -7
- package/libs/Sculpt/Meshes/Polygon.js +71 -33
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -0
- package/libs/Sculpt/Meshes/Rectangle.js +3 -3
- package/libs/Sculpt/Objects/Rectangle/index.js +32 -32
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,7 @@ export declare class LineMesh extends IObject3D {
|
|
|
43
43
|
private backLine;
|
|
44
44
|
private opacityBeforeHighlight;
|
|
45
45
|
private paramsStyle;
|
|
46
|
+
private lastRenderLengthItem;
|
|
46
47
|
constructor(params?: Partial<LineMeshStyle & LineData>);
|
|
47
48
|
updateMatrixWorld(force?: boolean): void;
|
|
48
49
|
setPoints(points: AnyPositions): void;
|
|
@@ -50,5 +51,5 @@ export declare class LineMesh extends IObject3D {
|
|
|
50
51
|
setStyle(params: Partial<LineMeshStyle>): void;
|
|
51
52
|
highlight(): void;
|
|
52
53
|
unhighlight(): void;
|
|
53
|
-
updateLengthItems
|
|
54
|
+
private updateLengthItems;
|
|
54
55
|
}
|
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var m = Object.getOwnPropertySymbols;
|
|
3
3
|
var k = Object.prototype.hasOwnProperty, S = Object.prototype.propertyIsEnumerable;
|
|
4
|
-
var
|
|
5
|
-
for (var e in
|
|
6
|
-
k.call(
|
|
7
|
-
if (
|
|
8
|
-
for (var e of
|
|
9
|
-
S.call(
|
|
10
|
-
return
|
|
4
|
+
var u = (o, s, e) => s in o ? M(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, f = (o, s) => {
|
|
5
|
+
for (var e in s || (s = {}))
|
|
6
|
+
k.call(s, e) && u(o, e, s[e]);
|
|
7
|
+
if (m)
|
|
8
|
+
for (var e of m(s))
|
|
9
|
+
S.call(s, e) && u(o, e, s[e]);
|
|
10
|
+
return o;
|
|
11
11
|
};
|
|
12
|
-
var l = (
|
|
13
|
-
import * as
|
|
14
|
-
import { DEFAULT_LINE_COLOR as
|
|
15
|
-
import { LineGeometry as
|
|
16
|
-
import { anyPositionToVector3 as
|
|
17
|
-
import { IObject3D as
|
|
12
|
+
var l = (o, s, e) => (u(o, typeof s != "symbol" ? s + "" : s, e), e);
|
|
13
|
+
import * as g from "three";
|
|
14
|
+
import { DEFAULT_LINE_COLOR as b, DEFAULT_LINE_WIDTH as p, DEFAULT_HIGHLIGHT_OPACITY as D } from "../typings/style.js";
|
|
15
|
+
import { LineGeometry as y, LineMaterial as I, THREE_Line2 as w } from "../../shared-utils/five/FiveLine.js";
|
|
16
|
+
import { anyPositionToVector3 as H } from "../../shared-utils/positionToVector3.js";
|
|
17
|
+
import { IObject3D as R } from "../../shared-utils/three/IObject3D.js";
|
|
18
18
|
import "hammerjs";
|
|
19
19
|
import "three/examples/jsm/renderers/CSS3DRenderer";
|
|
20
|
-
import { centerPoint as
|
|
21
|
-
import { LightTag as
|
|
20
|
+
import { centerPoint as C } from "../../shared-utils/three/centerPoint.js";
|
|
21
|
+
import { LightTag as x } from "../../shared-utils/tag.js";
|
|
22
22
|
import { globalModules as W } from "../utils/Modules/Global.js";
|
|
23
|
-
import { removeAllTag as
|
|
24
|
-
import { getLengthHTML as
|
|
25
|
-
import { applyObjectMatrixWorld as
|
|
23
|
+
import { removeAllTag as A } from "../utils/removeAllTag.js";
|
|
24
|
+
import { getLengthHTML as O } from "../utils/Meshes/getLengthHTML.js";
|
|
25
|
+
import { applyObjectMatrixWorld as T } from "../../shared-utils/three/applyObjectMatrixWorld.js";
|
|
26
26
|
import "../../shared-utils/three/THREESphere.js";
|
|
27
27
|
import "animejs";
|
|
28
28
|
import { notNil as c } from "../../shared-utils/isNil.js";
|
|
29
29
|
import "../../vendor/@tweenjs/tween/dist/tween.esm.js.js";
|
|
30
|
-
class
|
|
30
|
+
class E extends I {
|
|
31
31
|
constructor(e) {
|
|
32
|
-
var
|
|
32
|
+
var i, t;
|
|
33
33
|
super(e);
|
|
34
34
|
l(this, "_three_color");
|
|
35
|
-
c(e == null ? void 0 : e.color) && (this.three_color = (
|
|
35
|
+
c(e == null ? void 0 : e.color) && (this.three_color = (i = e == null ? void 0 : e.color) != null ? i : 16777215), Object.keys(e).forEach((n) => {
|
|
36
36
|
["color", "dashed", "dashScale", "dashSize", "gapSize", "resolution"].includes(n) || n in this && (this[n] = e[n]);
|
|
37
|
-
}), this.setDashed((
|
|
37
|
+
}), this.setDashed((t = e == null ? void 0 : e.dashed) != null ? t : !1);
|
|
38
38
|
}
|
|
39
39
|
get three_color() {
|
|
40
40
|
return this._three_color;
|
|
@@ -46,15 +46,15 @@ class T extends w {
|
|
|
46
46
|
this.dashed = e, e ? this.defines.USE_DASH = "" : delete this.defines.USE_DASH, this.needsUpdate = !0;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
class _ extends
|
|
50
|
-
constructor(e,
|
|
51
|
-
super(e,
|
|
49
|
+
class _ extends w {
|
|
50
|
+
constructor(e, i) {
|
|
51
|
+
super(e, i);
|
|
52
52
|
l(this, "name", "Line3");
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
class $ extends
|
|
55
|
+
class $ extends R {
|
|
56
56
|
constructor(e) {
|
|
57
|
-
var
|
|
57
|
+
var h, r, d, a, L;
|
|
58
58
|
super();
|
|
59
59
|
l(this, "name", "LineMesh");
|
|
60
60
|
l(this, "points");
|
|
@@ -64,26 +64,27 @@ class $ extends I {
|
|
|
64
64
|
l(this, "backLine");
|
|
65
65
|
l(this, "opacityBeforeHighlight");
|
|
66
66
|
l(this, "paramsStyle", {});
|
|
67
|
+
l(this, "lastRenderLengthItem");
|
|
67
68
|
this.paramsStyle = e != null ? e : {};
|
|
68
|
-
const
|
|
69
|
-
color: new
|
|
70
|
-
linewidth: (
|
|
69
|
+
const i = new y(), t = new E({
|
|
70
|
+
color: new g.Color((h = e == null ? void 0 : e.lineColor) != null ? h : b),
|
|
71
|
+
linewidth: (r = e == null ? void 0 : e.lineWidth) != null ? r : p,
|
|
71
72
|
dashScale: 40,
|
|
72
73
|
opacity: (d = e == null ? void 0 : e.opacity) != null ? d : 1,
|
|
73
74
|
transparent: !0,
|
|
74
|
-
dashed: (
|
|
75
|
-
}), n = new
|
|
76
|
-
color: new
|
|
77
|
-
linewidth:
|
|
78
|
-
dashScale:
|
|
79
|
-
opacity:
|
|
75
|
+
dashed: (a = e == null ? void 0 : e.dashed) != null ? a : !1
|
|
76
|
+
}), n = new E({
|
|
77
|
+
color: new g.Color((L = e == null ? void 0 : e.lineColor) != null ? L : b),
|
|
78
|
+
linewidth: t.linewidth * 0.9,
|
|
79
|
+
dashScale: t.dashScale,
|
|
80
|
+
opacity: t.opacity * 0.8,
|
|
80
81
|
depthTest: !1,
|
|
81
82
|
depthWrite: !1,
|
|
82
83
|
transparent: !0,
|
|
83
|
-
resolution:
|
|
84
|
+
resolution: t.resolution
|
|
84
85
|
});
|
|
85
|
-
this.line = new _(
|
|
86
|
-
|
|
86
|
+
this.line = new _(i, t), this.backLine = new _(i, n), this.line.renderOrder = 1, this.backLine.renderOrder = 0, this.line.name = "lineFrontMaterial", this.backLine.name = "lineBackMaterial", e && this.setStyle(e), e != null && e.points && this.setPoints(e.points), this.addEventListener("removed", () => {
|
|
87
|
+
A(this);
|
|
87
88
|
});
|
|
88
89
|
}
|
|
89
90
|
get style() {
|
|
@@ -100,7 +101,7 @@ class $ extends I {
|
|
|
100
101
|
return this.line.material.linewidth;
|
|
101
102
|
}
|
|
102
103
|
get color() {
|
|
103
|
-
return new
|
|
104
|
+
return new g.Color(this.line.material.three_color);
|
|
104
105
|
}
|
|
105
106
|
get dashed() {
|
|
106
107
|
return this.line.material.dashed;
|
|
@@ -112,29 +113,32 @@ class $ extends I {
|
|
|
112
113
|
return this.line.material.depthTest === !1 ? "depthTest" : "translucence";
|
|
113
114
|
}
|
|
114
115
|
updateMatrixWorld(e) {
|
|
115
|
-
|
|
116
|
+
var t;
|
|
117
|
+
super.updateMatrixWorld(e);
|
|
118
|
+
const i = (t = this.points) == null ? void 0 : t.map((n) => n.toArray().join(",")).join(",");
|
|
119
|
+
i !== this.lastRenderLengthItem && (this.updateLengthItems(), this.lastRenderLengthItem = i);
|
|
116
120
|
}
|
|
117
121
|
setPoints(e) {
|
|
118
|
-
const
|
|
119
|
-
if (this.points =
|
|
120
|
-
this.line.geometry = new
|
|
122
|
+
const i = e.map(H).filter(c);
|
|
123
|
+
if (this.points = i, i.length < 2) {
|
|
124
|
+
this.line.geometry = new y(), this.backLine.geometry = this.line.geometry, this.updateLengthItems();
|
|
121
125
|
return;
|
|
122
126
|
}
|
|
123
127
|
this.addIfNotExists(this.line, this.backLine);
|
|
124
|
-
const
|
|
125
|
-
|
|
128
|
+
const t = i.flatMap((n) => [n.x, n.y, n.z]);
|
|
129
|
+
t.length > 2 && (this.line.geometry.dispose(), this.line.geometry = new y(), this.backLine.geometry = this.line.geometry), this.line.geometry.setPositions(t), this.line.computeLineDistances(), this.updateLengthItems(), this.needsRender = !0;
|
|
126
130
|
}
|
|
127
|
-
setResolution(e,
|
|
128
|
-
const
|
|
129
|
-
(
|
|
131
|
+
setResolution(e, i) {
|
|
132
|
+
const t = this.line.material.resolution;
|
|
133
|
+
(t.x !== e || t.y !== i) && (t.set(e, i), this.needsRender = !0);
|
|
130
134
|
const n = this.backLine.material.resolution;
|
|
131
|
-
(n.x !== e || n.y !==
|
|
135
|
+
(n.x !== e || n.y !== i) && (n.set(e, i), this.needsRender = !0);
|
|
132
136
|
}
|
|
133
137
|
setStyle(e) {
|
|
134
|
-
var n,
|
|
135
|
-
this.paramsStyle =
|
|
136
|
-
const
|
|
137
|
-
|
|
138
|
+
var n, h, r;
|
|
139
|
+
this.paramsStyle = f(f({}, this.paramsStyle), e), c(e.lineColor) && (this.line.material.three_color = new g.Color(e.lineColor), this.backLine.material.three_color = new g.Color(e.lineColor)), c(e.lineWidth) && (this.line.material.linewidth = e.lineWidth), c(e.dashed) && this.line.material.setDashed(e.dashed), c(e.opacity) && (this.line.material.opacity = e.opacity, this.backLine.material.opacity = this.line.material.opacity * 0.2), this.updateLengthItems();
|
|
140
|
+
const i = (n = e.occlusionVisibility) != null ? n : this.paramsStyle.occlusionVisibility, t = (r = (h = e.occlusionMode) != null ? h : this.paramsStyle.occlusionMode) != null ? r : "translucence";
|
|
141
|
+
i ? t === "depthTest" ? (this.line.material.depthTest = !1, this.backLine.visible = !1) : t === "translucence" && (this.line.material.depthTest = !0, this.backLine.visible = !0, this.line.material.opacity === 1 ? this.backLine.material.setDashed(!0) : this.backLine.material.setDashed(this.line.material.dashed)) : (this.line.material.depthTest = !0, this.backLine.visible = !1), this.needsRender = !0;
|
|
138
142
|
}
|
|
139
143
|
highlight() {
|
|
140
144
|
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.line.material.opacity, this.line.material.opacity = this.opacityBeforeHighlight * D, this.backLine.material.opacity = this.backLine.material.opacity * D, this.needsRender = !0);
|
|
@@ -143,25 +147,26 @@ class $ extends I {
|
|
|
143
147
|
this.highlighted && (this.highlighted = !1, this.line.material.opacity = this.opacityBeforeHighlight, this.backLine.material.opacity = 0.2, this.needsRender = !0);
|
|
144
148
|
}
|
|
145
149
|
updateLengthItems() {
|
|
146
|
-
|
|
147
|
-
this.lengthDoms.forEach((
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
const e = () => {
|
|
151
|
+
this.lengthDoms.forEach((i) => i.destroy()), this.lengthDoms = [];
|
|
152
|
+
};
|
|
153
|
+
if (!this.points || this.points.length < 2)
|
|
154
|
+
return e();
|
|
150
155
|
if (this.paramsStyle.lengthEnable) {
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
return [
|
|
156
|
+
const i = T(this, this.points).map((t, n) => {
|
|
157
|
+
if (n !== 0)
|
|
158
|
+
return [T(this, this.points[n - 1]), t];
|
|
154
159
|
}).filter(c);
|
|
155
|
-
|
|
156
|
-
var
|
|
157
|
-
const r =
|
|
158
|
-
this.lengthDoms[
|
|
159
|
-
const
|
|
160
|
-
return
|
|
161
|
-
})(), this.lengthDoms[
|
|
162
|
-
}), this.lengthDoms.length >
|
|
160
|
+
i.forEach(([t, n], h) => {
|
|
161
|
+
var d;
|
|
162
|
+
const r = C(t, n);
|
|
163
|
+
this.lengthDoms[h] = (d = this.lengthDoms[h]) != null ? d : (() => {
|
|
164
|
+
const a = new x(W.five);
|
|
165
|
+
return a.intersectCheck = !1, a;
|
|
166
|
+
})(), this.lengthDoms[h].setPosition(r, [t, n]), this.lengthDoms[h].container.innerHTML = O(t.distanceTo(n).toFixed(2) + "m");
|
|
167
|
+
}), this.lengthDoms.length > i.length && (this.lengthDoms.slice(i.length).forEach((t) => t.destroy()), this.lengthDoms.length = i.length);
|
|
163
168
|
} else
|
|
164
|
-
|
|
169
|
+
e();
|
|
165
170
|
}
|
|
166
171
|
}
|
|
167
172
|
export {
|
|
@@ -5,11 +5,14 @@ import type { PointsData } from '../utils/data';
|
|
|
5
5
|
export declare const blankGeometry: THREE.BufferGeometry & {
|
|
6
6
|
isBlank: true;
|
|
7
7
|
};
|
|
8
|
-
export type PolygonStyle = ColoredMeshStyle
|
|
8
|
+
export type PolygonStyle = ColoredMeshStyle & {
|
|
9
|
+
lengthEnable: boolean;
|
|
10
|
+
};
|
|
9
11
|
export type PolygonData = PointsData;
|
|
10
12
|
export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
11
13
|
name: string;
|
|
12
14
|
get style(): {
|
|
15
|
+
lengthEnable: boolean;
|
|
13
16
|
color: THREE.Color;
|
|
14
17
|
opacity: number;
|
|
15
18
|
occlusionVisibility: boolean;
|
|
@@ -17,19 +20,24 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
|
17
20
|
};
|
|
18
21
|
get isBlank(): boolean;
|
|
19
22
|
get center(): THREE.Vector3;
|
|
23
|
+
get geometryInfo(): {
|
|
24
|
+
area: number;
|
|
25
|
+
center: THREE.Vector3;
|
|
26
|
+
};
|
|
20
27
|
points: THREE.Vector3[];
|
|
21
28
|
planeHelperNeedUpdate: boolean;
|
|
22
|
-
|
|
29
|
+
geometryInfoNeedUpdate: boolean;
|
|
30
|
+
_paramsStyle: Partial<PolygonStyle>;
|
|
23
31
|
private planeHelper;
|
|
24
|
-
private
|
|
32
|
+
private _geometryInfo;
|
|
25
33
|
private opacityBeforeHighlight;
|
|
26
34
|
private highlighted;
|
|
35
|
+
private lastRenderLengthItem;
|
|
36
|
+
private areaDom?;
|
|
27
37
|
constructor(params?: Partial<PolygonStyle & PolygonData>);
|
|
38
|
+
updateMatrixWorld(force?: boolean): void;
|
|
39
|
+
setStyle(params: Partial<ColoredMeshStyle>): void;
|
|
28
40
|
setPoints(points: AnyPositions): void;
|
|
29
|
-
getGeometryInfo(): {
|
|
30
|
-
center: THREE.Vector3;
|
|
31
|
-
area: number;
|
|
32
|
-
};
|
|
33
41
|
/**
|
|
34
42
|
* @description: 获取一个点投影在当前平面上的点
|
|
35
43
|
*/
|
|
@@ -37,4 +45,5 @@ export default class PolygonMesh extends ColoredMesh<THREE.BufferGeometry> {
|
|
|
37
45
|
highlight(): void;
|
|
38
46
|
unhighlight(): void;
|
|
39
47
|
private updatePlaneHelper;
|
|
48
|
+
private updateAreaItems;
|
|
40
49
|
}
|
|
@@ -1,61 +1,99 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
var d = Object.defineProperty, y = Object.defineProperties;
|
|
2
|
+
var f = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var u = Object.prototype.hasOwnProperty, c = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var h = (i, t, e) => t in i ? d(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e, n = (i, t) => {
|
|
6
|
+
for (var e in t || (t = {}))
|
|
7
|
+
u.call(t, e) && h(i, e, t[e]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var e of p(t))
|
|
10
|
+
c.call(t, e) && h(i, e, t[e]);
|
|
11
|
+
return i;
|
|
12
|
+
}, g = (i, t) => y(i, f(t));
|
|
13
|
+
var r = (i, t, e) => (h(i, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
+
import * as l from "three";
|
|
15
|
+
import { generatePolygonGeometry as I } from "../../shared-utils/three/generatePolygonGeometry.js";
|
|
16
|
+
import { DEFAULT_HIGHLIGHT_OPACITY as H } from "../typings/style.js";
|
|
17
|
+
import { anyPositionToVector3 as P } from "../../shared-utils/positionToVector3.js";
|
|
18
|
+
import { ColoredMesh as _ } from "../utils/three/ColoredMesh.js";
|
|
19
|
+
import { getGeometryInfo as S } from "../../shared-utils/three/geometryUtil.js";
|
|
20
|
+
import { LightTag as L } from "../../shared-utils/tag.js";
|
|
21
|
+
import { globalModules as U } from "../utils/Modules/Global.js";
|
|
22
|
+
import { getLengthHTML as A } from "../utils/Meshes/getLengthHTML.js";
|
|
23
|
+
const a = new l.BufferGeometry();
|
|
24
|
+
a.name = "blankGeometry";
|
|
25
|
+
a.isBlank = !0;
|
|
26
|
+
class E extends _ {
|
|
14
27
|
constructor(e) {
|
|
15
28
|
super(e);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
29
|
+
r(this, "name", "PolygonMesh");
|
|
30
|
+
r(this, "points", []);
|
|
31
|
+
r(this, "planeHelperNeedUpdate", !0);
|
|
32
|
+
r(this, "geometryInfoNeedUpdate", !0);
|
|
33
|
+
r(this, "_paramsStyle");
|
|
34
|
+
r(this, "planeHelper", null);
|
|
35
|
+
r(this, "_geometryInfo", null);
|
|
36
|
+
r(this, "opacityBeforeHighlight");
|
|
37
|
+
r(this, "highlighted", !1);
|
|
38
|
+
r(this, "lastRenderLengthItem");
|
|
39
|
+
r(this, "areaDom");
|
|
40
|
+
e != null && e.points && this.setPoints(e.points), this._paramsStyle = e != null ? e : {}, this.updateAreaItems();
|
|
25
41
|
}
|
|
26
42
|
get style() {
|
|
27
|
-
return super.style;
|
|
43
|
+
return g(n({}, super.style), { lengthEnable: this._paramsStyle.lengthEnable });
|
|
28
44
|
}
|
|
29
45
|
get isBlank() {
|
|
30
46
|
return !!this.geometry.isBlank;
|
|
31
47
|
}
|
|
32
48
|
get center() {
|
|
33
|
-
return this.
|
|
49
|
+
return this.geometryInfo.center;
|
|
34
50
|
}
|
|
35
|
-
|
|
51
|
+
get geometryInfo() {
|
|
52
|
+
return this.geometryInfoNeedUpdate && (this._geometryInfo = S(this.geometry), this.geometryInfoNeedUpdate = !1), this._geometryInfo;
|
|
53
|
+
}
|
|
54
|
+
updateMatrixWorld(e) {
|
|
36
55
|
var s;
|
|
37
|
-
|
|
38
|
-
|
|
56
|
+
super.updateMatrixWorld(e);
|
|
57
|
+
const o = (s = this.points) == null ? void 0 : s.map((m) => m.toArray().join(",")).join(",");
|
|
58
|
+
o !== this.lastRenderLengthItem && (this.updateAreaItems(), this.lastRenderLengthItem = o);
|
|
59
|
+
}
|
|
60
|
+
setStyle(e) {
|
|
61
|
+
this._paramsStyle = n(n({}, this._paramsStyle), e), super.setStyle(this._paramsStyle), this.updateAreaItems();
|
|
39
62
|
}
|
|
40
|
-
|
|
41
|
-
|
|
63
|
+
setPoints(e) {
|
|
64
|
+
var s;
|
|
65
|
+
const o = e.map(P);
|
|
66
|
+
this.points = o, this.geometry = (s = I(this.points)) != null ? s : a, this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0, this.updateAreaItems();
|
|
42
67
|
}
|
|
43
68
|
/**
|
|
44
69
|
* @description: 获取一个点投影在当前平面上的点
|
|
45
70
|
*/
|
|
46
71
|
projectPoint(e) {
|
|
47
|
-
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new
|
|
72
|
+
return e && (this.planeHelperNeedUpdate && this.updatePlaneHelper(), this.planeHelper ? this.planeHelper.projectPoint(e, new l.Vector3()) : e);
|
|
48
73
|
}
|
|
49
74
|
highlight() {
|
|
50
|
-
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity *
|
|
75
|
+
this.highlighted || (this.highlighted = !0, this.opacityBeforeHighlight = this.opacity, this.setStyle({ opacity: this.opacity * H }), this.needsRender = !0);
|
|
51
76
|
}
|
|
52
77
|
unhighlight() {
|
|
53
78
|
this.highlighted && (this.highlighted = !1, this.setStyle({ opacity: this.opacityBeforeHighlight }), this.needsRender = !0);
|
|
54
79
|
}
|
|
55
80
|
updatePlaneHelper() {
|
|
56
|
-
this.points.length >= 3 ? this.planeHelper = new
|
|
81
|
+
this.points.length >= 3 ? this.planeHelper = new l.Plane().setFromCoplanarPoints(this.points[0], this.points[1], this.points[2]) : this.planeHelper = null, this.planeHelperNeedUpdate = !1;
|
|
82
|
+
}
|
|
83
|
+
updateAreaItems() {
|
|
84
|
+
var o;
|
|
85
|
+
const e = () => {
|
|
86
|
+
var s;
|
|
87
|
+
(s = this.areaDom) == null || s.destroy(), this.areaDom = void 0;
|
|
88
|
+
};
|
|
89
|
+
if (!this._paramsStyle.lengthEnable || !this.geometryInfo)
|
|
90
|
+
return e();
|
|
91
|
+
this.areaDom = (o = this.areaDom) != null ? o : (() => {
|
|
92
|
+
const s = new L(U.five);
|
|
93
|
+
return s.intersectCheck = !1, s;
|
|
94
|
+
})(), this.areaDom.setPosition(this.center), this.areaDom.container.innerHTML = A(this.geometryInfo.area.toFixed(2) + "m²");
|
|
57
95
|
}
|
|
58
96
|
}
|
|
59
97
|
export {
|
|
60
|
-
|
|
98
|
+
E as PolygonMesh
|
|
61
99
|
};
|
|
@@ -16,7 +16,7 @@ import { PolygonMesh as u } from "./Polygon.js";
|
|
|
16
16
|
import { RectangleGeometry as g } from "../utils/three/RectangleGeometry.js";
|
|
17
17
|
import { getBetterNormal as f } from "../utils/getBetterNormal.js";
|
|
18
18
|
import { Sculpt as d } from "../index.js";
|
|
19
|
-
class
|
|
19
|
+
class T extends u {
|
|
20
20
|
constructor(t) {
|
|
21
21
|
super(t);
|
|
22
22
|
i(this, "name", "RectangleMesh");
|
|
@@ -41,9 +41,9 @@ class U extends u {
|
|
|
41
41
|
const [m, s, n] = o, p = m.clone().add(n).sub(s);
|
|
42
42
|
o.push(p);
|
|
43
43
|
}
|
|
44
|
-
this.up.copy(f(o, d.modules.five.camera.position)), this.points = o, this.geometry = new g(o), this.planeHelperNeedUpdate = !0;
|
|
44
|
+
this.up.copy(f(o, d.modules.five.camera.position)), this.points = o, this.geometry = new g(o), this.planeHelperNeedUpdate = !0, this.geometryInfoNeedUpdate = !0;
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
export {
|
|
48
|
-
|
|
48
|
+
T as RectangleMesh
|
|
49
49
|
};
|
|
@@ -11,29 +11,29 @@ var E = (s, t, e) => t in s ? U(s, t, { enumerable: !0, configurable: !0, writab
|
|
|
11
11
|
return s;
|
|
12
12
|
}, u = (s, t) => k(s, B(t));
|
|
13
13
|
var L = (s, t, e) => (E(s, typeof t != "symbol" ? t + "" : t, e), e);
|
|
14
|
-
var D = (s, t, e) => new Promise((c,
|
|
15
|
-
var a = (
|
|
14
|
+
var D = (s, t, e) => new Promise((c, p) => {
|
|
15
|
+
var a = (l) => {
|
|
16
16
|
try {
|
|
17
|
-
g(e.next(
|
|
17
|
+
g(e.next(l));
|
|
18
18
|
} catch (h) {
|
|
19
|
-
|
|
19
|
+
p(h);
|
|
20
20
|
}
|
|
21
|
-
}, m = (
|
|
21
|
+
}, m = (l) => {
|
|
22
22
|
try {
|
|
23
|
-
g(e.throw(
|
|
23
|
+
g(e.throw(l));
|
|
24
24
|
} catch (h) {
|
|
25
|
-
|
|
25
|
+
p(h);
|
|
26
26
|
}
|
|
27
|
-
}, g = (
|
|
27
|
+
}, g = (l) => l.done ? c(l.value) : Promise.resolve(l.value).then(a, m);
|
|
28
28
|
g((e = e.apply(s, t)).next());
|
|
29
29
|
});
|
|
30
30
|
import { hotkeys as j } from "../../../vendor/hotkeys-js/dist/hotkeys.esm.js";
|
|
31
31
|
import { BaseObject as q } from "../Base/index.js";
|
|
32
|
-
import * as
|
|
32
|
+
import * as o from "three";
|
|
33
33
|
import { PolylineWithDotsMesh as M } from "../../Meshes/Polyline.js";
|
|
34
34
|
import { RectangleEditor as G } from "./Editor.js";
|
|
35
35
|
import { RectangleWithEdgeMesh as H } from "../../Meshes/RectangleWithEdge.js";
|
|
36
|
-
const P = new
|
|
36
|
+
const P = new o.Vector3();
|
|
37
37
|
class S extends q {
|
|
38
38
|
constructor(e, c) {
|
|
39
39
|
super(e, c);
|
|
@@ -70,51 +70,51 @@ class S extends q {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
function J(s, t, e) {
|
|
73
|
-
return new Promise((c,
|
|
73
|
+
return new Promise((c, p) => {
|
|
74
74
|
var N, T;
|
|
75
75
|
const a = s.parent;
|
|
76
76
|
if (!a)
|
|
77
|
-
return
|
|
78
|
-
const m = (N = e == null ? void 0 : e.limit) != null ? N : "none", g = (T = e == null ? void 0 : e.drawMethod) != null ? T : "diagonal",
|
|
79
|
-
a.add(
|
|
77
|
+
return p(new Error("No container"));
|
|
78
|
+
const m = (N = e == null ? void 0 : e.limit) != null ? N : "none", g = (T = e == null ? void 0 : e.drawMethod) != null ? T : "diagonal", l = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), h = new M(u(d({}, s.style), { dashed: !0, lengthEnable: !1 })), y = new M(u(d({}, s.style), { dashed: !1, lengthEnable: !1 }));
|
|
79
|
+
a.add(l, y, h), t.enable();
|
|
80
80
|
const n = [];
|
|
81
|
-
let i = new
|
|
82
|
-
const f = new
|
|
83
|
-
n.push(i.clone()), n.length === 1 ? (m === "xoz" && f.setFromNormalAndCoplanarPoint(new
|
|
84
|
-
}, x = (
|
|
81
|
+
let i = new o.Vector3(), v = new o.Vector3();
|
|
82
|
+
const f = new o.Plane(), C = () => {
|
|
83
|
+
n.push(i.clone()), n.length === 1 ? (m === "xoz" && f.setFromNormalAndCoplanarPoint(new o.Vector3(0, 1, 0), n[0]), m === "none" && f.setFromNormalAndCoplanarPoint(v, n[0])) : n.length === 2 ? m === "y" ? (V(), c()) : y.setPoints([n[0], n[1]]) : n.length === 3 && (V(), c());
|
|
84
|
+
}, x = (r) => {
|
|
85
85
|
var W;
|
|
86
|
-
if (!(
|
|
86
|
+
if (!(r != null && r.raycaster))
|
|
87
87
|
return;
|
|
88
88
|
const O = (W = n.at(-1)) == null ? void 0 : W.clone();
|
|
89
89
|
if (n.length === 0) {
|
|
90
|
-
i =
|
|
90
|
+
i = r.point.clone(), v = r.face.normal;
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
if (n.length === 1 && m === "y") {
|
|
94
|
-
const
|
|
95
|
-
s.setPoints([n[0],
|
|
94
|
+
const w = new o.Line3(new o.Vector3(0, 1, 0).add(n[0]), new o.Vector3(0, -1, 0).add(n[0])).closestPointToPoint(r.point, !1, new o.Vector3());
|
|
95
|
+
s.setPoints([n[0], w, r.point]);
|
|
96
96
|
return;
|
|
97
97
|
}
|
|
98
98
|
if (n.length === 1) {
|
|
99
|
-
f ? (i =
|
|
99
|
+
f ? (i = r.raycaster.ray.intersectPlane(f, P), h.setPoints([i, r.point])) : i = r.point.clone(), l.setPoints([O, i]);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
if (n.length === 2) {
|
|
103
|
-
a.remove(
|
|
104
|
-
const z =
|
|
103
|
+
a.remove(l);
|
|
104
|
+
const z = r.raycaster.ray.intersectPlane(f, P);
|
|
105
105
|
if (g === "diagonal") {
|
|
106
|
-
const
|
|
107
|
-
i = new
|
|
106
|
+
const w = n[0].distanceTo(n[1]) / 2, b = new o.Vector3().lerpVectors(n[0], n[1], 0.5), F = new o.Vector3().subVectors(z, b).normalize();
|
|
107
|
+
i = new o.Vector3().addVectors(b, F.multiplyScalar(w)), s.setPoints([n[0], i, n[1]]);
|
|
108
108
|
} else if (g === "vertex") {
|
|
109
|
-
const
|
|
110
|
-
i = new
|
|
109
|
+
const w = P.crossVectors(n[0].clone().sub(n[1]), f.normal).normalize();
|
|
110
|
+
i = new o.Line3(n[1].clone().add(w), n[1].clone().sub(w)).closestPointToPoint(r.point, !1, P), s.setPoints([n[0], n[1], i]);
|
|
111
111
|
}
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
|
-
},
|
|
115
|
-
t.off("select", C), t.off("intersectionUpdate", x), t.off("disable", R), t.disable(), a == null || a.remove(
|
|
114
|
+
}, V = () => {
|
|
115
|
+
t.off("select", C), t.off("intersectionUpdate", x), t.off("disable", R), t.disable(), a == null || a.remove(l, y, h);
|
|
116
116
|
}, R = () => {
|
|
117
|
-
|
|
117
|
+
V(), a == null || a.remove(s), p(new Error("Cancelled"));
|
|
118
118
|
};
|
|
119
119
|
t.on("select", C), t.on("intersectionUpdate", x), t.on("disable", R);
|
|
120
120
|
});
|
package/libs/base/BasePlugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function A() {
|
|
2
2
|
console.debug(
|
|
3
|
-
"%c %c@realsee/dnalogel %cv3.47.
|
|
3
|
+
"%c %c@realsee/dnalogel %cv3.47.13",
|
|
4
4
|
[
|
|
5
5
|
"background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAMCAMAAACHgmeRAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABLFBMVEUAAAAapPoap/oaqvkbrfkbr/gZnfwZoPsaqfnD4v/E4/8Ylv0clPm93/+/4P/B4f8Yj/683/8Wif+33P8Uhv+x2f8ShP+s1v8Pgf+n0/8Nf/+h0f8Lff8Lff8Nf/9dl/+czv8KfP8KfP+Lxf+Uyv+Xy/+Hwv+Jw/+Mxf+Oxv+RyP8aovsapfoap/oZmfwZm/wZnvsYnPsYkf4YlP0NePsDYfgYcfi43f+63v8Xiv8Xjf4EWfwCV/sWZ/qz2v+02/8Vh/8WiP8EUf8CTf4WXv2u1/+v2P8Thf8Thv8ETf8CR/8VV/+o1f+q1f8Qgv8Rg/8DSv8BRf8UVP+j0v+k0v8OgP8Pgf8DR/8DQv9Nhf+dzv+fz/+Kv/+Vyv+Xy/+azf+Oxv+Qx/+SyP////8MUhLdAAAAK3RSTlMACEWQ2bd98uQECPXxqO7c+Pb49vj2+Pb49vj23Oul8fMHA+TwerXXjEIG2P+bHgAAAAFiS0dEY1y+LaoAAAB+SURBVAjXY2BgZGJmYWVgYGBgY9fW0eVg4ORi4NbTNzDk4eXjZxAwMjYxNTO3EGQQsrSytrG1sxdmEHFwdHJ2cXUTZRBz9/D08vbxFWeQ8PMPCAwKDpFkkAoNC4+IjIqWZpCRlZOPiY2LV2BQVGJQTkhMUlEFWaOmrqGpxQAAyg0S9Dq+VPYAAAAASUVORK5CYII=')",
|
|
6
6
|
"background-repeat: no-repeat",
|