rm-graphical-computing 1.0.60 → 1.0.61

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,6 +1,6 @@
1
1
  import * as c from "three";
2
- import { Box3 as Gn, BufferAttribute as qn, BufferGeometry as Wn, MathUtils as Ae, Matrix3 as pn, Matrix4 as Ee, Object3D as On, Plane as Hn, Ray as Nn, Vector2 as $n, Vector3 as wt } from "three";
3
- var Xn = Object.create, Pe = Object.defineProperty, Yn = Object.getOwnPropertyDescriptor, jn = Object.getOwnPropertyNames, Un = Object.getPrototypeOf, yn = Object.prototype.hasOwnProperty, Zn = (t, e) => () => (t && (e = t(t = 0)), e), we = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), Kn = (t, e) => {
2
+ import { Box3 as qn, BufferAttribute as Wn, BufferGeometry as On, MathUtils as Ae, Matrix3 as pn, Matrix4 as Ee, Object3D as Hn, Plane as Nn, Ray as $n, Vector2 as Xn, Vector3 as wt } from "three";
3
+ var Yn = Object.create, Pe = Object.defineProperty, jn = Object.getOwnPropertyDescriptor, Un = Object.getOwnPropertyNames, Zn = Object.getPrototypeOf, yn = Object.prototype.hasOwnProperty, Kn = (t, e) => () => (t && (e = t(t = 0)), e), we = (t, e) => () => (e || t((e = { exports: {} }).exports, e), e.exports), Qn = (t, e) => {
4
4
  let n = {};
5
5
  for (var o in t)
6
6
  Pe(n, o, {
@@ -10,18 +10,18 @@ var Xn = Object.create, Pe = Object.defineProperty, Yn = Object.getOwnPropertyDe
10
10
  return e || Pe(n, Symbol.toStringTag, { value: "Module" }), n;
11
11
  }, xn = (t, e, n, o) => {
12
12
  if (e && typeof e == "object" || typeof e == "function")
13
- for (var i = jn(e), r = 0, a = i.length, s; r < a; r++)
13
+ for (var i = Un(e), r = 0, a = i.length, s; r < a; r++)
14
14
  s = i[r], !yn.call(t, s) && s !== n && Pe(t, s, {
15
15
  get: ((l) => e[l]).bind(null, s),
16
- enumerable: !(o = Yn(e, s)) || o.enumerable
16
+ enumerable: !(o = jn(e, s)) || o.enumerable
17
17
  });
18
18
  return t;
19
- }, Qn = (t, e, n) => (n = t != null ? Xn(Un(t)) : {}, xn(e || !t || !t.__esModule ? Pe(n, "default", {
19
+ }, Jn = (t, e, n) => (n = t != null ? Yn(Zn(t)) : {}, xn(e || !t || !t.__esModule ? Pe(n, "default", {
20
20
  value: t,
21
21
  enumerable: !0
22
- }) : n, t)), Jn = (t) => yn.call(t, "module.exports") ? t["module.exports"] : xn(Pe({}, "__esModule", { value: !0 }), t);
22
+ }) : n, t)), tr = (t) => yn.call(t, "module.exports") ? t["module.exports"] : xn(Pe({}, "__esModule", { value: !0 }), t);
23
23
  function De(t, e = !1) {
24
- const n = t[0].index !== null, o = new Set(Object.keys(t[0].attributes)), i = new Set(Object.keys(t[0].morphAttributes)), r = {}, a = {}, s = t[0].morphTargetsRelative, l = new Wn();
24
+ const n = t[0].index !== null, o = new Set(Object.keys(t[0].attributes)), i = new Set(Object.keys(t[0].morphAttributes)), r = {}, a = {}, s = t[0].morphTargetsRelative, l = new On();
25
25
  let h = 0;
26
26
  for (let u = 0; u < t.length; ++u) {
27
27
  const d = t[u];
@@ -96,7 +96,7 @@ function qe(t) {
96
96
  return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
97
97
  r += u.count * n;
98
98
  }
99
- const a = new e(r), s = new qn(a, n, o);
99
+ const a = new e(r), s = new Wn(a, n, o);
100
100
  let l = 0;
101
101
  for (let h = 0; h < t.length; ++h) {
102
102
  const u = t[h];
@@ -111,9 +111,9 @@ function qe(t) {
111
111
  }
112
112
  return i !== void 0 && (s.gpuType = i), s;
113
113
  }
114
- var tr = class extends On {
114
+ var er = class extends Hn {
115
115
  constructor(t = document.createElement("div")) {
116
- super(), this.isCSS2DObject = !0, this.element = t, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new $n(0.5, 0.5), this.addEventListener("removed", function() {
116
+ super(), this.isCSS2DObject = !0, this.element = t, this.element.style.position = "absolute", this.element.style.userSelect = "none", this.element.setAttribute("draggable", !1), this.center = new Xn(0.5, 0.5), this.addEventListener("removed", function() {
117
117
  this.traverse(function(e) {
118
118
  e.element && e.element instanceof e.element.ownerDocument.defaultView.Element && e.element.parentNode !== null && e.element.remove();
119
119
  });
@@ -122,7 +122,7 @@ var tr = class extends On {
122
122
  copy(t, e) {
123
123
  return super.copy(t, e), this.element = t.element.cloneNode(!0), this.center = t.center, this;
124
124
  }
125
- }, Zo = new wt(), Ko = new Ee(), Qo = new Ee(), Jo = new wt(), ti = new wt(), er = (t, e, n) => {
125
+ }, Zo = new wt(), Ko = new Ee(), Qo = new Ee(), Jo = new wt(), ti = new wt(), nr = (t, e, n) => {
126
126
  let o = new c.LineBasicMaterial({ color: "#0011ff" }), i = [];
127
127
  i.push(t), i.push(e);
128
128
  let r = new c.BufferGeometry();
@@ -140,7 +140,7 @@ var tr = class extends On {
140
140
  const g = document.createElement("canvas");
141
141
  g.width = d, g.height = f;
142
142
  const b = g.getContext("2d");
143
- b.fillStyle = r, b.fillRect(0, 0, d, f), b.fillStyle = a, b.font = `bold ${o}px ${i}`, b.textAlign = "center", b.textBaseline = "middle", u > l - s * 2 ? nr(b, t, d / 2, f / 2, l, o) : b.fillText(t, d / 2, f / 2);
143
+ b.fillStyle = r, b.fillRect(0, 0, d, f), b.fillStyle = a, b.font = `bold ${o}px ${i}`, b.textAlign = "center", b.textBaseline = "middle", u > l - s * 2 ? rr(b, t, d / 2, f / 2, l, o) : b.fillText(t, d / 2, f / 2);
144
144
  const w = new c.CanvasTexture(g), S = new c.SpriteMaterial({
145
145
  map: w,
146
146
  depthTest: !1,
@@ -150,7 +150,7 @@ var tr = class extends On {
150
150
  const y = 5e-3;
151
151
  return P.scale.set(d * y, f * y, 1), P;
152
152
  };
153
- function nr(t, e, n, o, i, r) {
153
+ function rr(t, e, n, o, i, r) {
154
154
  const a = e.split("");
155
155
  let s = "", l = r * 1.2, h = o;
156
156
  for (let u = 0; u < a.length; u++) {
@@ -184,7 +184,7 @@ var Kt = (t, e, n = 0.01) => {
184
184
  angle: l
185
185
  };
186
186
  };
187
- function rr(t, e, n) {
187
+ function or(t, e, n) {
188
188
  const o = new c.BufferGeometry(), i = [], r = [];
189
189
  t.forEach((s) => i.push(s.x, s.y, s.z)), e.forEach((s) => i.push(s.x, s.y, s.z)), r.push(0, 2, 1, 0, 3, 2), r.push(4, 5, 6, 4, 6, 7), r.push(0, 1, 5, 0, 5, 4), r.push(1, 2, 6, 1, 6, 5), r.push(2, 3, 7, 2, 7, 6), r.push(3, 0, 4, 3, 4, 7), o.setAttribute("position", new c.Float32BufferAttribute(i, 3)), o.setIndex(r), o.computeVertexNormals();
190
190
  const a = new c.MeshBasicMaterial({
@@ -210,7 +210,7 @@ var Te = class {
210
210
  }, this.label = null, this.labelElement = null, this.createLabel();
211
211
  }
212
212
  createLabel() {
213
- return this.labelElement = document.createElement("div"), this.labelElement.textContent = this.config.value, this.applyBlackWhiteStyle(), this.label = new tr(this.labelElement), this.label.position.copy(this.config.position), this.label;
213
+ return this.labelElement = document.createElement("div"), this.labelElement.textContent = this.config.value, this.applyBlackWhiteStyle(), this.label = new er(this.labelElement), this.label.position.copy(this.config.position), this.label;
214
214
  }
215
215
  applyBlackWhiteStyle() {
216
216
  const t = this.labelElement.style, e = this.config;
@@ -237,7 +237,7 @@ var Te = class {
237
237
  dispose() {
238
238
  this.labelElement && this.labelElement.parentNode && this.labelElement.parentNode.removeChild(this.labelElement), this.label = null, this.labelElement = null;
239
239
  }
240
- }, or = (t) => {
240
+ }, ir = (t) => {
241
241
  const e = new c.Group(), n = new c.Group();
242
242
  if (t && t.length) {
243
243
  const o = [
@@ -445,7 +445,7 @@ var Te = class {
445
445
  depthWrite: !1
446
446
  }), T = new c.Line(A, D);
447
447
  h != "door" ? n.add(T) : e.add(T);
448
- const B = rr(_.map((W) => new c.Vector3(W.x, W.y, P.heightData.minZ)), _.map((W) => new c.Vector3(W.x, W.y, W.z)), h);
448
+ const B = or(_.map((W) => new c.Vector3(W.x, W.y, P.heightData.minZ)), _.map((W) => new c.Vector3(W.x, W.y, W.z)), h);
449
449
  h != "door" ? n.add(B) : e.add(B);
450
450
  const [L, I, C] = V, R = L.distanceTo(I), k = new c.Vector3().copy(L).add(I).multiplyScalar(0.5);
451
451
  new Te({
@@ -471,7 +471,7 @@ var Te = class {
471
471
  AiProjectionGroup: e,
472
472
  AiProjectionGroup2: n
473
473
  };
474
- }, ir = (t, e, n, o) => {
474
+ }, ar = (t, e, n, o) => {
475
475
  const i = t;
476
476
  let r = [];
477
477
  if (o && o.length && (r = o.map((x) => x.clone())), !i || i.length < 4) return {};
@@ -592,7 +592,7 @@ var Te = class {
592
592
  closestDistance: null
593
593
  };
594
594
  g < 0 && f.negate();
595
- const S = new c.Vector3().addVectors(d, f).normalize(), P = new c.Vector3().addVectors(t, e).multiplyScalar(0.5), y = We(n, P, d), m = We(o, P, d), p = (y + m) / 2, v = Math.max(y, m), x = t.dot(S), M = e.dot(S), z = n.dot(S), V = o.dot(S), _ = Math.min(x, M), A = Math.max(x, M), D = Math.min(z, V), T = Math.max(z, V), B = A - _, L = T - D, I = Math.min(B, L), C = Math.min(A, T) - Math.max(_, D), R = C < 0 ? -C : 0, k = C > 0 ? C : 0, E = I > 0 ? k / I : 0, G = ar(t, e, n, o), W = b <= a && p < s;
595
+ const S = new c.Vector3().addVectors(d, f).normalize(), P = new c.Vector3().addVectors(t, e).multiplyScalar(0.5), y = We(n, P, d), m = We(o, P, d), p = (y + m) / 2, v = Math.max(y, m), x = t.dot(S), M = e.dot(S), z = n.dot(S), V = o.dot(S), _ = Math.min(x, M), A = Math.max(x, M), D = Math.min(z, V), T = Math.max(z, V), B = A - _, L = T - D, I = Math.min(B, L), C = Math.min(A, T) - Math.max(_, D), R = C < 0 ? -C : 0, k = C > 0 ? C : 0, E = I > 0 ? k / I : 0, G = sr(t, e, n, o), W = b <= a && p < s;
596
596
  let O;
597
597
  return W ? O = E > 0.5 ? "collinear_overlap" : "collinear_gap" : b <= r && (O = "parallel_offset"), {
598
598
  type: O,
@@ -608,7 +608,7 @@ function We(t, e, n) {
608
608
  const o = new c.Vector3().subVectors(t, e), i = o.dot(n), r = n.clone().multiplyScalar(i);
609
609
  return new c.Vector3().subVectors(o, r).length();
610
610
  }
611
- function ar(t, e, n, o) {
611
+ function sr(t, e, n, o) {
612
612
  const i = new c.Vector3().subVectors(e, t), r = new c.Vector3().subVectors(o, n), a = new c.Vector3().subVectors(n, t), s = i.dot(i), l = i.dot(r), h = r.dot(r), u = i.dot(a), d = r.dot(a), f = s * h - l * l;
613
613
  let g, b;
614
614
  f < 1e-10 ? (g = 0, b = h !== 0 ? d / h : 0) : (g = (l * d - h * u) / f, b = (s * d - l * u) / f), g = c.MathUtils.clamp(g, 0, 1), b = h !== 0 ? c.MathUtils.clamp((l * g + d) / h, 0, 1) : 0, g = s !== 0 ? c.MathUtils.clamp((l * b - u) / s, 0, 1) : 0;
@@ -687,7 +687,7 @@ var ei = (t, e, n, o = 0.05, i = 0.02) => {
687
687
  newProjectPoints: b,
688
688
  newOnLinePoints: g
689
689
  };
690
- }, sr = (t) => {
690
+ }, lr = (t) => {
691
691
  function e(n, o, i, r, a, s, l, h, u) {
692
692
  let d = new c.Line3(n, o), f = /* @__PURE__ */ new Map(), g = new c.Vector3(), b = n.clone(), w = o.clone(), S = 0;
693
693
  for (; ; ) {
@@ -746,7 +746,7 @@ var ei = (t, e, n, o = 0.05, i = 0.02) => {
746
746
  const { newOriginalPoints: p } = Me(f, g, o.originalPoints);
747
747
  o.originalPoints = p;
748
748
  }
749
- }, jt = (t, e) => new c.Vector3(t.x, t.y, 0).distanceTo(new c.Vector3(e.x, e.y, 0)), lr = (t, e, n = 1e-6) => {
749
+ }, jt = (t, e) => new c.Vector3(t.x, t.y, 0).distanceTo(new c.Vector3(e.x, e.y, 0)), cr = (t, e, n = 1e-6) => {
750
750
  const o = new c.Vector3();
751
751
  return t.closestPointToPoint(e, !0, o), o.distanceTo(e) < n;
752
752
  }, He = (t) => {
@@ -756,7 +756,7 @@ var ei = (t, e, n, o = 0.05, i = 0.02) => {
756
756
  r > e && (e = r, n = [t[o], t[i]]);
757
757
  }
758
758
  return n;
759
- }, Tt = (t, e, n = 0.03) => Math.abs(t.x - e.x) < n && Math.abs(t.y - e.y) < n && Math.abs(t.z - e.z) < n, cr = (t) => {
759
+ }, Tt = (t, e, n = 0.03) => Math.abs(t.x - e.x) < n && Math.abs(t.y - e.y) < n && Math.abs(t.z - e.z) < n, ur = (t) => {
760
760
  const e = [];
761
761
  t.children.forEach((n) => {
762
762
  n.type == "GridHelper" || n.type == "DirectionalLight" || n.type == "AmbientLight" || e.push(n);
@@ -778,14 +778,14 @@ function Ne(t) {
778
778
  }
779
779
  t.dispose();
780
780
  }
781
- var ur = (t, e = 1e-3) => {
781
+ var hr = (t, e = 1e-3) => {
782
782
  const n = /* @__PURE__ */ new Map(), o = [];
783
783
  for (const i of t) {
784
784
  const r = `${Math.round(i.x / e)},${Math.round(i.y / e)},${Math.round(i.z / e)}`;
785
785
  n.has(r) || (n.set(r, !0), o.push(i));
786
786
  }
787
787
  return o;
788
- }, hr = class {
788
+ }, dr = class {
789
789
  results;
790
790
  clusterResults;
791
791
  constructor() {
@@ -1229,13 +1229,13 @@ var ur = (t, e = 1e-3) => {
1229
1229
  return console.error("合并网格时出错:", n), null;
1230
1230
  }
1231
1231
  }
1232
- }, dr = (t) => {
1232
+ }, fr = (t) => {
1233
1233
  let e = {};
1234
1234
  const n = [], o = [], i = [];
1235
1235
  return t[0].width, t[0].height, t.forEach((r) => {
1236
1236
  o.push(...r.vertices), i.push(r.center), n.push(r.vertices);
1237
1237
  }), e.originalVertices = n, e.allCenterPoints = i, e;
1238
- }, fr = (t) => {
1238
+ }, mr = (t) => {
1239
1239
  const e = new wt().copy(t.start).add(t.end).multiplyScalar(0.5), n = new wt().subVectors(new wt(e.x, e.y, e.z + 1), e).normalize(), o = new wt(t.direction.x, t.direction.y, 0);
1240
1240
  o.applyAxisAngle(n, Math.PI / 2);
1241
1241
  const i = new wt().copy(e).add(o.clone().multiplyScalar(t.length)), r = new wt().copy(e).sub(o.clone().multiplyScalar(t.length));
@@ -1255,7 +1255,7 @@ var ur = (t, e = 1e-3) => {
1255
1255
  a.applyEuler(new c.Euler(-Math.PI / 2, 0, 0));
1256
1256
  let s = new c.Vector3(r.end.x, r.end.y, r.end.z);
1257
1257
  if (s.applyEuler(new c.Euler(-Math.PI / 2, 0, 0)), e.add(xe(String(i), new c.Vector3((a.x + s.x) / 2, (a.y + s.y) / 2, (a.z + s.z) / 2))), (r.isBayWindow || r.isWindow) && n) continue;
1258
- const l = new Hn().setFromCoplanarPoints(new wt(r.start.x, r.start.y, r.start.z), new wt(r.end.x, r.end.y, r.end.z), new wt(r.start.x, r.start.y, r.rooftopPz)), h = [];
1258
+ const l = new Nn().setFromCoplanarPoints(new wt(r.start.x, r.start.y, r.start.z), new wt(r.end.x, r.end.y, r.end.z), new wt(r.start.x, r.start.y, r.rooftopPz)), h = [];
1259
1259
  r.originalPoints.forEach((x, M) => {
1260
1260
  const z = new wt();
1261
1261
  l.projectPoint(x, z), h.push(z);
@@ -1266,7 +1266,7 @@ var ur = (t, e = 1e-3) => {
1266
1266
  wireframe: !1,
1267
1267
  transparent: !0,
1268
1268
  opacity: 0.5
1269
- }), g = new c.Group(), b = new hr(), { horizontalSubdivisions: w, verticalSubdivisions: S } = b.initLimits4(u, d), P = b.createSubdividedWallPlane(r, S, w, f, g);
1269
+ }), g = new c.Group(), b = new dr(), { horizontalSubdivisions: w, verticalSubdivisions: S } = b.initLimits4(u, d), P = b.createSubdividedWallPlane(r, S, w, f, g);
1270
1270
  b.analyzePointDistribution(P, h, 0.01);
1271
1271
  const y = new c.MeshBasicMaterial({
1272
1272
  color: "black",
@@ -1275,10 +1275,10 @@ var ur = (t, e = 1e-3) => {
1275
1275
  side: c.DoubleSide
1276
1276
  }), m = b.highlightEmptySegments(P, y, g), p = [];
1277
1277
  for (const x of m.clusters) {
1278
- const M = dr(x);
1278
+ const M = fr(x);
1279
1279
  M && p.push(M);
1280
1280
  }
1281
- const v = fr(r).direction;
1281
+ const v = mr(r).direction;
1282
1282
  r.checkResults = p, r.verticalDirection = v, r.originaIndex = i, o.push(r);
1283
1283
  }
1284
1284
  return o;
@@ -1304,8 +1304,8 @@ var ur = (t, e = 1e-3) => {
1304
1304
  p.push(s.clone().addScaledVector(u, a)), p.push(p[0].clone().addScaledVector(h, b)), p.push(p[1].clone().addScaledVector(d, a * 2)), p.push(s.clone().addScaledVector(d, b));
1305
1305
  let v = [];
1306
1306
  for (let x = 0; x < i.length; x++)
1307
- f.includes(x) || gr(i[x], p) && (f.push(x), v.push(i[x]));
1308
- v.length > 0 && g.push(pr(v)), s = s.addScaledVector(h, b);
1307
+ f.includes(x) || pr(i[x], p) && (f.push(x), v.push(i[x]));
1308
+ v.length > 0 && g.push(yr(v)), s = s.addScaledVector(h, b);
1309
1309
  }
1310
1310
  const w = new Float32Array(i.length * 3);
1311
1311
  i.forEach((m, p) => {
@@ -1316,11 +1316,11 @@ var ur = (t, e = 1e-3) => {
1316
1316
  color: wn(),
1317
1317
  size: 0.02
1318
1318
  })));
1319
- const [P, y] = br(g, {
1319
+ const [P, y] = vr(g, {
1320
1320
  plane: "xy",
1321
1321
  trimRatio: 0
1322
1322
  });
1323
- er(P, y, e);
1323
+ nr(P, y, e);
1324
1324
  }
1325
1325
  };
1326
1326
  function $e(t, e = "xy") {
@@ -1338,31 +1338,31 @@ function $e(t, e = "xy") {
1338
1338
  };
1339
1339
  throw new Error(`Unsupported plane: ${e}`);
1340
1340
  }
1341
- function mr(t, e, n) {
1341
+ function gr(t, e, n) {
1342
1342
  const o = e.x - t.x, i = e.y - t.y, r = n.x - t.x;
1343
1343
  return o * (n.y - t.y) - i * r;
1344
1344
  }
1345
- function gr(t, e, n = "xy") {
1345
+ function pr(t, e, n = "xy") {
1346
1346
  if (!e || e.length !== 4) throw new Error("rectPoints must contain 4 points");
1347
1347
  const o = $e(t, n), i = e.map((s) => $e(s, n));
1348
1348
  let r = !1, a = !1;
1349
1349
  for (let s = 0; s < 4; s++) {
1350
- const l = i[s], h = i[(s + 1) % 4], u = mr(l, h, o);
1350
+ const l = i[s], h = i[(s + 1) % 4], u = gr(l, h, o);
1351
1351
  if (u > 1e-9 && (r = !0), u < -1e-9 && (a = !0), r && a) return !1;
1352
1352
  }
1353
1353
  return !0;
1354
1354
  }
1355
- function pr(t) {
1355
+ function yr(t) {
1356
1356
  if (!t || t.length === 0) return null;
1357
1357
  const e = new c.Vector3(0, 0, 0);
1358
1358
  for (const n of t) Array.isArray(n) ? (e.x += n[0], e.y += n[1], e.z += n[2]) : (e.x += n.x, e.y += n.y, e.z += n.z);
1359
1359
  return e.divideScalar(t.length), e;
1360
1360
  }
1361
- function yr(t) {
1361
+ function xr(t) {
1362
1362
  return t instanceof c.Vector3 ? t.clone() : Array.isArray(t) ? new c.Vector3(t[0], t[1], t[2]) : new c.Vector3(t.x, t.y, t.z);
1363
1363
  }
1364
- function xr(t, e = "xy") {
1365
- const n = yr(t);
1364
+ function wr(t, e = "xy") {
1365
+ const n = xr(t);
1366
1366
  if (e === "xy") return {
1367
1367
  x: n.x,
1368
1368
  y: n.y,
@@ -1386,7 +1386,7 @@ function Xe(t, e, n, o = "xy") {
1386
1386
  if (o === "yz") return new c.Vector3(n, t, e);
1387
1387
  throw new Error(`Unsupported plane: ${o}`);
1388
1388
  }
1389
- function wr(t, e, n) {
1389
+ function br(t, e, n) {
1390
1390
  if (Math.abs(e) < 1e-12) return t >= n ? {
1391
1391
  x: 1,
1392
1392
  y: 0
@@ -1405,10 +1405,10 @@ function wr(t, e, n) {
1405
1405
  y: h / u
1406
1406
  };
1407
1407
  }
1408
- function br(t, e = {}) {
1408
+ function vr(t, e = {}) {
1409
1409
  const { plane: n = "xy", trimRatio: o = 0 } = e;
1410
1410
  if (!t || t.length < 2) return null;
1411
- const i = t.map((L) => xr(L, n));
1411
+ const i = t.map((L) => wr(L, n));
1412
1412
  let r = 0, a = 0, s = 0;
1413
1413
  for (const L of i)
1414
1414
  r += L.x, a += L.y, s += L.up;
@@ -1419,7 +1419,7 @@ function br(t, e = {}) {
1419
1419
  l += I * I, h += I * C, u += C * C;
1420
1420
  }
1421
1421
  l /= i.length, h /= i.length, u /= i.length;
1422
- const d = wr(l, h, u), f = {
1422
+ const d = br(l, h, u), f = {
1423
1423
  x: -d.y,
1424
1424
  y: d.x
1425
1425
  }, g = [];
@@ -1445,7 +1445,7 @@ function br(t, e = {}) {
1445
1445
  return [Xe(A, D, V, n), Xe(T, B, _, n)];
1446
1446
  }
1447
1447
  var oi = async (t, e, n, o) => {
1448
- cr(o);
1448
+ ur(o);
1449
1449
  let i = await fetch(t);
1450
1450
  if (!i) return;
1451
1451
  let r = await i.json();
@@ -1477,7 +1477,7 @@ var oi = async (t, e, n, o) => {
1477
1477
  }
1478
1478
  }
1479
1479
  o.add(g), console.log(w), console.time();
1480
- const { beamGroup: x } = await vr(r, y, p, w, o);
1480
+ const { beamGroup: x } = await Mr(r, y, p, w, o);
1481
1481
  console.timeEnd(), console.log("beamGroup", x);
1482
1482
  const M = new c.MeshBasicMaterial({
1483
1483
  color: "#cffd00",
@@ -1574,7 +1574,7 @@ var oi = async (t, e, n, o) => {
1574
1574
  k.rotateX(-Math.PI / 2), l.add(new c.Line(k, L)), B.forEach((E) => E.dispose());
1575
1575
  }
1576
1576
  o.add(l);
1577
- const { AiProjectionGroup: C, AiProjectionGroup2: R } = or(p);
1577
+ const { AiProjectionGroup: C, AiProjectionGroup2: R } = ir(p);
1578
1578
  return h.add(C), h.rotateX(-Math.PI / 2), o.add(h), u.add(R), u.visible = !1, u.rotateX(-Math.PI / 2), o.add(u), console.log("jsonpcdData", p), r.forEach((k) => {
1579
1579
  k.doorAndBeamData && k.doorAndBeamData.length > 0 && (k.doorAndBeamData.forEach((E) => {
1580
1580
  if (E.beamStart) {
@@ -1638,12 +1638,12 @@ var oi = async (t, e, n, o) => {
1638
1638
  beamDoorGroup: f,
1639
1639
  lineIndexGroup: g
1640
1640
  };
1641
- }, vr = async (t, e, n, o, i) => {
1641
+ }, Mr = async (t, e, n, o, i) => {
1642
1642
  if (o && o.length > 0) for (let m = 0; m < o.length; m++) {
1643
1643
  const p = o[m];
1644
1644
  p.isLine2 = !0, t.push(p);
1645
1645
  }
1646
- if (sr(t, i), t.length <= 0 || e.length <= 0) return t;
1646
+ if (lr(t, i), t.length <= 0 || e.length <= 0) return t;
1647
1647
  n || (n = []);
1648
1648
  for (const m of t) {
1649
1649
  let p = [];
@@ -1795,7 +1795,7 @@ var oi = async (t, e, n, o) => {
1795
1795
  const M = new c.Vector3(p.start.x, p.start.y, p.start.z), z = new c.Vector3(p.end.x, p.end.y, p.end.z);
1796
1796
  let V = p.rooftopPz - p.start.z, _ = 0;
1797
1797
  for (const D of p.mergeCheckRegion) {
1798
- const { facePoints: T, boxArea: B, totalInPlaneNum: L } = ir(D.points, D.gridWidth, D.gridHeight, D.centerPts);
1798
+ const { facePoints: T, boxArea: B, totalInPlaneNum: L } = ar(D.points, D.gridWidth, D.gridHeight, D.centerPts);
1799
1799
  if (!T || T.length <= 0) continue;
1800
1800
  T[0].distanceTo(T[1]);
1801
1801
  let I = T[0].distanceTo(T[3]);
@@ -2090,8 +2090,8 @@ var oi = async (t, e, n, o) => {
2090
2090
  let dt = j.closestPointToPoint(Ct[rt], !0, kt);
2091
2091
  dt.distanceTo(Ct[rt]) < 0.15 && (tt.push(Ct[rt]), mt.push(dt.clone()));
2092
2092
  }
2093
- for (let rt = 0; rt < mt.length; rt++) lr(j, mt[rt]) && tt.push(mt[rt]);
2094
- if (tt = mt, tt = ur(tt), tt.length < 150) continue;
2093
+ for (let rt = 0; rt < mt.length; rt++) cr(j, mt[rt]) && tt.push(mt[rt]);
2094
+ if (tt = mt, tt = hr(tt), tt.length < 150) continue;
2095
2095
  let ot = He(tt);
2096
2096
  if (ot.length == 2) {
2097
2097
  let rt = ot[0].distanceTo(ot[1]);
@@ -2484,7 +2484,7 @@ var oi = async (t, e, n, o) => {
2484
2484
  u.indexs.length == 3 && (u.indexs.forEach((P) => o.add(P)), n.threeEdgeRect.push(u));
2485
2485
  }
2486
2486
  return n;
2487
- }, yt = 11102230246251565e-32, Ht = 134217729, Mr = (3 + 8 * yt) * yt;
2487
+ }, yt = 11102230246251565e-32, Ht = 134217729, Pr = (3 + 8 * yt) * yt;
2488
2488
  function Be(t, e, n, o, i) {
2489
2489
  let r, a, s, l, h = e[0], u = o[0], d = 0, f = 0;
2490
2490
  u > h == u > -h ? (r = h, h = e[++d]) : (r = u, u = o[++f]);
@@ -2498,7 +2498,7 @@ function Be(t, e, n, o, i) {
2498
2498
  a = r + u, l = a - r, s = r - (a - l) + (u - l), u = o[++f], r = a, s !== 0 && (i[g++] = s);
2499
2499
  return (r !== 0 || g === 0) && (i[g++] = r), g;
2500
2500
  }
2501
- function Pr(t, e) {
2501
+ function zr(t, e) {
2502
2502
  let n = e[0];
2503
2503
  for (let o = 1; o < t; o++) n += e[o];
2504
2504
  return n;
@@ -2506,13 +2506,13 @@ function Pr(t, e) {
2506
2506
  function q(t) {
2507
2507
  return new Float64Array(t);
2508
2508
  }
2509
- var zr = (3 + 16 * yt) * yt, Vr = (2 + 12 * yt) * yt, Sr = (9 + 64 * yt) * yt * yt, de = q(4), Ye = q(8), je = q(12), Ue = q(16), Xt = q(4);
2510
- function _r(t, e, n, o, i, r, a) {
2509
+ var Vr = (3 + 16 * yt) * yt, Sr = (2 + 12 * yt) * yt, _r = (9 + 64 * yt) * yt * yt, de = q(4), Ye = q(8), je = q(12), Ue = q(16), Xt = q(4);
2510
+ function Dr(t, e, n, o, i, r, a) {
2511
2511
  let s, l, h, u, d, f, g, b, w, S, P, y, m, p, v, x, M, z;
2512
2512
  const V = t - i, _ = n - i, A = e - r, D = o - r;
2513
2513
  p = V * D, f = Ht * V, g = f - (f - V), b = V - g, f = Ht * D, w = f - (f - D), S = D - w, v = b * S - (p - g * w - b * w - g * S), x = A * _, f = Ht * A, g = f - (f - A), b = A - g, f = Ht * _, w = f - (f - _), S = _ - w, M = b * S - (x - g * w - b * w - g * S), P = v - M, d = v - P, de[0] = v - (P + d) + (d - M), y = p + P, d = y - p, m = p - (y - d) + (P - d), P = m - x, d = m - P, de[1] = m - (P + d) + (d - x), z = y + P, d = z - y, de[2] = y - (z - d) + (P - d), de[3] = z;
2514
- let T = Pr(4, de), B = Vr * a;
2515
- if (T >= B || -T >= B || (d = t - V, s = t - (V + d) + (d - i), d = n - _, h = n - (_ + d) + (d - i), d = e - A, l = e - (A + d) + (d - r), d = o - D, u = o - (D + d) + (d - r), s === 0 && l === 0 && h === 0 && u === 0) || (B = Sr * a + Mr * Math.abs(T), T += V * u + D * s - (A * h + _ * l), T >= B || -T >= B)) return T;
2514
+ let T = zr(4, de), B = Sr * a;
2515
+ if (T >= B || -T >= B || (d = t - V, s = t - (V + d) + (d - i), d = n - _, h = n - (_ + d) + (d - i), d = e - A, l = e - (A + d) + (d - r), d = o - D, u = o - (D + d) + (d - r), s === 0 && l === 0 && h === 0 && u === 0) || (B = _r * a + Pr * Math.abs(T), T += V * u + D * s - (A * h + _ * l), T >= B || -T >= B)) return T;
2516
2516
  p = s * D, f = Ht * s, g = f - (f - s), b = s - g, f = Ht * D, w = f - (f - D), S = D - w, v = b * S - (p - g * w - b * w - g * S), x = l * _, f = Ht * l, g = f - (f - l), b = l - g, f = Ht * _, w = f - (f - _), S = _ - w, M = b * S - (x - g * w - b * w - g * S), P = v - M, d = v - P, Xt[0] = v - (P + d) + (d - M), y = p + P, d = y - p, m = p - (y - d) + (P - d), P = m - x, d = m - P, Xt[1] = m - (P + d) + (d - x), z = y + P, d = z - y, Xt[2] = y - (z - d) + (P - d), Xt[3] = z;
2517
2517
  const L = Be(4, de, 4, Xt, Ye);
2518
2518
  p = V * u, f = Ht * V, g = f - (f - V), b = V - g, f = Ht * u, w = f - (f - u), S = u - w, v = b * S - (p - g * w - b * w - g * S), x = A * h, f = Ht * A, g = f - (f - A), b = A - g, f = Ht * h, w = f - (f - h), S = h - w, M = b * S - (x - g * w - b * w - g * S), P = v - M, d = v - P, Xt[0] = v - (P + d) + (d - M), y = p + P, d = y - p, m = p - (y - d) + (P - d), P = m - x, d = m - P, Xt[1] = m - (P + d) + (d - x), z = y + P, d = z - y, Xt[2] = y - (z - d) + (P - d), Xt[3] = z;
@@ -2521,10 +2521,10 @@ function _r(t, e, n, o, i, r, a) {
2521
2521
  }
2522
2522
  function ze(t, e, n, o, i, r) {
2523
2523
  const a = (e - r) * (n - i), s = (t - i) * (o - r), l = a - s, h = Math.abs(a + s);
2524
- return Math.abs(l) >= zr * h ? l : -_r(t, e, n, o, i, r, h);
2524
+ return Math.abs(l) >= Vr * h ? l : -Dr(t, e, n, o, i, r, h);
2525
2525
  }
2526
2526
  var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt * yt, ui = q(4), hi = q(4), di = q(4), fi = q(4), mi = q(4), gi = q(4), pi = q(4), yi = q(4), xi = q(4), wi = q(8), bi = q(8), vi = q(8), Mi = q(4), Pi = q(8), zi = q(8), Vi = q(16), Si = q(12), _i = q(192), Di = q(192), Ei = (10 + 96 * yt) * yt, Ai = (4 + 48 * yt) * yt, Ti = (44 + 576 * yt) * yt * yt, Bi = q(4), Ii = q(4), ki = q(4), Li = q(4), Ci = q(4), Ri = q(4), Fi = q(4), Gi = q(4), qi = q(8), Wi = q(8), Oi = q(8), Hi = q(8), Ni = q(8), $i = q(8), Xi = q(8), Yi = q(8), ji = q(8), Ui = q(4), Zi = q(4), Ki = q(4), Qi = q(8), Ji = q(16), ta = q(16), ea = q(16), na = q(32), ra = q(32), oa = q(48), ia = q(64), aa = q(1152), sa = q(1152), la = (16 + 224 * yt) * yt, ca = (5 + 72 * yt) * yt, ua = (71 + 1408 * yt) * yt * yt, ha = q(4), da = q(4), fa = q(4), ma = q(4), ga = q(4), pa = q(4), ya = q(4), xa = q(4), wa = q(4), ba = q(4), va = q(24), Ma = q(24), Pa = q(24), za = q(24), Va = q(24), Sa = q(24), _a = q(24), Da = q(24), Ea = q(24), Aa = q(24), Ta = q(1152), Ba = q(1152), Ia = q(1152), ka = q(1152), La = q(1152), Ca = q(2304), Ra = q(2304), Fa = q(3456), Ga = q(5760), qa = q(8), Wa = q(8), Oa = q(8), Ha = q(16), Na = q(24), $a = q(48), Xa = q(48), Ya = q(96), ja = q(192), Ua = q(384), Za = q(384), Ka = q(384), Qa = q(768), Ja = q(96), ts = q(96), es = q(96), ns = q(1152), Ze = Math.pow(2, -52), Ve = new Uint32Array(512), Ke = class vn {
2527
- static from(e, n = Br, o = Ir) {
2527
+ static from(e, n = Ir, o = kr) {
2528
2528
  const i = e.length, r = new Float64Array(i * 2);
2529
2529
  for (let a = 0; a < i; a++) {
2530
2530
  const s = e[a];
@@ -2561,7 +2561,7 @@ var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt
2561
2561
  let y = e[2 * b], m = e[2 * b + 1], p = 1 / 0;
2562
2562
  for (let V = 0; V < a; V++) {
2563
2563
  if (V === g || V === b) continue;
2564
- const _ = Ar(S, P, y, m, e[2 * V], e[2 * V + 1]);
2564
+ const _ = Tr(S, P, y, m, e[2 * V], e[2 * V + 1]);
2565
2565
  _ < p && (w = V, p = _);
2566
2566
  }
2567
2567
  let v = e[2 * w], x = e[2 * w + 1];
@@ -2581,7 +2581,7 @@ var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt
2581
2581
  const V = b, _ = y, A = m;
2582
2582
  b = w, y = v, m = x, w = V, v = _, x = A;
2583
2583
  }
2584
- const M = Tr(S, P, y, m, v, x);
2584
+ const M = Br(S, P, y, m, v, x);
2585
2585
  this._cx = M.x, this._cy = M.y;
2586
2586
  for (let V = 0; V < a; V++) this._dists[V] = Ie(e[2 * V], e[2 * V + 1], M.x, M.y);
2587
2587
  ge(this._ids, this._dists, 0, a - 1), this._hullStart = g;
@@ -2616,7 +2616,7 @@ var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt
2616
2616
  this.triangles = this._triangles.subarray(0, this.trianglesLen), this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
2617
2617
  }
2618
2618
  _hashKey(e, n) {
2619
- return Math.floor(Dr(e - this._cx, n - this._cy) * this._hashSize) % this._hashSize;
2619
+ return Math.floor(Er(e - this._cx, n - this._cy) * this._hashSize) % this._hashSize;
2620
2620
  }
2621
2621
  _legalize(e) {
2622
2622
  const { _triangles: n, _halfedges: o, coords: i } = this;
@@ -2629,7 +2629,7 @@ var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt
2629
2629
  continue;
2630
2630
  }
2631
2631
  const h = s - s % 3, u = l + (e + 1) % 3, d = h + (s + 2) % 3, f = n[a], g = n[e], b = n[u], w = n[d];
2632
- if (Er(i[2 * f], i[2 * f + 1], i[2 * g], i[2 * g + 1], i[2 * b], i[2 * b + 1], i[2 * w], i[2 * w + 1])) {
2632
+ if (Ar(i[2 * f], i[2 * f + 1], i[2 * g], i[2 * g + 1], i[2 * b], i[2 * b + 1], i[2 * w], i[2 * w + 1])) {
2633
2633
  n[e] = w, n[s] = f;
2634
2634
  const S = o[d];
2635
2635
  if (S === -1) {
@@ -2660,7 +2660,7 @@ var si = (7 + 56 * yt) * yt, li = (3 + 28 * yt) * yt, ci = (26 + 288 * yt) * yt
2660
2660
  return this._triangles[s] = e, this._triangles[s + 1] = n, this._triangles[s + 2] = o, this._link(s, i), this._link(s + 1, r), this._link(s + 2, a), this.trianglesLen += 3, s;
2661
2661
  }
2662
2662
  };
2663
- function Dr(t, e) {
2663
+ function Er(t, e) {
2664
2664
  const n = t / (Math.abs(t) + Math.abs(e));
2665
2665
  return (e > 0 ? 3 - n : 1 + n) / 4;
2666
2666
  }
@@ -2668,15 +2668,15 @@ function Ie(t, e, n, o) {
2668
2668
  const i = t - n, r = e - o;
2669
2669
  return i * i + r * r;
2670
2670
  }
2671
- function Er(t, e, n, o, i, r, a, s) {
2671
+ function Ar(t, e, n, o, i, r, a, s) {
2672
2672
  const l = t - a, h = e - s, u = n - a, d = o - s, f = i - a, g = r - s, b = l * l + h * h, w = u * u + d * d, S = f * f + g * g;
2673
2673
  return l * (d * S - w * g) - h * (u * S - w * f) + b * (u * g - d * f) < 0;
2674
2674
  }
2675
- function Ar(t, e, n, o, i, r) {
2675
+ function Tr(t, e, n, o, i, r) {
2676
2676
  const a = n - t, s = o - e, l = i - t, h = r - e, u = a * a + s * s, d = l * l + h * h, f = 0.5 / (a * h - s * l), g = (h * u - s * d) * f, b = (a * d - l * u) * f;
2677
2677
  return g * g + b * b;
2678
2678
  }
2679
- function Tr(t, e, n, o, i, r) {
2679
+ function Br(t, e, n, o, i, r) {
2680
2680
  const a = n - t, s = o - e, l = i - t, h = r - e, u = a * a + s * s, d = l * l + h * h, f = 0.5 / (a * h - s * l);
2681
2681
  return {
2682
2682
  x: t + (h * u - s * d) * f,
@@ -2712,10 +2712,10 @@ function ve(t, e, n) {
2712
2712
  const o = t[e];
2713
2713
  t[e] = t[n], t[n] = o;
2714
2714
  }
2715
- function Br(t) {
2715
+ function Ir(t) {
2716
2716
  return t[0];
2717
2717
  }
2718
- function Ir(t) {
2718
+ function kr(t) {
2719
2719
  return t[1];
2720
2720
  }
2721
2721
  var Qe = 1e-6, he = class {
@@ -2759,7 +2759,7 @@ var Qe = 1e-6, he = class {
2759
2759
  value() {
2760
2760
  return this._.length ? this._ : null;
2761
2761
  }
2762
- }, kr = class {
2762
+ }, Lr = class {
2763
2763
  constructor(t, [e, n, o, i] = [
2764
2764
  0,
2765
2765
  0,
@@ -3026,14 +3026,14 @@ var Qe = 1e-6, he = class {
3026
3026
  }
3027
3027
  return t;
3028
3028
  }
3029
- }, Lr = 2 * Math.PI, fe = Math.pow;
3030
- function Cr(t) {
3029
+ }, Cr = 2 * Math.PI, fe = Math.pow;
3030
+ function Rr(t) {
3031
3031
  return t[0];
3032
3032
  }
3033
- function Rr(t) {
3033
+ function Fr(t) {
3034
3034
  return t[1];
3035
3035
  }
3036
- function Fr(t) {
3036
+ function Gr(t) {
3037
3037
  const { triangles: e, coords: n } = t;
3038
3038
  for (let o = 0; o < e.length; o += 3) {
3039
3039
  const i = 2 * e[o], r = 2 * e[o + 1], a = 2 * e[o + 2];
@@ -3041,12 +3041,12 @@ function Fr(t) {
3041
3041
  }
3042
3042
  return !0;
3043
3043
  }
3044
- function Gr(t, e, n) {
3044
+ function qr(t, e, n) {
3045
3045
  return [t + Math.sin(t + e) * n, e + Math.cos(t - e) * n];
3046
3046
  }
3047
- var qr = class Mn {
3048
- static from(e, n = Cr, o = Rr, i) {
3049
- return new Mn("length" in e ? Wr(e, n, o, i) : Float64Array.from(Or(e, n, o, i)));
3047
+ var Wr = class Mn {
3048
+ static from(e, n = Rr, o = Fr, i) {
3049
+ return new Mn("length" in e ? Or(e, n, o, i) : Float64Array.from(Hr(e, n, o, i)));
3050
3050
  }
3051
3051
  constructor(e) {
3052
3052
  this._delaunator = new Ke(e), this.inedges = new Int32Array(e.length / 2), this._hullIndex = new Int32Array(e.length / 2), this.points = this._delaunator.coords, this._init();
@@ -3056,7 +3056,7 @@ var qr = class Mn {
3056
3056
  }
3057
3057
  _init() {
3058
3058
  const e = this._delaunator, n = this.points;
3059
- if (e.hull && e.hull.length > 2 && Fr(e)) {
3059
+ if (e.hull && e.hull.length > 2 && Gr(e)) {
3060
3060
  this.collinear = Int32Array.from({ length: n.length / 2 }, (f, g) => g).sort((f, g) => n[2 * f] - n[2 * g] || n[2 * f + 1] - n[2 * g + 1]);
3061
3061
  const l = this.collinear[0], h = this.collinear[this.collinear.length - 1], u = [
3062
3062
  n[2 * l],
@@ -3065,7 +3065,7 @@ var qr = class Mn {
3065
3065
  n[2 * h + 1]
3066
3066
  ], d = 1e-8 * Math.hypot(u[3] - u[1], u[2] - u[0]);
3067
3067
  for (let f = 0, g = n.length / 2; f < g; ++f) {
3068
- const b = Gr(n[2 * f], n[2 * f + 1], d);
3068
+ const b = qr(n[2 * f], n[2 * f + 1], d);
3069
3069
  n[2 * f] = b[0], n[2 * f + 1] = b[1];
3070
3070
  }
3071
3071
  this._delaunator = new Ke(n);
@@ -3079,7 +3079,7 @@ var qr = class Mn {
3079
3079
  i.length <= 2 && i.length > 0 && (this.triangles = new Int32Array(3).fill(-1), this.halfedges = new Int32Array(3).fill(-1), this.triangles[0] = i[0], a[i[0]] = 1, i.length === 2 && (a[i[1]] = 0, this.triangles[1] = i[1], this.triangles[2] = i[1]));
3080
3080
  }
3081
3081
  voronoi(e) {
3082
- return new kr(this, e);
3082
+ return new Lr(this, e);
3083
3083
  }
3084
3084
  *neighbors(e) {
3085
3085
  const { inedges: n, hull: o, _hullIndex: i, halfedges: r, triangles: a, collinear: s } = this;
@@ -3140,7 +3140,7 @@ var qr = class Mn {
3140
3140
  const o = e == null ? e = new he() : void 0, { points: i } = this;
3141
3141
  for (let r = 0, a = i.length; r < a; r += 2) {
3142
3142
  const s = i[r], l = i[r + 1];
3143
- e.moveTo(s + n, l), e.arc(s, l, n, 0, Lr);
3143
+ e.moveTo(s + n, l), e.arc(s, l, n, 0, Cr);
3144
3144
  }
3145
3145
  return o && o.value();
3146
3146
  }
@@ -3170,7 +3170,7 @@ var qr = class Mn {
3170
3170
  return this.renderTriangle(e, n), n.value();
3171
3171
  }
3172
3172
  };
3173
- function Wr(t, e, n, o) {
3173
+ function Or(t, e, n, o) {
3174
3174
  const i = t.length, r = new Float64Array(i * 2);
3175
3175
  for (let a = 0; a < i; ++a) {
3176
3176
  const s = t[a];
@@ -3178,15 +3178,15 @@ function Wr(t, e, n, o) {
3178
3178
  }
3179
3179
  return r;
3180
3180
  }
3181
- function* Or(t, e, n, o) {
3181
+ function* Hr(t, e, n, o) {
3182
3182
  let i = 0;
3183
3183
  for (const r of t)
3184
3184
  yield e.call(o, r, i, t), yield n.call(o, r, i, t), ++i;
3185
3185
  }
3186
- function Hr(t, e, n, o) {
3186
+ function Nr(t, e, n, o) {
3187
3187
  return 1 + (t[e][0] === 0 || t[n][0] === 0 || t[o][0] === 0 ? 1 : 0);
3188
3188
  }
3189
- function Nr(t, e, n, o, i, r) {
3189
+ function $r(t, e, n, o, i, r) {
3190
3190
  const a = Math.hypot(n - i, o - r), s = Math.hypot(t - i, e - r), l = Math.hypot(t - n, e - o), h = Math.abs((n - t) * (r - e) - (i - t) * (o - e)) / 2;
3191
3191
  return h === 0 ? 1 / 0 : a * s * l / (4 * h);
3192
3192
  }
@@ -3198,12 +3198,12 @@ function Je(t) {
3198
3198
  e.has(b) || (e.add(b), n.push(g));
3199
3199
  }
3200
3200
  if (n.length < 3) return [];
3201
- const { triangles: o } = new qr(Float64Array.from(n.flat()));
3201
+ const { triangles: o } = new Wr(Float64Array.from(n.flat()));
3202
3202
  if (!o.length) return [];
3203
3203
  const i = /* @__PURE__ */ new Map(), r = (g, b) => g < b ? `${g}_${b}` : `${b}_${g}`;
3204
3204
  for (let g = 0; g < o.length; g += 3) {
3205
3205
  const b = o[g], w = o[g + 1], S = o[g + 2], [P, y] = n[b], [m, p] = n[w], [v, x] = n[S];
3206
- if (Nr(P, y, m, p, v, x) <= 1 / Hr(n, b, w, S)) for (const [M, z] of [
3206
+ if ($r(P, y, m, p, v, x) <= 1 / Nr(n, b, w, S)) for (const [M, z] of [
3207
3207
  [b, w],
3208
3208
  [w, S],
3209
3209
  [S, b]
@@ -3253,7 +3253,7 @@ var ht = {
3253
3253
  [],
3254
3254
  [],
3255
3255
  []
3256
- ], St = [], se = new wt(), le = new wt(), ce = new wt(), Rt = new wt(), tn = new wt(), en = new wt(), Zt = new pn(), nn = new Gn(), Se = new Ee(), rn = new Ee(), on = new Nn(), Pn = class {
3256
+ ], St = [], se = new wt(), le = new wt(), ce = new wt(), Rt = new wt(), tn = new wt(), en = new wt(), Zt = new pn(), nn = new qn(), Se = new Ee(), rn = new Ee(), on = new $n(), Pn = class {
3257
3257
  constructor(t = new wt(), e = new wt(), n = new pn()) {
3258
3258
  this.center = t, this.halfSize = e, this.rotation = n;
3259
3259
  }
@@ -3283,7 +3283,7 @@ var ht = {
3283
3283
  return Rt.subVectors(t, this.center), this.rotation.extractBasis(se, le, ce), Math.abs(Rt.dot(se)) <= this.halfSize.x && Math.abs(Rt.dot(le)) <= this.halfSize.y && Math.abs(Rt.dot(ce)) <= this.halfSize.z;
3284
3284
  }
3285
3285
  intersectsBox3(t) {
3286
- return this.intersectsOBB($r.fromBox3(t));
3286
+ return this.intersectsOBB(Xr.fromBox3(t));
3287
3287
  }
3288
3288
  intersectsSphere(t) {
3289
3289
  return this.clampPoint(t.center, en), en.distanceToSquared(t.center) <= t.radius * t.radius;
@@ -3325,7 +3325,7 @@ var ht = {
3325
3325
  const r = 1 / n, a = 1 / o, s = 1 / i;
3326
3326
  return Zt.elements[0] *= r, Zt.elements[1] *= r, Zt.elements[2] *= r, Zt.elements[3] *= a, Zt.elements[4] *= a, Zt.elements[5] *= a, Zt.elements[6] *= s, Zt.elements[7] *= s, Zt.elements[8] *= s, this.rotation.multiply(Zt), this.halfSize.x *= n, this.halfSize.y *= o, this.halfSize.z *= i, Rt.setFromMatrixPosition(t), this.center.add(Rt), this;
3327
3327
  }
3328
- }, $r = new Pn(), Wt = 63710088e-1, zn = {
3328
+ }, Xr = new Pn(), Wt = 63710088e-1, zn = {
3329
3329
  centimeters: Wt * 100,
3330
3330
  centimetres: Wt * 100,
3331
3331
  degrees: 360 / (2 * Math.PI),
@@ -3367,12 +3367,12 @@ function _n(t, e, n = {}) {
3367
3367
  coordinates: t
3368
3368
  }, e, n);
3369
3369
  }
3370
- function Xr(t, e = "kilometers") {
3370
+ function Yr(t, e = "kilometers") {
3371
3371
  const n = zn[e];
3372
3372
  if (!n) throw new Error(e + " units is invalid");
3373
3373
  return t * n;
3374
3374
  }
3375
- function Yr(t, e = "kilometers") {
3375
+ function jr(t, e = "kilometers") {
3376
3376
  const n = zn[e];
3377
3377
  if (!n) throw new Error(e + " units is invalid");
3378
3378
  return t / n;
@@ -3385,12 +3385,12 @@ function ee(t) {
3385
3385
  }
3386
3386
  function En(t, e = "kilometers", n = "kilometers") {
3387
3387
  if (!(t >= 0)) throw new Error("length must be a positive number");
3388
- return Xr(Yr(t, e), n);
3388
+ return Yr(jr(t, e), n);
3389
3389
  }
3390
3390
  function an(t) {
3391
3391
  return !isNaN(t) && t !== null && !Array.isArray(t);
3392
3392
  }
3393
- function jr(t) {
3393
+ function Ur(t) {
3394
3394
  return t !== null && typeof t == "object" && !Array.isArray(t);
3395
3395
  }
3396
3396
  function be(t, e, n) {
@@ -3450,13 +3450,13 @@ function be(t, e, n) {
3450
3450
  }
3451
3451
  }
3452
3452
  }
3453
- function Ur(t) {
3453
+ function Zr(t) {
3454
3454
  var e = [];
3455
3455
  return be(t, function(n) {
3456
3456
  e.push(n);
3457
3457
  }), e;
3458
3458
  }
3459
- function Zr(t, e) {
3459
+ function Kr(t, e) {
3460
3460
  var n, o, i, r, a, s, l, h, u, d, f = 0, g = t.type === "FeatureCollection", b = t.type === "Feature", w = g ? t.features.length : 1;
3461
3461
  for (n = 0; n < w; n++) {
3462
3462
  for (s = g ? t.features[n].geometry : b ? t.geometry : t, h = g ? t.features[n].properties : b ? t.properties : {}, u = g ? t.features[n].bbox : b ? t.bbox : void 0, d = g ? t.features[n].id : b ? t.id : void 0, l = s ? s.type === "GeometryCollection" : !1, a = l ? s.geometries.length : 1, i = 0; i < a; i++) {
@@ -3483,13 +3483,13 @@ function Zr(t, e) {
3483
3483
  f++;
3484
3484
  }
3485
3485
  }
3486
- function Kr(t, e, n) {
3486
+ function Qr(t, e, n) {
3487
3487
  var o = n;
3488
- return Zr(t, function(i, r, a, s, l) {
3488
+ return Kr(t, function(i, r, a, s, l) {
3489
3489
  r === 0 && n === void 0 ? o = i : o = e(o, i, r, a, s, l);
3490
3490
  }), o;
3491
3491
  }
3492
- var Qr = /* @__PURE__ */ we(((t, e) => {
3492
+ var Jr = /* @__PURE__ */ we(((t, e) => {
3493
3493
  (function(n, o) {
3494
3494
  typeof t == "object" && typeof e < "u" ? e.exports = o() : typeof define == "function" && define.amd ? define(o) : (n = n || self).RBush = o();
3495
3495
  })(t, function() {
@@ -3707,13 +3707,13 @@ var Qr = /* @__PURE__ */ we(((t, e) => {
3707
3707
  for (var m = y.length - 1, p = void 0; m >= 0; m--) y[m].children.length === 0 ? m > 0 ? (p = y[m - 1].children).splice(p.indexOf(y[m]), 1) : this.clear() : s(y[m], this.toBBox);
3708
3708
  }, r;
3709
3709
  });
3710
- })), Jr = /* @__PURE__ */ Kn({ default: () => An });
3711
- function to(t, e) {
3710
+ })), to = /* @__PURE__ */ Qn({ default: () => An });
3711
+ function eo(t, e) {
3712
3712
  return t < e ? -1 : t > e ? 1 : 0;
3713
3713
  }
3714
- var An, eo = Zn((() => {
3714
+ var An, no = Kn((() => {
3715
3715
  An = class {
3716
- constructor(t = [], e = to) {
3716
+ constructor(t = [], e = eo) {
3717
3717
  if (this.data = t, this.length = this.data.length, this.compare = e, this.length > 0) for (let n = (this.length >> 1) - 1; n >= 0; n--) this._down(n);
3718
3718
  }
3719
3719
  push(t) {
@@ -3747,7 +3747,7 @@ var An, eo = Zn((() => {
3747
3747
  e[t] = i;
3748
3748
  }
3749
3749
  };
3750
- })), no = /* @__PURE__ */ we(((t, e) => {
3750
+ })), ro = /* @__PURE__ */ we(((t, e) => {
3751
3751
  e.exports = function(o, i, r, a) {
3752
3752
  var s = o[0], l = o[1], h = !1;
3753
3753
  r === void 0 && (r = 0), a === void 0 && (a = i.length);
@@ -3757,7 +3757,7 @@ var An, eo = Zn((() => {
3757
3757
  }
3758
3758
  return h;
3759
3759
  };
3760
- })), ro = /* @__PURE__ */ we(((t, e) => {
3760
+ })), oo = /* @__PURE__ */ we(((t, e) => {
3761
3761
  e.exports = function(o, i, r, a) {
3762
3762
  var s = o[0], l = o[1], h = !1;
3763
3763
  r === void 0 && (r = 0), a === void 0 && (a = i.length);
@@ -3767,12 +3767,12 @@ var An, eo = Zn((() => {
3767
3767
  }
3768
3768
  return h;
3769
3769
  };
3770
- })), oo = /* @__PURE__ */ we(((t, e) => {
3771
- var n = no(), o = ro();
3770
+ })), io = /* @__PURE__ */ we(((t, e) => {
3771
+ var n = ro(), o = oo();
3772
3772
  e.exports = function(r, a, s, l) {
3773
3773
  return a.length > 0 && Array.isArray(a[0]) ? o(r, a, s, l) : n(r, a, s, l);
3774
3774
  }, e.exports.nested = o, e.exports.flat = n;
3775
- })), io = /* @__PURE__ */ we(((t, e) => {
3775
+ })), ao = /* @__PURE__ */ we(((t, e) => {
3776
3776
  (function(n, o) {
3777
3777
  typeof t == "object" && typeof e < "u" ? o(t) : typeof define == "function" && define.amd ? define(["exports"], o) : o((n = n || self).predicates = {});
3778
3778
  })(t, function(n) {
@@ -3815,8 +3815,8 @@ var An, eo = Zn((() => {
3815
3815
  return (S - p) * (P - m) - (w - m) * (y - p);
3816
3816
  }, Object.defineProperty(n, "__esModule", { value: !0 });
3817
3817
  });
3818
- })), ao = /* @__PURE__ */ we(((t, e) => {
3819
- var n = Qr(), o = (eo(), Jn(Jr)), i = oo(), r = io().orient2d;
3818
+ })), so = /* @__PURE__ */ we(((t, e) => {
3819
+ var n = Jr(), o = (no(), tr(to)), i = io(), r = ao().orient2d;
3820
3820
  o.default && (o = o.default), e.exports = a, e.exports.default = a;
3821
3821
  function a(x, M, z) {
3822
3822
  M = Math.max(0, M === void 0 ? 2 : M), z = z || 0;
@@ -3965,14 +3965,14 @@ var An, eo = Zn((() => {
3965
3965
  }
3966
3966
  return V.pop(), M.pop(), M.concat(V);
3967
3967
  }
3968
- })), so = /* @__PURE__ */ Qn(ao(), 1);
3969
- function lo(t, e = {}) {
3968
+ })), lo = /* @__PURE__ */ Jn(so(), 1);
3969
+ function co(t, e = {}) {
3970
3970
  e.concavity = e.concavity || 1 / 0;
3971
3971
  const n = [];
3972
3972
  if (be(t, (i) => {
3973
3973
  n.push([i[0], i[1]]);
3974
3974
  }), !n.length) return null;
3975
- const o = (0, so.default)(n, e.concavity);
3975
+ const o = (0, lo.default)(n, e.concavity);
3976
3976
  return o.length > 3 ? _n([o]) : null;
3977
3977
  }
3978
3978
  function Tn(t, e = {}) {
@@ -3990,14 +3990,14 @@ function ne(t) {
3990
3990
  if (Array.isArray(t) && t.length >= 2 && !Array.isArray(t[0]) && !Array.isArray(t[1])) return [...t];
3991
3991
  throw new Error("coord must be GeoJSON Point or an Array of numbers");
3992
3992
  }
3993
- function co(t) {
3993
+ function uo(t) {
3994
3994
  if (Array.isArray(t)) return t;
3995
3995
  if (t.type === "Feature") {
3996
3996
  if (t.geometry !== null) return t.geometry.coordinates;
3997
3997
  } else if (t.coordinates) return t.coordinates;
3998
3998
  throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array");
3999
3999
  }
4000
- function uo(t, e, n = {}) {
4000
+ function ho(t, e, n = {}) {
4001
4001
  let o;
4002
4002
  return n.final ? o = sn(ne(e), ne(t)) : o = sn(ne(t), ne(e)), o > 180 ? -(360 - o) : o;
4003
4003
  }
@@ -4008,11 +4008,11 @@ function sn(t, e) {
4008
4008
  const r = Math.log(Math.tan(o / 2 + Math.PI / 4) / Math.tan(n / 2 + Math.PI / 4));
4009
4009
  return (Dn(Math.atan2(i, r)) + 360) % 360;
4010
4010
  }
4011
- function ho(t, e, n = {}) {
4011
+ function fo(t, e, n = {}) {
4012
4012
  const o = ne(t), i = ne(e);
4013
- return i[0] += i[0] - o[0] > 180 ? -360 : o[0] - i[0] > 180 ? 360 : 0, En(fo(o, i), "meters", n.units);
4013
+ return i[0] += i[0] - o[0] > 180 ? -360 : o[0] - i[0] > 180 ? 360 : 0, En(mo(o, i), "meters", n.units);
4014
4014
  }
4015
- function fo(t, e, n) {
4015
+ function mo(t, e, n) {
4016
4016
  n = n === void 0 ? Wt : Number(n);
4017
4017
  const o = n, i = t[1] * Math.PI / 180, r = e[1] * Math.PI / 180, a = r - i;
4018
4018
  let s = Math.abs(e[0] - t[0]) * Math.PI / 180;
@@ -4020,14 +4020,14 @@ function fo(t, e, n) {
4020
4020
  const l = Math.log(Math.tan(r / 2 + Math.PI / 4) / Math.tan(i / 2 + Math.PI / 4)), h = Math.abs(l) > 1e-11 ? a / l : Math.cos(i);
4021
4021
  return Math.sqrt(a * a + h * h * s * s) * o;
4022
4022
  }
4023
- function mo(t, e, n, o = {}) {
4023
+ function go(t, e, n, o = {}) {
4024
4024
  const i = e < 0;
4025
4025
  let r = En(Math.abs(e), o.units, "meters");
4026
4026
  i && (r = -Math.abs(r));
4027
- const a = ne(t), s = go(a, r, n);
4027
+ const a = ne(t), s = po(a, r, n);
4028
4028
  return s[0] += s[0] - a[0] > 180 ? -360 : a[0] - s[0] > 180 ? 360 : 0, Sn(s, o.properties);
4029
4029
  }
4030
- function go(t, e, n, o) {
4030
+ function po(t, e, n, o) {
4031
4031
  o = o === void 0 ? Wt : Number(o);
4032
4032
  const i = e / o, r = t[0] * Math.PI / 180, a = ee(t[1]), s = ee(n), l = i * Math.cos(s);
4033
4033
  let h = a + l;
@@ -4035,13 +4035,13 @@ function go(t, e, n, o) {
4035
4035
  const u = Math.log(Math.tan(h / 2 + Math.PI / 4) / Math.tan(a / 2 + Math.PI / 4)), d = Math.abs(u) > 1e-11 ? l / u : Math.cos(a);
4036
4036
  return [((r + i * Math.sin(s) / d) * 180 / Math.PI + 540) % 360 - 180, h * 180 / Math.PI];
4037
4037
  }
4038
- function po(t) {
4038
+ function yo(t) {
4039
4039
  if (!t) throw new Error("geojson is required");
4040
4040
  switch (t.type) {
4041
4041
  case "Feature":
4042
4042
  return Bn(t);
4043
4043
  case "FeatureCollection":
4044
- return yo(t);
4044
+ return xo(t);
4045
4045
  case "Point":
4046
4046
  case "LineString":
4047
4047
  case "Polygon":
@@ -4074,7 +4074,7 @@ function In(t) {
4074
4074
  typeof o == "object" ? o === null ? e[n] = null : Array.isArray(o) ? e[n] = o.map((i) => i) : e[n] = In(o) : e[n] = o;
4075
4075
  }), e;
4076
4076
  }
4077
- function yo(t) {
4077
+ function xo(t) {
4078
4078
  const e = { type: "FeatureCollection" };
4079
4079
  return Object.keys(t).forEach((n) => {
4080
4080
  switch (n) {
@@ -4095,27 +4095,27 @@ function kn(t) {
4095
4095
  return typeof e[0] != "object" ? e.slice() : e.map((n) => kn(n));
4096
4096
  }
4097
4097
  function ln(t, e, n) {
4098
- if (n = n || {}, !jr(n)) throw new Error("options is invalid");
4098
+ if (n = n || {}, !Ur(n)) throw new Error("options is invalid");
4099
4099
  const o = n.pivot, i = n.mutate;
4100
4100
  if (!t) throw new Error("geojson is required");
4101
4101
  if (e == null || isNaN(e)) throw new Error("angle is required");
4102
4102
  if (e === 0) return t;
4103
4103
  const r = o ?? Tn(t);
4104
- return (i === !1 || i === void 0) && (t = po(t)), be(t, function(a) {
4105
- const s = uo(r, a) + e, l = co(mo(r, ho(r, a), s));
4104
+ return (i === !1 || i === void 0) && (t = yo(t)), be(t, function(a) {
4105
+ const s = ho(r, a) + e, l = uo(go(r, fo(r, a), s));
4106
4106
  a[0] = l[0], a[1] = l[1];
4107
4107
  }), t;
4108
4108
  }
4109
4109
  function Ln(t, e, n = {}) {
4110
- if (n.final === !0) return xo(t, e);
4110
+ if (n.final === !0) return wo(t, e);
4111
4111
  const o = ne(t), i = ne(e), r = ee(o[0]), a = ee(i[0]), s = ee(o[1]), l = ee(i[1]), h = Math.sin(a - r) * Math.cos(l), u = Math.cos(s) * Math.sin(l) - Math.sin(s) * Math.cos(l) * Math.cos(a - r);
4112
4112
  return Dn(Math.atan2(h, u));
4113
4113
  }
4114
- function xo(t, e) {
4114
+ function wo(t, e) {
4115
4115
  let n = Ln(e, t);
4116
4116
  return n = (n + 180) % 360, n;
4117
4117
  }
4118
- function wo(t, e = {}) {
4118
+ function bo(t, e = {}) {
4119
4119
  if (t.bbox != null && e.recompute !== !0) return t.bbox;
4120
4120
  const n = [
4121
4121
  1 / 0,
@@ -4127,7 +4127,7 @@ function wo(t, e = {}) {
4127
4127
  n[0] > o[0] && (n[0] = o[0]), n[1] > o[1] && (n[1] = o[1]), n[2] < o[0] && (n[2] = o[0]), n[3] < o[1] && (n[3] = o[1]);
4128
4128
  }), n;
4129
4129
  }
4130
- function bo(t, e = {}) {
4130
+ function vo(t, e = {}) {
4131
4131
  const n = Number(t[0]), o = Number(t[1]), i = Number(t[2]), r = Number(t[3]);
4132
4132
  if (t.length === 6) throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
4133
4133
  const a = [n, o];
@@ -4142,13 +4142,13 @@ function bo(t, e = {}) {
4142
4142
  id: e.id
4143
4143
  });
4144
4144
  }
4145
- function vo(t) {
4146
- return bo(wo(t));
4147
- }
4148
4145
  function Mo(t) {
4149
- return Kr(t, (e, n) => e + Po(n), 0);
4146
+ return vo(bo(t));
4150
4147
  }
4151
4148
  function Po(t) {
4149
+ return Qr(t, (e, n) => e + zo(n), 0);
4150
+ }
4151
+ function zo(t) {
4152
4152
  let e = 0, n;
4153
4153
  switch (t.type) {
4154
4154
  case "Polygon":
@@ -4172,7 +4172,7 @@ function cn(t) {
4172
4172
  }
4173
4173
  return e;
4174
4174
  }
4175
- var zo = Wt * Wt / 2, ke = Math.PI / 180;
4175
+ var Vo = Wt * Wt / 2, ke = Math.PI / 180;
4176
4176
  function un(t) {
4177
4177
  const e = t.length - 1;
4178
4178
  if (e <= 2) return 0;
@@ -4181,15 +4181,15 @@ function un(t) {
4181
4181
  const i = t[o], r = t[o + 1 === e ? 0 : o + 1], a = t[o + 2 >= e ? (o + 2) % e : o + 2], s = i[0] * ke, l = r[1] * ke, h = a[0] * ke;
4182
4182
  n += (h - s) * Math.sin(l), o++;
4183
4183
  }
4184
- return n * zo;
4184
+ return n * Vo;
4185
4185
  }
4186
- function Vo(t) {
4187
- const e = lo(t);
4186
+ function So(t) {
4187
+ const e = co(t);
4188
4188
  if (!e) throw new Error("Can't calculate smallestSurroundingRectangleByArea for given geometry");
4189
- const n = Tn(e), o = Ur(e);
4189
+ const n = Tn(e), o = Zr(e);
4190
4190
  let i = Number.MAX_SAFE_INTEGER, r = null;
4191
4191
  for (let a = 0; a < o.length - 1; a++) {
4192
- let s = Ln(o[a], o[a + 1]), l = vo(ln(e, -1 * s, { pivot: n })), h = Mo(l);
4192
+ let s = Ln(o[a], o[a + 1]), l = Mo(ln(e, -1 * s, { pivot: n })), h = Po(l);
4193
4193
  h < i && (i = h, r = ln(l, s, { pivot: n }));
4194
4194
  }
4195
4195
  return r;
@@ -4198,13 +4198,13 @@ function hn(t, e) {
4198
4198
  const n = e[0] - t[0], o = e[1] - t[1];
4199
4199
  return Math.sqrt(n * n + o * o);
4200
4200
  }
4201
- function So(t) {
4201
+ function _o(t) {
4202
4202
  let e = 1 / 0, n = -1 / 0, o = 1 / 0, i = -1 / 0;
4203
4203
  for (const [r, a] of t)
4204
4204
  r < e && (e = r), r > n && (n = r), a < o && (o = a), a > i && (i = a);
4205
4205
  return [(n + e) * 0.5, (i + o) * 0.5];
4206
4206
  }
4207
- var _o = class Fe extends Pn {
4207
+ var Do = class Fe extends Pn {
4208
4208
  getBoxMesh() {
4209
4209
  oe.identity(), oe.setFromMatrix3(this.rotation), oe.decompose(_e, ue, new c.Vector3());
4210
4210
  const e = this.halfSize.clone().multiplyScalar(2), n = new c.Mesh(new c.BoxGeometry(e.x, e.y, e.z));
@@ -4212,7 +4212,7 @@ var _o = class Fe extends Pn {
4212
4212
  }
4213
4213
  getBoxEdge(e = 16776960) {
4214
4214
  const n = this.getBoxMesh();
4215
- Eo.setFromObject(n);
4215
+ Ao.setFromObject(n);
4216
4216
  const o = new c.EdgesGeometry(n.geometry.clone().applyMatrix4(n.matrixWorld));
4217
4217
  return new c.LineSegments(o, new c.LineBasicMaterial({
4218
4218
  color: e,
@@ -4230,21 +4230,21 @@ var _o = class Fe extends Pn {
4230
4230
  if (o instanceof c.Euler) ue.setFromEuler(o);
4231
4231
  else if (o instanceof c.Quaternion) ue.copy(o);
4232
4232
  else throw new Error("传入的旋转不是欧拉角或者四元数");
4233
- return oe.compose(n, ue, Do), i.center.copy(n), i.halfSize.copy(e.multiplyScalar(0.5)), i.rotation.setFromMatrix4(oe), i;
4233
+ return oe.compose(n, ue, Eo), i.center.copy(n), i.halfSize.copy(e.multiplyScalar(0.5)), i.rotation.setFromMatrix4(oe), i;
4234
4234
  }
4235
4235
  static fromByPath2D(e, n, o, i = new Fe()) {
4236
- const r = Vo({
4236
+ const r = So({
4237
4237
  type: "Polygon",
4238
4238
  coordinates: [e.map((f) => [f.x, f.y])]
4239
4239
  });
4240
4240
  if (!r) throw new Error("2d obb 获取失败");
4241
4241
  const a = r.geometry.coordinates[0], s = hn(a[0], a[1]), l = hn(a[1], a[2]), h = Math.atan2(a[1][1] - a[0][1], a[1][0] - a[0][0]);
4242
4242
  _e.set(s, l, o), dn.set(0, 0, h);
4243
- const [u, d] = So(a);
4243
+ const [u, d] = _o(a);
4244
4244
  return n.x = u, n.y = d, this.from(_e, n, dn, i);
4245
4245
  }
4246
- }, oe = new c.Matrix4(), ue = new c.Quaternion(), dn = new c.Euler(), Do = new c.Vector3(1, 1, 1), _e = new c.Vector3(), Eo = new c.Box3();
4247
- function Ao(t, e, n = 5e-3, o = 0.2) {
4246
+ }, oe = new c.Matrix4(), ue = new c.Quaternion(), dn = new c.Euler(), Eo = new c.Vector3(1, 1, 1), _e = new c.Vector3(), Ao = new c.Box3();
4247
+ function To(t, e, n = 5e-3, o = 0.2) {
4248
4248
  if (!t.length || !e.length) return 0;
4249
4249
  const i = Math.max(n, 0.03), r = n * n, a = /* @__PURE__ */ new Map(), s = (d, f, g) => `${Math.floor(d / i)},${Math.floor(f / i)},${Math.floor(g / i)}`;
4250
4250
  for (const d of e) {
@@ -4327,7 +4327,7 @@ function gn(t, e, n, o) {
4327
4327
  const i = [];
4328
4328
  for (let a = 0; a < t.length; a++) i.push(new c.Vector3(t[a][0], t[a][1], 0));
4329
4329
  if (i.length == 0) return null;
4330
- const r = _o.fromByPath2D(i, e, n);
4330
+ const r = Do.fromByPath2D(i, e, n);
4331
4331
  return r.center.z = o, r;
4332
4332
  }
4333
4333
  var rs = (t) => {
@@ -4494,7 +4494,7 @@ var rs = (t) => {
4494
4494
  }
4495
4495
  let m = !1, p = [], v = [];
4496
4496
  const x = a[s].points, M = g[b].points;
4497
- if (x.length > M.length ? (m = !0, p = x, v = M) : (p = M, v = x), Ao(v, p, 0.03, 0.5) > 0.5) if (m) g[b].isDel = !0;
4497
+ if (x.length > M.length ? (m = !0, p = x, v = M) : (p = M, v = x), To(v, p, 0.03, 0.5) > 0.5) if (m) g[b].isDel = !0;
4498
4498
  else {
4499
4499
  a[s].isDel = !0;
4500
4500
  break;
@@ -4569,7 +4569,7 @@ function ye(t, e) {
4569
4569
  const n = t.x - e.x, o = t.y - e.y;
4570
4570
  return Math.sqrt(n * n + o * o);
4571
4571
  }
4572
- function To(t) {
4572
+ function Bo(t) {
4573
4573
  let e = 0, n = 0, o = 0;
4574
4574
  for (let i = 0; i < 4; i++) {
4575
4575
  const r = t[i], a = t[(i + 1) % 4], s = a.x - r.x, l = a.y - r.y, h = Math.sqrt(s * s + l * l);
@@ -4606,7 +4606,7 @@ function Rn(t, e, n, o, i, r) {
4606
4606
  t: d
4607
4607
  };
4608
4608
  }
4609
- function Bo(t, e, n = 0.15) {
4609
+ function Io(t, e, n = 0.15) {
4610
4610
  let o = 0, i = 0;
4611
4611
  for (const a of e)
4612
4612
  a !== t && ((ye(t.start, a.start) <= n || ye(t.start, a.end) <= n) && o++, (ye(t.end, a.start) <= n || ye(t.end, a.end) <= n) && i++);
@@ -4617,7 +4617,7 @@ function Bo(t, e, n = 0.15) {
4617
4617
  score: r
4618
4618
  };
4619
4619
  }
4620
- function Io(t, e) {
4620
+ function ko(t, e) {
4621
4621
  const n = [], { start: o, end: i } = t;
4622
4622
  for (const s of e) {
4623
4623
  const { dist: l } = Rn(s.x, s.y, o.x, o.y, i.x, i.y);
@@ -4626,7 +4626,7 @@ function Io(t, e) {
4626
4626
  const r = n.reduce((s, l) => s + l, 0) / n.length, a = n.reduce((s, l) => s + (l - r) ** 2, 0) / n.length;
4627
4627
  return a < 0.01 ? 3 : a < 0.05 ? 2 : a < 0.1 ? 1 : 0;
4628
4628
  }
4629
- function ko(t, e, n = 0.15) {
4629
+ function Lo(t, e, n = 0.15) {
4630
4630
  const o = t.end.x - t.start.x, i = t.end.y - t.start.y, r = Math.sqrt(o * o + i * i);
4631
4631
  if (r < 1e-12) return 0;
4632
4632
  const a = -i / r, s = o / r, l = [[], []];
@@ -4647,8 +4647,8 @@ function ko(t, e, n = 0.15) {
4647
4647
  const h = [...l[0], ...l[1]];
4648
4648
  return h.every((u) => u === h[0]) ? 2 : 1;
4649
4649
  }
4650
- function Lo(t, e, n) {
4651
- const o = Bo(t, n), i = Io(t, e), r = ko(t, n);
4650
+ function Co(t, e, n) {
4651
+ const o = Io(t, n), i = ko(t, e), r = Lo(t, n);
4652
4652
  return {
4653
4653
  score: o.score * 3 + i * 2 + r * 2,
4654
4654
  details: {
@@ -4658,12 +4658,12 @@ function Lo(t, e, n) {
4658
4658
  }
4659
4659
  };
4660
4660
  }
4661
- function Co(t) {
4661
+ function Ro(t) {
4662
4662
  const e = t.end.x - t.start.x, n = t.end.y - t.start.y;
4663
4663
  let o = Math.atan2(n, e) * (180 / Math.PI);
4664
4664
  return o < 0 && (o += 180), o;
4665
4665
  }
4666
- function Ro(t, e) {
4666
+ function Fo(t, e) {
4667
4667
  const n = [];
4668
4668
  for (const o of t) {
4669
4669
  let i = !1;
@@ -4678,7 +4678,7 @@ function Ro(t, e) {
4678
4678
  }
4679
4679
  return n;
4680
4680
  }
4681
- function Fo(t, e = 0.05) {
4681
+ function Go(t, e = 0.05) {
4682
4682
  const n = [];
4683
4683
  for (const o of t) {
4684
4684
  let i = !1;
@@ -4690,7 +4690,7 @@ function Fo(t, e = 0.05) {
4690
4690
  }
4691
4691
  return n;
4692
4692
  }
4693
- function Go(t, e, n, o, i) {
4693
+ function qo(t, e, n, o, i) {
4694
4694
  const r = [];
4695
4695
  for (const s of t) {
4696
4696
  const l = s.seg, h = (l.start.x - e.start.x) * n + (l.start.y - e.start.y) * o, u = (l.end.x - e.start.x) * n + (l.end.y - e.start.y) * o;
@@ -4720,7 +4720,7 @@ function Go(t, e, n, o, i) {
4720
4720
  }
4721
4721
  return a;
4722
4722
  }
4723
- function qo(t, e, n, o, i, r, a) {
4723
+ function Wo(t, e, n, o, i, r, a) {
4724
4724
  const s = n - e, l = { ...t };
4725
4725
  return l.start = {
4726
4726
  x: t.start.x + e * o,
@@ -4736,7 +4736,7 @@ function qo(t, e, n, o, i, r, a) {
4736
4736
  z: 0
4737
4737
  }, l.rooftopPz = r, l.buildRosource = a, l.isRebuild = !1, l.doorAndBeamData || (l.doorAndBeamData = []), l.insetionArr || (l.insetionArr = []), l;
4738
4738
  }
4739
- function Wo(t, e) {
4739
+ function Oo(t, e) {
4740
4740
  let n = !0;
4741
4741
  for (; n; ) {
4742
4742
  n = !1;
@@ -4768,11 +4768,11 @@ function Fn(t, e = 5, n = 0.05) {
4768
4768
  };
4769
4769
  const o = t.map((l, h) => ({
4770
4770
  seg: l,
4771
- angle: Co(l),
4771
+ angle: Ro(l),
4772
4772
  idx: h
4773
4773
  }));
4774
4774
  o.sort((l, h) => l.angle - h.angle);
4775
- const i = Ro(o, e), r = [], a = [], s = [];
4775
+ const i = Fo(o, e), r = [], a = [], s = [];
4776
4776
  for (const l of i) {
4777
4777
  let h = l[0].seg;
4778
4778
  for (const P of l) P.seg.length > h.length && (h = P.seg);
@@ -4787,7 +4787,7 @@ function Fn(t, e = 5, n = 0.05) {
4787
4787
  };
4788
4788
  });
4789
4789
  w.sort((P, y) => P.offset - y.offset);
4790
- const S = Fo(w);
4790
+ const S = Go(w);
4791
4791
  for (const P of S) {
4792
4792
  let y = P[0].seg;
4793
4793
  for (const D of P) D.seg.length > y.length && (y = D.seg);
@@ -4816,20 +4816,20 @@ function Fn(t, e = 5, n = 0.05) {
4816
4816
  });
4817
4817
  }
4818
4818
  [...new Set(P.map((D) => String(D.seg.buildRosource)))];
4819
- const A = Go(P, y, x, M, n);
4819
+ const A = qo(P, y, x, M, n);
4820
4820
  for (const { l: D, r: T, srcIdxs: B } of A) {
4821
4821
  if (T - D < 0.01) continue;
4822
- const L = qo(y, D, T, x, M, V, y.buildRosource);
4822
+ const L = Wo(y, D, T, x, M, V, y.buildRosource);
4823
4823
  r.push(L), a.push(B);
4824
4824
  }
4825
4825
  }
4826
4826
  }
4827
4827
  return {
4828
- ...Wo(r, a),
4828
+ ...Oo(r, a),
4829
4829
  debugRPZGroups: s
4830
4830
  };
4831
4831
  }
4832
- function Oo(t) {
4832
+ function Ho(t) {
4833
4833
  return {
4834
4834
  minLengthRatio: 0.95,
4835
4835
  maxDistance: 0.5,
@@ -4839,7 +4839,7 @@ function Oo(t) {
4839
4839
  ...t
4840
4840
  };
4841
4841
  }
4842
- function Ho(t, e, n) {
4842
+ function No(t, e, n) {
4843
4843
  return [
4844
4844
  {
4845
4845
  x: e,
@@ -4868,7 +4868,7 @@ function Ho(t, e, n) {
4868
4868
  }
4869
4869
  ];
4870
4870
  }
4871
- function No(t, e, n, o, i, r, a) {
4871
+ function $o(t, e, n, o, i, r, a) {
4872
4872
  const s = [{
4873
4873
  margin: r.projectionMargin,
4874
4874
  maxDist: r.maxDistance,
@@ -4933,16 +4933,16 @@ function No(t, e, n, o, i, r, a) {
4933
4933
  }
4934
4934
  return l;
4935
4935
  }
4936
- function $o(t, e, n, o) {
4936
+ function Xo(t, e, n, o) {
4937
4937
  if (t.length <= 1)
4938
4938
  return t.length === 1 && (t[0].score = -1), t;
4939
4939
  for (const i of t) {
4940
- const { score: r, details: a } = Lo(i.seg, e, n);
4940
+ const { score: r, details: a } = Co(i.seg, e, n);
4941
4941
  i.score = r, i.details = a;
4942
4942
  }
4943
4943
  return t.sort((i, r) => r.embedRatio - i.embedRatio || r.score - i.score || i.minDist - r.minDist), t;
4944
4944
  }
4945
- function Xo(t, e, n, o) {
4945
+ function Yo(t, e, n, o) {
4946
4946
  const i = t.end.x - t.start.x, r = t.end.y - t.start.y, a = Math.sqrt(i * i + r * r), s = i / a, l = r / a, h = e.map((x) => {
4947
4947
  const M = x.x - t.start.x, z = x.y - t.start.y;
4948
4948
  return (M * s + z * l) / a;
@@ -4959,7 +4959,7 @@ function Xo(t, e, n, o) {
4959
4959
  groundClearance: p
4960
4960
  };
4961
4961
  }
4962
- function Yo(t, e, n) {
4962
+ function Gn(t, e, n) {
4963
4963
  const o = e.map((u) => n[u]), i = [], r = [], a = [], s = [], l = [];
4964
4964
  let h;
4965
4965
  for (const u of o) {
@@ -4973,23 +4973,23 @@ function Yo(t, e, n) {
4973
4973
  i.length && (t.points = i), r.length && (t.originalPoints = r), a.length && (t.doorAndBeamData = a), s.length && (t.insetionArr = s), l.length && (t.drawWindow = l), h && (t.boxData = h);
4974
4974
  }
4975
4975
  function jo(t, e, n) {
4976
- const o = Oo(n), i = [], { segments: r, sourceMap: a } = Fn(e), s = r;
4976
+ const o = Ho(n), i = [], { segments: r, sourceMap: a } = Fn(e), s = r;
4977
4977
  for (const l of t) {
4978
4978
  const h = l.coordinatesByArea?.coordinates;
4979
4979
  if (!h || h.length < 4) continue;
4980
- const u = h.slice(0, 4), d = u.reduce((x, M) => x + M.x, 0) / 4, f = u.reduce((x, M) => x + M.y, 0) / 4, { longSide: g, dirX: b, dirY: w } = To(u);
4980
+ const u = h.slice(0, 4), d = u.reduce((x, M) => x + M.x, 0) / 4, f = u.reduce((x, M) => x + M.y, 0) / 4, { longSide: g, dirX: b, dirY: w } = Bo(u);
4981
4981
  if (g < 0.01 || u.reduce((x, M) => x + M.z, 0) / 4 < Cn(e, d, f) - 0.3) continue;
4982
- const S = Ho(u, d, f);
4982
+ const S = No(u, d, f);
4983
4983
  l.name;
4984
- let P = No(s, g, b, w, S, o, l.name);
4985
- P = $o(P, S, e, l.name);
4984
+ let P = $o(s, g, b, w, S, o, l.name);
4985
+ P = Xo(P, S, e, l.name);
4986
4986
  let y = null, m = 1 / 0, p = 0;
4987
4987
  if (P.length > 0) {
4988
4988
  const x = P[0];
4989
4989
  y = x.seg, m = x.minDist, p = x.ratio;
4990
4990
  }
4991
4991
  let v;
4992
- if (y && (v = Xo(y, u, l, r), !o.printOnly)) {
4992
+ if (y && (v = Yo(y, u, l, r), !o.printOnly)) {
4993
4993
  const x = y;
4994
4994
  x.drawWindow || (x.drawWindow = []), x.drawWindow.push(v);
4995
4995
  }
@@ -5007,7 +5007,7 @@ function jo(t, e, n) {
5007
5007
  const h = l.wallSegment, u = r.indexOf(h);
5008
5008
  if (u === -1) continue;
5009
5009
  const d = a[u];
5010
- !d || d.length <= 1 || Yo(h, d, e);
5010
+ !d || d.length <= 1 || Gn(h, d, e);
5011
5011
  }
5012
5012
  return i;
5013
5013
  }
@@ -5015,7 +5015,12 @@ function os(t, e, n) {
5015
5015
  const o = {
5016
5016
  printOnly: !1,
5017
5017
  ...n
5018
- }, i = jo(Array.isArray(e) ? e.filter((l) => l && l.category === "window" && !l.isBayWindowObj) : [], t, o), { segments: r, sourceMap: a } = Fn(t), s = new Set(i.map((l) => l.windowName));
5018
+ }, i = jo(Array.isArray(e) ? e.filter((l) => l && l.category === "window" && !l.isBayWindowObj) : [], t, o), { segments: r, sourceMap: a } = Fn(t);
5019
+ for (let l = 0; l < r.length; l++) {
5020
+ const h = a[l];
5021
+ h && Gn(r[l], h, t);
5022
+ }
5023
+ const s = new Set(i.map((l) => l.windowName));
5019
5024
  for (const l of e) l && l.category === "window" && !l.isBayWindowObj && (s.has(l.name) ? delete l.AbnormalWindow : l.AbnormalWindow = !0);
5020
5025
  for (const l of i) if (l.drawWindow) {
5021
5026
  const h = r.find((u) => Math.abs(u.start.x - l.wallSegment.start.x) < 0.01 && Math.abs(u.start.y - l.wallSegment.start.y) < 0.01 && Math.abs(u.end.x - l.wallSegment.end.x) < 0.01 && Math.abs(u.end.y - l.wallSegment.end.y) < 0.01);
@@ -5032,7 +5037,7 @@ export {
5032
5037
  Cn as computeLocalFloorZ,
5033
5038
  jo as findWindowWalls,
5034
5039
  ni as getAllGeometry,
5035
- vr as getBeamLine,
5040
+ Mr as getBeamLine,
5036
5041
  ai as getColLine,
5037
5042
  ii as getMainBeamLine,
5038
5043
  rs as getMergeMeaning,
@@ -5043,7 +5048,7 @@ export {
5043
5048
  Fn as mergeCollinearSegments,
5044
5049
  Qt as perpendicularInfo,
5045
5050
  os as processData,
5046
- sr as removeNoisePoints,
5051
+ lr as removeNoisePoints,
5047
5052
  Jt as segmentsIntersect2D,
5048
5053
  ri as updateStEdPoint,
5049
5054
  oi as usegetBeamLine