rm-graphical-computing 1.0.36 → 1.0.38
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.cjs +1 -1
- package/dist/index.js +785 -604
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -112,18 +112,23 @@ var E = class extends s {
|
|
|
112
112
|
new d(), new o(), new o(), new d(), new d();
|
|
113
113
|
//#endregion
|
|
114
114
|
//#region src/utils/utils.mjs
|
|
115
|
-
var D = (t, n, r
|
|
115
|
+
var D = (t, n, r) => {
|
|
116
|
+
let i = new e.LineBasicMaterial({ color: "#0011ff" }), a = [];
|
|
117
|
+
a.push(t), a.push(n);
|
|
118
|
+
let o = new e.BufferGeometry();
|
|
119
|
+
o.setFromPoints(a), o.rotateX(-Math.PI / 2), r.add(new e.Line(o, i));
|
|
120
|
+
}, O = (t, n, r, i, a = 1e-8) => {
|
|
116
121
|
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;
|
|
117
122
|
if (Math.abs(u) < a) return null;
|
|
118
123
|
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;
|
|
119
124
|
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) };
|
|
120
|
-
},
|
|
125
|
+
}, k = (t, n, r = {}) => {
|
|
121
126
|
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");
|
|
122
127
|
u.font = `bold ${i}px ${a}`;
|
|
123
128
|
let d = u.measureText(t).width, f = Math.min(d + c * 2, l), p = i + c * 2, m = document.createElement("canvas");
|
|
124
129
|
m.width = f, m.height = p;
|
|
125
130
|
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 ?
|
|
131
|
+
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 ? A(h, t, f / 2, p / 2, l, i) : h.fillText(t, f / 2, p / 2);
|
|
127
132
|
let g = new e.CanvasTexture(m), _ = new e.SpriteMaterial({
|
|
128
133
|
map: g,
|
|
129
134
|
depthTest: !1,
|
|
@@ -133,7 +138,7 @@ var D = (t, n, r, i, a = 1e-8) => {
|
|
|
133
138
|
let y = .005;
|
|
134
139
|
return v.scale.set(f * y, p * y, 1), v;
|
|
135
140
|
};
|
|
136
|
-
function
|
|
141
|
+
function A(e, t, n, r, i, a) {
|
|
137
142
|
let o = t.split(""), s = "", c = a * 1.2, l = r;
|
|
138
143
|
for (let t = 0; t < o.length; t++) {
|
|
139
144
|
let r = s + o[t];
|
|
@@ -141,7 +146,7 @@ function k(e, t, n, r, i, a) {
|
|
|
141
146
|
}
|
|
142
147
|
e.fillText(s, n, l);
|
|
143
148
|
}
|
|
144
|
-
var
|
|
149
|
+
var j = (e, t, n = .01) => {
|
|
145
150
|
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);
|
|
146
151
|
if (r < 1e-10 || i < 1e-10) return {
|
|
147
152
|
parallel: !1,
|
|
@@ -165,7 +170,7 @@ var A = (e, t, n = .01) => {
|
|
|
165
170
|
angle: c
|
|
166
171
|
};
|
|
167
172
|
};
|
|
168
|
-
function
|
|
173
|
+
function M(t, n, r) {
|
|
169
174
|
let i = new e.BufferGeometry(), a = [], o = [];
|
|
170
175
|
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();
|
|
171
176
|
let s = new e.MeshBasicMaterial({
|
|
@@ -176,7 +181,7 @@ function j(t, n, r) {
|
|
|
176
181
|
});
|
|
177
182
|
return new e.Mesh(i, s);
|
|
178
183
|
}
|
|
179
|
-
var
|
|
184
|
+
var N = class {
|
|
180
185
|
constructor(t = {}) {
|
|
181
186
|
this.config = {
|
|
182
187
|
value: t.value || "0.0000m",
|
|
@@ -218,14 +223,14 @@ var M = class {
|
|
|
218
223
|
dispose() {
|
|
219
224
|
this.labelElement && this.labelElement.parentNode && this.labelElement.parentNode.removeChild(this.labelElement), this.label = null, this.labelElement = null;
|
|
220
225
|
}
|
|
221
|
-
},
|
|
226
|
+
}, P = (t) => {
|
|
222
227
|
let n = new e.Group(), r = new e.Group();
|
|
223
228
|
if (t && t.length) {
|
|
224
229
|
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(".");
|
|
225
230
|
t.forEach((t, a) => {
|
|
226
231
|
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
232
|
s.add(b);
|
|
228
|
-
let x = new
|
|
233
|
+
let x = new N({
|
|
229
234
|
value: u,
|
|
230
235
|
position: new e.Vector3(d.x, d.y, d.z)
|
|
231
236
|
}).getLabel();
|
|
@@ -274,15 +279,15 @@ var M = class {
|
|
|
274
279
|
depthWrite: !1
|
|
275
280
|
}), s = new e.Line(a, o);
|
|
276
281
|
l == "door" ? n.add(s) : r.add(s);
|
|
277
|
-
let c =
|
|
282
|
+
let c = M(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);
|
|
278
283
|
l == "door" ? n.add(c) : r.add(c);
|
|
279
284
|
let [u, d, f] = t, p = u.distanceTo(d), m = new e.Vector3().copy(u).add(d).multiplyScalar(.5);
|
|
280
|
-
new
|
|
285
|
+
new N({
|
|
281
286
|
value: String(p.toFixed(3)),
|
|
282
287
|
position: m
|
|
283
288
|
}).getLabel();
|
|
284
289
|
let h = d.distanceTo(f), g = new e.Vector3().copy(d).add(f).multiplyScalar(.5);
|
|
285
|
-
new
|
|
290
|
+
new N({
|
|
286
291
|
value: String(h.toFixed(3)),
|
|
287
292
|
position: g
|
|
288
293
|
}).getLabel();
|
|
@@ -300,7 +305,7 @@ var M = class {
|
|
|
300
305
|
AiProjectionGroup: n,
|
|
301
306
|
AiProjectionGroup2: r
|
|
302
307
|
};
|
|
303
|
-
},
|
|
308
|
+
}, F = (t, n, r, i) => {
|
|
304
309
|
let a = t, o = [];
|
|
305
310
|
if (i && i.length && (o = i.map((e) => e.clone())), !a || a.length < 4) return {};
|
|
306
311
|
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;
|
|
@@ -313,7 +318,7 @@ var M = class {
|
|
|
313
318
|
g,
|
|
314
319
|
_,
|
|
315
320
|
v
|
|
316
|
-
], b =
|
|
321
|
+
], b = j(new e.Vector3().subVectors(h, g), new e.Vector3(0, 0, 1));
|
|
317
322
|
b && b.parallel && (y = [
|
|
318
323
|
h,
|
|
319
324
|
v,
|
|
@@ -371,7 +376,7 @@ var M = class {
|
|
|
371
376
|
boxArea: S,
|
|
372
377
|
totalInPlaneNum: x
|
|
373
378
|
};
|
|
374
|
-
},
|
|
379
|
+
}, I = (t, n, r, i, a = e.MathUtils.degToRad(8)) => {
|
|
375
380
|
let o = new e.Vector3(), s = new e.Vector3();
|
|
376
381
|
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();
|
|
377
382
|
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";
|
|
@@ -386,7 +391,7 @@ var M = class {
|
|
|
386
391
|
v2: s
|
|
387
392
|
}
|
|
388
393
|
};
|
|
389
|
-
},
|
|
394
|
+
}, L = (t, n, r, i) => {
|
|
390
395
|
let a = new e.Vector3().subVectors(n, t), o = new e.Vector3().subVectors(i, r), s = a.length(), c = o.length();
|
|
391
396
|
if (s === 0 || c === 0) return {
|
|
392
397
|
rate: NaN,
|
|
@@ -403,7 +408,7 @@ var M = class {
|
|
|
403
408
|
isPerpendicular: Math.abs(f - 90) < .01,
|
|
404
409
|
isParallel: f < .01
|
|
405
410
|
};
|
|
406
|
-
},
|
|
411
|
+
}, R = (t, n, r = !1) => new e.Vector3((t.x + n.x) / 2, (t.y + n.y) / 2, r ? 0 : (t.z + n.z) / 2), z = (t, n, r, i, a = {}) => {
|
|
407
412
|
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);
|
|
408
413
|
if (h > o) return {
|
|
409
414
|
type: "not_parallel",
|
|
@@ -436,7 +441,7 @@ function te(t, n, r, i) {
|
|
|
436
441
|
let g = t.clone().add(a.clone().multiplyScalar(m)), _ = r.clone().add(o.clone().multiplyScalar(h));
|
|
437
442
|
return g.distanceTo(_);
|
|
438
443
|
}
|
|
439
|
-
var
|
|
444
|
+
var ne = (t, n, r, i = .05, a = .02) => {
|
|
440
445
|
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);
|
|
441
446
|
for (let t = 0; t < n.length; t++) {
|
|
442
447
|
y.subVectors(n[t], o);
|
|
@@ -457,8 +462,8 @@ var z = (t, n, r, i = .05, a = .02) => {
|
|
|
457
462
|
quadArea: O,
|
|
458
463
|
coveredArea: k
|
|
459
464
|
};
|
|
460
|
-
},
|
|
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 =
|
|
465
|
+
}, re = (e, t) => Math.round(Math.max(5, Math.min(350, t * Math.sqrt(e)))), ie = (t) => {
|
|
466
|
+
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 = re(i, 100), s = re(a, 70), c = a / s, l = /* @__PURE__ */ new Map();
|
|
462
467
|
for (let e = 0; e < s; e++) l.set((e + 1) * c, {
|
|
463
468
|
count: 0,
|
|
464
469
|
minZ: Infinity,
|
|
@@ -485,24 +490,25 @@ var z = (t, n, r, i = .05, a = .02) => {
|
|
|
485
490
|
minZ: p,
|
|
486
491
|
maxZ: m
|
|
487
492
|
};
|
|
488
|
-
},
|
|
493
|
+
}, ae = (t, n, r) => {
|
|
489
494
|
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);
|
|
490
495
|
i.setFromCoplanarPoints(a, o, s);
|
|
491
|
-
let c = [];
|
|
496
|
+
let c = [], l = [];
|
|
492
497
|
r.forEach((t) => {
|
|
493
498
|
let n = new e.Vector3();
|
|
494
|
-
i.projectPoint(t, n), n.z = a.z, c.push(n);
|
|
499
|
+
i.projectPoint(t, n), l.push(n.clone()), n.z = a.z, c.push(n);
|
|
495
500
|
});
|
|
496
|
-
let
|
|
497
|
-
i.projectPoint(a,
|
|
498
|
-
let
|
|
501
|
+
let u = new e.Vector3(), d = new e.Vector3();
|
|
502
|
+
i.projectPoint(a, u), i.projectPoint(o, d);
|
|
503
|
+
let f = new e.Line3(u, d), p = [], m = [], h = [], g = new e.Vector3();
|
|
499
504
|
return c.forEach((e, t) => {
|
|
500
|
-
|
|
505
|
+
f.closestPointToPoint(e, !0, g).distanceTo(e) < .001 ? (p.push(r[t]), m.push(l[t])) : h.push(e);
|
|
501
506
|
}), {
|
|
502
|
-
newOriginalPoints:
|
|
503
|
-
newProjectPoints:
|
|
507
|
+
newOriginalPoints: p,
|
|
508
|
+
newProjectPoints: h,
|
|
509
|
+
newOnLinePoints: m
|
|
504
510
|
};
|
|
505
|
-
},
|
|
511
|
+
}, oe = (t) => {
|
|
506
512
|
function n(t, n, r, i, a, o, s, c, l) {
|
|
507
513
|
let u = new e.Line3(t, n), d = /* @__PURE__ */ new Map(), f = new e.Vector3(), p = t.clone(), m = n.clone(), h = 0;
|
|
508
514
|
for (;;) {
|
|
@@ -544,7 +550,7 @@ var z = (t, n, r, i = .05, a = .02) => {
|
|
|
544
550
|
if (i.checkResults[0].originalVertices && i.checkResults[0].originalVertices.length > 0) {
|
|
545
551
|
let [t, n, r, s] = i.checkResults[0].originalVertices[0];
|
|
546
552
|
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);
|
|
547
|
-
let c =
|
|
553
|
+
let c = j(new e.Vector3().subVectors(t, n).normalize(), new e.Vector3(0, 0, 1));
|
|
548
554
|
c && c.parallel && ([o, a] = [a, o]);
|
|
549
555
|
}
|
|
550
556
|
if (a < 0 || o < 0) continue;
|
|
@@ -554,35 +560,35 @@ var z = (t, n, r, i = .05, a = .02) => {
|
|
|
554
560
|
o / 2;
|
|
555
561
|
let b = l * u / (a * o);
|
|
556
562
|
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 } =
|
|
563
|
+
let { newOriginalPoints: x } = ae(p, m, i.originalPoints);
|
|
558
564
|
i.originalPoints = x;
|
|
559
565
|
}
|
|
560
|
-
}, B = (t, n) => new e.Vector3(t.x, t.y, 0).distanceTo(new e.Vector3(n.x, n.y, 0)),
|
|
566
|
+
}, B = (t, n) => new e.Vector3(t.x, t.y, 0).distanceTo(new e.Vector3(n.x, n.y, 0)), se = (t, n, r = 1e-6) => {
|
|
561
567
|
let i = new e.Vector3();
|
|
562
568
|
return t.closestPointToPoint(n, !0, i), i.distanceTo(n) < r;
|
|
563
|
-
},
|
|
569
|
+
}, ce = (e) => {
|
|
564
570
|
let t = 0, n = [];
|
|
565
571
|
for (let r = 0; r < e.length; r++) for (let i = r + 1; i < e.length; i++) {
|
|
566
572
|
let a = e[r].distanceTo(e[i]);
|
|
567
573
|
a > t && (t = a, n = [e[r], e[i]]);
|
|
568
574
|
}
|
|
569
575
|
return n;
|
|
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,
|
|
576
|
+
}, 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, le = (e) => {
|
|
571
577
|
let t = [];
|
|
572
578
|
e.children.forEach((e) => {
|
|
573
579
|
e.type == "GridHelper" || e.type == "DirectionalLight" || e.type == "AmbientLight" || t.push(e);
|
|
574
580
|
}), t.forEach((t) => {
|
|
575
|
-
e.remove(t),
|
|
581
|
+
e.remove(t), de(t);
|
|
576
582
|
});
|
|
577
|
-
},
|
|
578
|
-
function
|
|
583
|
+
}, ue = () => `#${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")}`;
|
|
584
|
+
function de(e) {
|
|
579
585
|
for (; e.children && e.children.length > 0;) {
|
|
580
586
|
let t = e.children[0];
|
|
581
|
-
e.remove(t),
|
|
587
|
+
e.remove(t), de(t);
|
|
582
588
|
}
|
|
583
|
-
e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((e) =>
|
|
589
|
+
e.geometry && e.geometry.dispose(), e.material && (Array.isArray(e.material) ? e.material.forEach((e) => fe(e)) : fe(e.material));
|
|
584
590
|
}
|
|
585
|
-
function
|
|
591
|
+
function fe(e) {
|
|
586
592
|
for (let t of Object.keys(e)) {
|
|
587
593
|
let n = e[t];
|
|
588
594
|
n && typeof n == "object" && typeof n.dispose == "function" && n.dispose();
|
|
@@ -591,7 +597,7 @@ function de(e) {
|
|
|
591
597
|
}
|
|
592
598
|
//#endregion
|
|
593
599
|
//#region src/geometry/handleWallSegment.mjs
|
|
594
|
-
var
|
|
600
|
+
var pe = class {
|
|
595
601
|
results;
|
|
596
602
|
clusterResults;
|
|
597
603
|
constructor() {
|
|
@@ -1023,12 +1029,12 @@ var fe = class {
|
|
|
1023
1029
|
return console.error("合并网格时出错:", e), null;
|
|
1024
1030
|
}
|
|
1025
1031
|
}
|
|
1026
|
-
},
|
|
1032
|
+
}, me = (e) => {
|
|
1027
1033
|
let t = {}, n = [], r = [], i = [];
|
|
1028
1034
|
return e[0].width, e[0].height, e.forEach((e) => {
|
|
1029
1035
|
r.push(...e.vertices), i.push(e.center), n.push(e.vertices);
|
|
1030
1036
|
}), t.originalVertices = n, t.allCenterPoints = i, t;
|
|
1031
|
-
},
|
|
1037
|
+
}, he = (e) => {
|
|
1032
1038
|
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);
|
|
1033
1039
|
r.applyAxisAngle(n, Math.PI / 2);
|
|
1034
1040
|
let i = new d().copy(t).add(r.clone().multiplyScalar(e.length)), a = new d().copy(t).sub(r.clone().multiplyScalar(e.length));
|
|
@@ -1038,7 +1044,7 @@ var fe = class {
|
|
|
1038
1044
|
center: t,
|
|
1039
1045
|
direction: r
|
|
1040
1046
|
};
|
|
1041
|
-
},
|
|
1047
|
+
}, ge = (t, n, r = !0) => {
|
|
1042
1048
|
let i = [];
|
|
1043
1049
|
if (!t) return [];
|
|
1044
1050
|
for (let a = 0; a < t.length; a++) {
|
|
@@ -1047,7 +1053,7 @@ var fe = class {
|
|
|
1047
1053
|
let s = new e.Vector3(o.start.x, o.start.y, o.start.z);
|
|
1048
1054
|
s.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
|
|
1049
1055
|
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(
|
|
1056
|
+
if (l.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), n.add(k(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
1057
|
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
1058
|
o.originalPoints.forEach((e, t) => {
|
|
1053
1059
|
let n = new d();
|
|
@@ -1059,7 +1065,7 @@ var fe = class {
|
|
|
1059
1065
|
wireframe: !1,
|
|
1060
1066
|
transparent: !0,
|
|
1061
1067
|
opacity: .5
|
|
1062
|
-
}), g = new e.Group(), _ = new
|
|
1068
|
+
}), g = new e.Group(), _ = new pe(), { horizontalSubdivisions: v, verticalSubdivisions: y } = _.initLimits4(p, m), b = _.createSubdividedWallPlane(o, y, v, h, g);
|
|
1063
1069
|
_.analyzePointDistribution(b, f, .01);
|
|
1064
1070
|
let x = new e.MeshBasicMaterial({
|
|
1065
1071
|
color: "black",
|
|
@@ -1068,15 +1074,170 @@ var fe = class {
|
|
|
1068
1074
|
side: e.DoubleSide
|
|
1069
1075
|
}), S = _.highlightEmptySegments(b, x, g), C = [];
|
|
1070
1076
|
for (let e of S.clusters) {
|
|
1071
|
-
let t =
|
|
1077
|
+
let t = me(e);
|
|
1072
1078
|
t && C.push(t);
|
|
1073
1079
|
}
|
|
1074
|
-
let w =
|
|
1080
|
+
let w = he(o).direction;
|
|
1075
1081
|
o.checkResults = C, o.verticalDirection = w, o.originaIndex = a, i.push(o);
|
|
1076
1082
|
}
|
|
1077
1083
|
return i;
|
|
1078
|
-
},
|
|
1079
|
-
|
|
1084
|
+
}, _e = (t, n) => {
|
|
1085
|
+
console.log("lines", t);
|
|
1086
|
+
for (let r = 0; r < t.length; r++) {
|
|
1087
|
+
let i = t[r], a = [];
|
|
1088
|
+
i.originalPoints.forEach((t) => {
|
|
1089
|
+
let n = new e.Vector3(t.x, t.y, 0), r = !1;
|
|
1090
|
+
for (let e = 0; e < a.length; e++) if (V(n, a[e], .01)) {
|
|
1091
|
+
r = !0;
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
r || a.push(n);
|
|
1095
|
+
});
|
|
1096
|
+
let o = Math.round(Math.max(5, Math.min(350, 20 * Math.sqrt(i.length)))), 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 = new e.Vector3().subVectors(c, s).normalize(), u = l.clone().cross(new e.Vector3(0, 0, 1)).normalize(), d = u.clone().negate(), f = [], p = [], m = i.length / o;
|
|
1097
|
+
console.log(m);
|
|
1098
|
+
for (let e = 0; e < o; e++) {
|
|
1099
|
+
let e = [];
|
|
1100
|
+
e.push(s.clone().addScaledVector(u, 1)), e.push(e[0].clone().addScaledVector(l, m)), e.push(e[1].clone().addScaledVector(d, 2)), e.push(s.clone().addScaledVector(d, m));
|
|
1101
|
+
let t = [];
|
|
1102
|
+
for (let n = 0; n < a.length; n++) f.includes(n) || be(a[n], e) && (f.push(n), t.push(a[n]));
|
|
1103
|
+
t.length > 0 && p.push(xe(t)), s = s.addScaledVector(l, m);
|
|
1104
|
+
}
|
|
1105
|
+
let h = new Float32Array(a.length * 3);
|
|
1106
|
+
a.forEach((e, t) => {
|
|
1107
|
+
h[t * 3] = e.x, h[t * 3 + 1] = e.y, h[t * 3 + 2] = e.z;
|
|
1108
|
+
});
|
|
1109
|
+
let g = new e.BufferGeometry();
|
|
1110
|
+
g.setAttribute("position", new e.BufferAttribute(h, 3)), g.rotateX(-Math.PI / 2), n.add(new e.Points(g, new e.PointsMaterial({
|
|
1111
|
+
color: ue(),
|
|
1112
|
+
size: .02
|
|
1113
|
+
})));
|
|
1114
|
+
let [_, v] = Ee(p, {
|
|
1115
|
+
plane: "xy",
|
|
1116
|
+
trimRatio: 0
|
|
1117
|
+
});
|
|
1118
|
+
D(_, v, n);
|
|
1119
|
+
}
|
|
1120
|
+
};
|
|
1121
|
+
function ve(e, t = "xy") {
|
|
1122
|
+
if (t === "xy") return {
|
|
1123
|
+
x: e.x,
|
|
1124
|
+
y: e.y
|
|
1125
|
+
};
|
|
1126
|
+
if (t === "xz") return {
|
|
1127
|
+
x: e.x,
|
|
1128
|
+
y: e.z
|
|
1129
|
+
};
|
|
1130
|
+
if (t === "yz") return {
|
|
1131
|
+
x: e.y,
|
|
1132
|
+
y: e.z
|
|
1133
|
+
};
|
|
1134
|
+
throw Error(`Unsupported plane: ${t}`);
|
|
1135
|
+
}
|
|
1136
|
+
function ye(e, t, n) {
|
|
1137
|
+
let r = t.x - e.x, i = t.y - e.y, a = n.x - e.x;
|
|
1138
|
+
return r * (n.y - e.y) - i * a;
|
|
1139
|
+
}
|
|
1140
|
+
function be(e, t, n = "xy") {
|
|
1141
|
+
if (!t || t.length !== 4) throw Error("rectPoints must contain 4 points");
|
|
1142
|
+
let r = ve(e, n), i = t.map((e) => ve(e, n)), a = !1, o = !1;
|
|
1143
|
+
for (let e = 0; e < 4; e++) {
|
|
1144
|
+
let t = i[e], n = i[(e + 1) % 4], s = ye(t, n, r);
|
|
1145
|
+
if (s > 1e-9 && (a = !0), s < -1e-9 && (o = !0), a && o) return !1;
|
|
1146
|
+
}
|
|
1147
|
+
return !0;
|
|
1148
|
+
}
|
|
1149
|
+
function xe(t) {
|
|
1150
|
+
if (!t || t.length === 0) return null;
|
|
1151
|
+
let n = new e.Vector3(0, 0, 0);
|
|
1152
|
+
for (let e of t) Array.isArray(e) ? (n.x += e[0], n.y += e[1], n.z += e[2]) : (n.x += e.x, n.y += e.y, n.z += e.z);
|
|
1153
|
+
return n.divideScalar(t.length), n;
|
|
1154
|
+
}
|
|
1155
|
+
function Se(t) {
|
|
1156
|
+
return t instanceof e.Vector3 ? t.clone() : Array.isArray(t) ? new e.Vector3(t[0], t[1], t[2]) : new e.Vector3(t.x, t.y, t.z);
|
|
1157
|
+
}
|
|
1158
|
+
function Ce(e, t = "xy") {
|
|
1159
|
+
let n = Se(e);
|
|
1160
|
+
if (t === "xy") return {
|
|
1161
|
+
x: n.x,
|
|
1162
|
+
y: n.y,
|
|
1163
|
+
up: n.z
|
|
1164
|
+
};
|
|
1165
|
+
if (t === "xz") return {
|
|
1166
|
+
x: n.x,
|
|
1167
|
+
y: n.z,
|
|
1168
|
+
up: n.y
|
|
1169
|
+
};
|
|
1170
|
+
if (t === "yz") return {
|
|
1171
|
+
x: n.y,
|
|
1172
|
+
y: n.z,
|
|
1173
|
+
up: n.x
|
|
1174
|
+
};
|
|
1175
|
+
throw Error(`Unsupported plane: ${t}`);
|
|
1176
|
+
}
|
|
1177
|
+
function we(t, n, r, i = "xy") {
|
|
1178
|
+
if (i === "xy") return new e.Vector3(t, n, r);
|
|
1179
|
+
if (i === "xz") return new e.Vector3(t, r, n);
|
|
1180
|
+
if (i === "yz") return new e.Vector3(r, t, n);
|
|
1181
|
+
throw Error(`Unsupported plane: ${i}`);
|
|
1182
|
+
}
|
|
1183
|
+
function Te(e, t, n) {
|
|
1184
|
+
let r = 1e-12;
|
|
1185
|
+
if (Math.abs(t) < r) return e >= n ? {
|
|
1186
|
+
x: 1,
|
|
1187
|
+
y: 0
|
|
1188
|
+
} : {
|
|
1189
|
+
x: 0,
|
|
1190
|
+
y: 1
|
|
1191
|
+
};
|
|
1192
|
+
let i = e + n, a = e * n - t * t, o = Math.sqrt(Math.max(0, i * i * .25 - a)), s = i * .5 + o, c = t, l = s - e, u = Math.hypot(c, l);
|
|
1193
|
+
return u < r ? {
|
|
1194
|
+
x: 1,
|
|
1195
|
+
y: 0
|
|
1196
|
+
} : {
|
|
1197
|
+
x: c / u,
|
|
1198
|
+
y: l / u
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
function Ee(e, t = {}) {
|
|
1202
|
+
let { plane: n = "xy", trimRatio: r = 0 } = t;
|
|
1203
|
+
if (!e || e.length < 2) return null;
|
|
1204
|
+
let i = e.map((e) => Ce(e, n)), a = 0, o = 0, s = 0;
|
|
1205
|
+
for (let e of i) a += e.x, o += e.y, s += e.up;
|
|
1206
|
+
a /= i.length, o /= i.length, s /= i.length;
|
|
1207
|
+
let c = 0, l = 0, u = 0;
|
|
1208
|
+
for (let e of i) {
|
|
1209
|
+
let t = e.x - a, n = e.y - o;
|
|
1210
|
+
c += t * t, l += t * n, u += n * n;
|
|
1211
|
+
}
|
|
1212
|
+
c /= i.length, l /= i.length, u /= i.length;
|
|
1213
|
+
let d = Te(c, l, u), f = {
|
|
1214
|
+
x: -d.y,
|
|
1215
|
+
y: d.x
|
|
1216
|
+
}, p = [];
|
|
1217
|
+
for (let e of i) {
|
|
1218
|
+
let t = e.x - a, n = e.y - o, r = t * d.x + n * d.y, i = t * f.x + n * f.y;
|
|
1219
|
+
p.push({
|
|
1220
|
+
s: r,
|
|
1221
|
+
t: i,
|
|
1222
|
+
up: e.up
|
|
1223
|
+
});
|
|
1224
|
+
}
|
|
1225
|
+
p.sort((e, t) => e.s - t.s);
|
|
1226
|
+
let m = p.length, h = Math.floor(m * r), g = Math.ceil(m * (1 - r)) - 1;
|
|
1227
|
+
h = Math.max(0, Math.min(m - 1, h)), g = Math.max(0, Math.min(m - 1, g));
|
|
1228
|
+
let _ = p[h], v = p[g], y = (() => {
|
|
1229
|
+
let e = p.map((e) => e.t).sort((e, t) => e - t), t = Math.floor(e.length / 2);
|
|
1230
|
+
return e.length % 2 == 0 ? (e[t - 1] + e[t]) * .5 : e[t];
|
|
1231
|
+
})(), b = (() => {
|
|
1232
|
+
let e = p.map((e) => e.up).sort((e, t) => e - t), t = Math.floor(e.length / 2);
|
|
1233
|
+
return e.length % 2 == 0 ? (e[t - 1] + e[t]) * .5 : e[t];
|
|
1234
|
+
})(), x = _.s, S = v.s, C = y, w = y, T = b, E = b, D = a + d.x * x + f.x * C, O = o + d.y * x + f.y * C, k = a + d.x * S + f.x * w, A = o + d.y * S + f.y * w;
|
|
1235
|
+
return [we(D, O, T, n), we(k, A, E, n)];
|
|
1236
|
+
}
|
|
1237
|
+
//#endregion
|
|
1238
|
+
//#region src/geometry/beamLine.mjs
|
|
1239
|
+
var De = async (t, n, r, i) => {
|
|
1240
|
+
le(i);
|
|
1080
1241
|
let a = await fetch(t);
|
|
1081
1242
|
if (!a) return;
|
|
1082
1243
|
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();
|
|
@@ -1086,7 +1247,7 @@ var fe = class {
|
|
|
1086
1247
|
let r = new e.Vector3(n.start.x, n.start.y, n.start.z);
|
|
1087
1248
|
r.applyEuler(new e.Euler(-Math.PI / 2, 0, 0));
|
|
1088
1249
|
let i = new e.Vector3(n.end.x, n.end.y, n.end.z);
|
|
1089
|
-
i.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(
|
|
1250
|
+
i.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(k(String(t), new e.Vector3((r.x + i.x) / 2, (r.y + i.y) / 2, (r.z + i.z) / 2)));
|
|
1090
1251
|
}
|
|
1091
1252
|
o.sort((e, t) => e.originalIndex - t.originalIndex), console.log("lins", o);
|
|
1092
1253
|
let h = await fetch(n);
|
|
@@ -1098,33 +1259,33 @@ var fe = class {
|
|
|
1098
1259
|
let n = y[t];
|
|
1099
1260
|
if (n.isFindBeam = !1, n.category == "door") {
|
|
1100
1261
|
let t = new e.Vector3(n.center.x, n.center.y, n.center.z);
|
|
1101
|
-
t.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(
|
|
1262
|
+
t.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), m.add(k(`door:${b}`, t)), b++;
|
|
1102
1263
|
}
|
|
1103
1264
|
}
|
|
1104
1265
|
i.add(m), console.time();
|
|
1105
|
-
let { beamGroup: x } = await
|
|
1106
|
-
console.timeEnd(), console.log("beamGroup", x)
|
|
1266
|
+
let { beamGroup: x } = await Oe(o, _, y, i);
|
|
1267
|
+
console.timeEnd(), console.log("beamGroup", x);
|
|
1268
|
+
let S = new e.MeshBasicMaterial({
|
|
1107
1269
|
color: "#cffd00",
|
|
1108
1270
|
transparent: !0,
|
|
1109
1271
|
opacity: .4,
|
|
1110
1272
|
side: e.DoubleSide
|
|
1111
|
-
})
|
|
1112
|
-
let S = new e.MeshBasicMaterial({
|
|
1273
|
+
}), C = new e.MeshBasicMaterial({
|
|
1113
1274
|
color: "#ff0000",
|
|
1114
1275
|
transparent: !0,
|
|
1115
1276
|
opacity: .4,
|
|
1116
1277
|
side: e.DoubleSide
|
|
1117
|
-
}),
|
|
1278
|
+
}), T = new e.MeshBasicMaterial({
|
|
1118
1279
|
color: "#e100ff",
|
|
1119
1280
|
transparent: !0,
|
|
1120
1281
|
opacity: .4,
|
|
1121
1282
|
side: e.DoubleSide
|
|
1122
|
-
}),
|
|
1283
|
+
}), E = new e.MeshBasicMaterial({
|
|
1123
1284
|
color: "#0400ff",
|
|
1124
1285
|
transparent: !0,
|
|
1125
1286
|
opacity: .4,
|
|
1126
1287
|
side: e.DoubleSide
|
|
1127
|
-
}),
|
|
1288
|
+
}), D = new e.LineBasicMaterial({ color: "#cffd00" }), O = [];
|
|
1128
1289
|
for (let t = 0; t < o.length; t++) {
|
|
1129
1290
|
let n = o[t];
|
|
1130
1291
|
if (n.checkResults) for (let t of n.checkResults) for (let n of t.originalVertices) {
|
|
@@ -1151,12 +1312,12 @@ var fe = class {
|
|
|
1151
1312
|
3
|
|
1152
1313
|
]), o.computeVertexNormals();
|
|
1153
1314
|
let c = new e.EdgesGeometry(o, 1);
|
|
1154
|
-
|
|
1315
|
+
O.push(c);
|
|
1155
1316
|
}
|
|
1156
1317
|
}
|
|
1157
|
-
if (
|
|
1158
|
-
let t = w(
|
|
1159
|
-
t.rotateX(-Math.PI / 2), s.add(new e.LineSegments(t,
|
|
1318
|
+
if (O.length > 0) {
|
|
1319
|
+
let t = w(O, !1);
|
|
1320
|
+
t.rotateX(-Math.PI / 2), s.add(new e.LineSegments(t, D)), s.visible = !1, i.add(s), O.forEach((e) => e.dispose());
|
|
1160
1321
|
}
|
|
1161
1322
|
new e.PointsMaterial({
|
|
1162
1323
|
color: 65535,
|
|
@@ -1170,35 +1331,35 @@ var fe = class {
|
|
|
1170
1331
|
});
|
|
1171
1332
|
let r = new e.BufferGeometry();
|
|
1172
1333
|
r.setAttribute("position", new e.BufferAttribute(n, 3)), r.rotateX(-Math.PI / 2), c.add(new e.Points(r, new e.PointsMaterial({
|
|
1173
|
-
color:
|
|
1334
|
+
color: ue(),
|
|
1174
1335
|
size: .02
|
|
1175
1336
|
})));
|
|
1176
1337
|
let i = [];
|
|
1177
1338
|
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));
|
|
1178
1339
|
let a = new e.BufferGeometry();
|
|
1179
|
-
a.setFromPoints(i), a.rotateX(-Math.PI / 2), f.add(new e.Line(a,
|
|
1340
|
+
a.setFromPoints(i), a.rotateX(-Math.PI / 2), f.add(new e.Line(a, D));
|
|
1180
1341
|
}
|
|
1181
1342
|
f.visible = !1, i.add(c), i.add(f);
|
|
1182
|
-
let
|
|
1343
|
+
let A = [], j = [], M = new e.LineBasicMaterial({ color: "#f30606" }), N = new e.MeshBasicMaterial({ color: "#071ac4" });
|
|
1183
1344
|
for (let t = 0; t < _.length; t++) {
|
|
1184
1345
|
let n = new e.SphereGeometry(.05);
|
|
1185
1346
|
n.translate(_[t].x, _[t].y, _[t].z);
|
|
1186
1347
|
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);
|
|
1187
1348
|
r.push(i), r.push(s);
|
|
1188
1349
|
let c = new e.BufferGeometry();
|
|
1189
|
-
c.setFromPoints(r),
|
|
1190
|
-
}
|
|
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());
|
|
1350
|
+
c.setFromPoints(r), j.push(c), A.push(n);
|
|
1194
1351
|
}
|
|
1195
1352
|
if (A.length > 0) {
|
|
1196
1353
|
let t = w(A, !1);
|
|
1197
|
-
t.rotateX(-Math.PI / 2), l.add(new e.
|
|
1354
|
+
t.rotateX(-Math.PI / 2), l.add(new e.Mesh(t, N)), A.forEach((e) => e.dispose());
|
|
1355
|
+
}
|
|
1356
|
+
if (j.length > 0) {
|
|
1357
|
+
let t = w(j, !1);
|
|
1358
|
+
t.rotateX(-Math.PI / 2), l.add(new e.Line(t, M)), j.forEach((e) => e.dispose());
|
|
1198
1359
|
}
|
|
1199
1360
|
i.add(l);
|
|
1200
|
-
let { AiProjectionGroup:
|
|
1201
|
-
return u.add(
|
|
1361
|
+
let { AiProjectionGroup: F, AiProjectionGroup2: I } = P(y);
|
|
1362
|
+
return u.add(F), u.rotateX(-Math.PI / 2), i.add(u), d.add(I), d.visible = !1, d.rotateX(-Math.PI / 2), i.add(d), console.log("jsonpcdData", y), o.forEach((t) => {
|
|
1202
1363
|
t.doorAndBeamData && t.doorAndBeamData.length > 0 && (t.doorAndBeamData.forEach((t) => {
|
|
1203
1364
|
if (t.beamStart) {
|
|
1204
1365
|
let n = new e.BufferGeometry(), r = new Float32Array([
|
|
@@ -1222,7 +1383,7 @@ var fe = class {
|
|
|
1222
1383
|
0,
|
|
1223
1384
|
2,
|
|
1224
1385
|
3
|
|
1225
|
-
]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2);
|
|
1386
|
+
]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), p.add(new e.Mesh(n, S));
|
|
1226
1387
|
}
|
|
1227
1388
|
let n = new e.BufferGeometry(), r = new Float32Array([
|
|
1228
1389
|
t.doorStart.x,
|
|
@@ -1245,7 +1406,9 @@ var fe = class {
|
|
|
1245
1406
|
0,
|
|
1246
1407
|
2,
|
|
1247
1408
|
3
|
|
1248
|
-
]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), t.isDoor ? p.add(new e.Mesh(n,
|
|
1409
|
+
]), n.computeVertexNormals(), n.rotateX(-Math.PI / 2), t.isDoor ? p.add(new e.Mesh(n, E)) : t.type == "beam" ? p.add(new e.Mesh(n, T)) : p.add(new e.Mesh(n, C));
|
|
1410
|
+
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);
|
|
1411
|
+
a.applyEuler(new e.Euler(-Math.PI / 2, 0, 0)), p.add(k(i, a));
|
|
1249
1412
|
}), i.add(p));
|
|
1250
1413
|
}), {
|
|
1251
1414
|
checkResultGroup: s,
|
|
@@ -1257,8 +1420,8 @@ var fe = class {
|
|
|
1257
1420
|
beamDoorGroup: p,
|
|
1258
1421
|
lineIndexGroup: m
|
|
1259
1422
|
};
|
|
1260
|
-
},
|
|
1261
|
-
if (
|
|
1423
|
+
}, Oe = async (t, n, r, i) => {
|
|
1424
|
+
if (oe(t, i), t.length <= 0 || n.length <= 0) return t;
|
|
1262
1425
|
r ||= [];
|
|
1263
1426
|
for (let n of t) {
|
|
1264
1427
|
let t = [];
|
|
@@ -1301,7 +1464,7 @@ var fe = class {
|
|
|
1301
1464
|
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) {
|
|
1302
1465
|
let t = new e.Vector3().subVectors(o, s).normalize();
|
|
1303
1466
|
d = o.distanceTo(p), u = o.distanceTo(s);
|
|
1304
|
-
let n =
|
|
1467
|
+
let n = j(t, new e.Vector3(0, 0, 1));
|
|
1305
1468
|
n && n.parallel && ([d, u] = [u, d]);
|
|
1306
1469
|
}
|
|
1307
1470
|
i.gridWidth = u, i.gridHeight = d;
|
|
@@ -1323,9 +1486,9 @@ var fe = class {
|
|
|
1323
1486
|
totalHeight: t
|
|
1324
1487
|
});
|
|
1325
1488
|
}
|
|
1326
|
-
let o = [...a.entries()].reduce((e, t) => t[1].num > e[1].num ? t : e)
|
|
1327
|
-
o[1].totalHeight / o[1].num;
|
|
1328
|
-
let
|
|
1489
|
+
let o = [...a.entries()].reduce((e, t) => t[1].num > e[1].num ? t : e);
|
|
1490
|
+
o[0], o[1].totalHeight / o[1].num;
|
|
1491
|
+
let s = [];
|
|
1329
1492
|
for (let t = 0; t < r.length; t++) {
|
|
1330
1493
|
let n = r[t];
|
|
1331
1494
|
if (n.isFindBeam = !1, n.category == "door") {
|
|
@@ -1340,10 +1503,10 @@ var fe = class {
|
|
|
1340
1503
|
r[2],
|
|
1341
1504
|
r[1]
|
|
1342
1505
|
]);
|
|
1343
|
-
let o =
|
|
1344
|
-
|
|
1506
|
+
let o = R(r[0], r[3], !0), c = R(r[1], r[2], !0);
|
|
1507
|
+
s.push({
|
|
1345
1508
|
doorStartPt: o,
|
|
1346
|
-
doorEndPt:
|
|
1509
|
+
doorEndPt: c,
|
|
1347
1510
|
boxPoints: r,
|
|
1348
1511
|
minZ: n.coordinatesByArea.heightData.minZ,
|
|
1349
1512
|
maxZ: n.coordinatesByArea.heightData.maxZ,
|
|
@@ -1353,12 +1516,12 @@ var fe = class {
|
|
|
1353
1516
|
});
|
|
1354
1517
|
}
|
|
1355
1518
|
}
|
|
1356
|
-
for (let n = 0; n <
|
|
1357
|
-
let r =
|
|
1519
|
+
for (let n = 0; n < s.length; n++) {
|
|
1520
|
+
let r = s[n];
|
|
1358
1521
|
for (let n = 0; n < t.length; n++) {
|
|
1359
1522
|
if (t[n].length < .5) continue;
|
|
1360
|
-
let i = [], a =
|
|
1361
|
-
i.push(a), i.push(
|
|
1523
|
+
let i = [], a = R(t[n].start, t[n].end, !0);
|
|
1524
|
+
i.push(a), i.push(R(a, t[n].start, !0)), i.push(R(a, t[n].end, !0));
|
|
1362
1525
|
let o = !1, s = r.boxPoints.length;
|
|
1363
1526
|
for (let e = 0; e < i.length; e++) {
|
|
1364
1527
|
let t = i[e].x, n = i[e].y;
|
|
@@ -1369,37 +1532,41 @@ var fe = class {
|
|
|
1369
1532
|
if (o) break;
|
|
1370
1533
|
}
|
|
1371
1534
|
if (o) {
|
|
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 =
|
|
1373
|
-
if (Math.abs(s - o) < .5 && c && c.
|
|
1535
|
+
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 = I(r.doorStartPt, r.doorEndPt, i, a);
|
|
1536
|
+
if (Math.abs(s - o) < .5 && c && c.angleDeg < 15) {
|
|
1374
1537
|
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);
|
|
1375
1538
|
break;
|
|
1376
|
-
} else if (Math.abs(s - o) > 1.3 && c && c.
|
|
1377
|
-
let
|
|
1378
|
-
if (
|
|
1539
|
+
} else if (Math.abs(s - o) > 1.3 && c && c.angleDeg < 15) {
|
|
1540
|
+
let t = z(r.doorStartPt, r.doorEndPt, i, a, { parallelAngleMax: e.MathUtils.degToRad(15) }), n = r.doorStartPt.distanceTo(i), o = r.doorStartPt.distanceTo(a), s = r.doorEndPt.distanceTo(i), c = r.doorEndPt.distanceTo(a), l = n < .2 || o < .2 || s < .2 || c < .2;
|
|
1541
|
+
if (t && t.type == "collinear_overlap" && t.maxPerpendicularDistance < .1 && !l) {
|
|
1379
1542
|
r.inWall = !0;
|
|
1380
1543
|
break;
|
|
1544
|
+
} else {
|
|
1545
|
+
let t = new e.Line3(i, a), n = t.closestPointToPoint(r.doorStartPt, !0, new e.Vector3()), o = t.closestPointToPoint(r.doorEndPt, !0, new e.Vector3()), s = n.distanceTo(r.doorStartPt), c = o.distanceTo(r.doorEndPt);
|
|
1546
|
+
if (s < .1 || c < .1) {
|
|
1547
|
+
r.inWall = !0;
|
|
1548
|
+
break;
|
|
1549
|
+
}
|
|
1381
1550
|
}
|
|
1382
1551
|
}
|
|
1383
1552
|
} else continue;
|
|
1384
1553
|
}
|
|
1385
1554
|
}
|
|
1386
|
-
let
|
|
1555
|
+
let c = 0, l = [], u = [], d = [], f = [], p = .2;
|
|
1387
1556
|
for (let i = 0; i < t.length; i++) {
|
|
1388
1557
|
let a = t[i];
|
|
1389
1558
|
if (!a.mergeCheckRegion || a.mergeCheckRegion.length == 0) continue;
|
|
1390
1559
|
a.doorAndBeamData = [], a.completePointAreaPercentage = -1;
|
|
1391
1560
|
let o = new e.Box3();
|
|
1392
1561
|
o.setFromPoints(a.originalPoints);
|
|
1393
|
-
let
|
|
1394
|
-
if (y < s - .5 || y > s + 2) continue;
|
|
1395
|
-
let b = 0;
|
|
1562
|
+
let m = o.max.z, h = o.min.z, g = new e.Vector3(a.start.x, a.start.y, a.start.z), _ = new e.Vector3(a.end.x, a.end.y, a.end.z), v = a.rooftopPz - a.start.z, y = 0;
|
|
1396
1563
|
for (let o of a.mergeCheckRegion) {
|
|
1397
|
-
let { facePoints:
|
|
1398
|
-
if (!
|
|
1399
|
-
|
|
1400
|
-
let C =
|
|
1564
|
+
let { facePoints: b, boxArea: x, totalInPlaneNum: S } = F(o.points, o.gridWidth, o.gridHeight, o.centerPts);
|
|
1565
|
+
if (!b || b.length <= 0) continue;
|
|
1566
|
+
b[0].distanceTo(b[1]);
|
|
1567
|
+
let C = b[0].distanceTo(b[3]), w = o.gridHeight * (C / o.gridHeight / 3 * 2) + o.gridHeight / 2, T = new e.Vector3(b[0].x, b[0].y, b[0].z + w), E = new e.Vector3(b[1].x, b[1].y, b[1].z + w), D = new e.Line3(T, E), k = [], A = new e.Vector3();
|
|
1401
1568
|
o.points.forEach((e) => {
|
|
1402
|
-
|
|
1569
|
+
D.closestPointToPoint(e, !0, A).distanceTo(e) < o.gridHeight + .01 && k.push(e);
|
|
1403
1570
|
});
|
|
1404
1571
|
let M = [], N = [];
|
|
1405
1572
|
for (;;) {
|
|
@@ -1414,33 +1581,33 @@ var fe = class {
|
|
|
1414
1581
|
if (e.length == 0) break;
|
|
1415
1582
|
M.push(e);
|
|
1416
1583
|
}
|
|
1417
|
-
let
|
|
1584
|
+
let P = [];
|
|
1418
1585
|
for (let t = 0; t < M.length; t++) {
|
|
1419
1586
|
let n = {
|
|
1420
1587
|
lineSt: new e.Vector3(),
|
|
1421
1588
|
lineEd: new e.Vector3(),
|
|
1422
1589
|
facePoints: []
|
|
1423
|
-
}, r =
|
|
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,
|
|
1425
|
-
}
|
|
1426
|
-
|
|
1427
|
-
let
|
|
1428
|
-
if (S != 0 && (
|
|
1429
|
-
let b =
|
|
1430
|
-
if (S < 1.5 ||
|
|
1431
|
-
let T = !1, E = !1,
|
|
1590
|
+
}, r = ce(M[t]);
|
|
1591
|
+
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, b[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, b[0].z)), n.facePoints.push(new e.Vector3(r[1].x, r[1].y, b[2].z)), n.facePoints.push(new e.Vector3(r[0].x, r[0].y, b[2].z)), P.push(n));
|
|
1592
|
+
}
|
|
1593
|
+
y += o.area;
|
|
1594
|
+
let ee = 0;
|
|
1595
|
+
if (S != 0 && (ee = o.gridHeight * o.gridWidth * S), (o.area - ee) / x * 100 > 70 && P.length == 1 || P.length > 1) for (let y = 0; y < P.length; y++) {
|
|
1596
|
+
let b = P[y], 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;
|
|
1597
|
+
if (S < 1.5 || m < b.facePoints[2].z || w > v / 3 * 2) continue;
|
|
1598
|
+
let T = !1, E = !1, D = !1, k = [], A = b.facePoints[2].clone(), M = b.facePoints[3].clone(), N = b.facePoints[0].clone(), F = b.facePoints[1].clone(), ee = !1, te = -1;
|
|
1432
1599
|
if (Math.abs(b.facePoints[0].z - a.start.z) < .25) {
|
|
1433
1600
|
if (x > .17 && a.length > .5) {
|
|
1434
|
-
let n = B(
|
|
1601
|
+
let n = B(g, N), r = B(g, F), o = B(_, N), s = B(_, F), c = .1;
|
|
1435
1602
|
if (n < c || r < c) {
|
|
1436
|
-
let { newOriginalPoints: r } =
|
|
1603
|
+
let { newOriginalPoints: r } = ae(N, F, a.originalPoints), o = [], s = [];
|
|
1437
1604
|
if (r.forEach((e) => {
|
|
1438
|
-
e.z >=
|
|
1605
|
+
e.z >= A.z ? o.push(e) : e.z <= N.z && s.push(e);
|
|
1439
1606
|
}), o.length > 10) {
|
|
1440
1607
|
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;
|
|
1441
1608
|
for (let n = 0; n < t.length; n++) {
|
|
1442
1609
|
if (n == i) continue;
|
|
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 =
|
|
1610
|
+
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 = O(r, o, a, c), m = L(r, o, a, c);
|
|
1444
1611
|
if (p != null) {
|
|
1445
1612
|
if (m && m.angle > 85) {
|
|
1446
1613
|
let e = p.point.distanceTo(r);
|
|
@@ -1451,52 +1618,51 @@ var fe = class {
|
|
|
1451
1618
|
}
|
|
1452
1619
|
continue;
|
|
1453
1620
|
}
|
|
1454
|
-
if (m && m.angle >
|
|
1455
|
-
let t =
|
|
1621
|
+
if (m && m.angle > 85) {
|
|
1622
|
+
let t = I(r, o, new e.Line3(a, c).closestPointToPoint(r, !0, l), r);
|
|
1456
1623
|
if (!t || t.direction != "same") continue;
|
|
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 =
|
|
1624
|
+
let i = r.clone().addScaledVector(s, 10), f = o.clone().addScaledVector(s.clone().negate(), 10), p = new e.Vector3().subVectors(c, a).normalize(), m = O(i, f, a.clone().addScaledVector(p.clone().negate(), .03), c.clone().addScaledVector(p, .03));
|
|
1458
1625
|
if (m == null) continue;
|
|
1459
1626
|
let h = r.distanceTo(m.point);
|
|
1460
1627
|
h < u && (u = h, d = n);
|
|
1461
1628
|
} else if (m && m.angle < 5) {
|
|
1462
|
-
let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(
|
|
1629
|
+
let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(F.x, F.y, 0), r = B(t, a), i = B(t, c), o = B(n, a), s = B(n, c);
|
|
1463
1630
|
if (r < .08 || i < .08 || o < .08 || s < .08) {
|
|
1464
1631
|
f = !0, u = Infinity, d = -1;
|
|
1465
1632
|
break;
|
|
1466
1633
|
}
|
|
1467
1634
|
}
|
|
1468
1635
|
}
|
|
1469
|
-
if (u != Infinity && u < 2) t[d].length > .25 && x + u > .5 && (
|
|
1636
|
+
if (u != Infinity && u < 2 && a.length - x > .5) t[d].length > .25 && x + u > .5 && (ee = !0, n < c ? (M = M.addScaledVector(s, u), N = N.addScaledVector(s, u)) : (A = A.addScaledVector(s, u), F = F.addScaledVector(s, u)));
|
|
1470
1637
|
else if (!f) {
|
|
1471
|
-
let r = .05, a =
|
|
1638
|
+
let r = .05, a = g.clone().addScaledVector(s, r), o = g.clone().addScaledVector(s.clone().negate(), r);
|
|
1472
1639
|
a.z = o.z = 0;
|
|
1473
1640
|
let l = !1;
|
|
1474
|
-
for (let
|
|
1475
|
-
if (
|
|
1476
|
-
let
|
|
1477
|
-
|
|
1478
|
-
let
|
|
1479
|
-
if (
|
|
1480
|
-
|
|
1481
|
-
let e =
|
|
1482
|
-
if (
|
|
1641
|
+
for (let n = 0; n < t.length; n++) {
|
|
1642
|
+
if (n == i) continue;
|
|
1643
|
+
let s = 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), d = new e.Vector3().subVectors(c, s).normalize();
|
|
1644
|
+
s = s.clone().addScaledVector(d.clone().negate(), r), c = c.clone().addScaledVector(d, r);
|
|
1645
|
+
let f = O(a, o, s, c);
|
|
1646
|
+
if (f) {
|
|
1647
|
+
f.point.z = g.z;
|
|
1648
|
+
let e = f.point.distanceTo(g);
|
|
1649
|
+
if (f.point.distanceTo(_) < e) continue;
|
|
1483
1650
|
u > e && (u = e), l = !0;
|
|
1484
1651
|
}
|
|
1485
|
-
if (l) break;
|
|
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)));
|
|
1487
1652
|
}
|
|
1488
1653
|
if (!l) continue;
|
|
1654
|
+
u != Infinity && u < 2 && (n < c ? (M = M.addScaledVector(s.clone().negate(), u), N = N.addScaledVector(s.clone().negate(), u)) : (A = A.addScaledVector(s.clone().negate(), u), F = F.addScaledVector(s.clone().negate(), u)));
|
|
1489
1655
|
}
|
|
1490
1656
|
} else continue;
|
|
1491
1657
|
} else if (o < c || s < c) {
|
|
1492
|
-
let { newOriginalPoints: n } =
|
|
1658
|
+
let { newOriginalPoints: n } = ae(N, F, a.originalPoints), r = [], s = [];
|
|
1493
1659
|
if (n.forEach((e) => {
|
|
1494
|
-
e.z >=
|
|
1660
|
+
e.z >= A.z ? r.push(e) : e.z <= N.z && s.push(e);
|
|
1495
1661
|
}), r.length > 10) {
|
|
1496
1662
|
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;
|
|
1497
1663
|
for (let a = 0; a < t.length; a++) {
|
|
1498
1664
|
if (a == i) continue;
|
|
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 =
|
|
1665
|
+
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 = O(n, r, o, c), m = L(n, r, o, c);
|
|
1500
1666
|
if (p != null) {
|
|
1501
1667
|
if (m && m.angle > 85 && (p.point.distanceTo(n), p.point.distanceTo(r) < .3)) {
|
|
1502
1668
|
u = Infinity, d = -1;
|
|
@@ -1504,289 +1670,300 @@ var fe = class {
|
|
|
1504
1670
|
}
|
|
1505
1671
|
continue;
|
|
1506
1672
|
}
|
|
1507
|
-
if (m && m.angle >
|
|
1508
|
-
let t =
|
|
1673
|
+
if (m && m.angle > 85) {
|
|
1674
|
+
let t = I(r, n, new e.Line3(o, c).closestPointToPoint(r, !0, l), r);
|
|
1509
1675
|
if (!t || t.direction != "same") continue;
|
|
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 =
|
|
1676
|
+
let i = n.clone().addScaledVector(s.clone().negate(), 10), f = r.clone().addScaledVector(s, 10), p = new e.Vector3().subVectors(c, o).normalize(), m = O(i, f, o.clone().addScaledVector(p.clone().negate(), .03), c.clone().addScaledVector(p, .03));
|
|
1511
1677
|
if (m == null) continue;
|
|
1512
1678
|
let h = r.distanceTo(m.point);
|
|
1513
1679
|
h < u && (u = h, d = a);
|
|
1514
1680
|
} else if (m && m.angle < 5) {
|
|
1515
|
-
let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(
|
|
1681
|
+
let t = new e.Vector3(N.x, N.y, 0), n = new e.Vector3(F.x, F.y, 0), r = B(t, o), i = B(t, c), a = B(n, o), s = B(n, c);
|
|
1516
1682
|
if (r < .08 || i < .08 || a < .08 || s < .08) {
|
|
1517
1683
|
f = !0, u = Infinity, d = -1;
|
|
1518
1684
|
break;
|
|
1519
1685
|
}
|
|
1520
1686
|
}
|
|
1521
1687
|
}
|
|
1522
|
-
if (u != Infinity && u < 2) t[d].length > .25 && x + u > .5 && (
|
|
1688
|
+
if (u != Infinity && u < 2 && a.length - x > .5) t[d].length > .25 && x + u > .5 && (ee = !0, o < c ? (M = M.addScaledVector(s, u), N = N.addScaledVector(s, u)) : (A = A.addScaledVector(s, u), F = F.addScaledVector(s, u)));
|
|
1523
1689
|
else if (!f) {
|
|
1524
|
-
let n = .05, r =
|
|
1690
|
+
let n = .05, r = _.clone().addScaledVector(s, n), a = g.clone();
|
|
1525
1691
|
r.z = a.z = 0;
|
|
1526
1692
|
let l = !1;
|
|
1527
1693
|
for (let o = 0; o < t.length; o++) {
|
|
1528
1694
|
if (o == i) continue;
|
|
1529
1695
|
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
1696
|
s = s.clone().addScaledVector(d.clone().negate(), n), c = c.clone().addScaledVector(d, n);
|
|
1531
|
-
let f =
|
|
1697
|
+
let f = O(r, a, s, c);
|
|
1532
1698
|
if (f) {
|
|
1533
|
-
f.point.z =
|
|
1534
|
-
let e = f.point.distanceTo(
|
|
1535
|
-
if (f.point.distanceTo(
|
|
1699
|
+
f.point.z = _.z;
|
|
1700
|
+
let e = f.point.distanceTo(_);
|
|
1701
|
+
if (f.point.distanceTo(g) < e) continue;
|
|
1536
1702
|
u > e && (u = e), l = !0;
|
|
1537
1703
|
}
|
|
1538
1704
|
}
|
|
1539
1705
|
if (!l) continue;
|
|
1540
|
-
u != Infinity && u < 2 && (o < c ? (M = M.addScaledVector(s.clone().negate(), u), N = N.addScaledVector(s.clone().negate(), u)) : (
|
|
1706
|
+
u != Infinity && u < 2 && (o < c ? (M = M.addScaledVector(s.clone().negate(), u), N = N.addScaledVector(s.clone().negate(), u)) : (A = A.addScaledVector(s.clone().negate(), u), F = F.addScaledVector(s.clone().negate(), u)));
|
|
1541
1707
|
}
|
|
1542
1708
|
} else continue;
|
|
1543
1709
|
}
|
|
1544
|
-
x = M.distanceTo(
|
|
1710
|
+
x = M.distanceTo(A);
|
|
1545
1711
|
}
|
|
1546
|
-
if (C < 85 && x > .
|
|
1712
|
+
if (C < 85 && x > .31 || x > .7 && S > v - v / 3) {
|
|
1547
1713
|
let t = !1;
|
|
1548
1714
|
for (let r = 0; r < n.length; r++) {
|
|
1549
1715
|
let i = r + 1;
|
|
1550
1716
|
if (i >= n.length) continue;
|
|
1551
1717
|
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);
|
|
1552
|
-
if (
|
|
1718
|
+
if (O(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) {
|
|
1553
1719
|
t = !0;
|
|
1554
1720
|
break;
|
|
1555
1721
|
}
|
|
1556
1722
|
}
|
|
1557
|
-
for (let t = 0; t <
|
|
1558
|
-
let n = new e.Vector3(
|
|
1559
|
-
if (Math.abs(b.facePoints[2].z -
|
|
1560
|
-
let l =
|
|
1723
|
+
for (let t = 0; t < s.length; t++) {
|
|
1724
|
+
let n = new e.Vector3(s[t].doorStartPt.x, s[t].doorStartPt.y, 0), i = new e.Vector3(s[t].doorEndPt.x, s[t].doorEndPt.y, 0), o = new e.Vector3(b.facePoints[0].x, b.facePoints[0].y, 0), c = new e.Vector3(b.facePoints[1].x, b.facePoints[1].y, 0), l = b.facePoints[2].z < s[t].maxZ || Math.abs(b.facePoints[2].z - s[t].maxZ) < .3;
|
|
1725
|
+
if (Math.abs(b.facePoints[2].z - s[t].maxZ), l) {
|
|
1726
|
+
let l = z(n.clone(), i.clone(), o.clone(), c.clone(), { distanceThreshold: 2 });
|
|
1561
1727
|
if (l && l.type == "collinear_gap") {
|
|
1562
|
-
let u =
|
|
1728
|
+
let u = R(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);
|
|
1563
1729
|
if (u.distanceTo(p) < .15) {
|
|
1564
|
-
let a = o.distanceTo(n), u =
|
|
1730
|
+
let a = o.distanceTo(n), u = c.distanceTo(n);
|
|
1565
1731
|
if (a > .25 && u > .25) {
|
|
1566
|
-
let e = o.distanceTo(i), t =
|
|
1732
|
+
let e = o.distanceTo(i), t = c.distanceTo(i);
|
|
1567
1733
|
if (e > .2 && t > .2) continue;
|
|
1568
1734
|
}
|
|
1569
|
-
E = !0,
|
|
1570
|
-
let d = new e.Vector3().subVectors(o,
|
|
1571
|
-
u < a && d.negate(), a > u ? (
|
|
1735
|
+
E = !0, D = !0, k.push(s[t].index), s[t].isFind = !0, te = t, r[s[t].index].isFindBeam = !0;
|
|
1736
|
+
let d = new e.Vector3().subVectors(o, c).normalize(), f = n.distanceTo(i) - l.overlap;
|
|
1737
|
+
u < a && d.negate(), a > u ? (A = b.facePoints[2].clone().addScaledVector(d, f), M = b.facePoints[3].clone(), N = M.clone(), F = A.clone(), N.z = F.z = b.facePoints[0].z) : (A = b.facePoints[2].clone(), M = b.facePoints[3].clone().addScaledVector(d, f), N = M.clone(), F = A.clone(), N.z = F.z = b.facePoints[0].z);
|
|
1572
1738
|
}
|
|
1573
1739
|
} else if (l && l.type == "collinear_overlap" && l.maxPerpendicularDistance < .35) {
|
|
1574
|
-
let a = o.distanceTo(
|
|
1740
|
+
let a = o.distanceTo(c), u = i.distanceTo(n);
|
|
1575
1741
|
if (Math.abs(a - l.overlap) < .25 || Math.abs(u - l.overlap) < .25) {
|
|
1576
1742
|
if (u > a && Math.abs(u - l.overlap) > 1) {
|
|
1577
|
-
let t = o.distanceTo(n), r = o.distanceTo(i), a =
|
|
1578
|
-
d < f ? (p.negate(),
|
|
1743
|
+
let t = o.distanceTo(n), r = o.distanceTo(i), a = c.distanceTo(n), s = c.distanceTo(i), d = t < r ? t : r, f = a < s ? a : s, p = new e.Vector3().subVectors(o, c).normalize(), m = u - l.overlap;
|
|
1744
|
+
d < f ? (p.negate(), A = b.facePoints[2].clone().addScaledVector(p, m), M = b.facePoints[3].clone(), N = M.clone(), F = A.clone(), N.z = F.z = b.facePoints[0].z) : (A = b.facePoints[2].clone(), M = b.facePoints[3].clone().addScaledVector(p, m), N = M.clone(), F = A.clone(), N.z = F.z = b.facePoints[0].z);
|
|
1579
1745
|
}
|
|
1580
|
-
E = !0,
|
|
1746
|
+
E = !0, D = !0, k.push(s[t].index), s[t].isFind = !0, r[s[t].index].isFindBeam = !0, te = t;
|
|
1581
1747
|
}
|
|
1582
1748
|
}
|
|
1583
1749
|
}
|
|
1584
1750
|
}
|
|
1585
|
-
if (!
|
|
1586
|
-
if (
|
|
1587
|
-
let n = new e.Vector3(
|
|
1588
|
-
(
|
|
1751
|
+
if (!D) for (let t = 0; t < s.length; t++) {
|
|
1752
|
+
if (s[t].inWall) continue;
|
|
1753
|
+
let n = new e.Vector3(s[t].doorStartPt.x, s[t].doorStartPt.y, 0), i = new e.Vector3(s[t].doorEndPt.x, s[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), c = new e.Vector3().subVectors(n, i).normalize(), l = new e.Vector3().subVectors(a, o).normalize(), u = .25, d = O(n.clone().addScaledVector(c, u), i.clone().addScaledVector(c.clone().negate(), u), a.clone().addScaledVector(l, u), o.clone().addScaledVector(l.clone().negate(), u)), f = n.distanceTo(a), m = n.distanceTo(o), h = i.distanceTo(a), g = i.distanceTo(o);
|
|
1754
|
+
(f < p || m < p || h < p || g < p || d) && (r[s[t].index].isFindBeam = !0, E = !0, s[t].isFind = !0, te = t);
|
|
1589
1755
|
}
|
|
1590
|
-
(E || t || Math.abs(S -
|
|
1756
|
+
(E || t || Math.abs(S - v) > .1 && S > v / 2 && x > .3 && Math.abs(h - a.start.z) < .4) && (T = !0);
|
|
1591
1757
|
}
|
|
1592
1758
|
}
|
|
1593
1759
|
if (T) {
|
|
1594
1760
|
let n = !1;
|
|
1595
|
-
for (let e = 0; e <
|
|
1596
|
-
let t =
|
|
1761
|
+
for (let e = 0; e < d.length; e++) {
|
|
1762
|
+
let t = z(d[e].start, d[e].end, N, F);
|
|
1597
1763
|
if (t && t.type == "collinear_overlap" && t.maxPerpendicularDistance < .01) {
|
|
1598
1764
|
n = !0;
|
|
1599
1765
|
break;
|
|
1600
1766
|
}
|
|
1601
1767
|
}
|
|
1602
1768
|
if (n) {
|
|
1603
|
-
|
|
1769
|
+
te != -1 && (r[s[te].index].isFindBeam = !1, s[te].isFind = !1);
|
|
1604
1770
|
continue;
|
|
1605
1771
|
}
|
|
1606
|
-
|
|
1772
|
+
d.push({
|
|
1607
1773
|
start: N,
|
|
1608
|
-
end:
|
|
1774
|
+
end: F
|
|
1609
1775
|
});
|
|
1610
1776
|
{
|
|
1611
|
-
|
|
1777
|
+
new e.PointsMaterial({
|
|
1778
|
+
color: 65535,
|
|
1779
|
+
size: .01
|
|
1780
|
+
});
|
|
1781
|
+
let t = new e.Vector3().subVectors(N, F), n = new e.Vector3().subVectors(F, N), r = Infinity, i = Infinity, o = N.clone(), s = F.clone(), c = [], l = [], u = new e.Line3(A, M), d = new e.Vector3(), f = 999999;
|
|
1612
1782
|
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 >
|
|
1614
|
-
let i = u.closestPointToPoint(r, !0, d), a =
|
|
1615
|
-
|
|
1783
|
+
if (r.z - N.z < S / 2 + .1 && r.z - N.z > S / 2 - .1 && c.push(r), r.z > A.z) {
|
|
1784
|
+
let i = u.closestPointToPoint(r, !0, d), a = new e.Vector3().subVectors(i, A), o = j(t, new e.Vector3().subVectors(i, M)), s = j(n, a);
|
|
1785
|
+
o && o.parallel && !o.sameDirection && s && s.parallel && !s.sameDirection && l.push(r);
|
|
1616
1786
|
}
|
|
1617
1787
|
}), c.length > 0) {
|
|
1618
|
-
let { newProjectPoints: a } =
|
|
1788
|
+
let { newProjectPoints: a } = ae(N, F, c);
|
|
1619
1789
|
for (let e of a) e.z = N.z;
|
|
1620
1790
|
a.forEach((a) => {
|
|
1621
|
-
let c = new e.Vector3(a.x, a.y, N.z), l = new e.Vector3().subVectors(c,
|
|
1791
|
+
let c = new e.Vector3(a.x, a.y, N.z), l = new e.Vector3().subVectors(c, F), u = j(t, new e.Vector3().subVectors(c, N)), d = j(n, l);
|
|
1622
1792
|
if (u && u.parallel && u.sameDirection) {
|
|
1623
1793
|
let e = c.distanceTo(N);
|
|
1624
1794
|
e < r && (r = e, o = c);
|
|
1625
1795
|
} else if (d && d.parallel && d.sameDirection) {
|
|
1626
|
-
let e = c.distanceTo(
|
|
1796
|
+
let e = c.distanceTo(F);
|
|
1627
1797
|
e < i && (i = e, s = c);
|
|
1628
1798
|
}
|
|
1629
1799
|
});
|
|
1630
1800
|
}
|
|
1631
|
-
o.equals(N) || (N = o, M = new e.Vector3(N.x, N.y, M.z)), s.equals(
|
|
1801
|
+
if (o.equals(N) || (N = o, M = new e.Vector3(N.x, N.y, M.z)), s.equals(F) || (F = s, A = new e.Vector3(F.x, F.y, A.z)), l.length > 10) {
|
|
1802
|
+
let { newOnLinePoints: e } = ae(M, A, l);
|
|
1803
|
+
for (let t = 0; t < e.length; t++) {
|
|
1804
|
+
let n = u.closestPointToPoint(e[t], !0, d).distanceTo(e[t]);
|
|
1805
|
+
n > .02 && f > n && (f = n);
|
|
1806
|
+
}
|
|
1807
|
+
A.z += f, M.z += f, S += f;
|
|
1808
|
+
}
|
|
1632
1809
|
}
|
|
1633
|
-
let
|
|
1634
|
-
if (
|
|
1635
|
-
|
|
1810
|
+
let p = F.distanceTo(N);
|
|
1811
|
+
if (p < .4 && !E || p < .3 && E) continue;
|
|
1812
|
+
u.includes(i) || u.push(i), a.checkResults[o.index].isDoor = !0;
|
|
1636
1813
|
let m = "", h = {
|
|
1637
|
-
id:
|
|
1638
|
-
beamStart:
|
|
1814
|
+
id: c,
|
|
1815
|
+
beamStart: A,
|
|
1639
1816
|
beamEnd: M,
|
|
1640
|
-
beamHeight: a.rooftopPz -
|
|
1817
|
+
beamHeight: a.rooftopPz - A.z,
|
|
1641
1818
|
doorStart: N,
|
|
1642
|
-
doorEnd:
|
|
1819
|
+
doorEnd: F,
|
|
1643
1820
|
doorHeight: S,
|
|
1644
1821
|
nearId: -1,
|
|
1645
1822
|
type: m,
|
|
1646
|
-
isExtend:
|
|
1823
|
+
isExtend: ee,
|
|
1647
1824
|
isDoor: E,
|
|
1648
|
-
isPullOutDoor:
|
|
1825
|
+
isPullOutDoor: D,
|
|
1649
1826
|
pcbDoorIndexs: k
|
|
1650
1827
|
}, g = !1, _ = new e.Vector3(), v = new e.Vector3(), y = -1;
|
|
1651
|
-
for (let n = 0; n <
|
|
1652
|
-
let r = t[
|
|
1828
|
+
for (let n = 0; n < l.length; n++) {
|
|
1829
|
+
let r = t[l[n].linesIndex].doorAndBeamData[l[n].doorIndex];
|
|
1653
1830
|
if (r.nearId != -1) continue;
|
|
1654
|
-
let i =
|
|
1831
|
+
let i = I(A.clone(), M.clone(), r.beamStart.clone(), r.beamEnd.clone());
|
|
1655
1832
|
if (i && i.isParallel) {
|
|
1656
|
-
let t =
|
|
1833
|
+
let t = A.distanceTo(M), n = r.beamStart.distanceTo(r.beamEnd), i = new e.Line3(A.clone(), M.clone());
|
|
1657
1834
|
i.start.z = 0, i.end.z = 0;
|
|
1658
|
-
let a =
|
|
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 =
|
|
1660
|
-
let o = new e.Vector3(), s = i.closestPointToPoint(a, !0, o),
|
|
1661
|
-
if (
|
|
1662
|
-
r.nearId =
|
|
1835
|
+
let a = R(r.beamStart, r.beamEnd, !0);
|
|
1836
|
+
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 = R(A, M, !0));
|
|
1837
|
+
let o = new e.Vector3(), s = i.closestPointToPoint(a, !0, o), l = s.distanceTo(a), u = new e.Vector3().subVectors(a, s).normalize(), d = u.clone().negate(), f = a.clone().addScaledVector(d, l + .1), p = O(i.start, i.end, a, f), m = !E && !r.isDoor && (t > n * 2 || n > t * 2);
|
|
1838
|
+
if (l < .4 && p != null && !m) {
|
|
1839
|
+
r.nearId = c, h.nearId = r.id;
|
|
1663
1840
|
let e = .8;
|
|
1664
1841
|
(r.isDoor || h.isDoor) && (r.isDoor = !0, h.isDoor = !0);
|
|
1665
1842
|
let i = k.some((e) => r.pcbDoorIndexs.includes(e));
|
|
1666
|
-
t < n ? t > e && !r.isPullOutDoor ? (r.beamStart =
|
|
1843
|
+
t < n ? t > e && !r.isPullOutDoor ? (r.beamStart = A.clone().addScaledVector(d, l), r.beamEnd = M.clone().addScaledVector(d, l), r.doorStart = N.clone().addScaledVector(d, l), r.doorEnd = F.clone().addScaledVector(d, l), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : !D || D && r.isPullOutDoor && i ? (h.beamStart = r.beamStart.clone().addScaledVector(u, l), h.beamEnd = r.beamEnd.clone().addScaledVector(u, l), h.doorStart = r.doorStart.clone().addScaledVector(u, l), h.doorEnd = r.doorEnd.clone().addScaledVector(u, l), h.doorHeight = r.doorHeight, h.beamStart.z = h.beamEnd.z = h.doorStart.z + h.doorHeight) : (r.beamStart = A.clone().addScaledVector(d, l), r.beamEnd = M.clone().addScaledVector(d, l), r.doorStart = N.clone().addScaledVector(d, l), r.doorEnd = F.clone().addScaledVector(d, l), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : t > n && (n > e && !D ? (h.beamStart = r.beamStart.clone().addScaledVector(d, l), h.beamEnd = r.beamEnd.clone().addScaledVector(d, l), h.doorStart = r.doorStart.clone().addScaledVector(d, l), h.doorEnd = r.doorEnd.clone().addScaledVector(d, l), h.doorHeight = r.doorHeight, h.beamStart.z = h.beamEnd.z = h.doorStart.z + h.doorHeight) : !r.isPullOutDoor || D && r.isPullOutDoor && i ? (r.beamStart = A.clone().addScaledVector(u, l), r.beamEnd = M.clone().addScaledVector(u, l), r.doorStart = N.clone().addScaledVector(u, l), r.doorEnd = F.clone().addScaledVector(u, l), r.doorHeight = h.doorHeight, r.beamStart.z = r.beamEnd.z = r.doorStart.z + r.doorHeight) : (h.beamStart = r.beamStart.clone().addScaledVector(d, l), h.beamEnd = r.beamEnd.clone().addScaledVector(d, l), h.doorStart = r.doorStart.clone().addScaledVector(d, l), h.doorEnd = r.doorEnd.clone().addScaledVector(d, l), 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;
|
|
1667
1844
|
break;
|
|
1668
1845
|
}
|
|
1669
1846
|
}
|
|
1670
1847
|
}
|
|
1671
1848
|
let b = !1;
|
|
1672
1849
|
if (!g) {
|
|
1673
|
-
let a = new e.Line3(N.clone(),
|
|
1850
|
+
let a = new e.Line3(N.clone(), F.clone());
|
|
1674
1851
|
for (let o = 0; o < t.length; o++) {
|
|
1675
1852
|
if (t[o].length < .5 || o == i || !t[o].checkResults) continue;
|
|
1676
|
-
let
|
|
1677
|
-
if (
|
|
1853
|
+
let c = z(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, F);
|
|
1854
|
+
if (c && c.maxPerpendicularDistance < .3) {
|
|
1678
1855
|
for (let i = 0; i < t[o].checkResults.length; i++) {
|
|
1679
1856
|
let i = [];
|
|
1680
1857
|
t[o].originalPoints.forEach((t) => {
|
|
1681
1858
|
t.z > N.z && t.z < N.z + S / 2 && i.push(new e.Vector3(t.x, t.y, N.z));
|
|
1682
1859
|
});
|
|
1683
|
-
let
|
|
1860
|
+
let c = new e.Vector3(), l = [], u = [];
|
|
1684
1861
|
for (let e = 0; e < i.length; e++) {
|
|
1685
|
-
let t = a.closestPointToPoint(i[e], !0,
|
|
1862
|
+
let t = a.closestPointToPoint(i[e], !0, c);
|
|
1686
1863
|
t.distanceTo(i[e]) < .15 && (l.push(i[e]), u.push(t.clone()));
|
|
1687
1864
|
}
|
|
1688
|
-
for (let e = 0; e < u.length; e++)
|
|
1865
|
+
for (let e = 0; e < u.length; e++) se(a, u[e]) && l.push(u[e]);
|
|
1689
1866
|
if (l = u, l.length < 500) continue;
|
|
1690
|
-
let d =
|
|
1867
|
+
let d = ce(l);
|
|
1691
1868
|
if (d.length == 2) {
|
|
1692
1869
|
let e = d[0].distanceTo(d[1]);
|
|
1693
1870
|
if (Math.abs(e - a.distance()) < .3) {
|
|
1694
|
-
n = !0,
|
|
1871
|
+
n = !0, te != -1 && (r[s[te].index].isFindBeam = !1, s[te].isFind = !1);
|
|
1695
1872
|
break;
|
|
1696
1873
|
}
|
|
1697
1874
|
}
|
|
1698
1875
|
}
|
|
1699
1876
|
if (n) break;
|
|
1700
|
-
} else
|
|
1877
|
+
} else c && c.type == "collinear_overlap" && c.maxPerpendicularDistance > .3 && c.maxPerpendicularDistance < .7 && (b = !0);
|
|
1701
1878
|
}
|
|
1702
1879
|
if (n) continue;
|
|
1703
1880
|
}
|
|
1704
1881
|
let C = !1;
|
|
1705
|
-
if (y != -1) for (let e = 0; e <
|
|
1882
|
+
if (y != -1) for (let e = 0; e < f.length && !(f[e].length == 1 && (f[e][0].id == c ? (f[e].push({
|
|
1706
1883
|
id: y,
|
|
1707
1884
|
beamStart: _,
|
|
1708
1885
|
beamEnd: v
|
|
1709
|
-
}), C = !0) :
|
|
1710
|
-
id:
|
|
1711
|
-
beamStart:
|
|
1886
|
+
}), C = !0) : f[e][0].id == y && (f[e].push({
|
|
1887
|
+
id: c,
|
|
1888
|
+
beamStart: A,
|
|
1712
1889
|
beamEnd: M
|
|
1713
1890
|
}), C = !0), C)); e++);
|
|
1714
|
-
C ||
|
|
1715
|
-
id:
|
|
1716
|
-
beamStart:
|
|
1891
|
+
C || f.push([{
|
|
1892
|
+
id: c,
|
|
1893
|
+
beamStart: A,
|
|
1717
1894
|
beamEnd: M
|
|
1718
1895
|
}]);
|
|
1719
1896
|
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") {
|
|
1897
|
+
if (console.log("id:", c, i, w), m = E ? "door" : w > 1.8 || b && w > 1 ? "beam" : "hole", h.type = m, h.nearId != -1 && m == "hole") {
|
|
1721
1898
|
let e = !1;
|
|
1722
1899
|
for (let n = 0; n < t.length; n++) if (t[n].doorAndBeamData) {
|
|
1723
|
-
for (let r = 0; r < t[n].doorAndBeamData.length; r++) if (t[n].doorAndBeamData[r].nearId ==
|
|
1900
|
+
for (let r = 0; r < t[n].doorAndBeamData.length; r++) if (t[n].doorAndBeamData[r].nearId == c && t[n].doorAndBeamData[r].type == "beam") {
|
|
1724
1901
|
t[n].doorAndBeamData[r].type = m, e = !0;
|
|
1725
1902
|
break;
|
|
1726
1903
|
}
|
|
1727
1904
|
if (e) break;
|
|
1728
1905
|
}
|
|
1729
1906
|
}
|
|
1730
|
-
if (a.doorAndBeamData.push(h),
|
|
1907
|
+
if (a.doorAndBeamData.push(h), l.push({
|
|
1731
1908
|
linesIndex: i,
|
|
1732
1909
|
doorIndex: a.doorAndBeamData.length - 1
|
|
1733
|
-
}),
|
|
1910
|
+
}), c++, D && x < 2) break;
|
|
1734
1911
|
}
|
|
1735
1912
|
}
|
|
1736
1913
|
}
|
|
1737
|
-
let
|
|
1738
|
-
a.completePointAreaPercentage =
|
|
1914
|
+
let b = a.length * (a.rooftopPz - a.start.z);
|
|
1915
|
+
a.completePointAreaPercentage = y / b * 100;
|
|
1739
1916
|
}
|
|
1740
|
-
if (
|
|
1917
|
+
if (u.length > 1) for (let n = 0; n < u.length; n++) {
|
|
1741
1918
|
let r = [];
|
|
1742
|
-
for (let i = 0; i < t[
|
|
1743
|
-
let a = t[
|
|
1919
|
+
for (let i = 0; i < t[u[n]].doorAndBeamData.length; i++) {
|
|
1920
|
+
let a = t[u[n]].doorAndBeamData[i].doorStart.clone(), o = t[u[n]].doorAndBeamData[i].doorEnd.clone();
|
|
1744
1921
|
a.z = o.z = 0;
|
|
1745
1922
|
let s = a.distanceTo(o), c = !1;
|
|
1746
|
-
for (let r = 0; r <
|
|
1747
|
-
let i = t[
|
|
1923
|
+
for (let r = 0; r < u.length; r++) if (n != r) for (let n = 0; n < t[u[r]].doorAndBeamData.length; n++) {
|
|
1924
|
+
let i = t[u[r]].doorAndBeamData[n].doorStart.clone(), l = t[u[r]].doorAndBeamData[n].doorEnd.clone();
|
|
1748
1925
|
i.z = l.z = 0, i.distanceTo(l);
|
|
1749
|
-
let
|
|
1750
|
-
if (
|
|
1751
|
-
let t = new e.Line3(i, l), n =
|
|
1752
|
-
if (Math.abs(s -
|
|
1926
|
+
let d = z(a, o, i, l);
|
|
1927
|
+
if (d.type == "collinear_overlap" && d.maxPerpendicularDistance < .2) {
|
|
1928
|
+
let t = new e.Line3(i, l), n = R(a, o), r = t.closestPointToPoint(n, !0, new e.Vector3()), u = n.distanceTo(r);
|
|
1929
|
+
if (Math.abs(s - d.overlap) < .1 && u < .04) {
|
|
1753
1930
|
c = !0;
|
|
1754
1931
|
break;
|
|
1755
1932
|
}
|
|
1756
1933
|
}
|
|
1757
1934
|
}
|
|
1758
|
-
c || r.push(t[
|
|
1759
|
-
}
|
|
1760
|
-
r.length != t[
|
|
1761
|
-
}
|
|
1762
|
-
let
|
|
1763
|
-
for (let n = 0; n <
|
|
1764
|
-
if (
|
|
1765
|
-
let i = new e.Vector3(
|
|
1766
|
-
for (let
|
|
1767
|
-
if (t[
|
|
1768
|
-
let u = new e.Vector3(t[
|
|
1769
|
-
|
|
1770
|
-
let C =
|
|
1771
|
-
if ((T <
|
|
1772
|
-
let o = i.distanceTo(u) < i.distanceTo(d) ? u : d,
|
|
1935
|
+
c || r.push(t[u[n]].doorAndBeamData[i]);
|
|
1936
|
+
}
|
|
1937
|
+
r.length != t[u[n]].doorAndBeamData.length && (t[u[n]].doorAndBeamData = r);
|
|
1938
|
+
}
|
|
1939
|
+
let m = .65, h = [], g = [];
|
|
1940
|
+
for (let n = 0; n < s.length; n++) {
|
|
1941
|
+
if (s[n].isFind || s[n].inWall) continue;
|
|
1942
|
+
let i = new e.Vector3(s[n].doorStartPt.x, s[n].doorStartPt.y, 0), a = new e.Vector3(s[n].doorEndPt.x, s[n].doorEndPt.y, 0), o = new e.Vector3().subVectors(i, a).normalize();
|
|
1943
|
+
for (let l = 0; l < t.length; l++) {
|
|
1944
|
+
if (t[l].length < .7 || t[l].completePointAreaPercentage > 60) continue;
|
|
1945
|
+
let u = new e.Vector3(t[l].start.x, t[l].start.y, 0), d = new e.Vector3(t[l].end.x, t[l].end.y, 0), _ = 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(_, v), S = d.clone().addScaledVector(_.clone().negate(), v);
|
|
1946
|
+
O(y, b, x, S);
|
|
1947
|
+
let C = I(y, b, x, S), w = i.distanceTo(u) > a.distanceTo(u) ? a : i, T = w.distanceTo(u), E = w.distanceTo(d);
|
|
1948
|
+
if ((T < p || E < p) && C && !C.isParallel) {
|
|
1949
|
+
let o = i.distanceTo(u) < i.distanceTo(d) ? u : d, _ = !1;
|
|
1773
1950
|
for (let v = 0; v < t.length; v++) {
|
|
1774
|
-
if (v ==
|
|
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 =
|
|
1776
|
-
if (
|
|
1777
|
-
let
|
|
1778
|
-
if (w > T && T >
|
|
1779
|
-
else if (w < T && w >
|
|
1951
|
+
if (v == l || h.includes(v) || t[v].length < .7) continue;
|
|
1952
|
+
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 = L(u, d, y, b), E = z(u, d, y, b), D = O(u, d, C, w), k = !0;
|
|
1953
|
+
if (D != null && (k = D.point.distanceTo(u) < p || D.point.distanceTo(d) < p), (T && T.angle > 85 || E && E.type == "collinear_gap") && k) {
|
|
1954
|
+
let p = new e.Line3(u, d), x = new e.Vector3(), S = p.closestPointToPoint(y, !0, x), C = p.closestPointToPoint(b, !0, x), w = S.distanceTo(y), T = C.distanceTo(b), E, D;
|
|
1955
|
+
if (w > T && T > m) E = b, D = C;
|
|
1956
|
+
else if (w < T && w > m) E = y, D = S;
|
|
1780
1957
|
else continue;
|
|
1781
1958
|
if (w = o.distanceTo(y), T = o.distanceTo(b), w > 2 && T > 2) continue;
|
|
1782
|
-
let O =
|
|
1959
|
+
let O = I(E, D, y, b);
|
|
1783
1960
|
if (!O || !O.isParallel) continue;
|
|
1784
|
-
let k =
|
|
1961
|
+
let k = z(i, a, E, D);
|
|
1785
1962
|
if (k && k.type == "collinear_overlap" && k.maxPerpendicularDistance < .2) continue;
|
|
1786
1963
|
E.z = D.z = t[v].start.z;
|
|
1787
1964
|
let A = !1;
|
|
1788
|
-
for (let e = 0; e <
|
|
1789
|
-
let t =
|
|
1965
|
+
for (let e = 0; e < g.length; e++) {
|
|
1966
|
+
let t = z(g[e].start, g[e].end, E, D);
|
|
1790
1967
|
if (t && t.type == "collinear_overlap" && t.maxPerpendicularDistance < .2) {
|
|
1791
1968
|
A = !0;
|
|
1792
1969
|
break;
|
|
@@ -1795,20 +1972,20 @@ var fe = class {
|
|
|
1795
1972
|
if (A) continue;
|
|
1796
1973
|
for (let n = 0; n < t.length; n++) {
|
|
1797
1974
|
if (t[n].length < .5) continue;
|
|
1798
|
-
let r =
|
|
1975
|
+
let r = z(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);
|
|
1799
1976
|
if (r && r.type == "collinear_overlap" && r.maxPerpendicularDistance < .1) {
|
|
1800
1977
|
A = !0;
|
|
1801
1978
|
break;
|
|
1802
1979
|
}
|
|
1803
1980
|
}
|
|
1804
1981
|
if (A) continue;
|
|
1805
|
-
|
|
1982
|
+
g.push({
|
|
1806
1983
|
start: E,
|
|
1807
1984
|
end: D
|
|
1808
|
-
}),
|
|
1809
|
-
let j = t[v].rooftopPz - t[v].start.z, M = t[
|
|
1985
|
+
}), h.push(v);
|
|
1986
|
+
let j = t[v].rooftopPz - t[v].start.z, M = t[l].rooftopPz - t[l].start.z, N = j < M ? j : M;
|
|
1810
1987
|
t[v].doorAndBeamData || (t[v].doorAndBeamData = []), t[v].doorAndBeamData.push({
|
|
1811
|
-
id:
|
|
1988
|
+
id: c,
|
|
1812
1989
|
beamStart: E,
|
|
1813
1990
|
beamEnd: D,
|
|
1814
1991
|
beamHeight: N,
|
|
@@ -1818,23 +1995,23 @@ var fe = class {
|
|
|
1818
1995
|
nearId: -1,
|
|
1819
1996
|
type: "onlyDoor",
|
|
1820
1997
|
isDoor: !0
|
|
1821
|
-
}), r[
|
|
1822
|
-
id:
|
|
1998
|
+
}), r[s[n].index].isFindBeam = !0, r[s[n].index].isFindOnlyDoor = !0, f.push([{
|
|
1999
|
+
id: c,
|
|
1823
2000
|
beamStart: E,
|
|
1824
2001
|
beamEnd: D
|
|
1825
|
-
}]),
|
|
2002
|
+
}]), c++, _ = !0;
|
|
1826
2003
|
break;
|
|
1827
2004
|
}
|
|
1828
2005
|
}
|
|
1829
|
-
if (
|
|
2006
|
+
if (_) break;
|
|
1830
2007
|
}
|
|
1831
2008
|
}
|
|
1832
2009
|
}
|
|
1833
2010
|
return {
|
|
1834
2011
|
lines: t,
|
|
1835
|
-
beamGroup:
|
|
2012
|
+
beamGroup: f
|
|
1836
2013
|
};
|
|
1837
|
-
},
|
|
2014
|
+
}, ke = (t, n) => {
|
|
1838
2015
|
if (t.length <= 0) return t;
|
|
1839
2016
|
for (let n of t) {
|
|
1840
2017
|
let t = [];
|
|
@@ -1876,7 +2053,7 @@ var fe = class {
|
|
|
1876
2053
|
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) {
|
|
1877
2054
|
let t = new e.Vector3().subVectors(o, s).normalize();
|
|
1878
2055
|
d = o.distanceTo(p), u = o.distanceTo(s);
|
|
1879
|
-
let n =
|
|
2056
|
+
let n = j(t, new e.Vector3(0, 0, 1));
|
|
1880
2057
|
n && n.parallel && ([d, u] = [u, d]);
|
|
1881
2058
|
}
|
|
1882
2059
|
i.gridWidth = u, i.gridHeight = d;
|
|
@@ -1907,7 +2084,7 @@ var fe = class {
|
|
|
1907
2084
|
size: .01
|
|
1908
2085
|
});
|
|
1909
2086
|
for (let r = 0; r < t.length; r++) {
|
|
1910
|
-
let i = t[r], { minZ: o, maxZ: s } =
|
|
2087
|
+
let i = t[r], { minZ: o, maxZ: s } = ie(i);
|
|
1911
2088
|
if (o == null || s == null) continue;
|
|
1912
2089
|
i.doorAndBeamData = [], i.completePointAreaPercentage = -1, s - o;
|
|
1913
2090
|
let c = i.rooftopPz - i.start.z;
|
|
@@ -1915,17 +2092,17 @@ var fe = class {
|
|
|
1915
2092
|
let l = new e.Vector3(i.start.x, i.start.y, 0), u = new e.Vector3(i.end.x, i.end.y, 0);
|
|
1916
2093
|
for (let i = 0; i < t.length; i++) {
|
|
1917
2094
|
if (i == r || t[i].length < 1) continue;
|
|
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 =
|
|
2095
|
+
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 = I(l, u, o, c), f = R(l, u), p = new e.Line3(o, c).closestPointToPoint(f, !0, new e.Vector3()), m = f.distanceTo(p), h = ie(a);
|
|
1919
2096
|
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 =
|
|
2097
|
+
let a = R(l, u), s = R(o, c);
|
|
1921
2098
|
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));
|
|
1922
2099
|
let d = `w:${t[r].originaIndex},b:${t[i].originaIndex}`, f = `b:${t[i].originaIndex},w:${t[r].originaIndex}`;
|
|
1923
|
-
n.add(
|
|
2100
|
+
n.add(k(d, a, { textColor: "#fd0000" })), n.add(k(f, s, { textColor: "#fd0000" }));
|
|
1924
2101
|
}
|
|
1925
2102
|
}
|
|
1926
2103
|
}
|
|
1927
2104
|
return t;
|
|
1928
|
-
},
|
|
2105
|
+
}, Ae = (t, n) => {
|
|
1929
2106
|
let r = {
|
|
1930
2107
|
rectangles: [],
|
|
1931
2108
|
threeEdgeRect: []
|
|
@@ -1938,7 +2115,7 @@ var fe = class {
|
|
|
1938
2115
|
for (let r = 0; r < t.length; r++) {
|
|
1939
2116
|
let i = t[r].length;
|
|
1940
2117
|
if (r == n || i < a || i > o) continue;
|
|
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 =
|
|
2118
|
+
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 = L(u, d, g, _);
|
|
1942
2119
|
if (!v || v.angle < 85) continue;
|
|
1943
2120
|
let y = V(g, u), b = V(g, d), x = V(_, u), S = V(_, d);
|
|
1944
2121
|
if (!(!y && !b && !x && !S)) {
|
|
@@ -1946,19 +2123,19 @@ var fe = class {
|
|
|
1946
2123
|
for (let p = 0; p < t.length; p++) {
|
|
1947
2124
|
let h = t[p].length;
|
|
1948
2125
|
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 =
|
|
2126
|
+
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 = L(g, _, v, y);
|
|
1950
2127
|
if (!b || b.angle < 85) continue;
|
|
1951
2128
|
let x = V(v, m), S = V(y, m);
|
|
1952
2129
|
if (!x && !S) continue;
|
|
1953
2130
|
new e.Vector3();
|
|
1954
2131
|
let C = new e.Vector3(), w = new e.Vector3();
|
|
1955
2132
|
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 =
|
|
2133
|
+
let T = j(f, w, .1);
|
|
1957
2134
|
if (!(!T || !T.parallel || !T.sameDirection)) {
|
|
1958
2135
|
for (let f = 0; f < t.length; f++) {
|
|
1959
2136
|
let m = t[f].length;
|
|
1960
2137
|
if (f == n || f == r || f == p || m < a || m > o) continue;
|
|
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), _ =
|
|
2138
|
+
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), _ = L(h, g, v, y);
|
|
1962
2139
|
if (!_ || _.angle < 85) continue;
|
|
1963
2140
|
let b = V(h, C), x = V(g, C);
|
|
1964
2141
|
if (!b && !x) continue;
|
|
@@ -2008,7 +2185,7 @@ var fe = class {
|
|
|
2008
2185
|
for (let r = 0; r < t.length; r++) {
|
|
2009
2186
|
let f = t[r].length;
|
|
2010
2187
|
if (r == n || i.has(r) || f < a || f > o) 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 =
|
|
2188
|
+
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 = L(u, d, p, m);
|
|
2012
2189
|
if (!g || g.angle < 85) continue;
|
|
2013
2190
|
let _ = V(p, d), v = V(m, d);
|
|
2014
2191
|
if (!_ && !v) continue;
|
|
@@ -2018,13 +2195,13 @@ var fe = class {
|
|
|
2018
2195
|
for (let d = 0; d < t.length; d++) {
|
|
2019
2196
|
let g = t[d].length;
|
|
2020
2197
|
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 =
|
|
2198
|
+
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 = L(p, m, _, v);
|
|
2022
2199
|
if (!b || b.angle < 85) continue;
|
|
2023
2200
|
let x = V(_, y), S = V(v, y);
|
|
2024
2201
|
if (!x && !S) continue;
|
|
2025
2202
|
let C = new e.Vector3(), w = new e.Vector3();
|
|
2026
2203
|
x ? (C = _.clone(), w = v.clone()) : (C = v.clone(), w = _.clone());
|
|
2027
|
-
let T =
|
|
2204
|
+
let T = j(h, new e.Vector3().subVectors(w, C).normalize(), .1);
|
|
2028
2205
|
if (!T || !T.parallel || !T.sameDirection) continue;
|
|
2029
2206
|
let E = !0, D = !0;
|
|
2030
2207
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -2048,8 +2225,8 @@ var fe = class {
|
|
|
2048
2225
|
l.indexs.length == 3 && (l.indexs.forEach((e) => i.add(e)), r.threeEdgeRect.push(l));
|
|
2049
2226
|
}
|
|
2050
2227
|
return r;
|
|
2051
|
-
}, H = 11102230246251565e-32, U = 134217729,
|
|
2052
|
-
function
|
|
2228
|
+
}, H = 11102230246251565e-32, U = 134217729, je = (3 + 8 * H) * H;
|
|
2229
|
+
function Me(e, t, n, r, i) {
|
|
2053
2230
|
let a, o, s, c, l = t[0], u = r[0], d = 0, f = 0;
|
|
2054
2231
|
u > l == u > -l ? (a = l, l = t[++d]) : (a = u, u = r[++f]);
|
|
2055
2232
|
let p = 0;
|
|
@@ -2058,7 +2235,7 @@ function xe(e, t, n, r, i) {
|
|
|
2058
2235
|
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
2236
|
return (a !== 0 || p === 0) && (i[p++] = a), p;
|
|
2060
2237
|
}
|
|
2061
|
-
function
|
|
2238
|
+
function Ne(e, t) {
|
|
2062
2239
|
let n = t[0];
|
|
2063
2240
|
for (let r = 1; r < e; r++) n += t[r];
|
|
2064
2241
|
return n;
|
|
@@ -2068,27 +2245,27 @@ function W(e) {
|
|
|
2068
2245
|
}
|
|
2069
2246
|
//#endregion
|
|
2070
2247
|
//#region node_modules/robust-predicates/esm/orient2d.js
|
|
2071
|
-
var
|
|
2072
|
-
function
|
|
2248
|
+
var Pe = (3 + 16 * H) * H, Fe = (2 + 12 * H) * H, Ie = (9 + 64 * H) * H * H, Le = W(4), Re = W(8), ze = W(12), Be = W(16), G = W(4);
|
|
2249
|
+
function Ve(e, t, n, r, i, a, o) {
|
|
2073
2250
|
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 - _,
|
|
2075
|
-
let k =
|
|
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 =
|
|
2251
|
+
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 - _, Le[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, Le[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, Le[2] = v - (w - d) + (_ - d), Le[3] = w;
|
|
2252
|
+
let k = Ne(4, Le), A = Fe * o;
|
|
2253
|
+
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 = Ie * o + je * Math.abs(k), k += T * u + O * s - (D * l + E * c), k >= A || -k >= A)) return k;
|
|
2077
2254
|
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 =
|
|
2255
|
+
let j = Me(4, Le, 4, G, Re);
|
|
2079
2256
|
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 =
|
|
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,
|
|
2257
|
+
let M = Me(j, Re, 4, G, ze);
|
|
2258
|
+
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, Be[Me(M, ze, 4, G, Be) - 1];
|
|
2082
2259
|
}
|
|
2083
|
-
function
|
|
2260
|
+
function He(e, t, n, r, i, a) {
|
|
2084
2261
|
let o = (t - a) * (n - i), s = (e - i) * (r - a), c = o - s, l = Math.abs(o + s);
|
|
2085
|
-
return Math.abs(c) >=
|
|
2262
|
+
return Math.abs(c) >= Pe * l ? c : -Ve(e, t, n, r, i, a, l);
|
|
2086
2263
|
}
|
|
2087
2264
|
(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
2265
|
//#endregion
|
|
2089
2266
|
//#region node_modules/delaunator/index.js
|
|
2090
|
-
var
|
|
2091
|
-
static from(t, n =
|
|
2267
|
+
var Ue = 2 ** -52, We = new Uint32Array(512), Ge = class e {
|
|
2268
|
+
static from(t, n = $e, r = et) {
|
|
2092
2269
|
let i = t.length, a = new Float64Array(i * 2);
|
|
2093
2270
|
for (let e = 0; e < i; e++) {
|
|
2094
2271
|
let i = t[e];
|
|
@@ -2111,25 +2288,25 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2111
2288
|
}
|
|
2112
2289
|
let u = (o + c) / 2, d = (s + l) / 2, f = 0, p = 0, m = 0;
|
|
2113
2290
|
for (let t = 0, n = Infinity; t < a; t++) {
|
|
2114
|
-
let r =
|
|
2291
|
+
let r = qe(u, d, e[2 * t], e[2 * t + 1]);
|
|
2115
2292
|
r < n && (f = t, n = r);
|
|
2116
2293
|
}
|
|
2117
2294
|
let h = e[2 * f], g = e[2 * f + 1];
|
|
2118
2295
|
for (let t = 0, n = Infinity; t < a; t++) {
|
|
2119
2296
|
if (t === f) continue;
|
|
2120
|
-
let r =
|
|
2297
|
+
let r = qe(h, g, e[2 * t], e[2 * t + 1]);
|
|
2121
2298
|
r < n && r > 0 && (p = t, n = r);
|
|
2122
2299
|
}
|
|
2123
2300
|
let _ = e[2 * p], v = e[2 * p + 1], y = Infinity;
|
|
2124
2301
|
for (let t = 0; t < a; t++) {
|
|
2125
2302
|
if (t === f || t === p) continue;
|
|
2126
|
-
let n =
|
|
2303
|
+
let n = Ye(h, g, _, v, e[2 * t], e[2 * t + 1]);
|
|
2127
2304
|
n < y && (m = t, y = n);
|
|
2128
2305
|
}
|
|
2129
2306
|
let b = e[2 * m], x = e[2 * m + 1];
|
|
2130
2307
|
if (y === Infinity) {
|
|
2131
2308
|
for (let t = 0; t < a; t++) this._dists[t] = e[2 * t] - e[0] || e[2 * t + 1] - e[1];
|
|
2132
|
-
|
|
2309
|
+
Ze(this._ids, this._dists, 0, a - 1);
|
|
2133
2310
|
let t = new Uint32Array(a), n = 0;
|
|
2134
2311
|
for (let e = 0, r = -Infinity; e < a; e++) {
|
|
2135
2312
|
let i = this._ids[e], a = this._dists[i];
|
|
@@ -2138,24 +2315,24 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2138
2315
|
this.hull = t.subarray(0, n), this.triangles = new Uint32Array(), this.halfedges = new Int32Array();
|
|
2139
2316
|
return;
|
|
2140
2317
|
}
|
|
2141
|
-
if (
|
|
2318
|
+
if (He(h, g, _, v, b, x) < 0) {
|
|
2142
2319
|
let e = p, t = _, n = v;
|
|
2143
2320
|
p = m, _ = b, v = x, m = e, b = t, x = n;
|
|
2144
2321
|
}
|
|
2145
|
-
let S =
|
|
2322
|
+
let S = Xe(h, g, _, v, b, x);
|
|
2146
2323
|
this._cx = S.x, this._cy = S.y;
|
|
2147
|
-
for (let t = 0; t < a; t++) this._dists[t] =
|
|
2148
|
-
|
|
2324
|
+
for (let t = 0; t < a; t++) this._dists[t] = qe(e[2 * t], e[2 * t + 1], S.x, S.y);
|
|
2325
|
+
Ze(this._ids, this._dists, 0, a - 1), this._hullStart = f;
|
|
2149
2326
|
let C = 3;
|
|
2150
2327
|
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
2328
|
for (let a = 0, o = 0, s = 0; a < this._ids.length; a++) {
|
|
2152
2329
|
let c = this._ids[a], l = e[2 * c], u = e[2 * c + 1];
|
|
2153
|
-
if (a > 0 && Math.abs(l - o) <=
|
|
2330
|
+
if (a > 0 && Math.abs(l - o) <= Ue && Math.abs(u - s) <= Ue || (o = l, s = u, c === f || c === p || c === m)) continue;
|
|
2154
2331
|
let d = 0;
|
|
2155
2332
|
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
2333
|
d = t[d];
|
|
2157
2334
|
let h = d, g;
|
|
2158
|
-
for (; g = n[h],
|
|
2335
|
+
for (; g = n[h], He(l, u, e[2 * h], e[2 * h + 1], e[2 * g], e[2 * g + 1]) >= 0;) if (h = g, h === d) {
|
|
2159
2336
|
h = -1;
|
|
2160
2337
|
break;
|
|
2161
2338
|
}
|
|
@@ -2163,8 +2340,8 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2163
2340
|
let _ = this._addTriangle(h, c, n[h], -1, -1, r[h]);
|
|
2164
2341
|
r[c] = this._legalize(_ + 2), r[h] = _, C++;
|
|
2165
2342
|
let v = n[h];
|
|
2166
|
-
for (; g = n[v],
|
|
2167
|
-
if (h === d) for (; g = t[h],
|
|
2343
|
+
for (; g = n[v], He(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;
|
|
2344
|
+
if (h === d) for (; g = t[h], He(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
2345
|
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
2346
|
}
|
|
2170
2347
|
this.hull = new Uint32Array(C);
|
|
@@ -2172,7 +2349,7 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2172
2349
|
this.triangles = this._triangles.subarray(0, this.trianglesLen), this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
|
|
2173
2350
|
}
|
|
2174
2351
|
_hashKey(e, t) {
|
|
2175
|
-
return Math.floor(
|
|
2352
|
+
return Math.floor(Ke(e - this._cx, t - this._cy) * this._hashSize) % this._hashSize;
|
|
2176
2353
|
}
|
|
2177
2354
|
_legalize(e) {
|
|
2178
2355
|
let { _triangles: t, _halfedges: n, coords: r } = this, i = 0, a = 0;
|
|
@@ -2180,11 +2357,11 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2180
2357
|
let o = n[e], s = e - e % 3;
|
|
2181
2358
|
if (a = s + (e + 2) % 3, o === -1) {
|
|
2182
2359
|
if (i === 0) break;
|
|
2183
|
-
e =
|
|
2360
|
+
e = We[--i];
|
|
2184
2361
|
continue;
|
|
2185
2362
|
}
|
|
2186
2363
|
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 (
|
|
2364
|
+
if (Je(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
2365
|
t[e] = m, t[o] = d;
|
|
2189
2366
|
let r = n[u];
|
|
2190
2367
|
if (r === -1) {
|
|
@@ -2199,10 +2376,10 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2199
2376
|
}
|
|
2200
2377
|
this._link(e, r), this._link(o, n[a]), this._link(a, u);
|
|
2201
2378
|
let s = c + (o + 1) % 3;
|
|
2202
|
-
i <
|
|
2379
|
+
i < We.length && (We[i++] = s);
|
|
2203
2380
|
} else {
|
|
2204
2381
|
if (i === 0) break;
|
|
2205
|
-
e =
|
|
2382
|
+
e = We[--i];
|
|
2206
2383
|
}
|
|
2207
2384
|
}
|
|
2208
2385
|
return a;
|
|
@@ -2215,30 +2392,30 @@ var Me = 2 ** -52, Ne = new Uint32Array(512), Pe = class e {
|
|
|
2215
2392
|
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
2393
|
}
|
|
2217
2394
|
};
|
|
2218
|
-
function
|
|
2395
|
+
function Ke(e, t) {
|
|
2219
2396
|
let n = e / (Math.abs(e) + Math.abs(t));
|
|
2220
2397
|
return (t > 0 ? 3 - n : 1 + n) / 4;
|
|
2221
2398
|
}
|
|
2222
|
-
function
|
|
2399
|
+
function qe(e, t, n, r) {
|
|
2223
2400
|
let i = e - n, a = t - r;
|
|
2224
2401
|
return i * i + a * a;
|
|
2225
2402
|
}
|
|
2226
|
-
function
|
|
2403
|
+
function Je(e, t, n, r, i, a, o, s) {
|
|
2227
2404
|
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
2405
|
return c * (d * g - h * p) - l * (u * g - h * f) + m * (u * p - d * f) < 0;
|
|
2229
2406
|
}
|
|
2230
|
-
function
|
|
2407
|
+
function Ye(e, t, n, r, i, a) {
|
|
2231
2408
|
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
2409
|
return p * p + m * m;
|
|
2233
2410
|
}
|
|
2234
|
-
function
|
|
2411
|
+
function Xe(e, t, n, r, i, a) {
|
|
2235
2412
|
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
2413
|
return {
|
|
2237
2414
|
x: e + (l * u - s * d) * f,
|
|
2238
2415
|
y: t + (o * d - c * u) * f
|
|
2239
2416
|
};
|
|
2240
2417
|
}
|
|
2241
|
-
function
|
|
2418
|
+
function Ze(e, t, n, r) {
|
|
2242
2419
|
if (r - n <= 20) for (let i = n + 1; i <= r; i++) {
|
|
2243
2420
|
let r = e[i], a = t[r], o = i - 1;
|
|
2244
2421
|
for (; o >= n && t[e[o]] > a;) e[o + 1] = e[o--];
|
|
@@ -2246,7 +2423,7 @@ function Be(e, t, n, r) {
|
|
|
2246
2423
|
}
|
|
2247
2424
|
else {
|
|
2248
2425
|
let i = n + r >> 1, a = n + 1, o = r;
|
|
2249
|
-
|
|
2426
|
+
Qe(e, i, a), t[e[n]] > t[e[r]] && Qe(e, n, r), t[e[a]] > t[e[r]] && Qe(e, a, r), t[e[n]] > t[e[a]] && Qe(e, n, a);
|
|
2250
2427
|
let s = e[a], c = t[s];
|
|
2251
2428
|
for (;;) {
|
|
2252
2429
|
do
|
|
@@ -2256,24 +2433,24 @@ function Be(e, t, n, r) {
|
|
|
2256
2433
|
o--;
|
|
2257
2434
|
while (t[e[o]] > c);
|
|
2258
2435
|
if (o < a) break;
|
|
2259
|
-
|
|
2436
|
+
Qe(e, a, o);
|
|
2260
2437
|
}
|
|
2261
|
-
e[n + 1] = e[o], e[o] = s, r - a + 1 >= o - n ? (
|
|
2438
|
+
e[n + 1] = e[o], e[o] = s, r - a + 1 >= o - n ? (Ze(e, t, a, r), Ze(e, t, n, o - 1)) : (Ze(e, t, n, o - 1), Ze(e, t, a, r));
|
|
2262
2439
|
}
|
|
2263
2440
|
}
|
|
2264
|
-
function
|
|
2441
|
+
function Qe(e, t, n) {
|
|
2265
2442
|
let r = e[t];
|
|
2266
2443
|
e[t] = e[n], e[n] = r;
|
|
2267
2444
|
}
|
|
2268
|
-
function
|
|
2445
|
+
function $e(e) {
|
|
2269
2446
|
return e[0];
|
|
2270
2447
|
}
|
|
2271
|
-
function
|
|
2448
|
+
function et(e) {
|
|
2272
2449
|
return e[1];
|
|
2273
2450
|
}
|
|
2274
2451
|
//#endregion
|
|
2275
2452
|
//#region node_modules/d3-delaunay/src/path.js
|
|
2276
|
-
var
|
|
2453
|
+
var tt = 1e-6, nt = class {
|
|
2277
2454
|
constructor() {
|
|
2278
2455
|
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
|
|
2279
2456
|
}
|
|
@@ -2290,7 +2467,7 @@ var We = 1e-6, Ge = class {
|
|
|
2290
2467
|
e = +e, t = +t, n = +n;
|
|
2291
2468
|
let r = e + n, i = t;
|
|
2292
2469
|
if (n < 0) throw Error("negative radius");
|
|
2293
|
-
this._x1 === null ? this._ += `M${r},${i}` : (Math.abs(this._x1 - r) >
|
|
2470
|
+
this._x1 === null ? this._ += `M${r},${i}` : (Math.abs(this._x1 - r) > tt || Math.abs(this._y1 - i) > tt) && (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
2471
|
}
|
|
2295
2472
|
rect(e, t, n, r) {
|
|
2296
2473
|
this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${+n}v${+r}h${-n}Z`;
|
|
@@ -2298,7 +2475,7 @@ var We = 1e-6, Ge = class {
|
|
|
2298
2475
|
value() {
|
|
2299
2476
|
return this._ || null;
|
|
2300
2477
|
}
|
|
2301
|
-
},
|
|
2478
|
+
}, rt = class {
|
|
2302
2479
|
constructor() {
|
|
2303
2480
|
this._ = [];
|
|
2304
2481
|
}
|
|
@@ -2314,7 +2491,7 @@ var We = 1e-6, Ge = class {
|
|
|
2314
2491
|
value() {
|
|
2315
2492
|
return this._.length ? this._ : null;
|
|
2316
2493
|
}
|
|
2317
|
-
},
|
|
2494
|
+
}, it = class {
|
|
2318
2495
|
constructor(e, [t, n, r, i] = [
|
|
2319
2496
|
0,
|
|
2320
2497
|
0,
|
|
@@ -2350,7 +2527,7 @@ var We = 1e-6, Ge = class {
|
|
|
2350
2527
|
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
2528
|
}
|
|
2352
2529
|
render(e) {
|
|
2353
|
-
let t = e == null ? e = new
|
|
2530
|
+
let t = e == null ? e = new nt() : void 0, { delaunay: { halfedges: n, inedges: r, hull: i }, circumcenters: a, vectors: o } = this;
|
|
2354
2531
|
if (i.length <= 1) return null;
|
|
2355
2532
|
for (let t = 0, r = n.length; t < r; ++t) {
|
|
2356
2533
|
let r = n[t];
|
|
@@ -2367,11 +2544,11 @@ var We = 1e-6, Ge = class {
|
|
|
2367
2544
|
return t && t.value();
|
|
2368
2545
|
}
|
|
2369
2546
|
renderBounds(e) {
|
|
2370
|
-
let t = e == null ? e = new
|
|
2547
|
+
let t = e == null ? e = new nt() : void 0;
|
|
2371
2548
|
return e.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin), t && t.value();
|
|
2372
2549
|
}
|
|
2373
2550
|
renderCell(e, t) {
|
|
2374
|
-
let n = t == null ? t = new
|
|
2551
|
+
let n = t == null ? t = new nt() : void 0, r = this._clip(e);
|
|
2375
2552
|
if (r === null || !r.length) return;
|
|
2376
2553
|
t.moveTo(r[0], r[1]);
|
|
2377
2554
|
let i = r.length;
|
|
@@ -2387,7 +2564,7 @@ var We = 1e-6, Ge = class {
|
|
|
2387
2564
|
}
|
|
2388
2565
|
}
|
|
2389
2566
|
cellPolygon(e) {
|
|
2390
|
-
let t = new
|
|
2567
|
+
let t = new rt();
|
|
2391
2568
|
return this.renderCell(e, t), t.value();
|
|
2392
2569
|
}
|
|
2393
2570
|
_renderSegment(e, t, n, r, i) {
|
|
@@ -2571,14 +2748,14 @@ var We = 1e-6, Ge = class {
|
|
|
2571
2748
|
}
|
|
2572
2749
|
return e;
|
|
2573
2750
|
}
|
|
2574
|
-
},
|
|
2575
|
-
function
|
|
2751
|
+
}, at = 2 * Math.PI, ot = Math.pow;
|
|
2752
|
+
function st(e) {
|
|
2576
2753
|
return e[0];
|
|
2577
2754
|
}
|
|
2578
|
-
function
|
|
2755
|
+
function ct(e) {
|
|
2579
2756
|
return e[1];
|
|
2580
2757
|
}
|
|
2581
|
-
function
|
|
2758
|
+
function lt(e) {
|
|
2582
2759
|
let { triangles: t, coords: n } = e;
|
|
2583
2760
|
for (let e = 0; e < t.length; e += 3) {
|
|
2584
2761
|
let r = 2 * t[e], i = 2 * t[e + 1], a = 2 * t[e + 2];
|
|
@@ -2586,22 +2763,22 @@ function Qe(e) {
|
|
|
2586
2763
|
}
|
|
2587
2764
|
return !0;
|
|
2588
2765
|
}
|
|
2589
|
-
function
|
|
2766
|
+
function ut(e, t, n) {
|
|
2590
2767
|
return [e + Math.sin(e + t) * n, t + Math.cos(e - t) * n];
|
|
2591
2768
|
}
|
|
2592
|
-
var
|
|
2593
|
-
static from(t, n =
|
|
2594
|
-
return new e("length" in t ?
|
|
2769
|
+
var dt = class e {
|
|
2770
|
+
static from(t, n = st, r = ct, i) {
|
|
2771
|
+
return new e("length" in t ? ft(t, n, r, i) : Float64Array.from(pt(t, n, r, i)));
|
|
2595
2772
|
}
|
|
2596
2773
|
constructor(e) {
|
|
2597
|
-
this._delaunator = new
|
|
2774
|
+
this._delaunator = new Ge(e), this.inedges = new Int32Array(e.length / 2), this._hullIndex = new Int32Array(e.length / 2), this.points = this._delaunator.coords, this._init();
|
|
2598
2775
|
}
|
|
2599
2776
|
update() {
|
|
2600
2777
|
return this._delaunator.update(), this._init(), this;
|
|
2601
2778
|
}
|
|
2602
2779
|
_init() {
|
|
2603
2780
|
let e = this._delaunator, t = this.points;
|
|
2604
|
-
if (e.hull && e.hull.length > 2 &&
|
|
2781
|
+
if (e.hull && e.hull.length > 2 && lt(e)) {
|
|
2605
2782
|
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
2783
|
let e = this.collinear[0], n = this.collinear[this.collinear.length - 1], r = [
|
|
2607
2784
|
t[2 * e],
|
|
@@ -2610,10 +2787,10 @@ var et = class e {
|
|
|
2610
2787
|
t[2 * n + 1]
|
|
2611
2788
|
], i = 1e-8 * Math.hypot(r[3] - r[1], r[2] - r[0]);
|
|
2612
2789
|
for (let e = 0, n = t.length / 2; e < n; ++e) {
|
|
2613
|
-
let n =
|
|
2790
|
+
let n = ut(t[2 * e], t[2 * e + 1], i);
|
|
2614
2791
|
t[2 * e] = n[0], t[2 * e + 1] = n[1];
|
|
2615
2792
|
}
|
|
2616
|
-
this._delaunator = new
|
|
2793
|
+
this._delaunator = new Ge(t);
|
|
2617
2794
|
} else delete this.collinear;
|
|
2618
2795
|
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
2796
|
for (let e = 0, t = n.length; e < t; ++e) {
|
|
@@ -2624,7 +2801,7 @@ var et = class e {
|
|
|
2624
2801
|
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
2802
|
}
|
|
2626
2803
|
voronoi(e) {
|
|
2627
|
-
return new
|
|
2804
|
+
return new it(this, e);
|
|
2628
2805
|
}
|
|
2629
2806
|
*neighbors(e) {
|
|
2630
2807
|
let { inedges: t, hull: n, _hullIndex: r, halfedges: i, triangles: a, collinear: o } = this;
|
|
@@ -2654,19 +2831,19 @@ var et = class e {
|
|
|
2654
2831
|
_step(e, t, n) {
|
|
2655
2832
|
let { inedges: r, hull: i, _hullIndex: a, halfedges: o, triangles: s, points: c } = this;
|
|
2656
2833
|
if (r[e] === -1 || !c.length) return (e + 1) % (c.length >> 1);
|
|
2657
|
-
let l = e, u =
|
|
2834
|
+
let l = e, u = ot(t - c[e * 2], 2) + ot(n - c[e * 2 + 1], 2), d = r[e], f = d;
|
|
2658
2835
|
do {
|
|
2659
|
-
let r = s[f], d =
|
|
2836
|
+
let r = s[f], d = ot(t - c[r * 2], 2) + ot(n - c[r * 2 + 1], 2);
|
|
2660
2837
|
if (d < u && (u = d, l = r), f = f % 3 == 2 ? f - 2 : f + 1, s[f] !== e) break;
|
|
2661
2838
|
if (f = o[f], f === -1) {
|
|
2662
|
-
if (f = i[(a[e] + 1) % i.length], f !== r &&
|
|
2839
|
+
if (f = i[(a[e] + 1) % i.length], f !== r && ot(t - c[f * 2], 2) + ot(n - c[f * 2 + 1], 2) < u) return f;
|
|
2663
2840
|
break;
|
|
2664
2841
|
}
|
|
2665
2842
|
} while (f !== d);
|
|
2666
2843
|
return l;
|
|
2667
2844
|
}
|
|
2668
2845
|
render(e) {
|
|
2669
|
-
let t = e == null ? e = new
|
|
2846
|
+
let t = e == null ? e = new nt() : void 0, { points: n, halfedges: r, triangles: i } = this;
|
|
2670
2847
|
for (let t = 0, a = r.length; t < a; ++t) {
|
|
2671
2848
|
let a = r[t];
|
|
2672
2849
|
if (a < t) continue;
|
|
@@ -2677,15 +2854,15 @@ var et = class e {
|
|
|
2677
2854
|
}
|
|
2678
2855
|
renderPoints(e, t) {
|
|
2679
2856
|
t === void 0 && (!e || typeof e.moveTo != "function") && (t = e, e = null), t = t == null ? 2 : +t;
|
|
2680
|
-
let n = e == null ? e = new
|
|
2857
|
+
let n = e == null ? e = new nt() : void 0, { points: r } = this;
|
|
2681
2858
|
for (let n = 0, i = r.length; n < i; n += 2) {
|
|
2682
2859
|
let i = r[n], a = r[n + 1];
|
|
2683
|
-
e.moveTo(i + t, a), e.arc(i, a, t, 0,
|
|
2860
|
+
e.moveTo(i + t, a), e.arc(i, a, t, 0, at);
|
|
2684
2861
|
}
|
|
2685
2862
|
return n && n.value();
|
|
2686
2863
|
}
|
|
2687
2864
|
renderHull(e) {
|
|
2688
|
-
let t = e == null ? e = new
|
|
2865
|
+
let t = e == null ? e = new nt() : void 0, { hull: n, points: r } = this, i = n[0] * 2, a = n.length;
|
|
2689
2866
|
e.moveTo(r[i], r[i + 1]);
|
|
2690
2867
|
for (let t = 1; t < a; ++t) {
|
|
2691
2868
|
let i = 2 * n[t];
|
|
@@ -2694,11 +2871,11 @@ var et = class e {
|
|
|
2694
2871
|
return e.closePath(), t && t.value();
|
|
2695
2872
|
}
|
|
2696
2873
|
hullPolygon() {
|
|
2697
|
-
let e = new
|
|
2874
|
+
let e = new rt();
|
|
2698
2875
|
return this.renderHull(e), e.value();
|
|
2699
2876
|
}
|
|
2700
2877
|
renderTriangle(e, t) {
|
|
2701
|
-
let n = t == null ? t = new
|
|
2878
|
+
let n = t == null ? t = new nt() : void 0, { points: r, triangles: i } = this, a = i[e *= 3] * 2, o = i[e + 1] * 2, s = i[e + 2] * 2;
|
|
2702
2879
|
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
2880
|
}
|
|
2704
2881
|
*trianglePolygons() {
|
|
@@ -2706,11 +2883,11 @@ var et = class e {
|
|
|
2706
2883
|
for (let t = 0, n = e.length / 3; t < n; ++t) yield this.trianglePolygon(t);
|
|
2707
2884
|
}
|
|
2708
2885
|
trianglePolygon(e) {
|
|
2709
|
-
let t = new
|
|
2886
|
+
let t = new rt();
|
|
2710
2887
|
return this.renderTriangle(e, t), t.value();
|
|
2711
2888
|
}
|
|
2712
2889
|
};
|
|
2713
|
-
function
|
|
2890
|
+
function ft(e, t, n, r) {
|
|
2714
2891
|
let i = e.length, a = new Float64Array(i * 2);
|
|
2715
2892
|
for (let o = 0; o < i; ++o) {
|
|
2716
2893
|
let i = e[o];
|
|
@@ -2718,20 +2895,20 @@ function tt(e, t, n, r) {
|
|
|
2718
2895
|
}
|
|
2719
2896
|
return a;
|
|
2720
2897
|
}
|
|
2721
|
-
function*
|
|
2898
|
+
function* pt(e, t, n, r) {
|
|
2722
2899
|
let i = 0;
|
|
2723
2900
|
for (let a of e) yield t.call(r, a, i, e), yield n.call(r, a, i, e), ++i;
|
|
2724
2901
|
}
|
|
2725
2902
|
//#endregion
|
|
2726
2903
|
//#region src/utils/clusert.mjs
|
|
2727
|
-
function
|
|
2904
|
+
function mt(e, t, n, r) {
|
|
2728
2905
|
return 1 + (e[t][0] === 0 || e[n][0] === 0 || e[r][0] === 0 ? 1 : 0);
|
|
2729
2906
|
}
|
|
2730
|
-
function
|
|
2907
|
+
function ht(e, t, n, r, i, a) {
|
|
2731
2908
|
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
2909
|
return l === 0 ? Infinity : o * s * c / (4 * l);
|
|
2733
2910
|
}
|
|
2734
|
-
function
|
|
2911
|
+
function gt(e) {
|
|
2735
2912
|
if (!e || e.length < 3) return [];
|
|
2736
2913
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2737
2914
|
for (let r of e) {
|
|
@@ -2739,12 +2916,12 @@ function at(e) {
|
|
|
2739
2916
|
t.has(e) || (t.add(e), n.push(r));
|
|
2740
2917
|
}
|
|
2741
2918
|
if (n.length < 3) return [];
|
|
2742
|
-
let { triangles: r } = new
|
|
2919
|
+
let { triangles: r } = new dt(Float64Array.from(n.flat()));
|
|
2743
2920
|
if (!r.length) return [];
|
|
2744
2921
|
let i = /* @__PURE__ */ new Map(), a = (e, t) => e < t ? `${e}_${t}` : `${t}_${e}`;
|
|
2745
2922
|
for (let e = 0; e < r.length; e += 3) {
|
|
2746
2923
|
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 (
|
|
2924
|
+
if (ht(c, l, u, d, f, p) <= 1 / mt(n, t, o, s)) for (let [e, n] of [
|
|
2748
2925
|
[t, o],
|
|
2749
2926
|
[o, s],
|
|
2750
2927
|
[s, t]
|
|
@@ -2793,7 +2970,7 @@ var K = {
|
|
|
2793
2970
|
[],
|
|
2794
2971
|
[],
|
|
2795
2972
|
[]
|
|
2796
|
-
], X = [],
|
|
2973
|
+
], X = [], _t = new d(), vt = new d(), yt = new d(), Z = new d(), bt = new d(), xt = new d(), Q = new a(), St = new t(), Ct = new o(), wt = new o(), Tt = new l(), Et = class {
|
|
2797
2974
|
constructor(e = new d(), t = new d(), n = new a()) {
|
|
2798
2975
|
this.center = e, this.halfSize = t, this.rotation = n;
|
|
2799
2976
|
}
|
|
@@ -2811,22 +2988,22 @@ var K = {
|
|
|
2811
2988
|
}
|
|
2812
2989
|
clampPoint(e, t) {
|
|
2813
2990
|
let n = this.halfSize;
|
|
2814
|
-
Z.subVectors(e, this.center), this.rotation.extractBasis(
|
|
2815
|
-
let r = i.clamp(Z.dot(
|
|
2816
|
-
t.add(
|
|
2817
|
-
let a = i.clamp(Z.dot(
|
|
2818
|
-
t.add(
|
|
2819
|
-
let o = i.clamp(Z.dot(
|
|
2820
|
-
return t.add(
|
|
2991
|
+
Z.subVectors(e, this.center), this.rotation.extractBasis(_t, vt, yt), t.copy(this.center);
|
|
2992
|
+
let r = i.clamp(Z.dot(_t), -n.x, n.x);
|
|
2993
|
+
t.add(_t.multiplyScalar(r));
|
|
2994
|
+
let a = i.clamp(Z.dot(vt), -n.y, n.y);
|
|
2995
|
+
t.add(vt.multiplyScalar(a));
|
|
2996
|
+
let o = i.clamp(Z.dot(yt), -n.z, n.z);
|
|
2997
|
+
return t.add(yt.multiplyScalar(o)), t;
|
|
2821
2998
|
}
|
|
2822
2999
|
containsPoint(e) {
|
|
2823
|
-
return Z.subVectors(e, this.center), this.rotation.extractBasis(
|
|
3000
|
+
return Z.subVectors(e, this.center), this.rotation.extractBasis(_t, vt, yt), Math.abs(Z.dot(_t)) <= this.halfSize.x && Math.abs(Z.dot(vt)) <= this.halfSize.y && Math.abs(Z.dot(yt)) <= this.halfSize.z;
|
|
2824
3001
|
}
|
|
2825
3002
|
intersectsBox3(e) {
|
|
2826
|
-
return this.intersectsOBB(
|
|
3003
|
+
return this.intersectsOBB(Dt.fromBox3(e));
|
|
2827
3004
|
}
|
|
2828
3005
|
intersectsSphere(e) {
|
|
2829
|
-
return this.clampPoint(e.center,
|
|
3006
|
+
return this.clampPoint(e.center, xt), xt.distanceToSquared(e.center) <= e.radius * e.radius;
|
|
2830
3007
|
}
|
|
2831
3008
|
intersectsOBB(e, t = 2 ** -52) {
|
|
2832
3009
|
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]);
|
|
@@ -2839,12 +3016,12 @@ var K = {
|
|
|
2839
3016
|
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
3017
|
}
|
|
2841
3018
|
intersectsPlane(e) {
|
|
2842
|
-
this.rotation.extractBasis(
|
|
2843
|
-
let t = this.halfSize.x * Math.abs(e.normal.dot(
|
|
3019
|
+
this.rotation.extractBasis(_t, vt, yt);
|
|
3020
|
+
let t = this.halfSize.x * Math.abs(e.normal.dot(_t)) + this.halfSize.y * Math.abs(e.normal.dot(vt)) + this.halfSize.z * Math.abs(e.normal.dot(yt)), n = e.normal.dot(this.center) - e.constant;
|
|
2844
3021
|
return Math.abs(n) <= t;
|
|
2845
3022
|
}
|
|
2846
3023
|
intersectRay(e, t) {
|
|
2847
|
-
return this.getSize(
|
|
3024
|
+
return this.getSize(bt), St.setFromCenterAndSize(Z.set(0, 0, 0), bt), Ct.setFromMatrix3(this.rotation), Ct.setPosition(this.center), wt.copy(Ct).invert(), Tt.copy(e).applyMatrix4(wt), Tt.intersectBox(St, t) ? t.applyMatrix4(Ct) : null;
|
|
2848
3025
|
}
|
|
2849
3026
|
intersectsRay(e) {
|
|
2850
3027
|
return this.intersectRay(e, Z) !== null;
|
|
@@ -2861,7 +3038,7 @@ var K = {
|
|
|
2861
3038
|
let a = 1 / n, o = 1 / r, s = 1 / i;
|
|
2862
3039
|
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
3040
|
}
|
|
2864
|
-
},
|
|
3041
|
+
}, Dt = new Et(), $ = 6371008.8, Ot = {
|
|
2865
3042
|
centimeters: $ * 100,
|
|
2866
3043
|
centimetres: $ * 100,
|
|
2867
3044
|
degrees: 360 / (2 * Math.PI),
|
|
@@ -2878,60 +3055,60 @@ var K = {
|
|
|
2878
3055
|
radians: 1,
|
|
2879
3056
|
yards: $ * 1.0936
|
|
2880
3057
|
};
|
|
2881
|
-
function
|
|
3058
|
+
function kt(e, t, n = {}) {
|
|
2882
3059
|
let r = { type: "Feature" };
|
|
2883
3060
|
return (n.id === 0 || n.id) && (r.id = n.id), n.bbox && (r.bbox = n.bbox), r.properties = t || {}, r.geometry = e, r;
|
|
2884
3061
|
}
|
|
2885
|
-
function
|
|
3062
|
+
function At(e, t, n = {}) {
|
|
2886
3063
|
if (!e) throw Error("coordinates is required");
|
|
2887
3064
|
if (!Array.isArray(e)) throw Error("coordinates must be an Array");
|
|
2888
3065
|
if (e.length < 2) throw Error("coordinates must be at least 2 numbers long");
|
|
2889
|
-
if (!
|
|
2890
|
-
return
|
|
3066
|
+
if (!Lt(e[0]) || !Lt(e[1])) throw Error("coordinates must contain numbers");
|
|
3067
|
+
return kt({
|
|
2891
3068
|
type: "Point",
|
|
2892
3069
|
coordinates: e
|
|
2893
3070
|
}, t, n);
|
|
2894
3071
|
}
|
|
2895
|
-
function
|
|
3072
|
+
function jt(e, t, n = {}) {
|
|
2896
3073
|
for (let t of e) {
|
|
2897
3074
|
if (t.length < 4) throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");
|
|
2898
3075
|
if (t[t.length - 1].length !== t[0].length) throw Error("First and last Position are not equivalent.");
|
|
2899
3076
|
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
3077
|
}
|
|
2901
|
-
return
|
|
3078
|
+
return kt({
|
|
2902
3079
|
type: "Polygon",
|
|
2903
3080
|
coordinates: e
|
|
2904
3081
|
}, t, n);
|
|
2905
3082
|
}
|
|
2906
|
-
function
|
|
2907
|
-
let n =
|
|
3083
|
+
function Mt(e, t = "kilometers") {
|
|
3084
|
+
let n = Ot[t];
|
|
2908
3085
|
if (!n) throw Error(t + " units is invalid");
|
|
2909
3086
|
return e * n;
|
|
2910
3087
|
}
|
|
2911
|
-
function
|
|
2912
|
-
let n =
|
|
3088
|
+
function Nt(e, t = "kilometers") {
|
|
3089
|
+
let n = Ot[t];
|
|
2913
3090
|
if (!n) throw Error(t + " units is invalid");
|
|
2914
3091
|
return e / n;
|
|
2915
3092
|
}
|
|
2916
|
-
function
|
|
3093
|
+
function Pt(e) {
|
|
2917
3094
|
return e % (2 * Math.PI) * 180 / Math.PI;
|
|
2918
3095
|
}
|
|
2919
|
-
function
|
|
3096
|
+
function Ft(e) {
|
|
2920
3097
|
return e % 360 * Math.PI / 180;
|
|
2921
3098
|
}
|
|
2922
|
-
function
|
|
3099
|
+
function It(e, t = "kilometers", n = "kilometers") {
|
|
2923
3100
|
if (!(e >= 0)) throw Error("length must be a positive number");
|
|
2924
|
-
return
|
|
3101
|
+
return Mt(Nt(e, t), n);
|
|
2925
3102
|
}
|
|
2926
|
-
function
|
|
3103
|
+
function Lt(e) {
|
|
2927
3104
|
return !isNaN(e) && e !== null && !Array.isArray(e);
|
|
2928
3105
|
}
|
|
2929
|
-
function
|
|
3106
|
+
function Rt(e) {
|
|
2930
3107
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
2931
3108
|
}
|
|
2932
3109
|
//#endregion
|
|
2933
3110
|
//#region node_modules/@turf/meta/dist/esm/index.js
|
|
2934
|
-
function
|
|
3111
|
+
function zt(e, t, n) {
|
|
2935
3112
|
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
3113
|
l = m ? e.features[_].geometry : h ? e.geometry : e, f = l ? l.type === "GeometryCollection" : !1, s = f ? l.geometries.length : 1;
|
|
2937
3114
|
for (var v = 0; v < s; v++) {
|
|
@@ -2977,7 +3154,7 @@ function Ot(e, t, n) {
|
|
|
2977
3154
|
}
|
|
2978
3155
|
break;
|
|
2979
3156
|
case "GeometryCollection":
|
|
2980
|
-
for (r = 0; r < o.geometries.length; r++) if (
|
|
3157
|
+
for (r = 0; r < o.geometries.length; r++) if (zt(o.geometries[r], t, n) === !1) return !1;
|
|
2981
3158
|
break;
|
|
2982
3159
|
default: throw Error("Unknown Geometry Type");
|
|
2983
3160
|
}
|
|
@@ -2985,13 +3162,13 @@ function Ot(e, t, n) {
|
|
|
2985
3162
|
}
|
|
2986
3163
|
}
|
|
2987
3164
|
}
|
|
2988
|
-
function
|
|
3165
|
+
function Bt(e) {
|
|
2989
3166
|
var t = [];
|
|
2990
|
-
return
|
|
3167
|
+
return zt(e, function(e) {
|
|
2991
3168
|
t.push(e);
|
|
2992
3169
|
}), t;
|
|
2993
3170
|
}
|
|
2994
|
-
function
|
|
3171
|
+
function Vt(e, t) {
|
|
2995
3172
|
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
3173
|
for (n = 0; n < h; n++) {
|
|
2997
3174
|
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++) {
|
|
@@ -3017,15 +3194,15 @@ function At(e, t) {
|
|
|
3017
3194
|
f++;
|
|
3018
3195
|
}
|
|
3019
3196
|
}
|
|
3020
|
-
function
|
|
3197
|
+
function Ht(e, t, n) {
|
|
3021
3198
|
var r = n;
|
|
3022
|
-
return
|
|
3199
|
+
return Vt(e, function(e, i, a, o, s) {
|
|
3023
3200
|
r = i === 0 && n === void 0 ? e : t(r, e, i, a, o, s);
|
|
3024
3201
|
}), r;
|
|
3025
3202
|
}
|
|
3026
3203
|
//#endregion
|
|
3027
3204
|
//#region node_modules/rbush/rbush.min.js
|
|
3028
|
-
var
|
|
3205
|
+
var Ut = /* @__PURE__ */ y(((e, t) => {
|
|
3029
3206
|
(function(n, r) {
|
|
3030
3207
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n ||= self).RBush = r();
|
|
3031
3208
|
})(e, function() {
|
|
@@ -3242,13 +3419,13 @@ var Mt = /* @__PURE__ */ y(((e, t) => {
|
|
|
3242
3419
|
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
3420
|
}, r;
|
|
3244
3421
|
});
|
|
3245
|
-
})),
|
|
3246
|
-
function
|
|
3422
|
+
})), Wt = /* @__PURE__ */ b({ default: () => Kt });
|
|
3423
|
+
function Gt(e, t) {
|
|
3247
3424
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3248
3425
|
}
|
|
3249
|
-
var
|
|
3250
|
-
|
|
3251
|
-
constructor(e = [], t =
|
|
3426
|
+
var Kt, qt = v((() => {
|
|
3427
|
+
Kt = class {
|
|
3428
|
+
constructor(e = [], t = Gt) {
|
|
3252
3429
|
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
3430
|
}
|
|
3254
3431
|
push(e) {
|
|
@@ -3281,7 +3458,7 @@ var Ft, It = v((() => {
|
|
|
3281
3458
|
t[e] = i;
|
|
3282
3459
|
}
|
|
3283
3460
|
};
|
|
3284
|
-
})),
|
|
3461
|
+
})), Jt = /* @__PURE__ */ y(((e, t) => {
|
|
3285
3462
|
t.exports = function(e, t, n, r) {
|
|
3286
3463
|
var i = e[0], a = e[1], o = !1;
|
|
3287
3464
|
n === void 0 && (n = 0), r === void 0 && (r = t.length);
|
|
@@ -3291,7 +3468,7 @@ var Ft, It = v((() => {
|
|
|
3291
3468
|
}
|
|
3292
3469
|
return o;
|
|
3293
3470
|
};
|
|
3294
|
-
})),
|
|
3471
|
+
})), Yt = /* @__PURE__ */ y(((e, t) => {
|
|
3295
3472
|
t.exports = function(e, t, n, r) {
|
|
3296
3473
|
var i = e[0], a = e[1], o = !1;
|
|
3297
3474
|
n === void 0 && (n = 0), r === void 0 && (r = t.length);
|
|
@@ -3301,12 +3478,12 @@ var Ft, It = v((() => {
|
|
|
3301
3478
|
}
|
|
3302
3479
|
return o;
|
|
3303
3480
|
};
|
|
3304
|
-
})),
|
|
3305
|
-
var n =
|
|
3481
|
+
})), Xt = /* @__PURE__ */ y(((e, t) => {
|
|
3482
|
+
var n = Jt(), r = Yt();
|
|
3306
3483
|
t.exports = function(e, t, i, a) {
|
|
3307
3484
|
return t.length > 0 && Array.isArray(t[0]) ? r(e, t, i, a) : n(e, t, i, a);
|
|
3308
3485
|
}, t.exports.nested = r, t.exports.flat = n;
|
|
3309
|
-
})),
|
|
3486
|
+
})), Zt = /* @__PURE__ */ y(((e, t) => {
|
|
3310
3487
|
(function(n, r) {
|
|
3311
3488
|
typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r((n ||= self).predicates = {});
|
|
3312
3489
|
})(e, function(e) {
|
|
@@ -3340,15 +3517,15 @@ var Ft, It = v((() => {
|
|
|
3340
3517
|
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
3518
|
let R = n(4, i, 4, c, a);
|
|
3342
3519
|
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
|
|
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(
|
|
3520
|
+
let z = n(R, a, 4, c, o);
|
|
3521
|
+
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(z, o, 4, c, s) - 1];
|
|
3345
3522
|
}(e, r, l, u, d, f, g);
|
|
3346
3523
|
}, e.orient2dfast = function(e, t, n, r, i, a) {
|
|
3347
3524
|
return (t - a) * (n - i) - (e - i) * (r - a);
|
|
3348
3525
|
}, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
3349
3526
|
});
|
|
3350
|
-
})),
|
|
3351
|
-
var n =
|
|
3527
|
+
})), Qt = /* @__PURE__ */ S((/* @__PURE__ */ y(((e, t) => {
|
|
3528
|
+
var n = Ut(), r = (qt(), C(Wt)), i = Xt(), a = Zt().orient2d;
|
|
3352
3529
|
r.default && (r = r.default), t.exports = o, t.exports.default = o;
|
|
3353
3530
|
function o(e, t, r) {
|
|
3354
3531
|
t = Math.max(0, t === void 0 ? 2 : t), r ||= 0;
|
|
@@ -3498,26 +3675,26 @@ var Ft, It = v((() => {
|
|
|
3498
3675
|
return r.pop(), t.pop(), t.concat(r);
|
|
3499
3676
|
}
|
|
3500
3677
|
})))(), 1);
|
|
3501
|
-
function
|
|
3678
|
+
function $t(e, t = {}) {
|
|
3502
3679
|
t.concavity = t.concavity || Infinity;
|
|
3503
3680
|
let n = [];
|
|
3504
|
-
if (
|
|
3681
|
+
if (zt(e, (e) => {
|
|
3505
3682
|
n.push([e[0], e[1]]);
|
|
3506
3683
|
}), !n.length) return null;
|
|
3507
|
-
let r = (0,
|
|
3508
|
-
return r.length > 3 ?
|
|
3684
|
+
let r = (0, Qt.default)(n, t.concavity);
|
|
3685
|
+
return r.length > 3 ? jt([r]) : null;
|
|
3509
3686
|
}
|
|
3510
3687
|
//#endregion
|
|
3511
3688
|
//#region node_modules/@turf/centroid/dist/esm/index.js
|
|
3512
|
-
function
|
|
3689
|
+
function en(e, t = {}) {
|
|
3513
3690
|
let n = 0, r = 0, i = 0;
|
|
3514
|
-
return
|
|
3691
|
+
return zt(e, function(e) {
|
|
3515
3692
|
n += e[0], r += e[1], i++;
|
|
3516
|
-
}, !0),
|
|
3693
|
+
}, !0), At([n / i, r / i], t.properties);
|
|
3517
3694
|
}
|
|
3518
3695
|
//#endregion
|
|
3519
3696
|
//#region node_modules/@turf/invariant/dist/esm/index.js
|
|
3520
|
-
function
|
|
3697
|
+
function tn(e) {
|
|
3521
3698
|
if (!e) throw Error("coord is required");
|
|
3522
3699
|
if (!Array.isArray(e)) {
|
|
3523
3700
|
if (e.type === "Feature" && e.geometry !== null && e.geometry.type === "Point") return [...e.geometry.coordinates];
|
|
@@ -3526,7 +3703,7 @@ function Wt(e) {
|
|
|
3526
3703
|
if (Array.isArray(e) && e.length >= 2 && !Array.isArray(e[0]) && !Array.isArray(e[1])) return [...e];
|
|
3527
3704
|
throw Error("coord must be GeoJSON Point or an Array of numbers");
|
|
3528
3705
|
}
|
|
3529
|
-
function
|
|
3706
|
+
function nn(e) {
|
|
3530
3707
|
if (Array.isArray(e)) return e;
|
|
3531
3708
|
if (e.type === "Feature") {
|
|
3532
3709
|
if (e.geometry !== null) return e.geometry.coordinates;
|
|
@@ -3535,23 +3712,23 @@ function Gt(e) {
|
|
|
3535
3712
|
}
|
|
3536
3713
|
//#endregion
|
|
3537
3714
|
//#region node_modules/@turf/rhumb-bearing/dist/esm/index.js
|
|
3538
|
-
function
|
|
3715
|
+
function rn(e, t, n = {}) {
|
|
3539
3716
|
let r;
|
|
3540
|
-
return r = n.final ?
|
|
3717
|
+
return r = n.final ? an(tn(t), tn(e)) : an(tn(e), tn(t)), r > 180 ? -(360 - r) : r;
|
|
3541
3718
|
}
|
|
3542
|
-
function
|
|
3543
|
-
let n =
|
|
3719
|
+
function an(e, t) {
|
|
3720
|
+
let n = Ft(e[1]), r = Ft(t[1]), i = Ft(t[0] - e[0]);
|
|
3544
3721
|
i > Math.PI && (i -= 2 * Math.PI), i < -Math.PI && (i += 2 * Math.PI);
|
|
3545
3722
|
let a = Math.log(Math.tan(r / 2 + Math.PI / 4) / Math.tan(n / 2 + Math.PI / 4));
|
|
3546
|
-
return (
|
|
3723
|
+
return (Pt(Math.atan2(i, a)) + 360) % 360;
|
|
3547
3724
|
}
|
|
3548
3725
|
//#endregion
|
|
3549
3726
|
//#region node_modules/@turf/rhumb-distance/dist/esm/index.js
|
|
3550
|
-
function
|
|
3551
|
-
let r =
|
|
3552
|
-
return i[0] += i[0] - r[0] > 180 ? -360 : r[0] - i[0] > 180 ? 360 : 0,
|
|
3727
|
+
function on(e, t, n = {}) {
|
|
3728
|
+
let r = tn(e), i = tn(t);
|
|
3729
|
+
return i[0] += i[0] - r[0] > 180 ? -360 : r[0] - i[0] > 180 ? 360 : 0, It(sn(r, i), "meters", n.units);
|
|
3553
3730
|
}
|
|
3554
|
-
function
|
|
3731
|
+
function sn(e, t, n) {
|
|
3555
3732
|
n = n === void 0 ? $ : Number(n);
|
|
3556
3733
|
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
3734
|
s > Math.PI && (s -= 2 * Math.PI);
|
|
@@ -3560,37 +3737,37 @@ function Yt(e, t, n) {
|
|
|
3560
3737
|
}
|
|
3561
3738
|
//#endregion
|
|
3562
3739
|
//#region node_modules/@turf/rhumb-destination/dist/esm/index.js
|
|
3563
|
-
function
|
|
3564
|
-
let i = t < 0, a =
|
|
3740
|
+
function cn(e, t, n, r = {}) {
|
|
3741
|
+
let i = t < 0, a = It(Math.abs(t), r.units, "meters");
|
|
3565
3742
|
i && (a = -Math.abs(a));
|
|
3566
|
-
let o =
|
|
3567
|
-
return s[0] += s[0] - o[0] > 180 ? -360 : o[0] - s[0] > 180 ? 360 : 0,
|
|
3743
|
+
let o = tn(e), s = ln(o, a, n);
|
|
3744
|
+
return s[0] += s[0] - o[0] > 180 ? -360 : o[0] - s[0] > 180 ? 360 : 0, At(s, r.properties);
|
|
3568
3745
|
}
|
|
3569
|
-
function
|
|
3746
|
+
function ln(e, t, n, r) {
|
|
3570
3747
|
r = r === void 0 ? $ : Number(r);
|
|
3571
|
-
let i = t / r, a = e[0] * Math.PI / 180, o =
|
|
3748
|
+
let i = t / r, a = e[0] * Math.PI / 180, o = Ft(e[1]), s = Ft(n), c = i * Math.cos(s), l = o + c;
|
|
3572
3749
|
Math.abs(l) > Math.PI / 2 && (l = l > 0 ? Math.PI - l : -Math.PI - l);
|
|
3573
3750
|
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
3751
|
return [((a + i * Math.sin(s) / d) * 180 / Math.PI + 540) % 360 - 180, l * 180 / Math.PI];
|
|
3575
3752
|
}
|
|
3576
3753
|
//#endregion
|
|
3577
3754
|
//#region node_modules/@turf/clone/dist/esm/index.js
|
|
3578
|
-
function
|
|
3755
|
+
function un(e) {
|
|
3579
3756
|
if (!e) throw Error("geojson is required");
|
|
3580
3757
|
switch (e.type) {
|
|
3581
|
-
case "Feature": return
|
|
3582
|
-
case "FeatureCollection": return
|
|
3758
|
+
case "Feature": return dn(e);
|
|
3759
|
+
case "FeatureCollection": return pn(e);
|
|
3583
3760
|
case "Point":
|
|
3584
3761
|
case "LineString":
|
|
3585
3762
|
case "Polygon":
|
|
3586
3763
|
case "MultiPoint":
|
|
3587
3764
|
case "MultiLineString":
|
|
3588
3765
|
case "MultiPolygon":
|
|
3589
|
-
case "GeometryCollection": return
|
|
3766
|
+
case "GeometryCollection": return mn(e);
|
|
3590
3767
|
default: throw Error("unknown GeoJSON type");
|
|
3591
3768
|
}
|
|
3592
3769
|
}
|
|
3593
|
-
function
|
|
3770
|
+
function dn(e) {
|
|
3594
3771
|
let t = { type: "Feature" };
|
|
3595
3772
|
return Object.keys(e).forEach((n) => {
|
|
3596
3773
|
switch (n) {
|
|
@@ -3599,16 +3776,16 @@ function $t(e) {
|
|
|
3599
3776
|
case "geometry": return;
|
|
3600
3777
|
default: t[n] = e[n];
|
|
3601
3778
|
}
|
|
3602
|
-
}), t.properties =
|
|
3779
|
+
}), t.properties = fn(e.properties), e.geometry == null ? t.geometry = null : t.geometry = mn(e.geometry), t;
|
|
3603
3780
|
}
|
|
3604
|
-
function
|
|
3781
|
+
function fn(e) {
|
|
3605
3782
|
let t = {};
|
|
3606
3783
|
return e && Object.keys(e).forEach((n) => {
|
|
3607
3784
|
let r = e[n];
|
|
3608
|
-
typeof r == "object" ? r === null ? t[n] = null : Array.isArray(r) ? t[n] = r.map((e) => e) : t[n] =
|
|
3785
|
+
typeof r == "object" ? r === null ? t[n] = null : Array.isArray(r) ? t[n] = r.map((e) => e) : t[n] = fn(r) : t[n] = r;
|
|
3609
3786
|
}), t;
|
|
3610
3787
|
}
|
|
3611
|
-
function
|
|
3788
|
+
function pn(e) {
|
|
3612
3789
|
let t = { type: "FeatureCollection" };
|
|
3613
3790
|
return Object.keys(e).forEach((n) => {
|
|
3614
3791
|
switch (n) {
|
|
@@ -3616,44 +3793,44 @@ function tn(e) {
|
|
|
3616
3793
|
case "features": return;
|
|
3617
3794
|
default: t[n] = e[n];
|
|
3618
3795
|
}
|
|
3619
|
-
}), t.features = e.features.map((e) =>
|
|
3796
|
+
}), t.features = e.features.map((e) => dn(e)), t;
|
|
3620
3797
|
}
|
|
3621
|
-
function
|
|
3798
|
+
function mn(e) {
|
|
3622
3799
|
let t = { type: e.type };
|
|
3623
|
-
return e.bbox && (t.bbox = e.bbox), e.type === "GeometryCollection" ? (t.geometries = e.geometries.map((e) =>
|
|
3800
|
+
return e.bbox && (t.bbox = e.bbox), e.type === "GeometryCollection" ? (t.geometries = e.geometries.map((e) => mn(e)), t) : (t.coordinates = hn(e.coordinates), t);
|
|
3624
3801
|
}
|
|
3625
|
-
function
|
|
3802
|
+
function hn(e) {
|
|
3626
3803
|
let t = e;
|
|
3627
|
-
return typeof t[0] == "object" ? t.map((e) =>
|
|
3804
|
+
return typeof t[0] == "object" ? t.map((e) => hn(e)) : t.slice();
|
|
3628
3805
|
}
|
|
3629
3806
|
//#endregion
|
|
3630
3807
|
//#region node_modules/@turf/transform-rotate/dist/esm/index.js
|
|
3631
|
-
function
|
|
3632
|
-
if (n ||= {}, !
|
|
3808
|
+
function gn(e, t, n) {
|
|
3809
|
+
if (n ||= {}, !Rt(n)) throw Error("options is invalid");
|
|
3633
3810
|
let r = n.pivot, i = n.mutate;
|
|
3634
3811
|
if (!e) throw Error("geojson is required");
|
|
3635
3812
|
if (t == null || isNaN(t)) throw Error("angle is required");
|
|
3636
3813
|
if (t === 0) return e;
|
|
3637
|
-
let a = r ??
|
|
3638
|
-
return (i === !1 || i === void 0) && (e =
|
|
3639
|
-
let n =
|
|
3814
|
+
let a = r ?? en(e);
|
|
3815
|
+
return (i === !1 || i === void 0) && (e = un(e)), zt(e, function(e) {
|
|
3816
|
+
let n = rn(a, e) + t, r = nn(cn(a, on(a, e), n));
|
|
3640
3817
|
e[0] = r[0], e[1] = r[1];
|
|
3641
3818
|
}), e;
|
|
3642
3819
|
}
|
|
3643
3820
|
//#endregion
|
|
3644
3821
|
//#region node_modules/@turf/bearing/dist/esm/index.js
|
|
3645
|
-
function
|
|
3646
|
-
if (n.final === !0) return
|
|
3647
|
-
let r =
|
|
3648
|
-
return
|
|
3822
|
+
function _n(e, t, n = {}) {
|
|
3823
|
+
if (n.final === !0) return vn(e, t);
|
|
3824
|
+
let r = tn(e), i = tn(t), a = Ft(r[0]), o = Ft(i[0]), s = Ft(r[1]), c = Ft(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);
|
|
3825
|
+
return Pt(Math.atan2(l, u));
|
|
3649
3826
|
}
|
|
3650
|
-
function
|
|
3651
|
-
let n =
|
|
3827
|
+
function vn(e, t) {
|
|
3828
|
+
let n = _n(t, e);
|
|
3652
3829
|
return n = (n + 180) % 360, n;
|
|
3653
3830
|
}
|
|
3654
3831
|
//#endregion
|
|
3655
3832
|
//#region node_modules/@turf/bbox/dist/esm/index.js
|
|
3656
|
-
function
|
|
3833
|
+
function yn(e, t = {}) {
|
|
3657
3834
|
if (e.bbox != null && !0 !== t.recompute) return e.bbox;
|
|
3658
3835
|
let n = [
|
|
3659
3836
|
Infinity,
|
|
@@ -3661,17 +3838,17 @@ function cn(e, t = {}) {
|
|
|
3661
3838
|
-Infinity,
|
|
3662
3839
|
-Infinity
|
|
3663
3840
|
];
|
|
3664
|
-
return
|
|
3841
|
+
return zt(e, (e) => {
|
|
3665
3842
|
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
3843
|
}), n;
|
|
3667
3844
|
}
|
|
3668
3845
|
//#endregion
|
|
3669
3846
|
//#region node_modules/@turf/bbox-polygon/dist/esm/index.js
|
|
3670
|
-
function
|
|
3847
|
+
function bn(e, t = {}) {
|
|
3671
3848
|
let n = Number(e[0]), r = Number(e[1]), i = Number(e[2]), a = Number(e[3]);
|
|
3672
3849
|
if (e.length === 6) throw Error("@turf/bbox-polygon does not support BBox with 6 positions");
|
|
3673
3850
|
let o = [n, r];
|
|
3674
|
-
return
|
|
3851
|
+
return jt([[
|
|
3675
3852
|
o,
|
|
3676
3853
|
[i, r],
|
|
3677
3854
|
[i, a],
|
|
@@ -3684,20 +3861,20 @@ function ln(e, t = {}) {
|
|
|
3684
3861
|
}
|
|
3685
3862
|
//#endregion
|
|
3686
3863
|
//#region node_modules/@turf/envelope/dist/esm/index.js
|
|
3687
|
-
function
|
|
3688
|
-
return
|
|
3864
|
+
function xn(e) {
|
|
3865
|
+
return bn(yn(e));
|
|
3689
3866
|
}
|
|
3690
3867
|
//#endregion
|
|
3691
3868
|
//#region node_modules/@turf/area/dist/esm/index.js
|
|
3692
|
-
function
|
|
3693
|
-
return
|
|
3869
|
+
function Sn(e) {
|
|
3870
|
+
return Ht(e, (e, t) => e + Cn(t), 0);
|
|
3694
3871
|
}
|
|
3695
|
-
function
|
|
3872
|
+
function Cn(e) {
|
|
3696
3873
|
let t = 0, n;
|
|
3697
3874
|
switch (e.type) {
|
|
3698
|
-
case "Polygon": return
|
|
3875
|
+
case "Polygon": return wn(e.coordinates);
|
|
3699
3876
|
case "MultiPolygon":
|
|
3700
|
-
for (n = 0; n < e.coordinates.length; n++) t +=
|
|
3877
|
+
for (n = 0; n < e.coordinates.length; n++) t += wn(e.coordinates[n]);
|
|
3701
3878
|
return t;
|
|
3702
3879
|
case "Point":
|
|
3703
3880
|
case "MultiPoint":
|
|
@@ -3706,57 +3883,57 @@ function fn(e) {
|
|
|
3706
3883
|
}
|
|
3707
3884
|
return 0;
|
|
3708
3885
|
}
|
|
3709
|
-
function
|
|
3886
|
+
function wn(e) {
|
|
3710
3887
|
let t = 0;
|
|
3711
3888
|
if (e && e.length > 0) {
|
|
3712
|
-
t += Math.abs(
|
|
3713
|
-
for (let n = 1; n < e.length; n++) t -= Math.abs(
|
|
3889
|
+
t += Math.abs(Dn(e[0]));
|
|
3890
|
+
for (let n = 1; n < e.length; n++) t -= Math.abs(Dn(e[n]));
|
|
3714
3891
|
}
|
|
3715
3892
|
return t;
|
|
3716
3893
|
}
|
|
3717
|
-
var
|
|
3718
|
-
function
|
|
3894
|
+
var Tn = $ * $ / 2, En = Math.PI / 180;
|
|
3895
|
+
function Dn(e) {
|
|
3719
3896
|
let t = e.length - 1;
|
|
3720
3897
|
if (t <= 2) return 0;
|
|
3721
3898
|
let n = 0, r = 0;
|
|
3722
3899
|
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] *
|
|
3900
|
+
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] * En, c = a[1] * En, l = o[0] * En;
|
|
3724
3901
|
n += (l - s) * Math.sin(c), r++;
|
|
3725
3902
|
}
|
|
3726
|
-
return n *
|
|
3903
|
+
return n * Tn;
|
|
3727
3904
|
}
|
|
3728
3905
|
//#endregion
|
|
3729
3906
|
//#region node_modules/geojson-minimum-bounding-rectangle/dist/index.js
|
|
3730
|
-
function
|
|
3731
|
-
let t =
|
|
3907
|
+
function On(e) {
|
|
3908
|
+
let t = $t(e);
|
|
3732
3909
|
if (!t) throw Error("Can't calculate smallestSurroundingRectangleByArea for given geometry");
|
|
3733
|
-
let n =
|
|
3910
|
+
let n = en(t), r = Bt(t), i = 2 ** 53 - 1, a = null;
|
|
3734
3911
|
for (let e = 0; e < r.length - 1; e++) {
|
|
3735
|
-
let o =
|
|
3736
|
-
c < i && (i = c, a =
|
|
3912
|
+
let o = _n(r[e], r[e + 1]), s = xn(gn(t, -1 * o, { pivot: n })), c = Sn(s);
|
|
3913
|
+
c < i && (i = c, a = gn(s, o, { pivot: n }));
|
|
3737
3914
|
}
|
|
3738
3915
|
return a;
|
|
3739
3916
|
}
|
|
3740
3917
|
//#endregion
|
|
3741
3918
|
//#region src/utils/OBB.mjs
|
|
3742
|
-
function
|
|
3919
|
+
function kn(e, t) {
|
|
3743
3920
|
let n = t[0] - e[0], r = t[1] - e[1];
|
|
3744
3921
|
return Math.sqrt(n * n + r * r);
|
|
3745
3922
|
}
|
|
3746
|
-
function
|
|
3923
|
+
function An(e) {
|
|
3747
3924
|
let t = Infinity, n = -Infinity, r = Infinity, i = -Infinity;
|
|
3748
3925
|
for (let [a, o] of e) a < t && (t = a), a > n && (n = a), o < r && (r = o), o > i && (i = o);
|
|
3749
3926
|
return [(n + t) * .5, (i + r) * .5];
|
|
3750
3927
|
}
|
|
3751
|
-
var
|
|
3928
|
+
var jn = class t extends Et {
|
|
3752
3929
|
getBoxMesh() {
|
|
3753
|
-
|
|
3930
|
+
Mn.identity(), Mn.setFromMatrix3(this.rotation), Mn.decompose(In, Nn, new e.Vector3());
|
|
3754
3931
|
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(
|
|
3932
|
+
return n.position.copy(this.center), n.rotation.setFromQuaternion(Nn), n;
|
|
3756
3933
|
}
|
|
3757
3934
|
getBoxEdge(t = 16776960) {
|
|
3758
3935
|
let n = this.getBoxMesh();
|
|
3759
|
-
|
|
3936
|
+
Ln.setFromObject(n);
|
|
3760
3937
|
let r = new e.EdgesGeometry(n.geometry.clone().applyMatrix4(n.matrixWorld));
|
|
3761
3938
|
return new e.LineSegments(r, new e.LineBasicMaterial({
|
|
3762
3939
|
color: t,
|
|
@@ -3764,33 +3941,33 @@ var bn = class t extends ht {
|
|
|
3764
3941
|
}));
|
|
3765
3942
|
}
|
|
3766
3943
|
toJson() {
|
|
3767
|
-
return
|
|
3944
|
+
return Mn.identity(), Mn.setFromMatrix3(this.rotation), Mn.decompose(In, Nn, new e.Vector3()), {
|
|
3768
3945
|
size: this.halfSize.toArray(),
|
|
3769
3946
|
center: this.center.toArray(),
|
|
3770
|
-
quaternion:
|
|
3947
|
+
quaternion: Nn.toArray()
|
|
3771
3948
|
};
|
|
3772
3949
|
}
|
|
3773
3950
|
static from(n, r, i, a = new t()) {
|
|
3774
|
-
if (i instanceof e.Euler)
|
|
3775
|
-
else if (i instanceof e.Quaternion)
|
|
3951
|
+
if (i instanceof e.Euler) Nn.setFromEuler(i);
|
|
3952
|
+
else if (i instanceof e.Quaternion) Nn.copy(i);
|
|
3776
3953
|
else throw Error("传入的旋转不是欧拉角或者四元数");
|
|
3777
|
-
return
|
|
3954
|
+
return Mn.compose(r, Nn, Fn), a.center.copy(r), a.halfSize.copy(n.multiplyScalar(.5)), a.rotation.setFromMatrix4(Mn), a;
|
|
3778
3955
|
}
|
|
3779
3956
|
static fromByPath2D(e, n, r, i = new t()) {
|
|
3780
|
-
let a =
|
|
3957
|
+
let a = On({
|
|
3781
3958
|
type: "Polygon",
|
|
3782
3959
|
coordinates: [e.map((e) => [e.x, e.y])]
|
|
3783
3960
|
});
|
|
3784
3961
|
if (!a) throw Error("2d obb 获取失败");
|
|
3785
|
-
let o = a.geometry.coordinates[0], s =
|
|
3786
|
-
|
|
3787
|
-
let [u, d] =
|
|
3788
|
-
return n.x = u, n.y = d, this.from(
|
|
3962
|
+
let o = a.geometry.coordinates[0], s = kn(o[0], o[1]), c = kn(o[1], o[2]), l = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]);
|
|
3963
|
+
In.set(s, c, r), Pn.set(0, 0, l);
|
|
3964
|
+
let [u, d] = An(o);
|
|
3965
|
+
return n.x = u, n.y = d, this.from(In, n, Pn, i);
|
|
3789
3966
|
}
|
|
3790
|
-
},
|
|
3967
|
+
}, Mn = new e.Matrix4(), Nn = new e.Quaternion(), Pn = new e.Euler(), Fn = new e.Vector3(1, 1, 1), In = new e.Vector3(), Ln = new e.Box3();
|
|
3791
3968
|
//#endregion
|
|
3792
3969
|
//#region src/pointCloudProcessing/mergeMeaning.mjs
|
|
3793
|
-
function
|
|
3970
|
+
function Rn(e, t, n = .005, r = .2) {
|
|
3794
3971
|
if (!e.length || !t.length) return 0;
|
|
3795
3972
|
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
3973
|
for (let e of t) {
|
|
@@ -3819,26 +3996,26 @@ function Dn(e, t, n = .005, r = .2) {
|
|
|
3819
3996
|
}
|
|
3820
3997
|
return c / e.length;
|
|
3821
3998
|
}
|
|
3822
|
-
function
|
|
3999
|
+
function zn(e, t, n = .5) {
|
|
3823
4000
|
let r = 0, i = 0;
|
|
3824
4001
|
for (let a of e) if (t.containsPoint(a) && (r++, i = r / e.length, i > n)) break;
|
|
3825
4002
|
return i;
|
|
3826
4003
|
}
|
|
3827
|
-
function
|
|
4004
|
+
function Bn(e, t, n, r) {
|
|
3828
4005
|
if (e.intersectsOBB(t)) return !0;
|
|
3829
4006
|
{
|
|
3830
|
-
let i =
|
|
4007
|
+
let i = Hn(e, r), a = Hn(t, n);
|
|
3831
4008
|
if (i || a) return !0;
|
|
3832
4009
|
}
|
|
3833
4010
|
return !1;
|
|
3834
4011
|
}
|
|
3835
|
-
function
|
|
4012
|
+
function Vn(t, n) {
|
|
3836
4013
|
let r = new e.Vector3(), i = new e.Vector3();
|
|
3837
4014
|
t.getSize(r), n.getSize(i);
|
|
3838
4015
|
let a = r.x * r.y * r.z, o = i.x * i.y * i.z;
|
|
3839
4016
|
return a > o ? 1 : a < o ? -1 : 0;
|
|
3840
4017
|
}
|
|
3841
|
-
function
|
|
4018
|
+
function Hn(e, t) {
|
|
3842
4019
|
let n = !0;
|
|
3843
4020
|
for (let r = 0; r < t.length; r++) if (!e.containsPoint(t[r])) {
|
|
3844
4021
|
n = !1;
|
|
@@ -3846,7 +4023,7 @@ function jn(e, t) {
|
|
|
3846
4023
|
}
|
|
3847
4024
|
return n;
|
|
3848
4025
|
}
|
|
3849
|
-
function
|
|
4026
|
+
function Un(e) {
|
|
3850
4027
|
if (e.length === 0) return {
|
|
3851
4028
|
x: 0,
|
|
3852
4029
|
y: 0,
|
|
@@ -3864,52 +4041,85 @@ function Mn(e) {
|
|
|
3864
4041
|
h: r - i
|
|
3865
4042
|
};
|
|
3866
4043
|
}
|
|
3867
|
-
function
|
|
4044
|
+
function Wn(t, n, r, i) {
|
|
3868
4045
|
let a = [];
|
|
3869
4046
|
for (let n = 0; n < t.length; n++) a.push(new e.Vector3(t[n][0], t[n][1], 0));
|
|
3870
4047
|
if (a.length == 0) return null;
|
|
3871
|
-
let o =
|
|
4048
|
+
let o = jn.fromByPath2D(a, n, r);
|
|
3872
4049
|
return o.center.z = i, o;
|
|
3873
4050
|
}
|
|
3874
|
-
var
|
|
4051
|
+
var Gn = (t) => {
|
|
3875
4052
|
if (t.length == 0) return [];
|
|
3876
|
-
let n = [];
|
|
3877
|
-
for (let
|
|
3878
|
-
let
|
|
3879
|
-
|
|
3880
|
-
let
|
|
3881
|
-
if (
|
|
3882
|
-
let
|
|
3883
|
-
for (let n = 0; n < t[
|
|
3884
|
-
let
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
|
|
4053
|
+
let n = [], r = /* @__PURE__ */ new Map();
|
|
4054
|
+
for (let i = 0; i < t.length; i++) {
|
|
4055
|
+
let a = t[i].points.map((e) => [e.x, e.y]), o = Un(t[i].points), s = t[i].obj_id;
|
|
4056
|
+
s = s.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"), s.split("_").slice(1, 3).join("_").split(".")[0].split("_")[0];
|
|
4057
|
+
let c = s.indexOf("_") + 1, l = s.lastIndexOf("_"), u = s.substring(c, l);
|
|
4058
|
+
if (u !== "floor") continue;
|
|
4059
|
+
let d = [];
|
|
4060
|
+
for (let n = 0; n < t[i].points.length; n++) d.push(new e.Vector3(t[i].points[n].x, t[i].points[n].y, t[i].points[n].z));
|
|
4061
|
+
let f = -99999;
|
|
4062
|
+
if (u === "floor") {
|
|
4063
|
+
let n = /* @__PURE__ */ new Map();
|
|
4064
|
+
for (let e = 0; e < t[i].points.length; e++) {
|
|
4065
|
+
let r = t[i].points[e].z;
|
|
4066
|
+
if (r = Math.floor(r * 10) / 10, n.has(r)) {
|
|
4067
|
+
let a = n.get(r);
|
|
4068
|
+
a.num += 1, a.points.push(t[i].points[e]), n.set(r, a);
|
|
4069
|
+
} else n.set(r, {
|
|
4070
|
+
num: 1,
|
|
4071
|
+
points: [t[i].points[e]]
|
|
4072
|
+
});
|
|
4073
|
+
}
|
|
4074
|
+
let r = [...n.entries()].reduce((e, t) => t[1].num > e[1].num ? t : e);
|
|
4075
|
+
a = [], a = r[1].points.map((e) => [e.x, e.y]), d = [], d = r[1].points.map((t) => new e.Vector3(t.x, t.y, t.z)), f = r[0];
|
|
4076
|
+
}
|
|
4077
|
+
let p = {
|
|
4078
|
+
points: d,
|
|
4079
|
+
path: gt(a),
|
|
4080
|
+
h: o.h,
|
|
4081
|
+
minz: o.minz,
|
|
4082
|
+
maxz: o.maxz,
|
|
3890
4083
|
center: {
|
|
3891
|
-
x:
|
|
3892
|
-
y:
|
|
3893
|
-
z:
|
|
4084
|
+
x: o.x,
|
|
4085
|
+
y: o.y,
|
|
4086
|
+
z: o.z
|
|
3894
4087
|
},
|
|
3895
|
-
obj_id: t[
|
|
3896
|
-
type:
|
|
3897
|
-
averagePz: t[
|
|
4088
|
+
obj_id: t[i].obj_id,
|
|
4089
|
+
type: u,
|
|
4090
|
+
averagePz: t[i].averagePz,
|
|
3898
4091
|
obb: null,
|
|
3899
4092
|
isDel: !1,
|
|
3900
|
-
obj_id:
|
|
3901
|
-
positionArr: [t[
|
|
4093
|
+
obj_id: s,
|
|
4094
|
+
positionArr: [t[i].position]
|
|
3902
4095
|
};
|
|
3903
|
-
if (
|
|
3904
|
-
let
|
|
3905
|
-
for (let e = 0; e < n.length; e++) if (n[e].type ==
|
|
3906
|
-
|
|
4096
|
+
if (p.obb = Wn(p.path, p.center, p.h, (p.maxz + p.minz) / 2), p.obb == null) continue;
|
|
4097
|
+
let m = -1;
|
|
4098
|
+
for (let e = 0; e < n.length; e++) if (n[e].type == u) {
|
|
4099
|
+
m = e;
|
|
4100
|
+
break;
|
|
4101
|
+
}
|
|
4102
|
+
if (m == -1 ? n.push({
|
|
4103
|
+
type: u,
|
|
4104
|
+
array: [p]
|
|
4105
|
+
}) : n[m].array.push(p), u == "floor" && f != -99999) if (r.has(f)) {
|
|
4106
|
+
let e = r.get(f);
|
|
4107
|
+
e.num += p.points.length, e.datas.push(p), r.set(f, e);
|
|
4108
|
+
} else r.set(f, {
|
|
4109
|
+
num: p.points.length,
|
|
4110
|
+
datas: [p]
|
|
4111
|
+
});
|
|
4112
|
+
}
|
|
4113
|
+
if (r.size > 0) {
|
|
4114
|
+
let e = [];
|
|
4115
|
+
for (let [t, n] of r.entries()) {
|
|
4116
|
+
let { num: t, datas: r } = n;
|
|
4117
|
+
t > 3e3 && e.push(...r);
|
|
4118
|
+
}
|
|
4119
|
+
for (let t = 0; t < n.length; t++) if (n[t].type == "floor") {
|
|
4120
|
+
n[t].array = e;
|
|
3907
4121
|
break;
|
|
3908
4122
|
}
|
|
3909
|
-
f == -1 ? n.push({
|
|
3910
|
-
type: l,
|
|
3911
|
-
array: [d]
|
|
3912
|
-
}) : n[f].array.push(d);
|
|
3913
4123
|
}
|
|
3914
4124
|
for (let e = 0; e < n.length; e++) {
|
|
3915
4125
|
let t = n[e].array, r = [], i = [];
|
|
@@ -3920,13 +4130,13 @@ var Pn = (t) => {
|
|
|
3920
4130
|
obb: t[e].obb.clone()
|
|
3921
4131
|
};
|
|
3922
4132
|
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 =
|
|
3924
|
-
let a =
|
|
4133
|
+
r.push(i), n.points.push(...t[i].points), n.path = gt(n.points.map((e) => [e.x, e.y]));
|
|
4134
|
+
let a = Un(n.points);
|
|
3925
4135
|
n.h = a.h, n.minz = a.minz, n.maxz = a.maxz, n.center = {
|
|
3926
4136
|
x: a.x,
|
|
3927
4137
|
y: a.y,
|
|
3928
4138
|
z: a.z
|
|
3929
|
-
}, n.obb =
|
|
4139
|
+
}, n.obb = Wn(n.path, n.center, n.h, (n.maxz + n.minz) / 2), n.positionArr.push(...t[i].positionArr), i = e;
|
|
3930
4140
|
}
|
|
3931
4141
|
n.path.length > t[e].path.length && (r.push(e), i.push(n));
|
|
3932
4142
|
}
|
|
@@ -3935,7 +4145,9 @@ var Pn = (t) => {
|
|
|
3935
4145
|
a.push(...i), n[e].array = a;
|
|
3936
4146
|
}
|
|
3937
4147
|
for (let t = 0; t < n.length; t++) {
|
|
3938
|
-
let r = n[t].type
|
|
4148
|
+
let r = n[t].type;
|
|
4149
|
+
if (r === "people" || r === "floor") continue;
|
|
4150
|
+
let i = n[t].array;
|
|
3939
4151
|
for (let a = 0; a < i.length; a++) {
|
|
3940
4152
|
let o = i[a].obb, s = i[a].minz;
|
|
3941
4153
|
i[a].maxz;
|
|
@@ -3954,74 +4166,61 @@ var Pn = (t) => {
|
|
|
3954
4166
|
}
|
|
3955
4167
|
}
|
|
3956
4168
|
if (!i[a].isDel) for (let e = t + 1; e < n.length; e++) {
|
|
3957
|
-
let t = n[e].type
|
|
4169
|
+
let t = n[e].type;
|
|
4170
|
+
if (t === "people" || t === "floor") continue;
|
|
4171
|
+
let l = n[e].array;
|
|
3958
4172
|
for (let e = 0; e < l.length; e++) {
|
|
3959
4173
|
if (l[e].isDel) continue;
|
|
3960
4174
|
let n = l[e].obb, u = l[e].minz;
|
|
3961
4175
|
if (l[e].maxz, o.intersectsOBB(n)) {
|
|
3962
|
-
|
|
3963
|
-
let d =
|
|
4176
|
+
zn(l[e].points, o);
|
|
4177
|
+
let d = zn(i[a].points, n), f = Vn(o, n);
|
|
3964
4178
|
if (d >= .3 && f == -1) {
|
|
3965
4179
|
i[a].isDel = !0;
|
|
3966
4180
|
break;
|
|
3967
4181
|
}
|
|
3968
4182
|
if (r !== "wall" && r !== "floor" && r !== "roof") {
|
|
3969
4183
|
if (r === "window") {
|
|
3970
|
-
if (t === "balcony railing" &&
|
|
4184
|
+
if (t === "balcony railing" && Hn(o, l[e].points)) {
|
|
3971
4185
|
l[e].isDel = !0;
|
|
3972
4186
|
continue;
|
|
3973
4187
|
}
|
|
3974
|
-
if (t === "balcony railing" &&
|
|
4188
|
+
if (t === "balcony railing" && Hn(n, i[a].points)) {
|
|
3975
4189
|
i[a].isDel = !0;
|
|
3976
4190
|
break;
|
|
3977
4191
|
}
|
|
3978
|
-
if (t === "balcony railing" &&
|
|
4192
|
+
if (t === "balcony railing" && Bn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(u - c) > .3)) {
|
|
3979
4193
|
l[e].isDel = !0;
|
|
3980
4194
|
continue;
|
|
3981
4195
|
}
|
|
3982
4196
|
} else if (r === "balcony railing") {
|
|
3983
|
-
if (t === "window" &&
|
|
4197
|
+
if (t === "window" && Hn(o, l[e].points)) {
|
|
3984
4198
|
l[e].isDel = !0;
|
|
3985
4199
|
continue;
|
|
3986
4200
|
}
|
|
3987
|
-
if (t === "window" &&
|
|
4201
|
+
if (t === "window" && Hn(n, i[a].points)) {
|
|
3988
4202
|
i[a].isDel = !0;
|
|
3989
4203
|
break;
|
|
3990
4204
|
}
|
|
3991
|
-
if (t === "window" &&
|
|
4205
|
+
if (t === "window" && Bn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(s - c) > .3)) {
|
|
3992
4206
|
i[a].isDel = !0;
|
|
3993
4207
|
break;
|
|
3994
4208
|
}
|
|
3995
4209
|
}
|
|
3996
4210
|
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),
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
|
|
4002
|
-
|
|
4003
|
-
|
|
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);
|
|
4211
|
+
if (m.length > h.length ? (d = !0, f = m, p = h) : (f = h, p = m), Rn(p, f, .03, .5) > .5) if (d) l[e].isDel = !0;
|
|
4212
|
+
else {
|
|
4213
|
+
i[a].isDel = !0;
|
|
4214
|
+
break;
|
|
4215
|
+
}
|
|
4216
|
+
else if (Bn(o, n)) {
|
|
4217
|
+
let s = Vn(o, n);
|
|
4019
4218
|
if (s === 1 || s === 0) {
|
|
4020
4219
|
if (t === "switch") continue;
|
|
4021
|
-
|
|
4220
|
+
zn(p, o) >= .5 && (l[e].isDel = !0);
|
|
4022
4221
|
} else {
|
|
4023
4222
|
if (r === "switch") continue;
|
|
4024
|
-
if (
|
|
4223
|
+
if (zn(p, n) >= .5) {
|
|
4025
4224
|
i[a].isDel = !0;
|
|
4026
4225
|
break;
|
|
4027
4226
|
}
|
|
@@ -4054,25 +4253,7 @@ var Pn = (t) => {
|
|
|
4054
4253
|
}
|
|
4055
4254
|
}
|
|
4056
4255
|
for (let e = 0; e < n.length; e++) n[e].array = n[e].array.filter((e) => !e.isDel);
|
|
4057
|
-
|
|
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;
|
|
4256
|
+
return n;
|
|
4076
4257
|
};
|
|
4077
4258
|
//#endregion
|
|
4078
|
-
export {
|
|
4259
|
+
export { z as classifySegments, ge as getAllGeometry, Oe as getBeamLine, Ae as getColLine, ke as getMainBeamLine, Gn as getMergeMeaning, I as getParallelism, ie as getPointCloudMinMax, ne as getPointCoverageOnQuad, j as isParallel, L as perpendicularInfo, oe as removeNoisePoints, O as segmentsIntersect2D, _e as updateStEdPoint, De as usegetBeamLine };
|