rm-graphical-computing-node 1.0.62 → 1.0.64

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 +54 -0
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -11844,6 +11844,59 @@ var getWindowData = (lines, pcdData, lineReader) => {
11844
11844
  lines.push(...tmpLines);
11845
11845
  return { lines, pcdData };
11846
11846
  };
11847
+ var checkWindowAndDoorIsTrue = async (lines, runDataList, collectDataPath, pointCloudCluster = null) => {
11848
+ if (!lines.length)
11849
+ return;
11850
+ const windowLines = [];
11851
+ for (let i = 0; i < lines.length; i++) {
11852
+ const line2 = lines[i];
11853
+ if (line2.drawWindow && line2.drawWindow.length || line2.drawDoorData && line2.drawDoorData.start) {
11854
+ line2.saveExistSegments = true;
11855
+ getOneLineCheckResults(line2, false);
11856
+ line2.checkResults = line2.existSegments;
11857
+ windowLines.push(line2);
11858
+ }
11859
+ }
11860
+ let trajectoryObj = {};
11861
+ for (let r = 0; r < runDataList.length; r++) {
11862
+ trajectoryObj[r] = runDataList[r];
11863
+ }
11864
+ await penetratingTask(windowLines, trajectoryObj, collectDataPath, 1);
11865
+ for (let i = 0; i < windowLines.length; i++) {
11866
+ let len = 0;
11867
+ for (let u4 = 0; u4 < windowLines[i].checkResults.length; u4++)
11868
+ len = windowLines[i].checkResults[u4].allCenterPoints.length;
11869
+ const allCenterPoints = windowLines[i].allCenterPoints;
11870
+ let newPoints = [];
11871
+ if (pointCloudCluster != null) {
11872
+ let clusterResult = pointCloudCluster([allCenterPoints], {
11873
+ tolerance: 0.2,
11874
+ minClusterSize: 30,
11875
+ maxClusterSize: 1e7,
11876
+ threadCount: 1
11877
+ });
11878
+ if (clusterResult.length > 0) {
11879
+ let maxNum = 0;
11880
+ for (const cluster of clusterResult[0]) {
11881
+ if (cluster.length < 50) continue;
11882
+ const newOriginalPoints = cluster.map((i2) => allCenterPoints[i2]);
11883
+ if (maxNum < newOriginalPoints.length) {
11884
+ maxNum = newOriginalPoints.length;
11885
+ newPoints = newOriginalPoints;
11886
+ }
11887
+ }
11888
+ } else
11889
+ newPoints = allCenterPoints;
11890
+ } else
11891
+ newPoints = allCenterPoints;
11892
+ let retNum = newPoints.length;
11893
+ let ps = retNum / len * 100;
11894
+ if (ps < 60) {
11895
+ windowLines[i].isRebuild = true;
11896
+ }
11897
+ }
11898
+ return lines;
11899
+ };
11847
11900
 
11848
11901
  // src/wall-window-matcher/utils.ts
11849
11902
  function dist2D(a, b) {
@@ -18026,6 +18079,7 @@ export {
18026
18079
  attachWindows,
18027
18080
  calcAngle3 as calcAngle,
18028
18081
  checkBeamIsReasonable,
18082
+ checkWindowAndDoorIsTrue,
18029
18083
  classifyWallByPointCloudPCA,
18030
18084
  processPipeline2 as classifyWallShapes,
18031
18085
  computeContour2 as computeContour,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.62",
3
+ "version": "1.0.64",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",