rm-graphical-computing-node 1.0.167 → 1.0.168

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 +63 -1
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -14128,7 +14128,7 @@ var drawStaircase = (pcdPointsArr, scene) => {
14128
14128
  }
14129
14129
  return pointCloudGroup;
14130
14130
  };
14131
- var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.2, wallLinesDelPs = 0.2) => {
14131
+ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averagePz2, pointCloudCluster = null, tolerancePointCloudCluster = 0.1, wallLinesDelPs = 0.2) => {
14132
14132
  if (allProjectionResults.length == 0) return [];
14133
14133
  if (!averagePz2) averagePz2 = allProjectionResults[0].averagePz;
14134
14134
  const pcdPointsArr = [];
@@ -14603,6 +14603,68 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14603
14603
  if (!delData.has(j))
14604
14604
  newnewData.push(array[j]);
14605
14605
  }
14606
+ if (pointCloudCluster != null) {
14607
+ let delArray = /* @__PURE__ */ new Set();
14608
+ let newArray = [];
14609
+ for (let j = 0; j < newnewData.length; j++) {
14610
+ if (delArray.has(j)) continue;
14611
+ let points = newnewData[j].points;
14612
+ let obj_id = newnewData[j].obj_id;
14613
+ let type = newnewData[j].type;
14614
+ let averagePz3 = newnewData[j].averagePz;
14615
+ let positionArr = newnewData[j].positionArr;
14616
+ let isStaircaseBalconyRailing = newnewData[j].isStaircaseBalconyRailing;
14617
+ if (points.length < 50)
14618
+ continue;
14619
+ let clusterResult = pointCloudCluster([points], {
14620
+ tolerance: tolerancePointCloudCluster,
14621
+ minClusterSize: 50,
14622
+ maxClusterSize: 1e7,
14623
+ threadCount: 1
14624
+ });
14625
+ let beforeLength = newArray.length;
14626
+ if (clusterResult.length > 0 && clusterResult[0].length > 1) {
14627
+ let add = 1;
14628
+ for (const cluster of clusterResult[0]) {
14629
+ if (cluster.length < 50) continue;
14630
+ const newOriginalPoints = cluster.map((i) => points[i]);
14631
+ const centerData = getCenterAndPointHeight(newOriginalPoints);
14632
+ let pathPoints = newOriginalPoints.map((p) => [p.x, p.y]);
14633
+ const data = {
14634
+ points: newOriginalPoints,
14635
+ path: computeContour(pathPoints),
14636
+ h: centerData.h,
14637
+ minz: centerData.minz,
14638
+ maxz: centerData.maxz,
14639
+ center: { x: centerData.x, y: centerData.y, z: centerData.z },
14640
+ type,
14641
+ averagePz: averagePz3,
14642
+ obb: null,
14643
+ obj_id: obj_id + `_${add}`,
14644
+ positionArr,
14645
+ isStaircaseBalconyRailing,
14646
+ mapPosition: newnewData[j]?.mapPosition
14647
+ };
14648
+ data.obb = getObb(data.path, data.center, data.h, (data.maxz + data.minz) / 2);
14649
+ if (data.obb == null) continue;
14650
+ newArray.push(data);
14651
+ add++;
14652
+ }
14653
+ }
14654
+ if (newArray.length != beforeLength) {
14655
+ delArray.add(j);
14656
+ }
14657
+ }
14658
+ if (delArray.size > 0) {
14659
+ for (let j = 0; j < newnewData.length; j++) {
14660
+ if (!delArray.has(j)) {
14661
+ newArray.push(newnewData[j]);
14662
+ }
14663
+ }
14664
+ newnewData.length = 0;
14665
+ newnewData.push(...newArray);
14666
+ }
14667
+ }
14606
14668
  delData.clear();
14607
14669
  for (let j = 0; j < newnewData.length; j++) {
14608
14670
  if (newnewData[j].obb == null || delData.has(j))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.167",
3
+ "version": "1.0.168",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",