@realsee/dnalogel 3.48.4 → 3.48.6
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/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
- package/dist/Sculpt/Meshes/Line.d.ts +1 -0
- package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/dist/Sculpt/Meshes/Polyline.d.ts +2 -0
- package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
- package/dist/index.cjs.js +51 -51
- package/dist/index.js +2607 -2515
- package/dist/index.umd.js +44 -44
- package/dist/shared-utils/three/PointSelector/index.d.ts +12 -4
- package/dist/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
- package/dist/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
- package/libs/CruisePlugin/Move.js +1 -1
- package/libs/CruisePlugin/index.js +1 -1
- package/libs/GuideLinePlugin/Controller.js +1 -1
- package/libs/GuideLinePlugin/GuideLineItem.js +1 -1
- package/libs/GuideLinePlugin/GuideLineModeItem.js +2 -3
- package/libs/ModelMakerPlugin/Controller.js +3 -2
- package/libs/ModelMakerPlugin/index.js +3 -2
- package/libs/PanoMeasurePlugin/Components/Controller0.js +21 -20
- package/libs/PanoMeasurePlugin/Components/Controller1.js +4 -3
- package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -3
- package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
- package/libs/PanoMeasurePlugin/Controller/index.js +4 -3
- package/libs/PanoMeasurePlugin/Model/area.js +3 -2
- package/libs/PanoMeasurePlugin/Model/polygon.js +8 -7
- package/libs/PanoMeasurePlugin/Modules/UIController/index.js +4 -3
- package/libs/PanoMeasurePlugin/index.js +15 -14
- package/libs/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
- package/libs/PanoMeasurePlugin/utils/isIntersecting.js +39 -16
- package/libs/PanoTagPlugin/Components/Tag/index.js +2 -3
- package/libs/PanoTagPlugin/Components/TagContainer.js +2 -3
- package/libs/PanoTagPlugin/Components/TagItem.js +2 -3
- package/libs/PanoTagPlugin/controller/Tag/BaseTag.js +111 -94
- package/libs/PanoTagPlugin/controller/Tag/ModelTag.js +2 -3
- package/libs/PanoTagPlugin/controller/Tag/PlaneTag.js +8 -9
- package/libs/PanoTagPlugin/controller/Tag/PointTag.js +2 -3
- package/libs/PanoTagPlugin/controller/TagRender.js +2 -3
- package/libs/PanoTagPlugin/controller/index.js +5 -6
- package/libs/PanoTagPlugin/index.js +11 -12
- package/libs/Sculpt/Meshes/Line.d.ts +1 -0
- package/libs/Sculpt/Meshes/Line.js +64 -56
- package/libs/Sculpt/Meshes/Polygon.js +3 -3
- package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
- package/libs/Sculpt/Meshes/Polyline.d.ts +2 -0
- package/libs/Sculpt/Meshes/Polyline.js +67 -66
- package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
- package/libs/Sculpt/Objects/Polygon/index.js +63 -64
- package/libs/Sculpt/Objects/Polyline/index.js +8 -9
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +128 -127
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/PointSelector/index.d.ts +12 -4
- package/libs/shared-utils/three/PointSelector/index.js +83 -56
- package/libs/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
- package/libs/shared-utils/three/PointSelector/utils/contents.js +4 -0
- package/libs/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
- package/libs/shared-utils/three/generatePolygonGeometry.js +19 -8
- package/package.json +2 -2
|
@@ -1,39 +1,38 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
1
|
+
var S = Object.defineProperty, b = Object.defineProperties;
|
|
2
|
+
var y = Object.getOwnPropertyDescriptors;
|
|
3
|
+
var p = Object.getOwnPropertySymbols;
|
|
4
|
+
var E = Object.prototype.hasOwnProperty, I = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var f = (n, s, e) => s in n ? S(n, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[s] = e, l = (n, s) => {
|
|
6
6
|
for (var e in s || (s = {}))
|
|
7
|
-
|
|
8
|
-
if (
|
|
9
|
-
for (var e of
|
|
10
|
-
|
|
11
|
-
return
|
|
12
|
-
}, m = (
|
|
13
|
-
var i = (
|
|
14
|
-
import { PointSelectorHelper as
|
|
15
|
-
import { isTouchDevice as
|
|
16
|
-
import
|
|
17
|
-
import * as
|
|
18
|
-
import { Subscribe as
|
|
19
|
-
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as
|
|
20
|
-
import { getRaycasterByNdcPosition as
|
|
21
|
-
|
|
22
|
-
|
|
7
|
+
E.call(s, e) && f(n, e, s[e]);
|
|
8
|
+
if (p)
|
|
9
|
+
for (var e of p(s))
|
|
10
|
+
I.call(s, e) && f(n, e, s[e]);
|
|
11
|
+
return n;
|
|
12
|
+
}, m = (n, s) => b(n, y(s));
|
|
13
|
+
var i = (n, s, e) => (f(n, typeof s != "symbol" ? s + "" : s, e), e);
|
|
14
|
+
import { PointSelectorHelper as w } from "./utils/PointSelectorHelper.js";
|
|
15
|
+
import { isTouchDevice as H } from "../../isTouchDevice.js";
|
|
16
|
+
import M from "hammerjs";
|
|
17
|
+
import * as d from "three";
|
|
18
|
+
import { Subscribe as N } from "../../Subscribe.js";
|
|
19
|
+
import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as U } from "../../five/getPosition.js";
|
|
20
|
+
import { getRaycasterByNdcPosition as L } from "../../five/getRaycasterByNdcPosition.js";
|
|
21
|
+
import { CURSOR_NOT_ALLOW_URL as v } from "./utils/contents.js";
|
|
22
|
+
const T = new d.Vector3(), u = () => !1;
|
|
23
|
+
class G extends N {
|
|
23
24
|
constructor(e, t) {
|
|
24
|
-
var
|
|
25
|
+
var a, o, c;
|
|
25
26
|
super();
|
|
26
|
-
|
|
27
|
-
* @description: 不在 five canvas 上时为 true
|
|
28
|
-
*/
|
|
29
|
-
i(this, "outOfFive", !1);
|
|
30
|
-
i(this, "enabled", !1);
|
|
27
|
+
i(this, "_cursorError", !1);
|
|
31
28
|
i(this, "actionIfNoModelUnderMouse", "virtualPoint");
|
|
32
29
|
i(this, "plane");
|
|
33
30
|
i(this, "pointSelectorHelper");
|
|
34
31
|
/** @deprecated directly use `pointSelector.on/off` instead */
|
|
35
32
|
i(this, "hook", this);
|
|
36
33
|
i(this, "five");
|
|
34
|
+
i(this, "_outOfFive", !1);
|
|
35
|
+
i(this, "_enabled", !1);
|
|
37
36
|
i(this, "hammer");
|
|
38
37
|
i(this, "mode");
|
|
39
38
|
/** 长按屏幕的动作触发后为true,手指抬起后为false */
|
|
@@ -55,11 +54,18 @@ class R extends H {
|
|
|
55
54
|
const t = this.emit("wantsSelect", this.position);
|
|
56
55
|
return t || (this.pointSelectorHelper.hide(), this.emit("select", this.position), console.debug(this.position)), !t;
|
|
57
56
|
});
|
|
57
|
+
i(this, "onMouseWheel", (e) => {
|
|
58
|
+
this.updateByMousePosition(e);
|
|
59
|
+
const t = () => this.updateByMousePosition();
|
|
60
|
+
this.five.off("render.prepare", t), this.five.on("render.prepare", t), setTimeout(() => {
|
|
61
|
+
this.five.off("render.prepare", t);
|
|
62
|
+
}, 200);
|
|
63
|
+
});
|
|
58
64
|
/**
|
|
59
65
|
* @description: 鼠标进入five canvas时
|
|
60
66
|
*/
|
|
61
67
|
i(this, "onEnter", () => {
|
|
62
|
-
this.pointSelectorHelper.show(), this.outOfFive = !1, this.emit("intersectionUpdate", this.position);
|
|
68
|
+
this.cursorError || this.pointSelectorHelper.show(), this.outOfFive = !1, this.emit("intersectionUpdate", this.position);
|
|
63
69
|
});
|
|
64
70
|
/**
|
|
65
71
|
* @description: 鼠标离开five canvas时
|
|
@@ -102,24 +108,24 @@ class R extends H {
|
|
|
102
108
|
this.pressDown && (this.pressDown = !1, this.select());
|
|
103
109
|
});
|
|
104
110
|
i(this, "updateByMousePosition", (e) => {
|
|
105
|
-
this.five.getElement() && (this.mousePosition = e, this.updateByNdcPosition(this.mouseNdcPosition));
|
|
111
|
+
this.five.getElement() && (e && (this.mousePosition = e), this.updateByNdcPosition(this.mouseNdcPosition));
|
|
106
112
|
});
|
|
107
113
|
/**
|
|
108
114
|
* @description: 根据鼠标位置计算焦点位置并更新
|
|
109
115
|
*/
|
|
110
116
|
i(this, "updateByNdcPosition", (e) => {
|
|
111
|
-
var
|
|
112
|
-
const t =
|
|
117
|
+
var h, a;
|
|
118
|
+
const t = L(this.five, e), r = F(this.five, t);
|
|
113
119
|
if (r)
|
|
114
120
|
return this.updatePointSelectorHelperIntersect(r), this.lastIntersection = r, !0;
|
|
115
121
|
if (this.plane) {
|
|
116
|
-
const
|
|
117
|
-
if (
|
|
122
|
+
const o = t.ray.intersectPlane(this.plane, T);
|
|
123
|
+
if (o) {
|
|
118
124
|
const c = {
|
|
119
|
-
distance: this.five.camera.position.distanceTo(
|
|
120
|
-
point:
|
|
121
|
-
object: new
|
|
122
|
-
face: new
|
|
125
|
+
distance: this.five.camera.position.distanceTo(o),
|
|
126
|
+
point: o.clone(),
|
|
127
|
+
object: new d.Object3D(),
|
|
128
|
+
face: new d.Face3(0, 0, 0, this.plane.normal.clone()),
|
|
123
129
|
raycaster: t,
|
|
124
130
|
isVirtual: !0
|
|
125
131
|
};
|
|
@@ -129,8 +135,8 @@ class R extends H {
|
|
|
129
135
|
if (this.actionIfNoModelUnderMouse === "lastPoint")
|
|
130
136
|
return this.updatePointSelectorHelperIntersect(this.lastIntersection), !0;
|
|
131
137
|
if (this.actionIfNoModelUnderMouse === "virtualPoint") {
|
|
132
|
-
const
|
|
133
|
-
return
|
|
138
|
+
const o = U(t, (h = this.lastIntersection) == null ? void 0 : h.distance);
|
|
139
|
+
return o.face = new d.Face3(0, 0, 0, (a = this.lastIntersection) == null ? void 0 : a.face.normal), o.isVirtual = !0, this.lastIntersection = o, this.updatePointSelectorHelperIntersect(o), !0;
|
|
134
140
|
} else if (this.actionIfNoModelUnderMouse === "disable")
|
|
135
141
|
return this.updatePointSelectorHelperIntersect(null), !1;
|
|
136
142
|
});
|
|
@@ -139,16 +145,16 @@ class R extends H {
|
|
|
139
145
|
*/
|
|
140
146
|
i(this, "updatePointSelectorHelperIntersect", (e) => {
|
|
141
147
|
if (!e) {
|
|
142
|
-
this.onLeave(), this.five.getElement().style.cursor =
|
|
148
|
+
this.onLeave(), this.five.getElement().style.cursor = v;
|
|
143
149
|
return;
|
|
144
150
|
}
|
|
145
|
-
this.onEnter(), this.five.getElement().style.cursor = "";
|
|
151
|
+
this.onEnter(), this.cursorError || (this.five.getElement().style.cursor = "");
|
|
146
152
|
const t = l({}, e);
|
|
147
153
|
let r = !1;
|
|
148
154
|
if (typeof this.adherePoints == "function" && typeof this.adherePointsRadius == "number") {
|
|
149
|
-
for (const
|
|
150
|
-
if (
|
|
151
|
-
t.point =
|
|
155
|
+
for (const h of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
|
|
156
|
+
if (h.distanceTo(e.point) < this.adherePointsRadius) {
|
|
157
|
+
t.point = h.clone(), r = !0;
|
|
152
158
|
break;
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -158,10 +164,10 @@ class R extends H {
|
|
|
158
164
|
const t = this.five.getElement();
|
|
159
165
|
if (!t)
|
|
160
166
|
return null;
|
|
161
|
-
const { top: r, left:
|
|
167
|
+
const { top: r, left: h, width: a, height: o } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
|
|
162
168
|
return {
|
|
163
|
-
x: (c -
|
|
164
|
-
y: 1 - (P - r) /
|
|
169
|
+
x: (c - h) / a,
|
|
170
|
+
y: 1 - (P - r) / o
|
|
165
171
|
};
|
|
166
172
|
});
|
|
167
173
|
i(this, "onFiveWantsPanGesture", () => {
|
|
@@ -174,20 +180,41 @@ class R extends H {
|
|
|
174
180
|
i(this, "emitIntersectionUpdate", (e) => {
|
|
175
181
|
this.emit("intersectionUpdate", e);
|
|
176
182
|
});
|
|
177
|
-
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (
|
|
178
|
-
const r = (
|
|
179
|
-
r === "auto" ? this.mode =
|
|
180
|
-
const
|
|
183
|
+
this.five = e, this.config = l(l({}, this.config), t), this.actionIfNoModelUnderMouse = (a = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? a : "virtualPoint";
|
|
184
|
+
const r = (o = t == null ? void 0 : t.mode) != null ? o : "auto";
|
|
185
|
+
r === "auto" ? this.mode = H ? "fixed" : "cursor" : this.mode = r;
|
|
186
|
+
const h = {
|
|
181
187
|
autoFixPCPosition: this.mode === "cursor",
|
|
182
188
|
initialPosition: this.mode === "fixed" ? { left: "35%", top: "20%" } : void 0
|
|
183
189
|
};
|
|
184
|
-
this.pointSelectorHelper = new
|
|
185
|
-
magnifierParams: l(l({},
|
|
190
|
+
this.pointSelectorHelper = new w(this.five, m(l({}, t == null ? void 0 : t.helper), {
|
|
191
|
+
magnifierParams: l(l({}, h), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
|
|
186
192
|
})), this.pointSelectorHelper.hide();
|
|
187
193
|
}
|
|
188
194
|
get position() {
|
|
189
195
|
return this.outOfFive ? null : this.pointSelectorHelper.position;
|
|
190
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* @description: 不在 five canvas 上时为 true
|
|
199
|
+
*/
|
|
200
|
+
get outOfFive() {
|
|
201
|
+
return this._outOfFive;
|
|
202
|
+
}
|
|
203
|
+
get enabled() {
|
|
204
|
+
return this._enabled;
|
|
205
|
+
}
|
|
206
|
+
get cursorError() {
|
|
207
|
+
return this._cursorError;
|
|
208
|
+
}
|
|
209
|
+
set cursorError(e) {
|
|
210
|
+
this._cursorError = e, this.five.getElement().style.cursor = e ? v : "", e ? this.pointSelectorHelper.hide() : this.pointSelectorHelper.show();
|
|
211
|
+
}
|
|
212
|
+
set outOfFive(e) {
|
|
213
|
+
this._outOfFive = e;
|
|
214
|
+
}
|
|
215
|
+
set enabled(e) {
|
|
216
|
+
this._enabled = e;
|
|
217
|
+
}
|
|
191
218
|
get mouseNdcPosition() {
|
|
192
219
|
return this.mousePosition ? this.mousePositionToNdcPosition(this.mousePosition) : null;
|
|
193
220
|
}
|
|
@@ -198,14 +225,14 @@ class R extends H {
|
|
|
198
225
|
const e = this.five.getElement();
|
|
199
226
|
if (!e)
|
|
200
227
|
throw new Error("five element not found");
|
|
201
|
-
this.hammer || (this.hammer = new
|
|
228
|
+
this.hammer || (this.hammer = new M(e)), this.mode === "cursor" ? (this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.five.on("wantsMoveToPano", u), this.five.on("wantsChangeMode", u), this.five.on("wantsTapGesture", u), e.addEventListener("mousemove", this.updateByMousePosition), e.addEventListener("wheel", this.onMouseWheel), e.addEventListener("mouseenter", this.onEnter), e.addEventListener("mouseout", this.onLeave), this.hammer.on("tap", this.onTap), this.hammer.on("pan", this.onPan), this.hammer.on("press", this.onPress), this.hammer.on("panend", this.onPanEnd)) : this.mode === "fixed" && (this.five.on("panoArrived", this.renderScreenCenter), this.five.on("panGesture", this.renderScreenCenter), this.five.on("interiaPan", this.renderScreenCenter), this.renderScreenCenter(), this.pointSelectorHelper.show()), this.pointSelectorHelper.hooks.on("intersectionUpdate", this.emitIntersectionUpdate), this.lastFiveHelperVisible = this.five.helperVisible, this.five.helperVisible = !1, this.emit("enable");
|
|
202
229
|
}
|
|
203
230
|
disable() {
|
|
204
231
|
if (!this.enabled)
|
|
205
232
|
return;
|
|
206
233
|
this.enabled = !1, this.pointSelectorHelper.disable(), this.five.getElement().style.cursor = "";
|
|
207
234
|
const e = this.five.getElement();
|
|
208
|
-
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano",
|
|
235
|
+
this.five.off("wantsPanGesture", this.onFiveWantsPanGesture), this.five.off("wantsMoveToPano", u), this.five.off("wantsChangeMode", u), this.five.off("wantsTapGesture", u), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.onMouseWheel), e == null || e.removeEventListener("mouseenter", this.onEnter), e == null || e.removeEventListener("mouseout", this.onLeave), this.hammer.off("tap", this.onTap), this.hammer.off("pan", this.onPan), this.hammer.off("press", this.onPress), this.hammer.off("panend", this.onPanEnd), this.five.off("panoArrived", this.renderScreenCenter), this.five.off("panGesture", this.renderScreenCenter), this.five.off("interiaPan", this.renderScreenCenter), this.pointSelectorHelper.hooks.off("intersectionUpdate", this.emitIntersectionUpdate), this.emit("disable");
|
|
209
236
|
}
|
|
210
237
|
dispose() {
|
|
211
238
|
this.disable(), this.pointSelectorHelper.dispose();
|
|
@@ -215,5 +242,5 @@ class R extends H {
|
|
|
215
242
|
}
|
|
216
243
|
}
|
|
217
244
|
export {
|
|
218
|
-
|
|
245
|
+
G as PointSelector
|
|
219
246
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CURSOR_NOT_ALLOW_URL = "url(\"data:image/svg+xml,%3Csvg width='12px' height='12px' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M6,12 C9.3137085,12 12,9.3137085 12,6 C12,2.6862915 9.3137085,0 6,0 C2.6862915,0 0,2.6862915 0,6 C0,9.3137085 2.6862915,12 6,12 Z' fill='%23FF5959'%3E%3C/path%3E%3Cg transform='translate(2, 2)' stroke='%23FFFFFF'%3E%3Ccircle cx='4' cy='4' r='4'%3E%3C/circle%3E%3Cline x1='1.07141075' y1='1.23997894' x2='6.64700843' y2='6.81557662'%3E%3C/line%3E%3C/g%3E%3C/g%3E%3C/svg%3E\") 6 6, auto";
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const e = `url("data:image/svg+xml,%3Csvg width='12px' height='12px' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd'%3E%3Cpath d='M6,12 C9.3137085,12 12,9.3137085 12,6 C12,2.6862915 9.3137085,0 6,0 C2.6862915,0 0,2.6862915 0,6 C0,9.3137085 2.6862915,12 6,12 Z' fill='%23FF5959'%3E%3C/path%3E%3Cg transform='translate(2, 2)' stroke='%23FFFFFF'%3E%3Ccircle cx='4' cy='4' r='4'%3E%3C/circle%3E%3Cline x1='1.07141075' y1='1.23997894' x2='6.64700843' y2='6.81557662'%3E%3C/line%3E%3C/g%3E%3C/g%3E%3C/svg%3E") 6 6, auto`;
|
|
2
|
+
export {
|
|
3
|
+
e as CURSOR_NOT_ALLOW_URL
|
|
4
|
+
};
|
|
@@ -2,5 +2,8 @@ import type { Vector3 } from 'three';
|
|
|
2
2
|
import * as THREE from 'three';
|
|
3
3
|
/**
|
|
4
4
|
* @description: 根据多边形的顶点数组生成多边形的 BufferGeometry
|
|
5
|
+
* @param checkLinesIntersect 检查多边形边线是否相交,需要保证传入的顶点是有序的
|
|
5
6
|
*/
|
|
6
|
-
export default function generatePolygonGeometry(_points: Vector3[]
|
|
7
|
+
export default function generatePolygonGeometry(_points: Vector3[], config?: {
|
|
8
|
+
checkLinesIntersect?: boolean;
|
|
9
|
+
}): THREE.BufferGeometry;
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { earcut3D as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import * as i from "three";
|
|
2
|
+
import { earcut3D as c } from "./earcut3D.js";
|
|
3
|
+
import { isIntersecting as m } from "../../PanoMeasurePlugin/utils/isIntersecting.js";
|
|
4
|
+
function h(a, s) {
|
|
5
|
+
const t = [...new Set(a)];
|
|
5
6
|
if (t.length < 3)
|
|
6
7
|
return;
|
|
7
|
-
t.at(-1).equals(t[0]) || t.push(t[0])
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
if (t.at(-1).equals(t[0]) || t.push(t[0]), s != null && s.checkLinesIntersect && t.length >= 5) {
|
|
9
|
+
const e = t.map((r, n) => {
|
|
10
|
+
if (n !== 0)
|
|
11
|
+
return { start: t[n - 1], end: t[n] };
|
|
12
|
+
}).filter(Boolean);
|
|
13
|
+
for (let r = 0; r < e.length; r++) {
|
|
14
|
+
const n = m(e[r], e.slice(r));
|
|
15
|
+
if (n && console.log("多边形边线相交", r, t), n)
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
const l = t.flatMap((e) => [e.x, e.y, e.z]), u = new i.Float32BufferAttribute(l, 3), f = c(t), o = new i.BufferGeometry();
|
|
20
|
+
return o.setAttribute("position", u), o.setIndex(f), o.name = "PolygonGeometry", o;
|
|
10
21
|
}
|
|
11
22
|
export {
|
|
12
|
-
|
|
23
|
+
h as generatePolygonGeometry
|
|
13
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@realsee/dnalogel",
|
|
3
|
-
"version": "3.48.
|
|
3
|
+
"version": "3.48.6",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./libs/index.js",
|
|
6
6
|
"types": "./libs/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@babel/core": "^7.22.9",
|
|
45
|
-
"@realsee/five": "6.
|
|
45
|
+
"@realsee/five": "6.1.3",
|
|
46
46
|
"@sveltejs/vite-plugin-svelte": "^2.4.2",
|
|
47
47
|
"@tsconfig/svelte": "^4.0.1",
|
|
48
48
|
"@tweenjs/tween.js": "^23.1.1",
|