rm-graphical-computing-node 1.0.109 → 1.0.111

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 +31 -15
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -4801,7 +4801,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4801
4801
  }
4802
4802
  if (isPPPP && isPPPP.angle > 85 && !wallBelowBeam) {
4803
4803
  doorAndBeamDataObj.beamNearWallVec = new THREE5.Vector3().subVectors(ptClose66, tmpPt66).normalize();
4804
- if (doorAndBeamDataObj.beamStart.z > lines[x].rooftopPz - 0.03 && length2 > 1) {
4804
+ if (doorAndBeamDataObj.beamStart.z > lines[x].rooftopPz - 0.05 && length2 > 1) {
4805
4805
  wallBelowBeam = true;
4806
4806
  } else
4807
4807
  wallBelowBeam = false;
@@ -4830,7 +4830,7 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4830
4830
  }
4831
4831
  inLinePts2 = inLinePtsTmp;
4832
4832
  inLinePts2 = uniqueVector3ByTolerance(inLinePts2);
4833
- if (inLinePts2.length < 150) continue;
4833
+ if (inLinePts2.length < 100) continue;
4834
4834
  let twoPoint = getFarthestPoints(inLinePts2);
4835
4835
  if (twoPoint.length == 2) {
4836
4836
  let twoPointLength = twoPoint[0].distanceTo(twoPoint[1]);
@@ -4906,7 +4906,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
4906
4906
  if (lineLength > 1.5 || isExtendBeam)
4907
4907
  dataType = "beam";
4908
4908
  else
4909
- dataType = nearWall && lineLength > 0.8 ? "beam" : "hole";
4909
+ dataType = /**nearWall && lineLength > 0.8 ? "beam" : */
4910
+ "hole";
4910
4911
  }
4911
4912
  doorAndBeamDataObj.type = dataType;
4912
4913
  doorAndBeamDataObj.wallBelowBeam = wallBelowBeam;
@@ -5035,6 +5036,14 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
5035
5036
  else if (doorAndBeamDataObj.isPullOutDoor)
5036
5037
  tmpDoorBeamData.isPullOutDoor = true;
5037
5038
  const hasCommon = pcbDoorIndexs.some((item) => tmpDoorBeamData.pcbDoorIndexs.includes(item));
5039
+ if (doorAndBeamDataObj.type == "beam" && tmpDoorBeamData.type == "beam" || doorAndBeamDataObj.type == "hole" && tmpDoorBeamData.type == "hole") {
5040
+ if (length22 > length1) {
5041
+ doorAndBeamDataObj.isExtend = true;
5042
+ }
5043
+ if (length1 > length22) {
5044
+ lines[doorBeamDataIndex[w2].linesIndex].isExtend = true;
5045
+ }
5046
+ }
5038
5047
  let lineIsOnlyBeam1 = false;
5039
5048
  let lineIsOnlyBeam2 = false;
5040
5049
  if (doorAndBeamDataObj.type == "beam" && tmpDoorBeamData.type == "beam") {
@@ -5044,12 +5053,6 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
5044
5053
  lines[doorBeamDataIndex[w2].linesIndex].originalPoints = null;
5045
5054
  lineIsOnlyBeam1 = length1 > length22;
5046
5055
  lineIsOnlyBeam2 = length1 < length22;
5047
- if (length22 > length1) {
5048
- doorAndBeamDataObj.isExtend = true;
5049
- }
5050
- if (length1 > length22) {
5051
- lines[doorBeamDataIndex[w2].linesIndex].isExtend = true;
5052
- }
5053
5056
  let lineTmp1 = new THREE5.Line3(tmpDoorBeamData.beamStart, tmpDoorBeamData.beamEnd);
5054
5057
  let lineTmp2 = new THREE5.Line3(doorAndBeamDataObj.beamStart, doorAndBeamDataObj.beamEnd);
5055
5058
  let ptClose12 = lineTmp1.closestPointToPoint(lineTmp2.start, true, new THREE5.Vector3());
@@ -5077,8 +5080,10 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
5077
5080
  console.log(doorAndBeamDataObj.beamStart.distanceTo(doorAndBeamDataObj.beamEnd));
5078
5081
  }
5079
5082
  }
