rm-graphical-computing-node 1.0.171 → 1.0.172
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 +78 -15
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -14128,7 +14128,7 @@ var drawStaircase = (pcdPointsArr, scene) => {
|
|
|
14128
14128
|
}
|
|
14129
14129
|
return pointCloudGroup;
|
|
14130
14130
|
};
|
|
14131
|
-
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.
|
|
14131
|
+
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.2, wallLinesDelPs = 0.2) => {
|
|
14132
14132
|
if (allProjectionResults.length == 0) return [];
|
|
14133
14133
|
if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
|
|
14134
14134
|
const pcdPointsArr = [];
|
|
@@ -14136,6 +14136,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14136
14136
|
const CELL = 0.1;
|
|
14137
14137
|
const grid = /* @__PURE__ */ new Map();
|
|
14138
14138
|
const rectRegions = [];
|
|
14139
|
+
let isTrueType = ["floor", "Staircase", "window", "metal framing of interior glass partitions", "door", "balcony railing"];
|
|
14139
14140
|
if (wallLines) {
|
|
14140
14141
|
for (const line2 of wallLines) {
|
|
14141
14142
|
for (const p2 of line2.originalPoints) {
|
|
@@ -14180,12 +14181,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14180
14181
|
let threePoints = [];
|
|
14181
14182
|
let threePointsStr = [];
|
|
14182
14183
|
for (let u4 = 0; u4 < allProjectionResults[i].points.length; u4++) {
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14184
|
+
if (allProjectionResults[i].points[u4].z > averagePz2 && allProjectionResults[i].points[u4].z - averagePz2 > 0.1 || isTrueType.includes(word)) {
|
|
14185
|
+
threePoints.push(new THREE8.Vector3(
|
|
14186
|
+
allProjectionResults[i].points[u4].x,
|
|
14187
|
+
allProjectionResults[i].points[u4].y,
|
|
14188
|
+
allProjectionResults[i].points[u4].z
|
|
14189
|
+
));
|
|
14190
|
+
threePointsStr.push(`${allProjectionResults[i].points[u4].x},${allProjectionResults[i].points[u4].y},${allProjectionResults[i].points[u4].z}`);
|
|
14191
|
+
}
|
|
14189
14192
|
}
|
|
14190
14193
|
if (wallLines) {
|
|
14191
14194
|
if (wallVerifyType.type1 && wallVerifyType.type1.length && wallVerifyType.type1.includes(word)) {
|
|
@@ -14293,6 +14296,72 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14293
14296
|
}
|
|
14294
14297
|
}
|
|
14295
14298
|
}
|
|
14299
|
+
if (pointCloudCluster != null) {
|
|
14300
|
+
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
14301
|
+
let type = pcdPointsArr[i].type;
|
|
14302
|
+
if (type != "window") continue;
|
|
14303
|
+
let array = pcdPointsArr[i].array;
|
|
14304
|
+
let delArray = /* @__PURE__ */ new Set();
|
|
14305
|
+
let newArray = [];
|
|
14306
|
+
for (let j = 0; j < array.length; j++) {
|
|
14307
|
+
if (delArray.has(j)) continue;
|
|
14308
|
+
let points = array[j].points;
|
|
14309
|
+
let obj_id = array[j].obj_id;
|
|
14310
|
+
let type2 = array[j].type;
|
|
14311
|
+
let averagePz3 = array[j].averagePz;
|
|
14312
|
+
let positionArr = array[j].positionArr;
|
|
14313
|
+
let isStaircaseBalconyRailing = array[j].isStaircaseBalconyRailing;
|
|
14314
|
+
if (points.length < 50)
|
|
14315
|
+
continue;
|
|
14316
|
+
let clusterResult = pointCloudCluster([points], {
|
|
14317
|
+
tolerance: tolerancePointCloudCluster,
|
|
14318
|
+
minClusterSize: 20,
|
|
14319
|
+
maxClusterSize: 1e7,
|
|
14320
|
+
threadCount: 1
|
|
14321
|
+
});
|
|
14322
|
+
let beforeLength = newArray.length;
|
|
14323
|
+
if (clusterResult.length > 0 && clusterResult[0].length > 1) {
|
|
14324
|
+
let add = 1;
|
|
14325
|
+
for (const cluster of clusterResult[0]) {
|
|
14326
|
+
if (cluster.length < 50) continue;
|
|
14327
|
+
const newOriginalPoints = cluster.map((i2) => points[i2]);
|
|
14328
|
+
const centerData = getCenterAndPointHeight(newOriginalPoints);
|
|
14329
|
+
let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
|
|
14330
|
+
const data = {
|
|
14331
|
+
points: newOriginalPoints,
|
|
14332
|
+
path: computeContour(pathPoints),
|
|
14333
|
+
h: centerData.h,
|
|
14334
|
+
minz: centerData.minz,
|
|
14335
|
+
maxz: centerData.maxz,
|
|
14336
|
+
center: { x: centerData.x, y: centerData.y, z: centerData.z },
|
|
14337
|
+
type: type2,
|
|
14338
|
+
averagePz: averagePz3,
|
|
14339
|
+
obb: null,
|
|
14340
|
+
obj_id: obj_id + `_${add}`,
|
|
14341
|
+
positionArr,
|
|
14342
|
+
isStaircaseBalconyRailing,
|
|
14343
|
+
mapPosition: array[j]?.mapPosition
|
|
14344
|
+
};
|
|
14345
|
+
data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
|
|
14346
|
+
if (data.obb == null) continue;
|
|
14347
|
+
newArray.push(data);
|
|
14348
|
+
add++;
|
|
14349
|
+
}
|
|
14350
|
+
}
|
|
14351
|
+
if (newArray.length != beforeLength) {
|
|
14352
|
+
delArray.add(j);
|
|
14353
|
+
}
|
|
14354
|
+
}
|
|
14355
|
+
if (delArray.size > 0) {
|
|
14356
|
+
for (let j = 0; j < array.length; j++) {
|
|
14357
|
+
if (!delArray.has(j)) {
|
|
14358
|
+
newArray.push(array[j]);
|
|
14359
|
+
}
|
|
14360
|
+
}
|
|
14361
|
+
pcdPointsArr[i].array = newArray;
|
|
14362
|
+
}
|
|
14363
|
+
}
|
|
14364
|
+
}
|
|
14296
14365
|
function appendPcdObj(targetType, sourceType) {
|
|
14297
14366
|
const targetData = pcdPointsArr.find((item) => item.type == targetType);
|
|
14298
14367
|
const sourceData = pcdPointsArr.find((item) => item.type == sourceType);
|
|
@@ -14453,9 +14522,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14453
14522
|
delData.add(k);
|
|
14454
14523
|
let threePoints = [];
|
|
14455
14524
|
let threePointsStr = [];
|
|
14456
|
-
let isTrueType = cloneData.type == "floor" || cloneData.type == "Staircase" || cloneData.type == "window" || cloneData.type == "metal framing of interior glass partitions" || cloneData.type == "door" || cloneData.type == "balcony railing";
|
|
14457
14525
|
for (let m = 0; m < array[k].points.length; m++) {
|
|
14458
|
-
if (array[k].points[m].z > averagePz2 && array[k].points[m].z - averagePz2 > 0.1 || isTrueType) {
|
|
14526
|
+
if (array[k].points[m].z > averagePz2 && array[k].points[m].z - averagePz2 > 0.1 || isTrueType.includes(cloneData.type)) {
|
|
14459
14527
|
cloneData.points.push(array[k].points[m]);
|
|
14460
14528
|
threePoints.push(array[k].points[m]);
|
|
14461
14529
|
threePointsStr.push(`${array[k].points[m].x},${array[k].points[m].y},${array[k].points[m].z}`);
|
|
@@ -14682,7 +14750,7 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14682
14750
|
for (let k = 0; k < newnewData.length; k++) {
|
|
14683
14751
|
if (newnewData[k].obb == null || delData.has(k) || j == k)
|
|
14684
14752
|
continue;
|
|
14685
|
-
let tol = 0.
|
|
14753
|
+
let tol = 0.35;
|
|
14686
14754
|
let boxVecK = getObbLongSideDirection(newnewData[k].obb);
|
|
14687
14755
|
let obbPointsClone = getOBBPoints(cloneData.obb);
|
|
14688
14756
|
let polygonK = newnewData[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
|
|
@@ -18462,11 +18530,6 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
18462
18530
|
lines[findDoorIndexs[j]].windowData = savedata2;
|
|
18463
18531
|
}
|
|
18464
18532
|
}
|
|
18465
|
-
for (let i = 0; i < lines.length; i++) {
|
|
18466
|
-
const line2 = lines[i];
|
|
18467
|
-
line2.originalPoints = lineReader.getOriginalPointsById(line2.id);
|
|
18468
|
-
line2.checkResults = lineReader.getLineCheckReultsById(line2.id);
|
|
18469
|
-
}
|
|
18470
18533
|
return { lines, pcdData };
|
|
18471
18534
|
};
|
|
18472
18535
|
var checkWindowAndDoorIsTrue = async (lines, runDataList, collectDataPath, pointCloudCluster = null) => {
|