rm-graphical-computing-node 1.0.120 → 1.0.122
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 +23 -47
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -9645,12 +9645,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9645
9645
|
if (word === "wall" || word === "stair guardrail")
|
|
9646
9646
|
continue;
|
|
9647
9647
|
let threePoints = [];
|
|
9648
|
+
let ptIndex = [];
|
|
9648
9649
|
for (let u4 = 0; u4 < allProjectionResults[i].points.length; u4++) {
|
|
9649
9650
|
threePoints.push(new THREE8.Vector3(
|
|
9650
9651
|
allProjectionResults[i].points[u4].x,
|
|
9651
9652
|
allProjectionResults[i].points[u4].y,
|
|
9652
9653
|
allProjectionResults[i].points[u4].z
|
|
9653
9654
|
));
|
|
9655
|
+
ptIndex.push(u4);
|
|
9654
9656
|
}
|
|
9655
9657
|
if (wallLines && wallLines.length && wallVerifyType && wallVerifyType.length && wallVerifyType.includes(word)) {
|
|
9656
9658
|
threePoints = checkNearObjects(wallLines, threePoints);
|
|
@@ -9682,6 +9684,11 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9682
9684
|
if (threePoints.length === 0)
|
|
9683
9685
|
continue;
|
|
9684
9686
|
const centerData = getCenterAndPointHeight(threePoints);
|
|
9687
|
+
let mapPosition = /* @__PURE__ */ new Map();
|
|
9688
|
+
mapPosition.set(
|
|
9689
|
+
`${allProjectionResults[i].position.x},${allProjectionResults[i].position.y},${allProjectionResults[i].position.z}`,
|
|
9690
|
+
threePoints
|
|
9691
|
+
);
|
|
9685
9692
|
const data = {
|
|
9686
9693
|
points: threePoints,
|
|
9687
9694
|
path: computeContour(points),
|
|
@@ -9696,7 +9703,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9696
9703
|
isDel: false,
|
|
9697
9704
|
obj_id,
|
|
9698
9705
|
positionArr: [allProjectionResults[i].position],
|
|
9699
|
-
isStaircaseBalconyRailing: false
|
|
9706
|
+
isStaircaseBalconyRailing: false,
|
|
9707
|
+
mapPosition
|
|
9700
9708
|
// isObliqueCeiling,
|
|
9701
9709
|
// pointPercent,
|
|
9702
9710
|
// pointsNormal
|
|
@@ -9842,7 +9850,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9842
9850
|
) {
|
|
9843
9851
|
let tol = array[k].type == "door frame" ? 0.5 : 0.5;
|
|
9844
9852
|
let boxVecK = getObbLongSideDirection(array[k].obb);
|
|
9845
|
-
|
|
9853
|
+
let f = calculateClosePointWithOBB(array[k].points, cloneData.obb);
|
|
9854
|
+
if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 && f < 0.3) {
|
|
9846
9855
|
let isPPPP = isParallel(boxVecJ, boxVecK, tol);
|
|
9847
9856
|
if (!isPPPP || !isPPPP.parallel) {
|
|
9848
9857
|
continue;
|
|
@@ -9860,9 +9869,16 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9860
9869
|
}
|
|
9861
9870
|
if (isMerge) {
|
|
9862
9871
|
delData.add(k);
|
|
9872
|
+
let nowIndex = cloneData.points.length;
|
|
9873
|
+
let threePoints = [];
|
|
9863
9874
|
for (let m = 0; m < array[k].points.length; m++) {
|
|
9864
|
-
if (array[k].points[m].z > averagePz2 && array[k].points[m].z - averagePz2 > 0.1 || cloneData.type == "floor" || cloneData.type == "Staircase")
|
|
9875
|
+
if (array[k].points[m].z > averagePz2 && array[k].points[m].z - averagePz2 > 0.1 || cloneData.type == "floor" || cloneData.type == "Staircase") {
|
|
9865
9876
|
cloneData.points.push(array[k].points[m]);
|
|
9877
|
+
threePoints.push(array[k].points[m]);
|
|
9878
|
+
}
|
|
9879
|
+
}
|
|
9880
|
+
if (cloneData.type != "floor") {
|
|
9881
|
+
cloneData.mapPosition.set(`${array[k].positionArr[0].x},${array[k].positionArr[0].y},${array[k].positionArr[0].z}`, threePoints);
|
|
9866
9882
|
}
|
|
9867
9883
|
let tmpPoints = cloneData.points.map((p) => [p.x, p.y]);
|
|
9868
9884
|
if (cloneData.type == "floor") {
|
|
@@ -10322,7 +10338,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
10322
10338
|
obj_id: array[j].obj_id,
|
|
10323
10339
|
pcdPoints: array[j].points,
|
|
10324
10340
|
positionArr: array[j].positionArr,
|
|
10325
|
-
isStaircaseBalconyRailing: array[j].isStaircaseBalconyRailing
|
|
10341
|
+
isStaircaseBalconyRailing: array[j].isStaircaseBalconyRailing,
|
|
10342
|
+
mapPosition: array[j].mapPosition
|
|
10326
10343
|
});
|
|
10327
10344
|
}
|
|
10328
10345
|
}
|
|
@@ -14648,48 +14665,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
14648
14665
|
const totalInPlaneNum = region.totalInPlaneNum;
|
|
14649
14666
|
if (!facePoints || facePoints.length <= 0)
|
|
14650
14667
|
continue;
|
|
14651
|
-
let
|
|
14652
|
-
let regionHeight = facePoints[0].distanceTo(facePoints[3]);
|
|
14653
|
-
const centerHeight = region.gridHeight * (regionHeight / region.gridHeight / 3 * 2) + region.gridHeight / 2;
|
|
14654
|
-
let linePt1 = new THREE10.Vector3(facePoints[0].x, facePoints[0].y, facePoints[0].z + centerHeight);
|
|
14655
|
-
let linePt2 = new THREE10.Vector3(facePoints[1].x, facePoints[1].y, facePoints[1].z + centerHeight);
|
|
14656
|
-
const centerLine = new THREE10.Line3(linePt1, linePt2);
|
|
14657
|
-
const inLinePts = [];
|
|
14658
|
-
let tmpTargetPt = new THREE10.Vector3();
|
|
14659
|
-
region.points.forEach((pt) => {
|
|
14660
|
-
const tmpClosePt = centerLine.closestPointToPoint(pt, true, tmpTargetPt);
|
|
14661
|
-
if (tmpClosePt.distanceTo(pt) < region.gridHeight + 0.01) {
|
|
14662
|
-
inLinePts.push(pt);
|
|
14663
|
-
}
|
|
14664
|
-
});
|
|
14665
|
-
let lineGroup = [];
|
|
14666
|
-
let isFindPtIndex = [];
|
|
14667
|
-
while (true) {
|
|
14668
|
-
let tmpLine = [];
|
|
14669
|
-
for (let e = 0; e < inLinePts.length; e++) {
|
|
14670
|
-
if (isFindPtIndex.includes(e))
|
|
14671
|
-
continue;
|
|
14672
|
-
if (tmpLine.length == 0) {
|
|
14673
|
-
tmpLine.push(inLinePts[e]);
|
|
14674
|
-
isFindPtIndex.push(e);
|
|
14675
|
-
}
|
|
14676
|
-
}
|
|
14677
|
-
for (let c = 0; c < inLinePts.length; c++) {
|
|
14678
|
-
if (isFindPtIndex.includes(c))
|
|
14679
|
-
continue;
|
|
14680
|
-
for (let e = 0; e < tmpLine.length; e++) {
|
|
14681
|
-
if (inLinePts[c].distanceTo(tmpLine[e]) < region.gridWidth + 0.01) {
|
|
14682
|
-
tmpLine.push(inLinePts[c]);
|
|
14683
|
-
isFindPtIndex.push(c);
|
|
14684
|
-
c = -1;
|
|
14685
|
-
break;
|
|
14686
|
-
}
|
|
14687
|
-
}
|
|
14688
|
-
}
|
|
14689
|
-
if (tmpLine.length == 0)
|
|
14690
|
-
break;
|
|
14691
|
-
lineGroup.push(tmpLine);
|
|
14692
|
-
}
|
|
14668
|
+
let lineGroup = [[...region.points]];
|
|
14693
14669
|
const regionData = [];
|
|
14694
14670
|
for (let e = 0; e < lineGroup.length; e++) {
|
|
14695
14671
|
const obj = {
|
|
@@ -15100,7 +15076,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
|
|
|
15100
15076
|
groundClearance,
|
|
15101
15077
|
obj_id: windowObj_id
|
|
15102
15078
|
};
|
|
15103
|
-
if (windowToWallAngle >
|
|
15079
|
+
if (windowToWallAngle > 50 && changeWindowSize) {
|
|
15104
15080
|
let rectPts = [doorAndBeamDataObj.windowBottomSt, doorAndBeamDataObj.windowBottomEd, doorAndBeamDataObj.windowTopEd, doorAndBeamDataObj.windowTopSt];
|
|
15105
15081
|
let checkResultsNum = region.centerPts ? region.centerPts.length : 0;
|
|
15106
15082
|
let inRectNum = 0;
|