rm-graphical-computing-node 1.0.134 → 1.0.136

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 +29 -14
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9673,8 +9673,11 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9673
9673
  ));
9674
9674
  threePointsStr.push(`${allProjectionResults[i].points[u4].x},${allProjectionResults[i].points[u4].y},${allProjectionResults[i].points[u4].z}`);
9675
9675
  }
9676
- if (wallLines && wallLines.length && wallVerifyType && wallVerifyType.length && wallVerifyType.includes(word)) {
9677
- threePoints = checkNearObjects(wallLines, threePoints);
9676
+ if (wallLines) {
9677
+ if (wallVerifyType.type1 && wallVerifyType.type1.length && wallVerifyType.type1.includes(word))
9678
+ threePoints = checkNearObjects(wallLines, threePoints);
9679
+ else if (wallVerifyType.type2 && wallVerifyType.type2.length && wallVerifyType.type2.includes(word))
9680
+ threePoints = checkNearObjects(wallLines, threePoints, true);
9678
9681
  }
9679
9682
  let floorZ = -99999;
9680
9683
  if (word === "floor") {
@@ -9789,9 +9792,9 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9789
9792
  let tol = 0.5;
9790
9793
  let f = calculateClosePointWithOBB(sourceItem.points, targetItem.obb);
9791
9794
  let boxVecJ = getObbLongSideDirection(targetItem.obb);
9792
- if (boxVecJ.length > 0.3 && boxVecK.length > 0.3 || f > 0.3) {
9795
+ if (boxVecJ.length > 0.2 && boxVecK.length > 0.2 || f > 0.3) {
9793
9796
  let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
9794
- if (!isPPPP || !isPPPP.parallel) {
9797
+ if ((!isPPPP || !isPPPP.parallel) && f < 0.8) {
9795
9798
  continue;
9796
9799
  }
9797
9800
  }
@@ -9882,9 +9885,9 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9882
9885
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
9883
9886
  let boxVecK = getObbLongSideDirection(array[k].obb);
9884
9887
  let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
9885
- if (boxVecJ.length > 0.3 && boxVecK.length > 0.3 || f > 0.3) {
9888
+ if (boxVecJ.length > 0.2 && boxVecK.length > 0.2 || f > 0.3) {
9886
9889
  let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
9887
- if ((!isPPPP || !isPPPP.parallel) && f < 0.65) {
9890
+ if ((!isPPPP || !isPPPP.parallel) && f < 0.8) {
9888
9891
  continue;
9889
9892
  }
9890
9893
  }
@@ -11924,7 +11927,7 @@ function obbContainsPoint(obb, point2, epsilon3 = 1e-6) {
11924
11927
  const z = v2.dot(zAxis);
11925
11928
  return Math.abs(x) <= h.x + epsilon3 && Math.abs(y) <= h.y + epsilon3 && Math.abs(z) <= h.z + epsilon3;
11926
11929
  }
11927
- var checkNearObjects = (lines, objPoints) => {
11930
+ var checkNearObjects = (lines, objPoints, delWallPoints = false) => {
11928
11931
  const CELL = 0.1;
11929
11932
  const grid = /* @__PURE__ */ new Map();
11930
11933
  const THRESHOLD_SQ = 0.03 * 0.03;
@@ -11968,13 +11971,16 @@ var checkNearObjects = (lines, objPoints) => {
11968
11971
  _pcdPoints.push(p);
11969
11972
  }
11970
11973
  }
11971
- let __pcdPoints = [];
11972
- for (const p of _pcdPoints) {
11973
- if (!pointInRectRegion(p, rectRegions, 0.03)) {
11974
- __pcdPoints.push(p);
11974
+ if (delWallPoints) {
11975
+ let __pcdPoints = [];
11976
+ for (const p of _pcdPoints) {
11977
+ if (!pointInRectRegion(p, rectRegions, 0.03)) {
11978
+ __pcdPoints.push(p);
11979
+ }
11975
11980
  }
11981
+ return __pcdPoints;
11976
11982
  }
11977
- return __pcdPoints;
11983
+ return _pcdPoints;
11978
11984
  };
11979
11985
 
11980
11986
  // src/utils/clusert.mjs
@@ -15266,7 +15272,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
15266
15272
  const windowPcdLen = windowPcdSt.distanceTo(windowPcdEd);
15267
15273
  const windowPcdHeight = Math.abs(windowPcd.maxZ - windowPcd.minZ);
15268
15274
  let windowHeight = beamTmpSt.z - doorTmpSt.z;
15269
- const windowLen = doorTmpSt.distanceTo(doorTmpEd);
15275
+ let windowLen = doorTmpSt.distanceTo(doorTmpEd);
15270
15276
  let changeWindowSize = false;
15271
15277
  let windowSizeThreshold = 0.3;
15272
15278
  if ((Math.abs(windowPcdLen - windowLen) < windowSizeThreshold || windowPcdLen > windowLen) && (Math.abs(windowPcdHeight - windowHeight) < windowSizeThreshold || windowPcdHeight > windowHeight)) {
@@ -15375,6 +15381,12 @@ var getWindowData = (lines, pcdData, lineReader) => {
15375
15381
  beamTmpEd = doorTmpEd.clone();
15376
15382
  beamTmpSt.z = beamTmpEd.z = windowPcd.maxZ;
15377
15383
  }
15384
+ windowLen = doorTmpSt.distanceTo(doorTmpEd);
15385
+ if (windowLen * 2 < windowPcdLen) {
15386
+ pcdData[windowDatas[findDoorDataIndex].index].isFindWindow = false;
15387
+ windowDatas[findDoorDataIndex].isFind = false;
15388
+ continue;
15389
+ }
15378
15390
  let isOverlap = false;
15379
15391
  for (let m = 0; m < allDoorLines1.length; m++) {
15380
15392
  let result = classifySegments(allDoorLines1[m].start, allDoorLines1[m].end, doorTmpSt, doorTmpEd);
@@ -15394,8 +15406,11 @@ var getWindowData = (lines, pcdData, lineReader) => {
15394
15406
  continue;
15395
15407
  }
15396
15408
  let afterDoorLen = doorTmpEd.distanceTo(doorTmpSt);
15397
- if (afterDoorLen < 0.4 && !isWindow || afterDoorLen < 0.3 && isWindow)
15409
+ if (afterDoorLen < 0.4 && !isWindow || afterDoorLen < 0.3 && isWindow) {
15410
+ pcdData[windowDatas[findDoorDataIndex].index].isFindWindow = false;
15411
+ windowDatas[findDoorDataIndex].isFind = false;
15398
15412
  continue;
15413
+ }
15399
15414
  let doorType = "";
15400
15415
  let groundClearance = doorTmpSt.z - line2.start.z > 1e-4 ? doorTmpSt.z - line2.start.z : 0;
15401
15416
  windowHeight = beamTmpSt.z - doorTmpSt.z;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.134",
3
+ "version": "1.0.136",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",