rm-graphical-computing-node 1.0.132 → 1.0.133

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 +28 -21
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3658,23 +3658,30 @@ var mergeLines = (lines) => {
3658
3658
  }
3659
3659
  return newLines;
3660
3660
  };
3661
- var pointInRectRegion = (point2, rect, epsilon3 = 1e-6) => {
3662
- if (rect.length !== 4)
3663
- return false;
3664
- const [p0, p1, p2, p3] = rect;
3665
- const ptBottom1 = p0;
3666
- const ptBottom2 = p0.z == p1.z ? p1 : p3;
3667
- let line2 = new THREE3.Line3(ptBottom1, ptBottom2);
3668
- let copyPoint = getPt3(point2);
3669
- copyPoint.z = ptBottom1.z;
3670
- const closestPoint = line2.closestPointToPoint(copyPoint, true, new THREE3.Vector3());
3671
- const distance2 = closestPoint.distanceTo(copyPoint);
3672
- if (distance2 > epsilon3)
3673
- return false;
3674
- const { minZ, maxZ } = getPointsMinAndMax(rect);
3675
- if (point2.z > minZ - epsilon3 && point2.z < maxZ + epsilon3)
3676
- return true;
3677
- return false;
3661
+ var pointInRectRegion = (point2, regions, epsilon3 = 1e-6) => {
3662
+ let isInside = false;
3663
+ for (let i = 0; i < regions.length; i++) {
3664
+ const rect = regions[i];
3665
+ if (rect.length !== 4)
3666
+ return false;
3667
+ const [p0, p1, p2, p3] = rect;
3668
+ const ptBottom1 = p0;
3669
+ const ptBottom2 = p1;
3670
+ let line2 = new THREE3.Line3(ptBottom1, ptBottom2);
3671
+ let copyPoint = getPt3(point2);
3672
+ copyPoint.z = ptBottom1.z;
3673
+ const closestPoint = line2.closestPointToPoint(copyPoint, true, new THREE3.Vector3());
3674
+ const distance2 = closestPoint.distanceTo(copyPoint);
3675
+ if (distance2 > epsilon3) {
3676
+ continue;
3677
+ }
3678
+ const { minZ, maxZ } = getPointsMinAndMax(rect);
3679
+ if (point2.z > minZ - epsilon3 && point2.z < maxZ + epsilon3) {
3680
+ isInside = true;
3681
+ break;
3682
+ }
3683
+ }
3684
+ return isInside;
3678
3685
  };
3679
3686
 
3680
3687
  // src/utils/updateLine.mjs
@@ -11931,8 +11938,8 @@ var checkNearObjects = (lines, objPoints) => {
11931
11938
  const rect = [];
11932
11939
  rect.push(getPt3(line2.start));
11933
11940
  rect.push(getPt3(line2.end));
11934
- rect.push(getPt3(new THREE8.Vector3(line2.end.x, line2.end.y, line2.rooftopPz)));
11935
- rect.push(getPt3(new THREE8.Vector3(line2.start.x, line2.start.y, line2.rooftopPz)));
11941
+ rect.push(getPt3(new THREE8.Vector3(line2.end.x, line2.end.y, line2.rooftopPz ? line2.rooftopPz : line2.end.z)));
11942
+ rect.push(getPt3(new THREE8.Vector3(line2.start.x, line2.start.y, line2.rooftopPz ? line2.rooftopPz : line2.start.z)));
11936
11943
  rectRegions.push(rect);
11937
11944
  }
11938
11945
  function hasNearbyPoint(p) {
@@ -11963,7 +11970,7 @@ var checkNearObjects = (lines, objPoints) => {
11963
11970
  }
11964
11971
  let __pcdPoints = [];
11965
11972
  for (const p of _pcdPoints) {
11966
- if (!pointInRectRegion(p, rectRegions, 0.1)) {
11973
+ if (!pointInRectRegion(p, rectRegions, 0.03)) {
11967
11974
  __pcdPoints.push(p);
11968
11975
  }
11969
11976
  }
@@ -15411,7 +15418,7 @@ var getWindowData = (lines, pcdData, lineReader) => {
15411
15418
  let inRectNum = 0;
15412
15419
  for (let b = 0; b < checkResultsNum; b++) {
15413
15420
  let pt = region.centerPts[b];
15414
- if (pointInRectRegion(pt, rectPts, 0.01))
15421
+ if (pointInRectRegion(pt, [rectPts], 0.01))
15415
15422
  inRectNum++;
15416
15423
  }
15417
15424
  let inRectPercentage = inRectNum / checkResultsNum;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.132",
3
+ "version": "1.0.133",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",