@realsee/dnalogel 3.48.5 → 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.
Files changed (44) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
  3. package/dist/Sculpt/Meshes/Line.d.ts +1 -0
  4. package/dist/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  5. package/dist/Sculpt/Meshes/Polyline.d.ts +2 -0
  6. package/dist/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
  7. package/dist/index.cjs.js +47 -47
  8. package/dist/index.js +2039 -1965
  9. package/dist/index.umd.js +41 -41
  10. package/dist/shared-utils/three/PointSelector/index.d.ts +12 -4
  11. package/dist/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
  12. package/dist/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
  13. package/libs/ModelMakerPlugin/Controller.js +3 -2
  14. package/libs/ModelMakerPlugin/index.js +3 -2
  15. package/libs/PanoMeasurePlugin/Components/Controller0.js +21 -20
  16. package/libs/PanoMeasurePlugin/Components/Controller1.js +4 -3
  17. package/libs/PanoMeasurePlugin/Controller/EditController.js +4 -3
  18. package/libs/PanoMeasurePlugin/Controller/WatchController.js +3 -2
  19. package/libs/PanoMeasurePlugin/Controller/index.js +4 -3
  20. package/libs/PanoMeasurePlugin/Model/area.js +3 -2
  21. package/libs/PanoMeasurePlugin/Model/polygon.js +8 -7
  22. package/libs/PanoMeasurePlugin/Modules/UIController/index.js +4 -3
  23. package/libs/PanoMeasurePlugin/index.js +15 -14
  24. package/libs/PanoMeasurePlugin/utils/isIntersecting.d.ts +1 -1
  25. package/libs/PanoMeasurePlugin/utils/isIntersecting.js +39 -16
  26. package/libs/Sculpt/Meshes/Line.d.ts +1 -0
  27. package/libs/Sculpt/Meshes/Line.js +64 -56
  28. package/libs/Sculpt/Meshes/Polygon.js +3 -3
  29. package/libs/Sculpt/Meshes/PolygonWithEdge.d.ts +1 -1
  30. package/libs/Sculpt/Meshes/Polyline.d.ts +2 -0
  31. package/libs/Sculpt/Meshes/Polyline.js +67 -66
  32. package/libs/Sculpt/Meshes/RectangleWithEdge.d.ts +1 -1
  33. package/libs/Sculpt/Objects/Polygon/index.js +63 -64
  34. package/libs/Sculpt/Objects/Polyline/index.js +8 -9
  35. package/libs/base/BasePlugin.js +1 -1
  36. package/libs/index.js +127 -126
  37. package/libs/shared-utils/logger.js +1 -1
  38. package/libs/shared-utils/three/PointSelector/index.d.ts +12 -4
  39. package/libs/shared-utils/three/PointSelector/index.js +83 -56
  40. package/libs/shared-utils/three/PointSelector/utils/contents.d.ts +1 -0
  41. package/libs/shared-utils/three/PointSelector/utils/contents.js +4 -0
  42. package/libs/shared-utils/three/generatePolygonGeometry.d.ts +4 -1
  43. package/libs/shared-utils/three/generatePolygonGeometry.js +19 -8
  44. package/package.json +1 -1
