rm-graphical-computing 1.0.39 → 1.0.40
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 +319 -314
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -595,9 +595,14 @@ function de(e) {
|
|
|
595
595
|
}
|
|
596
596
|
e.dispose();
|
|
597
597
|
}
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
598
|
+
var fe = (e, t = .001) => {
|
|
599
|
+
let n = /* @__PURE__ */ new Map(), r = [];
|
|
600
|
+
for (let i of e) {
|
|
601
|
+
let e = `${Math.round(i.x / t)},${Math.round(i.y / t)},${Math.round(i.z / t)}`;
|
|
602
|
+
n.has(e) || (n.set(e, !0), r.push(i));
|
|
603
|
+
}
|
|
604
|
+
return r;
|
|
605
|
+
}, pe = class {
|
|
601
606
|
results;
|
|
602
607
|
clusterResults;
|
|
603
608
|
constructor() {
|
|
@@ -1029,12 +1034,12 @@ var fe = class {
|
|
|
1029
1034
|
return console.error("合并网格时出错:", e), null;
|
|
1030
1035
|
}
|
|
1031
1036
|
}
|
|
1032
|
-
},
|
|
1037
|
+
}, me = (e) => {
|
|
1033
1038
|
let t = {}, n = [], r = [], i = [];
|
|
1034
1039
|
return e[0].width, e[0].height, e.forEach((e) => {
|
|
1035
1040
|
r.push(...e.vertices), i.push(e.center), n.push(e.vertices);
|
|
1036
1041
|
}), t.originalVertices = n, t.allCenterPoints = i, t;
|
|
1037
|
-
},
|
|
1042
|
+
}, he = (e) => {
|
|
1038
1043
|
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);
|
|
1039
1044
|
r.applyAxisAngle(n, Math.PI / 2);
|
|
1040
1045
|
let i = new d().copy(t).add(r.clone().multiplyScalar(e.length)), a = new d().copy(t).sub(r.clone().multiplyScalar(e.length));
|
|
@@ -1044,7 +1049,7 @@ var fe = class {
|
|
|
1044
1049
|
center: t,
|
|
1045
1050
|
direction: r
|
|
1046
1051
|
};
|
|
1047
|
-
},
|
|
1052
|
+
}, ge = (t, n, r = !0) => {
|
|
1048
1053
|
let i = [];
|
|
1049
1054
|
if (!t) return [];
|
|
1050
1055
|
for (let a = 0; a < t.length; a++) {
|
|
@@ -1065,7 +1070,7 @@ var fe = class {
|
|
|
1065
1070
|
wireframe: !1,
|
|
1066
1071
|
transparent: !0,
|
|
1067
1072
|
opacity: .5
|
|
1068
|
-
}), g = new e.Group(), _ = new
|
|
1073
|
+
}), g = new e.Group(), _ = new pe(), { horizontalSubdivisions: v, verticalSubdivisions: y } = _.initLimits4(p, m), b = _.createSubdividedWallPlane(o, y, v, h, g);
|
|
1069
1074
|
_.analyzePointDistribution(b, f, .01);
|
|
1070
1075
|
let x = new e.MeshBasicMaterial({
|
|
1071
1076
|
color: "black",
|
|
@@ -1074,14 +1079,14 @@ var fe = class {
|
|
|
1074
1079
|
side: e.DoubleSide
|
|
1075
1080
|
}), S = _.highlightEmptySegments(b, x, g), C = [];
|
|
1076
1081
|
for (let e of S.clusters) {
|
|
1077
|
-
let t =
|
|
1082
|
+
let t = me(e);
|
|
1078
1083
|
t && C.push(t);
|
|
1079
1084
|
}
|
|
1080
|
-
let w =
|
|
1085
|
+
let w = he(o).direction;
|
|
1081
1086
|
o.checkResults = C, o.verticalDirection = w, o.originaIndex = a, i.push(o);
|
|
1082
1087
|
}
|
|
1083
1088
|
return i;
|
|
1084
|
-
},
|
|
1089
|
+
}, _e = (t, n) => {
|
|
1085
1090
|
console.log("lines", t);
|
|
1086
1091
|
for (let r = 0; r < t.length; r++) {
|
|
1087
1092
|
let i = t[r], a = [];
|
|
@@ -1099,8 +1104,8 @@ var fe = class {
|
|
|
1099
1104
|
let e = [];
|
|
1100
1105
|
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
1106
|
let t = [];
|
|
1102
|
-
for (let n = 0; n < a.length; n++) f.includes(n) ||
|
|
1103
|
-
t.length > 0 && p.push(
|
|
1107
|
+
for (let n = 0; n < a.length; n++) f.includes(n) || be(a[n], e) && (f.push(n), t.push(a[n]));
|
|
1108
|
+
t.length > 0 && p.push(xe(t)), s = s.addScaledVector(l, m);
|
|
1104
1109
|
}
|
|
1105
1110
|
let h = new Float32Array(a.length * 3);
|
|
1106
1111
|
a.forEach((e, t) => {
|
|
@@ -1111,14 +1116,14 @@ var fe = class {
|
|
|
1111
1116
|
color: le(),
|
|
1112
1117
|
size: .02
|
|
1113
1118
|
})));
|
|
1114
|
-
let [_, v] =
|
|
1119
|
+
let [_, v] = Ee(p, {
|
|
1115
1120
|
plane: "xy",
|
|
1116
1121
|
trimRatio: 0
|
|
1117
1122
|
});
|
|
1118
1123
|
D(_, v, n);
|
|
1119
1124
|
}
|
|
1120
1125
|
};
|
|
1121
|
-
function
|
|
1126
|
+
function ve(e, t = "xy") {
|
|
1122
1127
|
if (t === "xy") return {
|
|
1123
1128
|
x: e.x,
|
|
1124
1129
|
y: e.y
|
|
@@ -1133,30 +1138,30 @@ function _e(e, t = "xy") {
|
|
|
1133
1138
|
};
|
|
1134
1139
|
throw Error(`Unsupported plane: ${t}`);
|
|
1135
1140
|
}
|
|
1136
|
-
function
|
|
1141
|
+
function ye(e, t, n) {
|
|
1137
1142
|
let r = t.x - e.x, i = t.y - e.y, a = n.x - e.x;
|
|
1138
1143
|
return r * (n.y - e.y) - i * a;
|
|
1139
1144
|
}
|
|
1140
|
-
function
|
|
1145
|
+
function be(e, t, n = "xy") {
|
|
1141
1146
|
if (!t || t.length !== 4) throw Error("rectPoints must contain 4 points");
|
|
1142
|
-
let r =
|
|
1147
|
+
let r = ve(e, n), i = t.map((e) => ve(e, n)), a = !1, o = !1;
|
|
1143
1148
|
for (let e = 0; e < 4; e++) {
|
|
1144
|
-
let t = i[e], n = i[(e + 1) % 4], s =
|
|
1149
|
+
let t = i[e], n = i[(e + 1) % 4], s = ye(t, n, r);
|
|
1145
1150
|
if (s > 1e-9 && (a = !0), s < -1e-9 && (o = !0), a && o) return !1;
|
|
1146
1151
|
}
|
|
1147
1152
|
return !0;
|
|
1148
1153
|
}
|
|
1149
|
-
function
|
|
1154
|
+
function xe(t) {
|
|
1150
1155
|
if (!t || t.length === 0) return null;
|
|
1151
1156
|
let n = new e.Vector3(0, 0, 0);
|
|
1152
1157
|
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
1158
|
return n.divideScalar(t.length), n;
|
|
1154
1159
|
}
|
|
1155
|
-
function
|
|
1160
|
+
function Se(t) {
|
|
1156
1161
|
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
1162
|
}
|
|
1158
|
-
function
|
|
1159
|
-
let n =
|
|
1163
|
+
function Ce(e, t = "xy") {
|
|
1164
|
+
let n = Se(e);
|
|
1160
1165
|
if (t === "xy") return {
|
|
1161
1166
|
x: n.x,
|
|
1162
1167
|
y: n.y,
|
|
@@ -1174,13 +1179,13 @@ function Se(e, t = "xy") {
|
|
|
1174
1179
|
};
|
|
1175
1180
|
throw Error(`Unsupported plane: ${t}`);
|
|
1176
1181
|
}
|
|
1177
|
-
function
|
|
1182
|
+
function we(t, n, r, i = "xy") {
|
|
1178
1183
|
if (i === "xy") return new e.Vector3(t, n, r);
|
|
1179
1184
|
if (i === "xz") return new e.Vector3(t, r, n);
|
|
1180
1185
|
if (i === "yz") return new e.Vector3(r, t, n);
|
|
1181
1186
|
throw Error(`Unsupported plane: ${i}`);
|
|
1182
1187
|
}
|
|
1183
|
-
function
|
|
1188
|
+
function Te(e, t, n) {
|
|
1184
1189
|
let r = 1e-12;
|
|
1185
1190
|
if (Math.abs(t) < r) return e >= n ? {
|
|
1186
1191
|
x: 1,
|
|
@@ -1198,10 +1203,10 @@ function we(e, t, n) {
|
|
|
1198
1203
|
y: l / u
|
|
1199
1204
|
};
|
|
1200
1205
|
}
|
|
1201
|
-
function
|
|
1206
|
+
function Ee(e, t = {}) {
|
|
1202
1207
|
let { plane: n = "xy", trimRatio: r = 0 } = t;
|
|
1203
1208
|
if (!e || e.length < 2) return null;
|
|
1204
|
-
let i = e.map((e) =>
|
|
1209
|
+
let i = e.map((e) => Ce(e, n)), a = 0, o = 0, s = 0;
|
|
1205
1210
|
for (let e of i) a += e.x, o += e.y, s += e.up;
|
|
1206
1211
|
a /= i.length, o /= i.length, s /= i.length;
|
|
1207
1212
|
let c = 0, l = 0, u = 0;
|
|
@@ -1210,7 +1215,7 @@ function Te(e, t = {}) {
|
|
|
1210
1215
|
c += t * t, l += t * n, u += n * n;
|
|
1211
1216
|
}
|
|
1212
1217
|
c /= i.length, l /= i.length, u /= i.length;
|
|
1213
|
-
let d =
|
|
1218
|
+
let d = Te(c, l, u), f = {
|
|
1214
1219
|
x: -d.y,
|
|
1215
1220
|
y: d.x
|
|
1216
1221
|
}, p = [];
|
|
@@ -1232,11 +1237,11 @@ function Te(e, t = {}) {
|
|
|
1232
1237
|
let e = p.map((e) => e.up).sort((e, t) => e - t), t = Math.floor(e.length / 2);
|
|
1233
1238
|
return e.length % 2 == 0 ? (e[t - 1] + e[t]) * .5 : e[t];
|
|
1234
1239
|
})(), 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 [
|
|
1240
|
+
return [we(D, O, T, n), we(k, A, E, n)];
|
|
1236
1241
|
}
|
|
1237
1242
|
//#endregion
|
|
1238
1243
|
//#region src/geometry/beamLine.mjs
|
|
1239
|
-
var
|
|
1244
|
+
var De = async (t, n, r, i) => {
|
|
1240
1245
|
ce(i);
|
|
1241
1246
|
let a = await fetch(t);
|
|
1242
1247
|
if (!a) return;
|
|
@@ -1263,7 +1268,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
1263
1268
|
}
|
|
1264
1269
|
}
|
|
1265
1270
|
i.add(m), console.time();
|
|
1266
|
-
let { beamGroup: x } = await
|
|
1271
|
+
let { beamGroup: x } = await Oe(o, _, y, i);
|
|
1267
1272
|
console.timeEnd(), console.log("beamGroup", x);
|
|
1268
1273
|
let S = new e.MeshBasicMaterial({
|
|
1269
1274
|
color: "#cffd00",
|
|
@@ -1420,7 +1425,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
1420
1425
|
beamDoorGroup: p,
|
|
1421
1426
|
lineIndexGroup: m
|
|
1422
1427
|
};
|
|
1423
|
-
},
|
|
1428
|
+
}, Oe = async (t, n, r, i) => {
|
|
1424
1429
|
if (ae(t, i), t.length <= 0 || n.length <= 0) return t;
|
|
1425
1430
|
r ||= [];
|
|
1426
1431
|
for (let n of t) {
|
|
@@ -1822,7 +1827,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
1822
1827
|
for (let i = 0; i < t[o].checkResults.length; i++) {
|
|
1823
1828
|
let i = [];
|
|
1824
1829
|
t[o].originalPoints.forEach((t) => {
|
|
1825
|
-
t.z > M.z && t.z < M.z + x / 2 && i.push(new e.Vector3(t.x, t.y, M.z));
|
|
1830
|
+
t.z > M.z + .2 && t.z < M.z + x / 2 && i.push(new e.Vector3(t.x, t.y, M.z));
|
|
1826
1831
|
});
|
|
1827
1832
|
let c = new e.Vector3(), u = [], d = [];
|
|
1828
1833
|
for (let e = 0; e < i.length; e++) {
|
|
@@ -1830,7 +1835,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
1830
1835
|
t.distanceTo(i[e]) < .15 && (u.push(i[e]), d.push(t.clone()));
|
|
1831
1836
|
}
|
|
1832
1837
|
for (let e = 0; e < d.length; e++) oe(a, d[e]) && u.push(d[e]);
|
|
1833
|
-
if (u = d, u.length <
|
|
1838
|
+
if (u = d, u = fe(u), u.length < 150) continue;
|
|
1834
1839
|
let f = se(u);
|
|
1835
1840
|
if (f.length == 2) {
|
|
1836
1841
|
let e = f[0].distanceTo(f[1]);
|
|
@@ -1982,7 +1987,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
1982
1987
|
lines: t,
|
|
1983
1988
|
beamGroup: f
|
|
1984
1989
|
};
|
|
1985
|
-
},
|
|
1990
|
+
}, ke = (t, n) => {
|
|
1986
1991
|
if (t.length <= 0) return t;
|
|
1987
1992
|
for (let n of t) {
|
|
1988
1993
|
let t = [];
|
|
@@ -2073,7 +2078,7 @@ var Ee = async (t, n, r, i) => {
|
|
|
2073
2078
|
}
|
|
2074
2079
|
}
|
|
2075
2080
|
return t;
|
|
2076
|
-
},
|
|
2081
|
+
}, Ae = (t, n) => {
|
|
2077
2082
|
let r = {
|
|
2078
2083
|
rectangles: [],
|
|
2079
2084
|
threeEdgeRect: []
|
|
@@ -2196,8 +2201,8 @@ var Ee = async (t, n, r, i) => {
|
|
|
2196
2201
|
l.indexs.length == 3 && (l.indexs.forEach((e) => i.add(e)), r.threeEdgeRect.push(l));
|
|
2197
2202
|
}
|
|
2198
2203
|
return r;
|
|
2199
|
-
}, U = 11102230246251565e-32, W = 134217729,
|
|
2200
|
-
function
|
|
2204
|
+
}, U = 11102230246251565e-32, W = 134217729, je = (3 + 8 * U) * U;
|
|
2205
|
+
function Me(e, t, n, r, i) {
|
|
2201
2206
|
let a, o, s, c, l = t[0], u = r[0], d = 0, f = 0;
|
|
2202
2207
|
u > l == u > -l ? (a = l, l = t[++d]) : (a = u, u = r[++f]);
|
|
2203
2208
|
let p = 0;
|
|
@@ -2206,7 +2211,7 @@ function je(e, t, n, r, i) {
|
|
|
2206
2211
|
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);
|
|
2207
2212
|
return (a !== 0 || p === 0) && (i[p++] = a), p;
|
|
2208
2213
|
}
|
|
2209
|
-
function
|
|
2214
|
+
function Ne(e, t) {
|
|
2210
2215
|
let n = t[0];
|
|
2211
2216
|
for (let r = 1; r < e; r++) n += t[r];
|
|
2212
2217
|
return n;
|
|
@@ -2216,27 +2221,27 @@ function G(e) {
|
|
|
2216
2221
|
}
|
|
2217
2222
|
//#endregion
|
|
2218
2223
|
//#region node_modules/robust-predicates/esm/orient2d.js
|
|
2219
|
-
var
|
|
2220
|
-
function
|
|
2224
|
+
var Pe = (3 + 16 * U) * U, Fe = (2 + 12 * U) * U, Ie = (9 + 64 * U) * U * U, Le = G(4), Re = G(8), ze = G(12), Be = G(16), K = G(4);
|
|
2225
|
+
function Ve(e, t, n, r, i, a, o) {
|
|
2221
2226
|
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;
|
|
2222
|
-
b = T * O, f = W * T, p = f - (f - T), m = T - p, f = W * O, h = f - (f - O), g = O - h, x = m * g - (b - p * h - m * h - p * g), S = D * E, f = W * D, p = f - (f - D), m = D - p, f = W * E, h = f - (f - E), g = E - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _,
|
|
2223
|
-
let k =
|
|
2224
|
-
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 =
|
|
2227
|
+
b = T * O, f = W * T, p = f - (f - T), m = T - p, f = W * O, h = f - (f - O), g = O - h, x = m * g - (b - p * h - m * h - p * g), S = D * E, f = W * D, p = f - (f - D), m = D - p, f = W * 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;
|
|
2228
|
+
let k = Ne(4, Le), A = Fe * o;
|
|
2229
|
+
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;
|
|
2225
2230
|
b = s * O, f = W * s, p = f - (f - s), m = s - p, f = W * O, h = f - (f - O), g = O - h, x = m * g - (b - p * h - m * h - p * g), S = c * E, f = W * c, p = f - (f - c), m = c - p, f = W * E, h = f - (f - E), g = E - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, K[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, K[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, K[2] = v - (w - d) + (_ - d), K[3] = w;
|
|
2226
|
-
let j =
|
|
2231
|
+
let j = Me(4, Le, 4, K, Re);
|
|
2227
2232
|
b = T * u, f = W * T, p = f - (f - T), m = T - p, f = W * u, h = f - (f - u), g = u - h, x = m * g - (b - p * h - m * h - p * g), S = D * l, f = W * D, p = f - (f - D), m = D - p, f = W * l, h = f - (f - l), g = l - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, K[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, K[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, K[2] = v - (w - d) + (_ - d), K[3] = w;
|
|
2228
|
-
let M =
|
|
2229
|
-
return b = s * u, f = W * s, p = f - (f - s), m = s - p, f = W * u, h = f - (f - u), g = u - h, x = m * g - (b - p * h - m * h - p * g), S = c * l, f = W * c, p = f - (f - c), m = c - p, f = W * l, h = f - (f - l), g = l - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, K[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, K[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, K[2] = v - (w - d) + (_ - d), K[3] = w,
|
|
2233
|
+
let M = Me(j, Re, 4, K, ze);
|
|
2234
|
+
return b = s * u, f = W * s, p = f - (f - s), m = s - p, f = W * u, h = f - (f - u), g = u - h, x = m * g - (b - p * h - m * h - p * g), S = c * l, f = W * c, p = f - (f - c), m = c - p, f = W * l, h = f - (f - l), g = l - h, C = m * g - (S - p * h - m * h - p * g), _ = x - C, d = x - _, K[0] = x - (_ + d) + (d - C), v = b + _, d = v - b, y = b - (v - d) + (_ - d), _ = y - S, d = y - _, K[1] = y - (_ + d) + (d - S), w = v + _, d = w - v, K[2] = v - (w - d) + (_ - d), K[3] = w, Be[Me(M, ze, 4, K, Be) - 1];
|
|
2230
2235
|
}
|
|
2231
|
-
function
|
|
2236
|
+
function He(e, t, n, r, i, a) {
|
|
2232
2237
|
let o = (t - a) * (n - i), s = (e - i) * (r - a), c = o - s, l = Math.abs(o + s);
|
|
2233
|
-
return Math.abs(c) >=
|
|
2238
|
+
return Math.abs(c) >= Pe * l ? c : -Ve(e, t, n, r, i, a, l);
|
|
2234
2239
|
}
|
|
2235
2240
|
(7 + 56 * U) * U, (3 + 28 * U) * U, (26 + 288 * U) * U * U, G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(8), G(8), G(8), G(4), G(8), G(8), G(16), G(12), G(192), G(192), (10 + 96 * U) * U, (4 + 48 * U) * U, (44 + 576 * U) * U * U, G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(8), G(8), G(8), G(8), G(8), G(8), G(8), G(8), G(8), G(4), G(4), G(4), G(8), G(16), G(16), G(16), G(32), G(32), G(48), G(64), G(1152), G(1152), (16 + 224 * U) * U, (5 + 72 * U) * U, (71 + 1408 * U) * U * U, G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(4), G(24), G(24), G(24), G(24), G(24), G(24), G(24), G(24), G(24), G(24), G(1152), G(1152), G(1152), G(1152), G(1152), G(2304), G(2304), G(3456), G(5760), G(8), G(8), G(8), G(16), G(24), G(48), G(48), G(96), G(192), G(384), G(384), G(384), G(768), G(96), G(96), G(96), G(1152);
|
|
2236
2241
|
//#endregion
|
|
2237
2242
|
//#region node_modules/delaunator/index.js
|
|
2238
|
-
var
|
|
2239
|
-
static from(t, n =
|
|
2243
|
+
var Ue = 2 ** -52, We = new Uint32Array(512), Ge = class e {
|
|
2244
|
+
static from(t, n = $e, r = et) {
|
|
2240
2245
|
let i = t.length, a = new Float64Array(i * 2);
|
|
2241
2246
|
for (let e = 0; e < i; e++) {
|
|
2242
2247
|
let i = t[e];
|
|
@@ -2259,25 +2264,25 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2259
2264
|
}
|
|
2260
2265
|
let u = (o + c) / 2, d = (s + l) / 2, f = 0, p = 0, m = 0;
|
|
2261
2266
|
for (let t = 0, n = Infinity; t < a; t++) {
|
|
2262
|
-
let r =
|
|
2267
|
+
let r = qe(u, d, e[2 * t], e[2 * t + 1]);
|
|
2263
2268
|
r < n && (f = t, n = r);
|
|
2264
2269
|
}
|
|
2265
2270
|
let h = e[2 * f], g = e[2 * f + 1];
|
|
2266
2271
|
for (let t = 0, n = Infinity; t < a; t++) {
|
|
2267
2272
|
if (t === f) continue;
|
|
2268
|
-
let r =
|
|
2273
|
+
let r = qe(h, g, e[2 * t], e[2 * t + 1]);
|
|
2269
2274
|
r < n && r > 0 && (p = t, n = r);
|
|
2270
2275
|
}
|
|
2271
2276
|
let _ = e[2 * p], v = e[2 * p + 1], y = Infinity;
|
|
2272
2277
|
for (let t = 0; t < a; t++) {
|
|
2273
2278
|
if (t === f || t === p) continue;
|
|
2274
|
-
let n =
|
|
2279
|
+
let n = Ye(h, g, _, v, e[2 * t], e[2 * t + 1]);
|
|
2275
2280
|
n < y && (m = t, y = n);
|
|
2276
2281
|
}
|
|
2277
2282
|
let b = e[2 * m], x = e[2 * m + 1];
|
|
2278
2283
|
if (y === Infinity) {
|
|
2279
2284
|
for (let t = 0; t < a; t++) this._dists[t] = e[2 * t] - e[0] || e[2 * t + 1] - e[1];
|
|
2280
|
-
|
|
2285
|
+
Ze(this._ids, this._dists, 0, a - 1);
|
|
2281
2286
|
let t = new Uint32Array(a), n = 0;
|
|
2282
2287
|
for (let e = 0, r = -Infinity; e < a; e++) {
|
|
2283
2288
|
let i = this._ids[e], a = this._dists[i];
|
|
@@ -2286,24 +2291,24 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2286
2291
|
this.hull = t.subarray(0, n), this.triangles = new Uint32Array(), this.halfedges = new Int32Array();
|
|
2287
2292
|
return;
|
|
2288
2293
|
}
|
|
2289
|
-
if (
|
|
2294
|
+
if (He(h, g, _, v, b, x) < 0) {
|
|
2290
2295
|
let e = p, t = _, n = v;
|
|
2291
2296
|
p = m, _ = b, v = x, m = e, b = t, x = n;
|
|
2292
2297
|
}
|
|
2293
|
-
let S =
|
|
2298
|
+
let S = Xe(h, g, _, v, b, x);
|
|
2294
2299
|
this._cx = S.x, this._cy = S.y;
|
|
2295
|
-
for (let t = 0; t < a; t++) this._dists[t] =
|
|
2296
|
-
|
|
2300
|
+
for (let t = 0; t < a; t++) this._dists[t] = qe(e[2 * t], e[2 * t + 1], S.x, S.y);
|
|
2301
|
+
Ze(this._ids, this._dists, 0, a - 1), this._hullStart = f;
|
|
2297
2302
|
let C = 3;
|
|
2298
2303
|
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);
|
|
2299
2304
|
for (let a = 0, o = 0, s = 0; a < this._ids.length; a++) {
|
|
2300
2305
|
let c = this._ids[a], l = e[2 * c], u = e[2 * c + 1];
|
|
2301
|
-
if (a > 0 && Math.abs(l - o) <=
|
|
2306
|
+
if (a > 0 && Math.abs(l - o) <= Ue && Math.abs(u - s) <= Ue || (o = l, s = u, c === f || c === p || c === m)) continue;
|
|
2302
2307
|
let d = 0;
|
|
2303
2308
|
for (let e = 0, t = this._hashKey(l, u); e < this._hashSize && (d = i[(t + e) % this._hashSize], !(d !== -1 && d !== n[d])); e++);
|
|
2304
2309
|
d = t[d];
|
|
2305
2310
|
let h = d, g;
|
|
2306
|
-
for (; g = n[h],
|
|
2311
|
+
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) {
|
|
2307
2312
|
h = -1;
|
|
2308
2313
|
break;
|
|
2309
2314
|
}
|
|
@@ -2311,8 +2316,8 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2311
2316
|
let _ = this._addTriangle(h, c, n[h], -1, -1, r[h]);
|
|
2312
2317
|
r[c] = this._legalize(_ + 2), r[h] = _, C++;
|
|
2313
2318
|
let v = n[h];
|
|
2314
|
-
for (; g = n[v],
|
|
2315
|
-
if (h === d) for (; g = t[h],
|
|
2319
|
+
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;
|
|
2320
|
+
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;
|
|
2316
2321
|
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;
|
|
2317
2322
|
}
|
|
2318
2323
|
this.hull = new Uint32Array(C);
|
|
@@ -2320,7 +2325,7 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2320
2325
|
this.triangles = this._triangles.subarray(0, this.trianglesLen), this.halfedges = this._halfedges.subarray(0, this.trianglesLen);
|
|
2321
2326
|
}
|
|
2322
2327
|
_hashKey(e, t) {
|
|
2323
|
-
return Math.floor(
|
|
2328
|
+
return Math.floor(Ke(e - this._cx, t - this._cy) * this._hashSize) % this._hashSize;
|
|
2324
2329
|
}
|
|
2325
2330
|
_legalize(e) {
|
|
2326
2331
|
let { _triangles: t, _halfedges: n, coords: r } = this, i = 0, a = 0;
|
|
@@ -2328,11 +2333,11 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2328
2333
|
let o = n[e], s = e - e % 3;
|
|
2329
2334
|
if (a = s + (e + 2) % 3, o === -1) {
|
|
2330
2335
|
if (i === 0) break;
|
|
2331
|
-
e =
|
|
2336
|
+
e = We[--i];
|
|
2332
2337
|
continue;
|
|
2333
2338
|
}
|
|
2334
2339
|
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];
|
|
2335
|
-
if (
|
|
2340
|
+
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])) {
|
|
2336
2341
|
t[e] = m, t[o] = d;
|
|
2337
2342
|
let r = n[u];
|
|
2338
2343
|
if (r === -1) {
|
|
@@ -2347,10 +2352,10 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2347
2352
|
}
|
|
2348
2353
|
this._link(e, r), this._link(o, n[a]), this._link(a, u);
|
|
2349
2354
|
let s = c + (o + 1) % 3;
|
|
2350
|
-
i <
|
|
2355
|
+
i < We.length && (We[i++] = s);
|
|
2351
2356
|
} else {
|
|
2352
2357
|
if (i === 0) break;
|
|
2353
|
-
e =
|
|
2358
|
+
e = We[--i];
|
|
2354
2359
|
}
|
|
2355
2360
|
}
|
|
2356
2361
|
return a;
|
|
@@ -2363,30 +2368,30 @@ var He = 2 ** -52, Ue = new Uint32Array(512), We = class e {
|
|
|
2363
2368
|
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;
|
|
2364
2369
|
}
|
|
2365
2370
|
};
|
|
2366
|
-
function
|
|
2371
|
+
function Ke(e, t) {
|
|
2367
2372
|
let n = e / (Math.abs(e) + Math.abs(t));
|
|
2368
2373
|
return (t > 0 ? 3 - n : 1 + n) / 4;
|
|
2369
2374
|
}
|
|
2370
|
-
function
|
|
2375
|
+
function qe(e, t, n, r) {
|
|
2371
2376
|
let i = e - n, a = t - r;
|
|
2372
2377
|
return i * i + a * a;
|
|
2373
2378
|
}
|
|
2374
|
-
function
|
|
2379
|
+
function Je(e, t, n, r, i, a, o, s) {
|
|
2375
2380
|
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;
|
|
2376
2381
|
return c * (d * g - h * p) - l * (u * g - h * f) + m * (u * p - d * f) < 0;
|
|
2377
2382
|
}
|
|
2378
|
-
function
|
|
2383
|
+
function Ye(e, t, n, r, i, a) {
|
|
2379
2384
|
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;
|
|
2380
2385
|
return p * p + m * m;
|
|
2381
2386
|
}
|
|
2382
|
-
function
|
|
2387
|
+
function Xe(e, t, n, r, i, a) {
|
|
2383
2388
|
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);
|
|
2384
2389
|
return {
|
|
2385
2390
|
x: e + (l * u - s * d) * f,
|
|
2386
2391
|
y: t + (o * d - c * u) * f
|
|
2387
2392
|
};
|
|
2388
2393
|
}
|
|
2389
|
-
function
|
|
2394
|
+
function Ze(e, t, n, r) {
|
|
2390
2395
|
if (r - n <= 20) for (let i = n + 1; i <= r; i++) {
|
|
2391
2396
|
let r = e[i], a = t[r], o = i - 1;
|
|
2392
2397
|
for (; o >= n && t[e[o]] > a;) e[o + 1] = e[o--];
|
|
@@ -2394,7 +2399,7 @@ function Xe(e, t, n, r) {
|
|
|
2394
2399
|
}
|
|
2395
2400
|
else {
|
|
2396
2401
|
let i = n + r >> 1, a = n + 1, o = r;
|
|
2397
|
-
|
|
2402
|
+
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);
|
|
2398
2403
|
let s = e[a], c = t[s];
|
|
2399
2404
|
for (;;) {
|
|
2400
2405
|
do
|
|
@@ -2404,24 +2409,24 @@ function Xe(e, t, n, r) {
|
|
|
2404
2409
|
o--;
|
|
2405
2410
|
while (t[e[o]] > c);
|
|
2406
2411
|
if (o < a) break;
|
|
2407
|
-
|
|
2412
|
+
Qe(e, a, o);
|
|
2408
2413
|
}
|
|
2409
|
-
e[n + 1] = e[o], e[o] = s, r - a + 1 >= o - n ? (
|
|
2414
|
+
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));
|
|
2410
2415
|
}
|
|
2411
2416
|
}
|
|
2412
|
-
function
|
|
2417
|
+
function Qe(e, t, n) {
|
|
2413
2418
|
let r = e[t];
|
|
2414
2419
|
e[t] = e[n], e[n] = r;
|
|
2415
2420
|
}
|
|
2416
|
-
function
|
|
2421
|
+
function $e(e) {
|
|
2417
2422
|
return e[0];
|
|
2418
2423
|
}
|
|
2419
|
-
function
|
|
2424
|
+
function et(e) {
|
|
2420
2425
|
return e[1];
|
|
2421
2426
|
}
|
|
2422
2427
|
//#endregion
|
|
2423
2428
|
//#region node_modules/d3-delaunay/src/path.js
|
|
2424
|
-
var
|
|
2429
|
+
var tt = 1e-6, nt = class {
|
|
2425
2430
|
constructor() {
|
|
2426
2431
|
this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";
|
|
2427
2432
|
}
|
|
@@ -2438,7 +2443,7 @@ var et = 1e-6, tt = class {
|
|
|
2438
2443
|
e = +e, t = +t, n = +n;
|
|
2439
2444
|
let r = e + n, i = t;
|
|
2440
2445
|
if (n < 0) throw Error("negative radius");
|
|
2441
|
-
this._x1 === null ? this._ += `M${r},${i}` : (Math.abs(this._x1 - r) >
|
|
2446
|
+
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}`);
|
|
2442
2447
|
}
|
|
2443
2448
|
rect(e, t, n, r) {
|
|
2444
2449
|
this._ += `M${this._x0 = this._x1 = +e},${this._y0 = this._y1 = +t}h${+n}v${+r}h${-n}Z`;
|
|
@@ -2446,7 +2451,7 @@ var et = 1e-6, tt = class {
|
|
|
2446
2451
|
value() {
|
|
2447
2452
|
return this._ || null;
|
|
2448
2453
|
}
|
|
2449
|
-
},
|
|
2454
|
+
}, rt = class {
|
|
2450
2455
|
constructor() {
|
|
2451
2456
|
this._ = [];
|
|
2452
2457
|
}
|
|
@@ -2462,7 +2467,7 @@ var et = 1e-6, tt = class {
|
|
|
2462
2467
|
value() {
|
|
2463
2468
|
return this._.length ? this._ : null;
|
|
2464
2469
|
}
|
|
2465
|
-
},
|
|
2470
|
+
}, it = class {
|
|
2466
2471
|
constructor(e, [t, n, r, i] = [
|
|
2467
2472
|
0,
|
|
2468
2473
|
0,
|
|
@@ -2498,7 +2503,7 @@ var et = 1e-6, tt = class {
|
|
|
2498
2503
|
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;
|
|
2499
2504
|
}
|
|
2500
2505
|
render(e) {
|
|
2501
|
-
let t = e == null ? e = new
|
|
2506
|
+
let t = e == null ? e = new nt() : void 0, { delaunay: { halfedges: n, inedges: r, hull: i }, circumcenters: a, vectors: o } = this;
|
|
2502
2507
|
if (i.length <= 1) return null;
|
|
2503
2508
|
for (let t = 0, r = n.length; t < r; ++t) {
|
|
2504
2509
|
let r = n[t];
|
|
@@ -2515,11 +2520,11 @@ var et = 1e-6, tt = class {
|
|
|
2515
2520
|
return t && t.value();
|
|
2516
2521
|
}
|
|
2517
2522
|
renderBounds(e) {
|
|
2518
|
-
let t = e == null ? e = new
|
|
2523
|
+
let t = e == null ? e = new nt() : void 0;
|
|
2519
2524
|
return e.rect(this.xmin, this.ymin, this.xmax - this.xmin, this.ymax - this.ymin), t && t.value();
|
|
2520
2525
|
}
|
|
2521
2526
|
renderCell(e, t) {
|
|
2522
|
-
let n = t == null ? t = new
|
|
2527
|
+
let n = t == null ? t = new nt() : void 0, r = this._clip(e);
|
|
2523
2528
|
if (r === null || !r.length) return;
|
|
2524
2529
|
t.moveTo(r[0], r[1]);
|
|
2525
2530
|
let i = r.length;
|
|
@@ -2535,7 +2540,7 @@ var et = 1e-6, tt = class {
|
|
|
2535
2540
|
}
|
|
2536
2541
|
}
|
|
2537
2542
|
cellPolygon(e) {
|
|
2538
|
-
let t = new
|
|
2543
|
+
let t = new rt();
|
|
2539
2544
|
return this.renderCell(e, t), t.value();
|
|
2540
2545
|
}
|
|
2541
2546
|
_renderSegment(e, t, n, r, i) {
|
|
@@ -2719,14 +2724,14 @@ var et = 1e-6, tt = class {
|
|
|
2719
2724
|
}
|
|
2720
2725
|
return e;
|
|
2721
2726
|
}
|
|
2722
|
-
},
|
|
2723
|
-
function
|
|
2727
|
+
}, at = 2 * Math.PI, ot = Math.pow;
|
|
2728
|
+
function st(e) {
|
|
2724
2729
|
return e[0];
|
|
2725
2730
|
}
|
|
2726
|
-
function
|
|
2731
|
+
function ct(e) {
|
|
2727
2732
|
return e[1];
|
|
2728
2733
|
}
|
|
2729
|
-
function
|
|
2734
|
+
function lt(e) {
|
|
2730
2735
|
let { triangles: t, coords: n } = e;
|
|
2731
2736
|
for (let e = 0; e < t.length; e += 3) {
|
|
2732
2737
|
let r = 2 * t[e], i = 2 * t[e + 1], a = 2 * t[e + 2];
|
|
@@ -2734,22 +2739,22 @@ function ct(e) {
|
|
|
2734
2739
|
}
|
|
2735
2740
|
return !0;
|
|
2736
2741
|
}
|
|
2737
|
-
function
|
|
2742
|
+
function ut(e, t, n) {
|
|
2738
2743
|
return [e + Math.sin(e + t) * n, t + Math.cos(e - t) * n];
|
|
2739
2744
|
}
|
|
2740
|
-
var
|
|
2741
|
-
static from(t, n =
|
|
2742
|
-
return new e("length" in t ?
|
|
2745
|
+
var dt = class e {
|
|
2746
|
+
static from(t, n = st, r = ct, i) {
|
|
2747
|
+
return new e("length" in t ? ft(t, n, r, i) : Float64Array.from(pt(t, n, r, i)));
|
|
2743
2748
|
}
|
|
2744
2749
|
constructor(e) {
|
|
2745
|
-
this._delaunator = new
|
|
2750
|
+
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();
|
|
2746
2751
|
}
|
|
2747
2752
|
update() {
|
|
2748
2753
|
return this._delaunator.update(), this._init(), this;
|
|
2749
2754
|
}
|
|
2750
2755
|
_init() {
|
|
2751
2756
|
let e = this._delaunator, t = this.points;
|
|
2752
|
-
if (e.hull && e.hull.length > 2 &&
|
|
2757
|
+
if (e.hull && e.hull.length > 2 && lt(e)) {
|
|
2753
2758
|
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]);
|
|
2754
2759
|
let e = this.collinear[0], n = this.collinear[this.collinear.length - 1], r = [
|
|
2755
2760
|
t[2 * e],
|
|
@@ -2758,10 +2763,10 @@ var ut = class e {
|
|
|
2758
2763
|
t[2 * n + 1]
|
|
2759
2764
|
], i = 1e-8 * Math.hypot(r[3] - r[1], r[2] - r[0]);
|
|
2760
2765
|
for (let e = 0, n = t.length / 2; e < n; ++e) {
|
|
2761
|
-
let n =
|
|
2766
|
+
let n = ut(t[2 * e], t[2 * e + 1], i);
|
|
2762
2767
|
t[2 * e] = n[0], t[2 * e + 1] = n[1];
|
|
2763
2768
|
}
|
|
2764
|
-
this._delaunator = new
|
|
2769
|
+
this._delaunator = new Ge(t);
|
|
2765
2770
|
} else delete this.collinear;
|
|
2766
2771
|
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);
|
|
2767
2772
|
for (let e = 0, t = n.length; e < t; ++e) {
|
|
@@ -2772,7 +2777,7 @@ var ut = class e {
|
|
|
2772
2777
|
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]));
|
|
2773
2778
|
}
|
|
2774
2779
|
voronoi(e) {
|
|
2775
|
-
return new
|
|
2780
|
+
return new it(this, e);
|
|
2776
2781
|
}
|
|
2777
2782
|
*neighbors(e) {
|
|
2778
2783
|
let { inedges: t, hull: n, _hullIndex: r, halfedges: i, triangles: a, collinear: o } = this;
|
|
@@ -2802,19 +2807,19 @@ var ut = class e {
|
|
|
2802
2807
|
_step(e, t, n) {
|
|
2803
2808
|
let { inedges: r, hull: i, _hullIndex: a, halfedges: o, triangles: s, points: c } = this;
|
|
2804
2809
|
if (r[e] === -1 || !c.length) return (e + 1) % (c.length >> 1);
|
|
2805
|
-
let l = e, u =
|
|
2810
|
+
let l = e, u = ot(t - c[e * 2], 2) + ot(n - c[e * 2 + 1], 2), d = r[e], f = d;
|
|
2806
2811
|
do {
|
|
2807
|
-
let r = s[f], d =
|
|
2812
|
+
let r = s[f], d = ot(t - c[r * 2], 2) + ot(n - c[r * 2 + 1], 2);
|
|
2808
2813
|
if (d < u && (u = d, l = r), f = f % 3 == 2 ? f - 2 : f + 1, s[f] !== e) break;
|
|
2809
2814
|
if (f = o[f], f === -1) {
|
|
2810
|
-
if (f = i[(a[e] + 1) % i.length], f !== r &&
|
|
2815
|
+
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;
|
|
2811
2816
|
break;
|
|
2812
2817
|
}
|
|
2813
2818
|
} while (f !== d);
|
|
2814
2819
|
return l;
|
|
2815
2820
|
}
|
|
2816
2821
|
render(e) {
|
|
2817
|
-
let t = e == null ? e = new
|
|
2822
|
+
let t = e == null ? e = new nt() : void 0, { points: n, halfedges: r, triangles: i } = this;
|
|
2818
2823
|
for (let t = 0, a = r.length; t < a; ++t) {
|
|
2819
2824
|
let a = r[t];
|
|
2820
2825
|
if (a < t) continue;
|
|
@@ -2825,15 +2830,15 @@ var ut = class e {
|
|
|
2825
2830
|
}
|
|
2826
2831
|
renderPoints(e, t) {
|
|
2827
2832
|
t === void 0 && (!e || typeof e.moveTo != "function") && (t = e, e = null), t = t == null ? 2 : +t;
|
|
2828
|
-
let n = e == null ? e = new
|
|
2833
|
+
let n = e == null ? e = new nt() : void 0, { points: r } = this;
|
|
2829
2834
|
for (let n = 0, i = r.length; n < i; n += 2) {
|
|
2830
2835
|
let i = r[n], a = r[n + 1];
|
|
2831
|
-
e.moveTo(i + t, a), e.arc(i, a, t, 0,
|
|
2836
|
+
e.moveTo(i + t, a), e.arc(i, a, t, 0, at);
|
|
2832
2837
|
}
|
|
2833
2838
|
return n && n.value();
|
|
2834
2839
|
}
|
|
2835
2840
|
renderHull(e) {
|
|
2836
|
-
let t = e == null ? e = new
|
|
2841
|
+
let t = e == null ? e = new nt() : void 0, { hull: n, points: r } = this, i = n[0] * 2, a = n.length;
|
|
2837
2842
|
e.moveTo(r[i], r[i + 1]);
|
|
2838
2843
|
for (let t = 1; t < a; ++t) {
|
|
2839
2844
|
let i = 2 * n[t];
|
|
@@ -2842,11 +2847,11 @@ var ut = class e {
|
|
|
2842
2847
|
return e.closePath(), t && t.value();
|
|
2843
2848
|
}
|
|
2844
2849
|
hullPolygon() {
|
|
2845
|
-
let e = new
|
|
2850
|
+
let e = new rt();
|
|
2846
2851
|
return this.renderHull(e), e.value();
|
|
2847
2852
|
}
|
|
2848
2853
|
renderTriangle(e, t) {
|
|
2849
|
-
let n = t == null ? t = new
|
|
2854
|
+
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;
|
|
2850
2855
|
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();
|
|
2851
2856
|
}
|
|
2852
2857
|
*trianglePolygons() {
|
|
@@ -2854,11 +2859,11 @@ var ut = class e {
|
|
|
2854
2859
|
for (let t = 0, n = e.length / 3; t < n; ++t) yield this.trianglePolygon(t);
|
|
2855
2860
|
}
|
|
2856
2861
|
trianglePolygon(e) {
|
|
2857
|
-
let t = new
|
|
2862
|
+
let t = new rt();
|
|
2858
2863
|
return this.renderTriangle(e, t), t.value();
|
|
2859
2864
|
}
|
|
2860
2865
|
};
|
|
2861
|
-
function
|
|
2866
|
+
function ft(e, t, n, r) {
|
|
2862
2867
|
let i = e.length, a = new Float64Array(i * 2);
|
|
2863
2868
|
for (let o = 0; o < i; ++o) {
|
|
2864
2869
|
let i = e[o];
|
|
@@ -2866,20 +2871,20 @@ function dt(e, t, n, r) {
|
|
|
2866
2871
|
}
|
|
2867
2872
|
return a;
|
|
2868
2873
|
}
|
|
2869
|
-
function*
|
|
2874
|
+
function* pt(e, t, n, r) {
|
|
2870
2875
|
let i = 0;
|
|
2871
2876
|
for (let a of e) yield t.call(r, a, i, e), yield n.call(r, a, i, e), ++i;
|
|
2872
2877
|
}
|
|
2873
2878
|
//#endregion
|
|
2874
2879
|
//#region src/utils/clusert.mjs
|
|
2875
|
-
function
|
|
2880
|
+
function mt(e, t, n, r) {
|
|
2876
2881
|
return 1 + (e[t][0] === 0 || e[n][0] === 0 || e[r][0] === 0 ? 1 : 0);
|
|
2877
2882
|
}
|
|
2878
|
-
function
|
|
2883
|
+
function ht(e, t, n, r, i, a) {
|
|
2879
2884
|
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;
|
|
2880
2885
|
return l === 0 ? Infinity : o * s * c / (4 * l);
|
|
2881
2886
|
}
|
|
2882
|
-
function
|
|
2887
|
+
function gt(e) {
|
|
2883
2888
|
if (!e || e.length < 3) return [];
|
|
2884
2889
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
2885
2890
|
for (let r of e) {
|
|
@@ -2887,12 +2892,12 @@ function ht(e) {
|
|
|
2887
2892
|
t.has(e) || (t.add(e), n.push(r));
|
|
2888
2893
|
}
|
|
2889
2894
|
if (n.length < 3) return [];
|
|
2890
|
-
let { triangles: r } = new
|
|
2895
|
+
let { triangles: r } = new dt(Float64Array.from(n.flat()));
|
|
2891
2896
|
if (!r.length) return [];
|
|
2892
2897
|
let i = /* @__PURE__ */ new Map(), a = (e, t) => e < t ? `${e}_${t}` : `${t}_${e}`;
|
|
2893
2898
|
for (let e = 0; e < r.length; e += 3) {
|
|
2894
2899
|
let t = r[e], o = r[e + 1], s = r[e + 2], [c, l] = n[t], [u, d] = n[o], [f, p] = n[s];
|
|
2895
|
-
if (
|
|
2900
|
+
if (ht(c, l, u, d, f, p) <= 1 / mt(n, t, o, s)) for (let [e, n] of [
|
|
2896
2901
|
[t, o],
|
|
2897
2902
|
[o, s],
|
|
2898
2903
|
[s, t]
|
|
@@ -2941,7 +2946,7 @@ var q = {
|
|
|
2941
2946
|
[],
|
|
2942
2947
|
[],
|
|
2943
2948
|
[]
|
|
2944
|
-
], Z = [],
|
|
2949
|
+
], Z = [], _t = new d(), vt = new d(), yt = new d(), Q = new d(), bt = new d(), xt = new d(), St = new a(), Ct = new t(), wt = new o(), Tt = new o(), Et = new l(), Dt = class {
|
|
2945
2950
|
constructor(e = new d(), t = new d(), n = new a()) {
|
|
2946
2951
|
this.center = e, this.halfSize = t, this.rotation = n;
|
|
2947
2952
|
}
|
|
@@ -2959,22 +2964,22 @@ var q = {
|
|
|
2959
2964
|
}
|
|
2960
2965
|
clampPoint(e, t) {
|
|
2961
2966
|
let n = this.halfSize;
|
|
2962
|
-
Q.subVectors(e, this.center), this.rotation.extractBasis(
|
|
2963
|
-
let r = i.clamp(Q.dot(
|
|
2964
|
-
t.add(
|
|
2965
|
-
let a = i.clamp(Q.dot(
|
|
2966
|
-
t.add(
|
|
2967
|
-
let o = i.clamp(Q.dot(
|
|
2968
|
-
return t.add(
|
|
2967
|
+
Q.subVectors(e, this.center), this.rotation.extractBasis(_t, vt, yt), t.copy(this.center);
|
|
2968
|
+
let r = i.clamp(Q.dot(_t), -n.x, n.x);
|
|
2969
|
+
t.add(_t.multiplyScalar(r));
|
|
2970
|
+
let a = i.clamp(Q.dot(vt), -n.y, n.y);
|
|
2971
|
+
t.add(vt.multiplyScalar(a));
|
|
2972
|
+
let o = i.clamp(Q.dot(yt), -n.z, n.z);
|
|
2973
|
+
return t.add(yt.multiplyScalar(o)), t;
|
|
2969
2974
|
}
|
|
2970
2975
|
containsPoint(e) {
|
|
2971
|
-
return Q.subVectors(e, this.center), this.rotation.extractBasis(
|
|
2976
|
+
return Q.subVectors(e, this.center), this.rotation.extractBasis(_t, vt, yt), Math.abs(Q.dot(_t)) <= this.halfSize.x && Math.abs(Q.dot(vt)) <= this.halfSize.y && Math.abs(Q.dot(yt)) <= this.halfSize.z;
|
|
2972
2977
|
}
|
|
2973
2978
|
intersectsBox3(e) {
|
|
2974
|
-
return this.intersectsOBB(
|
|
2979
|
+
return this.intersectsOBB(Ot.fromBox3(e));
|
|
2975
2980
|
}
|
|
2976
2981
|
intersectsSphere(e) {
|
|
2977
|
-
return this.clampPoint(e.center,
|
|
2982
|
+
return this.clampPoint(e.center, xt), xt.distanceToSquared(e.center) <= e.radius * e.radius;
|
|
2978
2983
|
}
|
|
2979
2984
|
intersectsOBB(e, t = 2 ** -52) {
|
|
2980
2985
|
q.c = this.center, q.e[0] = this.halfSize.x, q.e[1] = this.halfSize.y, q.e[2] = this.halfSize.z, this.rotation.extractBasis(q.u[0], q.u[1], q.u[2]), J.c = e.center, J.e[0] = e.halfSize.x, J.e[1] = e.halfSize.y, J.e[2] = e.halfSize.z, e.rotation.extractBasis(J.u[0], J.u[1], J.u[2]);
|
|
@@ -2987,12 +2992,12 @@ var q = {
|
|
|
2987
2992
|
return n = q.e[1] * X[2][0] + q.e[2] * X[1][0], r = J.e[1] * X[0][2] + J.e[2] * X[0][1], !(Math.abs(Z[2] * Y[1][0] - Z[1] * Y[2][0]) > n + r || (n = q.e[1] * X[2][1] + q.e[2] * X[1][1], r = J.e[0] * X[0][2] + J.e[2] * X[0][0], Math.abs(Z[2] * Y[1][1] - Z[1] * Y[2][1]) > n + r) || (n = q.e[1] * X[2][2] + q.e[2] * X[1][2], r = J.e[0] * X[0][1] + J.e[1] * X[0][0], Math.abs(Z[2] * Y[1][2] - Z[1] * Y[2][2]) > n + r) || (n = q.e[0] * X[2][0] + q.e[2] * X[0][0], r = J.e[1] * X[1][2] + J.e[2] * X[1][1], Math.abs(Z[0] * Y[2][0] - Z[2] * Y[0][0]) > n + r) || (n = q.e[0] * X[2][1] + q.e[2] * X[0][1], r = J.e[0] * X[1][2] + J.e[2] * X[1][0], Math.abs(Z[0] * Y[2][1] - Z[2] * Y[0][1]) > n + r) || (n = q.e[0] * X[2][2] + q.e[2] * X[0][2], r = J.e[0] * X[1][1] + J.e[1] * X[1][0], Math.abs(Z[0] * Y[2][2] - Z[2] * Y[0][2]) > n + r) || (n = q.e[0] * X[1][0] + q.e[1] * X[0][0], r = J.e[1] * X[2][2] + J.e[2] * X[2][1], Math.abs(Z[1] * Y[0][0] - Z[0] * Y[1][0]) > n + r) || (n = q.e[0] * X[1][1] + q.e[1] * X[0][1], r = J.e[0] * X[2][2] + J.e[2] * X[2][0], Math.abs(Z[1] * Y[0][1] - Z[0] * Y[1][1]) > n + r) || (n = q.e[0] * X[1][2] + q.e[1] * X[0][2], r = J.e[0] * X[2][1] + J.e[1] * X[2][0], Math.abs(Z[1] * Y[0][2] - Z[0] * Y[1][2]) > n + r));
|
|
2988
2993
|
}
|
|
2989
2994
|
intersectsPlane(e) {
|
|
2990
|
-
this.rotation.extractBasis(
|
|
2991
|
-
let t = this.halfSize.x * Math.abs(e.normal.dot(
|
|
2995
|
+
this.rotation.extractBasis(_t, vt, yt);
|
|
2996
|
+
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;
|
|
2992
2997
|
return Math.abs(n) <= t;
|
|
2993
2998
|
}
|
|
2994
2999
|
intersectRay(e, t) {
|
|
2995
|
-
return this.getSize(
|
|
3000
|
+
return this.getSize(bt), Ct.setFromCenterAndSize(Q.set(0, 0, 0), bt), wt.setFromMatrix3(this.rotation), wt.setPosition(this.center), Tt.copy(wt).invert(), Et.copy(e).applyMatrix4(Tt), Et.intersectBox(Ct, t) ? t.applyMatrix4(wt) : null;
|
|
2996
3001
|
}
|
|
2997
3002
|
intersectsRay(e) {
|
|
2998
3003
|
return this.intersectRay(e, Q) !== null;
|
|
@@ -3005,11 +3010,11 @@ var q = {
|
|
|
3005
3010
|
}
|
|
3006
3011
|
applyMatrix4(e) {
|
|
3007
3012
|
let t = e.elements, n = Q.set(t[0], t[1], t[2]).length(), r = Q.set(t[4], t[5], t[6]).length(), i = Q.set(t[8], t[9], t[10]).length();
|
|
3008
|
-
e.determinant() < 0 && (n = -n),
|
|
3013
|
+
e.determinant() < 0 && (n = -n), St.setFromMatrix4(e);
|
|
3009
3014
|
let a = 1 / n, o = 1 / r, s = 1 / i;
|
|
3010
|
-
return
|
|
3015
|
+
return St.elements[0] *= a, St.elements[1] *= a, St.elements[2] *= a, St.elements[3] *= o, St.elements[4] *= o, St.elements[5] *= o, St.elements[6] *= s, St.elements[7] *= s, St.elements[8] *= s, this.rotation.multiply(St), this.halfSize.x *= n, this.halfSize.y *= r, this.halfSize.z *= i, Q.setFromMatrixPosition(e), this.center.add(Q), this;
|
|
3011
3016
|
}
|
|
3012
|
-
},
|
|
3017
|
+
}, Ot = new Dt(), $ = 6371008.8, kt = {
|
|
3013
3018
|
centimeters: $ * 100,
|
|
3014
3019
|
centimetres: $ * 100,
|
|
3015
3020
|
degrees: 360 / (2 * Math.PI),
|
|
@@ -3026,60 +3031,60 @@ var q = {
|
|
|
3026
3031
|
radians: 1,
|
|
3027
3032
|
yards: $ * 1.0936
|
|
3028
3033
|
};
|
|
3029
|
-
function
|
|
3034
|
+
function At(e, t, n = {}) {
|
|
3030
3035
|
let r = { type: "Feature" };
|
|
3031
3036
|
return (n.id === 0 || n.id) && (r.id = n.id), n.bbox && (r.bbox = n.bbox), r.properties = t || {}, r.geometry = e, r;
|
|
3032
3037
|
}
|
|
3033
|
-
function
|
|
3038
|
+
function jt(e, t, n = {}) {
|
|
3034
3039
|
if (!e) throw Error("coordinates is required");
|
|
3035
3040
|
if (!Array.isArray(e)) throw Error("coordinates must be an Array");
|
|
3036
3041
|
if (e.length < 2) throw Error("coordinates must be at least 2 numbers long");
|
|
3037
|
-
if (!
|
|
3038
|
-
return
|
|
3042
|
+
if (!Rt(e[0]) || !Rt(e[1])) throw Error("coordinates must contain numbers");
|
|
3043
|
+
return At({
|
|
3039
3044
|
type: "Point",
|
|
3040
3045
|
coordinates: e
|
|
3041
3046
|
}, t, n);
|
|
3042
3047
|
}
|
|
3043
|
-
function
|
|
3048
|
+
function Mt(e, t, n = {}) {
|
|
3044
3049
|
for (let t of e) {
|
|
3045
3050
|
if (t.length < 4) throw Error("Each LinearRing of a Polygon must have 4 or more Positions.");
|
|
3046
3051
|
if (t[t.length - 1].length !== t[0].length) throw Error("First and last Position are not equivalent.");
|
|
3047
3052
|
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.");
|
|
3048
3053
|
}
|
|
3049
|
-
return
|
|
3054
|
+
return At({
|
|
3050
3055
|
type: "Polygon",
|
|
3051
3056
|
coordinates: e
|
|
3052
3057
|
}, t, n);
|
|
3053
3058
|
}
|
|
3054
|
-
function
|
|
3055
|
-
let n =
|
|
3059
|
+
function Nt(e, t = "kilometers") {
|
|
3060
|
+
let n = kt[t];
|
|
3056
3061
|
if (!n) throw Error(t + " units is invalid");
|
|
3057
3062
|
return e * n;
|
|
3058
3063
|
}
|
|
3059
|
-
function
|
|
3060
|
-
let n =
|
|
3064
|
+
function Pt(e, t = "kilometers") {
|
|
3065
|
+
let n = kt[t];
|
|
3061
3066
|
if (!n) throw Error(t + " units is invalid");
|
|
3062
3067
|
return e / n;
|
|
3063
3068
|
}
|
|
3064
|
-
function
|
|
3069
|
+
function Ft(e) {
|
|
3065
3070
|
return e % (2 * Math.PI) * 180 / Math.PI;
|
|
3066
3071
|
}
|
|
3067
|
-
function
|
|
3072
|
+
function It(e) {
|
|
3068
3073
|
return e % 360 * Math.PI / 180;
|
|
3069
3074
|
}
|
|
3070
|
-
function
|
|
3075
|
+
function Lt(e, t = "kilometers", n = "kilometers") {
|
|
3071
3076
|
if (!(e >= 0)) throw Error("length must be a positive number");
|
|
3072
|
-
return
|
|
3077
|
+
return Nt(Pt(e, t), n);
|
|
3073
3078
|
}
|
|
3074
|
-
function
|
|
3079
|
+
function Rt(e) {
|
|
3075
3080
|
return !isNaN(e) && e !== null && !Array.isArray(e);
|
|
3076
3081
|
}
|
|
3077
|
-
function
|
|
3082
|
+
function zt(e) {
|
|
3078
3083
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
3079
3084
|
}
|
|
3080
3085
|
//#endregion
|
|
3081
3086
|
//#region node_modules/@turf/meta/dist/esm/index.js
|
|
3082
|
-
function
|
|
3087
|
+
function Bt(e, t, n) {
|
|
3083
3088
|
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; _++) {
|
|
3084
3089
|
l = m ? e.features[_].geometry : h ? e.geometry : e, f = l ? l.type === "GeometryCollection" : !1, s = f ? l.geometries.length : 1;
|
|
3085
3090
|
for (var v = 0; v < s; v++) {
|
|
@@ -3125,7 +3130,7 @@ function zt(e, t, n) {
|
|
|
3125
3130
|
}
|
|
3126
3131
|
break;
|
|
3127
3132
|
case "GeometryCollection":
|
|
3128
|
-
for (r = 0; r < o.geometries.length; r++) if (
|
|
3133
|
+
for (r = 0; r < o.geometries.length; r++) if (Bt(o.geometries[r], t, n) === !1) return !1;
|
|
3129
3134
|
break;
|
|
3130
3135
|
default: throw Error("Unknown Geometry Type");
|
|
3131
3136
|
}
|
|
@@ -3133,13 +3138,13 @@ function zt(e, t, n) {
|
|
|
3133
3138
|
}
|
|
3134
3139
|
}
|
|
3135
3140
|
}
|
|
3136
|
-
function
|
|
3141
|
+
function Vt(e) {
|
|
3137
3142
|
var t = [];
|
|
3138
|
-
return
|
|
3143
|
+
return Bt(e, function(e) {
|
|
3139
3144
|
t.push(e);
|
|
3140
3145
|
}), t;
|
|
3141
3146
|
}
|
|
3142
|
-
function
|
|
3147
|
+
function Ht(e, t) {
|
|
3143
3148
|
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;
|
|
3144
3149
|
for (n = 0; n < h; n++) {
|
|
3145
3150
|
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++) {
|
|
@@ -3165,15 +3170,15 @@ function Vt(e, t) {
|
|
|
3165
3170
|
f++;
|
|
3166
3171
|
}
|
|
3167
3172
|
}
|
|
3168
|
-
function
|
|
3173
|
+
function Ut(e, t, n) {
|
|
3169
3174
|
var r = n;
|
|
3170
|
-
return
|
|
3175
|
+
return Ht(e, function(e, i, a, o, s) {
|
|
3171
3176
|
r = i === 0 && n === void 0 ? e : t(r, e, i, a, o, s);
|
|
3172
3177
|
}), r;
|
|
3173
3178
|
}
|
|
3174
3179
|
//#endregion
|
|
3175
3180
|
//#region node_modules/rbush/rbush.min.js
|
|
3176
|
-
var
|
|
3181
|
+
var Wt = /* @__PURE__ */ y(((e, t) => {
|
|
3177
3182
|
(function(n, r) {
|
|
3178
3183
|
typeof e == "object" && t !== void 0 ? t.exports = r() : typeof define == "function" && define.amd ? define(r) : (n ||= self).RBush = r();
|
|
3179
3184
|
})(e, function() {
|
|
@@ -3390,13 +3395,13 @@ var Ut = /* @__PURE__ */ y(((e, t) => {
|
|
|
3390
3395
|
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);
|
|
3391
3396
|
}, r;
|
|
3392
3397
|
});
|
|
3393
|
-
})),
|
|
3394
|
-
function
|
|
3398
|
+
})), Gt = /* @__PURE__ */ b({ default: () => qt });
|
|
3399
|
+
function Kt(e, t) {
|
|
3395
3400
|
return e < t ? -1 : e > t ? 1 : 0;
|
|
3396
3401
|
}
|
|
3397
|
-
var
|
|
3398
|
-
|
|
3399
|
-
constructor(e = [], t =
|
|
3402
|
+
var qt, Jt = v((() => {
|
|
3403
|
+
qt = class {
|
|
3404
|
+
constructor(e = [], t = Kt) {
|
|
3400
3405
|
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);
|
|
3401
3406
|
}
|
|
3402
3407
|
push(e) {
|
|
@@ -3429,7 +3434,7 @@ var Kt, qt = v((() => {
|
|
|
3429
3434
|
t[e] = i;
|
|
3430
3435
|
}
|
|
3431
3436
|
};
|
|
3432
|
-
})),
|
|
3437
|
+
})), Yt = /* @__PURE__ */ y(((e, t) => {
|
|
3433
3438
|
t.exports = function(e, t, n, r) {
|
|
3434
3439
|
var i = e[0], a = e[1], o = !1;
|
|
3435
3440
|
n === void 0 && (n = 0), r === void 0 && (r = t.length);
|
|
@@ -3439,7 +3444,7 @@ var Kt, qt = v((() => {
|
|
|
3439
3444
|
}
|
|
3440
3445
|
return o;
|
|
3441
3446
|
};
|
|
3442
|
-
})),
|
|
3447
|
+
})), Xt = /* @__PURE__ */ y(((e, t) => {
|
|
3443
3448
|
t.exports = function(e, t, n, r) {
|
|
3444
3449
|
var i = e[0], a = e[1], o = !1;
|
|
3445
3450
|
n === void 0 && (n = 0), r === void 0 && (r = t.length);
|
|
@@ -3449,12 +3454,12 @@ var Kt, qt = v((() => {
|
|
|
3449
3454
|
}
|
|
3450
3455
|
return o;
|
|
3451
3456
|
};
|
|
3452
|
-
})),
|
|
3453
|
-
var n =
|
|
3457
|
+
})), Zt = /* @__PURE__ */ y(((e, t) => {
|
|
3458
|
+
var n = Yt(), r = Xt();
|
|
3454
3459
|
t.exports = function(e, t, i, a) {
|
|
3455
3460
|
return t.length > 0 && Array.isArray(t[0]) ? r(e, t, i, a) : n(e, t, i, a);
|
|
3456
3461
|
}, t.exports.nested = r, t.exports.flat = n;
|
|
3457
|
-
})),
|
|
3462
|
+
})), Qt = /* @__PURE__ */ y(((e, t) => {
|
|
3458
3463
|
(function(n, r) {
|
|
3459
3464
|
typeof e == "object" && t !== void 0 ? r(e) : typeof define == "function" && define.amd ? define(["exports"], r) : r((n ||= self).predicates = {});
|
|
3460
3465
|
})(e, function(e) {
|
|
@@ -3495,8 +3500,8 @@ var Kt, qt = v((() => {
|
|
|
3495
3500
|
return (t - a) * (n - i) - (e - i) * (r - a);
|
|
3496
3501
|
}, Object.defineProperty(e, "__esModule", { value: !0 });
|
|
3497
3502
|
});
|
|
3498
|
-
})),
|
|
3499
|
-
var n =
|
|
3503
|
+
})), $t = /* @__PURE__ */ S((/* @__PURE__ */ y(((e, t) => {
|
|
3504
|
+
var n = Wt(), r = (Jt(), C(Gt)), i = Zt(), a = Qt().orient2d;
|
|
3500
3505
|
r.default && (r = r.default), t.exports = o, t.exports.default = o;
|
|
3501
3506
|
function o(e, t, r) {
|
|
3502
3507
|
t = Math.max(0, t === void 0 ? 2 : t), r ||= 0;
|
|
@@ -3646,26 +3651,26 @@ var Kt, qt = v((() => {
|
|
|
3646
3651
|
return r.pop(), t.pop(), t.concat(r);
|
|
3647
3652
|
}
|
|
3648
3653
|
})))(), 1);
|
|
3649
|
-
function
|
|
3654
|
+
function en(e, t = {}) {
|
|
3650
3655
|
t.concavity = t.concavity || Infinity;
|
|
3651
3656
|
let n = [];
|
|
3652
|
-
if (
|
|
3657
|
+
if (Bt(e, (e) => {
|
|
3653
3658
|
n.push([e[0], e[1]]);
|
|
3654
3659
|
}), !n.length) return null;
|
|
3655
|
-
let r = (0,
|
|
3656
|
-
return r.length > 3 ?
|
|
3660
|
+
let r = (0, $t.default)(n, t.concavity);
|
|
3661
|
+
return r.length > 3 ? Mt([r]) : null;
|
|
3657
3662
|
}
|
|
3658
3663
|
//#endregion
|
|
3659
3664
|
//#region node_modules/@turf/centroid/dist/esm/index.js
|
|
3660
|
-
function
|
|
3665
|
+
function tn(e, t = {}) {
|
|
3661
3666
|
let n = 0, r = 0, i = 0;
|
|
3662
|
-
return
|
|
3667
|
+
return Bt(e, function(e) {
|
|
3663
3668
|
n += e[0], r += e[1], i++;
|
|
3664
|
-
}, !0),
|
|
3669
|
+
}, !0), jt([n / i, r / i], t.properties);
|
|
3665
3670
|
}
|
|
3666
3671
|
//#endregion
|
|
3667
3672
|
//#region node_modules/@turf/invariant/dist/esm/index.js
|
|
3668
|
-
function
|
|
3673
|
+
function nn(e) {
|
|
3669
3674
|
if (!e) throw Error("coord is required");
|
|
3670
3675
|
if (!Array.isArray(e)) {
|
|
3671
3676
|
if (e.type === "Feature" && e.geometry !== null && e.geometry.type === "Point") return [...e.geometry.coordinates];
|
|
@@ -3674,7 +3679,7 @@ function tn(e) {
|
|
|
3674
3679
|
if (Array.isArray(e) && e.length >= 2 && !Array.isArray(e[0]) && !Array.isArray(e[1])) return [...e];
|
|
3675
3680
|
throw Error("coord must be GeoJSON Point or an Array of numbers");
|
|
3676
3681
|
}
|
|
3677
|
-
function
|
|
3682
|
+
function rn(e) {
|
|
3678
3683
|
if (Array.isArray(e)) return e;
|
|
3679
3684
|
if (e.type === "Feature") {
|
|
3680
3685
|
if (e.geometry !== null) return e.geometry.coordinates;
|
|
@@ -3683,23 +3688,23 @@ function nn(e) {
|
|
|
3683
3688
|
}
|
|
3684
3689
|
//#endregion
|
|
3685
3690
|
//#region node_modules/@turf/rhumb-bearing/dist/esm/index.js
|
|
3686
|
-
function
|
|
3691
|
+
function an(e, t, n = {}) {
|
|
3687
3692
|
let r;
|
|
3688
|
-
return r = n.final ?
|
|
3693
|
+
return r = n.final ? on(nn(t), nn(e)) : on(nn(e), nn(t)), r > 180 ? -(360 - r) : r;
|
|
3689
3694
|
}
|
|
3690
|
-
function
|
|
3691
|
-
let n =
|
|
3695
|
+
function on(e, t) {
|
|
3696
|
+
let n = It(e[1]), r = It(t[1]), i = It(t[0] - e[0]);
|
|
3692
3697
|
i > Math.PI && (i -= 2 * Math.PI), i < -Math.PI && (i += 2 * Math.PI);
|
|
3693
3698
|
let a = Math.log(Math.tan(r / 2 + Math.PI / 4) / Math.tan(n / 2 + Math.PI / 4));
|
|
3694
|
-
return (
|
|
3699
|
+
return (Ft(Math.atan2(i, a)) + 360) % 360;
|
|
3695
3700
|
}
|
|
3696
3701
|
//#endregion
|
|
3697
3702
|
//#region node_modules/@turf/rhumb-distance/dist/esm/index.js
|
|
3698
|
-
function
|
|
3699
|
-
let r =
|
|
3700
|
-
return i[0] += i[0] - r[0] > 180 ? -360 : r[0] - i[0] > 180 ? 360 : 0,
|
|
3703
|
+
function sn(e, t, n = {}) {
|
|
3704
|
+
let r = nn(e), i = nn(t);
|
|
3705
|
+
return i[0] += i[0] - r[0] > 180 ? -360 : r[0] - i[0] > 180 ? 360 : 0, Lt(cn(r, i), "meters", n.units);
|
|
3701
3706
|
}
|
|
3702
|
-
function
|
|
3707
|
+
function cn(e, t, n) {
|
|
3703
3708
|
n = n === void 0 ? $ : Number(n);
|
|
3704
3709
|
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;
|
|
3705
3710
|
s > Math.PI && (s -= 2 * Math.PI);
|
|
@@ -3708,37 +3713,37 @@ function sn(e, t, n) {
|
|
|
3708
3713
|
}
|
|
3709
3714
|
//#endregion
|
|
3710
3715
|
//#region node_modules/@turf/rhumb-destination/dist/esm/index.js
|
|
3711
|
-
function
|
|
3712
|
-
let i = t < 0, a =
|
|
3716
|
+
function ln(e, t, n, r = {}) {
|
|
3717
|
+
let i = t < 0, a = Lt(Math.abs(t), r.units, "meters");
|
|
3713
3718
|
i && (a = -Math.abs(a));
|
|
3714
|
-
let o =
|
|
3715
|
-
return s[0] += s[0] - o[0] > 180 ? -360 : o[0] - s[0] > 180 ? 360 : 0,
|
|
3719
|
+
let o = nn(e), s = un(o, a, n);
|
|
3720
|
+
return s[0] += s[0] - o[0] > 180 ? -360 : o[0] - s[0] > 180 ? 360 : 0, jt(s, r.properties);
|
|
3716
3721
|
}
|
|
3717
|
-
function
|
|
3722
|
+
function un(e, t, n, r) {
|
|
3718
3723
|
r = r === void 0 ? $ : Number(r);
|
|
3719
|
-
let i = t / r, a = e[0] * Math.PI / 180, o =
|
|
3724
|
+
let i = t / r, a = e[0] * Math.PI / 180, o = It(e[1]), s = It(n), c = i * Math.cos(s), l = o + c;
|
|
3720
3725
|
Math.abs(l) > Math.PI / 2 && (l = l > 0 ? Math.PI - l : -Math.PI - l);
|
|
3721
3726
|
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);
|
|
3722
3727
|
return [((a + i * Math.sin(s) / d) * 180 / Math.PI + 540) % 360 - 180, l * 180 / Math.PI];
|
|
3723
3728
|
}
|
|
3724
3729
|
//#endregion
|
|
3725
3730
|
//#region node_modules/@turf/clone/dist/esm/index.js
|
|
3726
|
-
function
|
|
3731
|
+
function dn(e) {
|
|
3727
3732
|
if (!e) throw Error("geojson is required");
|
|
3728
3733
|
switch (e.type) {
|
|
3729
|
-
case "Feature": return
|
|
3730
|
-
case "FeatureCollection": return
|
|
3734
|
+
case "Feature": return fn(e);
|
|
3735
|
+
case "FeatureCollection": return mn(e);
|
|
3731
3736
|
case "Point":
|
|
3732
3737
|
case "LineString":
|
|
3733
3738
|
case "Polygon":
|
|
3734
3739
|
case "MultiPoint":
|
|
3735
3740
|
case "MultiLineString":
|
|
3736
3741
|
case "MultiPolygon":
|
|
3737
|
-
case "GeometryCollection": return
|
|
3742
|
+
case "GeometryCollection": return hn(e);
|
|
3738
3743
|
default: throw Error("unknown GeoJSON type");
|
|
3739
3744
|
}
|
|
3740
3745
|
}
|
|
3741
|
-
function
|
|
3746
|
+
function fn(e) {
|
|
3742
3747
|
let t = { type: "Feature" };
|
|
3743
3748
|
return Object.keys(e).forEach((n) => {
|
|
3744
3749
|
switch (n) {
|
|
@@ -3747,16 +3752,16 @@ function dn(e) {
|
|
|
3747
3752
|
case "geometry": return;
|
|
3748
3753
|
default: t[n] = e[n];
|
|
3749
3754
|
}
|
|
3750
|
-
}), t.properties =
|
|
3755
|
+
}), t.properties = pn(e.properties), e.geometry == null ? t.geometry = null : t.geometry = hn(e.geometry), t;
|
|
3751
3756
|
}
|
|
3752
|
-
function
|
|
3757
|
+
function pn(e) {
|
|
3753
3758
|
let t = {};
|
|
3754
3759
|
return e && Object.keys(e).forEach((n) => {
|
|
3755
3760
|
let r = e[n];
|
|
3756
|
-
typeof r == "object" ? r === null ? t[n] = null : Array.isArray(r) ? t[n] = r.map((e) => e) : t[n] =
|
|
3761
|
+
typeof r == "object" ? r === null ? t[n] = null : Array.isArray(r) ? t[n] = r.map((e) => e) : t[n] = pn(r) : t[n] = r;
|
|
3757
3762
|
}), t;
|
|
3758
3763
|
}
|
|
3759
|
-
function
|
|
3764
|
+
function mn(e) {
|
|
3760
3765
|
let t = { type: "FeatureCollection" };
|
|
3761
3766
|
return Object.keys(e).forEach((n) => {
|
|
3762
3767
|
switch (n) {
|
|
@@ -3764,44 +3769,44 @@ function pn(e) {
|
|
|
3764
3769
|
case "features": return;
|
|
3765
3770
|
default: t[n] = e[n];
|
|
3766
3771
|
}
|
|
3767
|
-
}), t.features = e.features.map((e) =>
|
|
3772
|
+
}), t.features = e.features.map((e) => fn(e)), t;
|
|
3768
3773
|
}
|
|
3769
|
-
function
|
|
3774
|
+
function hn(e) {
|
|
3770
3775
|
let t = { type: e.type };
|
|
3771
|
-
return e.bbox && (t.bbox = e.bbox), e.type === "GeometryCollection" ? (t.geometries = e.geometries.map((e) =>
|
|
3776
|
+
return e.bbox && (t.bbox = e.bbox), e.type === "GeometryCollection" ? (t.geometries = e.geometries.map((e) => hn(e)), t) : (t.coordinates = gn(e.coordinates), t);
|
|
3772
3777
|
}
|
|
3773
|
-
function
|
|
3778
|
+
function gn(e) {
|
|
3774
3779
|
let t = e;
|
|
3775
|
-
return typeof t[0] == "object" ? t.map((e) =>
|
|
3780
|
+
return typeof t[0] == "object" ? t.map((e) => gn(e)) : t.slice();
|
|
3776
3781
|
}
|
|
3777
3782
|
//#endregion
|
|
3778
3783
|
//#region node_modules/@turf/transform-rotate/dist/esm/index.js
|
|
3779
|
-
function
|
|
3780
|
-
if (n ||= {}, !
|
|
3784
|
+
function _n(e, t, n) {
|
|
3785
|
+
if (n ||= {}, !zt(n)) throw Error("options is invalid");
|
|
3781
3786
|
let r = n.pivot, i = n.mutate;
|
|
3782
3787
|
if (!e) throw Error("geojson is required");
|
|
3783
3788
|
if (t == null || isNaN(t)) throw Error("angle is required");
|
|
3784
3789
|
if (t === 0) return e;
|
|
3785
|
-
let a = r ??
|
|
3786
|
-
return (i === !1 || i === void 0) && (e =
|
|
3787
|
-
let n =
|
|
3790
|
+
let a = r ?? tn(e);
|
|
3791
|
+
return (i === !1 || i === void 0) && (e = dn(e)), Bt(e, function(e) {
|
|
3792
|
+
let n = an(a, e) + t, r = rn(ln(a, sn(a, e), n));
|
|
3788
3793
|
e[0] = r[0], e[1] = r[1];
|
|
3789
3794
|
}), e;
|
|
3790
3795
|
}
|
|
3791
3796
|
//#endregion
|
|
3792
3797
|
//#region node_modules/@turf/bearing/dist/esm/index.js
|
|
3793
|
-
function
|
|
3794
|
-
if (n.final === !0) return
|
|
3795
|
-
let r =
|
|
3796
|
-
return
|
|
3798
|
+
function vn(e, t, n = {}) {
|
|
3799
|
+
if (n.final === !0) return yn(e, t);
|
|
3800
|
+
let r = nn(e), i = nn(t), a = It(r[0]), o = It(i[0]), s = It(r[1]), c = It(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);
|
|
3801
|
+
return Ft(Math.atan2(l, u));
|
|
3797
3802
|
}
|
|
3798
|
-
function
|
|
3799
|
-
let n =
|
|
3803
|
+
function yn(e, t) {
|
|
3804
|
+
let n = vn(t, e);
|
|
3800
3805
|
return n = (n + 180) % 360, n;
|
|
3801
3806
|
}
|
|
3802
3807
|
//#endregion
|
|
3803
3808
|
//#region node_modules/@turf/bbox/dist/esm/index.js
|
|
3804
|
-
function
|
|
3809
|
+
function bn(e, t = {}) {
|
|
3805
3810
|
if (e.bbox != null && !0 !== t.recompute) return e.bbox;
|
|
3806
3811
|
let n = [
|
|
3807
3812
|
Infinity,
|
|
@@ -3809,17 +3814,17 @@ function yn(e, t = {}) {
|
|
|
3809
3814
|
-Infinity,
|
|
3810
3815
|
-Infinity
|
|
3811
3816
|
];
|
|
3812
|
-
return
|
|
3817
|
+
return Bt(e, (e) => {
|
|
3813
3818
|
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]);
|
|
3814
3819
|
}), n;
|
|
3815
3820
|
}
|
|
3816
3821
|
//#endregion
|
|
3817
3822
|
//#region node_modules/@turf/bbox-polygon/dist/esm/index.js
|
|
3818
|
-
function
|
|
3823
|
+
function xn(e, t = {}) {
|
|
3819
3824
|
let n = Number(e[0]), r = Number(e[1]), i = Number(e[2]), a = Number(e[3]);
|
|
3820
3825
|
if (e.length === 6) throw Error("@turf/bbox-polygon does not support BBox with 6 positions");
|
|
3821
3826
|
let o = [n, r];
|
|
3822
|
-
return
|
|
3827
|
+
return Mt([[
|
|
3823
3828
|
o,
|
|
3824
3829
|
[i, r],
|
|
3825
3830
|
[i, a],
|
|
@@ -3832,20 +3837,20 @@ function bn(e, t = {}) {
|
|
|
3832
3837
|
}
|
|
3833
3838
|
//#endregion
|
|
3834
3839
|
//#region node_modules/@turf/envelope/dist/esm/index.js
|
|
3835
|
-
function
|
|
3836
|
-
return bn(
|
|
3840
|
+
function Sn(e) {
|
|
3841
|
+
return xn(bn(e));
|
|
3837
3842
|
}
|
|
3838
3843
|
//#endregion
|
|
3839
3844
|
//#region node_modules/@turf/area/dist/esm/index.js
|
|
3840
|
-
function Sn(e) {
|
|
3841
|
-
return Ht(e, (e, t) => e + Cn(t), 0);
|
|
3842
|
-
}
|
|
3843
3845
|
function Cn(e) {
|
|
3846
|
+
return Ut(e, (e, t) => e + wn(t), 0);
|
|
3847
|
+
}
|
|
3848
|
+
function wn(e) {
|
|
3844
3849
|
let t = 0, n;
|
|
3845
3850
|
switch (e.type) {
|
|
3846
|
-
case "Polygon": return
|
|
3851
|
+
case "Polygon": return Tn(e.coordinates);
|
|
3847
3852
|
case "MultiPolygon":
|
|
3848
|
-
for (n = 0; n < e.coordinates.length; n++) t +=
|
|
3853
|
+
for (n = 0; n < e.coordinates.length; n++) t += Tn(e.coordinates[n]);
|
|
3849
3854
|
return t;
|
|
3850
3855
|
case "Point":
|
|
3851
3856
|
case "MultiPoint":
|
|
@@ -3854,57 +3859,57 @@ function Cn(e) {
|
|
|
3854
3859
|
}
|
|
3855
3860
|
return 0;
|
|
3856
3861
|
}
|
|
3857
|
-
function
|
|
3862
|
+
function Tn(e) {
|
|
3858
3863
|
let t = 0;
|
|
3859
3864
|
if (e && e.length > 0) {
|
|
3860
|
-
t += Math.abs(
|
|
3861
|
-
for (let n = 1; n < e.length; n++) t -= Math.abs(
|
|
3865
|
+
t += Math.abs(On(e[0]));
|
|
3866
|
+
for (let n = 1; n < e.length; n++) t -= Math.abs(On(e[n]));
|
|
3862
3867
|
}
|
|
3863
3868
|
return t;
|
|
3864
3869
|
}
|
|
3865
|
-
var
|
|
3866
|
-
function
|
|
3870
|
+
var En = $ * $ / 2, Dn = Math.PI / 180;
|
|
3871
|
+
function On(e) {
|
|
3867
3872
|
let t = e.length - 1;
|
|
3868
3873
|
if (t <= 2) return 0;
|
|
3869
3874
|
let n = 0, r = 0;
|
|
3870
3875
|
for (; r < t;) {
|
|
3871
|
-
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] *
|
|
3876
|
+
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] * Dn, c = a[1] * Dn, l = o[0] * Dn;
|
|
3872
3877
|
n += (l - s) * Math.sin(c), r++;
|
|
3873
3878
|
}
|
|
3874
|
-
return n *
|
|
3879
|
+
return n * En;
|
|
3875
3880
|
}
|
|
3876
3881
|
//#endregion
|
|
3877
3882
|
//#region node_modules/geojson-minimum-bounding-rectangle/dist/index.js
|
|
3878
|
-
function
|
|
3879
|
-
let t =
|
|
3883
|
+
function kn(e) {
|
|
3884
|
+
let t = en(e);
|
|
3880
3885
|
if (!t) throw Error("Can't calculate smallestSurroundingRectangleByArea for given geometry");
|
|
3881
|
-
let n =
|
|
3886
|
+
let n = tn(t), r = Vt(t), i = 2 ** 53 - 1, a = null;
|
|
3882
3887
|
for (let e = 0; e < r.length - 1; e++) {
|
|
3883
|
-
let o =
|
|
3884
|
-
c < i && (i = c, a =
|
|
3888
|
+
let o = vn(r[e], r[e + 1]), s = Sn(_n(t, -1 * o, { pivot: n })), c = Cn(s);
|
|
3889
|
+
c < i && (i = c, a = _n(s, o, { pivot: n }));
|
|
3885
3890
|
}
|
|
3886
3891
|
return a;
|
|
3887
3892
|
}
|
|
3888
3893
|
//#endregion
|
|
3889
3894
|
//#region src/utils/OBB.mjs
|
|
3890
|
-
function
|
|
3895
|
+
function An(e, t) {
|
|
3891
3896
|
let n = t[0] - e[0], r = t[1] - e[1];
|
|
3892
3897
|
return Math.sqrt(n * n + r * r);
|
|
3893
3898
|
}
|
|
3894
|
-
function
|
|
3899
|
+
function jn(e) {
|
|
3895
3900
|
let t = Infinity, n = -Infinity, r = Infinity, i = -Infinity;
|
|
3896
3901
|
for (let [a, o] of e) a < t && (t = a), a > n && (n = a), o < r && (r = o), o > i && (i = o);
|
|
3897
3902
|
return [(n + t) * .5, (i + r) * .5];
|
|
3898
3903
|
}
|
|
3899
|
-
var
|
|
3904
|
+
var Mn = class t extends Dt {
|
|
3900
3905
|
getBoxMesh() {
|
|
3901
|
-
|
|
3906
|
+
Nn.identity(), Nn.setFromMatrix3(this.rotation), Nn.decompose(Ln, Pn, new e.Vector3());
|
|
3902
3907
|
let t = this.halfSize.clone().multiplyScalar(2), n = new e.Mesh(new e.BoxGeometry(t.x, t.y, t.z));
|
|
3903
|
-
return n.position.copy(this.center), n.rotation.setFromQuaternion(
|
|
3908
|
+
return n.position.copy(this.center), n.rotation.setFromQuaternion(Pn), n;
|
|
3904
3909
|
}
|
|
3905
3910
|
getBoxEdge(t = 16776960) {
|
|
3906
3911
|
let n = this.getBoxMesh();
|
|
3907
|
-
|
|
3912
|
+
Rn.setFromObject(n);
|
|
3908
3913
|
let r = new e.EdgesGeometry(n.geometry.clone().applyMatrix4(n.matrixWorld));
|
|
3909
3914
|
return new e.LineSegments(r, new e.LineBasicMaterial({
|
|
3910
3915
|
color: t,
|
|
@@ -3912,33 +3917,33 @@ var jn = class t extends Et {
|
|
|
3912
3917
|
}));
|
|
3913
3918
|
}
|
|
3914
3919
|
toJson() {
|
|
3915
|
-
return
|
|
3920
|
+
return Nn.identity(), Nn.setFromMatrix3(this.rotation), Nn.decompose(Ln, Pn, new e.Vector3()), {
|
|
3916
3921
|
size: this.halfSize.toArray(),
|
|
3917
3922
|
center: this.center.toArray(),
|
|
3918
|
-
quaternion:
|
|
3923
|
+
quaternion: Pn.toArray()
|
|
3919
3924
|
};
|
|
3920
3925
|
}
|
|
3921
3926
|
static from(n, r, i, a = new t()) {
|
|
3922
|
-
if (i instanceof e.Euler)
|
|
3923
|
-
else if (i instanceof e.Quaternion)
|
|
3927
|
+
if (i instanceof e.Euler) Pn.setFromEuler(i);
|
|
3928
|
+
else if (i instanceof e.Quaternion) Pn.copy(i);
|
|
3924
3929
|
else throw Error("传入的旋转不是欧拉角或者四元数");
|
|
3925
|
-
return
|
|
3930
|
+
return Nn.compose(r, Pn, In), a.center.copy(r), a.halfSize.copy(n.multiplyScalar(.5)), a.rotation.setFromMatrix4(Nn), a;
|
|
3926
3931
|
}
|
|
3927
3932
|
static fromByPath2D(e, n, r, i = new t()) {
|
|
3928
|
-
let a =
|
|
3933
|
+
let a = kn({
|
|
3929
3934
|
type: "Polygon",
|
|
3930
3935
|
coordinates: [e.map((e) => [e.x, e.y])]
|
|
3931
3936
|
});
|
|
3932
3937
|
if (!a) throw Error("2d obb 获取失败");
|
|
3933
|
-
let o = a.geometry.coordinates[0], s =
|
|
3934
|
-
|
|
3935
|
-
let [u, d] =
|
|
3936
|
-
return n.x = u, n.y = d, this.from(
|
|
3938
|
+
let o = a.geometry.coordinates[0], s = An(o[0], o[1]), c = An(o[1], o[2]), l = Math.atan2(o[1][1] - o[0][1], o[1][0] - o[0][0]);
|
|
3939
|
+
Ln.set(s, c, r), Fn.set(0, 0, l);
|
|
3940
|
+
let [u, d] = jn(o);
|
|
3941
|
+
return n.x = u, n.y = d, this.from(Ln, n, Fn, i);
|
|
3937
3942
|
}
|
|
3938
|
-
},
|
|
3943
|
+
}, Nn = new e.Matrix4(), Pn = new e.Quaternion(), Fn = new e.Euler(), In = new e.Vector3(1, 1, 1), Ln = new e.Vector3(), Rn = new e.Box3();
|
|
3939
3944
|
//#endregion
|
|
3940
3945
|
//#region src/pointCloudProcessing/mergeMeaning.mjs
|
|
3941
|
-
function
|
|
3946
|
+
function zn(e, t, n = .005, r = .2) {
|
|
3942
3947
|
if (!e.length || !t.length) return 0;
|
|
3943
3948
|
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)}`;
|
|
3944
3949
|
for (let e of t) {
|
|
@@ -3967,26 +3972,26 @@ function Rn(e, t, n = .005, r = .2) {
|
|
|
3967
3972
|
}
|
|
3968
3973
|
return c / e.length;
|
|
3969
3974
|
}
|
|
3970
|
-
function
|
|
3975
|
+
function Bn(e, t, n = .5) {
|
|
3971
3976
|
let r = 0, i = 0;
|
|
3972
3977
|
for (let a of e) if (t.containsPoint(a) && (r++, i = r / e.length, i > n)) break;
|
|
3973
3978
|
return i;
|
|
3974
3979
|
}
|
|
3975
|
-
function
|
|
3980
|
+
function Vn(e, t, n, r) {
|
|
3976
3981
|
if (e.intersectsOBB(t)) return !0;
|
|
3977
3982
|
{
|
|
3978
|
-
let i =
|
|
3983
|
+
let i = Un(e, r), a = Un(t, n);
|
|
3979
3984
|
if (i || a) return !0;
|
|
3980
3985
|
}
|
|
3981
3986
|
return !1;
|
|
3982
3987
|
}
|
|
3983
|
-
function
|
|
3988
|
+
function Hn(t, n) {
|
|
3984
3989
|
let r = new e.Vector3(), i = new e.Vector3();
|
|
3985
3990
|
t.getSize(r), n.getSize(i);
|
|
3986
3991
|
let a = r.x * r.y * r.z, o = i.x * i.y * i.z;
|
|
3987
3992
|
return a > o ? 1 : a < o ? -1 : 0;
|
|
3988
3993
|
}
|
|
3989
|
-
function
|
|
3994
|
+
function Un(e, t) {
|
|
3990
3995
|
let n = !0;
|
|
3991
3996
|
for (let r = 0; r < t.length; r++) if (!e.containsPoint(t[r])) {
|
|
3992
3997
|
n = !1;
|
|
@@ -3994,7 +3999,7 @@ function Hn(e, t) {
|
|
|
3994
3999
|
}
|
|
3995
4000
|
return n;
|
|
3996
4001
|
}
|
|
3997
|
-
function
|
|
4002
|
+
function Wn(e) {
|
|
3998
4003
|
if (e.length === 0) return {
|
|
3999
4004
|
x: 0,
|
|
4000
4005
|
y: 0,
|
|
@@ -4012,25 +4017,25 @@ function Un(e) {
|
|
|
4012
4017
|
h: r - i
|
|
4013
4018
|
};
|
|
4014
4019
|
}
|
|
4015
|
-
function
|
|
4020
|
+
function Gn(t, n, r, i) {
|
|
4016
4021
|
let a = [];
|
|
4017
4022
|
for (let n = 0; n < t.length; n++) a.push(new e.Vector3(t[n][0], t[n][1], 0));
|
|
4018
4023
|
if (a.length == 0) return null;
|
|
4019
|
-
let o =
|
|
4024
|
+
let o = Mn.fromByPath2D(a, n, r);
|
|
4020
4025
|
return o.center.z = i, o;
|
|
4021
4026
|
}
|
|
4022
|
-
var
|
|
4027
|
+
var Kn = (t) => {
|
|
4023
4028
|
if (t.length == 0) return [];
|
|
4024
4029
|
let n = [], r = /* @__PURE__ */ new Map();
|
|
4025
4030
|
for (let i = 0; i < t.length; i++) {
|
|
4026
|
-
let a = t[i].points.map((e) => [e.x, e.y]), o =
|
|
4027
|
-
|
|
4028
|
-
let
|
|
4029
|
-
if (
|
|
4030
|
-
let
|
|
4031
|
-
for (let n = 0; n < t[i].points.length; n++)
|
|
4032
|
-
let
|
|
4033
|
-
if (
|
|
4031
|
+
let a = t[i].points.map((e) => [e.x, e.y]), o = t[i].obj_id;
|
|
4032
|
+
o = o.replace(/calcony railing/g, "balcony railing").replace(/glass balcony railing/g, "balcony railing").replace(/metal balcony railing/g, "balcony railing").replace(/temporary construction guardrail/g, "balcony railing").replace(/the floor of the house/g, "floor").replace(/the outdoor floor/g, "floor"), o.split("_").slice(1, 3).join("_").split(".")[0].split("_")[0];
|
|
4033
|
+
let s = o.indexOf("_") + 1, c = o.lastIndexOf("_"), l = o.substring(s, c);
|
|
4034
|
+
if (l === "wall") continue;
|
|
4035
|
+
let u = [];
|
|
4036
|
+
for (let n = 0; n < t[i].points.length; n++) u.push(new e.Vector3(t[i].points[n].x, t[i].points[n].y, t[i].points[n].z));
|
|
4037
|
+
let d = -99999;
|
|
4038
|
+
if (l === "floor") {
|
|
4034
4039
|
let n = /* @__PURE__ */ new Map();
|
|
4035
4040
|
for (let e = 0; e < t[i].points.length; e++) {
|
|
4036
4041
|
let r = t[i].points[e].z;
|
|
@@ -4043,40 +4048,40 @@ var Gn = (t) => {
|
|
|
4043
4048
|
});
|
|
4044
4049
|
}
|
|
4045
4050
|
let r = [...n.entries()].reduce((e, t) => t[1].num > e[1].num ? t : e);
|
|
4046
|
-
a = [], a = r[1].points.map((e) => [e.x, e.y]),
|
|
4051
|
+
a = [], a = r[1].points.map((e) => [e.x, e.y]), u = [], u = r[1].points.map((t) => new e.Vector3(t.x, t.y, t.z)), d = r[0];
|
|
4047
4052
|
}
|
|
4048
|
-
let p = {
|
|
4049
|
-
points:
|
|
4050
|
-
path:
|
|
4051
|
-
h:
|
|
4052
|
-
minz:
|
|
4053
|
-
maxz:
|
|
4053
|
+
let f = Wn(u), p = {
|
|
4054
|
+
points: u,
|
|
4055
|
+
path: gt(a),
|
|
4056
|
+
h: f.h,
|
|
4057
|
+
minz: f.minz,
|
|
4058
|
+
maxz: f.maxz,
|
|
4054
4059
|
center: {
|
|
4055
|
-
x:
|
|
4056
|
-
y:
|
|
4057
|
-
z:
|
|
4060
|
+
x: f.x,
|
|
4061
|
+
y: f.y,
|
|
4062
|
+
z: f.z
|
|
4058
4063
|
},
|
|
4059
4064
|
obj_id: t[i].obj_id,
|
|
4060
|
-
type:
|
|
4065
|
+
type: l,
|
|
4061
4066
|
averagePz: t[i].averagePz,
|
|
4062
4067
|
obb: null,
|
|
4063
4068
|
isDel: !1,
|
|
4064
|
-
obj_id:
|
|
4069
|
+
obj_id: o,
|
|
4065
4070
|
positionArr: [t[i].position]
|
|
4066
4071
|
};
|
|
4067
|
-
if (p.obb =
|
|
4072
|
+
if (p.obb = Gn(p.path, p.center, p.h, (p.maxz + p.minz) / 2), p.obb == null) continue;
|
|
4068
4073
|
let m = -1;
|
|
4069
|
-
for (let e = 0; e < n.length; e++) if (n[e].type ==
|
|
4074
|
+
for (let e = 0; e < n.length; e++) if (n[e].type == l) {
|
|
4070
4075
|
m = e;
|
|
4071
4076
|
break;
|
|
4072
4077
|
}
|
|
4073
4078
|
if (m == -1 ? n.push({
|
|
4074
|
-
type:
|
|
4079
|
+
type: l,
|
|
4075
4080
|
array: [p]
|
|
4076
|
-
}) : n[m].array.push(p),
|
|
4077
|
-
let e = r.get(
|
|
4078
|
-
e.num += p.points.length, e.datas.push(p), r.set(
|
|
4079
|
-
} else r.set(
|
|
4081
|
+
}) : n[m].array.push(p), l == "floor" && d != -99999) if (r.has(d)) {
|
|
4082
|
+
let e = r.get(d);
|
|
4083
|
+
e.num += p.points.length, e.datas.push(p), r.set(d, e);
|
|
4084
|
+
} else r.set(d, {
|
|
4080
4085
|
num: p.points.length,
|
|
4081
4086
|
datas: [p]
|
|
4082
4087
|
});
|
|
@@ -4101,13 +4106,13 @@ var Gn = (t) => {
|
|
|
4101
4106
|
obb: t[e].obb.clone()
|
|
4102
4107
|
};
|
|
4103
4108
|
for (let i = e + 1; i < t.length; i++) if (!(t[i].obb == null || r.includes(i)) && n.obb.intersectsOBB(t[i].obb)) {
|
|
4104
|
-
r.push(i), n.points.push(...t[i].points), n.path =
|
|
4105
|
-
let a =
|
|
4109
|
+
r.push(i), n.points.push(...t[i].points), n.path = gt(n.points.map((e) => [e.x, e.y]));
|
|
4110
|
+
let a = Wn(n.points);
|
|
4106
4111
|
n.h = a.h, n.minz = a.minz, n.maxz = a.maxz, n.center = {
|
|
4107
4112
|
x: a.x,
|
|
4108
4113
|
y: a.y,
|
|
4109
4114
|
z: a.z
|
|
4110
|
-
}, n.obb =
|
|
4115
|
+
}, n.obb = Gn(n.path, n.center, n.h, (n.maxz + n.minz) / 2), n.positionArr.push(...t[i].positionArr), i = e;
|
|
4111
4116
|
}
|
|
4112
4117
|
n.path.length > t[e].path.length && (r.push(e), i.push(n));
|
|
4113
4118
|
}
|
|
@@ -4144,54 +4149,54 @@ var Gn = (t) => {
|
|
|
4144
4149
|
if (l[e].isDel) continue;
|
|
4145
4150
|
let n = l[e].obb, u = l[e].minz;
|
|
4146
4151
|
if (l[e].maxz, o.intersectsOBB(n)) {
|
|
4147
|
-
|
|
4148
|
-
let d =
|
|
4152
|
+
Bn(l[e].points, o);
|
|
4153
|
+
let d = Bn(i[a].points, n), f = Hn(o, n);
|
|
4149
4154
|
if (d >= .3 && f == -1) {
|
|
4150
4155
|
i[a].isDel = !0;
|
|
4151
4156
|
break;
|
|
4152
4157
|
}
|
|
4153
4158
|
if (r !== "wall" && r !== "floor" && r !== "roof") {
|
|
4154
4159
|
if (r === "window") {
|
|
4155
|
-
if (t === "balcony railing" &&
|
|
4160
|
+
if (t === "balcony railing" && Un(o, l[e].points)) {
|
|
4156
4161
|
l[e].isDel = !0;
|
|
4157
4162
|
continue;
|
|
4158
4163
|
}
|
|
4159
|
-
if (t === "balcony railing" &&
|
|
4164
|
+
if (t === "balcony railing" && Un(n, i[a].points)) {
|
|
4160
4165
|
i[a].isDel = !0;
|
|
4161
4166
|
break;
|
|
4162
4167
|
}
|
|
4163
|
-
if (t === "balcony railing" &&
|
|
4168
|
+
if (t === "balcony railing" && Vn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(u - c) > .3)) {
|
|
4164
4169
|
l[e].isDel = !0;
|
|
4165
4170
|
continue;
|
|
4166
4171
|
}
|
|
4167
4172
|
} else if (r === "balcony railing") {
|
|
4168
|
-
if (t === "window" &&
|
|
4173
|
+
if (t === "window" && Un(o, l[e].points)) {
|
|
4169
4174
|
l[e].isDel = !0;
|
|
4170
4175
|
continue;
|
|
4171
4176
|
}
|
|
4172
|
-
if (t === "window" &&
|
|
4177
|
+
if (t === "window" && Un(n, i[a].points)) {
|
|
4173
4178
|
i[a].isDel = !0;
|
|
4174
4179
|
break;
|
|
4175
4180
|
}
|
|
4176
|
-
if (t === "window" &&
|
|
4181
|
+
if (t === "window" && Vn(o, n, i[a].points, l[e].points) && (Math.abs(s - u) < .1 || Math.abs(s - c) > .3)) {
|
|
4177
4182
|
i[a].isDel = !0;
|
|
4178
4183
|
break;
|
|
4179
4184
|
}
|
|
4180
4185
|
}
|
|
4181
4186
|
let d = !1, f = [], p = [], m = i[a].points, h = l[e].points;
|
|
4182
|
-
if (m.length > h.length ? (d = !0, f = m, p = h) : (f = h, p = m),
|
|
4187
|
+
if (m.length > h.length ? (d = !0, f = m, p = h) : (f = h, p = m), zn(p, f, .03, .5) > .5) if (d) l[e].isDel = !0;
|
|
4183
4188
|
else {
|
|
4184
4189
|
i[a].isDel = !0;
|
|
4185
4190
|
break;
|
|
4186
4191
|
}
|
|
4187
|
-
else if (
|
|
4188
|
-
let s =
|
|
4192
|
+
else if (Vn(o, n)) {
|
|
4193
|
+
let s = Hn(o, n);
|
|
4189
4194
|
if (s === 1 || s === 0) {
|
|
4190
4195
|
if (t === "switch") continue;
|
|
4191
|
-
|
|
4196
|
+
Bn(p, o) >= .5 && (l[e].isDel = !0);
|
|
4192
4197
|
} else {
|
|
4193
4198
|
if (r === "switch") continue;
|
|
4194
|
-
if (
|
|
4199
|
+
if (Bn(p, n) >= .5) {
|
|
4195
4200
|
i[a].isDel = !0;
|
|
4196
4201
|
break;
|
|
4197
4202
|
}
|
|
@@ -4220,7 +4225,7 @@ var Gn = (t) => {
|
|
|
4220
4225
|
let n = new e.Vector3();
|
|
4221
4226
|
i[t].obb.getSize(n), (n.x < .1 || n.y < .1) && (i[t].isDel = !0);
|
|
4222
4227
|
}
|
|
4223
|
-
r === "balcony railing" && (Math.abs(n - a) < .4 && (i[t].isDel = !0), (a < s && Math.abs(a - s) > 1 || a > s && Math.abs(a - s) > 1) && (i[t].isDel = !0), n < s && (i[t].isDel = !0)), r === "people" && (Math.abs(n - a) < 1 && (i[t].isDel = !0), a > s && a - s > .3 && (i[t].isDel = !0), n < s && (i[t].isDel = !0));
|
|
4228
|
+
r === "balcony railing" && (Math.abs(n - a) < .4 && (i[t].isDel = !0), (a < s && Math.abs(a - s) > 1 || a > s && Math.abs(a - s) > 1) && (i[t].isDel = !0), n < s && (i[t].isDel = !0)), r === "people" && (Math.abs(n - a) < 1 && (i[t].isDel = !0), a > s && a - s > .3 && (i[t].isDel = !0), n < s && (i[t].isDel = !0)), r === "floor" && i[t].points.length < 500 && (i[t].isDel = !0);
|
|
4224
4229
|
}
|
|
4225
4230
|
}
|
|
4226
4231
|
for (let e = 0; e < n.length; e++) n[e].array = n[e].array.filter((e) => !e.isDel);
|
|
@@ -4245,4 +4250,4 @@ var Gn = (t) => {
|
|
|
4245
4250
|
return i;
|
|
4246
4251
|
};
|
|
4247
4252
|
//#endregion
|
|
4248
|
-
export { z as classifySegments,
|
|
4253
|
+
export { z as classifySegments, ge as getAllGeometry, Oe as getBeamLine, Ae as getColLine, ke as getMainBeamLine, Kn as getMergeMeaning, I as getParallelism, re as getPointCloudMinMax, te as getPointCoverageOnQuad, j as isParallel, L as perpendicularInfo, ae as removeNoisePoints, O as segmentsIntersect2D, _e as updateStEdPoint, De as usegetBeamLine };
|