rm-graphical-computing-node 1.0.96 → 1.0.97
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.mjs +88 -82
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9157,6 +9157,69 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9157
9157
|
newData.push(...mergeData);
|
|
9158
9158
|
pcdPointsArr[i].array = newData;
|
|
9159
9159
|
}
|
|
9160
|
+
if (pointCloudCluster != null) {
|
|
9161
|
+
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9162
|
+
let type = pcdPointsArr[i].type;
|
|
9163
|
+
if (type == "floor") continue;
|
|
9164
|
+
let array = pcdPointsArr[i].array;
|
|
9165
|
+
let delArray = /* @__PURE__ */ new Set();
|
|
9166
|
+
let newArray = [];
|
|
9167
|
+
for (let j = 0; j < array.length; j++) {
|
|
9168
|
+
if (delArray.has(j)) continue;
|
|
9169
|
+
let points = array[j].points;
|
|
9170
|
+
let obj_id = array[j].obj_id;
|
|
9171
|
+
let type2 = array[j].type;
|
|
9172
|
+
let averagePz3 = array[j].averagePz;
|
|
9173
|
+
let positionArr = array[j].positionArr;
|
|
9174
|
+
let isStaircaseBalconyRailing = array[j].isStaircaseBalconyRailing;
|
|
9175
|
+
if (points.length < 50)
|
|
9176
|
+
continue;
|
|
9177
|
+
let clusterResult = pointCloudCluster([points], {
|
|
9178
|
+
tolerance: tolerancePointCloudCluster,
|
|
9179
|
+
minClusterSize: 50,
|
|
9180
|
+
maxClusterSize: 1e7,
|
|
9181
|
+
threadCount: 1
|
|
9182
|
+
});
|
|
9183
|
+
let beforeLength = newArray.length;
|
|
9184
|
+
if (clusterResult.length > 0 && clusterResult[0].length > 1) {
|
|
9185
|
+
for (const cluster of clusterResult[0]) {
|
|
9186
|
+
if (cluster.length < 50) continue;
|
|
9187
|
+
const newOriginalPoints = cluster.map((i2) => points[i2]);
|
|
9188
|
+
const centerData = getCenterAndPointHeight(newOriginalPoints);
|
|
9189
|
+
let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
|
|
9190
|
+
const data = {
|
|
9191
|
+
points: newOriginalPoints,
|
|
9192
|
+
path: computeContour(pathPoints),
|
|
9193
|
+
h: centerData.h,
|
|
9194
|
+
minz: centerData.minz,
|
|
9195
|
+
maxz: centerData.maxz,
|
|
9196
|
+
center: { x: centerData.x, y: centerData.y, z: centerData.z },
|
|
9197
|
+
type: type2,
|
|
9198
|
+
averagePz: averagePz3,
|
|
9199
|
+
obb: null,
|
|
9200
|
+
obj_id,
|
|
9201
|
+
positionArr,
|
|
9202
|
+
isStaircaseBalconyRailing
|
|
9203
|
+
};
|
|
9204
|
+
data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
|
|
9205
|
+
if (data.obb == null) continue;
|
|
9206
|
+
newArray.push(data);
|
|
9207
|
+
}
|
|
9208
|
+
}
|
|
9209
|
+
if (newArray.length != beforeLength) {
|
|
9210
|
+
delArray.add(j);
|
|
9211
|
+
}
|
|
9212
|
+
}
|
|
9213
|
+
if (delArray.size > 0) {
|
|
9214
|
+
for (let j = 0; j < array.length; j++) {
|
|
9215
|
+
if (!delArray.has(j)) {
|
|
9216
|
+
newArray.push(array[j]);
|
|
9217
|
+
}
|
|
9218
|
+
}
|
|
9219
|
+
pcdPointsArr[i].array = newArray;
|
|
9220
|
+
}
|
|
9221
|
+
}
|
|
9222
|
+
}
|
|
9160
9223
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9161
9224
|
const type1 = pcdPointsArr[i].type;
|
|
9162
9225
|
if (type1 === "people" || type1 === "floor")
|
|
@@ -9290,17 +9353,36 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9290
9353
|
break;
|
|
9291
9354
|
}
|
|
9292
9355
|
} else {
|
|
9356
|
+
const ratio2 = calculateClosePointRatioWithGrid2(array2[k].points, array1[e].points, 0.03, 0.3);
|
|
9357
|
+
if (ratio2 > 0.3) {
|
|
9358
|
+
if (containsObbPoints(obb1, array2[k].points)) {
|
|
9359
|
+
array2[k].isDel = true;
|
|
9360
|
+
continue;
|
|
9361
|
+
}
|
|
9362
|
+
if (containsObbPoints(obb2, array1[e].points)) {
|
|
9363
|
+
array2[k].isDel = true;
|
|
9364
|
+
continue;
|
|
9365
|
+
}
|
|
9366
|
+
if (obb1.intersectsOBB(obb2)) {
|
|
9367
|
+
array2[k].isDel = true;
|
|
9368
|
+
continue;
|
|
9369
|
+
}
|
|
9370
|
+
}
|
|
9371
|
+
}
|
|
9372
|
+
} else if (type2 === "door") {
|
|
9373
|
+
const ratio2 = calculateClosePointRatioWithGrid2(array1[e].points, array2[k].points, 0.03, 0.3);
|
|
9374
|
+
if (ratio2 > 0.3) {
|
|
9293
9375
|
if (containsObbPoints(obb1, array2[k].points)) {
|
|
9294
|
-
|
|
9295
|
-
|
|
9376
|
+
array1[e].isDel = true;
|
|
9377
|
+
break;
|
|
9296
9378
|
}
|
|
9297
9379
|
if (containsObbPoints(obb2, array1[e].points)) {
|
|
9298
|
-
|
|
9299
|
-
|
|
9380
|
+
array1[e].isDel = true;
|
|
9381
|
+
break;
|
|
9300
9382
|
}
|
|
9301
9383
|
if (obb1.intersectsOBB(obb2)) {
|
|
9302
|
-
|
|
9303
|
-
|
|
9384
|
+
array1[e].isDel = true;
|
|
9385
|
+
break;
|
|
9304
9386
|
}
|
|
9305
9387
|
}
|
|
9306
9388
|
} else if (type1 === "window sill") {
|
|
@@ -9356,19 +9438,6 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9356
9438
|
if (type2 === "window sill" && obb1.intersectsOBB(obb2)) {
|
|
9357
9439
|
continue;
|
|
9358
9440
|
}
|
|
9359
|
-
} else if (type2 === "door") {
|
|
9360
|
-
if (containsObbPoints(obb1, array2[k].points)) {
|
|
9361
|
-
array1[e].isDel = true;
|
|
9362
|
-
break;
|
|
9363
|
-
}
|
|
9364
|
-
if (containsObbPoints(obb2, array1[e].points)) {
|
|
9365
|
-
array1[e].isDel = true;
|
|
9366
|
-
break;
|
|
9367
|
-
}
|
|
9368
|
-
if (obb1.intersectsOBB(obb2)) {
|
|
9369
|
-
array1[e].isDel = true;
|
|
9370
|
-
break;
|
|
9371
|
-
}
|
|
9372
9441
|
}
|
|
9373
9442
|
let isMax = false;
|
|
9374
9443
|
let majorPoints = [];
|
|
@@ -9503,69 +9572,6 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
|
|
|
9503
9572
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9504
9573
|
pcdPointsArr[i].array = pcdPointsArr[i].array.filter((item) => !item.isDel);
|
|
9505
9574
|
}
|
|
9506
|
-
if (pointCloudCluster != null) {
|
|
9507
|
-
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9508
|
-
let type = pcdPointsArr[i].type;
|
|
9509
|
-
if (type == "floor") continue;
|
|
9510
|
-
let array = pcdPointsArr[i].array;
|
|
9511
|
-
let delArray = /* @__PURE__ */ new Set();
|
|
9512
|
-
let newArray = [];
|
|
9513
|
-
for (let j = 0; j < array.length; j++) {
|
|
9514
|
-
if (delArray.has(j)) continue;
|
|
9515
|
-
let points = array[j].points;
|
|
9516
|
-
let obj_id = array[j].obj_id;
|
|
9517
|
-
let type2 = array[j].type;
|
|
9518
|
-
let averagePz3 = array[j].averagePz;
|
|
9519
|
-
let positionArr = array[j].positionArr;
|
|
9520
|
-
let isStaircaseBalconyRailing = array[j].isStaircaseBalconyRailing;
|
|
9521
|
-
if (points.length < 50)
|
|
9522
|
-
continue;
|
|
9523
|
-
let clusterResult = pointCloudCluster([points], {
|
|
9524
|
-
tolerance: tolerancePointCloudCluster,
|
|
9525
|
-
minClusterSize: 50,
|
|
9526
|
-
maxClusterSize: 1e7,
|
|
9527
|
-
threadCount: 1
|
|
9528
|
-
});
|
|
9529
|
-
let beforeLength = newArray.length;
|
|
9530
|
-
if (clusterResult.length > 0 && clusterResult[0].length > 1) {
|
|
9531
|
-
for (const cluster of clusterResult[0]) {
|
|
9532
|
-
if (cluster.length < 50) continue;
|
|
9533
|
-
const newOriginalPoints = cluster.map((i2) => points[i2]);
|
|
9534
|
-
const centerData = getCenterAndPointHeight(newOriginalPoints);
|
|
9535
|
-
let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
|
|
9536
|
-
const data = {
|
|
9537
|
-
points: newOriginalPoints,
|
|
9538
|
-
path: computeContour(pathPoints),
|
|
9539
|
-
h: centerData.h,
|
|
9540
|
-
minz: centerData.minz,
|
|
9541
|
-
maxz: centerData.maxz,
|
|
9542
|
-
center: { x: centerData.x, y: centerData.y, z: centerData.z },
|
|
9543
|
-
type: type2,
|
|
9544
|
-
averagePz: averagePz3,
|
|
9545
|
-
obb: null,
|
|
9546
|
-
obj_id,
|
|
9547
|
-
positionArr,
|
|
9548
|
-
isStaircaseBalconyRailing
|
|
9549
|
-
};
|
|
9550
|
-
data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
|
|
9551
|
-
if (data.obb == null) continue;
|
|
9552
|
-
newArray.push(data);
|
|
9553
|
-
}
|
|
9554
|
-
}
|
|
9555
|
-
if (newArray.length != beforeLength) {
|
|
9556
|
-
delArray.add(j);
|
|
9557
|
-
}
|
|
9558
|
-
}
|
|
9559
|
-
if (delArray.size > 0) {
|
|
9560
|
-
for (let j = 0; j < array.length; j++) {
|
|
9561
|
-
if (!delArray.has(j)) {
|
|
9562
|
-
newArray.push(array[j]);
|
|
9563
|
-
}
|
|
9564
|
-
}
|
|
9565
|
-
pcdPointsArr[i].array = newArray;
|
|
9566
|
-
}
|
|
9567
|
-
}
|
|
9568
|
-
}
|
|
9569
9575
|
const retPcdPointArr = [];
|
|
9570
9576
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9571
9577
|
const array = pcdPointsArr[i].array;
|