5080
- if (length1 < length22 && !lineIsOnlyBeam2 || lineIsOnlyBeam1) {
5081
- if (lineIsOnlyBeam1) {
5083
+ let holeTyp1 = doorAndBeamDataObj.type == "hole" && length1 > length22;
5084
+ let holeTyp2 = doorAndBeamDataObj.type == "hole" && length1 < length22;
5085
+ if (length1 < length22 && !lineIsOnlyBeam2 && doorAndBeamDataObj.type != "hole" || lineIsOnlyBeam1 || holeTyp1) {
5086
+ if (lineIsOnlyBeam1 || holeTyp1) {
5082
5087
  vecNegate = vecNegate.negate();
5083
5088
  vec2 = vec2.negate();
5084
5089
  }
@@ -5110,8 +5115,8 @@ var getBeamLine = async (lines, runDataList, pcdData, lineReader, lineEditor, on
5110
5115
  tmpDoorBeamData.doorOpenEndPoint = doorAndBeamDataObj.doorOpenEndPoint.clone();
5111
5116
  tmpDoorBeamData.doorOpenVector = doorAndBeamDataObj.doorOpenVector.clone();
5112
5117
  }
5113
- } else if (length1 > length22 && !lineIsOnlyBeam1 || lineIsOnlyBeam2) {
5114
- if (lineIsOnlyBeam2) {
5118
+ } else if (length1 > length22 && !lineIsOnlyBeam1 && doorAndBeamDataObj.type == "hole" || lineIsOnlyBeam2 || holeTyp2) {
5119
+ if (lineIsOnlyBeam2 || holeTyp2) {
5115
5120
  vecNegate = vecNegate.negate();
5116
5121
  vec2 = vec2.negate();
5117
5122
  }
@@ -13877,7 +13882,9 @@ var getWindowData = (lines, pcdData, lineReader) => {
13877
13882
  //是否在墙内
13878
13883
  name: window.name,
13879
13884
  rectPts: window.coordinatesByArea.coordinates,
13880
- obj_id: window.obj_id
13885
+ obj_id: window.obj_id,
13886
+ findLineIndex: []
13887
+ //存储的数据格式是[[线索引,线的windowData索引]]
13881
13888
  });
13882
13889
  }
13883
13890
  }
@@ -14018,7 +14025,10 @@ var getWindowData = (lines, pcdData, lineReader) => {
14018
14025
  if (!line2.isLine2) {
14019
14026
  if (length2 < 3.5) {
14020
14027
  for (let n = 0; n < windowDatas.length; n++) {
14021
- if (windowDatas[n].isFind) continue;
14028
+ if (windowDatas[n].isFind) {
14029
+ if (line2.length < lines[windowDatas[n].findLineIndex[0]].length)
14030
+ continue;
14031
+ }
14022
14032
  let doorSt = new THREE10.Vector3(windowDatas[n].windowStartPt.x, windowDatas[n].windowStartPt.y, 0);
14023
14033
  let doorEd = new THREE10.Vector3(windowDatas[n].windowEndPt.x, windowDatas[n].windowEndPt.y, 0);
14024
14034
  let beamSt = new THREE10.Vector3(tmpRegion.facePoints[0].x, tmpRegion.facePoints[0].y, 0);
@@ -14358,6 +14368,12 @@ var getWindowData = (lines, pcdData, lineReader) => {
14358
14368
  obj_id: windowObj_id
14359
14369
  };
14360
14370
  line2.windowIdToCheckResults.push([region.index, id]);
14371
+ if (windowDatas[findDoorDataIndex].findLineIndex.length > 0) {
14372
+ let lineIndex = windowDatas[findDoorDataIndex].findLineIndex[0];
14373
+ let windowDataIndex = windowDatas[findDoorDataIndex].findLineIndex[1];
14374
+ lines[lineIndex].windowData.splice(windowDataIndex, 1);
14375
+ }
14376
+ windowDatas[findDoorDataIndex].findLineIndex = [index, line2.windowData.length - 1];
14361
14377
  line2.windowData.push(doorAndBeamDataObj);
14362
14378
  doorBeamDataIndex.push({
14363
14379
  linesIndex: index,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.109",
3
+ "version": "1.0.111",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",