@@ -1,39 +1,38 @@
1
- var v = Object.defineProperty, E = Object.defineProperties;
2
- var w = Object.getOwnPropertyDescriptors;
3
- var f = Object.getOwnPropertySymbols;
4
- var S = Object.prototype.hasOwnProperty, y = Object.prototype.propertyIsEnumerable;
5
- var p = (o, s, e) => s in o ? v(o, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[s] = e, l = (o, s) => {
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
- S.call(s, e) && p(o, e, s[e]);
8
- if (f)
9
- for (var e of f(s))
10
- y.call(s, e) && p(o, e, s[e]);
11
- return o;
12
- }, m = (o, s) => E(o, w(s));
13
- var i = (o, s, e) => (p(o, typeof s != "symbol" ? s + "" : s, e), e);
14
- import { PointSelectorHelper as I } from "./utils/PointSelectorHelper.js";
15
- import { isTouchDevice as b } from "../../isTouchDevice.js";
16
- import C from "hammerjs";
17
- import * as u from "three";
18
- import { Subscribe as H } from "../../Subscribe.js";
19
- import { getIntersectByRaycaster as F, getVirtualIntersectByRaycaster as M } from "../../five/getPosition.js";
20
- import { getRaycasterByNdcPosition as N } from "../../five/getRaycasterByNdcPosition.js";
21
- const x = new u.Vector3(), d = () => !1;
22
- class R extends H {
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 h, n, c;
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 a, h;
112
- const t = N(this.five, e), r = F(this.five, 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 n = t.ray.intersectPlane(this.plane, x);
117
- if (n) {
122
+ const o = t.ray.intersectPlane(this.plane, T);
123
+ if (o) {
118
124
  const c = {
119
- distance: this.five.camera.position.distanceTo(n),
120
- point: n.clone(),
121
- object: new u.Object3D(),
122
- face: new u.Face3(0, 0, 0, this.plane.normal.clone()),
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 n = M(t, (a = this.lastIntersection) == null ? void 0 : a.distance);
133
- return n.face = new u.Face3(0, 0, 0, (h = this.lastIntersection) == null ? void 0 : h.face.normal), n.isVirtual = !0, this.lastIntersection = n, this.updatePointSelectorHelperIntersect(n), !0;
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 = `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"), auto`;
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 a of this.adherePoints({ intersection: e, pointSelectorInstance: this }))
150
- if (a.distanceTo(e.point) < this.adherePointsRadius) {
151
- t.point = a.clone(), r = !0;
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: a, width: h, height: n } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
167
+ const { top: r, left: h, width: a, height: o } = t.getBoundingClientRect(), { clientX: c, clientY: P } = e;
162
168
  return {
163
- x: (c - a) / h,
164
- y: 1 - (P - r) / n
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 = (h = t == null ? void 0 : t.actionIfNoModelUnderMouse) != null ? h : "virtualPoint";
178
- const r = (n = t == null ? void 0 : t.mode) != null ? n : "auto";
179
- r === "auto" ? this.mode = b ? "fixed" : "cursor" : this.mode = r;
180
- const a = {
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 I(this.five, m(l({}, t == null ? void 0 : t.helper), {
185
- magnifierParams: l(l({}, a), (c = t == null ? void 0 : t.helper) == null ? void 0 : c.magnifierParams)
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 C(e)), this.mode === "cursor" ? (this.five.on("wantsPanGesture", this.onFiveWantsPanGesture), this.five.on("wantsMoveToPano", d), this.five.on("wantsChangeMode", d), this.five.on("wantsTapGesture", d), e.addEventListener("mousemove", this.updateByMousePosition), e.addEventListener("wheel", this.updateByMousePosition), 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");
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", d), this.five.off("wantsChangeMode", d), this.five.off("wantsTapGesture", d), this.five.helperVisible = this.lastFiveHelperVisible, e == null || e.removeEventListener("mousemove", this.updateByMousePosition), e == null || e.removeEventListener("wheel", this.updateByMousePosition), 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");
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
- R as PointSelector
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[]): THREE.BufferGeometry;
7
+ export default function generatePolygonGeometry(_points: Vector3[], config?: {
8
+ checkLinesIntersect?: boolean;
9
+ }): THREE.BufferGeometry;
@@ -1,13 +1,24 @@
1
- import * as n from "three";
2
- import { earcut3D as a } from "./earcut3D.js";
3
- function m(r) {
4
- const t = [...new Set(r)];
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
- const i = t.flatMap((o) => [o.x, o.y, o.z]), s = new n.Float32BufferAttribute(i, 3), u = a(t), e = new n.BufferGeometry();
9
- return e.setAttribute("position", s), e.setIndex(u), e.name = "PolygonGeometry", e;
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
- m as generatePolygonGeometry
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.5",
3
+ "version": "3.48.6",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./libs/index.js",
6
6
  "types": "./libs/index.d.ts",