rm-graphical-computing-node 1.0.128 → 1.0.130

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 +61 -9
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9864,14 +9864,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9864
9864
  }
9865
9865
  if (
9866
9866
  /**array[k].type == 'door frame' || */
9867
- array[k].type == "window"
9867
+ array[k].type == "window" || array[k].type == "metal framing of interior glass partitions"
9868
9868
  ) {
9869
9869
  let tol = array[k].type == "door frame" ? 0.5 : 0.5;
9870
9870
  let boxVecK = getObbLongSideDirection(array[k].obb);
9871
- let f = calculateClosePointWithOBB(array[k].points, cloneData.obb);
9871
+ let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
9872
9872
  if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3 || f > 0.3) {
9873
9873
  let isPPPP = isParallel(boxVecJ, boxVecK, tol);
9874
- if (!isPPPP || !isPPPP.parallel) {
9874
+ if ((!isPPPP || !isPPPP.parallel) && f < 0.8) {
9875
9875
  continue;
9876
9876
  }
9877
9877
  }
@@ -9884,6 +9884,10 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9884
9884
  isMerge = cloneData.obb.intersectsOBB(array[k].obb, 0.01);
9885
9885
  if (!isMerge)
9886
9886
  isMerge = obbContainsOBB(cloneData.obb, array[k].obb);
9887
+ if (!isMerge) {
9888
+ let f = calculateClosePointWithOBB(array[k].points, cloneData.obb, 1);
9889
+ isMerge = f > 0.8;
9890
+ }
9887
9891
  }
9888
9892
  if (isMerge) {
9889
9893
  delData.add(k);
@@ -9955,9 +9959,40 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9955
9959
  });
9956
9960
  let beforeLength = newArray.length;
9957
9961
  if (clusterResult.length > 0 && clusterResult[0].length > 1) {
9958
- for (const cluster of clusterResult[0]) {
9959
- if (cluster.length < 50) continue;
9960
- const newOriginalPoints = cluster.map((i2) => points[i2]);
9962
+ if (type2 != "window") {
9963
+ for (const cluster of clusterResult[0]) {
9964
+ if (cluster.length < 50) continue;
9965
+ const newOriginalPoints = cluster.map((i2) => points[i2]);
9966
+ const centerData = getCenterAndPointHeight(newOriginalPoints);
9967
+ let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
9968
+ const data = {
9969
+ points: newOriginalPoints,
9970
+ path: computeContour(pathPoints),
9971
+ h: centerData.h,
9972
+ minz: centerData.minz,
9973
+ maxz: centerData.maxz,
9974
+ center: { x: centerData.x, y: centerData.y, z: centerData.z },
9975
+ type: type2,
9976
+ averagePz: averagePz3,
9977
+ obb: null,
9978
+ obj_id,
9979
+ positionArr,
9980
+ isStaircaseBalconyRailing,
9981
+ mapPosition: array[i].mapPosition
9982
+ };
9983
+ data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
9984
+ if (data.obb == null) continue;
9985
+ newArray.push(data);
9986
+ }
9987
+ } else {
9988
+ const newOriginalPoints = [];
9989
+ for (const cluster of clusterResult[0]) {
9990
+ if (cluster.length < 50) continue;
9991
+ let tmpPts = cluster.map((i2) => points[i2]);
9992
+ for (const p of tmpPts) {
9993
+ newOriginalPoints.push(p);
9994
+ }
9995
+ }
9961
9996
  const centerData = getCenterAndPointHeight(newOriginalPoints);
9962
9997
  let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
9963
9998
  const data = {
@@ -9972,7 +10007,8 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9972
10007
  obb: null,
9973
10008
  obj_id,
9974
10009
  positionArr,
9975
- isStaircaseBalconyRailing
10010
+ isStaircaseBalconyRailing,
10011
+ mapPosition: array[i].mapPosition
9976
10012
  };
9977
10013
  data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
9978
10014
  if (data.obb == null) continue;
@@ -10340,6 +10376,14 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
10340
10376
  array[j].isDel = true;
10341
10377
  }
10342
10378
  }
10379
+ if (type == "metal framing of interior glass partitions") {
10380
+ const size = new THREE8.Vector3();
10381
+ array[j].obb.getSize(size);
10382
+ let volume = size.x * size.y * size.z;
10383
+ if (size.x < 0.1 || size.y < 0.1 || size.z < 0.1 || volume < 0.1) {
10384
+ array[j].isDel = true;
10385
+ }
10386
+ }
10343
10387
  }
10344
10388
  }
10345
10389
  for (let i = 0; i < pcdPointsArr.length; i++) {
@@ -15611,6 +15655,8 @@ var getWindowPcdData = (lines, pcdData) => {
15611
15655
  if (maxIndex == -1)
15612
15656
  continue;
15613
15657
  const line2 = tmpLines[maxIndex];
15658
+ if (line2.length < 0.5)
15659
+ continue;
15614
15660
  let ptStart = getPt3(line2.start);
15615
15661
  let ptEnd = getPt3(line2.end);
15616
15662
  ptStart.z = ptEnd.z = ptShortEd1.z;
@@ -15629,8 +15675,10 @@ var getWindowPcdData = (lines, pcdData) => {
15629
15675
  tmpptShortEd1 = tmpptShortEd1.addScaledVector(vec1, 0.1);
15630
15676
  tmpptShortSt2 = tmpptShortSt2.addScaledVector(vec2, -0.1);
15631
15677
  tmpptShortEd2 = tmpptShortEd2.addScaledVector(vec2, 0.1);
15632
- let intersect1 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt1, tmpptShortEd1, pcdToLineDist);
15633
- let intersect2 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt2, tmpptShortEd2, pcdToLineDist);
15678
+ let pcdLen = ptLongSt1.distanceTo(ptLongEd1);
15679
+ let tmpTol = pcdLen > pcdToLineDist + 0.2 ? pcdToLineDist : 0.1;
15680
+ let intersect1 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt1, tmpptShortEd1, tmpTol);
15681
+ let intersect2 = segmentsIntersect2D(tmpptStart, tmpptEnd, tmpptShortSt2, tmpptShortEd2, tmpTol);
15634
15682
  let windowLocationIsTrue = true;
15635
15683
  let windowData = {
15636
15684
  p: null,
@@ -15691,6 +15739,10 @@ var getWindowPcdData = (lines, pcdData) => {
15691
15739
  windowData.height = height;
15692
15740
  windowData.width = ptWindowSt.distanceTo(ptWindowEd);
15693
15741
  windowData.obj_id = pcd.obj_id;
15742
+ let lineMid = getMid(ptStart, ptEnd);
15743
+ let dist2 = lineMid.distanceTo(p);
15744
+ if (dist2 > line2.length / 2)
15745
+ continue;
15694
15746
  if ((line2.isPassageEntrance || line2.inPassageEntranceDoor) && line2.passageEntrance && line2.passageEntrance.length == 1) {
15695
15747
  const ret = checkWindowLocationIsTrue(windowData, line2.passageEntrance);
15696
15748
  windowLocationIsTrue = ret.windowLocationIsTrue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.128",
3
+ "version": "1.0.130",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",