rm-graphical-computing 1.0.34 → 1.0.36

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/dist/index.js CHANGED
@@ -1,68 +1,87 @@
1
1
  import * as e from "three";
2
- import { BufferAttribute as t, BufferGeometry as n, Matrix4 as r, Object3D as i, Plane as a, Vector2 as o, Vector3 as s } from "three";
2
+ import { Box3 as t, BufferAttribute as n, BufferGeometry as r, MathUtils as i, Matrix3 as a, Matrix4 as o, Object3D as s, Plane as c, Ray as l, Vector2 as u, Vector3 as d } from "three";
3
+ //#region \0rolldown/runtime.js
4
+ var f = Object.create, p = Object.defineProperty, m = Object.getOwnPropertyDescriptor, h = Object.getOwnPropertyNames, g = Object.getPrototypeOf, _ = Object.prototype.hasOwnProperty, v = (e, t) => () => (e && (t = e(e = 0)), t), y = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), b = (e, t) => {
5
+ let n = {};
6
+ for (var r in e) p(n, r, {
7
+ get: e[r],
8
+ enumerable: !0
9
+ });
10
+ return t || p(n, Symbol.toStringTag, { value: "Module" }), n;
11
+ }, x = (e, t, n, r) => {
12
+ if (t && typeof t == "object" || typeof t == "function") for (var i = h(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !_.call(e, s) && s !== n && p(e, s, {
13
+ get: ((e) => t[e]).bind(null, s),
14
+ enumerable: !(r = m(t, s)) || r.enumerable
15
+ });
16
+ return e;
17
+ }, S = (e, t, n) => (n = e == null ? {} : f(g(e)), x(t || !e || !e.__esModule ? p(n, "default", {
18
+ value: e,
19
+ enumerable: !0
20
+ }) : n, e)), C = (e) => _.call(e, "module.exports") ? e["module.exports"] : x(p({}, "__esModule", { value: !0 }), e);
21
+ //#endregion
3
22
  //#region node_modules/three/examples/jsm/utils/BufferGeometryUtils.js
4
- function c(e, t = !1) {
5
- let r = e[0].index !== null, i = new Set(Object.keys(e[0].attributes)), a = new Set(Object.keys(e[0].morphAttributes)), o = {}, s = {}, c = e[0].morphTargetsRelative, u = new n(), d = 0;
6
- for (let n = 0; n < e.length; ++n) {
7
- let l = e[n], f = 0;
8
- if (r !== (l.index !== null)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."), null;
9
- for (let e in l.attributes) {
10
- if (!i.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". All geometries must have compatible attributes; make sure \"" + e + "\" attribute exists among all geometries, or in none of them."), null;
11
- o[e] === void 0 && (o[e] = []), o[e].push(l.attributes[e]), f++;
12
- }
13
- if (f !== i.size) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". Make sure all geometries have the same number of attributes."), null;
14
- if (c !== l.morphTargetsRelative) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". .morphTargetsRelative must be consistent throughout all geometries."), null;
15
- for (let e in l.morphAttributes) {
16
- if (!a.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". .morphAttributes must be consistent throughout all geometries."), null;
17
- s[e] === void 0 && (s[e] = []), s[e].push(l.morphAttributes[e]);
23
+ function w(e, t = !1) {
24
+ let n = e[0].index !== null, i = new Set(Object.keys(e[0].attributes)), a = new Set(Object.keys(e[0].morphAttributes)), o = {}, s = {}, c = e[0].morphTargetsRelative, l = new r(), u = 0;
25
+ for (let r = 0; r < e.length; ++r) {
26
+ let d = e[r], f = 0;
27
+ if (n !== (d.index !== null)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."), null;
28
+ for (let e in d.attributes) {
29
+ if (!i.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". All geometries must have compatible attributes; make sure \"" + e + "\" attribute exists among all geometries, or in none of them."), null;
30
+ o[e] === void 0 && (o[e] = []), o[e].push(d.attributes[e]), f++;
31
+ }
32
+ if (f !== i.size) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". Make sure all geometries have the same number of attributes."), null;
33
+ if (c !== d.morphTargetsRelative) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". .morphTargetsRelative must be consistent throughout all geometries."), null;
34
+ for (let e in d.morphAttributes) {
35
+ if (!a.has(e)) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". .morphAttributes must be consistent throughout all geometries."), null;
36
+ s[e] === void 0 && (s[e] = []), s[e].push(d.morphAttributes[e]);
18
37
  }
19
38
  if (t) {
20
39
  let e;
21
- if (r) e = l.index.count;
22
- else if (l.attributes.position !== void 0) e = l.attributes.position.count;
23
- else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + n + ". The geometry must have either an index or a position attribute"), null;
24
- u.addGroup(d, e, n), d += e;
40
+ if (n) e = d.index.count;
41
+ else if (d.attributes.position !== void 0) e = d.attributes.position.count;
42
+ else return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + r + ". The geometry must have either an index or a position attribute"), null;
43
+ l.addGroup(u, e, r), u += e;
25
44
  }
26
45
  }
27
- if (r) {
46
+ if (n) {
28
47
  let t = 0, n = [];
29
48
  for (let r = 0; r < e.length; ++r) {
30
49
  let i = e[r].index;
31
50
  for (let e = 0; e < i.count; ++e) n.push(i.getX(e) + t);
32
51
  t += e[r].attributes.position.count;
33
52
  }
34
- u.setIndex(n);
53
+ l.setIndex(n);
35
54
  }
36
55
  for (let e in o) {
37
- let t = l(o[e]);
56
+ let t = T(o[e]);
38
57
  if (!t) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " attribute."), null;
39
- u.setAttribute(e, t);
58
+ l.setAttribute(e, t);
40
59
  }
41
60
  for (let e in s) {
42
61
  let t = s[e][0].length;
43
62
  if (t === 0) break;
44
- u.morphAttributes = u.morphAttributes || {}, u.morphAttributes[e] = [];
63
+ l.morphAttributes = l.morphAttributes || {}, l.morphAttributes[e] = [];
45
64
  for (let n = 0; n < t; ++n) {
46
65
  let t = [];
47
66
  for (let r = 0; r < s[e].length; ++r) t.push(s[e][r][n]);
48
- let r = l(t);
67
+ let r = T(t);
49
68
  if (!r) return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + e + " morphAttribute."), null;
50
- u.morphAttributes[e].push(r);
69
+ l.morphAttributes[e].push(r);
51
70
  }
52
71
  }
53
- return u;
72
+ return l;
54
73
  }
