rm-graphical-computing-node 1.0.41 → 1.0.43

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.
Files changed (2) hide show
  1. package/dist/index.mjs +60 -27
  2. package/package.json +2 -1
package/dist/index.mjs CHANGED
@@ -4641,8 +4641,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4641
4641
  let afterDoorLen = doorTmpEd.distanceTo(doorTmpSt);
4642
4642
  if (afterDoorLen < 0.4 && !isDoor || afterDoorLen < 0.3 && isDoor)
4643
4643
  continue;
4644
- if (!findDoorIndexs.includes(index))
4645
- findDoorIndexs.push(index);
4646
4644
  let dataType = "";
4647
4645
  let doorType = isDoor ? "singleDoor" : "";
4648
4646
  doorType = isPullOutDoor ? "pullOutDoor" : doorType;
@@ -4694,11 +4692,23 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4694
4692
  let isPPP = getParallelism(startPt2, endPt2, doorTmpSt, doorTmpEd);
4695
4693
  if (result && result.maxPerpendicularDistance < 0.5) {
4696
4694
  if (isPPP && isPPP.isParallel) {
4695
+ let lineLen = startPt2.distanceTo(endPt2);
4696
+ let doorLen = doorTmpSt.distanceTo(doorTmpEd);
4697
4697
  let tmpLine66 = new THREE5.Line3(startPt2, endPt2);
4698
4698
  let tmpPt66 = new THREE5.Vector3(doorTmpSt.x, doorTmpSt.y, startPt2.z);
4699
4699
  let ptClose66 = tmpLine66.closestPointToPoint(tmpPt66, true, new THREE5.Vector3());
4700
4700
  let isPPPP = perpendicularInfo(ptClose66, tmpPt66, doorTmpSt, doorTmpEd);
4701
- if (isPPPP && isPPPP.angle > 85) {
4701
+ if (doorLen > lineLen) {
4702
+ tmpLine66 = new THREE5.Line3(
4703
+ new THREE5.Vector3(doorTmpSt.x, doorTmpSt.y, startPt2.z),
4704
+ new THREE5.Vector3(doorTmpEd.x, doorTmpEd.y, startPt2.z)
4705
+ );
4706
+ tmpPt66 = startPt2.clone();
4707
+ ptClose66 = tmpLine66.closestPointToPoint(tmpPt66, true, new THREE5.Vector3());
4708
+ isPPPP = perpendicularInfo(ptClose66, tmpPt66, doorTmpSt, doorTmpEd);
4709
+ [ptClose66, tmpPt66] = [tmpPt66, ptClose66];
4710
+ }
4711
+ if (isPPPP && isPPPP.angle > 85 && !wallBelowBeam) {
4702
4712
  doorAndBeamDataObj.beamNearWallVec = new THREE5.Vector3().subVectors(ptClose66, tmpPt66).normalize();
4703
4713
  if (doorAndBeamDataObj.beamStart.z > lines[x].rooftopPz - 0.03 && length2 > 1) {
4704
4714
  wallBelowBeam = true;
@@ -4987,8 +4997,12 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4987
4997
  });
4988
4998
  allDoorLines1.push({
4989
4999
  start: doorTmpSt,
4990
- end: doorTmpEd
5000
+ end: doorTmpEd,
5001
+ index,
5002
+ id: doorAndBeamDataObj.id
4991
5003
  });
5004
+ if (!findDoorIndexs.includes(index))
5005
+ findDoorIndexs.push(index);
4992
5006
  id++;
4993
5007
  if (isPullOutDoor && length2 < 2) break;
4994
5008
  }
@@ -5597,7 +5611,8 @@ function clonePoint(p) {
5597
5611
  }
5598
5612
 
5599
5613
  // src/geometry/colLine.mjs
5600
- var getColLine = (lines, runDataList) => {
5614
+ import * as gfx from "rm-gxf-computing-rusts";
5615
+ var getColLine = (lines, runDataList, collectDataPath, pointCloudCluster = null) => {
5601
5616
  if (!lines || lines.length <= 0) return;
5602
5617
  let colDatas = {
5603
5618
  rectangles: [],
@@ -5815,6 +5830,7 @@ var getColLine = (lines, runDataList) => {
5815
5830
  continue;
5816
5831
  let colIndexs = {
5817
5832
  uuids: [],
5833
+ rooftopPz: 0,
5818
5834
  missingEdge: {
5819
5835
  start: new THREE6.Vector3(),
5820
5836
  end: new THREE6.Vector3()
@@ -5913,6 +5929,7 @@ var getColLine = (lines, runDataList) => {
5913
5929
  let area2 = length1 * length2;
5914
5930
  if (area2 < minArea || area2 > maxArea) continue;
5915
5931
  colIndexs.uuids = [lines[i].uuid, lines[j].uuid, lines[k].uuid];
5932
+ colIndexs.rooftopPz = Math.max(lines[i].rooftopPz, lines[j].rooftopPz, lines[k].rooftopPz);
5916
5933
  colIndexs.missingEdge.start = nextNextEndPt;
5917
5934
  colIndexs.missingEdge.end = startPt;
5918
5935
  break;
@@ -8814,17 +8831,25 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
8814
8831
  const isMaxBox = compareBoxVolume(obb1, obb2);
8815
8832
  if (type1 !== "wall" && type1 !== "floor" && type1 !== "roof") {
8816
8833
  if (type1 === "window") {
8817
- if (type2 === "balcony railing" && containsObbPoints(obb1, array2[k].points)) {
8818
- array2[k].isDel = true;
8819
- continue;
8820
- }
8821
- if (type2 === "balcony railing" && containsObbPoints(obb2, array1[e].points)) {
8822
- array1[e].isDel = true;
8823
- break;
8824
- }
8825
- if (type2 === "balcony railing" && checkBundingBox(obb1, obb2, array1[e].points, array2[k].points) && (Math.abs(minz1 - minz2) < 0.1 || Math.abs(minz2 - averagePz3) > 0.3)) {
8826
- array2[k].isDel = true;
8827
- continue;
8834
+ const size1 = new THREE8.Vector3();
8835
+ obb1.getSize(size1);
8836
+ let maxLen1 = size1.x > size1.y ? size1.x : size1.y;
8837
+ const size2 = new THREE8.Vector3();
8838
+ obb2.getSize(size2);
8839
+ let maxLen2 = size2.x > size2.y ? size2.x : size2.y;
8840
+ if (Math.abs(maxLen1 - maxLen2) < 0.5 || maxLen1 > maxLen2) {
8841
+ if (type2 === "balcony railing" && containsObbPoints(obb1, array2[k].points)) {
8842
+ array2[k].isDel = true;
8843
+ continue;
8844
+ }
8845
+ if (type2 === "balcony railing" && containsObbPoints(obb2, array1[e].points)) {
8846
+ array1[e].isDel = true;
8847
+ break;
8848
+ }
8849
+ if (type2 === "balcony railing" && checkBundingBox(obb1, obb2, array1[e].points, array2[k].points) && (Math.abs(minz1 - minz2) < 0.1 || Math.abs(minz2 - averagePz3) > 0.3)) {
8850
+ array2[k].isDel = true;
8851
+ continue;
8852
+ }
8828
8853
  }
8829
8854
  if (type2 === "door" && containsObbPoints(obb1, array2[k].points)) {
8830
8855
  array2[k].isDel = true;
@@ -8837,17 +8862,25 @@ var getMergeMeaning = (allProjectionResults, averagePz2, pointCloudCluster = nul
8837
8862
  if (type2 === "window sill")
8838
8863
  continue;
8839
8864
  } else if (type1 === "balcony railing") {
8840
- if (type2 === "window" && containsObbPoints(obb1, array2[k].points)) {
8841
- array2[k].isDel = true;
8842
- continue;
8843
- }
8844
- if (type2 === "window" && containsObbPoints(obb2, array1[e].points)) {
8845
- array1[e].isDel = true;
8846
- break;
8847
- }
8848
- if (type2 === "window" && checkBundingBox(obb1, obb2, array1[e].points, array2[k].points) && (Math.abs(minz1 - minz2) < 0.1 || Math.abs(minz1 - averagePz3) > 0.3)) {
8849
- array1[e].isDel = true;
8850
- break;
8865
+ const size1 = new THREE8.Vector3();
8866
+ obb1.getSize(size1);
8867
+ let maxLen1 = size1.x > size1.y ? size1.x : size1.y;
8868
+ const size2 = new THREE8.Vector3();
8869
+ obb2.getSize(size2);
8870
+ let maxLen2 = size2.x > size2.y ? size2.x : size2.y;
8871
+ if (Math.abs(maxLen1 - maxLen2) < 0.5 || maxLen1 < maxLen2) {
8872
+ if (type2 === "window" && containsObbPoints(obb1, array2[k].points)) {
8873
+ array2[k].isDel = true;
8874
+ continue;
8875
+ }
8876
+ if (type2 === "window" && containsObbPoints(obb2, array1[e].points)) {
8877
+ array1[e].isDel = true;
8878
+ break;
8879
+ }
8880
+ if (type2 === "window" && checkBundingBox(obb1, obb2, array1[e].points, array2[k].points) && (Math.abs(minz1 - minz2) < 0.1 || Math.abs(minz1 - averagePz3) > 0.3)) {
8881
+ array1[e].isDel = true;
8882
+ break;
8883
+ }
8851
8884
  }
8852
8885
  if (type2 === "Staircase" && containsObbPoints(obb1, array2[k].points)) {
8853
8886
  array1[e].isStaircaseBalconyRailing = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",
@@ -21,6 +21,7 @@
21
21
  "d3-delaunay": "^6.0.4",
22
22
  "geojson-minimum-bounding-rectangle": "^2.0.3",
23
23
  "rm-graphical-computing-node": "^1.0.24",
24
+ "rm-gxf-computing-rusts": "^0.0.61",
24
25
  "rm-point-cloud-calculation": "^1.0.4",
25
26
  "rm-point-cloud-calculation-napi": "^1.0.9",
26
27
  "three": "^0.184.0"