rm-graphical-computing-node 1.0.166 → 1.0.168
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 +70 -4
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8279,7 +8279,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
8279
8279
|
let doorBeamDataIndex = [];
|
|
8280
8280
|
let findDoorIndexs = [];
|
|
8281
8281
|
let allDoorLines1 = [];
|
|
8282
|
-
let nearDist = 0.
|
|
8282
|
+
let nearDist = 0.15;
|
|
8283
|
+
let nearDist1 = 0.29;
|
|
8283
8284
|
const doorAndDoorFrameDatas = [...doorDatas];
|
|
8284
8285
|
doorAndDoorFrameDatas.push(...doorFrame);
|
|
8285
8286
|
doorAndDoorFrameDatas.push(...metalFraming);
|
|
@@ -9666,7 +9667,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
9666
9667
|
let ptNear = doorSt.distanceTo(beamSt) > doorEd.distanceTo(beamSt) ? doorEd : doorSt;
|
|
9667
9668
|
let dist11 = ptNear.distanceTo(beamSt);
|
|
9668
9669
|
let dist22 = ptNear.distanceTo(beamEd);
|
|
9669
|
-
let isNear = dist11 <
|
|
9670
|
+
let isNear = dist11 < nearDist1 || dist22 < nearDist1;
|
|
9670
9671
|
if (isNear && isDoorParBeam && !isDoorParBeam.isParallel) {
|
|
9671
9672
|
let nearDoorDist1 = doorSt.distanceTo(beamSt);
|
|
9672
9673
|
let nearDoorDist2 = doorSt.distanceTo(beamEd);
|
|
@@ -9686,7 +9687,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
9686
9687
|
let isTmpInsert = segmentsIntersect2D(beamSt, beamEd, newBeamStOther, newBeamEdOther);
|
|
9687
9688
|
let isInside = true;
|
|
9688
9689
|
if (isTmpInsert != null) {
|
|
9689
|
-
isInside = isTmpInsert.point.distanceTo(
|
|
9690
|
+
isInside = isTmpInsert.point.distanceTo(ptNear) < nearDist1;
|
|
9690
9691
|
}
|
|
9691
9692
|
if ((isP && isP.angle > 85 || isPP && isPP.type == "collinear_gap") && isInside) {
|
|
9692
9693
|
let line3 = new THREE5.Line3(beamSt, beamEd);
|
|
@@ -9740,6 +9741,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
9740
9741
|
}
|
|
9741
9742
|
if (isOverlap)
|
|
9742
9743
|
continue;
|
|
9744
|
+
let isPPPPP = getParallelism(doorSt, doorEd, doorStartPt, doorEndPt);
|
|
9745
|
+
if (isPPPPP && (isPPPPP.isParallel || isPPPPP.angleDeg > 90 || isPPPPP.angleDeg < 20))
|
|
9746
|
+
continue;
|
|
9743
9747
|
allDoorLines.push({
|
|
9744
9748
|
start: doorStartPt,
|
|
9745
9749
|
end: doorEndPt
|
|
@@ -14124,7 +14128,7 @@ var drawStaircase = (pcdPointsArr, scene) => {
|
|
|
14124
14128
|
}
|
|
14125
14129
|
return pointCloudGroup;
|
|
14126
14130
|
};
|
|
14127
|
-
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.
|
|
14131
|
+
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.1, wallLinesDelPs = 0.2) => {
|
|
14128
14132
|
if (allProjectionResults.length == 0) return [];
|
|
14129
14133
|
if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
|
|
14130
14134
|
const pcdPointsArr = [];
|
|
@@ -14599,6 +14603,68 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
14599
14603
|
if (!delData.has(j))
|
|
14600
14604
|
newnewData.push(array[j]);
|
|
14601
14605
|
}
|
|
14606
|
+
if (pointCloudCluster != null) {
|
|
14607
|
+
let delArray = /* @__PURE__ */ new Set();
|
|
14608
|
+
let newArray = [];
|
|
14609
|
+
for (let j = 0; j < newnewData.length; j++) {
|
|
14610
|
+
if (delArray.has(j)) continue;
|
|
14611
|
+
let points = newnewData[j].points;
|
|
14612
|
+
let obj_id = newnewData[j].obj_id;
|
|
14613
|
+
let type = newnewData[j].type;
|
|
14614
|
+
let averagePz3 = newnewData[j].averagePz;
|
|
14615
|
+
let positionArr = newnewData[j].positionArr;
|
|
14616
|
+
let isStaircaseBalconyRailing = newnewData[j].isStaircaseBalconyRailing;
|
|
14617
|
+
if (points.length < 50)
|
|
14618
|
+
continue;
|
|
14619
|
+
let clusterResult = pointCloudCluster([points], {
|
|
14620
|
+
tolerance: tolerancePointCloudCluster,
|
|
14621
|
+
minClusterSize: 50,
|
|
14622
|
+
maxClusterSize: 1e7,
|
|
14623
|
+
threadCount: 1
|
|
14624
|
+
});
|
|
14625
|
+
let beforeLength = newArray.length;
|
|
14626
|
+
if (clusterResult.length > 0 && clusterResult[0].length > 1) {
|
|
14627
|
+
let add = 1;
|
|
14628
|
+
for (const cluster of clusterResult[0]) {
|
|
14629
|
+
if (cluster.length < 50) continue;
|
|
14630
|
+
const newOriginalPoints = cluster.map((i) => points[i]);
|
|
14631
|
+
const centerData = getCenterAndPointHeight(newOriginalPoints);
|
|
14632
|
+
let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
|
|
14633
|
+
const data = {
|
|
14634
|
+
points: newOriginalPoints,
|
|
14635
|
+
path: computeContour(pathPoints),
|
|
14636
|
+
h: centerData.h,
|
|
14637
|
+
minz: centerData.minz,
|
|
14638
|
+
maxz: centerData.maxz,
|
|
14639
|
+
center: { x: centerData.x, y: centerData.y, z: centerData.z },
|
|
14640
|
+
type,
|
|
14641
|
+
averagePz: averagePz3,
|
|
14642
|
+
obb: null,
|
|
14643
|
+
obj_id: obj_id + `_${add}`,
|
|
14644
|
+
positionArr,
|
|
14645
|
+
isStaircaseBalconyRailing,
|
|
14646
|
+
mapPosition: newnewData[j]?.mapPosition
|
|
14647
|
+
};
|
|
14648
|
+
data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
|
|
14649
|
+
if (data.obb == null) continue;
|
|
14650
|
+
newArray.push(data);
|
|
14651
|
+
add++;
|
|
14652
|
+
}
|
|
14653
|
+
}
|
|
14654
|
+
if (newArray.length != beforeLength) {
|
|
14655
|
+
delArray.add(j);
|
|
14656
|
+
}
|
|
14657
|
+
}
|
|
14658
|
+
if (delArray.size > 0) {
|
|
14659
|
+
for (let j = 0; j < newnewData.length; j++) {
|
|
14660
|
+
if (!delArray.has(j)) {
|
|
14661
|
+
newArray.push(newnewData[j]);
|
|
14662
|
+
}
|
|
14663
|
+
}
|
|
14664
|
+
newnewData.length = 0;
|
|
14665
|
+
newnewData.push(...newArray);
|
|
14666
|
+
}
|
|
14667
|
+
}
|
|
14602
14668
|
delData.clear();
|
|
14603
14669
|
for (let j = 0; j < newnewData.length; j++) {
|
|
14604
14670
|
if (newnewData[j].obb == null || delData.has(j))
|