55
- function l(e) {
56
- let n, r, i, a = -1, o = 0;
57
- for (let t = 0; t < e.length; ++t) {
58
- let s = e[t];
59
- if (n === void 0 && (n = s.array.constructor), n !== s.array.constructor) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."), null;
74
+ function T(e) {
75
+ let t, r, i, a = -1, o = 0;
76
+ for (let n = 0; n < e.length; ++n) {
77
+ let s = e[n];
78
+ if (t === void 0 && (t = s.array.constructor), t !== s.array.constructor) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.array must be of consistent array types across matching attributes."), null;
60
79
  if (r === void 0 && (r = s.itemSize), r !== s.itemSize) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.itemSize must be consistent across matching attributes."), null;
61
80
  if (i === void 0 && (i = s.normalized), i !== s.normalized) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.normalized must be consistent across matching attributes."), null;
62
81
  if (a === -1 && (a = s.gpuType), a !== s.gpuType) return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
63
82
  o += s.count * r;
64
83
  }
65
- let s = new n(o), c = new t(s, r, i), l = 0;
84
+ let s = new t(o), c = new n(s, r, i), l = 0;
66
85
  for (let t = 0; t < e.length; ++t) {
67
86
  let n = e[t];
68
87
  if (n.isInterleavedBufferAttribute) {
@@ -78,9 +97,9 @@ function l(e) {
78
97
  }
79
98
  //#endregion
80
99
  //#region node_modules/three/examples/jsm/renderers/CSS2DRenderer.js
81
- var u = class extends i {
100
+ var E = class extends s {
82
101
  constructor(e = document.createElement("div")) {
83
- super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new o(.5, .5), this.addEventListener("removed", function() {
102
+ super(), this.isCSS2DObject = !0, this.element = e, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new u(.5, .5), this.addEventListener("removed", function() {
84
103
  this.traverse(function(e) {
85
104
  e.element && e.element instanceof e.element.ownerDocument.defaultView.Element && e.element.parentNode !== null && e.element.remove();
86
105
  });
@@ -90,31 +109,31 @@ var u = class extends i {
90
109
  return super.copy(e, t), this.element = e.element.cloneNode(!0), this.center = e.center, this;
91
110
  }
92
111
  };
93
- new s(), new r(), new r(), new s(), new s();
112
+ new d(), new o(), new o(), new d(), new d();
94
113
  //#endregion
95
114
  //#region src/utils/utils.mjs
96
- var d = (t, n, r, i, a = 1e-8) => {
115
+ var D = (t, n, r, i, a = 1e-8) => {
97
116
  let o = n.x - t.x, s = n.y - t.y, c = i.x - r.x, l = i.y - r.y, u = o * l - s * c;
98
117
  if (Math.abs(u) < a) return null;
99
118
  let d = ((r.x - t.x) * l - (r.y - t.y) * c) / u, f = ((r.x - t.x) * s - (r.y - t.y) * o) / u;
100
119
  return d < -a || d > 1 + a || f < -a || f > 1 + a ? null : { point: new e.Vector3(t.x + d * o, t.y + d * s, t.z) };
101
- }, f = (t, n, r = {}) => {
120
+ }, O = (t, n, r = {}) => {
102
121
  let { fontSize: i = 36, fontFamily: a = "sans-serif", backgroundColor: o = "rgba(0,0,0,0)", textColor: s = "#ffffff", padding: c = 10, maxWidth: l = 256 } = r, u = document.createElement("canvas").getContext("2d");
103
122
  u.font = `bold ${i}px ${a}`;
104
- let d = u.measureText(t).width, f = Math.min(d + c * 2, l), m = i + c * 2, h = document.createElement("canvas");
105
- h.width = f, h.height = m;
106
- let g = h.getContext("2d");
107
- g.fillStyle = o, g.fillRect(0, 0, f, m), g.fillStyle = s, g.font = `bold ${i}px ${a}`, g.textAlign = "center", g.textBaseline = "middle", d > l - c * 2 ? p(g, t, f / 2, m / 2, l, i) : g.fillText(t, f / 2, m / 2);
108
- let _ = new e.CanvasTexture(h), v = new e.SpriteMaterial({
109
- map: _,
123
+ let d = u.measureText(t).width, f = Math.min(d + c * 2, l), p = i + c * 2, m = document.createElement("canvas");
124
+ m.width = f, m.height = p;
125
+ let h = m.getContext("2d");
126
+ h.fillStyle = o, h.fillRect(0, 0, f, p), h.fillStyle = s, h.font = `bold ${i}px ${a}`, h.textAlign = "center", h.textBaseline = "middle", d > l - c * 2 ? k(h, t, f / 2, p / 2, l, i) : h.fillText(t, f / 2, p / 2);
127
+ let g = new e.CanvasTexture(m), _ = new e.SpriteMaterial({
128
+ map: g,
110
129
  depthTest: !1,
111
130
  transparent: !0
112
- }), y = new e.Sprite(v);
113
- y.position.set(n.x, n.y, n.z);
114
- let b = .005;
115
- return y.scale.set(f * b, m * b, 1), y;
131
+ }), v = new e.Sprite(_);
132
+ v.position.set(n.x, n.y, n.z);
133
+ let y = .005;
134
+ return v.scale.set(f * y, p * y, 1), v;
116
135
  };
117
- function p(e, t, n, r, i, a) {
136
+ function k(e, t, n, r, i, a) {
118
137
  let o = t.split(""), s = "", c = a * 1.2, l = r;
119
138
  for (let t = 0; t < o.length; t++) {
120
139
  let r = s + o[t];
@@ -122,7 +141,7 @@ function p(e, t, n, r, i, a) {
122
141
  }
123
142
  e.fillText(s, n, l);
124
143
  }
125
- var m = (e, t, n = .01) => {
144
+ var A = (e, t, n = .01) => {
126
145
  let r = Math.sqrt(e.x * e.x + e.y * e.y + e.z * e.z), i = Math.sqrt(t.x * t.x + t.y * t.y + t.z * t.z);
127
146
  if (r < 1e-10 || i < 1e-10) return {
128
147
  parallel: !1,
@@ -146,7 +165,7 @@ var m = (e, t, n = .01) => {
146
165
  angle: c
147
166
  };
148
167
  };
149
- function h(t, n, r) {
168
+ function j(t, n, r) {
150
169
  let i = new e.BufferGeometry(), a = [], o = [];
151
170
  t.forEach((e) => a.push(e.x, e.y, e.z)), n.forEach((e) => a.push(e.x, e.y, e.z)), o.push(0, 2, 1, 0, 3, 2), o.push(4, 5, 6, 4, 6, 7), o.push(0, 1, 5, 0, 5, 4), o.push(1, 2, 6, 1, 6, 5), o.push(2, 3, 7, 2, 7, 6), o.push(3, 0, 4, 3, 4, 7), i.setAttribute("position", new e.Float32BufferAttribute(a, 3)), i.setIndex(o), i.computeVertexNormals();
152
171
  let s = new e.MeshBasicMaterial({
@@ -157,7 +176,7 @@ function h(t, n, r) {
157
176
  });
158
177
  return new e.Mesh(i, s);
159
178
  }
160
- var g = class {
179
+ var M = class {
161
180
  constructor(t = {}) {
162
181
  this.config = {
163
182
  value: t.value || "0.0000m",
@@ -172,7 +191,7 @@ var g = class {
172
191
  }, this.label = null, this.labelElement = null, this.createLabel();
173
192
  }
174
193
  createLabel() {
175
- return this.labelElement = document.createElement("div"), this.labelElement.textContent = this.config.value, this.applyBlackWhiteStyle(), this.label = new u(this.labelElement), this.label.position.copy(this.config.position), this.label;
194
+ return this.labelElement = document.createElement("div"), this.labelElement.textContent = this.config.value, this.applyBlackWhiteStyle(), this.label = new E(this.labelElement), this.label.position.copy(this.config.position), this.label;
176
195
  }
177
196
  applyBlackWhiteStyle() {
178
197
  let e = this.labelElement.style, t = this.config;
@@ -199,33 +218,33 @@ var g = class {
199
218
  dispose() {
200
219
  this.labelElement && this.labelElement.parentNode && this.labelElement.parentNode.removeChild(this.labelElement), this.label = null, this.labelElement = null;
201
220
  }
202
- }, _ = (t) => {
221
+ }, N = (t) => {
203
222
  let n = new e.Group(), r = new e.Group();
204
223
  if (t && t.length) {
205
224
  let i = /* @__PURE__ */ "green.red.pink.white.azure.yellow.bisque.grey.blanchedalmond.blue.blueviolet.brown.burlywood.cadetblue.chartreuse.chocolate.coral.cornflowerblue.cornsilk.crimson.cyan.darkblue.darkcyan.darkgoldenrod.darkgray.darkgreen.darkgrey.darkkhaki.darkmagenta.darkolivegreen.darkorange.darkorchid.darkred.darksalmon.darkseagreen.darkslateblue.darkslategray.darkslategrey.darkturquoise.darkviolet.deeppink.deepskyblue.dimgray.dimgrey.dodgerblue.firebrick.floralwhite.forestgreen.fuchsia.gainsboro.ghostwhite.gold.goldenrod.gray.aliceblue.greenyellow.black.honeydew.hotpink.indianred.indigo.ivory.khaki.lavender.lavenderblush.lawngreen.lemonchiffon.lightblue.lightcoral.lightcyan.lightgoldenrodyellow.lightgray.lightgreen.lightgrey.lightpink.lightsalmon.lightseagreen.lightskyblue.lightslategray.lightslategrey.lightsteelblue.lightyellow.lime.limegreen.linen.magenta.maroon.mediumaquamarine.mediumblue.mediumorchid.mediumpurple.mediumseagreen.mediumslateblue.mediumspringgreen.mediumturquoise.mediumvioletred.midnightblue.mintcream.mistyrose.moccasin.navajowhite.navy.oldlace.olive.olivedrab.orange.orangered.orchid.palegoldenrod.palegreen.paleturquoise.palevioletred.papayawhip.peachpuff.peru.pink.plum.powderblue.purple.rebeccapurple.yellow.rosybrown.royalblue.saddlebrown.salmon.sandybrown.seagreen.seashell.sienna.silver.skyblue.slateblue.slategray.slategrey.snow.springgreen.steelblue.tan.teal.thistle.tomato.turquoise.violet.wheat.white.whitesmoke.yellow.yellowgreen".split(".");
206
225
  t.forEach((t, a) => {
207
- let o = i[a], s = new e.Group(), { pcdPoints: c, category: l, name: u, center: d, box: f, obbBox: p, contour: m, nline: _, coordinatesByWidth: v, coordinatesByArea: y } = t, b = c.length, x = new e.Box3(new e.Vector3(f.min.x, f.min.y, f.min.z), new e.Vector3(f.max.x, f.max.y, f.max.z)), S = new e.Box3Helper(x, o);
208
- s.add(S);
209
- let C = new g({
226
+ let o = i[a], s = new e.Group(), { pcdPoints: c, category: l, name: u, center: d, box: f, obbBox: p, contour: m, nline: h, coordinatesByWidth: g, coordinatesByArea: _ } = t, v = c.length, y = new e.Box3(new e.Vector3(f.min.x, f.min.y, f.min.z), new e.Vector3(f.max.x, f.max.y, f.max.z)), b = new e.Box3Helper(y, o);
227
+ s.add(b);
228
+ let x = new M({
210
229
  value: u,
211
230
  position: new e.Vector3(d.x, d.y, d.z)
212
231
  }).getLabel();
213
- s.add(C);
214
- let w = new e.InstancedMesh(new e.SphereGeometry(.007, 8, 8), new e.MeshBasicMaterial({ color: o }), b);
215
- s.add(w);
216
- let T = new e.Matrix4(), E = 0;
232
+ s.add(x);
233
+ let S = new e.InstancedMesh(new e.SphereGeometry(.007, 8, 8), new e.MeshBasicMaterial({ color: o }), v);
234
+ s.add(S);
235
+ let C = new e.Matrix4(), w = 0;
217
236
  if (c.forEach((e) => {
218
- T.setPosition(e.x, e.y, e.z), w.setMatrixAt(E, T), E++;
219
- }), w.instanceMatrix.needsUpdate = !0, _) {
237
+ C.setPosition(e.x, e.y, e.z), S.setMatrixAt(w, C), w++;
238
+ }), S.instanceMatrix.needsUpdate = !0, h) {
220
239
  let t = new e.BufferGeometry();
221
- t.setFromPoints([new e.Vector3(_.start.x, _.start.y, _.start.z), new e.Vector3(_.end.x, _.end.y, _.end.z)]);
240
+ t.setFromPoints([new e.Vector3(h.start.x, h.start.y, h.start.z), new e.Vector3(h.end.x, h.end.y, h.end.z)]);
222
241
  let n = new e.LineBasicMaterial({
223
242
  color: "red",
224
243
  depthTest: !1,
225
244
  depthWrite: !1
226
245
  });
227
246
  new e.Line(t, n);
228
- let r = new e.Vector3().copy(new e.Vector3(_.start.x, _.start.y, _.start.z)).add(new e.Vector3(_.end.x, _.end.y, _.end.z)).multiplyScalar(.5), i = new e.Vector3(_.centerDir.x, _.centerDir.y, _.centerDir.z);
247
+ let r = new e.Vector3().copy(new e.Vector3(h.start.x, h.start.y, h.start.z)).add(new e.Vector3(h.end.x, h.end.y, h.end.z)).multiplyScalar(.5), i = new e.Vector3(h.centerDir.x, h.centerDir.y, h.centerDir.z);
229
248
  new e.ArrowHelper(i, r, 1, "red");
230
249
  }
231
250
  if (m) {
@@ -242,9 +261,9 @@ var g = class {
242
261
  }), o = new e.Line(i, a);
243
262
  l == "door" ? n.add(o) : r.add(o);
244
263
  }
245
- if (y) {
264
+ if (_) {
246
265
  let t = [], i = [];
247
- y.coordinates.forEach((n, r) => {
266
+ _.coordinates.forEach((n, r) => {
248
267
  t.push(new e.Vector3(n.x, n.y, n.z)), i.length < 4 && i.push(new e.Vector3(n.x, n.y, n.z));
249
268
  });
250
269
  let a = new e.BufferGeometry();
@@ -255,17 +274,17 @@ var g = class {
255
274
  depthWrite: !1
256
275
  }), s = new e.Line(a, o);
257
276
  l == "door" ? n.add(s) : r.add(s);
258
- let c = h(i.map((t) => new e.Vector3(t.x, t.y, y.heightData.minZ)), i.map((t) => new e.Vector3(t.x, t.y, t.z)), l);
277
+ let c = j(i.map((t) => new e.Vector3(t.x, t.y, _.heightData.minZ)), i.map((t) => new e.Vector3(t.x, t.y, t.z)), l);
259
278
  l == "door" ? n.add(c) : r.add(c);
260
279
  let [u, d, f] = t, p = u.distanceTo(d), m = new e.Vector3().copy(u).add(d).multiplyScalar(.5);
261
- new g({
280
+ new M({
262
281
  value: String(p.toFixed(3)),
263
282
  position: m
264
283
  }).getLabel();
265
- let _ = d.distanceTo(f), v = new e.Vector3().copy(d).add(f).multiplyScalar(.5);
266
- new g({
267
- value: String(_.toFixed(3)),
268
- position: v
284
+ let h = d.distanceTo(f), g = new e.Vector3().copy(d).add(f).multiplyScalar(.5);
285
+ new M({
286
+ value: String(h.toFixed(3)),
287
+ position: g
269
288
  }).getLabel();
270
289
  }
271
290
  if (p) {
@@ -281,7 +300,7 @@ var g = class {
281
300
  AiProjectionGroup: n,
282
301
  AiProjectionGroup2: r
283
302
  };
284
- }, v = (t, n, r, i) => {
303
+ }, P = (t, n, r, i) => {
285
304
  let a = t, o = [];
286
305
  if (i && i.length && (o = i.map((e) => e.clone())), !a || a.length < 4) return {};
287
306
  let s = new e.Vector3().subVectors(a[1], a[0]).normalize(), c = new e.Vector3().subVectors(a[3], a[0]).normalize(), l = s.clone().cross(c).normalize(), u = Infinity, d = -Infinity, f = Infinity, p = -Infinity;
@@ -289,23 +308,23 @@ var g = class {
289
308
  let t = e.dot(s), n = e.dot(c);
290
309
  t < u && (u = t), t > d && (d = t), n < f && (f = n), n > p && (p = n);
291
310
  }
292
- let h = a[0].dot(l), g = s.clone().multiplyScalar(u).add(c.clone().multiplyScalar(f)).add(l.clone().multiplyScalar(h)), _ = s.clone().multiplyScalar(d).add(c.clone().multiplyScalar(f)).add(l.clone().multiplyScalar(h)), v = s.clone().multiplyScalar(d).add(c.clone().multiplyScalar(p)).add(l.clone().multiplyScalar(h)), y = s.clone().multiplyScalar(u).add(c.clone().multiplyScalar(p)).add(l.clone().multiplyScalar(h)), b = [
311
+ let m = a[0].dot(l), h = s.clone().multiplyScalar(u).add(c.clone().multiplyScalar(f)).add(l.clone().multiplyScalar(m)), g = s.clone().multiplyScalar(d).add(c.clone().multiplyScalar(f)).add(l.clone().multiplyScalar(m)), _ = s.clone().multiplyScalar(d).add(c.clone().multiplyScalar(p)).add(l.clone().multiplyScalar(m)), v = s.clone().multiplyScalar(u).add(c.clone().multiplyScalar(p)).add(l.clone().multiplyScalar(m)), y = [
312
+ h,
293
313
  g,
294
314
  _,
315
+ v
316
+ ], b = A(new e.Vector3().subVectors(h, g), new e.Vector3(0, 0, 1));
317
+ b && b.parallel && (y = [
318
+ h,
295
319
  v,
296
- y
297
- ], x = m(new e.Vector3().subVectors(g, _), new e.Vector3(0, 0, 1));
298
- x && x.parallel && (b = [
299
- g,
300
- y,
301
- v,
302
- _
320
+ _,
321
+ g
303
322
  ]);
304
- let S = 0;
323
+ let x = 0;
305
324
  if (i.length > 0) {
306
- let t = new e.Vector3().subVectors(b[1], b[0]).normalize(), i = t.clone().negate(), a = new e.Vector3().subVectors(b[3], b[0]).normalize(), s = a.clone().negate(), c = b[0].distanceTo(b[1]), l = b[0].distanceTo(b[3]), u = c / n, d = l / r, f = .001;
325
+ let t = new e.Vector3().subVectors(y[1], y[0]).normalize(), i = t.clone().negate(), a = new e.Vector3().subVectors(y[3], y[0]).normalize(), s = a.clone().negate(), c = y[0].distanceTo(y[1]), l = y[0].distanceTo(y[3]), u = c / n, d = l / r, f = .001;
307
326
  for (let i = 0; i < u; i++) {
308
- let i = b[0], s = 0;
327
+ let i = y[0], s = 0;
309
328
  for (let c = 0; c < d; c++) {
310
329
  let c = i.clone().addScaledVector(t, n), l = c.clone().addScaledVector(a, r), u = i.clone().addScaledVector(a, r), d = new e.Vector3().add(i).add(c).add(l).add(u).multiplyScalar(.25);
311
330
  for (let e = 0; e < o.length; e++) if (o[e].distanceTo(d) < f) {
@@ -315,11 +334,11 @@ var g = class {
315
334
  i = u;
316
335
  }
317
336
  if (s >= d / 2) break;
318
- S += s, b[0] = b[0].addScaledVector(t, n), b[3] = b[3].addScaledVector(t, n);
337
+ x += s, y[0] = y[0].addScaledVector(t, n), y[3] = y[3].addScaledVector(t, n);
319
338
  }
320
- c = b[0].distanceTo(b[1]), u = c / n;
339
+ c = y[0].distanceTo(y[1]), u = c / n;
321
340
  for (let t = 0; t < u; t++) {
322
- let t = b[1], s = 0;
341
+ let t = y[1], s = 0;
323
342
  for (let c = 0; c < d; c++) {
324
343
  let c = t.clone().addScaledVector(i, n), l = c.clone().addScaledVector(a, r), u = t.clone().addScaledVector(a, r), d = new e.Vector3().add(t).add(c).add(l).add(u).multiplyScalar(.25);
325
344
  for (let e = 0; e < o.length; e++) if (o[e].distanceTo(d) < f) {
@@ -329,11 +348,11 @@ var g = class {
329
348
  t = u;
330
349
  }
331
350
  if (s >= d / 2) break;
332
- S += s, b[1] = b[1].addScaledVector(i, n), b[2] = b[2].addScaledVector(i, n);
351
+ x += s, y[1] = y[1].addScaledVector(i, n), y[2] = y[2].addScaledVector(i, n);
333
352
  }
334
- c = b[0].distanceTo(b[1]), u = c / n;
353
+ c = y[0].distanceTo(y[1]), u = c / n;
335
354
  for (let i = 0; i < d; i++) {
336
- let i = b[3], a = 0;
355
+ let i = y[3], a = 0;
337
356
  for (let c = 0; c < u; c++) {
338
357
  let c = i.clone().addScaledVector(t, n), l = c.clone().addScaledVector(s, r), u = i.clone().addScaledVector(s, r), d = new e.Vector3().add(i).add(c).add(l).add(u).multiplyScalar(.25);
339
358
  for (let e = 0; e < o.length; e++) if (o[e].distanceTo(d) < f) {
@@ -343,16 +362,16 @@ var g = class {
343
362
  i = c;
344
363
  }
345
364
  if (a >= u / 2) break;
346
- S += a, b[2] = b[2].addScaledVector(s, r), b[3] = b[3].addScaledVector(s, r);
365
+ x += a, y[2] = y[2].addScaledVector(s, r), y[3] = y[3].addScaledVector(s, r);
347
366
  }
348
367
  }
349
- let C = b[0].distanceTo(b[1]) * b[0].distanceTo(b[3]);
368
+ let S = y[0].distanceTo(y[1]) * y[0].distanceTo(y[3]);
350
369
  return {
351
- facePoints: b,
352
- boxArea: C,
353
- totalInPlaneNum: S
370
+ facePoints: y,
371
+ boxArea: S,
372
+ totalInPlaneNum: x
354
373
  };
355
- }, y = (t, n, r, i, a = e.MathUtils.degToRad(8)) => {
374
+ }, F = (t, n, r, i, a = e.MathUtils.degToRad(8)) => {
356
375
  let o = new e.Vector3(), s = new e.Vector3();
357
376
  o.subVectors(new e.Vector3(n.x, n.y, 0), new e.Vector3(t.x, t.y, 0)).normalize(), s.subVectors(new e.Vector3(i.x, i.y, 0), new e.Vector3(r.x, r.y, 0)).normalize();
358
377
  let c = o.dot(s), l = Math.acos(Math.min(Math.abs(c), 1)), u = 1 - Math.min(l / a, 1), d = c > 0 ? "same" : "opposite";
@@ -367,7 +386,7 @@ var g = class {
367
386
  v2: s
368
387
  }
369
388
  };
370
- }, b = (t, n, r, i) => {
389
+ }, I = (t, n, r, i) => {
371
390
  let a = new e.Vector3().subVectors(n, t), o = new e.Vector3().subVectors(i, r), s = a.length(), c = o.length();
372
391
  if (s === 0 || c === 0) return {
373
392
  rate: NaN,
@@ -384,7 +403,7 @@ var g = class {
384
403
  isPerpendicular: Math.abs(f - 90) < .01,
385
404
  isParallel: f < .01
386
405
  };
387
- }, x = (t, n, r = !1) => new e.Vector3((t.x + n.x) / 2, (t.y + n.y) / 2, r ? 0 : (t.z + n.z) / 2), S = (t, n, r, i, a = {}) => {
406
+ }, L = (t, n, r = !1) => new e.Vector3((t.x + n.x) / 2, (t.y + n.y) / 2, r ? 0 : (t.z + n.z) / 2), R = (t, n, r, i, a = {}) => {
388
407
  let { parallelAngleMax: o = e.MathUtils.degToRad(10), collinearAngleMax: s = e.MathUtils.degToRad(7), distanceThreshold: c = 2, overlapThreshold: l = .01 } = a, u = new e.Vector3().subVectors(n, t), d = new e.Vector3().subVectors(i, r), f = u.clone().normalize(), p = d.clone().normalize(), m = e.MathUtils.clamp(f.dot(p), -1, 1), h = Math.acos(Math.abs(m)), g = e.MathUtils.radToDeg(h);
389
408
  if (h > o) return {
390
409
  type: "not_parallel",
@@ -396,28 +415,28 @@ var g = class {
396
415
  closestDistance: null
397
416
  };
398
417
  m < 0 && p.negate();
399
- let _ = new e.Vector3().addVectors(f, p).normalize(), v = new e.Vector3().addVectors(t, n).multiplyScalar(.5), y = C(r, v, f), b = C(i, v, f), x = (y + b) / 2, S = Math.max(y, b), T = t.dot(_), E = n.dot(_), D = r.dot(_), O = i.dot(_), k = Math.min(T, E), A = Math.max(T, E), j = Math.min(D, O), M = Math.max(D, O), N = A - k, P = M - j, F = Math.min(N, P), I = Math.min(A, M) - Math.max(k, j), L = I < 0 ? -I : 0, R = I > 0 ? I : 0, z = F > 0 ? R / F : 0, B = w(t, n, r, i), V = h <= s && x < c, H;
400
- return V ? H = z > .5 ? "collinear_overlap" : "collinear_gap" : h <= o && (H = "parallel_offset"), {
401
- type: H,
418
+ let _ = new e.Vector3().addVectors(f, p).normalize(), v = new e.Vector3().addVectors(t, n).multiplyScalar(.5), y = ee(r, v, f), b = ee(i, v, f), x = (y + b) / 2, S = Math.max(y, b), C = t.dot(_), w = n.dot(_), T = r.dot(_), E = i.dot(_), D = Math.min(C, w), O = Math.max(C, w), k = Math.min(T, E), A = Math.max(T, E), j = O - D, M = A - k, N = Math.min(j, M), P = Math.min(O, A) - Math.max(D, k), F = P < 0 ? -P : 0, I = P > 0 ? P : 0, L = N > 0 ? I / N : 0, R = te(t, n, r, i), z = h <= s && x < c, ne;
419
+ return z ? ne = L > .5 ? "collinear_overlap" : "collinear_gap" : h <= o && (ne = "parallel_offset"), {
420
+ type: ne,
402
421
  angleDeg: g,
403
422
  avgPerpendicularDistance: x,
404
423
  maxPerpendicularDistance: S,
405
- gap: L,
406
- overlap: R,
407
- closestDistance: B
424
+ gap: F,
425
+ overlap: I,
426
+ closestDistance: R
408
427
  };
409
428
  };
410
- function C(t, n, r) {
429
+ function ee(t, n, r) {
411
430
  let i = new e.Vector3().subVectors(t, n), a = i.dot(r), o = r.clone().multiplyScalar(a);
412
431
  return new e.Vector3().subVectors(i, o).length();
413
432
  }
414
- function w(t, n, r, i) {
433
+ function te(t, n, r, i) {
415
434
  let a = new e.Vector3().subVectors(n, t), o = new e.Vector3().subVectors(i, r), s = new e.Vector3().subVectors(r, t), c = a.dot(a), l = a.dot(o), u = o.dot(o), d = a.dot(s), f = o.dot(s), p = c * u - l * l, m, h;
416
435
  p < 1e-10 ? (m = 0, h = u === 0 ? 0 : f / u) : (m = (l * f - u * d) / p, h = (c * f - l * d) / p), m = e.MathUtils.clamp(m, 0, 1), h = u === 0 ? 0 : e.MathUtils.clamp((l * m + f) / u, 0, 1), m = c === 0 ? 0 : e.MathUtils.clamp((l * h - d) / c, 0, 1);
417
436
  let g = t.clone().add(a.clone().multiplyScalar(m)), _ = r.clone().add(o.clone().multiplyScalar(h));
418
437
  return g.distanceTo(_);
419
438
  }
420
- var T = (t, n, r, i = .05, a = .02) => {
439
+ var z = (t, n, r, i = .05, a = .02) => {
421
440
  let [o, s, c, l] = t, u = new e.Vector3().subVectors(s, o), d = new e.Vector3().subVectors(l, o), f = new e.Vector3().crossVectors(u, d).normalize(), p = u.length(), m = d.length(), h = u.clone().normalize(), g = d.clone().normalize(), _ = r - i, v = r + i, y = new e.Vector3(), b = [], x = Math.ceil(p / a), S = Math.ceil(m / a), C = p / x, w = m / S, T = new Uint8Array(x * S);
422
441
  for (let t = 0; t < n.length; t++) {
423
442
  y.subVectors(n[t], o);
@@ -438,8 +457,8 @@ var T = (t, n, r, i = .05, a = .02) => {
438
457
  quadArea: O,
439
458
  coveredArea: k
440
459
  };
441
- }, E = (e, t) => Math.round(Math.max(5, Math.min(350, t * Math.sqrt(e)))), D = (t) => {
442
- let n = new e.Vector3(t.start.x, t.start.y, t.start.z), r = new e.Vector3(t.end.x, t.end.y, t.end.z), i = n.distanceTo(r), a = t.rooftopPz - t.start.z, o = E(i, 100), s = E(a, 70), c = a / s, l = /* @__PURE__ */ new Map();
460
+ }, ne = (e, t) => Math.round(Math.max(5, Math.min(350, t * Math.sqrt(e)))), re = (t) => {
461
+ let n = new e.Vector3(t.start.x, t.start.y, t.start.z), r = new e.Vector3(t.end.x, t.end.y, t.end.z), i = n.distanceTo(r), a = t.rooftopPz - t.start.z, o = ne(i, 100), s = ne(a, 70), c = a / s, l = /* @__PURE__ */ new Map();
443
462
  for (let e = 0; e < s; e++) l.set((e + 1) * c, {
444
463
  count: 0,
445
464
  minZ: Infinity,
@@ -466,7 +485,7 @@ var T = (t, n, r, i = .05, a = .02) => {
466
485
  minZ: p,
467
486
  maxZ: m
468
487
  };
469
- }, O = (t, n, r) => {
488
+ }, ie = (t, n, r) => {
470
489
  let i = new e.Plane(), a = new e.Vector3(t.x, t.y, t.z), o = new e.Vector3(n.x, n.y, n.z), s = new e.Vector3(n.x, n.y, n.z + 5);
471
490
  i.setFromCoplanarPoints(a, o, s);
472
491
  let c = [];
@@ -483,7 +502,7 @@ var T = (t, n, r, i = .05, a = .02) => {
483
502
  newOriginalPoints: f,
484
503
  newProjectPoints: p
485
504
  };
486
- }, k = (t) => {
505
+ }, ae = (t) => {
487
506
  function n(t, n, r, i, a, o, s, c, l) {
488
507
  let u = new e.Line3(t, n), d = /* @__PURE__ */ new Map(), f = new e.Vector3(), p = t.clone(), m = n.clone(), h = 0;
489
508
  for (;;) {
@@ -525,45 +544,45 @@ var T = (t, n, r, i = .05, a = .02) => {
525
544
  if (i.checkResults[0].originalVertices && i.checkResults[0].originalVertices.length > 0) {
526
545
  let [t, n, r, s] = i.checkResults[0].originalVertices[0];
527
546
  t = new e.Vector3(t.x, t.y, t.z), n = new e.Vector3(n.x, n.y, n.z), r = new e.Vector3(r.x, r.y, r.z), s = new e.Vector3(s.x, s.y, s.z), a = t.distanceTo(n), o = t.distanceTo(s);
528
- let c = m(new e.Vector3().subVectors(t, n).normalize(), new e.Vector3(0, 0, 1));
547
+ let c = A(new e.Vector3().subVectors(t, n).normalize(), new e.Vector3(0, 0, 1));
529
548
  c && c.parallel && ([o, a] = [a, o]);
530
549
  }
531
550
  if (a < 0 || o < 0) continue;
532
- let s = new e.Vector3(i.start.x, i.start.y, i.start.z), c = new e.Vector3(i.end.x, i.end.y, i.end.z), l = s.distanceTo(c), u = i.rooftopPz - i.start.z, d = Math.ceil(l / a), f = Math.ceil(u / o), p = s.clone(), h = c.clone(), g = h.clone().add(new e.Vector3(0, 0, u)), _ = p.clone().add(new e.Vector3(0, 0, u)), v = new e.Vector3().subVectors(h, p).normalize(), y = v.clone().negate();
533
- new e.Vector3().subVectors(g, p).normalize().clone().negate();
534
- let b = a / 2;
551
+ let s = new e.Vector3(i.start.x, i.start.y, i.start.z), c = new e.Vector3(i.end.x, i.end.y, i.end.z), l = s.distanceTo(c), u = i.rooftopPz - i.start.z, d = Math.ceil(l / a), f = Math.ceil(u / o), p = s.clone(), m = c.clone(), h = m.clone().add(new e.Vector3(0, 0, u)), g = p.clone().add(new e.Vector3(0, 0, u)), _ = new e.Vector3().subVectors(m, p).normalize(), v = _.clone().negate();
552
+ new e.Vector3().subVectors(h, p).normalize().clone().negate();
553
+ let y = a / 2;
535
554
  o / 2;
536
- let x = l * u / (a * o);
537
- n(p, _, v, a, b, f, d, x, i), n(h, g, y, a, b, f, d, x, i), i.start = p, i.end = h;
538
- let { newOriginalPoints: S } = O(p, h, i.originalPoints);
539
- i.originalPoints = S;
555
+ let b = l * u / (a * o);
556
+ n(p, g, _, a, y, f, d, b, i), n(m, h, v, a, y, f, d, b, i), i.start = p, i.end = m;
557
+ let { newOriginalPoints: x } = ie(p, m, i.originalPoints);
558
+ i.originalPoints = x;
540
559
  }
541
- }, A = (t, n) => new e.Vector3(t.x, t.y, 0).distanceTo(new e.Vector3(n.x, n.y, 0)), j = (t, n, r = 1e-6) => {
560
+ }, B = (t, n) => new e.Vector3(t.x, t.y, 0).distanceTo(new e.Vector3(n.x, n.y, 0)), oe = (t, n, r = 1e-6) => {
542
561
  let i = new e.Vector3();
543
562
  return t.closestPointToPoint(n, !0, i), i.distanceTo(n) < r;
544
- }, M = (e) => {
563
+ }, se = (e) => {
545
564
  let t = 0, n = [];
546
565
  for (let r = 0; r < e.length; r++) for (let i = r + 1; i < e.length; i++) {
547
566
  let a = e[r].distanceTo(e[i]);
548
567
  a > t && (t = a, n = [e[r], e[i]]);
549
568
  }
550
569
  return n;
551
- }, N = (e, t, n = .03) => Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < n && Math.abs(e.z - t.z) < n, P = (e) => {
570
+ }, V = (e, t, n = .03) => Math.abs(e.x - t.x) < n && Math.abs(e.y - t.y) < n && Math.abs(e.z - t.z) < n, ce = (e) => {
552
571
  let t = [];
553
572
  e.children.forEach((e) => {
554
573
  e.type == "GridHelper" || e.type == "DirectionalLight" || e.type == "AmbientLight" || t.push(e);
555
574
  }), t.forEach((t) => {
556
- e.remove(t), I(t);
575
+ e.remove(t), ue(t);
557
576
  });
558
- }, F = () => `#${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}`;
559
- function I(e) {
577
+ }, le = () => `#${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}${Math.floor(Math.random() * 75 + 180).toString(16).padStart(2, "0")}`;
578
+ function ue(e) {
560
579
  for (; e.children && e.children.length > 0;) {
561
580
  let t = e.children[0];
562
- e.remove(t), I(t);
581
+ e.remove(t), ue(t);
563
582
  }
564
- e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((e) => L(e)) : L(e.material));
583
+ e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((e) => de(e)) : de(e.material));
565
584
  }
566
- function L(e) {
585
+ function de(e) {
567
586
  for (let t of Object.keys(e)) {
568
587
  let n = e[t];
569
588
  n && typeof n == "object" && typeof n.dispose == "function" && n.dispose();
@@ -572,7 +591,7 @@ function L(e) {
572
591
  }
573
592
  //#endregion
574
593
  //#region src/geometry/handleWallSegment.mjs
575
- var R = class {
594
+ var fe = class {
576
595
  results;
577
596
  clusterResults;
578
597
  constructor() {
@@ -998,114 +1017,114 @@ var R = class {
998
1017
  t.forEach((e, t) => {
999
1018
  e.applyMatrix4(n[t].matrixWorld);
1000
1019
  });
1001
- let r = c(t), i = n[0].material.clone(), a = new e.Mesh(r, i);
1020
+ let r = w(t), i = n[0].material.clone(), a = new e.Mesh(r, i);
1002
1021
  return a.name = "mergedWalls", a;
1003
1022
  } catch (e) {
1004
1023
  return console.error("合并网格时出错:", e), null;
1005
1024
  }
1006
1025
  }
1007
- }, z = (e) => {
1026
+ }, pe = (e) => {
1008
1027
  let t = {}, n = [], r = [], i = [];
1009
1028
  return e[0].width, e[0].height, e.forEach((e) => {
1010
1029
  r.push(...e.vertices), i.push(e.center), n.push(e.vertices);
1011
1030
  }), t.originalVertices = n, t.allCenterPoints = i, t;
1012
- }, B = (e) => {
1013
- let t = new s().copy(e.start).add(e.end).multiplyScalar(.5), n = new s().subVectors(new s(t.x, t.y, t.z + 1), t).normalize(), r = new s(e.direction.x, e.direction.y, 0);
1031
+ }, me = (e) => {
1032
+ let t = new d().copy(e.start).add(e.end).multiplyScalar(.5), n = new d().subVectors(new d(t.x, t.y, t.z + 1), t).normalize(), r = new d(e.direction.x, e.direction.y, 0);
1014
1033
  r.applyAxisAngle(n, Math.PI / 2);
1015
- let i = new s().copy(t).add(r.clone().multiplyScalar(e.length)), a = new s().copy(t).sub(r.clone().multiplyScalar(e.length));
1034
+ let i = new d().copy(t).add(r.clone().multiplyScalar(e.length)), a = new d().copy(t).sub(r.clone().multiplyScalar(e.length));
1016
1035
  return t.z = e.start.z, i.z = e.start.z, a.z = e.start.z, {
1017
1036
  start: i,
1018
1037
  end: a,
1019
1038
  center: t,
1020
1039
  direction: r
1021
1040
  };
1022
- }, V = (t, n, r = !0) => {
1041
+ }, he = (t, n, r = !0) => {
1023
1042
  let i = [];
1024
1043
  if (!t) return [];
1025
- for (let o = 0; o < t.length; o++) {
1026
- let c = t[o];
1027
- if (!c) continue;
1028
- let l = new e.Vector3(c.start.x, c.start.y, c.start.z);
1029
- l.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
1030
- let u = new e.Vector3(c.end.x, c.end.y, c.end.z);
1031
- if (u.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), n.add(f(String(o), new e.Vector3((l.x + u.x) / 2, (l.y + u.y) / 2, (l.z + u.z) / 2))), (c.isBayWindow || c.isWindow) && r) continue;
1032
- let d = new a().setFromCoplanarPoints(new s(c.start.x, c.start.y, c.start.z), new s(c.end.x, c.end.y, c.end.z), new s(c.start.x, c.start.y, c.rooftopPz)), p = [];
1033
- c.originalPoints.forEach((e, t) => {
1034
- let n = new s();
1035
- d.projectPoint(e, n), p.push(n);
1044
+ for (let a = 0; a < t.length; a++) {
1045
+ let o = t[a];
1046
+ if (!o) continue;
1047
+ let s = new e.Vector3(o.start.x, o.start.y, o.start.z);
1048
+ s.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
1049
+ let l = new e.Vector3(o.end.x, o.end.y, o.end.z);
1050
+ if (l.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), n.add(O(String(a), new e.Vector3((s.x + l.x) / 2, (s.y + l.y) / 2, (s.z + l.z) / 2))), (o.isBayWindow || o.isWindow) && r) continue;
1051
+ let u = new c().setFromCoplanarPoints(new d(o.start.x, o.start.y, o.start.z), new d(o.end.x, o.end.y, o.end.z), new d(o.start.x, o.start.y, o.rooftopPz)), f = [];
1052
+ o.originalPoints.forEach((e, t) => {
1053
+ let n = new d();
1054
+ u.projectPoint(e, n), f.push(n);
1036
1055
  });
1037
- let m = new s(c.start.x, c.start.y, c.start.z).distanceTo(new s(c.end.x, c.end.y, c.end.z)), h = Math.abs(c.rooftopPz - c.start.z), g = new e.MeshBasicMaterial({
1056
+ let p = new d(o.start.x, o.start.y, o.start.z).distanceTo(new d(o.end.x, o.end.y, o.end.z)), m = Math.abs(o.rooftopPz - o.start.z), h = new e.MeshBasicMaterial({
1038
1057
  color: "red",
1039
1058
  side: e.DoubleSide,
1040
1059
  wireframe: !1,
1041
1060
  transparent: !0,
1042
1061
  opacity: .5
1043
- }), _ = new e.Group(), v = new R(), { horizontalSubdivisions: y, verticalSubdivisions: b } = v.initLimits4(m, h), x = v.createSubdividedWallPlane(c, b, y, g, _);
1044
- v.analyzePointDistribution(x, p, .01);
1045
- let S = new e.MeshBasicMaterial({
1062
+ }), g = new e.Group(), _ = new fe(), { horizontalSubdivisions: v, verticalSubdivisions: y } = _.initLimits4(p, m), b = _.createSubdividedWallPlane(o, y, v, h, g);
1063
+ _.analyzePointDistribution(b, f, .01);
1064
+ let x = new e.MeshBasicMaterial({
1046
1065
  color: "black",
1047
1066
  transparent: !0,
1048
1067
  opacity: .8,
1049
1068
  side: e.DoubleSide
1050
- }), C = v.highlightEmptySegments(x, S, _), w = [];
1051
- for (let e of C.clusters) {
1052
- let t = z(e);
1053
- t && w.push(t);
1069
+ }), S = _.highlightEmptySegments(b, x, g), C = [];
1070
+ for (let e of S.clusters) {
1071
+ let t = pe(e);
1072
+ t && C.push(t);
1054
1073
  }
1055
- let T = B(c).direction;
1056
- c.checkResults = w, c.verticalDirection = T, c.originaIndex = o, i.push(c);
1074
+ let w = me(o).direction;
1075
+ o.checkResults = C, o.verticalDirection = w, o.originaIndex = a, i.push(o);
1057
1076
  }
1058
1077
  return i;
1059
- }, H = async (t, n, r, i) => {
1060
- P(i);
1078
+ }, ge = async (t, n, r, i) => {
1079
+ ce(i);
1061
1080
  let a = await fetch(t);
1062
1081
  if (!a) return;
1063
- let o = await a.json(), s = new e.Group(), l = new e.Group(), u = new e.Group(), d = new e.Group(), p = new e.Group(), m = new e.Group(), h = new e.Group(), g = new e.Group();
1082
+ let o = await a.json(), s = new e.Group(), c = new e.Group(), l = new e.Group(), u = new e.Group(), d = new e.Group(), f = new e.Group(), p = new e.Group(), m = new e.Group();
1064
1083
  for (let t = 0; t < o.length; t++) {
1065
1084
  let n = o[t];
1066
1085
  if (!n) continue;
1067
1086
  let r = new e.Vector3(n.start.x, n.start.y, n.start.z);
1068
1087
  r.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
1069
1088
  let i = new e.Vector3(n.end.x, n.end.y, n.end.z);
1070
- i.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), g.add(f(String(t), new e.Vector3((r.x + i.x) / 2, (r.y + i.y) / 2, (r.z + i.z) / 2)));
1089
+ i.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(O(String(t), new e.Vector3((r.x + i.x) / 2, (r.y + i.y) / 2, (r.z + i.z) / 2)));
1071
1090
  }
1072
1091
  o.sort((e, t) => e.originalIndex - t.originalIndex), console.log("lins", o);
1073
- let v = await fetch(n);
1074
- if (!v) return;
1075
- let y = await v.json(), b = Array.isArray(y) ? y : Object.values(y), x = await fetch(r);
1076
- if (console.log("respcd", x), !x) return;
1077
- let S = await x.json(), C = 0;
1078
- for (let t = 0; t < S.length; t++) {
1079
- let n = S[t];
1092
+ let h = await fetch(n);
1093
+ if (!h) return;
1094
+ let g = await h.json(), _ = Array.isArray(g) ? g : Object.values(g), v = await fetch(r);
1095
+ if (console.log("respcd", v), !v) return;
1096
+ let y = await v.json(), b = 0;
1097
+ for (let t = 0; t < y.length; t++) {
1098
+ let n = y[t];
1080
1099
  if (n.isFindBeam = !1, n.category == "door") {
1081
1100
  let t = new e.Vector3(n.center.x, n.center.y, n.center.z);
1082
- t.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), g.add(f(`door:${C}`, t)), C++;
1101
+ t.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(O(`door:${b}`, t)), b++;
1083
1102
  }
1084
1103
  }
1085
- i.add(g), console.time();
1086
- let { beamGroup: w } = await U(o, b, S, i);
1087
- console.timeEnd(), console.log("beamGroup", w);
1088
- let T = new e.MeshBasicMaterial({
1104
+ i.add(m), console.time();
1105
+ let { beamGroup: x } = await _e(o, _, y, i);
1106
+ console.timeEnd(), console.log("beamGroup", x), new e.MeshBasicMaterial({
1089
1107
  color: "#cffd00",
1090
1108
  transparent: !0,
1091
1109
  opacity: .4,
1092
1110
  side: e.DoubleSide
1093
- }), E = new e.MeshBasicMaterial({
1111
+ });
1112
+ let S = new e.MeshBasicMaterial({
1094
1113
  color: "#ff0000",
1095
1114
  transparent: !0,
1096
1115
  opacity: .4,
1097
1116
  side: e.DoubleSide
1098
- }), D = new e.MeshBasicMaterial({
1117
+ }), C = new e.MeshBasicMaterial({
1099
1118
  color: "#e100ff",
1100
1119
  transparent: !0,
1101
1120
  opacity: .4,
1102
1121
  side: e.DoubleSide
1103
- }), O = new e.MeshBasicMaterial({
1122
+ }), T = new e.MeshBasicMaterial({
1104
1123
  color: "#0400ff",
1105
1124
  transparent: !0,
1106
1125
  opacity: .4,
1107
1126
  side: e.DoubleSide
1108
- }), k = new e.LineBasicMaterial({ color: "#cffd00" }), A = [];
1127
+ }), E = new e.LineBasicMaterial({ color: "#cffd00" }), D = [];
1109
1128
  for (let t = 0; t < o.length; t++) {
1110
1129
  let n = o[t];
1111
1130
  if (n.checkResults) for (let t of n.checkResults) for (let n of t.originalVertices) {
@@ -1132,12 +1151,12 @@ var R = class {
1132
1151
  3
1133
1152
  ]), o.computeVertexNormals();
1134
1153
  let c = new e.EdgesGeometry(o, 1);
1135
- A.push(c);
1154
+ D.push(c);
1136
1155
  }
1137
1156
  }
1138
- if (A.length > 0) {
1139
- let t = c(A, !1);
1140
- t.rotateX(-Math.PI / 2), s.add(new e.LineSegments(t, k)), s.visible = !1, i.add(s), A.forEach((e) => e.dispose());
1157
+ if (D.length > 0) {
1158
+ let t = w(D, !1);
1159
+ t.rotateX(-Math.PI / 2), s.add(new e.LineSegments(t, E)), s.visible = !1, i.add(s), D.forEach((e) => e.dispose());
1141
1160
  }
1142
1161
  new e.PointsMaterial({
1143
1162
  color: 65535,
@@ -1150,36 +1169,36 @@ var R = class {
1150
1169
  n[t * 3] = e.x, n[t * 3 + 1] = e.y, n[t * 3 + 2] = e.z;
1151
1170
  });
1152
1171
  let r = new e.BufferGeometry();
1153
- r.setAttribute("position", new e.BufferAttribute(n, 3)), r.rotateX(-Math.PI / 2), l.add(new e.Points(r, new e.PointsMaterial({
1154
- color: F(),
1172
+ r.setAttribute("position", new e.BufferAttribute(n, 3)), r.rotateX(-Math.PI / 2), c.add(new e.Points(r, new e.PointsMaterial({
1173
+ color: le(),
1155
1174
  size: .02
1156
1175
  })));
1157
1176
  let i = [];
1158
1177
  i.push(new e.Vector3(t.start.x, t.start.y, t.start.z)), i.push(new e.Vector3(t.end.x, t.end.y, t.end.z));
1159
1178
  let a = new e.BufferGeometry();
1160
- a.setFromPoints(i), a.rotateX(-Math.PI / 2), m.add(new e.Line(a, k));
1179
+ a.setFromPoints(i), a.rotateX(-Math.PI / 2), f.add(new e.Line(a, E));
1161
1180
  }
1162
- m.visible = !1, i.add(l), i.add(m);
1163
- let j = [], M = [], N = new e.LineBasicMaterial({ color: "#f30606" }), I = new e.MeshBasicMaterial({ color: "#071ac4" });
1164
- for (let t = 0; t < b.length; t++) {
1181
+ f.visible = !1, i.add(c), i.add(f);
1182
+ let k = [], A = [], j = new e.LineBasicMaterial({ color: "#f30606" }), M = new e.MeshBasicMaterial({ color: "#071ac4" });
1183
+ for (let t = 0; t < _.length; t++) {
1165
1184
  let n = new e.SphereGeometry(.05);
1166
- n.translate(b[t].x, b[t].y, b[t].z);
1167
- let r = [], i = new e.Vector3(b[t].x, b[t].y, b[t].z), a = new e.Quaternion(b[t].qx, b[t].qy, b[t].qz, b[t].qw), o = new e.Vector3(0, 0, -1).applyQuaternion(a), s = i.clone().addScaledVector(o, .001);
1185
+ n.translate(_[t].x, _[t].y, _[t].z);
1186
+ let r = [], i = new e.Vector3(_[t].x, _[t].y, _[t].z), a = new e.Quaternion(_[t].qx, _[t].qy, _[t].qz, _[t].qw), o = new e.Vector3(0, 0, -1).applyQuaternion(a), s = i.clone().addScaledVector(o, .001);
1168
1187
  r.push(i), r.push(s);
1169
1188
  let c = new e.BufferGeometry();
1170
- c.setFromPoints(r), M.push(c), j.push(n);
1189
+ c.setFromPoints(r), A.push(c), k.push(n);
1171
1190
  }
1172
- if (j.length > 0) {
1173
- let t = c(j, !1);
1174
- t.rotateX(-Math.PI / 2), u.add(new e.Mesh(t, I)), j.forEach((e) => e.dispose());
1191
+ if (k.length > 0) {
1192
+ let t = w(k, !1);
1193
+ t.rotateX(-Math.PI / 2), l.add(new e.Mesh(t, M)), k.forEach((e) => e.dispose());
1175
1194
  }
1176
- if (M.length > 0) {
1177
- let t = c(M, !1);
1178
- t.rotateX(-Math.PI / 2), u.add(new e.Line(t, N)), M.forEach((e) => e.dispose());
1195
+ if (A.length > 0) {
1196
+ let t = w(A, !1);
1197
+ t.rotateX(-Math.PI / 2), l.add(new e.Line(t, j)), A.forEach((e) => e.dispose());
1179
1198
  }
1180
- i.add(u);
1181
- let { AiProjectionGroup: L, AiProjectionGroup2: R } = _(S);
1182
- return d.add(L), d.rotateX(-Math.PI / 2), i.add(d), p.add(R), p.visible = !1, p.rotateX(-Math.PI / 2), i.add(p), console.log("jsonpcdData", S), o.forEach((t) => {
1199
+ i.add(l);
1200
+ let { AiProjectionGroup: P, AiProjectionGroup2: F } = N(y);
1201
+ return u.add(P), u.rotateX(-Math.PI / 2), i.add(u), d.add(F), d.visible = !1, d.rotateX(-Math.PI / 2), i.add(d), console.log("jsonpcdData", y), o.forEach((t) => {
1183
1202
  t.doorAndBeamData && t.doorAndBeamData.length > 0 && (t.doorAndBeamData.forEach((t) => {
1184
1203
  if (t.beamStart) {
1185
1204
  let n = new e.BufferGeometry(), r = new Float32Array([
@@ -1203,7 +1222,7 @@ var R = class {
1203
1222
  0,
1204
1223
  2,
1205
1224
  3
1206
- ]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), h.add(new e.Mesh(n, T));
1225
+ ]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2);
1207
1226
  }
1208
1227
  let n = new e.BufferGeometry(), r = new Float32Array([
1209
1228
  t.doorStart.x,
@@ -1226,22 +1245,20 @@ var R = class {
1226
1245
  0,
1227
1246
  2,
1228
1247
  3
1229
- ]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), t.isDoor ? h.add(new e.Mesh(n, O)) : t.type == "beam" ? h.add(new e.Mesh(n, D)) : h.add(new e.Mesh(n, E));
1230
- let i = `id:${t.id},Nid:${t.nearId}`, a = new e.Vector3((t.doorStart.x + t.doorEnd.x) / 2, (t.doorStart.y + t.doorEnd.y) / 2, t.doorStart.z + t.doorHeight);
1231
- a.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), h.add(f(i, a));
1232
- }), i.add(h));
1248
+ ]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), t.isDoor ? p.add(new e.Mesh(n, T)) : t.type == "beam" ? p.add(new e.Mesh(n, C)) : p.add(new e.Mesh(n, S)), `${t.id}${t.nearId}`, new e.Vector3((t.doorStart.x + t.doorEnd.x) / 2, (t.doorStart.y + t.doorEnd.y) / 2, t.doorStart.z + t.doorHeight).applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
1249
+ }), i.add(p));
1233
1250
  }), {
1234
1251
  checkResultGroup: s,
1235
- pointCloudGroup: l,
1236
- runData: u,
1237
- pcdGroup: d,
1238
- pcdGroup2: p,
1239
- pointLineGroup: m,
1240
- beamDoorGroup: h,
1241
- lineIndexGroup: g
1252
+ pointCloudGroup: c,
1253
+ runData: l,
1254
+ pcdGroup: u,
1255
+ pcdGroup2: d,
1256
+ pointLineGroup: f,
1257
+ beamDoorGroup: p,
1258
+ lineIndexGroup: m
1242
1259
  };
1243
- }, U = async (t, n, r, i) => {
1244
- if (k(t, i), t.length <= 0 || n.length <= 0) return t;
1260
+ }, _e = async (t, n, r, i) => {
1261
+ if (ae(t, i), t.length <= 0 || n.length <= 0) return t;
1245
1262
  r ||= [];
1246
1263
  for (let n of t) {
1247
1264
  let t = [];
@@ -1280,11 +1297,11 @@ var R = class {
1280
1297
  gridHeight: -1,
1281
1298
  centerPts: []
1282
1299
  });
1283
- let i = l.get(n), [o, s, f, p] = a[t], h = new e.Vector3().add(o).add(s).add(f).add(p).multiplyScalar(.25);
1284
- if (i.points.push(...a[t]), i.area += o.distanceTo(s) * o.distanceTo(p), i.originalVertices.push(a[t]), i.index = r, i.centerPts.push(h), u == -1 || d == -1) {
1300
+ let i = l.get(n), [o, s, f, p] = a[t], m = new e.Vector3().add(o).add(s).add(f).add(p).multiplyScalar(.25);
1301
+ if (i.points.push(...a[t]), i.area += o.distanceTo(s) * o.distanceTo(p), i.originalVertices.push(a[t]), i.index = r, i.centerPts.push(m), u == -1 || d == -1) {
1285
1302
  let t = new e.Vector3().subVectors(o, s).normalize();
1286
1303
  d = o.distanceTo(p), u = o.distanceTo(s);
1287
- let n = m(t, new e.Vector3(0, 0, 1));
1304
+ let n = A(t, new e.Vector3(0, 0, 1));
1288
1305
  n && n.parallel && ([d, u] = [u, d]);
1289
1306
  }
1290
1307
  i.gridWidth = u, i.gridHeight = d;
@@ -1323,7 +1340,7 @@ var R = class {
1323
1340
  r[2],
1324
1341
  r[1]
1325
1342
  ]);
1326
- let o = x(r[0], r[3], !0), s = x(r[1], r[2], !0);
1343
+ let o = L(r[0], r[3], !0), s = L(r[1], r[2], !0);
1327
1344
  c.push({
1328
1345
  doorStartPt: o,
1329
1346
  doorEndPt: s,
@@ -1340,8 +1357,8 @@ var R = class {
1340
1357
  let r = c[n];
1341
1358
  for (let n = 0; n < t.length; n++) {
1342
1359
  if (t[n].length < .5) continue;
1343
- let i = [], a = x(t[n].start, t[n].end, !0);
1344
- i.push(a), i.push(x(a, t[n].start, !0)), i.push(x(a, t[n].end, !0));
1360
+ let i = [], a = L(t[n].start, t[n].end, !0);
1361
+ i.push(a), i.push(L(a, t[n].start, !0)), i.push(L(a, t[n].end, !0));
1345
1362
  let o = !1, s = r.boxPoints.length;
1346
1363
  for (let e = 0; e < i.length; e++) {
1347
1364
  let t = i[e].x, n = i[e].y;
@@ -1352,12 +1369,12 @@ var R = class {
1352
1369
  if (o) break;
1353
1370
  }
1354
1371
  if (o) {
1355
- let i = new e.Vector3(t[n].start.x, t[n].start.y, 0), a = new e.Vector3(t[n].end.x, t[n].end.y, 0), o = r.doorStartPt.distanceTo(r.doorEndPt), s = i.distanceTo(a), c = y(r.doorStartPt, r.doorEndPt, i, a);
1372
+ let i = new e.Vector3(t[n].start.x, t[n].start.y, 0), a = new e.Vector3(t[n].end.x, t[n].end.y, 0), o = r.doorStartPt.distanceTo(r.doorEndPt), s = i.distanceTo(a), c = F(r.doorStartPt, r.doorEndPt, i, a);
1356
1373
  if (Math.abs(s - o) < .5 && c && c.isParallel) {
1357
1374
  r.doorStartPt = new e.Vector3(t[n].start.x, t[n].start.y, 0), r.doorEndPt = new e.Vector3(t[n].end.x, t[n].end.y, 0);
1358
1375
  break;
1359
1376
  } else if (Math.abs(s - o) > 1.3 && c && c.isParallel) {
1360
- let e = S(r.doorStartPt, r.doorEndPt, i, a), t = r.doorStartPt.distanceTo(i), n = r.doorStartPt.distanceTo(a), o = r.doorEndPt.distanceTo(i), s = r.doorEndPt.distanceTo(a), c = t < .2 || n < .2 || o < .2 || s < .2;
1377
+ let e = R(r.doorStartPt, r.doorEndPt, i, a), t = r.doorStartPt.distanceTo(i), n = r.doorStartPt.distanceTo(a), o = r.doorEndPt.distanceTo(i), s = r.doorEndPt.distanceTo(a), c = t < .2 || n < .2 || o < .2 || s < .2;
1361
1378
  if (e && e.type == "collinear_overlap" && e.maxPerpendicularDistance < .1 && !c) {
1362
1379
  r.inWall = !0;
1363
1380
  break;
@@ -1366,455 +1383,458 @@ var R = class {
1366
1383
  } else continue;
1367
1384
  }
1368
1385
  }
1369
- let l = 0, u = [], f = [], p = [], h = [], g = .2;
1386
+ let l = 0, u = [], d = [], f = [], p = [], m = .2;
1370
1387
  for (let i = 0; i < t.length; i++) {
1371
1388
  let a = t[i];
1372
1389
  if (!a.mergeCheckRegion || a.mergeCheckRegion.length == 0) continue;
1373
1390
  a.doorAndBeamData = [], a.completePointAreaPercentage = -1;
1374
1391
  let o = new e.Box3();
1375
1392
  o.setFromPoints(a.originalPoints);
1376
- let _ = o.max.z, C = o.min.z, w = new e.Vector3(a.start.x, a.start.y, a.start.z), T = new e.Vector3(a.end.x, a.end.y, a.end.z), E = a.rooftopPz - a.start.z;
1377
- if (E < s - .5 || E > s + 2) continue;
1378
- let D = 0;
1393
+ let h = o.max.z, g = o.min.z, _ = new e.Vector3(a.start.x, a.start.y, a.start.z), v = new e.Vector3(a.end.x, a.end.y, a.end.z), y = a.rooftopPz - a.start.z;
1394
+ if (y < s - .5 || y > s + 2) continue;
1395
+ let b = 0;
1379
1396
  for (let o of a.mergeCheckRegion) {
1380
- let { facePoints: s, boxArea: k, totalInPlaneNum: N } = v(o.points, o.gridWidth, o.gridHeight, o.centerPts);
1397
+ let { facePoints: s, boxArea: x, totalInPlaneNum: S } = P(o.points, o.gridWidth, o.gridHeight, o.centerPts);
1381
1398
  if (!s || s.length <= 0) continue;
1382
1399
  s[0].distanceTo(s[1]);
1383
- let P = s[0].distanceTo(s[3]), F = o.gridHeight * (P / o.gridHeight / 3 * 2) + o.gridHeight / 2, I = new e.Vector3(s[0].x, s[0].y, s[0].z + F), L = new e.Vector3(s[1].x, s[1].y, s[1].z + F), R = new e.Line3(I, L), z = [], B = new e.Vector3();
1400
+ let C = s[0].distanceTo(s[3]), w = o.gridHeight * (C / o.gridHeight / 3 * 2) + o.gridHeight / 2, T = new e.Vector3(s[0].x, s[0].y, s[0].z + w), E = new e.Vector3(s[1].x, s[1].y, s[1].z + w), O = new e.Line3(T, E), k = [], j = new e.Vector3();
1384
1401
  o.points.forEach((e) => {
1385
- R.closestPointToPoint(e, !0, B).distanceTo(e) < o.gridHeight + .01 && z.push(e);
1402
+ O.closestPointToPoint(e, !0, j).distanceTo(e) < o.gridHeight + .01 && k.push(e);
1386
1403
  });
1387
- let V = [], H = [];
1404
+ let M = [], N = [];
1388
1405
  for (;;) {
1389
1406
  let e = [];
1390
- for (let t = 0; t < z.length; t++) H.includes(t) || e.length == 0 && (e.push(z[t]), H.push(t));
1391
- for (let t = 0; t < z.length; t++) if (!H.includes(t)) {
1392
- for (let n = 0; n < e.length; n++) if (z[t].distanceTo(e[n]) < o.gridWidth + .01) {
1393
- e.push(z[t]), H.push(t), t = -1;
1407
+ for (let t = 0; t < k.length; t++) N.includes(t) || e.length == 0 && (e.push(k[t]), N.push(t));
1408
+ for (let t = 0; t < k.length; t++) if (!N.includes(t)) {
1409
+ for (let n = 0; n < e.length; n++) if (k[t].distanceTo(e[n]) < o.gridWidth + .01) {
1410
+ e.push(k[t]), N.push(t), t = -1;
1394
1411
  break;
1395
1412
  }
1396
1413
  }
1397
1414
  if (e.length == 0) break;
1398
- V.push(e);
1415
+ M.push(e);
1399
1416
  }
1400
- let U = [];
1401
- for (let t = 0; t < V.length; t++) {
1417
+ let ee = [];
1418
+ for (let t = 0; t < M.length; t++) {
1402
1419
  let n = {
1403
1420
  lineSt: new e.Vector3(),
1404
1421
  lineEd: new e.Vector3(),
1405
1422
  facePoints: []
1406
- }, r = M(V[t]);
1407
- Array.isArray(r) && r.length == 2 && (n.lineSt = r[0], n.lineEd = r[1], n.facePoints.push(new e.Vector3(r[0].x, r[0].y, s[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, s[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, s[2].z)), n.facePoints.push(new e.Vector3(r[0].x, r[0].y, s[2].z)), U.push(n));
1408
- }
1409
- D += o.area;
1410
- let W = 0;
1411
- if (N != 0 && (W = o.gridHeight * o.gridWidth * N), (o.area - W) / k * 100 > 70 && U.length == 1 || U.length > 1) for (let s = 0; s < U.length; s++) {
1412
- let v = U[s], D = v.facePoints[0].distanceTo(v.facePoints[1]), k = v.facePoints[0].distanceTo(v.facePoints[3]), N = D / a.length * 100, P = a.rooftopPz - v.facePoints[2].z;
1413
- if (k < 1.5 || _ < v.facePoints[2].z || P > E / 3 * 2) continue;
1414
- let F = !1, I = !1, L = !1, R = [], z = v.facePoints[2].clone(), B = v.facePoints[3].clone(), V = v.facePoints[0].clone(), H = v.facePoints[1].clone(), W = !1, G = -1;
1415
- if (Math.abs(v.facePoints[0].z - a.start.z) < .25) {
1416
- if (D > .17 && a.length > .5) {
1417
- let n = A(w, V), r = A(w, H), o = A(T, V), s = A(T, H), c = .1;
1423
+ }, r = se(M[t]);
1424
+ Array.isArray(r) && r.length == 2 && (n.lineSt = r[0], n.lineEd = r[1], n.facePoints.push(new e.Vector3(r[0].x, r[0].y, s[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, s[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, s[2].z)), n.facePoints.push(new e.Vector3(r[0].x, r[0].y, s[2].z)), ee.push(n));
1425
+ }
1426
+ b += o.area;
1427
+ let te = 0;
1428
+ if (S != 0 && (te = o.gridHeight * o.gridWidth * S), (o.area - te) / x * 100 > 70 && ee.length == 1 || ee.length > 1) for (let s = 0; s < ee.length; s++) {
1429
+ let b = ee[s], x = b.facePoints[0].distanceTo(b.facePoints[1]), S = b.facePoints[0].distanceTo(b.facePoints[3]), C = x / a.length * 100, w = a.rooftopPz - b.facePoints[2].z;
1430
+ if (S < 1.5 || h < b.facePoints[2].z || w > y / 3 * 2) continue;
1431
+ let T = !1, E = !1, O = !1, k = [], j = b.facePoints[2].clone(), M = b.facePoints[3].clone(), N = b.facePoints[0].clone(), P = b.facePoints[1].clone(), te = !1, z = -1;
1432
+ if (Math.abs(b.facePoints[0].z - a.start.z) < .25) {
1433
+ if (x > .17 && a.length > .5) {
1434
+ let n = B(_, N), r = B(_, P), o = B(v, N), s = B(v, P), c = .1;
1418
1435
  if (n < c || r < c) {
1419
- let { newOriginalPoints: r } = O(V, H, a.originalPoints), o = [], s = [];
1436
+ let { newOriginalPoints: r } = ie(N, P, a.originalPoints), o = [], s = [];
1420
1437
  if (r.forEach((e) => {
1421
- e.z >= z.z ? o.push(e) : e.z <= V.z && s.push(e);
1438
+ e.z >= j.z ? o.push(e) : e.z <= N.z && s.push(e);
1422
1439
  }), o.length > 10) {
1423
- let r = new e.Vector3(a.start.x, a.start.y, 0), o = new e.Vector3(a.end.x, a.end.y, 0), s = new e.Vector3().subVectors(r, o).normalize(), l = new e.Vector3(), u = Infinity, f = -1, p = !1;
1440
+ let r = new e.Vector3(a.start.x, a.start.y, 0), o = new e.Vector3(a.end.x, a.end.y, 0), s = new e.Vector3().subVectors(r, o).normalize(), l = new e.Vector3(), u = Infinity, d = -1, f = !1;
1424
1441
  for (let n = 0; n < t.length; n++) {
1425
1442
  if (n == i) continue;
1426
- let a = new e.Vector3(t[n].start.x, t[n].start.y, 0), c = new e.Vector3(t[n].end.x, t[n].end.y, 0), m = d(r, o, a, c), h = b(r, o, a, c);
1427
- if (m != null) {
1428
- if (h && h.angle > 85) {
1429
- let e = m.point.distanceTo(r);
1430
- if (m.point.distanceTo(o), e < .3) {
1431
- u = Infinity, f = -1;
1443
+ let a = new e.Vector3(t[n].start.x, t[n].start.y, 0), c = new e.Vector3(t[n].end.x, t[n].end.y, 0), p = D(r, o, a, c), m = I(r, o, a, c);
1444
+ if (p != null) {
1445
+ if (m && m.angle > 85) {
1446
+ let e = p.point.distanceTo(r);
1447
+ if (p.point.distanceTo(o), e < .3) {
1448
+ u = Infinity, d = -1;
1432
1449
  break;
1433
1450
  }
1434
1451
  }
1435
1452
  continue;
1436
1453
  }
1437
- if (h && h.angle > 65) {
1438
- let t = y(r, o, new e.Line3(a, c).closestPointToPoint(r, !0, l), r);
1454
+ if (m && m.angle > 65) {
1455
+ let t = F(r, o, new e.Line3(a, c).closestPointToPoint(r, !0, l), r);
1439
1456
  if (!t || t.direction != "same") continue;
1440
- let i = r.clone().addScaledVector(s, 10), p = o.clone().addScaledVector(s.clone().negate(), 10), m = new e.Vector3().subVectors(c, a).normalize(), h = d(i, p, a.clone().addScaledVector(m.clone().negate(), .03), c.clone().addScaledVector(m, .03));
1441
- if (h == null) continue;
1442
- let g = r.distanceTo(h.point);
1443
- g < u && (u = g, f = n);
1444
- } else if (h && h.angle < 5) {
1445
- let t = new e.Vector3(V.x, V.y, 0), n = new e.Vector3(H.x, H.y, 0), r = A(t, a), i = A(t, c), o = A(n, a), s = A(n, c);
1457
+ let i = r.clone().addScaledVector(s, 10), f = o.clone().addScaledVector(s.clone().negate(), 10), p = new e.Vector3().subVectors(c, a).normalize(), m = D(i, f, a.clone().addScaledVector(p.clone().negate(), .03), c.clone().addScaledVector(p, .03));
1458
+ if (m == null) continue;
1459
+ let h = r.distanceTo(m.point);
1460
+ h < u && (u = h, d = n);
1461
+ } else if (m && m.angle < 5) {
1462
+ let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(P.x, P.y, 0), r = B(t, a), i = B(t, c), o = B(n, a), s = B(n, c);
1446
1463
  if (r < .08 || i < .08 || o < .08 || s < .08) {
1447
- p = !0, u = Infinity, f = -1;
1464
+ f = !0, u = Infinity, d = -1;
1448
1465
  break;
1449
1466
  }
1450
1467
  }
1451
1468
  }
1452
- if (u != Infinity && u < 2) t[f].length > .25 && D + u > .5 && (W = !0, n < c ? (B = B.addScaledVector(s, u), V = V.addScaledVector(s, u)) : (z = z.addScaledVector(s, u), H = H.addScaledVector(s, u)));
1453
- else if (!p) {
1454
- let r = .05, a = w.clone().addScaledVector(s, r), o = w.clone().addScaledVector(s.clone().negate(), r);
1469
+ if (u != Infinity && u < 2) t[d].length > .25 && x + u > .5 && (te = !0, n < c ? (M = M.addScaledVector(s, u), N = N.addScaledVector(s, u)) : (j = j.addScaledVector(s, u), P = P.addScaledVector(s, u)));
1470
+ else if (!f) {
1471
+ let r = .05, a = _.clone().addScaledVector(s, r), o = _.clone().addScaledVector(s.clone().negate(), r);
1455
1472
  a.z = o.z = 0;
1456
1473
  let l = !1;
1457
- for (let f = 0; f < t.length; f++) {
1458
- if (f == i) continue;
1459
- let p = new e.Vector3(t[f].start.x, t[f].start.y, 0), m = new e.Vector3(t[f].end.x, t[f].end.y, 0), h = new e.Vector3().subVectors(m, p).normalize();
1460
- p = p.clone().addScaledVector(h.clone().negate(), r), m = m.clone().addScaledVector(h, r);
1461
- let g = d(a, o, p, m);
1462
- if (g) {
1463
- g.point.z = w.z;
1464
- let e = g.point.distanceTo(w);
1465
- if (g.point.distanceTo(T) < e) continue;
1474
+ for (let d = 0; d < t.length; d++) {
1475
+ if (d == i) continue;
1476
+ let f = new e.Vector3(t[d].start.x, t[d].start.y, 0), p = new e.Vector3(t[d].end.x, t[d].end.y, 0), m = new e.Vector3().subVectors(p, f).normalize();
1477
+ f = f.clone().addScaledVector(m.clone().negate(), r), p = p.clone().addScaledVector(m, r);
1478
+ let h = D(a, o, f, p);
1479
+ if (h) {
1480
+ h.point.z = _.z;
1481
+ let e = h.point.distanceTo(_);
1482
+ if (h.point.distanceTo(v) < e) continue;
1466
1483
  u > e && (u = e), l = !0;
1467
1484
  }
1468
1485
  if (l) break;
1469
- u != Infinity && u < 2 && (n < c ? (B = B.addScaledVector(s.clone().negate(), u), V = V.addScaledVector(s.clone().negate(), u)) : (z = z.addScaledVector(s.clone().negate(), u), H = H.addScaledVector(s.clone().negate(), u)));
1486
+ u != Infinity && u < 2 && (n < c ? (M = M.addScaledVector(s.clone().negate(), u), N = N.addScaledVector(s.clone().negate(), u)) : (j = j.addScaledVector(s.clone().negate(), u), P = P.addScaledVector(s.clone().negate(), u)));
1470
1487
  }
1471
1488
  if (!l) continue;
1472
1489
  }
1473
1490
  } else continue;
1474
1491
  } else if (o < c || s < c) {
1475
- let { newOriginalPoints: n } = O(V, H, a.originalPoints), r = [], s = [];
1492
+ let { newOriginalPoints: n } = ie(N, P, a.originalPoints), r = [], s = [];
1476
1493
  if (n.forEach((e) => {
1477
- e.z >= z.z ? r.push(e) : e.z <= V.z && s.push(e);
1494
+ e.z >= j.z ? r.push(e) : e.z <= N.z && s.push(e);
1478
1495
  }), r.length > 10) {
1479
- let n = new e.Vector3(a.start.x, a.start.y, 0), r = new e.Vector3(a.end.x, a.end.y, 0), s = new e.Vector3().subVectors(r, n).normalize(), l = new e.Vector3(), u = Infinity, f = -1, p = !1;
1496
+ let n = new e.Vector3(a.start.x, a.start.y, 0), r = new e.Vector3(a.end.x, a.end.y, 0), s = new e.Vector3().subVectors(r, n).normalize(), l = new e.Vector3(), u = Infinity, d = -1, f = !1;
1480
1497
  for (let a = 0; a < t.length; a++) {
1481
1498
  if (a == i) continue;
1482
- let o = new e.Vector3(t[a].start.x, t[a].start.y, 0), c = new e.Vector3(t[a].end.x, t[a].end.y, 0), m = d(n, r, o, c), h = b(n, r, o, c);
1483
- if (m != null) {
1484
- if (h && h.angle > 85 && (m.point.distanceTo(n), m.point.distanceTo(r) < .3)) {
1485
- u = Infinity, f = -1;
1499
+ let o = new e.Vector3(t[a].start.x, t[a].start.y, 0), c = new e.Vector3(t[a].end.x, t[a].end.y, 0), p = D(n, r, o, c), m = I(n, r, o, c);
1500
+ if (p != null) {
1501
+ if (m && m.angle > 85 && (p.point.distanceTo(n), p.point.distanceTo(r) < .3)) {
1502
+ u = Infinity, d = -1;
1486
1503
  break;
1487
1504
  }
1488
1505
  continue;
1489
1506
  }
1490
- if (h && h.angle > 65) {
1491
- let t = y(r, n, new e.Line3(o, c).closestPointToPoint(r, !0, l), r);
1507
+ if (m && m.angle > 65) {
1508
+ let t = F(r, n, new e.Line3(o, c).closestPointToPoint(r, !0, l), r);
1492
1509
  if (!t || t.direction != "same") continue;
1493
- let i = n.clone().addScaledVector(s.clone().negate(), 10), p = r.clone().addScaledVector(s, 10), m = new e.Vector3().subVectors(c, o).normalize(), h = d(i, p, o.clone().addScaledVector(m.clone().negate(), .03), c.clone().addScaledVector(m, .03));
1494
- if (h == null) continue;
1495
- let g = r.distanceTo(h.point);
1496
- g < u && (u = g, f = a);
1497
- } else if (h && h.angle < 5) {
1498
- let t = new e.Vector3(V.x, V.y, 0), n = new e.Vector3(H.x, H.y, 0), r = A(t, o), i = A(t, c), a = A(n, o), s = A(n, c);
1510
+ let i = n.clone().addScaledVector(s.clone().negate(), 10), f = r.clone().addScaledVector(s, 10), p = new e.Vector3().subVectors(c, o).normalize(), m = D(i, f, o.clone().addScaledVector(p.clone().negate(), .03), c.clone().addScaledVector(p, .03));
1511
+ if (m == null) continue;
1512
+ let h = r.distanceTo(m.point);
1513
+ h < u && (u = h, d = a);
1514
+ } else if (m && m.angle < 5) {
1515
+ let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(P.x, P.y, 0), r = B(t, o), i = B(t, c), a = B(n, o), s = B(n, c);
1499
1516
  if (r < .08 || i < .08 || a < .08 || s < .08) {
1500
- p = !0, u = Infinity, f = -1;
1517
+ f = !0, u = Infinity, d = -1;
1501
1518
  break;
1502
1519
  }
1503
1520
  }
1504
1521
  }
1505
- if (u != Infinity && u < 2) t[f].length > .25 && D + u > .5 && (W = !0, o < c ? (B = B.addScaledVector(s, u), V = V.addScaledVector(s, u)) : (z = z.addScaledVector(s, u), H = H.addScaledVector(s, u)));
1506
- else if (!p) {
1507
- let n = .05, r = T.clone().addScaledVector(s, n), a = w.clone();
1522
+ if (u != Infinity && u < 2) t[d].length > .25 && x + u > .5 && (te = !0, o < c ? (M = M.addScaledVector(s, u), N = N.addScaledVector(s, u)) : (j = j.addScaledVector(s, u), P = P.addScaledVector(s, u)));
1523
+ else if (!f) {
1524
+ let n = .05, r = v.clone().addScaledVector(s, n), a = _.clone();
1508
1525
  r.z = a.z = 0;
1509
1526
  let l = !1;
1510
1527
  for (let o = 0; o < t.length; o++) {
1511
1528
  if (o == i) continue;
1512
- let s = new e.Vector3(t[o].start.x, t[o].start.y, 0), c = new e.Vector3(t[o].end.x, t[o].end.y, 0), f = new e.Vector3().subVectors(c, s).normalize();
1513
- s = s.clone().addScaledVector(f.clone().negate(), n), c = c.clone().addScaledVector(f, n);
1514
- let p = d(r, a, s, c);
1515
- if (p) {
1516
- p.point.z = T.z;
1517
- let e = p.point.distanceTo(T);
1518
- if (p.point.distanceTo(w) < e) continue;
1529
+ let s = new e.Vector3(t[o].start.x, t[o].start.y, 0), c = new e.Vector3(t[o].end.x, t[o].end.y, 0), d = new e.Vector3().subVectors(c, s).normalize();
1530
+ s = s.clone().addScaledVector(d.clone().negate(), n), c = c.clone().addScaledVector(d, n);
1531
+ let f = D(r, a, s, c);
1532
+ if (f) {
1533
+ f.point.z = v.z;
1534
+ let e = f.point.distanceTo(v);
1535
+ if (f.point.distanceTo(_) < e) continue;
1519
1536
  u > e && (u = e), l = !0;
1520
1537
  }
1521
1538
  }
1522
1539
  if (!l) continue;
1523
- u != Infinity && u < 2 && (o < c ? (B = B.addScaledVector(s.clone().negate(), u), V = V.addScaledVector(s.clone().negate(), u)) : (z = z.addScaledVector(s.clone().negate(), u), H = H.addScaledVector(s.clone().negate(), u)));
1540
+ u != Infinity && u < 2 && (o < c ? (M = M.addScaledVector(s.clone().negate(), u), N = N.addScaledVector(s.clone().negate(), u)) : (j = j.addScaledVector(s.clone().negate(), u), P = P.addScaledVector(s.clone().negate(), u)));
1524
1541
  }
1525
1542
  } else continue;
1526
1543
  }
1527
- D = B.distanceTo(z);
1544
+ x = M.distanceTo(j);
1528
1545
  }
1529
- if (N < 85 && D > .35 || D > .7 && k > E - E / 3) {
1546
+ if (C < 85 && x > .35 || x > .7 && S > y - y / 3) {
1530
1547
  let t = !1;
1531
1548
  for (let r = 0; r < n.length; r++) {
1532
1549
  let i = r + 1;
1533
1550
  if (i >= n.length) continue;
1534
1551
  let a = new e.Vector3(n[r].x, n[r].y, n[r].z), o = new e.Vector3(n[i].x, n[i].y, n[i].z);
1535
- if (d(new e.Vector3(a.x, a.y, 0), new e.Vector3(o.x, o.y, 0), new e.Vector3(v.facePoints[0].x, v.facePoints[0].y, 0), new e.Vector3(v.facePoints[1].x, v.facePoints[1].y, 0), .1) != null) {
1552
+ if (D(new e.Vector3(a.x, a.y, 0), new e.Vector3(o.x, o.y, 0), new e.Vector3(b.facePoints[0].x, b.facePoints[0].y, 0), new e.Vector3(b.facePoints[1].x, b.facePoints[1].y, 0), .1) != null) {
1536
1553
  t = !0;
1537
1554
  break;
1538
1555
  }
1539
1556
  }
1540
1557
  for (let t = 0; t < c.length; t++) {
1541
- let n = new e.Vector3(c[t].doorStartPt.x, c[t].doorStartPt.y, 0), i = new e.Vector3(c[t].doorEndPt.x, c[t].doorEndPt.y, 0), o = new e.Vector3(v.facePoints[0].x, v.facePoints[0].y, 0), s = new e.Vector3(v.facePoints[1].x, v.facePoints[1].y, 0), l = v.facePoints[2].z < c[t].maxZ || Math.abs(v.facePoints[2].z - c[t].maxZ) < .3;
1542
- if (Math.abs(v.facePoints[2].z - c[t].maxZ), l) {
1543
- let l = S(n.clone(), i.clone(), o.clone(), s.clone(), { distanceThreshold: 2 });
1558
+ let n = new e.Vector3(c[t].doorStartPt.x, c[t].doorStartPt.y, 0), i = new e.Vector3(c[t].doorEndPt.x, c[t].doorEndPt.y, 0), o = new e.Vector3(b.facePoints[0].x, b.facePoints[0].y, 0), s = new e.Vector3(b.facePoints[1].x, b.facePoints[1].y, 0), l = b.facePoints[2].z < c[t].maxZ || Math.abs(b.facePoints[2].z - c[t].maxZ) < .3;
1559
+ if (Math.abs(b.facePoints[2].z - c[t].maxZ), l) {
1560
+ let l = R(n.clone(), i.clone(), o.clone(), s.clone(), { distanceThreshold: 2 });
1544
1561
  if (l && l.type == "collinear_gap") {
1545
- let u = x(n, i), d = new e.Line3(new e.Vector3(a.start.x, a.start.y, 0), new e.Vector3(a.end.x, a.end.y, 0)), f = new e.Vector3(), p = d.closestPointToPoint(u, !0, f);
1562
+ let u = L(n, i), d = new e.Line3(new e.Vector3(a.start.x, a.start.y, 0), new e.Vector3(a.end.x, a.end.y, 0)), f = new e.Vector3(), p = d.closestPointToPoint(u, !0, f);
1546
1563
  if (u.distanceTo(p) < .15) {
1547
1564
  let a = o.distanceTo(n), u = s.distanceTo(n);
1548
1565
  if (a > .25 && u > .25) {
1549
1566
  let e = o.distanceTo(i), t = s.distanceTo(i);
1550
1567
  if (e > .2 && t > .2) continue;
1551
1568
  }
1552
- I = !0, L = !0, R.push(c[t].index), c[t].isFind = !0, G = t, r[c[t].index].isFindBeam = !0;
1569
+ E = !0, O = !0, k.push(c[t].index), c[t].isFind = !0, z = t, r[c[t].index].isFindBeam = !0;
1553
1570
  let d = new e.Vector3().subVectors(o, s).normalize(), f = n.distanceTo(i) - l.overlap;
1554
- u < a && d.negate(), a > u ? (z = v.facePoints[2].clone().addScaledVector(d, f), B = v.facePoints[3].clone(), V = B.clone(), H = z.clone(), V.z = H.z = v.facePoints[0].z) : (z = v.facePoints[2].clone(), B = v.facePoints[3].clone().addScaledVector(d, f), V = B.clone(), H = z.clone(), V.z = H.z = v.facePoints[0].z);
1571
+ u < a && d.negate(), a > u ? (j = b.facePoints[2].clone().addScaledVector(d, f), M = b.facePoints[3].clone(), N = M.clone(), P = j.clone(), N.z = P.z = b.facePoints[0].z) : (j = b.facePoints[2].clone(), M = b.facePoints[3].clone().addScaledVector(d, f), N = M.clone(), P = j.clone(), N.z = P.z = b.facePoints[0].z);
1555
1572
  }
1556
1573
  } else if (l && l.type == "collinear_overlap" && l.maxPerpendicularDistance < .35) {
1557
1574
  let a = o.distanceTo(s), u = i.distanceTo(n);
1558
1575
  if (Math.abs(a - l.overlap) < .25 || Math.abs(u - l.overlap) < .25) {
1559
1576
  if (u > a && Math.abs(u - l.overlap) > 1) {
1560
1577
  let t = o.distanceTo(n), r = o.distanceTo(i), a = s.distanceTo(n), c = s.distanceTo(i), d = t < r ? t : r, f = a < c ? a : c, p = new e.Vector3().subVectors(o, s).normalize(), m = u - l.overlap;
1561
- d < f ? (p.negate(), z = v.facePoints[2].clone().addScaledVector(p, m), B = v.facePoints[3].clone(), V = B.clone(), H = z.clone(), V.z = H.z = v.facePoints[0].z) : (z = v.facePoints[2].clone(), B = v.facePoints[3].clone().addScaledVector(p, m), V = B.clone(), H = z.clone(), V.z = H.z = v.facePoints[0].z);
1578
+ d < f ? (p.negate(), j = b.facePoints[2].clone().addScaledVector(p, m), M = b.facePoints[3].clone(), N = M.clone(), P = j.clone(), N.z = P.z = b.facePoints[0].z) : (j = b.facePoints[2].clone(), M = b.facePoints[3].clone().addScaledVector(p, m), N = M.clone(), P = j.clone(), N.z = P.z = b.facePoints[0].z);
1562
1579
  }
1563
- I = !0, L = !0, R.push(c[t].index), c[t].isFind = !0, r[c[t].index].isFindBeam = !0, G = t;
1580
+ E = !0, O = !0, k.push(c[t].index), c[t].isFind = !0, r[c[t].index].isFindBeam = !0, z = t;
1564
1581
  }
1565
1582
  }
1566
1583
  }
1567
1584
  }
1568
- if (!L) for (let t = 0; t < c.length; t++) {
1585
+ if (!O) for (let t = 0; t < c.length; t++) {
1569
1586
  if (c[t].inWall) continue;
1570
- let n = new e.Vector3(c[t].doorStartPt.x, c[t].doorStartPt.y, 0), i = new e.Vector3(c[t].doorEndPt.x, c[t].doorEndPt.y, 0), a = new e.Vector3(v.facePoints[0].x, v.facePoints[0].y, 0), o = new e.Vector3(v.facePoints[1].x, v.facePoints[1].y, 0), s = new e.Vector3().subVectors(n, i).normalize(), l = new e.Vector3().subVectors(a, o).normalize(), u = .2, f = d(n.clone().addScaledVector(s, u), i.clone().addScaledVector(s.clone().negate(), u), a.clone().addScaledVector(l, u), o.clone().addScaledVector(l.clone().negate(), u)), p = v.facePoints[2].z < c[t].maxZ || Math.abs(v.facePoints[2].z - c[t].maxZ) < .3, m = n.distanceTo(a), h = n.distanceTo(o), _ = i.distanceTo(a), y = i.distanceTo(o);
1571
- (m < g || h < g || _ < g || y < g || f) && p && (r[c[t].index].isFindBeam = !0, I = !0, c[t].isFind = !0, G = t);
1587
+ let n = new e.Vector3(c[t].doorStartPt.x, c[t].doorStartPt.y, 0), i = new e.Vector3(c[t].doorEndPt.x, c[t].doorEndPt.y, 0), a = new e.Vector3(b.facePoints[0].x, b.facePoints[0].y, 0), o = new e.Vector3(b.facePoints[1].x, b.facePoints[1].y, 0), s = new e.Vector3().subVectors(n, i).normalize(), l = new e.Vector3().subVectors(a, o).normalize(), u = .2, d = D(n.clone().addScaledVector(s, u), i.clone().addScaledVector(s.clone().negate(), u), a.clone().addScaledVector(l, u), o.clone().addScaledVector(l.clone().negate(), u)), f = b.facePoints[2].z < c[t].maxZ || Math.abs(b.facePoints[2].z - c[t].maxZ) < .3, p = n.distanceTo(a), h = n.distanceTo(o), g = i.distanceTo(a), _ = i.distanceTo(o);
1588
+ (p < m || h < m || g < m || _ < m || d) && f && (r[c[t].index].isFindBeam = !0, E = !0, c[t].isFind = !0, z = t);
1572
1589
  }
1573
- (I || t || Math.abs(k - E) > .1 && k > E / 2 && D > .3 && Math.abs(C - a.start.z) < .4) && (F = !0);
1590
+ (E || t || Math.abs(S - y) > .1 && S > y / 2 && x > .3 && Math.abs(g - a.start.z) < .4) && (T = !0);
1574
1591
  }
1575
1592
  }
1576
- if (F) {
1593
+ if (T) {
1577
1594
  let n = !1;
1578
- for (let e = 0; e < p.length; e++) {
1579
- let t = S(p[e].start, p[e].end, V, H);
1595
+ for (let e = 0; e < f.length; e++) {
1596
+ let t = R(f[e].start, f[e].end, N, P);
1580
1597
  if (t && t.type == "collinear_overlap" && t.maxPerpendicularDistance < .01) {
1581
1598
  n = !0;
1582
1599
  break;
1583
1600
  }
1584
1601
  }
1585
1602
  if (n) {
1586
- G != -1 && (r[c[G].index].isFindBeam = !1, c[G].isFind = !1);
1603
+ z != -1 && (r[c[z].index].isFindBeam = !1, c[z].isFind = !1);
1587
1604
  continue;
1588
1605
  }
1589
- p.push({
1590
- start: V,
1591
- end: H
1606
+ f.push({
1607
+ start: N,
1608
+ end: P
1592
1609
  });
1593
1610
  {
1594
- let t = new e.Vector3().subVectors(V, H), n = new e.Vector3().subVectors(H, V), r = Infinity, i = Infinity, o = V.clone(), s = H.clone(), c = [];
1595
- if (a.originalPoints.forEach((e) => {
1596
- e.z - V.z < k / 2 + .1 && e.z - V.z > k / 2 - .1 && c.push(e);
1611
+ let t = new e.Vector3().subVectors(N, P), n = new e.Vector3().subVectors(P, N), r = Infinity, i = Infinity, o = N.clone(), s = P.clone(), c = [], l = [], u = new e.Line3(j, M), d = new e.Vector3(), f = 999999;
1612
+ if (a.originalPoints.forEach((r) => {
1613
+ if (r.z - N.z < S / 2 + .1 && r.z - N.z > S / 2 - .1 && c.push(r), r.z > j.z) {
1614
+ let i = u.closestPointToPoint(r, !0, d), a = i.distanceTo(r), o = new e.Vector3().subVectors(i, j), s = A(t, new e.Vector3().subVectors(i, M)), c = A(n, o);
1615
+ s && s.parallel && !s.sameDirection && c && c.parallel && !c.sameDirection && a < .1 && a > .02 && (f > a && (f = a), l.push(r));
1616
+ }
1597
1617
  }), c.length > 0) {
1598
- let { newProjectPoints: a } = O(V, H, c);
1599
- for (let e of a) e.z = V.z;
1618
+ let { newProjectPoints: a } = ie(N, P, c);
1619
+ for (let e of a) e.z = N.z;
1600
1620
  a.forEach((a) => {
1601
- let c = new e.Vector3(a.x, a.y, V.z), l = new e.Vector3().subVectors(c, H), u = m(t, new e.Vector3().subVectors(c, V)), d = m(n, l);
1621
+ let c = new e.Vector3(a.x, a.y, N.z), l = new e.Vector3().subVectors(c, P), u = A(t, new e.Vector3().subVectors(c, N)), d = A(n, l);
1602
1622
  if (u && u.parallel && u.sameDirection) {
1603
- let e = c.distanceTo(V);
1623
+ let e = c.distanceTo(N);
1604
1624
  e < r && (r = e, o = c);
1605
1625
  } else if (d && d.parallel && d.sameDirection) {
1606
- let e = c.distanceTo(H);
1626
+ let e = c.distanceTo(P);
1607
1627
  e < i && (i = e, s = c);
1608
1628
  }
1609
1629
  });
1610
1630
  }
1611
- o.equals(V) || (V = o, B = new e.Vector3(V.x, V.y, B.z)), s.equals(H) || (H = s, z = new e.Vector3(H.x, H.y, z.z));
1631
+ o.equals(N) || (N = o, M = new e.Vector3(N.x, N.y, M.z)), s.equals(P) || (P = s, j = new e.Vector3(P.x, P.y, j.z)), l.length > 10 && (j.z = M.z + f, S += f);
1612
1632
  }
1613
- let s = H.distanceTo(V);
1614
- if (s < .4 && !I || s < .3 && I) continue;
1615
- f.includes(i) || f.push(i), a.checkResults[o.index].isDoor = !0;
1616
- let g = "", _ = {
1633
+ let s = P.distanceTo(N);
1634
+ if (s < .4 && !E || s < .3 && E) continue;
1635
+ d.includes(i) || d.push(i), a.checkResults[o.index].isDoor = !0;
1636
+ let m = "", h = {
1617
1637
  id: l,
1618
- beamStart: z,
1619
- beamEnd: B,
1620
- beamHeight: a.rooftopPz - v.facePoints[2].z,
1621
- doorStart: V,
1622
- doorEnd: H,
1623
- doorHeight: k,
1638
+ beamStart: j,
1639
+ beamEnd: M,
1640
+ beamHeight: a.rooftopPz - j.z,
1641
+ doorStart: N,
1642
+ doorEnd: P,
1643
+ doorHeight: S,
1624
1644
  nearId: -1,
1625
- type: g,
1626
- isExtend: W,
1627
- isDoor: I,
1628
- isPullOutDoor: L,
1629
- pcbDoorIndexs: R
1630
- }, b = !1, C = new e.Vector3(), w = new e.Vector3(), T = -1;
1645
+ type: m,
1646
+ isExtend: te,
1647
+ isDoor: E,
1648
+ isPullOutDoor: O,
1649
+ pcbDoorIndexs: k
1650
+ }, g = !1, _ = new e.Vector3(), v = new e.Vector3(), y = -1;
1631
1651
  for (let n = 0; n < u.length; n++) {
1632
1652
  let r = t[u[n].linesIndex].doorAndBeamData[u[n].doorIndex];
1633
1653
  if (r.nearId != -1) continue;
1634
- let i = y(z.clone(), B.clone(), r.beamStart.clone(), r.beamEnd.clone());
1654
+ let i = F(j.clone(), M.clone(), r.beamStart.clone(), r.beamEnd.clone());
1635
1655
  if (i && i.isParallel) {
1636
- let t = z.distanceTo(B), n = r.beamStart.distanceTo(r.beamEnd), i = new e.Line3(z.clone(), B.clone());
1656
+ let t = j.distanceTo(M), n = r.beamStart.distanceTo(r.beamEnd), i = new e.Line3(j.clone(), M.clone());
1637
1657
  i.start.z = 0, i.end.z = 0;
1638
- let a = x(r.beamStart, r.beamEnd, !0);
1639
- n > t && (i.start = new e.Vector3(r.beamStart.x, r.beamStart.y, 0), i.end = new e.Vector3(r.beamEnd.x, r.beamEnd.y, 0), a = x(z, B, !0));
1640
- let o = new e.Vector3(), s = i.closestPointToPoint(a, !0, o), c = s.distanceTo(a), u = new e.Vector3().subVectors(a, s).normalize(), f = u.clone().negate(), p = a.clone().addScaledVector(f, c + .1), m = d(i.start, i.end, a, p), h = !I && !r.isDoor && (t > n * 2 || n > t * 2);
1641
- if (c < .4 && m != null && !h) {
1642
- r.nearId = l, _.nearId = r.id;
1658
+ let a = L(r.beamStart, r.beamEnd, !0);
1659
+ n > t && (i.start = new e.Vector3(r.beamStart.x, r.beamStart.y, 0), i.end = new e.Vector3(r.beamEnd.x, r.beamEnd.y, 0), a = L(j, M, !0));
1660
+ let o = new e.Vector3(), s = i.closestPointToPoint(a, !0, o), c = s.distanceTo(a), u = new e.Vector3().subVectors(a, s).normalize(), d = u.clone().negate(), f = a.clone().addScaledVector(d, c + .1), p = D(i.start, i.end, a, f), m = !E && !r.isDoor && (t > n * 2 || n > t * 2);
1661
+ if (c < .4 && p != null && !m) {
1662
+ r.nearId = l, h.nearId = r.id;
1643
1663
  let e = .8;
1644
- (r.isDoor || _.isDoor) && (r.isDoor = !0, _.isDoor = !0);
1645
- let i = R.some((e) => r.pcbDoorIndexs.includes(e));
1646
- t < n ? t > e && !r.isPullOutDoor ? (r.beamStart = z.clone().addScaledVector(f, c), r.beamEnd = B.clone().addScaledVector(f, c), r.doorStart = V.clone().addScaledVector(f, c), r.doorEnd = H.clone().addScaledVector(f, c), r.doorHeight = _.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : !L || L && r.isPullOutDoor && i ? (_.beamStart = r.beamStart.clone().addScaledVector(u, c), _.beamEnd = r.beamEnd.clone().addScaledVector(u, c), _.doorStart = r.doorStart.clone().addScaledVector(u, c), _.doorEnd = r.doorEnd.clone().addScaledVector(u, c), _.doorHeight = r.doorHeight, _.beamStart.z = _.beamEnd.z = _.doorStart.z + _.doorHeight) : (r.beamStart = z.clone().addScaledVector(f, c), r.beamEnd = B.clone().addScaledVector(f, c), r.doorStart = V.clone().addScaledVector(f, c), r.doorEnd = H.clone().addScaledVector(f, c), r.doorHeight = _.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : t > n && (n > e && !L ? (_.beamStart = r.beamStart.clone().addScaledVector(f, c), _.beamEnd = r.beamEnd.clone().addScaledVector(f, c), _.doorStart = r.doorStart.clone().addScaledVector(f, c), _.doorEnd = r.doorEnd.clone().addScaledVector(f, c), _.doorHeight = r.doorHeight, _.beamStart.z = _.beamEnd.z = _.doorStart.z + _.doorHeight) : !r.isPullOutDoor || L && r.isPullOutDoor && i ? (r.beamStart = z.clone().addScaledVector(u, c), r.beamEnd = B.clone().addScaledVector(u, c), r.doorStart = V.clone().addScaledVector(u, c), r.doorEnd = H.clone().addScaledVector(u, c), r.doorHeight = _.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : (_.beamStart = r.beamStart.clone().addScaledVector(f, c), _.beamEnd = r.beamEnd.clone().addScaledVector(f, c), _.doorStart = r.doorStart.clone().addScaledVector(f, c), _.doorEnd = r.doorEnd.clone().addScaledVector(f, c), _.doorHeight = r.doorHeight, _.beamStart.z = _.beamEnd.z = _.doorStart.z + _.doorHeight)), T = _.nearId, C = r.beamStart.clone(), w = r.beamEnd.clone(), b = !0;
1664
+ (r.isDoor || h.isDoor) && (r.isDoor = !0, h.isDoor = !0);
1665
+ let i = k.some((e) => r.pcbDoorIndexs.includes(e));
1666
+ t < n ? t > e && !r.isPullOutDoor ? (r.beamStart = j.clone().addScaledVector(d, c), r.beamEnd = M.clone().addScaledVector(d, c), r.doorStart = N.clone().addScaledVector(d, c), r.doorEnd = P.clone().addScaledVector(d, c), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : !O || O && r.isPullOutDoor && i ? (h.beamStart = r.beamStart.clone().addScaledVector(u, c), h.beamEnd = r.beamEnd.clone().addScaledVector(u, c), h.doorStart = r.doorStart.clone().addScaledVector(u, c), h.doorEnd = r.doorEnd.clone().addScaledVector(u, c), h.doorHeight = r.doorHeight, h.beamStart.z = h.beamEnd.z = h.doorStart.z + h.doorHeight) : (r.beamStart = j.clone().addScaledVector(d, c), r.beamEnd = M.clone().addScaledVector(d, c), r.doorStart = N.clone().addScaledVector(d, c), r.doorEnd = P.clone().addScaledVector(d, c), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : t > n && (n > e && !O ? (h.beamStart = r.beamStart.clone().addScaledVector(d, c), h.beamEnd = r.beamEnd.clone().addScaledVector(d, c), h.doorStart = r.doorStart.clone().addScaledVector(d, c), h.doorEnd = r.doorEnd.clone().addScaledVector(d, c), h.doorHeight = r.doorHeight, h.beamStart.z = h.beamEnd.z = h.doorStart.z + h.doorHeight) : !r.isPullOutDoor || O && r.isPullOutDoor && i ? (r.beamStart = j.clone().addScaledVector(u, c), r.beamEnd = M.clone().addScaledVector(u, c), r.doorStart = N.clone().addScaledVector(u, c), r.doorEnd = P.clone().addScaledVector(u, c), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : (h.beamStart = r.beamStart.clone().addScaledVector(d, c), h.beamEnd = r.beamEnd.clone().addScaledVector(d, c), h.doorStart = r.doorStart.clone().addScaledVector(d, c), h.doorEnd = r.doorEnd.clone().addScaledVector(d, c), h.doorHeight = r.doorHeight, h.beamStart.z = h.beamEnd.z = h.doorStart.z + h.doorHeight)), y = h.nearId, _ = r.beamStart.clone(), v = r.beamEnd.clone(), g = !0;
1647
1667
  break;
1648
1668
  }
1649
1669
  }
1650
1670
  }
1651
- let E = !1;
1652
- if (!b) {
1653
- let a = new e.Line3(V.clone(), H.clone());
1671
+ let b = !1;
1672
+ if (!g) {
1673
+ let a = new e.Line3(N.clone(), P.clone());
1654
1674
  for (let o = 0; o < t.length; o++) {
1655
1675
  if (t[o].length < .5 || o == i || !t[o].checkResults) continue;
1656
- let s = S(new e.Vector3(t[o].start.x, t[o].start.y, t[o].start.z), new e.Vector3(t[o].end.x, t[o].end.y, t[o].end.z), V, H);
1676
+ let s = R(new e.Vector3(t[o].start.x, t[o].start.y, t[o].start.z), new e.Vector3(t[o].end.x, t[o].end.y, t[o].end.z), N, P);
1657
1677
  if (s && s.maxPerpendicularDistance < .3) {
1658
1678
  for (let i = 0; i < t[o].checkResults.length; i++) {
1659
1679
  let i = [];
1660
1680
  t[o].originalPoints.forEach((t) => {
1661
- t.z > V.z && t.z < V.z + k / 2 && i.push(new e.Vector3(t.x, t.y, V.z));
1681
+ t.z > N.z && t.z < N.z + S / 2 && i.push(new e.Vector3(t.x, t.y, N.z));
1662
1682
  });
1663
1683
  let s = new e.Vector3(), l = [], u = [];
1664
1684
  for (let e = 0; e < i.length; e++) {
1665
1685
  let t = a.closestPointToPoint(i[e], !0, s);
1666
1686
  t.distanceTo(i[e]) < .15 && (l.push(i[e]), u.push(t.clone()));
1667
1687
  }
1668
- for (let e = 0; e < u.length; e++) j(a, u[e]) && l.push(u[e]);
1688
+ for (let e = 0; e < u.length; e++) oe(a, u[e]) && l.push(u[e]);
1669
1689
  if (l = u, l.length < 500) continue;
1670
- let d = M(l);
1690
+ let d = se(l);
1671
1691
  if (d.length == 2) {
1672
1692
  let e = d[0].distanceTo(d[1]);
1673
1693
  if (Math.abs(e - a.distance()) < .3) {
1674
- n = !0, G != -1 && (r[c[G].index].isFindBeam = !1, c[G].isFind = !1);
1694
+ n = !0, z != -1 && (r[c[z].index].isFindBeam = !1, c[z].isFind = !1);
1675
1695
  break;
1676
1696
  }
1677
1697
  }
1678
1698
  }
1679
1699
  if (n) break;
1680
- } else s && s.type == "collinear_overlap" && s.maxPerpendicularDistance > .3 && s.maxPerpendicularDistance < .7 && (E = !0);
1700
+ } else s && s.type == "collinear_overlap" && s.maxPerpendicularDistance > .3 && s.maxPerpendicularDistance < .7 && (b = !0);
1681
1701
  }
1682
1702
  if (n) continue;
1683
1703
  }
1684
- let A = !1;
1685
- if (T != -1) for (let e = 0; e < h.length && !(h[e].length == 1 && (h[e][0].id == l ? (h[e].push({
1686
- id: T,
1687
- beamStart: C,
1688
- beamEnd: w
1689
- }), A = !0) : h[e][0].id == T && (h[e].push({
1704
+ let C = !1;
1705
+ if (y != -1) for (let e = 0; e < p.length && !(p[e].length == 1 && (p[e][0].id == l ? (p[e].push({
1706
+ id: y,
1707
+ beamStart: _,
1708
+ beamEnd: v
1709
+ }), C = !0) : p[e][0].id == y && (p[e].push({
1690
1710
  id: l,
1691
- beamStart: z,
1692
- beamEnd: B
1693
- }), A = !0), A)); e++);
1694
- A || h.push([{
1711
+ beamStart: j,
1712
+ beamEnd: M
1713
+ }), C = !0), C)); e++);
1714
+ C || p.push([{
1695
1715
  id: l,
1696
- beamStart: z,
1697
- beamEnd: B
1716
+ beamStart: j,
1717
+ beamEnd: M
1698
1718
  }]);
1699
- let N = _.doorStart.distanceTo(_.doorEnd);
1700
- if (g = I ? "door" : N > 1.8 || E && N > 1 ? "beam" : "hole", _.type = g, _.nearId != -1 && g == "hole") {
1719
+ let w = h.doorStart.distanceTo(h.doorEnd);
1720
+ if (m = E ? "door" : w > 1.8 || b && w > 1 ? "beam" : "hole", h.type = m, h.nearId != -1 && m == "hole") {
1701
1721
  let e = !1;
1702
1722
  for (let n = 0; n < t.length; n++) if (t[n].doorAndBeamData) {
1703
1723
  for (let r = 0; r < t[n].doorAndBeamData.length; r++) if (t[n].doorAndBeamData[r].nearId == l && t[n].doorAndBeamData[r].type == "beam") {
1704
- t[n].doorAndBeamData[r].type = g, e = !0;
1724
+ t[n].doorAndBeamData[r].type = m, e = !0;
1705
1725
  break;
1706
1726
  }
1707
1727
  if (e) break;
1708
1728
  }
1709
1729
  }
1710
- if (a.doorAndBeamData.push(_), u.push({
1730
+ if (a.doorAndBeamData.push(h), u.push({
1711
1731
  linesIndex: i,
1712
1732
  doorIndex: a.doorAndBeamData.length - 1
1713
- }), l++, L && D < 2) break;
1733
+ }), l++, O && x < 2) break;
1714
1734
  }
1715
1735
  }
1716
1736
  }
1717
- let k = a.length * (a.rooftopPz - a.start.z);
1718
- a.completePointAreaPercentage = D / k * 100;
1737
+ let x = a.length * (a.rooftopPz - a.start.z);
1738
+ a.completePointAreaPercentage = b / x * 100;
1719
1739
  }
1720
- if (f.length > 1) for (let n = 0; n < f.length; n++) {
1740
+ if (d.length > 1) for (let n = 0; n < d.length; n++) {
1721
1741
  let r = [];
1722
- for (let i = 0; i < t[f[n]].doorAndBeamData.length; i++) {
1723
- let a = t[f[n]].doorAndBeamData[i].doorStart.clone(), o = t[f[n]].doorAndBeamData[i].doorEnd.clone();
1742
+ for (let i = 0; i < t[d[n]].doorAndBeamData.length; i++) {
1743
+ let a = t[d[n]].doorAndBeamData[i].doorStart.clone(), o = t[d[n]].doorAndBeamData[i].doorEnd.clone();
1724
1744
  a.z = o.z = 0;
1725
1745
  let s = a.distanceTo(o), c = !1;
1726
- for (let r = 0; r < f.length; r++) if (n != r) for (let n = 0; n < t[f[r]].doorAndBeamData.length; n++) {
1727
- let i = t[f[r]].doorAndBeamData[n].doorStart.clone(), l = t[f[r]].doorAndBeamData[n].doorEnd.clone();
1746
+ for (let r = 0; r < d.length; r++) if (n != r) for (let n = 0; n < t[d[r]].doorAndBeamData.length; n++) {
1747
+ let i = t[d[r]].doorAndBeamData[n].doorStart.clone(), l = t[d[r]].doorAndBeamData[n].doorEnd.clone();
1728
1748
  i.z = l.z = 0, i.distanceTo(l);
1729
- let u = S(a, o, i, l);
1749
+ let u = R(a, o, i, l);
1730
1750
  if (u.type == "collinear_overlap" && u.maxPerpendicularDistance < .2) {
1731
- let t = new e.Line3(i, l), n = x(a, o), r = t.closestPointToPoint(n, !0, new e.Vector3()), d = n.distanceTo(r);
1751
+ let t = new e.Line3(i, l), n = L(a, o), r = t.closestPointToPoint(n, !0, new e.Vector3()), d = n.distanceTo(r);
1732
1752
  if (Math.abs(s - u.overlap) < .1 && d < .04) {
1733
1753
  c = !0;
1734
1754
  break;
1735
1755
  }
1736
1756
  }
1737
1757
  }
1738
- c || r.push(t[f[n]].doorAndBeamData[i]);
1758
+ c || r.push(t[d[n]].doorAndBeamData[i]);
1739
1759
  }
1740
- r.length != t[f[n]].doorAndBeamData.length && (t[f[n]].doorAndBeamData = r);
1760
+ r.length != t[d[n]].doorAndBeamData.length && (t[d[n]].doorAndBeamData = r);
1741
1761
  }
1742
- let _ = .65, C = [], w = [];
1762
+ let h = .65, g = [], _ = [];
1743
1763
  for (let n = 0; n < c.length; n++) {
1744
1764
  if (c[n].isFind) continue;
1745
1765
  let i = new e.Vector3(c[n].doorStartPt.x, c[n].doorStartPt.y, 0), a = new e.Vector3(c[n].doorEndPt.x, c[n].doorEndPt.y, 0), o = new e.Vector3().subVectors(i, a).normalize();
1746
1766
  for (let s = 0; s < t.length; s++) {
1747
1767
  if (t[s].length < .7 || t[s].completePointAreaPercentage > 60) continue;
1748
- let u = new e.Vector3(t[s].start.x, t[s].start.y, 0), f = new e.Vector3(t[s].end.x, t[s].end.y, 0), p = new e.Vector3().subVectors(u, f).normalize(), m = .3, v = i.clone().addScaledVector(o, m), x = a.clone().addScaledVector(o.clone().negate(), m), T = u.clone().addScaledVector(p, m), E = f.clone().addScaledVector(p.clone().negate(), m);
1749
- d(v, x, T, E);
1750
- let D = y(v, x, T, E), O = i.distanceTo(u) > a.distanceTo(u) ? a : i, k = O.distanceTo(u), A = O.distanceTo(f);
1751
- if ((k < g || A < g) && D && !D.isParallel) {
1752
- let o = i.distanceTo(u) < i.distanceTo(f) ? u : f, p = !1;
1753
- for (let m = 0; m < t.length; m++) {
1754
- if (m == s || C.includes(m) || t[m].length < .7) continue;
1755
- let v = new e.Vector3(t[m].start.x, t[m].start.y, 0), x = new e.Vector3(t[m].end.x, t[m].end.y, 0), T = new e.Vector3().subVectors(v, x).normalize(), E = T.clone().negate(), D = v.clone().addScaledVector(T, 5), O = x.clone().addScaledVector(E, 5), k = b(u, f, v, x), A = S(u, f, v, x), j = d(u, f, D, O), M = !0;
1756
- if (j != null && (M = j.point.distanceTo(u) < g || j.point.distanceTo(f) < g), (k && k.angle > 85 || A && A.type == "collinear_gap") && M) {
1757
- let d = new e.Line3(u, f), g = new e.Vector3(), b = d.closestPointToPoint(v, !0, g), T = d.closestPointToPoint(x, !0, g), E = b.distanceTo(v), D = T.distanceTo(x), O, k;
1758
- if (E > D && D > _) O = x, k = T;
1759
- else if (E < D && E > _) O = v, k = b;
1768
+ let u = new e.Vector3(t[s].start.x, t[s].start.y, 0), d = new e.Vector3(t[s].end.x, t[s].end.y, 0), f = new e.Vector3().subVectors(u, d).normalize(), v = .3, y = i.clone().addScaledVector(o, v), b = a.clone().addScaledVector(o.clone().negate(), v), x = u.clone().addScaledVector(f, v), S = d.clone().addScaledVector(f.clone().negate(), v);
1769
+ D(y, b, x, S);
1770
+ let C = F(y, b, x, S), w = i.distanceTo(u) > a.distanceTo(u) ? a : i, T = w.distanceTo(u), E = w.distanceTo(d);
1771
+ if ((T < m || E < m) && C && !C.isParallel) {
1772
+ let o = i.distanceTo(u) < i.distanceTo(d) ? u : d, f = !1;
1773
+ for (let v = 0; v < t.length; v++) {
1774
+ if (v == s || g.includes(v) || t[v].length < .7) continue;
1775
+ let y = new e.Vector3(t[v].start.x, t[v].start.y, 0), b = new e.Vector3(t[v].end.x, t[v].end.y, 0), x = new e.Vector3().subVectors(y, b).normalize(), S = x.clone().negate(), C = y.clone().addScaledVector(x, 5), w = b.clone().addScaledVector(S, 5), T = I(u, d, y, b), E = R(u, d, y, b), O = D(u, d, C, w), k = !0;
1776
+ if (O != null && (k = O.point.distanceTo(u) < m || O.point.distanceTo(d) < m), (T && T.angle > 85 || E && E.type == "collinear_gap") && k) {
1777
+ let m = new e.Line3(u, d), x = new e.Vector3(), S = m.closestPointToPoint(y, !0, x), C = m.closestPointToPoint(b, !0, x), w = S.distanceTo(y), T = C.distanceTo(b), E, D;
1778
+ if (w > T && T > h) E = b, D = C;
1779
+ else if (w < T && w > h) E = y, D = S;
1760
1780
  else continue;
1761
- if (E = o.distanceTo(v), D = o.distanceTo(x), E > 2 && D > 2) continue;
1762
- let A = y(O, k, v, x);
1763
- if (!A || !A.isParallel) continue;
1764
- let j = S(i, a, O, k);
1765
- if (j && j.type == "collinear_overlap" && j.maxPerpendicularDistance < .2) continue;
1766
- O.z = k.z = t[m].start.z;
1767
- let M = !1;
1768
- for (let e = 0; e < w.length; e++) {
1769
- let t = S(w[e].start, w[e].end, O, k);
1781
+ if (w = o.distanceTo(y), T = o.distanceTo(b), w > 2 && T > 2) continue;
1782
+ let O = F(E, D, y, b);
1783
+ if (!O || !O.isParallel) continue;
1784
+ let k = R(i, a, E, D);
1785
+ if (k && k.type == "collinear_overlap" && k.maxPerpendicularDistance < .2) continue;
1786
+ E.z = D.z = t[v].start.z;
1787
+ let A = !1;
1788
+ for (let e = 0; e < _.length; e++) {
1789
+ let t = R(_[e].start, _[e].end, E, D);
1770
1790
  if (t && t.type == "collinear_overlap" && t.maxPerpendicularDistance < .2) {
1771
- M = !0;
1791
+ A = !0;
1772
1792
  break;
1773
1793
  }
1774
1794
  }
1775
- if (M) continue;
1795
+ if (A) continue;
1776
1796
  for (let n = 0; n < t.length; n++) {
1777
1797
  if (t[n].length < .5) continue;
1778
- let r = S(new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), O, k);
1798
+ let r = R(new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), E, D);
1779
1799
  if (r && r.type == "collinear_overlap" && r.maxPerpendicularDistance < .1) {
1780
- M = !0;
1800
+ A = !0;
1781
1801
  break;
1782
1802
  }
1783
1803
  }
1784
- if (M) continue;
1785
- w.push({
1786
- start: O,
1787
- end: k
1788
- }), C.push(m);
1789
- let N = t[m].rooftopPz - t[m].start.z, P = t[s].rooftopPz - t[s].start.z, F = N < P ? N : P;
1790
- t[m].doorAndBeamData || (t[m].doorAndBeamData = []), t[m].doorAndBeamData.push({
1804
+ if (A) continue;
1805
+ _.push({
1806
+ start: E,
1807
+ end: D
1808
+ }), g.push(v);
1809
+ let j = t[v].rooftopPz - t[v].start.z, M = t[s].rooftopPz - t[s].start.z, N = j < M ? j : M;
1810
+ t[v].doorAndBeamData || (t[v].doorAndBeamData = []), t[v].doorAndBeamData.push({
1791
1811
  id: l,
1792
- beamStart: O,
1793
- beamEnd: k,
1794
- beamHeight: F,
1795
- doorStart: O,
1796
- doorEnd: k,
1797
- doorHeight: F,
1812
+ beamStart: E,
1813
+ beamEnd: D,
1814
+ beamHeight: N,
1815
+ doorStart: E,
1816
+ doorEnd: D,
1817
+ doorHeight: N,
1798
1818
  nearId: -1,
1799
1819
  type: "onlyDoor",
1800
1820
  isDoor: !0
1801
- }), r[c[n].index].isFindBeam = !0, r[c[n].index].isFindOnlyDoor = !0, h.push([{
1821
+ }), r[c[n].index].isFindBeam = !0, r[c[n].index].isFindOnlyDoor = !0, p.push([{
1802
1822
  id: l,
1803
- beamStart: O,
1804
- beamEnd: k
1805
- }]), l++, p = !0;
1823
+ beamStart: E,
1824
+ beamEnd: D
1825
+ }]), l++, f = !0;
1806
1826
  break;
1807
1827
  }
1808
1828
  }
1809
- if (p) break;
1829
+ if (f) break;
1810
1830
  }
1811
1831
  }
1812
1832
  }
1813
1833
  return {
1814
1834
  lines: t,
1815
- beamGroup: h
1835
+ beamGroup: p
1816
1836
  };
1817
- }, W = (t, n) => {
1837
+ }, ve = (t, n) => {
1818
1838
  if (t.length <= 0) return t;
1819
1839
  for (let n of t) {
1820
1840
  let t = [];
@@ -1852,11 +1872,11 @@ var R = class {
1852
1872
  gridHeight: -1,
1853
1873
  centerPts: []
1854
1874
  });
1855
- let i = l.get(n), [o, s, f, p] = a[t], h = new e.Vector3().add(o).add(s).add(f).add(p).multiplyScalar(.25);
1856
- if (i.points.push(...a[t]), i.area += o.distanceTo(s) * o.distanceTo(p), i.originalVertices.push(a[t]), i.index = r, i.centerPts.push(h), u == -1 || d == -1) {
1875
+ let i = l.get(n), [o, s, f, p] = a[t], m = new e.Vector3().add(o).add(s).add(f).add(p).multiplyScalar(.25);
1876
+ if (i.points.push(...a[t]), i.area += o.distanceTo(s) * o.distanceTo(p), i.originalVertices.push(a[t]), i.index = r, i.centerPts.push(m), u == -1 || d == -1) {
1857
1877
  let t = new e.Vector3().subVectors(o, s).normalize();
1858
1878
  d = o.distanceTo(p), u = o.distanceTo(s);
1859
- let n = m(t, new e.Vector3(0, 0, 1));
1879
+ let n = A(t, new e.Vector3(0, 0, 1));
1860
1880
  n && n.parallel && ([d, u] = [u, d]);
1861
1881
  }
1862
1882
  i.gridWidth = u, i.gridHeight = d;
@@ -1887,7 +1907,7 @@ var R = class {
1887
1907
  size: .01
1888
1908
  });
1889
1909
  for (let r = 0; r < t.length; r++) {
1890
- let i = t[r], { minZ: o, maxZ: s } = D(i);
1910
+ let i = t[r], { minZ: o, maxZ: s } = re(i);
1891
1911
  if (o == null || s == null) continue;
1892
1912
  i.doorAndBeamData = [], i.completePointAreaPercentage = -1, s - o;
1893
1913
  let c = i.rooftopPz - i.start.z;
@@ -1895,17 +1915,17 @@ var R = class {
1895
1915
  let l = new e.Vector3(i.start.x, i.start.y, 0), u = new e.Vector3(i.end.x, i.end.y, 0);
1896
1916
  for (let i = 0; i < t.length; i++) {
1897
1917
  if (i == r || t[i].length < 1) continue;
1898
- let a = t[i], o = new e.Vector3(a.start.x, a.start.y, 0), c = new e.Vector3(a.end.x, a.end.y, 0), d = y(l, u, o, c), p = x(l, u), m = new e.Line3(o, c).closestPointToPoint(p, !0, new e.Vector3()), h = p.distanceTo(m), g = D(a);
1899
- if (!(g.minZ === void 0 || g.maxZ === void 0) && !(g.maxZ - g.minZ > 1) && d && d.isParallel && h < .25 && Math.abs(s - g.minZ) < .1) {
1900
- let a = x(l, u), s = x(o, c);
1918
+ let a = t[i], o = new e.Vector3(a.start.x, a.start.y, 0), c = new e.Vector3(a.end.x, a.end.y, 0), d = F(l, u, o, c), f = L(l, u), p = new e.Line3(o, c).closestPointToPoint(f, !0, new e.Vector3()), m = f.distanceTo(p), h = re(a);
1919
+ if (!(h.minZ === void 0 || h.maxZ === void 0) && !(h.maxZ - h.minZ > 1) && d && d.isParallel && m < .25 && Math.abs(s - h.minZ) < .1) {
1920
+ let a = L(l, u), s = L(o, c);
1901
1921
  a.z = s.z = 1, a.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), s.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
1902
- let d = `w:${t[r].originaIndex},b:${t[i].originaIndex}`, p = `b:${t[i].originaIndex},w:${t[r].originaIndex}`;
1903
- n.add(f(d, a, { textColor: "#fd0000" })), n.add(f(p, s, { textColor: "#fd0000" }));
1922
+ let d = `w:${t[r].originaIndex},b:${t[i].originaIndex}`, f = `b:${t[i].originaIndex},w:${t[r].originaIndex}`;
1923
+ n.add(O(d, a, { textColor: "#fd0000" })), n.add(O(f, s, { textColor: "#fd0000" }));
1904
1924
  }
1905
1925
  }
1906
1926
  }
1907
1927
  return t;
1908
- }, G = (t, n) => {
1928
+ }, ye = (t, n) => {
1909
1929
  let r = {
1910
1930
  rectangles: [],
1911
1931
  threeEdgeRect: []
@@ -1913,42 +1933,42 @@ var R = class {
1913
1933
  for (let n = 0; n < t.length; n++) {
1914
1934
  let c = t[n].length;
1915
1935
  if (i.has(n) || c < a || c > o) continue;
1916
- let l = [], u = new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), d = new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), f = new e.Vector3().subVectors(d, u).normalize().clone().negate(), p = new e.Vector3(), h = new e.Vector3(), g = new e.Vector3();
1936
+ let l = [], u = new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), d = new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), f = new e.Vector3().subVectors(d, u).normalize().clone().negate(), p = new e.Vector3(), m = new e.Vector3(), h = new e.Vector3();
1917
1937
  new e.Vector3();
1918
1938
  for (let r = 0; r < t.length; r++) {
1919
1939
  let i = t[r].length;
1920
1940
  if (r == n || i < a || i > o) continue;
1921
- let _ = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), v = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), y = b(u, d, _, v);
1922
- if (!y || y.angle < 85) continue;
1923
- let x = N(_, u), S = N(_, d), C = N(v, u), w = N(v, d);
1924
- if (!(!x && !S && !C && !w)) {
1925
- x || S ? (p = _.clone(), h = v.clone()) : (p = v.clone(), h = _.clone()), g = new e.Vector3().subVectors(h, p).normalize(), g.clone().negate();
1941
+ let g = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), _ = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), v = I(u, d, g, _);
1942
+ if (!v || v.angle < 85) continue;
1943
+ let y = V(g, u), b = V(g, d), x = V(_, u), S = V(_, d);
1944
+ if (!(!y && !b && !x && !S)) {
1945
+ y || b ? (p = g.clone(), m = _.clone()) : (p = _.clone(), m = g.clone()), h = new e.Vector3().subVectors(m, p).normalize(), h.clone().negate();
1926
1946
  for (let p = 0; p < t.length; p++) {
1927
- let g = t[p].length;
1928
- if (p == n || p == r || g < a || g > o) continue;
1929
- let y = new e.Vector3(t[p].start.x, t[p].start.y, t[p].start.z), x = new e.Vector3(t[p].end.x, t[p].end.y, t[p].end.z), S = b(_, v, y, x);
1930
- if (!S || S.angle < 85) continue;
1931
- let C = N(y, h), w = N(x, h);
1932
- if (!C && !w) continue;
1947
+ let h = t[p].length;
1948
+ if (p == n || p == r || h < a || h > o) continue;
1949
+ let v = new e.Vector3(t[p].start.x, t[p].start.y, t[p].start.z), y = new e.Vector3(t[p].end.x, t[p].end.y, t[p].end.z), b = I(g, _, v, y);
1950
+ if (!b || b.angle < 85) continue;
1951
+ let x = V(v, m), S = V(y, m);
1952
+ if (!x && !S) continue;
1933
1953
  new e.Vector3();
1934
- let T = new e.Vector3(), E = new e.Vector3();
1935
- C ? (E = new e.Vector3().subVectors(x, y).normalize(), y.clone(), T = x.clone()) : (E = new e.Vector3().subVectors(y, x).normalize(), x.clone(), T = y.clone());
1936
- let D = m(f, E, .1);
1937
- if (!(!D || !D.parallel || !D.sameDirection)) {
1954
+ let C = new e.Vector3(), w = new e.Vector3();
1955
+ x ? (w = new e.Vector3().subVectors(y, v).normalize(), v.clone(), C = y.clone()) : (w = new e.Vector3().subVectors(v, y).normalize(), y.clone(), C = v.clone());
1956
+ let T = A(f, w, .1);
1957
+ if (!(!T || !T.parallel || !T.sameDirection)) {
1938
1958
  for (let f = 0; f < t.length; f++) {
1939
1959
  let m = t[f].length;
1940
1960
  if (f == n || f == r || f == p || m < a || m > o) continue;
1941
- let h = new e.Vector3(t[f].start.x, t[f].start.y, t[f].start.z), g = new e.Vector3(t[f].end.x, t[f].end.y, t[f].end.z), _ = b(h, g, y, x);
1961
+ let h = new e.Vector3(t[f].start.x, t[f].start.y, t[f].start.z), g = new e.Vector3(t[f].end.x, t[f].end.y, t[f].end.z), _ = I(h, g, v, y);
1942
1962
  if (!_ || _.angle < 85) continue;
1943
- let v = N(h, T), S = N(g, T);
1944
- if (!v && !S) continue;
1963
+ let b = V(h, C), x = V(g, C);
1964
+ if (!b && !x) continue;
1945
1965
  new e.Vector3();
1946
- let C = new e.Vector3();
1947
- v ? (h.clone(), C = g.clone()) : (g.clone(), C = h.clone());
1948
- let w = N(C, u), E = N(C, d);
1949
- if (!w && !E) continue;
1950
- let D = c * i;
1951
- if (!(D < s || D > 2)) {
1966
+ let S = new e.Vector3();
1967
+ b ? (h.clone(), S = g.clone()) : (g.clone(), S = h.clone());
1968
+ let w = V(S, u), T = V(S, d);
1969
+ if (!w && !T) continue;
1970
+ let E = c * i;
1971
+ if (!(E < s || E > 2)) {
1952
1972
  l = [
1953
1973
  n,
1954
1974
  r,
@@ -1978,48 +1998,48 @@ var R = class {
1978
1998
  }, u = new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), d = new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), f = !0, p = !0;
1979
1999
  for (let r = 0; r < t.length; r++) {
1980
2000
  if (r == n) continue;
1981
- let i = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), a = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), o = N(i, u), s = N(a, u), c = N(i, d), l = N(a, d);
2001
+ let i = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), a = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), o = V(i, u), s = V(a, u), c = V(i, d), l = V(a, d);
1982
2002
  if (o || s ? f = !1 : (c || l) && (p = !1), !f && !p) break;
1983
2003
  }
1984
2004
  if (!f && !p) continue;
1985
- let h = new e.Vector3();
1986
- f || ([u, d] = [d, u]), h = new e.Vector3().subVectors(d, u).normalize();
1987
- let g = h.clone().negate();
2005
+ let m = new e.Vector3();
2006
+ f || ([u, d] = [d, u]), m = new e.Vector3().subVectors(d, u).normalize();
2007
+ let h = m.clone().negate();
1988
2008
  for (let r = 0; r < t.length; r++) {
1989
2009
  let f = t[r].length;
1990
2010
  if (r == n || i.has(r) || f < a || f > o) continue;
1991
- let p = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), h = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), _ = b(u, d, p, h);
1992
- if (!_ || _.angle < 85) continue;
1993
- let v = N(p, d), y = N(h, d);
1994
- if (!v && !y) continue;
2011
+ let p = new e.Vector3(t[r].start.x, t[r].start.y, t[r].start.z), m = new e.Vector3(t[r].end.x, t[r].end.y, t[r].end.z), g = I(u, d, p, m);
2012
+ if (!g || g.angle < 85) continue;
2013
+ let _ = V(p, d), v = V(m, d);
2014
+ if (!_ && !v) continue;
1995
2015
  new e.Vector3();
1996
- let x = new e.Vector3();
1997
- v ? (p.clone(), x = h.clone()) : (h.clone(), x = p.clone());
2016
+ let y = new e.Vector3();
2017
+ _ ? (p.clone(), y = m.clone()) : (m.clone(), y = p.clone());
1998
2018
  for (let d = 0; d < t.length; d++) {
1999
- let _ = t[d].length;
2000
- if (d == n || d == r || i.has(d) || _ < a || _ > o) continue;
2001
- let v = new e.Vector3(t[d].start.x, t[d].start.y, t[d].start.z), y = new e.Vector3(t[d].end.x, t[d].end.y, t[d].end.z), S = b(p, h, v, y);
2002
- if (!S || S.angle < 85) continue;
2003
- let C = N(v, x), w = N(y, x);
2004
- if (!C && !w) continue;
2005
- let T = new e.Vector3(), E = new e.Vector3();
2006
- C ? (T = v.clone(), E = y.clone()) : (T = y.clone(), E = v.clone());
2007
- let D = m(g, new e.Vector3().subVectors(E, T).normalize(), .1);
2008
- if (!D || !D.parallel || !D.sameDirection) continue;
2009
- let O = !0, k = !0;
2019
+ let g = t[d].length;
2020
+ if (d == n || d == r || i.has(d) || g < a || g > o) continue;
2021
+ let _ = new e.Vector3(t[d].start.x, t[d].start.y, t[d].start.z), v = new e.Vector3(t[d].end.x, t[d].end.y, t[d].end.z), b = I(p, m, _, v);
2022
+ if (!b || b.angle < 85) continue;
2023
+ let x = V(_, y), S = V(v, y);
2024
+ if (!x && !S) continue;
2025
+ let C = new e.Vector3(), w = new e.Vector3();
2026
+ x ? (C = _.clone(), w = v.clone()) : (C = v.clone(), w = _.clone());
2027
+ let T = A(h, new e.Vector3().subVectors(w, C).normalize(), .1);
2028
+ if (!T || !T.parallel || !T.sameDirection) continue;
2029
+ let E = !0, D = !0;
2010
2030
  for (let n = 0; n < t.length; n++) {
2011
2031
  if (n == d) continue;
2012
- let r = new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), i = new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), a = N(r, v), o = N(i, v), s = N(r, y), c = N(i, y);
2013
- if (a || o ? O = !1 : (s || c) && (k = !1), !O && !k) break;
2032
+ let r = new e.Vector3(t[n].start.x, t[n].start.y, t[n].start.z), i = new e.Vector3(t[n].end.x, t[n].end.y, t[n].end.z), a = V(r, _), o = V(i, _), s = V(r, v), c = V(i, v);
2033
+ if (a || o ? E = !1 : (s || c) && (D = !1), !E && !D) break;
2014
2034
  }
2015
- if (!O && !k) continue;
2016
- let A = c * f;
2017
- if (!(A < s || A > 2)) {
2035
+ if (!E && !D) continue;
2036
+ let O = c * f;
2037
+ if (!(O < s || O > 2)) {
2018
2038
  l.indexs = [
2019
2039
  n,
2020
2040
  r,
2021
2041
  d
2022
- ], l.missingEdge.start = E, l.missingEdge.end = u;
2042
+ ], l.missingEdge.start = w, l.missingEdge.end = u;
2023
2043
  break;
2024
2044
  }
2025
2045
  }
@@ -2028,6 +2048,2031 @@ var R = class {
2028
2048
  l.indexs.length == 3 && (l.indexs.forEach((e) => i.add(e)), r.threeEdgeRect.push(l));
2029
2049
  }
2030
2050
  return r;
2051
+ }, H = 11102230246251565e-32, U = 134217729, be = (3 + 8 * H) * H;
2052
+ function xe(e, t, n, r, i) {
2053
+ let a, o, s, c, l = t[0], u = r[0], d = 0, f = 0;
2054
+ u > l == u > -l ? (a = l, l = t[++d]) : (a = u, u = r[++f]);
2055
+ let p = 0;
2056
+ if (d < e && f < n) for (u > l == u > -l ? (o = l + a, s = a - (o - l), l = t[++d]) : (o = u + a, s = a - (o - u), u = r[++f]), a = o, s !== 0 && (i[p++] = s); d < e && f < n;) u > l == u > -l ? (o = a + l, c = o - a, s = a - (o - c) + (l - c), l = t[++d]) : (o = a + u, c = o - a, s = a - (o - c) + (u - c), u = r[++f]), a = o, s !== 0 && (i[p++] = s);
2057
+ for (; d < e;) o = a + l, c = o - a, s = a - (o - c) + (l - c), l = t[++d], a = o, s !== 0 && (i[p++] = s);
2058
+ for (; f < n;) o = a + u, c = o - a, s = a - (o - c) + (u - c), u = r[++f], a = o, s !== 0 && (i[p++] = s);
2059
+ return (a !== 0 || p === 0) && (i[p++] = a), p;
2060
+ }
2061
+ function Se(e, t) {
2062
+ let n = t[0];
2063
+ for (let r = 1; r < e; r++) n += t[r];
2064
+ return n;
2065
+ }
2066
+ function W(e) {
2067
+ return new Float64Array(e);
2068
+ }
2069
+ //#endregion
2070
+ //#region node_modules/robust-predicates/esm/orient2d.js
2071
+ var Ce = (3 + 16 * H) * H, we = (2 + 12 * H) * H, Te = (9 + 64 * H) * H * H, Ee = W(4), De = W(8), Oe = W(12), ke = W(16), G = W(4);
2072
+ function Ae(e, t, n, r, i, a, o) {
2073
+ let s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T = e - i, E = n - i, D = t - a, O = r - a;
2074
+ b = T * O, f = U * T, p = f - (f - T), m = T - p, f = U * O, h = f - (f - O), g = O - h, x = m * g - (b - p * h - m * h - p * g), S = D * E, f = U * D, p = f - (f - D), m = D - p, f = U * E, h = f - (f - E), g = E - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, Ee[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, Ee[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, Ee[2] = v - (w - d) + (_ - d), Ee[3] = w;
2075
+ let k = Se(4, Ee), A = we * o;
2076
+ if (k >= A || -k >= A || (d = e - T, s = e - (T + d) + (d - i), d = n - E, l = n - (E + d) + (d - i), d = t - D, c = t - (D + d) + (d - a), d = r - O, u = r - (O + d) + (d - a), s === 0 && c === 0 && l === 0 && u === 0) || (A = Te * o + be * Math.abs(k), k += T * u + O * s - (D * l + E * c), k >= A || -k >= A)) return k;
2077
+ b = s * O, f = U * s, p = f - (f - s), m = s - p, f = U * O, h = f - (f - O), g = O - h, x = m * g - (b - p * h - m * h - p * g), S = c * E, f = U * c, p = f - (f - c), m = c - p, f = U * E, h = f - (f - E), g = E - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, G[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, G[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, G[2] = v - (w - d) + (_ - d), G[3] = w;
2078
+ let j = xe(4, Ee, 4, G, De);
2079
+ b = T * u, f = U * T, p = f - (f - T), m = T - p, f = U * u, h = f - (f - u), g = u - h, x = m * g - (b - p * h - m * h - p * g), S = D * l, f = U * D, p = f - (f - D), m = D - p, f = U * l, h = f - (f - l), g = l - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, G[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, G[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, G[2] = v - (w - d) + (_ - d), G[3] = w;
2080
+ let M = xe(j, De, 4, G, Oe);
2081
+ return b = s * u, f = U * s, p = f - (f - s), m = s - p, f = U * u, h = f - (f - u), g = u - h, x = m * g - (b - p * h - m * h - p * g), S = c * l, f = U * c, p = f - (f - c), m = c - p, f = U * l, h = f - (f - l), g = l - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, G[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, G[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, G[2] = v - (w - d) + (_ - d), G[3] = w, ke[xe(M, Oe, 4, G, ke) - 1];
2082
+ }
2083
+ function je(e, t, n, r, i, a) {
2084
+ let o = (t - a) * (n - i), s = (e - i) * (r - a), c = o - s, l = Math.abs(o + s);
2085
+ return Math.abs(c) >= Ce * l ? c : -Ae(e, t, n, r, i, a, l);
2086
+ }
2087
+ (7 + 56 * H) * H, (3 + 28 * H) * H, (26 + 288 * H) * H * H, W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(8), W(8), W(8), W(4), W(8), W(8), W(16), W(12), W(192), W(192), (10 + 96 * H) * H, (4 + 48 * H) * H, (44 + 576 * H) * H * H, W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(8), W(8), W(8), W(8), W(8), W(8), W(8), W(8), W(8), W(4), W(4), W(4), W(8), W(16), W(16), W(16), W(32), W(32), W(48), W(64), W(1152), W(1152), (16 + 224 * H) * H, (5 + 72 * H) * H, (71 + 1408 * H) * H * H, W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(4), W(24), W(24), W(24), W(24), W(24), W(24), W(24), W(24), W(24), W(24), W(1152), W(1152), W(1152), W(1152), W(1152), W(2304), W(2304), W(3456), W(5760), W(8), W(8), W(8), W(16), W(24), W(48), W(48), W(96), W(192), W(384), W(384), W(384), W(768), W(96), W(96), W(96), W(1152);
2088
+ //#endregion
2089
+ //#region node_modules/delaunator/index.js
2090
+ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
2091
+ static from(t, n = He, r = Ue) {
2092
+ let i = t.length, a = new Float64Array(i * 2);
2093
+ for (let e = 0; e < i; e++) {
2094
+ let i = t[e];
2095
+ a[2 * e] = n(i), a[2 * e + 1] = r(i);
2096
+ }
2097
+ return new e(a);
2098
+ }
2099
+ constructor(e) {
2100
+ let t = e.length >> 1;
2101
+ if (t > 0 && typeof e[0] != "number") throw Error("Expected coords to contain numbers.");
2102
+ this.coords = e;
2103
+ let n = Math.max(2 * t - 5, 0);
2104
+ this._triangles = new Uint32Array(n * 3), this._halfedges = new Int32Array(n * 3), this._hashSize = Math.ceil(Math.sqrt(t)), this._hullPrev = new Uint32Array(t), this._hullNext = new Uint32Array(t), this._hullTri = new Uint32Array(t), this._hullHash = new Int32Array(this._hashSize), this._ids = new Uint32Array(t), this._dists = new Float64Array(t), this.trianglesLen = 0, this._cx = 0, this._cy = 0, this._hullStart = 0, this.hull = this._triangles, this.triangles = this._triangles, this.halfedges = this._halfedges, this.update();
2105
+ }
2106
+ update() {
2107
+ let { coords: e, _hullPrev: t, _hullNext: n, _hullTri: r, _hullHash: i } = this, a = e.length >> 1, o = Infinity, s = Infinity, c = -Infinity, l = -Infinity;
2108
+ for (let t = 0; t < a; t++) {
2109
+ let n = e[2 * t], r = e[2 * t + 1];
2110
+ n < o && (o = n), r < s && (s = r), n > c && (c = n), r > l && (l = r), this._ids[t] = t;
2111
+ }
2112
+ let u = (o + c) / 2, d = (s + l) / 2, f = 0, p = 0, m = 0;
2113
+ for (let t = 0, n = Infinity; t < a; t++) {
2114
+ let r = Ie(u, d, e[2 * t], e[2 * t + 1]);
2115
+ r < n && (f = t, n = r);
2116
+ }
2117
+ let h = e[2 * f], g = e[2 * f + 1];
2118
+ for (let t = 0, n = Infinity; t < a; t++) {
2119
+ if (t === f) continue;
2120
+ let r = Ie(h, g, e[2 * t], e[2 * t + 1]);
2121
+ r < n && r > 0 && (p = t, n = r);
2122
+ }
2123
+ let _ = e[2 * p], v = e[2 * p + 1], y = Infinity;
2124
+ for (let t = 0; t < a; t++) {
2125
+ if (t === f || t === p) continue;
2126
+ let n = Re(h, g, _, v, e[2 * t], e[2 * t + 1]);
2127
+ n < y && (m = t, y = n);
2128
+ }
2129
+ let b = e[2 * m], x = e[2 * m + 1];
2130
+ if (y === Infinity) {
2131
+ for (let t = 0; t < a; t++) this._dists[t] = e[2 * t] - e[0] || e[2 * t + 1] - e[1];
2132
+ Be(this._ids, this._dists, 0, a - 1);
2133
+ let t = new Uint32Array(a), n = 0;
2134
+ for (let e = 0, r = -Infinity; e < a; e++) {
2135
+ let i = this._ids[e], a = this._dists[i];
2136
+ a > r && (t[n++] = i, r = a);
2137
+ }
2138
+ this.hull = t.subarray(0, n), this.triangles = new Uint32Array(), this.halfedges = new Int32Array();
2139
+ return;
2140
+ }
2141
+ if (je(h, g, _, v, b, x) < 0) {
2142
+ let e = p, t = _, n = v;
2143
+ p = m, _ = b, v = x, m = e, b = t, x = n;
2144
+ }
2145
+ let S = ze(h, g, _, v, b, x);
2146
+ this._cx = S.x, this._cy = S.y;
2147
+ for (let t = 0; t < a; t++) this._dists[t] = Ie(e[2 * t], e[2 * t + 1], S.x, S.y);
2148
+ Be(this._ids, this._dists, 0, a - 1), this._hullStart = f;
2149
+ let C = 3;
2150
+ n[f] = t[m] = p, n[p] = t[f] = m, n[m] = t[p] = f, r[f] = 0, r[p] = 1, r[m] = 2, i.fill(-1), i[this._hashKey(h, g)] = f, i[this._hashKey(_, v)] = p, i[this._hashKey(b, x)] = m, this.trianglesLen = 0, this._addTriangle(f, p, m, -1, -1, -1);
2151
+ for (let a = 0, o = 0, s = 0; a < this._ids.length; a++) {
2152
+ let c = this._ids[a], l = e[2 * c], u = e[2 * c + 1];
2153
+ if (a > 0 && Math.abs(l - o) <= Me && Math.abs(u - s) <= Me || (o = l, s = u, c === f || c === p || c === m)) continue;
2154
+ let d = 0;
2155
+ for (let e = 0, t = this._hashKey(l, u); e < this._hashSize && (d = i[(t + e) % this._hashSize], !(d !== -1 && d !== n[d])); e++);
2156
+ d = t[d];
2157
+ let h = d, g;
2158
+ for (; g = n[h], je(l, u, e[2 * h], e[2 * h + 1], e[2 * g], e[2 * g + 1]) >= 0;) if (h = g, h === d) {
2159
+ h = -1;
2160
+ break;
2161
+ }
2162
+ if (h === -1) continue;
2163
+ let _ = this._addTriangle(h, c, n[h], -1, -1, r[h]);
2164
+ r[c] = this._legalize(_ + 2), r[h] = _, C++;
2165
+ let v = n[h];
2166
+ for (; g = n[v], je(l, u, e[2 * v], e[2 * v + 1], e[2 * g], e[2 * g + 1]) < 0;) _ = this._addTriangle(v, c, g, r[c], -1, r[v]), r[c] = this._legalize(_ + 2), n[v] = v, C--, v = g;
2167
+ if (h === d) for (; g = t[h], je(l, u, e[2 * g], e[2 * g + 1], e[2 * h], e[2 * h + 1]) < 0;) _ = this._addTriangle(g, c, h, -1, r[h], r[g]), this._legalize(_ + 2), r[g] = _, n[h] = h, C--, h = g;
2168
+ this._hullStart = t[c] = h, n[h] = t[v] = c, n[c] = v, i[this._hashKey(l, u)] = c, i[this._hashKey(e[2 * h], e[2 * h + 1])] = h;
2169
+ }
2170
+ this.hull = new Uint32Array(C);
2171
+ for (let e = 0, t = this._hullStart; e < C; e++) this.hull[e] = t, t = n[t];
2172
+ this.triangles = this._triangles.subarray(0, this.trianglesLen), this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
2173
+ }
2174
+ _hashKey(e, t) {
2175
+ return Math.floor(Fe(e - this._cx, t - this._cy) * this._hashSize) % this._hashSize;
2176
+ }
2177
+ _legalize(e) {
2178
+ let { _triangles: t, _halfedges: n, coords: r } = this, i = 0, a = 0;
2179
+ for (;;) {
2180
+ let o = n[e], s = e - e % 3;
2181
+ if (a = s + (e + 2) % 3, o === -1) {
2182
+ if (i === 0) break;
2183
+ e = Ne[--i];
2184
+ continue;
2185
+ }
2186
+ let c = o - o % 3, l = s + (e + 1) % 3, u = c + (o + 2) % 3, d = t[a], f = t[e], p = t[l], m = t[u];
2187
+ if (Le(r[2 * d], r[2 * d + 1], r[2 * f], r[2 * f + 1], r[2 * p], r[2 * p + 1], r[2 * m], r[2 * m + 1])) {
2188
+ t[e] = m, t[o] = d;
2189
+ let r = n[u];
2190
+ if (r === -1) {
2191
+ let t = this._hullStart;
2192
+ do {
2193
+ if (this._hullTri[t] === u) {
2194
+ this._hullTri[t] = e;
2195
+ break;
2196
+ }
2197
+ t = this._hullPrev[t];
2198
+ } while (t !== this._hullStart);
2199
+ }
2200
+ this._link(e, r), this._link(o, n[a]), this._link(a, u);
2201
+ let s = c + (o + 1) % 3;
2202
+ i < Ne.length && (Ne[i++] = s);
2203
+ } else {
2204
+ if (i === 0) break;
2205
+ e = Ne[--i];
2206
+ }
2207
+ }
2208
+ return a;
2209
+ }
2210
+ _link(e, t) {
2211
+ this._halfedges[e] = t, t !== -1 && (this._halfedges[t] = e);
2212
+ }
2213
+ _addTriangle(e, t, n, r, i, a) {
2214
+ let o = this.trianglesLen;
2215
+ return this._triangles[o] = e, this._triangles[o + 1] = t, this._triangles[o + 2] = n, this._link(o, r), this._link(o + 1, i), this._link(o + 2, a), this.trianglesLen += 3, o;
2216
+ }
2217
+ };
2218
+ function Fe(e, t) {
2219
+ let n = e / (Math.abs(e) + Math.abs(t));
2220
+ return (t > 0 ? 3 - n : 1 + n) / 4;
2221
+ }
2222
+ function Ie(e, t, n, r) {
2223
+ let i = e - n, a = t - r;
2224
+ return i * i + a * a;
2225
+ }
2226
+ function Le(e, t, n, r, i, a, o, s) {
2227
+ let c = e - o, l = t - s, u = n - o, d = r - s, f = i - o, p = a - s, m = c * c + l * l, h = u * u + d * d, g = f * f + p * p;
2228
+ return c * (d * g - h * p) - l * (u * g - h * f) + m * (u * p - d * f) < 0;
2229
+ }
2230
+ function Re(e, t, n, r, i, a) {
2231
+ let o = n - e, s = r - t, c = i - e, l = a - t, u = o * o + s * s, d = c * c + l * l, f = .5 / (o * l - s * c), p = (l * u - s * d) * f, m = (o * d - c * u) * f;
2232
+ return p * p + m * m;
2233
+ }
2234
+ function ze(e, t, n, r, i, a) {
2235
+ let o = n - e, s = r - t, c = i - e, l = a - t, u = o * o + s * s, d = c * c + l * l, f = .5 / (o * l - s * c);
2236
+ return {
2237
+ x: e + (l * u - s * d) * f,
2238
+ y: t + (o * d - c * u) * f
2239
+ };
2240
+ }
2241
+ function Be(e, t, n, r) {
2242
+ if (r - n <= 20) for (let i = n + 1; i <= r; i++) {
2243
+ let r = e[i], a = t[r], o = i - 1;
2244
+ for (; o >= n && t[e[o]] > a;) e[o + 1] = e[o--];
2245
+ e[o + 1] = r;
2246
+ }
2247
+ else {
2248
+ let i = n + r >> 1, a = n + 1, o = r;
2249
+ Ve(e, i, a), t[e[n]] > t[e[r]] && Ve(e, n, r), t[e[a]] > t[e[r]] && Ve(e, a, r), t[e[n]] > t[e[a]] && Ve(e, n, a);
2250
+ let s = e[a], c = t[s];
2251
+ for (;;) {
2252
+ do
2253
+ a++;
2254
+ while (t[e[a]] < c);
2255
+ do
2256
+ o--;
2257
+ while (t[e[o]] > c);
2258
+ if (o < a) break;
2259
+ Ve(e, a, o);
2260
+ }
2261
+ e[n + 1] = e[o], e[o] = s, r - a + 1 >= o - n ? (Be(e, t, a, r), Be(e, t, n, o - 1)) : (Be(e, t, n, o - 1), Be(e, t, a, r));
2262
+ }
2263
+ }
2264
+ function Ve(e, t, n) {
2265
+ let r = e[t];
2266
+ e[t] = e[n], e[n] = r;
2267
+ }
2268
+ function He(e) {
2269
+ return e[0];
2270
+ }
2271
+ function Ue(e) {
2272
+ return e[1];
2273
+ }
2274
+ //#endregion
2275
+ //#region node_modules/d3-delaunay/src/path.js
2276
+ var We = 1e-6, Ge = class {
2277
+ constructor() {
2278
+ this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
2279
+ }
2280
+ moveTo(e, t) {
2281
+ this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}`;
2282
+ }
2283
+ closePath() {
2284
+ this._x1 !== null && (this._x1 = this._x0, this._y1 = this._y0, this._ += "Z");
2285
+ }
2286
+ lineTo(e, t) {
2287
+ this._ += `L${this._x1 = +e},${this._y1 = +t}`;
2288
+ }
2289
+ arc(e, t, n) {
2290
+ e = +e, t = +t, n = +n;
2291
+ let r = e + n, i = t;
2292
+ if (n < 0) throw Error("negative radius");
2293
+ this._x1 === null ? this._ += `M${r},${i}` : (Math.abs(this._x1 - r) > We || Math.abs(this._y1 - i) > We) && (this._ += "L" + r + "," + i), n && (this._ += `A${n},${n},0,1,1,${e - n},${t}A${n},${n},0,1,1,${this._x1 = r},${this._y1 = i}`);
2294
+ }
2295
+ rect(e, t, n, r) {
2296
+ this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${+n}v${+r}h${-n}Z`;
2297
+ }
2298
+ value() {
2299
+ return this._ || null;
2300
+ }
2301
+ }, Ke = class {
2302
+ constructor() {
2303
+ this._ = [];
2304
+ }
2305
+ moveTo(e, t) {
2306
+ this._.push([e, t]);
2307
+ }
2308
+ closePath() {
2309
+ this._.push(this._[0].slice());
2310
+ }
2311
+ lineTo(e, t) {
2312
+ this._.push([e, t]);
2313
+ }
2314
+ value() {
2315
+ return this._.length ? this._ : null;
2316
+ }
2317
+ }, qe = class {
2318
+ constructor(e, [t, n, r, i] = [
2319
+ 0,
2320
+ 0,
2321
+ 960,
2322
+ 500
2323
+ ]) {
2324
+ if (!((r = +r) >= (t = +t)) || !((i = +i) >= (n = +n))) throw Error("invalid bounds");
2325
+ this.delaunay = e, this._circumcenters = new Float64Array(e.points.length * 2), this.vectors = new Float64Array(e.points.length * 2), this.xmax = r, this.xmin = t, this.ymax = i, this.ymin = n, this._init();
2326
+ }
2327
+ update() {
2328
+ return this.delaunay.update(), this._init(), this;
2329
+ }
2330
+ _init() {
2331
+ let { delaunay: { points: e, hull: t, triangles: n }, vectors: r } = this, i, a, o = this.circumcenters = this._circumcenters.subarray(0, n.length / 3 * 2);
2332
+ for (let r = 0, s = 0, c = n.length, l, u; r < c; r += 3, s += 2) {
2333
+ let c = n[r] * 2, d = n[r + 1] * 2, f = n[r + 2] * 2, p = e[c], m = e[c + 1], h = e[d], g = e[d + 1], _ = e[f], v = e[f + 1], y = h - p, b = g - m, x = _ - p, S = v - m, C = (y * S - b * x) * 2;
2334
+ if (Math.abs(C) < 1e-9) {
2335
+ if (i === void 0) {
2336
+ i = a = 0;
2337
+ for (let n of t) i += e[n * 2], a += e[n * 2 + 1];
2338
+ i /= t.length, a /= t.length;
2339
+ }
2340
+ let n = 1e9 * Math.sign((i - p) * S - (a - m) * x);
2341
+ l = (p + _) / 2 - n * S, u = (m + v) / 2 + n * x;
2342
+ } else {
2343
+ let e = 1 / C, t = y * y + b * b, n = x * x + S * S;
2344
+ l = p + (S * t - b * n) * e, u = m + (y * n - x * t) * e;
2345
+ }
2346
+ o[s] = l, o[s + 1] = u;
2347
+ }
2348
+ let s = t[t.length - 1], c, l = s * 4, u, d = e[2 * s], f, p = e[2 * s + 1];
2349
+ r.fill(0);
2350
+ for (let n = 0; n < t.length; ++n) s = t[n], c = l, u = d, f = p, l = s * 4, d = e[2 * s], p = e[2 * s + 1], r[c + 2] = r[l] = f - p, r[c + 3] = r[l + 1] = d - u;
2351
+ }
2352
+ render(e) {
2353
+ let t = e == null ? e = new Ge() : void 0, { delaunay: { halfedges: n, inedges: r, hull: i }, circumcenters: a, vectors: o } = this;
2354
+ if (i.length <= 1) return null;
2355
+ for (let t = 0, r = n.length; t < r; ++t) {
2356
+ let r = n[t];
2357
+ if (r < t) continue;
2358
+ let i = Math.floor(t / 3) * 2, o = Math.floor(r / 3) * 2, s = a[i], c = a[i + 1], l = a[o], u = a[o + 1];
2359
+ this._renderSegment(s, c, l, u, e);
2360
+ }
2361
+ let s, c = i[i.length - 1];
2362
+ for (let t = 0; t < i.length; ++t) {
2363
+ s = c, c = i[t];
2364
+ let n = Math.floor(r[c] / 3) * 2, l = a[n], u = a[n + 1], d = s * 4, f = this._project(l, u, o[d + 2], o[d + 3]);
2365
+ f && this._renderSegment(l, u, f[0], f[1], e);
2366
+ }
2367
+ return t && t.value();
2368
+ }
2369
+ renderBounds(e) {
2370
+ let t = e == null ? e = new Ge() : void 0;
2371
+ return e.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin), t && t.value();
2372
+ }
2373
+ renderCell(e, t) {
2374
+ let n = t == null ? t = new Ge() : void 0, r = this._clip(e);
2375
+ if (r === null || !r.length) return;
2376
+ t.moveTo(r[0], r[1]);
2377
+ let i = r.length;
2378
+ for (; r[0] === r[i - 2] && r[1] === r[i - 1] && i > 1;) i -= 2;
2379
+ for (let e = 2; e < i; e += 2) (r[e] !== r[e - 2] || r[e + 1] !== r[e - 1]) && t.lineTo(r[e], r[e + 1]);
2380
+ return t.closePath(), n && n.value();
2381
+ }
2382
+ *cellPolygons() {
2383
+ let { delaunay: { points: e } } = this;
2384
+ for (let t = 0, n = e.length / 2; t < n; ++t) {
2385
+ let e = this.cellPolygon(t);
2386
+ e && (e.index = t, yield e);
2387
+ }
2388
+ }
2389
+ cellPolygon(e) {
2390
+ let t = new Ke();
2391
+ return this.renderCell(e, t), t.value();
2392
+ }
2393
+ _renderSegment(e, t, n, r, i) {
2394
+ let a, o = this._regioncode(e, t), s = this._regioncode(n, r);
2395
+ o === 0 && s === 0 ? (i.moveTo(e, t), i.lineTo(n, r)) : (a = this._clipSegment(e, t, n, r, o, s)) && (i.moveTo(a[0], a[1]), i.lineTo(a[2], a[3]));
2396
+ }
2397
+ contains(e, t, n) {
2398
+ return (t = +t, t !== t) || (n = +n, n !== n) ? !1 : this.delaunay._step(e, t, n) === e;
2399
+ }
2400
+ *neighbors(e) {
2401
+ let t = this._clip(e);
2402
+ if (t) for (let n of this.delaunay.neighbors(e)) {
2403
+ let e = this._clip(n);
2404
+ if (e) {
2405
+ loop: for (let r = 0, i = t.length; r < i; r += 2) for (let a = 0, o = e.length; a < o; a += 2) if (t[r] === e[a] && t[r + 1] === e[a + 1] && t[(r + 2) % i] === e[(a + o - 2) % o] && t[(r + 3) % i] === e[(a + o - 1) % o]) {
2406
+ yield n;
2407
+ break loop;
2408
+ }
2409
+ }
2410
+ }
2411
+ }
2412
+ _cell(e) {
2413
+ let { circumcenters: t, delaunay: { inedges: n, halfedges: r, triangles: i } } = this, a = n[e];
2414
+ if (a === -1) return null;
2415
+ let o = [], s = a;
2416
+ do {
2417
+ let n = Math.floor(s / 3);
2418
+ if (o.push(t[n * 2], t[n * 2 + 1]), s = s % 3 == 2 ? s - 2 : s + 1, i[s] !== e) break;
2419
+ s = r[s];
2420
+ } while (s !== a && s !== -1);
2421
+ return o;
2422
+ }
2423
+ _clip(e) {
2424
+ if (e === 0 && this.delaunay.hull.length === 1) return [
2425
+ this.xmax,
2426
+ this.ymin,
2427
+ this.xmax,
2428
+ this.ymax,
2429
+ this.xmin,
2430
+ this.ymax,
2431
+ this.xmin,
2432
+ this.ymin
2433
+ ];
2434
+ let t = this._cell(e);
2435
+ if (t === null) return null;
2436
+ let { vectors: n } = this, r = e * 4;
2437
+ return this._simplify(n[r] || n[r + 1] ? this._clipInfinite(e, t, n[r], n[r + 1], n[r + 2], n[r + 3]) : this._clipFinite(e, t));
2438
+ }
2439
+ _clipFinite(e, t) {
2440
+ let n = t.length, r = null, i, a, o = t[n - 2], s = t[n - 1], c, l = this._regioncode(o, s), u, d = 0;
2441
+ for (let f = 0; f < n; f += 2) if (i = o, a = s, o = t[f], s = t[f + 1], c = l, l = this._regioncode(o, s), c === 0 && l === 0) u = d, d = 0, r ? r.push(o, s) : r = [o, s];
2442
+ else {
2443
+ let t, n, f, p, m;
2444
+ if (c === 0) {
2445
+ if ((t = this._clipSegment(i, a, o, s, c, l)) === null) continue;
2446
+ [n, f, p, m] = t;
2447
+ } else {
2448
+ if ((t = this._clipSegment(o, s, i, a, l, c)) === null) continue;
2449
+ [p, m, n, f] = t, u = d, d = this._edgecode(n, f), u && d && this._edge(e, u, d, r, r.length), r ? r.push(n, f) : r = [n, f];
2450
+ }
2451
+ u = d, d = this._edgecode(p, m), u && d && this._edge(e, u, d, r, r.length), r ? r.push(p, m) : r = [p, m];
2452
+ }
2453
+ if (r) u = d, d = this._edgecode(r[0], r[1]), u && d && this._edge(e, u, d, r, r.length);
2454
+ else if (this.contains(e, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2)) return [
2455
+ this.xmax,
2456
+ this.ymin,
2457
+ this.xmax,
2458
+ this.ymax,
2459
+ this.xmin,
2460
+ this.ymax,
2461
+ this.xmin,
2462
+ this.ymin
2463
+ ];
2464
+ return r;
2465
+ }
2466
+ _clipSegment(e, t, n, r, i, a) {
2467
+ let o = i < a;
2468
+ for (o && ([e, t, n, r, i, a] = [
2469
+ n,
2470
+ r,
2471
+ e,
2472
+ t,
2473
+ a,
2474
+ i
2475
+ ]);;) {
2476
+ if (i === 0 && a === 0) return o ? [
2477
+ n,
2478
+ r,
2479
+ e,
2480
+ t
2481
+ ] : [
2482
+ e,
2483
+ t,
2484
+ n,
2485
+ r
2486
+ ];
2487
+ if (i & a) return null;
2488
+ let s, c, l = i || a;
2489
+ l & 8 ? (s = e + (n - e) * (this.ymax - t) / (r - t), c = this.ymax) : l & 4 ? (s = e + (n - e) * (this.ymin - t) / (r - t), c = this.ymin) : l & 2 ? (c = t + (r - t) * (this.xmax - e) / (n - e), s = this.xmax) : (c = t + (r - t) * (this.xmin - e) / (n - e), s = this.xmin), i ? (e = s, t = c, i = this._regioncode(e, t)) : (n = s, r = c, a = this._regioncode(n, r));
2490
+ }
2491
+ }
2492
+ _clipInfinite(e, t, n, r, i, a) {
2493
+ let o = Array.from(t), s;
2494
+ if ((s = this._project(o[0], o[1], n, r)) && o.unshift(s[0], s[1]), (s = this._project(o[o.length - 2], o[o.length - 1], i, a)) && o.push(s[0], s[1]), o = this._clipFinite(e, o)) for (let t = 0, n = o.length, r, i = this._edgecode(o[n - 2], o[n - 1]); t < n; t += 2) r = i, i = this._edgecode(o[t], o[t + 1]), r && i && (t = this._edge(e, r, i, o, t), n = o.length);
2495
+ else this.contains(e, (this.xmin + this.xmax) / 2, (this.ymin + this.ymax) / 2) && (o = [
2496
+ this.xmin,
2497
+ this.ymin,
2498
+ this.xmax,
2499
+ this.ymin,
2500
+ this.xmax,
2501
+ this.ymax,
2502
+ this.xmin,
2503
+ this.ymax
2504
+ ]);
2505
+ return o;
2506
+ }
2507
+ _edge(e, t, n, r, i) {
2508
+ for (; t !== n;) {
2509
+ let n, a;
2510
+ switch (t) {
2511
+ case 5:
2512
+ t = 4;
2513
+ continue;
2514
+ case 4:
2515
+ t = 6, n = this.xmax, a = this.ymin;
2516
+ break;
2517
+ case 6:
2518
+ t = 2;
2519
+ continue;
2520
+ case 2:
2521
+ t = 10, n = this.xmax, a = this.ymax;
2522
+ break;
2523
+ case 10:
2524
+ t = 8;
2525
+ continue;
2526
+ case 8:
2527
+ t = 9, n = this.xmin, a = this.ymax;
2528
+ break;
2529
+ case 9:
2530
+ t = 1;
2531
+ continue;
2532
+ case 1:
2533
+ t = 5, n = this.xmin, a = this.ymin;
2534
+ break;
2535
+ }
2536
+ (r[i] !== n || r[i + 1] !== a) && this.contains(e, n, a) && (r.splice(i, 0, n, a), i += 2);
2537
+ }
2538
+ return i;
2539
+ }
2540
+ _project(e, t, n, r) {
2541
+ let i = Infinity, a, o, s;
2542
+ if (r < 0) {
2543
+ if (t <= this.ymin) return null;
2544
+ (a = (this.ymin - t) / r) < i && (s = this.ymin, o = e + (i = a) * n);
2545
+ } else if (r > 0) {
2546
+ if (t >= this.ymax) return null;
2547
+ (a = (this.ymax - t) / r) < i && (s = this.ymax, o = e + (i = a) * n);
2548
+ }
2549
+ if (n > 0) {
2550
+ if (e >= this.xmax) return null;
2551
+ (a = (this.xmax - e) / n) < i && (o = this.xmax, s = t + (i = a) * r);
2552
+ } else if (n < 0) {
2553
+ if (e <= this.xmin) return null;
2554
+ (a = (this.xmin - e) / n) < i && (o = this.xmin, s = t + (i = a) * r);
2555
+ }
2556
+ return [o, s];
2557
+ }
2558
+ _edgecode(e, t) {
2559
+ return (e === this.xmin ? 1 : e === this.xmax ? 2 : 0) | (t === this.ymin ? 4 : t === this.ymax ? 8 : 0);
2560
+ }
2561
+ _regioncode(e, t) {
2562
+ return (e < this.xmin ? 1 : e > this.xmax ? 2 : 0) | (t < this.ymin ? 4 : t > this.ymax ? 8 : 0);
2563
+ }
2564
+ _simplify(e) {
2565
+ if (e && e.length > 4) {
2566
+ for (let t = 0; t < e.length; t += 2) {
2567
+ let n = (t + 2) % e.length, r = (t + 4) % e.length;
2568
+ (e[t] === e[n] && e[n] === e[r] || e[t + 1] === e[n + 1] && e[n + 1] === e[r + 1]) && (e.splice(n, 2), t -= 2);
2569
+ }
2570
+ e.length || (e = null);
2571
+ }
2572
+ return e;
2573
+ }
2574
+ }, Je = 2 * Math.PI, Ye = Math.pow;
2575
+ function Xe(e) {
2576
+ return e[0];
2577
+ }
2578
+ function Ze(e) {
2579
+ return e[1];
2580
+ }
2581
+ function Qe(e) {
2582
+ let { triangles: t, coords: n } = e;
2583
+ for (let e = 0; e < t.length; e += 3) {
2584
+ let r = 2 * t[e], i = 2 * t[e + 1], a = 2 * t[e + 2];
2585
+ if ((n[a] - n[r]) * (n[i + 1] - n[r + 1]) - (n[i] - n[r]) * (n[a + 1] - n[r + 1]) > 1e-10) return !1;
2586
+ }
2587
+ return !0;
2588
+ }
2589
+ function $e(e, t, n) {
2590
+ return [e + Math.sin(e + t) * n, t + Math.cos(e - t) * n];
2591
+ }
2592
+ var et = class e {
2593
+ static from(t, n = Xe, r = Ze, i) {
2594
+ return new e("length" in t ? tt(t, n, r, i) : Float64Array.from(nt(t, n, r, i)));
2595
+ }
2596
+ constructor(e) {
2597
+ this._delaunator = new Pe(e), this.inedges = new Int32Array(e.length / 2), this._hullIndex = new Int32Array(e.length / 2), this.points = this._delaunator.coords, this._init();
2598
+ }
2599
+ update() {
2600
+ return this._delaunator.update(), this._init(), this;
2601
+ }
2602
+ _init() {
2603
+ let e = this._delaunator, t = this.points;
2604
+ if (e.hull && e.hull.length > 2 && Qe(e)) {
2605
+ this.collinear = Int32Array.from({ length: t.length / 2 }, (e, t) => t).sort((e, n) => t[2 * e] - t[2 * n] || t[2 * e + 1] - t[2 * n + 1]);
2606
+ let e = this.collinear[0], n = this.collinear[this.collinear.length - 1], r = [
2607
+ t[2 * e],
2608
+ t[2 * e + 1],
2609
+ t[2 * n],
2610
+ t[2 * n + 1]
2611
+ ], i = 1e-8 * Math.hypot(r[3] - r[1], r[2] - r[0]);
2612
+ for (let e = 0, n = t.length / 2; e < n; ++e) {
2613
+ let n = $e(t[2 * e], t[2 * e + 1], i);
2614
+ t[2 * e] = n[0], t[2 * e + 1] = n[1];
2615
+ }
2616
+ this._delaunator = new Pe(t);
2617
+ } else delete this.collinear;
2618
+ let n = this.halfedges = this._delaunator.halfedges, r = this.hull = this._delaunator.hull, i = this.triangles = this._delaunator.triangles, a = this.inedges.fill(-1), o = this._hullIndex.fill(-1);
2619
+ for (let e = 0, t = n.length; e < t; ++e) {
2620
+ let t = i[e % 3 == 2 ? e - 2 : e + 1];
2621
+ (n[e] === -1 || a[t] === -1) && (a[t] = e);
2622
+ }
2623
+ for (let e = 0, t = r.length; e < t; ++e) o[r[e]] = e;
2624
+ r.length <= 2 && r.length > 0 && (this.triangles = new Int32Array(3).fill(-1), this.halfedges = new Int32Array(3).fill(-1), this.triangles[0] = r[0], a[r[0]] = 1, r.length === 2 && (a[r[1]] = 0, this.triangles[1] = r[1], this.triangles[2] = r[1]));
2625
+ }
2626
+ voronoi(e) {
2627
+ return new qe(this, e);
2628
+ }
2629
+ *neighbors(e) {
2630
+ let { inedges: t, hull: n, _hullIndex: r, halfedges: i, triangles: a, collinear: o } = this;
2631
+ if (o) {
2632
+ let t = o.indexOf(e);
2633
+ t > 0 && (yield o[t - 1]), t < o.length - 1 && (yield o[t + 1]);
2634
+ return;
2635
+ }
2636
+ let s = t[e];
2637
+ if (s === -1) return;
2638
+ let c = s, l = -1;
2639
+ do {
2640
+ if (yield l = a[c], c = c % 3 == 2 ? c - 2 : c + 1, a[c] !== e) return;
2641
+ if (c = i[c], c === -1) {
2642
+ let t = n[(r[e] + 1) % n.length];
2643
+ t !== l && (yield t);
2644
+ return;
2645
+ }
2646
+ } while (c !== s);
2647
+ }
2648
+ find(e, t, n = 0) {
2649
+ if ((e = +e, e !== e) || (t = +t, t !== t)) return -1;
2650
+ let r = n, i;
2651
+ for (; (i = this._step(n, e, t)) >= 0 && i !== n && i !== r;) n = i;
2652
+ return i;
2653
+ }
2654
+ _step(e, t, n) {
2655
+ let { inedges: r, hull: i, _hullIndex: a, halfedges: o, triangles: s, points: c } = this;
2656
+ if (r[e] === -1 || !c.length) return (e + 1) % (c.length >> 1);
2657
+ let l = e, u = Ye(t - c[e * 2], 2) + Ye(n - c[e * 2 + 1], 2), d = r[e], f = d;
2658
+ do {
2659
+ let r = s[f], d = Ye(t - c[r * 2], 2) + Ye(n - c[r * 2 + 1], 2);
2660
+ if (d < u && (u = d, l = r), f = f % 3 == 2 ? f - 2 : f + 1, s[f] !== e) break;
2661
+ if (f = o[f], f === -1) {
2662
+ if (f = i[(a[e] + 1) % i.length], f !== r && Ye(t - c[f * 2], 2) + Ye(n - c[f * 2 + 1], 2) < u) return f;
2663
+ break;
2664
+ }
2665
+ } while (f !== d);
2666
+ return l;
2667
+ }
2668
+ render(e) {
2669
+ let t = e == null ? e = new Ge() : void 0, { points: n, halfedges: r, triangles: i } = this;
2670
+ for (let t = 0, a = r.length; t < a; ++t) {
2671
+ let a = r[t];
2672
+ if (a < t) continue;
2673
+ let o = i[t] * 2, s = i[a] * 2;
2674
+ e.moveTo(n[o], n[o + 1]), e.lineTo(n[s], n[s + 1]);
2675
+ }
2676
+ return this.renderHull(e), t && t.value();
2677
+ }
2678
+ renderPoints(e, t) {
2679
+ t === void 0 && (!e || typeof e.moveTo != "function") && (t = e, e = null), t = t == null ? 2 : +t;
2680
+ let n = e == null ? e = new Ge() : void 0, { points: r } = this;
2681
+ for (let n = 0, i = r.length; n < i; n += 2) {
2682
+ let i = r[n], a = r[n + 1];
2683
+ e.moveTo(i + t, a), e.arc(i, a, t, 0, Je);
2684
+ }
2685
+ return n && n.value();
2686
+ }
2687
+ renderHull(e) {
2688
+ let t = e == null ? e = new Ge() : void 0, { hull: n, points: r } = this, i = n[0] * 2, a = n.length;
2689
+ e.moveTo(r[i], r[i + 1]);
2690
+ for (let t = 1; t < a; ++t) {
2691
+ let i = 2 * n[t];
2692
+ e.lineTo(r[i], r[i + 1]);
2693
+ }
2694
+ return e.closePath(), t && t.value();
2695
+ }
2696
+ hullPolygon() {
2697
+ let e = new Ke();
2698
+ return this.renderHull(e), e.value();
2699
+ }
2700
+ renderTriangle(e, t) {
2701
+ let n = t == null ? t = new Ge() : void 0, { points: r, triangles: i } = this, a = i[e *= 3] * 2, o = i[e + 1] * 2, s = i[e + 2] * 2;
2702
+ return t.moveTo(r[a], r[a + 1]), t.lineTo(r[o], r[o + 1]), t.lineTo(r[s], r[s + 1]), t.closePath(), n && n.value();
2703
+ }
2704
+ *trianglePolygons() {
2705
+ let { triangles: e } = this;
2706
+ for (let t = 0, n = e.length / 3; t < n; ++t) yield this.trianglePolygon(t);
2707
+ }
2708
+ trianglePolygon(e) {
2709
+ let t = new Ke();
2710
+ return this.renderTriangle(e, t), t.value();
2711
+ }
2712
+ };
2713
+ function tt(e, t, n, r) {
2714
+ let i = e.length, a = new Float64Array(i * 2);
2715
+ for (let o = 0; o < i; ++o) {
2716
+ let i = e[o];
2717
+ a[o * 2] = t.call(r, i, o, e), a[o * 2 + 1] = n.call(r, i, o, e);
2718
+ }
2719
+ return a;
2720
+ }
2721
+ function* nt(e, t, n, r) {
2722
+ let i = 0;
2723
+ for (let a of e) yield t.call(r, a, i, e), yield n.call(r, a, i, e), ++i;
2724
+ }
2725
+ //#endregion
2726
+ //#region src/utils/clusert.mjs
2727
+ function rt(e, t, n, r) {
2728
+ return 1 + (e[t][0] === 0 || e[n][0] === 0 || e[r][0] === 0 ? 1 : 0);
2729
+ }
2730
+ function it(e, t, n, r, i, a) {
2731
+ let o = Math.hypot(n - i, r - a), s = Math.hypot(e - i, t - a), c = Math.hypot(e - n, t - r), l = Math.abs((n - e) * (a - t) - (i - e) * (r - t)) / 2;
2732
+ return l === 0 ? Infinity : o * s * c / (4 * l);
2733
+ }
2734
+ function at(e) {
2735
+ if (!e || e.length < 3) return [];
2736
+ let t = /* @__PURE__ */ new Set(), n = [];
2737
+ for (let r of e) {
2738
+ let e = `${r[0]}_${r[1]}`;
2739
+ t.has(e) || (t.add(e), n.push(r));
2740
+ }
2741
+ if (n.length < 3) return [];
2742
+ let { triangles: r } = new et(Float64Array.from(n.flat()));
2743
+ if (!r.length) return [];
2744
+ let i = /* @__PURE__ */ new Map(), a = (e, t) => e < t ? `${e}_${t}` : `${t}_${e}`;
2745
+ for (let e = 0; e < r.length; e += 3) {
2746
+ let t = r[e], o = r[e + 1], s = r[e + 2], [c, l] = n[t], [u, d] = n[o], [f, p] = n[s];
2747
+ if (it(c, l, u, d, f, p) <= 1 / rt(n, t, o, s)) for (let [e, n] of [
2748
+ [t, o],
2749
+ [o, s],
2750
+ [s, t]
2751
+ ]) {
2752
+ let t = a(e, n);
2753
+ i.set(t, (i.get(t) || 0) + 1);
2754
+ }
2755
+ }
2756
+ let o = [];
2757
+ for (let [e, t] of i) t === 1 && o.push(e.split("_").map(Number));
2758
+ if (!o.length) return [];
2759
+ let s = /* @__PURE__ */ new Map();
2760
+ for (let [e, t] of o) (s.get(e) || s.set(e, []).get(e)).push(t), (s.get(t) || s.set(t, []).get(t)).push(e);
2761
+ let c = o[0][0], l = [], u = /* @__PURE__ */ new Set(), d = c, f = -1;
2762
+ do {
2763
+ l.push(n[d]), u.add(d);
2764
+ let e = s.get(d) || [], t = e.find((e) => e !== f && !u.has(e));
2765
+ if (t === void 0 && (t = e.find((e) => e !== f)), t === void 0) break;
2766
+ f = d, d = t;
2767
+ } while (d !== c && l.length <= o.length + 1);
2768
+ return l;
2769
+ }
2770
+ //#endregion
2771
+ //#region node_modules/three/examples/jsm/math/OBB.js
2772
+ var K = {
2773
+ c: null,
2774
+ u: [
2775
+ new d(),
2776
+ new d(),
2777
+ new d()
2778
+ ],
2779
+ e: []
2780
+ }, q = {
2781
+ c: null,
2782
+ u: [
2783
+ new d(),
2784
+ new d(),
2785
+ new d()
2786
+ ],
2787
+ e: []
2788
+ }, J = [
2789
+ [],
2790
+ [],
2791
+ []
2792
+ ], Y = [
2793
+ [],
2794
+ [],
2795
+ []
2796
+ ], X = [], ot = new d(), st = new d(), ct = new d(), Z = new d(), lt = new d(), ut = new d(), Q = new a(), dt = new t(), ft = new o(), pt = new o(), mt = new l(), ht = class {
2797
+ constructor(e = new d(), t = new d(), n = new a()) {
2798
+ this.center = e, this.halfSize = t, this.rotation = n;
2799
+ }
2800
+ set(e, t, n) {
2801
+ return this.center = e, this.halfSize = t, this.rotation = n, this;
2802
+ }
2803
+ copy(e) {
2804
+ return this.center.copy(e.center), this.halfSize.copy(e.halfSize), this.rotation.copy(e.rotation), this;
2805
+ }
2806
+ clone() {
2807
+ return new this.constructor().copy(this);
2808
+ }
2809
+ getSize(e) {
2810
+ return e.copy(this.halfSize).multiplyScalar(2);
2811
+ }
2812
+ clampPoint(e, t) {
2813
+ let n = this.halfSize;
2814
+ Z.subVectors(e, this.center), this.rotation.extractBasis(ot, st, ct), t.copy(this.center);
2815
+ let r = i.clamp(Z.dot(ot), -n.x, n.x);
2816
+ t.add(ot.multiplyScalar(r));
2817
+ let a = i.clamp(Z.dot(st), -n.y, n.y);
2818
+ t.add(st.multiplyScalar(a));
2819
+ let o = i.clamp(Z.dot(ct), -n.z, n.z);
2820
+ return t.add(ct.multiplyScalar(o)), t;
2821
+ }
2822
+ containsPoint(e) {
2823
+ return Z.subVectors(e, this.center), this.rotation.extractBasis(ot, st, ct), Math.abs(Z.dot(ot)) <= this.halfSize.x && Math.abs(Z.dot(st)) <= this.halfSize.y && Math.abs(Z.dot(ct)) <= this.halfSize.z;
2824
+ }
2825
+ intersectsBox3(e) {
2826
+ return this.intersectsOBB(gt.fromBox3(e));
2827
+ }
2828
+ intersectsSphere(e) {
2829
+ return this.clampPoint(e.center, ut), ut.distanceToSquared(e.center) <= e.radius * e.radius;
2830
+ }
2831
+ intersectsOBB(e, t = 2 ** -52) {
2832
+ K.c = this.center, K.e[0] = this.halfSize.x, K.e[1] = this.halfSize.y, K.e[2] = this.halfSize.z, this.rotation.extractBasis(K.u[0], K.u[1], K.u[2]), q.c = e.center, q.e[0] = e.halfSize.x, q.e[1] = e.halfSize.y, q.e[2] = e.halfSize.z, e.rotation.extractBasis(q.u[0], q.u[1], q.u[2]);
2833
+ for (let e = 0; e < 3; e++) for (let t = 0; t < 3; t++) J[e][t] = K.u[e].dot(q.u[t]);
2834
+ Z.subVectors(q.c, K.c), X[0] = Z.dot(K.u[0]), X[1] = Z.dot(K.u[1]), X[2] = Z.dot(K.u[2]);
2835
+ for (let e = 0; e < 3; e++) for (let n = 0; n < 3; n++) Y[e][n] = Math.abs(J[e][n]) + t;
2836
+ let n, r;
2837
+ for (let e = 0; e < 3; e++) if (n = K.e[e], r = q.e[0] * Y[e][0] + q.e[1] * Y[e][1] + q.e[2] * Y[e][2], Math.abs(X[e]) > n + r) return !1;
2838
+ for (let e = 0; e < 3; e++) if (n = K.e[0] * Y[0][e] + K.e[1] * Y[1][e] + K.e[2] * Y[2][e], r = q.e[e], Math.abs(X[0] * J[0][e] + X[1] * J[1][e] + X[2] * J[2][e]) > n + r) return !1;
2839
+ return n = K.e[1] * Y[2][0] + K.e[2] * Y[1][0], r = q.e[1] * Y[0][2] + q.e[2] * Y[0][1], !(Math.abs(X[2] * J[1][0] - X[1] * J[2][0]) > n + r || (n = K.e[1] * Y[2][1] + K.e[2] * Y[1][1], r = q.e[0] * Y[0][2] + q.e[2] * Y[0][0], Math.abs(X[2] * J[1][1] - X[1] * J[2][1]) > n + r) || (n = K.e[1] * Y[2][2] + K.e[2] * Y[1][2], r = q.e[0] * Y[0][1] + q.e[1] * Y[0][0], Math.abs(X[2] * J[1][2] - X[1] * J[2][2]) > n + r) || (n = K.e[0] * Y[2][0] + K.e[2] * Y[0][0], r = q.e[1] * Y[1][2] + q.e[2] * Y[1][1], Math.abs(X[0] * J[2][0] - X[2] * J[0][0]) > n + r) || (n = K.e[0] * Y[2][1] + K.e[2] * Y[0][1], r = q.e[0] * Y[1][2] + q.e[2] * Y[1][0], Math.abs(X[0] * J[2][1] - X[2] * J[0][1]) > n + r) || (n = K.e[0] * Y[2][2] + K.e[2] * Y[0][2], r = q.e[0] * Y[1][1] + q.e[1] * Y[1][0], Math.abs(X[0] * J[2][2] - X[2] * J[0][2]) > n + r) || (n = K.e[0] * Y[1][0] + K.e[1] * Y[0][0], r = q.e[1] * Y[2][2] + q.e[2] * Y[2][1], Math.abs(X[1] * J[0][0] - X[0] * J[1][0]) > n + r) || (n = K.e[0] * Y[1][1] + K.e[1] * Y[0][1], r = q.e[0] * Y[2][2] + q.e[2] * Y[2][0], Math.abs(X[1] * J[0][1] - X[0] * J[1][1]) > n + r) || (n = K.e[0] * Y[1][2] + K.e[1] * Y[0][2], r = q.e[0] * Y[2][1] + q.e[1] * Y[2][0], Math.abs(X[1] * J[0][2] - X[0] * J[1][2]) > n + r));
2840
+ }
2841
+ intersectsPlane(e) {
2842
+ this.rotation.extractBasis(ot, st, ct);
2843
+ let t = this.halfSize.x * Math.abs(e.normal.dot(ot)) + this.halfSize.y * Math.abs(e.normal.dot(st)) + this.halfSize.z * Math.abs(e.normal.dot(ct)), n = e.normal.dot(this.center) - e.constant;
2844
+ return Math.abs(n) <= t;
2845
+ }
2846
+ intersectRay(e, t) {
2847
+ return this.getSize(lt), dt.setFromCenterAndSize(Z.set(0, 0, 0), lt), ft.setFromMatrix3(this.rotation), ft.setPosition(this.center), pt.copy(ft).invert(), mt.copy(e).applyMatrix4(pt), mt.intersectBox(dt, t) ? t.applyMatrix4(ft) : null;
2848
+ }
2849
+ intersectsRay(e) {
2850
+ return this.intersectRay(e, Z) !== null;
2851
+ }
2852
+ fromBox3(e) {
2853
+ return e.getCenter(this.center), e.getSize(this.halfSize).multiplyScalar(.5), this.rotation.identity(), this;
2854
+ }
2855
+ equals(e) {
2856
+ return e.center.equals(this.center) && e.halfSize.equals(this.halfSize) && e.rotation.equals(this.rotation);
2857
+ }
2858
+ applyMatrix4(e) {
2859
+ let t = e.elements, n = Z.set(t[0], t[1], t[2]).length(), r = Z.set(t[4], t[5], t[6]).length(), i = Z.set(t[8], t[9], t[10]).length();
2860
+ e.determinant() < 0 && (n = -n), Q.setFromMatrix4(e);
2861
+ let a = 1 / n, o = 1 / r, s = 1 / i;
2862
+ return Q.elements[0] *= a, Q.elements[1] *= a, Q.elements[2] *= a, Q.elements[3] *= o, Q.elements[4] *= o, Q.elements[5] *= o, Q.elements[6] *= s, Q.elements[7] *= s, Q.elements[8] *= s, this.rotation.multiply(Q), this.halfSize.x *= n, this.halfSize.y *= r, this.halfSize.z *= i, Z.setFromMatrixPosition(e), this.center.add(Z), this;
2863
+ }
2864
+ }, gt = new ht(), $ = 6371008.8, _t = {
2865
+ centimeters: $ * 100,
2866
+ centimetres: $ * 100,
2867
+ degrees: 360 / (2 * Math.PI),
2868
+ feet: $ * 3.28084,
2869
+ inches: $ * 39.37,
2870
+ kilometers: $ / 1e3,
2871
+ kilometres: $ / 1e3,
2872
+ meters: $,
2873
+ metres: $,
2874
+ miles: $ / 1609.344,
2875
+ millimeters: $ * 1e3,
2876
+ millimetres: $ * 1e3,
2877
+ nauticalmiles: $ / 1852,
2878
+ radians: 1,
2879
+ yards: $ * 1.0936
2880
+ };
2881
+ function vt(e, t, n = {}) {
2882
+ let r = { type: "Feature" };
2883
+ return (n.id === 0 || n.id) && (r.id = n.id), n.bbox && (r.bbox = n.bbox), r.properties = t || {}, r.geometry = e, r;
2884
+ }
2885
+ function yt(e, t, n = {}) {
2886
+ if (!e) throw Error("coordinates is required");
2887
+ if (!Array.isArray(e)) throw Error("coordinates must be an Array");
2888
+ if (e.length < 2) throw Error("coordinates must be at least 2 numbers long");
2889
+ if (!Et(e[0]) || !Et(e[1])) throw Error("coordinates must contain numbers");
2890
+ return vt({
2891
+ type: "Point",
2892
+ coordinates: e
2893
+ }, t, n);
2894
+ }
2895
+ function bt(e, t, n = {}) {
2896
+ for (let t of e) {
2897
+ if (t.length < 4) throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");
2898
+ if (t[t.length - 1].length !== t[0].length) throw Error("First and last Position are not equivalent.");
2899
+ for (let e = 0; e < t[t.length - 1].length; e++) if (t[t.length - 1][e] !== t[0][e]) throw Error("First and last Position are not equivalent.");
2900
+ }
2901
+ return vt({
2902
+ type: "Polygon",
2903
+ coordinates: e
2904
+ }, t, n);
2905
+ }
2906
+ function xt(e, t = "kilometers") {
2907
+ let n = _t[t];
2908
+ if (!n) throw Error(t + " units is invalid");
2909
+ return e * n;
2910
+ }
2911
+ function St(e, t = "kilometers") {
2912
+ let n = _t[t];
2913
+ if (!n) throw Error(t + " units is invalid");
2914
+ return e / n;
2915
+ }
2916
+ function Ct(e) {
2917
+ return e % (2 * Math.PI) * 180 / Math.PI;
2918
+ }
2919
+ function wt(e) {
2920
+ return e % 360 * Math.PI / 180;
2921
+ }
2922
+ function Tt(e, t = "kilometers", n = "kilometers") {
2923
+ if (!(e >= 0)) throw Error("length must be a positive number");
2924
+ return xt(St(e, t), n);
2925
+ }
2926
+ function Et(e) {
2927
+ return !isNaN(e) && e !== null && !Array.isArray(e);
2928
+ }
2929
+ function Dt(e) {
2930
+ return typeof e == "object" && !!e && !Array.isArray(e);
2931
+ }
2932
+ //#endregion
2933
+ //#region node_modules/@turf/meta/dist/esm/index.js
2934
+ function Ot(e, t, n) {
2935
+ if (e !== null) for (var r, i, a, o, s, c, l, u = 0, d = 0, f, p = e.type, m = p === "FeatureCollection", h = p === "Feature", g = m ? e.features.length : 1, _ = 0; _ < g; _++) {
2936
+ l = m ? e.features[_].geometry : h ? e.geometry : e, f = l ? l.type === "GeometryCollection" : !1, s = f ? l.geometries.length : 1;
2937
+ for (var v = 0; v < s; v++) {
2938
+ var y = 0, b = 0;
2939
+ if (o = f ? l.geometries[v] : l, o !== null) {
2940
+ c = o.coordinates;
2941
+ var x = o.type;
2942
+ switch (u = n && (x === "Polygon" || x === "MultiPolygon") ? 1 : 0, x) {
2943
+ case null: break;
2944
+ case "Point":
2945
+ if (t(c, d, _, y, b) === !1) return !1;
2946
+ d++, y++;
2947
+ break;
2948
+ case "LineString":
2949
+ case "MultiPoint":
2950
+ for (r = 0; r < c.length; r++) {
2951
+ if (t(c[r], d, _, y, b) === !1) return !1;
2952
+ d++, x === "MultiPoint" && y++;
2953
+ }
2954
+ x === "LineString" && y++;
2955
+ break;
2956
+ case "Polygon":
2957
+ case "MultiLineString":
2958
+ for (r = 0; r < c.length; r++) {
2959
+ for (i = 0; i < c[r].length - u; i++) {
2960
+ if (t(c[r][i], d, _, y, b) === !1) return !1;
2961
+ d++;
2962
+ }
2963
+ x === "MultiLineString" && y++, x === "Polygon" && b++;
2964
+ }
2965
+ x === "Polygon" && y++;
2966
+ break;
2967
+ case "MultiPolygon":
2968
+ for (r = 0; r < c.length; r++) {
2969
+ for (b = 0, i = 0; i < c[r].length; i++) {
2970
+ for (a = 0; a < c[r][i].length - u; a++) {
2971
+ if (t(c[r][i][a], d, _, y, b) === !1) return !1;
2972
+ d++;
2973
+ }
2974
+ b++;
2975
+ }
2976
+ y++;
2977
+ }
2978
+ break;
2979
+ case "GeometryCollection":
2980
+ for (r = 0; r < o.geometries.length; r++) if (Ot(o.geometries[r], t, n) === !1) return !1;
2981
+ break;
2982
+ default: throw Error("Unknown Geometry Type");
2983
+ }
2984
+ }
2985
+ }
2986
+ }
2987
+ }
2988
+ function kt(e) {
2989
+ var t = [];
2990
+ return Ot(e, function(e) {
2991
+ t.push(e);
2992
+ }), t;
2993
+ }
2994
+ function At(e, t) {
2995
+ var n, r, i, a, o, s, c, l, u, d, f = 0, p = e.type === "FeatureCollection", m = e.type === "Feature", h = p ? e.features.length : 1;
2996
+ for (n = 0; n < h; n++) {
2997
+ for (s = p ? e.features[n].geometry : m ? e.geometry : e, l = p ? e.features[n].properties : m ? e.properties : {}, u = p ? e.features[n].bbox : m ? e.bbox : void 0, d = p ? e.features[n].id : m ? e.id : void 0, c = s ? s.type === "GeometryCollection" : !1, o = c ? s.geometries.length : 1, i = 0; i < o; i++) {
2998
+ if (a = c ? s.geometries[i] : s, a === null) {
2999
+ if (t(null, f, l, u, d) === !1) return !1;
3000
+ continue;
3001
+ }
3002
+ switch (a.type) {
3003
+ case "Point":
3004
+ case "LineString":
3005
+ case "MultiPoint":
3006
+ case "Polygon":
3007
+ case "MultiLineString":
3008
+ case "MultiPolygon":
3009
+ if (t(a, f, l, u, d) === !1) return !1;
3010
+ break;
3011
+ case "GeometryCollection":
3012
+ for (r = 0; r < a.geometries.length; r++) if (t(a.geometries[r], f, l, u, d) === !1) return !1;
3013
+ break;
3014
+ default: throw Error("Unknown Geometry Type");
3015
+ }
3016
+ }
3017
+ f++;
3018
+ }
3019
+ }
3020
+ function jt(e, t, n) {
3021
+ var r = n;
3022
+ return At(e, function(e, i, a, o, s) {
3023
+ r = i === 0 && n === void 0 ? e : t(r, e, i, a, o, s);
3024
+ }), r;
3025
+ }
3026
+ //#endregion
3027
+ //#region node_modules/rbush/rbush.min.js
3028
+ var Mt = /* @__PURE__ */ y(((e, t) => {
3029
+ (function(n, r) {
3030
+ typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n ||= self).RBush = r();
3031
+ })(e, function() {
3032
+ function e(e, r, i, a, o) {
3033
+ (function e(n, r, i, a, o) {
3034
+ for (; a > i;) {
3035
+ if (a - i > 600) {
3036
+ var s = a - i + 1, c = r - i + 1, l = Math.log(s), u = .5 * Math.exp(2 * l / 3), d = .5 * Math.sqrt(l * u * (s - u) / s) * (c - s / 2 < 0 ? -1 : 1);
3037
+ e(n, r, Math.max(i, Math.floor(r - c * u / s + d)), Math.min(a, Math.floor(r + (s - c) * u / s + d)), o);
3038
+ }
3039
+ var f = n[r], p = i, m = a;
3040
+ for (t(n, i, r), o(n[a], f) > 0 && t(n, i, a); p < m;) {
3041
+ for (t(n, p, m), p++, m--; o(n[p], f) < 0;) p++;
3042
+ for (; o(n[m], f) > 0;) m--;
3043
+ }
3044
+ o(n[i], f) === 0 ? t(n, i, m) : t(n, ++m, a), m <= r && (i = m + 1), r <= m && (a = m - 1);
3045
+ }
3046
+ })(e, r, i || 0, a || e.length - 1, o || n);
3047
+ }
3048
+ function t(e, t, n) {
3049
+ var r = e[t];
3050
+ e[t] = e[n], e[n] = r;
3051
+ }
3052
+ function n(e, t) {
3053
+ return e < t ? -1 : e > t ? 1 : 0;
3054
+ }
3055
+ var r = function(e) {
3056
+ e === void 0 && (e = 9), this._maxEntries = Math.max(4, e), this._minEntries = Math.max(2, Math.ceil(.4 * this._maxEntries)), this.clear();
3057
+ };
3058
+ function i(e, t, n) {
3059
+ if (!n) return t.indexOf(e);
3060
+ for (var r = 0; r < t.length; r++) if (n(e, t[r])) return r;
3061
+ return -1;
3062
+ }
3063
+ function a(e, t) {
3064
+ o(e, 0, e.children.length, t, e);
3065
+ }
3066
+ function o(e, t, n, r, i) {
3067
+ i ||= m(null), i.minX = Infinity, i.minY = Infinity, i.maxX = -Infinity, i.maxY = -Infinity;
3068
+ for (var a = t; a < n; a++) {
3069
+ var o = e.children[a];
3070
+ s(i, e.leaf ? r(o) : o);
3071
+ }
3072
+ return i;
3073
+ }
3074
+ function s(e, t) {
3075
+ return e.minX = Math.min(e.minX, t.minX), e.minY = Math.min(e.minY, t.minY), e.maxX = Math.max(e.maxX, t.maxX), e.maxY = Math.max(e.maxY, t.maxY), e;
3076
+ }
3077
+ function c(e, t) {
3078
+ return e.minX - t.minX;
3079
+ }
3080
+ function l(e, t) {
3081
+ return e.minY - t.minY;
3082
+ }
3083
+ function u(e) {
3084
+ return (e.maxX - e.minX) * (e.maxY - e.minY);
3085
+ }
3086
+ function d(e) {
3087
+ return e.maxX - e.minX + (e.maxY - e.minY);
3088
+ }
3089
+ function f(e, t) {
3090
+ return e.minX <= t.minX && e.minY <= t.minY && t.maxX <= e.maxX && t.maxY <= e.maxY;
3091
+ }
3092
+ function p(e, t) {
3093
+ return t.minX <= e.maxX && t.minY <= e.maxY && t.maxX >= e.minX && t.maxY >= e.minY;
3094
+ }
3095
+ function m(e) {
3096
+ return {
3097
+ children: e,
3098
+ height: 1,
3099
+ leaf: !0,
3100
+ minX: Infinity,
3101
+ minY: Infinity,
3102
+ maxX: -Infinity,
3103
+ maxY: -Infinity
3104
+ };
3105
+ }
3106
+ function h(t, n, r, i, a) {
3107
+ for (var o = [n, r]; o.length;) if (!((r = o.pop()) - (n = o.pop()) <= i)) {
3108
+ var s = n + Math.ceil((r - n) / i / 2) * i;
3109
+ e(t, s, n, r, a), o.push(n, s, s, r);
3110
+ }
3111
+ }
3112
+ return r.prototype.all = function() {
3113
+ return this._all(this.data, []);
3114
+ }, r.prototype.search = function(e) {
3115
+ var t = this.data, n = [];
3116
+ if (!p(e, t)) return n;
3117
+ for (var r = this.toBBox, i = []; t;) {
3118
+ for (var a = 0; a < t.children.length; a++) {
3119
+ var o = t.children[a], s = t.leaf ? r(o) : o;
3120
+ p(e, s) && (t.leaf ? n.push(o) : f(e, s) ? this._all(o, n) : i.push(o));
3121
+ }
3122
+ t = i.pop();
3123
+ }
3124
+ return n;
3125
+ }, r.prototype.collides = function(e) {
3126
+ var t = this.data;
3127
+ if (!p(e, t)) return !1;
3128
+ for (var n = []; t;) {
3129
+ for (var r = 0; r < t.children.length; r++) {
3130
+ var i = t.children[r], a = t.leaf ? this.toBBox(i) : i;
3131
+ if (p(e, a)) {
3132
+ if (t.leaf || f(e, a)) return !0;
3133
+ n.push(i);
3134
+ }
3135
+ }
3136
+ t = n.pop();
3137
+ }
3138
+ return !1;
3139
+ }, r.prototype.load = function(e) {
3140
+ if (!e || !e.length) return this;
3141
+ if (e.length < this._minEntries) {
3142
+ for (var t = 0; t < e.length; t++) this.insert(e[t]);
3143
+ return this;
3144
+ }
3145
+ var n = this._build(e.slice(), 0, e.length - 1, 0);
3146
+ if (this.data.children.length) if (this.data.height === n.height) this._splitRoot(this.data, n);
3147
+ else {
3148
+ if (this.data.height < n.height) {
3149
+ var r = this.data;
3150
+ this.data = n, n = r;
3151
+ }
3152
+ this._insert(n, this.data.height - n.height - 1, !0);
3153
+ }
3154
+ else this.data = n;
3155
+ return this;
3156
+ }, r.prototype.insert = function(e) {
3157
+ return e && this._insert(e, this.data.height - 1), this;
3158
+ }, r.prototype.clear = function() {
3159
+ return this.data = m([]), this;
3160
+ }, r.prototype.remove = function(e, t) {
3161
+ if (!e) return this;
3162
+ for (var n, r, a, o = this.data, s = this.toBBox(e), c = [], l = []; o || c.length;) {
3163
+ if (o || (o = c.pop(), r = c[c.length - 1], n = l.pop(), a = !0), o.leaf) {
3164
+ var u = i(e, o.children, t);
3165
+ if (u !== -1) return o.children.splice(u, 1), c.push(o), this._condense(c), this;
3166
+ }
3167
+ a || o.leaf || !f(o, s) ? r ? (n++, o = r.children[n], a = !1) : o = null : (c.push(o), l.push(n), n = 0, r = o, o = o.children[0]);
3168
+ }
3169
+ return this;
3170
+ }, r.prototype.toBBox = function(e) {
3171
+ return e;
3172
+ }, r.prototype.compareMinX = function(e, t) {
3173
+ return e.minX - t.minX;
3174
+ }, r.prototype.compareMinY = function(e, t) {
3175
+ return e.minY - t.minY;
3176
+ }, r.prototype.toJSON = function() {
3177
+ return this.data;
3178
+ }, r.prototype.fromJSON = function(e) {
3179
+ return this.data = e, this;
3180
+ }, r.prototype._all = function(e, t) {
3181
+ for (var n = []; e;) e.leaf ? t.push.apply(t, e.children) : n.push.apply(n, e.children), e = n.pop();
3182
+ return t;
3183
+ }, r.prototype._build = function(e, t, n, r) {
3184
+ var i, o = n - t + 1, s = this._maxEntries;
3185
+ if (o <= s) return a(i = m(e.slice(t, n + 1)), this.toBBox), i;
3186
+ r || (r = Math.ceil(Math.log(o) / Math.log(s)), s = Math.ceil(o / s ** (r - 1))), (i = m([])).leaf = !1, i.height = r;
3187
+ var c = Math.ceil(o / s), l = c * Math.ceil(Math.sqrt(s));
3188
+ h(e, t, n, l, this.compareMinX);
3189
+ for (var u = t; u <= n; u += l) {
3190
+ var d = Math.min(u + l - 1, n);
3191
+ h(e, u, d, c, this.compareMinY);
3192
+ for (var f = u; f <= d; f += c) {
3193
+ var p = Math.min(f + c - 1, d);
3194
+ i.children.push(this._build(e, f, p, r - 1));
3195
+ }
3196
+ }
3197
+ return a(i, this.toBBox), i;
3198
+ }, r.prototype._chooseSubtree = function(e, t, n, r) {
3199
+ for (; r.push(t), !t.leaf && r.length - 1 !== n;) {
3200
+ for (var i = Infinity, a = Infinity, o = void 0, s = 0; s < t.children.length; s++) {
3201
+ var c = t.children[s], l = u(c), d = (f = e, p = c, (Math.max(p.maxX, f.maxX) - Math.min(p.minX, f.minX)) * (Math.max(p.maxY, f.maxY) - Math.min(p.minY, f.minY)) - l);
3202
+ d < a ? (a = d, i = l < i ? l : i, o = c) : d === a && l < i && (i = l, o = c);
3203
+ }
3204
+ t = o || t.children[0];
3205
+ }
3206
+ var f, p;
3207
+ return t;
3208
+ }, r.prototype._insert = function(e, t, n) {
3209
+ var r = n ? e : this.toBBox(e), i = [], a = this._chooseSubtree(r, this.data, t, i);
3210
+ for (a.children.push(e), s(a, r); t >= 0 && i[t].children.length > this._maxEntries;) this._split(i, t), t--;
3211
+ this._adjustParentBBoxes(r, i, t);
3212
+ }, r.prototype._split = function(e, t) {
3213
+ var n = e[t], r = n.children.length, i = this._minEntries;
3214
+ this._chooseSplitAxis(n, i, r);
3215
+ var o = this._chooseSplitIndex(n, i, r), s = m(n.children.splice(o, n.children.length - o));
3216
+ s.height = n.height, s.leaf = n.leaf, a(n, this.toBBox), a(s, this.toBBox), t ? e[t - 1].children.push(s) : this._splitRoot(n, s);
3217
+ }, r.prototype._splitRoot = function(e, t) {
3218
+ this.data = m([e, t]), this.data.height = e.height + 1, this.data.leaf = !1, a(this.data, this.toBBox);
3219
+ }, r.prototype._chooseSplitIndex = function(e, t, n) {
3220
+ for (var r, i, a, s, c, l, d, f = Infinity, p = Infinity, m = t; m <= n - t; m++) {
3221
+ var h = o(e, 0, m, this.toBBox), g = o(e, m, n, this.toBBox), _ = (i = h, a = g, s = void 0, c = void 0, l = void 0, d = void 0, s = Math.max(i.minX, a.minX), c = Math.max(i.minY, a.minY), l = Math.min(i.maxX, a.maxX), d = Math.min(i.maxY, a.maxY), Math.max(0, l - s) * Math.max(0, d - c)), v = u(h) + u(g);
3222
+ _ < f ? (f = _, r = m, p = v < p ? v : p) : _ === f && v < p && (p = v, r = m);
3223
+ }
3224
+ return r || n - t;
3225
+ }, r.prototype._chooseSplitAxis = function(e, t, n) {
3226
+ var r = e.leaf ? this.compareMinX : c, i = e.leaf ? this.compareMinY : l;
3227
+ this._allDistMargin(e, t, n, r) < this._allDistMargin(e, t, n, i) && e.children.sort(r);
3228
+ }, r.prototype._allDistMargin = function(e, t, n, r) {
3229
+ e.children.sort(r);
3230
+ for (var i = this.toBBox, a = o(e, 0, t, i), c = o(e, n - t, n, i), l = d(a) + d(c), u = t; u < n - t; u++) {
3231
+ var f = e.children[u];
3232
+ s(a, e.leaf ? i(f) : f), l += d(a);
3233
+ }
3234
+ for (var p = n - t - 1; p >= t; p--) {
3235
+ var m = e.children[p];
3236
+ s(c, e.leaf ? i(m) : m), l += d(c);
3237
+ }
3238
+ return l;
3239
+ }, r.prototype._adjustParentBBoxes = function(e, t, n) {
3240
+ for (var r = n; r >= 0; r--) s(t[r], e);
3241
+ }, r.prototype._condense = function(e) {
3242
+ for (var t = e.length - 1, n = void 0; t >= 0; t--) e[t].children.length === 0 ? t > 0 ? (n = e[t - 1].children).splice(n.indexOf(e[t]), 1) : this.clear() : a(e[t], this.toBBox);
3243
+ }, r;
3244
+ });
3245
+ })), Nt = /* @__PURE__ */ b({ default: () => Ft });
3246
+ function Pt(e, t) {
3247
+ return e < t ? -1 : e > t ? 1 : 0;
3248
+ }
3249
+ var Ft, It = v((() => {
3250
+ Ft = class {
3251
+ constructor(e = [], t = Pt) {
3252
+ if (this.data = e, this.length = this.data.length, this.compare = t, this.length > 0) for (let e = (this.length >> 1) - 1; e >= 0; e--) this._down(e);
3253
+ }
3254
+ push(e) {
3255
+ this.data.push(e), this.length++, this._up(this.length - 1);
3256
+ }
3257
+ pop() {
3258
+ if (this.length === 0) return;
3259
+ let e = this.data[0], t = this.data.pop();
3260
+ return this.length--, this.length > 0 && (this.data[0] = t, this._down(0)), e;
3261
+ }
3262
+ peek() {
3263
+ return this.data[0];
3264
+ }
3265
+ _up(e) {
3266
+ let { data: t, compare: n } = this, r = t[e];
3267
+ for (; e > 0;) {
3268
+ let i = e - 1 >> 1, a = t[i];
3269
+ if (n(r, a) >= 0) break;
3270
+ t[e] = a, e = i;
3271
+ }
3272
+ t[e] = r;
3273
+ }
3274
+ _down(e) {
3275
+ let { data: t, compare: n } = this, r = this.length >> 1, i = t[e];
3276
+ for (; e < r;) {
3277
+ let r = (e << 1) + 1, a = t[r], o = r + 1;
3278
+ if (o < this.length && n(t[o], a) < 0 && (r = o, a = t[o]), n(a, i) >= 0) break;
3279
+ t[e] = a, e = r;
3280
+ }
3281
+ t[e] = i;
3282
+ }
3283
+ };
3284
+ })), Lt = /* @__PURE__ */ y(((e, t) => {
3285
+ t.exports = function(e, t, n, r) {
3286
+ var i = e[0], a = e[1], o = !1;
3287
+ n === void 0 && (n = 0), r === void 0 && (r = t.length);
3288
+ for (var s = (r - n) / 2, c = 0, l = s - 1; c < s; l = c++) {
3289
+ var u = t[n + c * 2 + 0], d = t[n + c * 2 + 1], f = t[n + l * 2 + 0], p = t[n + l * 2 + 1];
3290
+ d > a != p > a && i < (f - u) * (a - d) / (p - d) + u && (o = !o);
3291
+ }
3292
+ return o;
3293
+ };
3294
+ })), Rt = /* @__PURE__ */ y(((e, t) => {
3295
+ t.exports = function(e, t, n, r) {
3296
+ var i = e[0], a = e[1], o = !1;
3297
+ n === void 0 && (n = 0), r === void 0 && (r = t.length);
3298
+ for (var s = r - n, c = 0, l = s - 1; c < s; l = c++) {
3299
+ var u = t[c + n][0], d = t[c + n][1], f = t[l + n][0], p = t[l + n][1];
3300
+ d > a != p > a && i < (f - u) * (a - d) / (p - d) + u && (o = !o);
3301
+ }
3302
+ return o;
3303
+ };
3304
+ })), zt = /* @__PURE__ */ y(((e, t) => {
3305
+ var n = Lt(), r = Rt();
3306
+ t.exports = function(e, t, i, a) {
3307
+ return t.length > 0 && Array.isArray(t[0]) ? r(e, t, i, a) : n(e, t, i, a);
3308
+ }, t.exports.nested = r, t.exports.flat = n;
3309
+ })), Bt = /* @__PURE__ */ y(((e, t) => {
3310
+ (function(n, r) {
3311
+ typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r((n ||= self).predicates = {});
3312
+ })(e, function(e) {
3313
+ let t = 134217729;
3314
+ function n(e, t, n, r, i) {
3315
+ let a, o, s, c, l = t[0], u = r[0], d = 0, f = 0;
3316
+ u > l == u > -l ? (a = l, l = t[++d]) : (a = u, u = r[++f]);
3317
+ let p = 0;
3318
+ if (d < e && f < n) for (u > l == u > -l ? (s = a - ((o = l + a) - l), l = t[++d]) : (s = a - ((o = u + a) - u), u = r[++f]), a = o, s !== 0 && (i[p++] = s); d < e && f < n;) u > l == u > -l ? (s = a - ((o = a + l) - (c = o - a)) + (l - c), l = t[++d]) : (s = a - ((o = a + u) - (c = o - a)) + (u - c), u = r[++f]), a = o, s !== 0 && (i[p++] = s);
3319
+ for (; d < e;) s = a - ((o = a + l) - (c = o - a)) + (l - c), l = t[++d], a = o, s !== 0 && (i[p++] = s);
3320
+ for (; f < n;) s = a - ((o = a + u) - (c = o - a)) + (u - c), u = r[++f], a = o, s !== 0 && (i[p++] = s);
3321
+ return a === 0 && p !== 0 || (i[p++] = a), p;
3322
+ }
3323
+ function r(e) {
3324
+ return new Float64Array(e);
3325
+ }
3326
+ let i = r(4), a = r(8), o = r(12), s = r(16), c = r(4);
3327
+ e.orient2d = function(e, r, l, u, d, f) {
3328
+ let p = (r - f) * (l - d), m = (e - d) * (u - f), h = p - m;
3329
+ if (p === 0 || m === 0 || p > 0 != m > 0) return h;
3330
+ let g = Math.abs(p + m);
3331
+ return Math.abs(h) >= 33306690738754716e-32 * g ? h : -function(e, r, l, u, d, f, p) {
3332
+ let m, h, g, _, v, y, b, x, S, C, w, T, E, D, O, k, A, j, M = e - d, N = l - d, P = r - f, F = u - f;
3333
+ v = (O = (x = M - (b = (y = t * M) - (y - M))) * (C = F - (S = (y = t * F) - (y - F))) - ((D = M * F) - b * S - x * S - b * C)) - (w = O - (A = (x = P - (b = (y = t * P) - (y - P))) * (C = N - (S = (y = t * N) - (y - N))) - ((k = P * N) - b * S - x * S - b * C))), i[0] = O - (w + v) + (v - A), v = (E = D - ((T = D + w) - (v = T - D)) + (w - v)) - (w = E - k), i[1] = E - (w + v) + (v - k), v = (j = T + w) - T, i[2] = T - (j - v) + (w - v), i[3] = j;
3334
+ let I = function(e, t) {
3335
+ let n = t[0];
3336
+ for (let r = 1; r < e; r++) n += t[r];
3337
+ return n;
3338
+ }(4, i), L = 22204460492503146e-32 * p;
3339
+ if (I >= L || -I >= L || (m = e - (M + (v = e - M)) + (v - d), g = l - (N + (v = l - N)) + (v - d), h = r - (P + (v = r - P)) + (v - f), _ = u - (F + (v = u - F)) + (v - f), m === 0 && h === 0 && g === 0 && _ === 0) || (L = 11093356479670487e-47 * p + 33306690738754706e-32 * Math.abs(I), (I += M * _ + F * m - (P * g + N * h)) >= L || -I >= L)) return I;
3340
+ v = (O = (x = m - (b = (y = t * m) - (y - m))) * (C = F - (S = (y = t * F) - (y - F))) - ((D = m * F) - b * S - x * S - b * C)) - (w = O - (A = (x = h - (b = (y = t * h) - (y - h))) * (C = N - (S = (y = t * N) - (y - N))) - ((k = h * N) - b * S - x * S - b * C))), c[0] = O - (w + v) + (v - A), v = (E = D - ((T = D + w) - (v = T - D)) + (w - v)) - (w = E - k), c[1] = E - (w + v) + (v - k), v = (j = T + w) - T, c[2] = T - (j - v) + (w - v), c[3] = j;
3341
+ let R = n(4, i, 4, c, a);
3342
+ v = (O = (x = M - (b = (y = t * M) - (y - M))) * (C = _ - (S = (y = t * _) - (y - _))) - ((D = M * _) - b * S - x * S - b * C)) - (w = O - (A = (x = P - (b = (y = t * P) - (y - P))) * (C = g - (S = (y = t * g) - (y - g))) - ((k = P * g) - b * S - x * S - b * C))), c[0] = O - (w + v) + (v - A), v = (E = D - ((T = D + w) - (v = T - D)) + (w - v)) - (w = E - k), c[1] = E - (w + v) + (v - k), v = (j = T + w) - T, c[2] = T - (j - v) + (w - v), c[3] = j;
3343
+ let ee = n(R, a, 4, c, o);
3344
+ return v = (O = (x = m - (b = (y = t * m) - (y - m))) * (C = _ - (S = (y = t * _) - (y - _))) - ((D = m * _) - b * S - x * S - b * C)) - (w = O - (A = (x = h - (b = (y = t * h) - (y - h))) * (C = g - (S = (y = t * g) - (y - g))) - ((k = h * g) - b * S - x * S - b * C))), c[0] = O - (w + v) + (v - A), v = (E = D - ((T = D + w) - (v = T - D)) + (w - v)) - (w = E - k), c[1] = E - (w + v) + (v - k), v = (j = T + w) - T, c[2] = T - (j - v) + (w - v), c[3] = j, s[n(ee, o, 4, c, s) - 1];
3345
+ }(e, r, l, u, d, f, g);
3346
+ }, e.orient2dfast = function(e, t, n, r, i, a) {
3347
+ return (t - a) * (n - i) - (e - i) * (r - a);
3348
+ }, Object.defineProperty(e, "__esModule", { value: !0 });
3349
+ });
3350
+ })), Vt = /* @__PURE__ */ S((/* @__PURE__ */ y(((e, t) => {
3351
+ var n = Mt(), r = (It(), C(Nt)), i = zt(), a = Bt().orient2d;
3352
+ r.default && (r = r.default), t.exports = o, t.exports.default = o;
3353
+ function o(e, t, r) {
3354
+ t = Math.max(0, t === void 0 ? 2 : t), r ||= 0;
3355
+ var i = h(e), a = new n(16);
3356
+ a.toBBox = function(e) {
3357
+ return {
3358
+ minX: e[0],
3359
+ minY: e[1],
3360
+ maxX: e[0],
3361
+ maxY: e[1]
3362
+ };
3363
+ }, a.compareMinX = function(e, t) {
3364
+ return e[0] - t[0];
3365
+ }, a.compareMinY = function(e, t) {
3366
+ return e[1] - t[1];
3367
+ }, a.load(e);
3368
+ for (var o = [], c = 0, l; c < i.length; c++) {
3369
+ var u = i[c];
3370
+ a.remove(u), l = g(u, l), o.push(l);
3371
+ }
3372
+ var d = new n(16);
3373
+ for (c = 0; c < o.length; c++) d.insert(m(o[c]));
3374
+ for (var f = t * t, p = r * r; o.length;) {
3375
+ var v = o.shift(), y = v.p, b = v.next.p, x = _(y, b);
3376
+ if (!(x < p)) {
3377
+ var S = x / f;
3378
+ u = s(a, v.prev.p, y, b, v.next.next.p, S, d), u && Math.min(_(u, y), _(u, b)) <= S && (o.push(v), o.push(g(u, v)), a.remove(u), d.remove(v), d.insert(m(v)), d.insert(m(v.next)));
3379
+ }
3380
+ }
3381
+ v = l;
3382
+ var C = [];
3383
+ do
3384
+ C.push(v.p), v = v.next;
3385
+ while (v !== l);
3386
+ return C.push(v.p), C;
3387
+ }
3388
+ function s(e, t, n, i, a, o, s) {
3389
+ for (var u = new r([], c), f = e.data; f;) {
3390
+ for (var p = 0; p < f.children.length; p++) {
3391
+ var m = f.children[p], h = f.leaf ? v(m, n, i) : l(n, i, m);
3392
+ h > o || u.push({
3393
+ node: m,
3394
+ dist: h
3395
+ });
3396
+ }
3397
+ for (; u.length && !u.peek().node.children;) {
3398
+ var g = u.pop(), _ = g.node, y = v(_, t, n), b = v(_, i, a);
3399
+ if (g.dist < y && g.dist < b && d(n, _, s) && d(i, _, s)) return _;
3400
+ }
3401
+ f = u.pop(), f &&= f.node;
3402
+ }
3403
+ return null;
3404
+ }
3405
+ function c(e, t) {
3406
+ return e.dist - t.dist;
3407
+ }
3408
+ function l(e, t, n) {
3409
+ if (u(e, n) || u(t, n)) return 0;
3410
+ var r = y(e[0], e[1], t[0], t[1], n.minX, n.minY, n.maxX, n.minY);
3411
+ if (r === 0) return 0;
3412
+ var i = y(e[0], e[1], t[0], t[1], n.minX, n.minY, n.minX, n.maxY);
3413
+ if (i === 0) return 0;
3414
+ var a = y(e[0], e[1], t[0], t[1], n.maxX, n.minY, n.maxX, n.maxY);
3415
+ if (a === 0) return 0;
3416
+ var o = y(e[0], e[1], t[0], t[1], n.minX, n.maxY, n.maxX, n.maxY);
3417
+ return o === 0 ? 0 : Math.min(r, i, a, o);
3418
+ }
3419
+ function u(e, t) {
3420
+ return e[0] >= t.minX && e[0] <= t.maxX && e[1] >= t.minY && e[1] <= t.maxY;
3421
+ }
3422
+ function d(e, t, n) {
3423
+ for (var r = Math.min(e[0], t[0]), i = Math.min(e[1], t[1]), a = Math.max(e[0], t[0]), o = Math.max(e[1], t[1]), s = n.search({
3424
+ minX: r,
3425
+ minY: i,
3426
+ maxX: a,
3427
+ maxY: o
3428
+ }), c = 0; c < s.length; c++) if (p(s[c].p, s[c].next.p, e, t)) return !1;
3429
+ return !0;
3430
+ }
3431
+ function f(e, t, n) {
3432
+ return a(e[0], e[1], t[0], t[1], n[0], n[1]);
3433
+ }
3434
+ function p(e, t, n, r) {
3435
+ return e !== r && t !== n && f(e, t, n) > 0 != f(e, t, r) > 0 && f(n, r, e) > 0 != f(n, r, t) > 0;
3436
+ }
3437
+ function m(e) {
3438
+ var t = e.p, n = e.next.p;
3439
+ return e.minX = Math.min(t[0], n[0]), e.minY = Math.min(t[1], n[1]), e.maxX = Math.max(t[0], n[0]), e.maxY = Math.max(t[1], n[1]), e;
3440
+ }
3441
+ function h(e) {
3442
+ for (var t = e[0], n = e[0], r = e[0], a = e[0], o = 0; o < e.length; o++) {
3443
+ var s = e[o];
3444
+ s[0] < t[0] && (t = s), s[0] > r[0] && (r = s), s[1] < n[1] && (n = s), s[1] > a[1] && (a = s);
3445
+ }
3446
+ var c = [
3447
+ t,
3448
+ n,
3449
+ r,
3450
+ a
3451
+ ], l = c.slice();
3452
+ for (o = 0; o < e.length; o++) i(e[o], c) || l.push(e[o]);
3453
+ return x(l);
3454
+ }
3455
+ function g(e, t) {
3456
+ var n = {
3457
+ p: e,
3458
+ prev: null,
3459
+ next: null,
3460
+ minX: 0,
3461
+ minY: 0,
3462
+ maxX: 0,
3463
+ maxY: 0
3464
+ };
3465
+ return t ? (n.next = t.next, n.prev = t, t.next.prev = n, t.next = n) : (n.prev = n, n.next = n), n;
3466
+ }
3467
+ function _(e, t) {
3468
+ var n = e[0] - t[0], r = e[1] - t[1];
3469
+ return n * n + r * r;
3470
+ }
3471
+ function v(e, t, n) {
3472
+ var r = t[0], i = t[1], a = n[0] - r, o = n[1] - i;
3473
+ if (a !== 0 || o !== 0) {
3474
+ var s = ((e[0] - r) * a + (e[1] - i) * o) / (a * a + o * o);
3475
+ s > 1 ? (r = n[0], i = n[1]) : s > 0 && (r += a * s, i += o * s);
3476
+ }
3477
+ return a = e[0] - r, o = e[1] - i, a * a + o * o;
3478
+ }
3479
+ function y(e, t, n, r, i, a, o, s) {
3480
+ var c = n - e, l = r - t, u = o - i, d = s - a, f = e - i, p = t - a, m = c * c + l * l, h = c * u + l * d, g = u * u + d * d, _ = c * f + l * p, v = u * f + d * p, y = m * g - h * h, b, x, S, C, w = y, T = y;
3481
+ y === 0 ? (x = 0, w = 1, C = v, T = g) : (x = h * v - g * _, C = m * v - h * _, x < 0 ? (x = 0, C = v, T = g) : x > w && (x = w, C = v + h, T = g)), C < 0 ? (C = 0, -_ < 0 ? x = 0 : -_ > m ? x = w : (x = -_, w = m)) : C > T && (C = T, -_ + h < 0 ? x = 0 : -_ + h > m ? x = w : (x = -_ + h, w = m)), b = x === 0 ? 0 : x / w, S = C === 0 ? 0 : C / T;
3482
+ var E = (1 - b) * e + b * n, D = (1 - b) * t + b * r, O = (1 - S) * i + S * o, k = (1 - S) * a + S * s, A = O - E, j = k - D;
3483
+ return A * A + j * j;
3484
+ }
3485
+ function b(e, t) {
3486
+ return e[0] === t[0] ? e[1] - t[1] : e[0] - t[0];
3487
+ }
3488
+ function x(e) {
3489
+ e.sort(b);
3490
+ for (var t = [], n = 0; n < e.length; n++) {
3491
+ for (; t.length >= 2 && f(t[t.length - 2], t[t.length - 1], e[n]) <= 0;) t.pop();
3492
+ t.push(e[n]);
3493
+ }
3494
+ for (var r = [], i = e.length - 1; i >= 0; i--) {
3495
+ for (; r.length >= 2 && f(r[r.length - 2], r[r.length - 1], e[i]) <= 0;) r.pop();
3496
+ r.push(e[i]);
3497
+ }
3498
+ return r.pop(), t.pop(), t.concat(r);
3499
+ }
3500
+ })))(), 1);
3501
+ function Ht(e, t = {}) {
3502
+ t.concavity = t.concavity || Infinity;
3503
+ let n = [];
3504
+ if (Ot(e, (e) => {
3505
+ n.push([e[0], e[1]]);
3506
+ }), !n.length) return null;
3507
+ let r = (0, Vt.default)(n, t.concavity);
3508
+ return r.length > 3 ? bt([r]) : null;
3509
+ }
3510
+ //#endregion
3511
+ //#region node_modules/@turf/centroid/dist/esm/index.js
3512
+ function Ut(e, t = {}) {
3513
+ let n = 0, r = 0, i = 0;
3514
+ return Ot(e, function(e) {
3515
+ n += e[0], r += e[1], i++;
3516
+ }, !0), yt([n / i, r / i], t.properties);
3517
+ }
3518
+ //#endregion
3519
+ //#region node_modules/@turf/invariant/dist/esm/index.js
3520
+ function Wt(e) {
3521
+ if (!e) throw Error("coord is required");
3522
+ if (!Array.isArray(e)) {
3523
+ if (e.type === "Feature" && e.geometry !== null && e.geometry.type === "Point") return [...e.geometry.coordinates];
3524
+ if (e.type === "Point") return [...e.coordinates];
3525
+ }
3526
+ if (Array.isArray(e) && e.length >= 2 && !Array.isArray(e[0]) && !Array.isArray(e[1])) return [...e];
3527
+ throw Error("coord must be GeoJSON Point or an Array of numbers");
3528
+ }
3529
+ function Gt(e) {
3530
+ if (Array.isArray(e)) return e;
3531
+ if (e.type === "Feature") {
3532
+ if (e.geometry !== null) return e.geometry.coordinates;
3533
+ } else if (e.coordinates) return e.coordinates;
3534
+ throw Error("coords must be GeoJSON Feature, Geometry Object or an Array");
3535
+ }
3536
+ //#endregion
3537
+ //#region node_modules/@turf/rhumb-bearing/dist/esm/index.js
3538
+ function Kt(e, t, n = {}) {
3539
+ let r;
3540
+ return r = n.final ? qt(Wt(t), Wt(e)) : qt(Wt(e), Wt(t)), r > 180 ? -(360 - r) : r;
3541
+ }
3542
+ function qt(e, t) {
3543
+ let n = wt(e[1]), r = wt(t[1]), i = wt(t[0] - e[0]);
3544
+ i > Math.PI && (i -= 2 * Math.PI), i < -Math.PI && (i += 2 * Math.PI);
3545
+ let a = Math.log(Math.tan(r / 2 + Math.PI / 4) / Math.tan(n / 2 + Math.PI / 4));
3546
+ return (Ct(Math.atan2(i, a)) + 360) % 360;
3547
+ }
3548
+ //#endregion
3549
+ //#region node_modules/@turf/rhumb-distance/dist/esm/index.js
3550
+ function Jt(e, t, n = {}) {
3551
+ let r = Wt(e), i = Wt(t);
3552
+ return i[0] += i[0] - r[0] > 180 ? -360 : r[0] - i[0] > 180 ? 360 : 0, Tt(Yt(r, i), "meters", n.units);
3553
+ }
3554
+ function Yt(e, t, n) {
3555
+ n = n === void 0 ? $ : Number(n);
3556
+ let r = n, i = e[1] * Math.PI / 180, a = t[1] * Math.PI / 180, o = a - i, s = Math.abs(t[0] - e[0]) * Math.PI / 180;
3557
+ s > Math.PI && (s -= 2 * Math.PI);
3558
+ let c = Math.log(Math.tan(a / 2 + Math.PI / 4) / Math.tan(i / 2 + Math.PI / 4)), l = Math.abs(c) > 1e-11 ? o / c : Math.cos(i);
3559
+ return Math.sqrt(o * o + l * l * s * s) * r;
3560
+ }
3561
+ //#endregion
3562
+ //#region node_modules/@turf/rhumb-destination/dist/esm/index.js
3563
+ function Xt(e, t, n, r = {}) {
3564
+ let i = t < 0, a = Tt(Math.abs(t), r.units, "meters");
3565
+ i && (a = -Math.abs(a));
3566
+ let o = Wt(e), s = Zt(o, a, n);
3567
+ return s[0] += s[0] - o[0] > 180 ? -360 : o[0] - s[0] > 180 ? 360 : 0, yt(s, r.properties);
3568
+ }
3569
+ function Zt(e, t, n, r) {
3570
+ r = r === void 0 ? $ : Number(r);
3571
+ let i = t / r, a = e[0] * Math.PI / 180, o = wt(e[1]), s = wt(n), c = i * Math.cos(s), l = o + c;
3572
+ Math.abs(l) > Math.PI / 2 && (l = l > 0 ? Math.PI - l : -Math.PI - l);
3573
+ let u = Math.log(Math.tan(l / 2 + Math.PI / 4) / Math.tan(o / 2 + Math.PI / 4)), d = Math.abs(u) > 1e-11 ? c / u : Math.cos(o);
3574
+ return [((a + i * Math.sin(s) / d) * 180 / Math.PI + 540) % 360 - 180, l * 180 / Math.PI];
3575
+ }
3576
+ //#endregion
3577
+ //#region node_modules/@turf/clone/dist/esm/index.js
3578
+ function Qt(e) {
3579
+ if (!e) throw Error("geojson is required");
3580
+ switch (e.type) {
3581
+ case "Feature": return $t(e);
3582
+ case "FeatureCollection": return tn(e);
3583
+ case "Point":
3584
+ case "LineString":
3585
+ case "Polygon":
3586
+ case "MultiPoint":
3587
+ case "MultiLineString":
3588
+ case "MultiPolygon":
3589
+ case "GeometryCollection": return nn(e);
3590
+ default: throw Error("unknown GeoJSON type");
3591
+ }
3592
+ }
3593
+ function $t(e) {
3594
+ let t = { type: "Feature" };
3595
+ return Object.keys(e).forEach((n) => {
3596
+ switch (n) {
3597
+ case "type":
3598
+ case "properties":
3599
+ case "geometry": return;
3600
+ default: t[n] = e[n];
3601
+ }
3602
+ }), t.properties = en(e.properties), e.geometry == null ? t.geometry = null : t.geometry = nn(e.geometry), t;
3603
+ }
3604
+ function en(e) {
3605
+ let t = {};
3606
+ return e && Object.keys(e).forEach((n) => {
3607
+ let r = e[n];
3608
+ typeof r == "object" ? r === null ? t[n] = null : Array.isArray(r) ? t[n] = r.map((e) => e) : t[n] = en(r) : t[n] = r;
3609
+ }), t;
3610
+ }
3611
+ function tn(e) {
3612
+ let t = { type: "FeatureCollection" };
3613
+ return Object.keys(e).forEach((n) => {
3614
+ switch (n) {
3615
+ case "type":
3616
+ case "features": return;
3617
+ default: t[n] = e[n];
3618
+ }
3619
+ }), t.features = e.features.map((e) => $t(e)), t;
3620
+ }
3621
+ function nn(e) {
3622
+ let t = { type: e.type };
3623
+ return e.bbox && (t.bbox = e.bbox), e.type === "GeometryCollection" ? (t.geometries = e.geometries.map((e) => nn(e)), t) : (t.coordinates = rn(e.coordinates), t);
3624
+ }
3625
+ function rn(e) {
3626
+ let t = e;
3627
+ return typeof t[0] == "object" ? t.map((e) => rn(e)) : t.slice();
3628
+ }
3629
+ //#endregion
3630
+ //#region node_modules/@turf/transform-rotate/dist/esm/index.js
3631
+ function an(e, t, n) {
3632
+ if (n ||= {}, !Dt(n)) throw Error("options is invalid");
3633
+ let r = n.pivot, i = n.mutate;
3634
+ if (!e) throw Error("geojson is required");
3635
+ if (t == null || isNaN(t)) throw Error("angle is required");
3636
+ if (t === 0) return e;
3637
+ let a = r ?? Ut(e);
3638
+ return (i === !1 || i === void 0) && (e = Qt(e)), Ot(e, function(e) {
3639
+ let n = Kt(a, e) + t, r = Gt(Xt(a, Jt(a, e), n));
3640
+ e[0] = r[0], e[1] = r[1];
3641
+ }), e;
3642
+ }
3643
+ //#endregion
3644
+ //#region node_modules/@turf/bearing/dist/esm/index.js
3645
+ function on(e, t, n = {}) {
3646
+ if (n.final === !0) return sn(e, t);
3647
+ let r = Wt(e), i = Wt(t), a = wt(r[0]), o = wt(i[0]), s = wt(r[1]), c = wt(i[1]), l = Math.sin(o - a) * Math.cos(c), u = Math.cos(s) * Math.sin(c) - Math.sin(s) * Math.cos(c) * Math.cos(o - a);
3648
+ return Ct(Math.atan2(l, u));
3649
+ }
3650
+ function sn(e, t) {
3651
+ let n = on(t, e);
3652
+ return n = (n + 180) % 360, n;
3653
+ }
3654
+ //#endregion
3655
+ //#region node_modules/@turf/bbox/dist/esm/index.js
3656
+ function cn(e, t = {}) {
3657
+ if (e.bbox != null && !0 !== t.recompute) return e.bbox;
3658
+ let n = [
3659
+ Infinity,
3660
+ Infinity,
3661
+ -Infinity,
3662
+ -Infinity
3663
+ ];
3664
+ return Ot(e, (e) => {
3665
+ n[0] > e[0] && (n[0] = e[0]), n[1] > e[1] && (n[1] = e[1]), n[2] < e[0] && (n[2] = e[0]), n[3] < e[1] && (n[3] = e[1]);
3666
+ }), n;
3667
+ }
3668
+ //#endregion
3669
+ //#region node_modules/@turf/bbox-polygon/dist/esm/index.js
3670
+ function ln(e, t = {}) {
3671
+ let n = Number(e[0]), r = Number(e[1]), i = Number(e[2]), a = Number(e[3]);
3672
+ if (e.length === 6) throw Error("@turf/bbox-polygon does not support BBox with 6 positions");
3673
+ let o = [n, r];
3674
+ return bt([[
3675
+ o,
3676
+ [i, r],
3677
+ [i, a],
3678
+ [n, a],
3679
+ o
3680
+ ]], t.properties, {
3681
+ bbox: e,
3682
+ id: t.id
3683
+ });
3684
+ }
3685
+ //#endregion
3686
+ //#region node_modules/@turf/envelope/dist/esm/index.js
3687
+ function un(e) {
3688
+ return ln(cn(e));
3689
+ }
3690
+ //#endregion
3691
+ //#region node_modules/@turf/area/dist/esm/index.js
3692
+ function dn(e) {
3693
+ return jt(e, (e, t) => e + fn(t), 0);
3694
+ }
3695
+ function fn(e) {
3696
+ let t = 0, n;
3697
+ switch (e.type) {
3698
+ case "Polygon": return pn(e.coordinates);
3699
+ case "MultiPolygon":
3700
+ for (n = 0; n < e.coordinates.length; n++) t += pn(e.coordinates[n]);
3701
+ return t;
3702
+ case "Point":
3703
+ case "MultiPoint":
3704
+ case "LineString":
3705
+ case "MultiLineString": return 0;
3706
+ }
3707
+ return 0;
3708
+ }
3709
+ function pn(e) {
3710
+ let t = 0;
3711
+ if (e && e.length > 0) {
3712
+ t += Math.abs(gn(e[0]));
3713
+ for (let n = 1; n < e.length; n++) t -= Math.abs(gn(e[n]));
3714
+ }
3715
+ return t;
3716
+ }
3717
+ var mn = $ * $ / 2, hn = Math.PI / 180;
3718
+ function gn(e) {
3719
+ let t = e.length - 1;
3720
+ if (t <= 2) return 0;
3721
+ let n = 0, r = 0;
3722
+ for (; r < t;) {
3723
+ let i = e[r], a = e[r + 1 === t ? 0 : r + 1], o = e[r + 2 >= t ? (r + 2) % t : r + 2], s = i[0] * hn, c = a[1] * hn, l = o[0] * hn;
3724
+ n += (l - s) * Math.sin(c), r++;
3725
+ }
3726
+ return n * mn;
3727
+ }
3728
+ //#endregion
3729
+ //#region node_modules/geojson-minimum-bounding-rectangle/dist/index.js
3730
+ function _n(e) {
3731
+ let t = Ht(e);
3732
+ if (!t) throw Error("Can't calculate smallestSurroundingRectangleByArea for given geometry");
3733
+ let n = Ut(t), r = kt(t), i = 2 ** 53 - 1, a = null;
3734
+ for (let e = 0; e < r.length - 1; e++) {
3735
+ let o = on(r[e], r[e + 1]), s = un(an(t, -1 * o, { pivot: n })), c = dn(s);
3736
+ c < i && (i = c, a = an(s, o, { pivot: n }));
3737
+ }
3738
+ return a;
3739
+ }
3740
+ //#endregion
3741
+ //#region src/utils/OBB.mjs
3742
+ function vn(e, t) {
3743
+ let n = t[0] - e[0], r = t[1] - e[1];
3744
+ return Math.sqrt(n * n + r * r);
3745
+ }
3746
+ function yn(e) {
3747
+ let t = Infinity, n = -Infinity, r = Infinity, i = -Infinity;
3748
+ for (let [a, o] of e) a < t && (t = a), a > n && (n = a), o < r && (r = o), o > i && (i = o);
3749
+ return [(n + t) * .5, (i + r) * .5];
3750
+ }
3751
+ var bn = class t extends ht {
3752
+ getBoxMesh() {
3753
+ xn.identity(), xn.setFromMatrix3(this.rotation), xn.decompose(Tn, Sn, new e.Vector3());
3754
+ let t = this.halfSize.clone().multiplyScalar(2), n = new e.Mesh(new e.BoxGeometry(t.x, t.y, t.z));
3755
+ return n.position.copy(this.center), n.rotation.setFromQuaternion(Sn), n;
3756
+ }
3757
+ getBoxEdge(t = 16776960) {
3758
+ let n = this.getBoxMesh();
3759
+ En.setFromObject(n);
3760
+ let r = new e.EdgesGeometry(n.geometry.clone().applyMatrix4(n.matrixWorld));
3761
+ return new e.LineSegments(r, new e.LineBasicMaterial({
3762
+ color: t,
3763
+ toneMapped: !1
3764
+ }));
3765
+ }
3766
+ toJson() {
3767
+ return xn.identity(), xn.setFromMatrix3(this.rotation), xn.decompose(Tn, Sn, new e.Vector3()), {
3768
+ size: this.halfSize.toArray(),
3769
+ center: this.center.toArray(),
3770
+ quaternion: Sn.toArray()
3771
+ };
3772
+ }
3773
+ static from(n, r, i, a = new t()) {
3774
+ if (i instanceof e.Euler) Sn.setFromEuler(i);
3775
+ else if (i instanceof e.Quaternion) Sn.copy(i);
3776
+ else throw Error("传入的旋转不是欧拉角或者四元数");
3777
+ return xn.compose(r, Sn, wn), a.center.copy(r), a.halfSize.copy(n.multiplyScalar(.5)), a.rotation.setFromMatrix4(xn), a;
3778
+ }
3779
+ static fromByPath2D(e, n, r, i = new t()) {
3780
+ let a = _n({
3781
+ type: "Polygon",
3782
+ coordinates: [e.map((e) => [e.x, e.y])]
3783
+ });
3784
+ if (!a) throw Error("2d obb 获取失败");
3785
+ let o = a.geometry.coordinates[0], s = vn(o[0], o[1]), c = vn(o[1], o[2]), l = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]);
3786
+ Tn.set(s, c, r), Cn.set(0, 0, l);
3787
+ let [u, d] = yn(o);
3788
+ return n.x = u, n.y = d, this.from(Tn, n, Cn, i);
3789
+ }
3790
+ }, xn = new e.Matrix4(), Sn = new e.Quaternion(), Cn = new e.Euler(), wn = new e.Vector3(1, 1, 1), Tn = new e.Vector3(), En = new e.Box3();
3791
+ //#endregion
3792
+ //#region src/pointCloudProcessing/mergeMeaning.mjs
3793
+ function Dn(e, t, n = .005, r = .2) {
3794
+ if (!e.length || !t.length) return 0;
3795
+ let i = Math.max(n * 3, .05), a = n * n, o = /* @__PURE__ */ new Map(), s = (e, t, n) => `${Math.floor(e / i)},${Math.floor(t / i)},${Math.floor(n / i)}`;
3796
+ for (let e of t) {
3797
+ let t = s(e.x, e.y, e.z);
3798
+ o.has(t) || o.set(t, []), o.get(t).push(e);
3799
+ }
3800
+ let c = 0, l = Math.ceil(n / i) + 1, u = [];
3801
+ for (let e = -l; e <= l; e++) for (let t = -l; t <= l; t++) for (let n = -l; n <= l; n++) e * e + t * t + n * n <= l * l && u.push([
3802
+ e,
3803
+ t,
3804
+ n
3805
+ ]);
3806
+ for (let t of e) {
3807
+ let n = Math.floor(t.x / i), s = Math.floor(t.y / i), l = Math.floor(t.z / i), d = !1;
3808
+ for (let [e, r, i] of u) {
3809
+ let c = `${n + e},${s + r},${l + i}`;
3810
+ if (o.has(c)) {
3811
+ for (let e of o.get(c)) if (t.distanceToSquared(e) < a) {
3812
+ d = !0;
3813
+ break;
3814
+ }
3815
+ if (d) break;
3816
+ }
3817
+ }
3818
+ if (d && (c++, c / e.length > r)) return c / e.length;
3819
+ }
3820
+ return c / e.length;
3821
+ }
3822
+ function On(e, t, n = .5) {
3823
+ let r = 0, i = 0;
3824
+ for (let a of e) if (t.containsPoint(a) && (r++, i = r / e.length, i > n)) break;
3825
+ return i;
3826
+ }
3827
+ function kn(e, t, n, r) {
3828
+ if (e.intersectsOBB(t)) return !0;
3829
+ {
3830
+ let i = jn(e, r), a = jn(t, n);
3831
+ if (i || a) return !0;
3832
+ }
3833
+ return !1;
3834
+ }
3835
+ function An(t, n) {
3836
+ let r = new e.Vector3(), i = new e.Vector3();
3837
+ t.getSize(r), n.getSize(i);
3838
+ let a = r.x * r.y * r.z, o = i.x * i.y * i.z;
3839
+ return a > o ? 1 : a < o ? -1 : 0;
3840
+ }
3841
+ function jn(e, t) {
3842
+ let n = !0;
3843
+ for (let r = 0; r < t.length; r++) if (!e.containsPoint(t[r])) {
3844
+ n = !1;
3845
+ break;
3846
+ }
3847
+ return n;
3848
+ }
3849
+ function Mn(e) {
3850
+ if (e.length === 0) return {
3851
+ x: 0,
3852
+ y: 0,
3853
+ z: 0,
3854
+ h: 0
3855
+ };
3856
+ let t = 0, n = 0, r = -Infinity, i = Infinity;
3857
+ for (let a of e) t += a.x, n += a.y, r = Math.max(r, a.z), i = Math.min(i, a.z);
3858
+ return {
3859
+ x: t / e.length,
3860
+ y: n / e.length,
3861
+ z: 0,
3862
+ maxz: r,
3863
+ minz: i,
3864
+ h: r - i
3865
+ };
3866
+ }
3867
+ function Nn(t, n, r, i) {
3868
+ let a = [];
3869
+ for (let n = 0; n < t.length; n++) a.push(new e.Vector3(t[n][0], t[n][1], 0));
3870
+ if (a.length == 0) return null;
3871
+ let o = bn.fromByPath2D(a, n, r);
3872
+ return o.center.z = i, o;
3873
+ }
3874
+ var Pn = (t) => {
3875
+ if (t.length == 0) return [];
3876
+ let n = [];
3877
+ for (let r = 0; r < t.length; r++) {
3878
+ let i = t[r].points.map((e) => [e.x, e.y]), a = Mn(t[r].points), o = t[r].obj_id;
3879
+ o = o.replace(/calcony railing/g, "balcony railing").replace(/glass balcony railing/g, "balcony railing").replace(/metal balcony railing/g, "balcony railing").replace(/temporary construction guardrail/g, "balcony railing"), o.split("_").slice(1, 3).join("_").split(".")[0].split("_")[0];
3880
+ let s = o.indexOf("_") + 1, c = o.lastIndexOf("_"), l = o.substring(s, c);
3881
+ if (l === "wall" || l === "floor" || l === "roof") continue;
3882
+ let u = [];
3883
+ for (let n = 0; n < t[r].points.length; n++) u.push(new e.Vector3(t[r].points[n].x, t[r].points[n].y, t[r].points[n].z));
3884
+ let d = {
3885
+ points: u,
3886
+ path: at(i),
3887
+ h: a.h,
3888
+ minz: a.minz,
3889
+ maxz: a.maxz,
3890
+ center: {
3891
+ x: a.x,
3892
+ y: a.y,
3893
+ z: a.z
3894
+ },
3895
+ obj_id: t[r].obj_id,
3896
+ type: l,
3897
+ averagePz: t[r].averagePz,
3898
+ obb: null,
3899
+ isDel: !1,
3900
+ obj_id: o,
3901
+ positionArr: [t[r].position]
3902
+ };
3903
+ if (d.obb = Nn(d.path, d.center, d.h, (d.maxz + d.minz) / 2), d.obb == null) continue;
3904
+ let f = -1;
3905
+ for (let e = 0; e < n.length; e++) if (n[e].type == l) {
3906
+ f = e;
3907
+ break;
3908
+ }
3909
+ f == -1 ? n.push({
3910
+ type: l,
3911
+ array: [d]
3912
+ }) : n[f].array.push(d);
3913
+ }
3914
+ for (let e = 0; e < n.length; e++) {
3915
+ let t = n[e].array, r = [], i = [];
3916
+ for (let e = 0; e < t.length; e++) {
3917
+ if (t[e].obb == null || r.includes(e)) continue;
3918
+ let n = {
3919
+ ...t[e],
3920
+ obb: t[e].obb.clone()
3921
+ };
3922
+ for (let i = e + 1; i < t.length; i++) if (!(t[i].obb == null || r.includes(i)) && n.obb.intersectsOBB(t[i].obb)) {
3923
+ r.push(i), n.points.push(...t[i].points), n.path = at(n.points.map((e) => [e.x, e.y]));
3924
+ let a = Mn(n.points);
3925
+ n.h = a.h, n.minz = a.minz, n.maxz = a.maxz, n.center = {
3926
+ x: a.x,
3927
+ y: a.y,
3928
+ z: a.z
3929
+ }, n.obb = Nn(n.path, n.center, n.h, (n.maxz + n.minz) / 2), n.positionArr.push(...t[i].positionArr), i = e;
3930
+ }
3931
+ n.path.length > t[e].path.length && (r.push(e), i.push(n));
3932
+ }
3933
+ let a = [];
3934
+ for (let e = 0; e < t.length; e++) r.includes(e) || a.push(t[e]);
3935
+ a.push(...i), n[e].array = a;
3936
+ }
3937
+ for (let t = 0; t < n.length; t++) {
3938
+ let r = n[t].type, i = n[t].array;
3939
+ for (let a = 0; a < i.length; a++) {
3940
+ let o = i[a].obb, s = i[a].minz;
3941
+ i[a].maxz;
3942
+ let c = i[a].averagePz;
3943
+ if (r === "window" || r === "door" || r === "tv" || r === "chair" || r === "cabinet" || r === "table") {
3944
+ let t = new e.Vector3();
3945
+ o.getSize(t);
3946
+ let n = [
3947
+ t.x,
3948
+ t.y,
3949
+ t.z
3950
+ ], r = 0;
3951
+ for (let e of n) if (e < .2 && (r++, r === 2)) {
3952
+ i[a].isDel = !0;
3953
+ break;
3954
+ }
3955
+ }
3956
+ if (!i[a].isDel) for (let e = t + 1; e < n.length; e++) {
3957
+ let t = n[e].type, l = n[e].array;
3958
+ for (let e = 0; e < l.length; e++) {
3959
+ if (l[e].isDel) continue;
3960
+ let n = l[e].obb, u = l[e].minz;
3961
+ if (l[e].maxz, o.intersectsOBB(n)) {
3962
+ On(l[e].points, o);
3963
+ let d = On(i[a].points, n), f = An(o, n);
3964
+ if (d >= .3 && f == -1) {
3965
+ i[a].isDel = !0;
3966
+ break;
3967
+ }
3968
+ if (r !== "wall" && r !== "floor" && r !== "roof") {
3969
+ if (r === "window") {
3970
+ if (t === "balcony railing" && containsObb(o, l[e].points)) {
3971
+ l[e].isDel = !0;
3972
+ continue;
3973
+ }
3974
+ if (t === "balcony railing" && containsObb(n, i[a].points)) {
3975
+ i[a].isDel = !0;
3976
+ break;
3977
+ }
3978
+ if (t === "balcony railing" && kn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(u - c) > .3)) {
3979
+ l[e].isDel = !0;
3980
+ continue;
3981
+ }
3982
+ } else if (r === "balcony railing") {
3983
+ if (t === "window" && containsObb(o, l[e].points)) {
3984
+ l[e].isDel = !0;
3985
+ continue;
3986
+ }
3987
+ if (t === "window" && containsObb(n, i[a].points)) {
3988
+ i[a].isDel = !0;
3989
+ break;
3990
+ }
3991
+ if (t === "window" && kn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(s - c) > .3)) {
3992
+ i[a].isDel = !0;
3993
+ break;
3994
+ }
3995
+ }
3996
+ let d = !1, f = [], p = [], m = i[a].points, h = l[e].points;
3997
+ if (m.length > h.length ? (d = !0, f = m, p = h) : (f = h, p = m), Dn(p, f, .03, .5) > .5) {
3998
+ if (t === "people") {
3999
+ l[e].isDel = !0;
4000
+ continue;
4001
+ } else if (r === "people") {
4002
+ i[a].isDel = !0;
4003
+ break;
4004
+ }
4005
+ if (d) l[e].isDel = !0;
4006
+ else {
4007
+ i[a].isDel = !0;
4008
+ break;
4009
+ }
4010
+ } else if (kn(o, n)) {
4011
+ if (t === "people") {
4012
+ l[e].isDel = !0;
4013
+ continue;
4014
+ } else if (r === "people") {
4015
+ i[a].isDel = !0;
4016
+ break;
4017
+ }
4018
+ let s = An(o, n);
4019
+ if (s === 1 || s === 0) {
4020
+ if (t === "switch") continue;
4021
+ On(p, o) >= .5 && (l[e].isDel = !0);
4022
+ } else {
4023
+ if (r === "switch") continue;
4024
+ if (On(p, n) >= .5) {
4025
+ i[a].isDel = !0;
4026
+ break;
4027
+ }
4028
+ }
4029
+ }
4030
+ }
4031
+ }
4032
+ }
4033
+ if (i[a].isDel) break;
4034
+ }
4035
+ }
4036
+ }
4037
+ for (let t = 0; t < n.length; t++) {
4038
+ let r = n[t].type, i = n[t].array;
4039
+ for (let t = 0; t < i.length; t++) {
4040
+ let n = i[t].maxz, a = i[t].minz, o = r === "switch" ? .1 : .3, s = i[t].averagePz;
4041
+ if (Math.abs(n - s) < o) {
4042
+ i[t].isDel = !0;
4043
+ continue;
4044
+ }
4045
+ if (r === "window" || r === "door" || r === "tv") {
4046
+ let e = Math.abs(n - s);
4047
+ r !== "window" && e < 1.6 && (i[t].isDel = !0), r === "window" && e < 1 && (i[t].isDel = !0);
4048
+ }
4049
+ if (r === "chair") {
4050
+ let n = new e.Vector3();
4051
+ i[t].obb.getSize(n), (n.x < .1 || n.y < .1) && (i[t].isDel = !0);
4052
+ }
4053
+ r === "balcony railing" && (Math.abs(n - a) < .4 && (i[t].isDel = !0), (a < s && Math.abs(a - s) > 1 || a > s && Math.abs(a - s) > 1) && (i[t].isDel = !0), n < s && (i[t].isDel = !0));
4054
+ }
4055
+ }
4056
+ for (let e = 0; e < n.length; e++) n[e].array = n[e].array.filter((e) => !e.isDel);
4057
+ let r = [];
4058
+ for (let t = 0; t < n.length; t++) {
4059
+ let i = n[t].array;
4060
+ for (let t = 0; t < i.length; t++) r.push({
4061
+ obbBox: i[t].obb,
4062
+ box: new e.Box3().setFromPoints(i[t].points),
4063
+ category: i[t].type,
4064
+ center: {
4065
+ x: i[t].center.x,
4066
+ y: i[t].center.y,
4067
+ z: (i[t].minz + i[t].maxz) / 2
4068
+ },
4069
+ name: i[t].obj_id,
4070
+ obj_id: i[t].obj_id,
4071
+ pcdPoints: i[t].points,
4072
+ positionArr: i[t].positionArr
4073
+ });
4074
+ }
4075
+ return r;
2031
4076
  };
2032
4077
  //#endregion
2033
- export { S as classifySegments, V as getAllGeometry, U as getBeamLine, G as getColLine, W as getMainBeamLine, y as getParallelism, D as getPointCloudMinMax, T as getPointCoverageOnQuad, m as isParallel, b as perpendicularInfo, k as removeNoisePoints, d as segmentsIntersect2D, H as usegetBeamLine };
4078
+ export { R as classifySegments, he as getAllGeometry, _e as getBeamLine, ye as getColLine, ve as getMainBeamLine, Pn as getMergeMeaning, F as getParallelism, re as getPointCloudMinMax, z as getPointCoverageOnQuad, A as isParallel, I as perpendicularInfo, ae as removeNoisePoints, D as segmentsIntersect2D, ge as usegetBeamLine };