rm-graphical-computing-node 1.0.117 → 1.0.119

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 +53 -3
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -9613,7 +9613,7 @@ var drawStaircase = (pcdPointsArr, scene) => {
9613
9613
  }
9614
9614
  return pointCloudGroup;
9615
9615
  };
9616
- var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.1) => {
9616
+ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.2) => {
9617
9617
  if (allProjectionResults.length == 0) return [];
9618
9618
  if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
9619
9619
  const pcdPointsArr = [];
@@ -9744,6 +9744,55 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9744
9744
  }
9745
9745
  }
9746
9746
  }
9747
+ function appendPcdObj(targetType, sourceType) {
9748
+ const targetData = pcdPointsArr.find((item) => item.type == targetType);
9749
+ const sourceData = pcdPointsArr.find((item) => item.type == sourceType);
9750
+ if (targetData && sourceData && targetData.array.length > 0 && sourceData.array.length > 0) {
9751
+ for (let i = 0; i < sourceData.array.length; i++) {
9752
+ const sourceItem = sourceData.array[i];
9753
+ if (sourceItem.obb == null) continue;
9754
+ for (let j = 0; j < targetData.array.length; j++) {
9755
+ const targetItem = targetData.array[j];
9756
+ if (targetItem.obb == null) continue;
9757
+ if (targetType == "window" && sourceType == "balcony railing" && !targetItem.isHasTie) {
9758
+ continue;
9759
+ }
9760
+ let isMerge = sourceItem.obb.intersectsOBB(targetItem.obb, 0.01);
9761
+ if (!isMerge)
9762
+ isMerge = obbContainsOBB(sourceItem.obb, targetItem.obb);
9763
+ if (isMerge) {
9764
+ for (let m = 0; m < sourceItem.points.length; m++) {
9765
+ targetItem.points.push(sourceItem.points[m]);
9766
+ }
9767
+ let tmpPoints = targetItem.points.map((p) => [p.x, p.y]);
9768
+ if (targetType == "window" && sourceType == "metal framing of interior glass partitions") {
9769
+ targetItem.isHasTie = true;
9770
+ }
9771
+ targetItem.path = computeContour(tmpPoints);
9772
+ const centerData = getCenterAndPointHeight(targetItem.points);
9773
+ targetItem.h = centerData.h;
9774
+ targetItem.minz = centerData.minz;
9775
+ targetItem.maxz = centerData.maxz;
9776
+ targetItem.center = { x: centerData.x, y: centerData.y, z: centerData.z };
9777
+ let newObb = getObb(targetItem.path, targetItem.center, targetItem.h, (targetItem.maxz + targetItem.minz) / 2);
9778
+ if (newObb != null)
9779
+ targetItem.obb = newObb;
9780
+ targetItem.positionArr.push(...sourceItem.positionArr);
9781
+ sourceData.array.splice(i, 1);
9782
+ i = -1;
9783
+ break;
9784
+ }
9785
+ }
9786
+ }
9787
+ }
9788
+ }
9789
+ console.time("appendPcdObj");
9790
+ appendPcdObj("window", "door frame");
9791
+ appendPcdObj("window", "metal framing of interior glass partitions");
9792
+ appendPcdObj("balcony railing", "metal framing of interior glass partitions");
9793
+ appendPcdObj("window", "balcony railing");
9794
+ appendPcdObj("window", "door frame");
9795
+ console.timeEnd("appendPcdObj");
9747
9796
  for (let i = 0; i < pcdPointsArr.length; i++) {
9748
9797
  const array = pcdPointsArr[i].array;
9749
9798
  const delData = /* @__PURE__ */ new Set();
@@ -9791,10 +9840,11 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
9791
9840
  if (cloneData.type == "pipe" && array[k].type == "pipe" && pipeIsVerticalJ != pipeIsVerticalK) {
9792
9841
  continue;
9793
9842
  }
9794
- if (array[k].type == "door frame") {
9843
+ if (array[k].type == "door frame" || array[k].type == "window") {
9844
+ let tol = array[k].type == "door frame" ? 0.2 : 0.5;
9795
9845
  let boxVecK = getObbLongSideDirection(array[k].obb);
9796
9846
  if (boxVecJ.length() > 0.3 && boxVecK.length() > 0.3) {
9797
- let isPPPP = isParallel(boxVecJ, boxVecK, 0.2);
9847
+ let isPPPP = isParallel(boxVecJ, boxVecK, tol);
9798
9848
  if (!isPPPP || !isPPPP.parallel) {
9799
9849
  continue;
9800
9850
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.117",
3
+ "version": "1.0.119",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",