rm-graphical-computing-node 1.0.116 → 1.0.118
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 +58 -10
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4945,7 +4945,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
4945
4945
|
"hole";
|
|
4946
4946
|
}
|
|
4947
4947
|
if (dataType == "beam" && findDoorFrame) {
|
|
4948
|
-
console.log("id", id, lineLength);
|
|
4949
4948
|
dataType = "hole";
|
|
4950
4949
|
}
|
|
4951
4950
|
doorAndBeamDataObj.type = dataType;
|
|
@@ -5697,9 +5696,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5697
5696
|
}
|
|
5698
5697
|
for (let h = 0; h < line4.doorAndBeamIdToCheckResults.length; h++) {
|
|
5699
5698
|
if (line4.doorAndBeamIdToCheckResults[h][1] == data4.id)
|
|
5700
|
-
newDoorAndBeamIdToCheckResults.push([line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, id]);
|
|
5699
|
+
newDoorAndBeamIdToCheckResults.push([line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, id]);
|
|
5701
5700
|
else
|
|
5702
|
-
newDoorAndBeamIdToCheckResults.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
5701
|
+
newDoorAndBeamIdToCheckResults.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
5703
5702
|
}
|
|
5704
5703
|
}
|
|
5705
5704
|
let tmpDoorPoints3 = [line3.start, line3.end, line4.start, line4.end];
|
|
@@ -5801,9 +5800,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5801
5800
|
}
|
|
5802
5801
|
for (let h = 0; h < line22.doorAndBeamIdToCheckResults.length; h++) {
|
|
5803
5802
|
if (line22.doorAndBeamIdToCheckResults[h][1] == data2.id)
|
|
5804
|
-
newDoorAndBeamIdToCheckResults.push([line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, id]);
|
|
5803
|
+
newDoorAndBeamIdToCheckResults.push([line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, id]);
|
|
5805
5804
|
else
|
|
5806
|
-
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5805
|
+
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5807
5806
|
}
|
|
5808
5807
|
let tmpDoorPoints3 = [line2.start, line2.end, line22.start, line22.end];
|
|
5809
5808
|
let twoPoint3 = getFarthestPoints(tmpDoorPoints3);
|
|
@@ -5923,9 +5922,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5923
5922
|
}
|
|
5924
5923
|
for (let h = 0; h < line22.doorAndBeamIdToCheckResults.length; h++) {
|
|
5925
5924
|
if (line22.doorAndBeamIdToCheckResults[h][1] == data2.id)
|
|
5926
|
-
newDoorAndBeamIdToCheckResults.push([line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, id]);
|
|
5925
|
+
newDoorAndBeamIdToCheckResults.push([line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, id]);
|
|
5927
5926
|
else
|
|
5928
|
-
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5927
|
+
newDoorAndBeamIdToCheckResults.push(line22.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line22.doorAndBeamIdToCheckResults[h][1]);
|
|
5929
5928
|
}
|
|
5930
5929
|
let tmpDoorPoints3 = [line2.start, line2.end, line22.start, line22.end];
|
|
5931
5930
|
let twoPoint3 = getFarthestPoints(tmpDoorPoints3);
|
|
@@ -5998,9 +5997,9 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
|
|
|
5998
5997
|
}
|
|
5999
5998
|
for (let h = 0; h < line4.doorAndBeamIdToCheckResults.length; h++) {
|
|
6000
5999
|
if (line4.doorAndBeamIdToCheckResults[h][1] == data4.id)
|
|
6001
|
-
newDoorAndBeamIdToCheckResults2.push([line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, id]);
|
|
6000
|
+
newDoorAndBeamIdToCheckResults2.push([line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, id]);
|
|
6002
6001
|
else
|
|
6003
|
-
newDoorAndBeamIdToCheckResults2.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
6002
|
+
newDoorAndBeamIdToCheckResults2.push(line4.doorAndBeamIdToCheckResults[h][0] + data1LineIndex.checkResults.length - 1, line4.doorAndBeamIdToCheckResults[h][1]);
|
|
6004
6003
|
}
|
|
6005
6004
|
let tmpDoorPoints4 = [line3.start, line3.end, line4.start, line4.end];
|
|
6006
6005
|
let twoPoint4 = getFarthestPoints(tmpDoorPoints4);
|
|
@@ -9614,7 +9613,7 @@ var drawStaircase = (pcdPointsArr, scene) => {
|
|
|
9614
9613
|
}
|
|
9615
9614
|
return pointCloudGroup;
|
|
9616
9615
|
};
|
|
9617
|
-
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.
|
|
9616
|
+
var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.2) => {
|
|
9618
9617
|
if (allProjectionResults.length == 0) return [];
|
|
9619
9618
|
if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
|
|
9620
9619
|
const pcdPointsArr = [];
|
|
@@ -9745,6 +9744,55 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
|
|
|
9745
9744
|
}
|
|
9746
9745
|
}
|
|
9747
9746
|
}
|
|
9747
|
+
function appendPcdObj(targetType, sourceType) {
|
|
9748
|
+
const targetData = pcdPointsArr.find((item) => item.type == targetType);
|
|
9749
|
+
const sourceData = pcdPointsArr.find((item) => item.type == sourceType);
|
|
9750
|
+
if (targetData && sourceData && targetData.array.length > 0 && sourceData.array.length > 0) {
|
|
9751
|
+
for (let i = 0; i < sourceData.array.length; i++) {
|
|
9752
|
+
const sourceItem = sourceData.array[i];
|
|
9753
|
+
if (sourceItem.obb == null) continue;
|
|
9754
|
+
for (let j = 0; j < targetData.array.length; j++) {
|
|
9755
|
+
const targetItem = targetData.array[j];
|
|
9756
|
+
if (targetItem.obb == null) continue;
|
|
9757
|
+
if (targetType == "window" && sourceType == "balcony railing" && !targetItem.isHasTie) {
|
|
9758
|
+
continue;
|
|
9759
|
+
}
|
|
9760
|
+
let isMerge = sourceItem.obb.intersectsOBB(targetItem.obb, 0.01);
|
|
9761
|
+
if (!isMerge)
|
|
9762
|
+
isMerge = obbContainsOBB(sourceItem.obb, targetItem.obb);
|
|
9763
|
+
if (isMerge) {
|
|
9764
|
+
for (let m = 0; m < sourceItem.points.length; m++) {
|
|
9765
|
+
targetItem.points.push(sourceItem.points[m]);
|
|
9766
|
+
}
|
|
9767
|
+
let tmpPoints = targetItem.points.map((p) => [p.x, p.y]);
|
|
9768
|
+
if (targetType == "window" && sourceType == "metal framing of interior glass partitions") {
|
|
9769
|
+
targetItem.isHasTie = true;
|
|
9770
|
+
}
|
|
9771
|
+
targetItem.path = computeContour(tmpPoints);
|
|
9772
|
+
const centerData = getCenterAndPointHeight(targetItem.points);
|
|
9773
|
+
targetItem.h = centerData.h;
|
|
9774
|
+
targetItem.minz = centerData.minz;
|
|
9775
|
+
targetItem.maxz = centerData.maxz;
|
|
9776
|
+
targetItem.center = { x: centerData.x, y: centerData.y, z: centerData.z };
|
|
9777
|
+
let newObb = getObb(targetItem.path, targetItem.center, targetItem.h, (targetItem.maxz + targetItem.minz) / 2);
|
|
9778
|
+
if (newObb != null)
|
|
9779
|
+
targetItem.obb = newObb;
|
|
9780
|
+
targetItem.positionArr.push(...sourceItem.positionArr);
|
|
9781
|
+
sourceData.array.splice(i, 1);
|
|
9782
|
+
i = -1;
|
|
9783
|
+
break;
|
|
9784
|
+
}
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9787
|
+
}
|
|
9788
|
+
}
|
|
9789
|
+
console.time("appendPcdObj");
|
|
9790
|
+
appendPcdObj("window", "door frame");
|
|
9791
|
+
appendPcdObj("window", "metal framing of interior glass partitions");
|
|
9792
|
+
appendPcdObj("balcony railing", "metal framing of interior glass partitions");
|
|
9793
|
+
appendPcdObj("window", "balcony railing");
|
|
9794
|
+
appendPcdObj("window", "door frame");
|
|
9795
|
+
console.timeEnd("appendPcdObj");
|
|
9748
9796
|
for (let i = 0; i < pcdPointsArr.length; i++) {
|
|
9749
9797
|
const array = pcdPointsArr[i].array;
|
|
9750
9798
|
const delData = /* @__PURE__ */ new Set();
|