rm-graphical-computing-node 1.0.161 → 1.0.162

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 +564 -11
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -14535,31 +14535,116 @@ var getMergeMeaning = (allProjectionResults, wallLines, wallVerifyType, averageP
14535
14535
  if (windowArray) {
14536
14536
  const delData = /* @__PURE__ */ new Set();
14537
14537
  const array = windowArray.array;
14538
+ const newnewData = [];
14538
14539
  for (let j = 0; j < array.length; j++) {
14539
- if (array[j].obb == null || delData.has(j))
14540
+ const result = splitLShapePointCloud(array[j].points, {
14541
+ threshold: 0.02,
14542
+ iterations: 2e3,
14543
+ minInliers: 100,
14544
+ sampleSize: 12e3,
14545
+ maxPlanes: 10,
14546
+ minPlaneRatio: 0.03,
14547
+ singlePlaneRatio: 0.9
14548
+ });
14549
+ if (result.isSplit) {
14550
+ delData.add(j);
14551
+ for (let h = 0; h < result.faces.length; h++) {
14552
+ let tmppoints = result.faces[h].map((p) => [p.x, p.y]);
14553
+ let cloneA = {
14554
+ points: result.faces[h],
14555
+ path: computeContour(tmppoints),
14556
+ h: array[j].h,
14557
+ minz: array[j].minz,
14558
+ maxz: array[j].maxz,
14559
+ center: { x: array[j].x, y: array[j].y, z: array[j].z },
14560
+ obj_id: array[j].obj_id + `${h}`,
14561
+ type: array[j].word,
14562
+ averagePz: array[j].averagePz,
14563
+ obb: null,
14564
+ isDel: false,
14565
+ positionArr: array[j].positionArr,
14566
+ isStaircaseBalconyRailing: false,
14567
+ mapPosition: array[j].averagePz.mapPosition
14568
+ };
14569
+ cloneA.obb = getObb(cloneA.path, cloneA.center, cloneA.h, (cloneA.maxz + cloneA.minz) / 2);
14570
+ if (cloneA.obb != null) newnewData.push(cloneA);
14571
+ }
14572
+ }
14573
+ }
14574
+ for (let j = 0; j < array.length; j++) {
14575
+ if (!delData.has(j))
14576
+ newnewData.push(array[j]);
14577
+ }
14578
+ delData.clear();
14579
+ for (let j = 0; j < newnewData.length; j++) {
14580
+ if (newnewData[j].obb == null || delData.has(j))
14540
14581
  continue;
14541
- const arrayJ = array[j];
14542
- if (arrayJ.obb == null)
14582
+ const cloneData = {
14583
+ ...newnewData[j],
14584
+ obb: newnewData[j].obb.clone()
14585
+ };
14586
+ if (cloneData.obb == null)
14543
14587
  continue;
14544
- for (let k = 0; k < array.length; k++) {
14545
- if (array[k].obb == null || delData.has(k) || j == k)
14588
+ let boxVecJ = null;
14589
+ boxVecJ = getObbLongSideDirection(cloneData.obb);
14590
+ let finMergeObj = false;
14591
+ for (let k = 0; k < newnewData.length; k++) {
14592
+ if (newnewData[k].obb == null || delData.has(k) || j == k)
14546
14593
  continue;
14547
- let obbPointsClone = getOBBPoints(arrayJ.obb);
14548
- let polygonK = array[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14594
+ let tol = 0.5;
14595
+ let boxVecK = getObbLongSideDirection(newnewData[k].obb);
14596
+ let obbPointsClone = getOBBPoints(cloneData.obb);
14597
+ let polygonK = newnewData[k].path.map((point2) => new THREE8.Vector3(point2[0], point2[1], 0));
14549
14598
  let polygonJ = [obbPointsClone[0], obbPointsClone[1], obbPointsClone[2], obbPointsClone[3]];
14550
14599
  polygonJ = setPointsSameZ(polygonJ, 0);
14551
14600
  let f = getPolygonIntersectionRatio(polygonK, polygonJ);
14552
- if (f > 80) {
14601
+ if (boxVecJ.length > 0.2 && boxVecK.length > 0.2 || f > 30) {
14602
+ let isPPPP = isParallel(boxVecJ.direction, boxVecK.direction, tol);
14603
+ if ((!isPPPP || !isPPPP.parallel) && f < 80) {
14604
+ continue;
14605
+ }
14606
+ }
14607
+ let isMerge = cloneData.obb.intersectsOBB(newnewData[k].obb, 0.01);
14608
+ if (!isMerge)
14609
+ isMerge = obbContainsOBB(cloneData.obb, newnewData[k].obb);
14610
+ if (!isMerge) {
14611
+ let f2 = calculateClosePointWithOBB(newnewData[k].points, cloneData.obb, 1);
14612
+ isMerge = f2 > 0.8;
14613
+ }
14614
+ if (isMerge) {
14553
14615
  delData.add(k);
14616
+ let threePoints = [];
14617
+ let threePointsStr = [];
14618
+ for (let m = 0; m < newnewData[k].points.length; m++) {
14619
+ cloneData.points.push(newnewData[k].points[m]);
14620
+ threePoints.push(newnewData[k].points[m]);
14621
+ threePointsStr.push(`${newnewData[k].points[m].x},${newnewData[k].points[m].y},${newnewData[k].points[m].z}`);
14622
+ }
14623
+ let tmpPoints = cloneData.points.map((p) => [p.x, p.y]);
14624
+ tmpPoints = voxelDownsample2DForContour(tmpPoints, 0.1);
14625
+ cloneData.path = computeContour(tmpPoints);
14626
+ const centerData = getCenterAndPointHeight(cloneData.points);
14627
+ cloneData.h = centerData.h;
14628
+ cloneData.minz = centerData.minz;
14629
+ cloneData.maxz = centerData.maxz;
14630
+ cloneData.center = { x: centerData.x, y: centerData.y, z: centerData.z };
14631
+ let newObb = getObb(cloneData.path, cloneData.center, cloneData.h, (cloneData.maxz + cloneData.minz) / 2);
14632
+ if (newObb != null)
14633
+ cloneData.obb = newObb;
14634
+ boxVecJ = getObbLongSideDirection(cloneData.obb);
14554
14635
  k = -1;
14555
- continue;
14636
+ finMergeObj = true;
14556
14637
  }
14557
14638
  }
14639
+ if (finMergeObj) {
14640
+ delData.add(j);
14641
+ newnewData.push(cloneData);
14642
+ }
14558
14643
  }
14559
14644
  const newData = [];
14560
- for (let j = 0; j < array.length; j++) {
14645
+ for (let j = 0; j < newnewData.length; j++) {
14561
14646
  if (!delData.has(j))
14562
- newData.push(array[j]);
14647
+ newData.push(newnewData[j]);
14563
14648
  }
14564
14649
  windowArray.array = newData;
14565
14650
  }
@@ -16499,6 +16584,474 @@ var checkNearObjects = (grid, rectRegions, objPoints, delWallPoints = false) =>
16499
16584
  }
16500
16585
  return _pcdPoints;
16501
16586
  };
16587
+ function splitLShapePointCloud(points, options = {}) {
16588
+ if (!Array.isArray(points) || points.length === 0) {
16589
+ return {
16590
+ isSplit: false,
16591
+ faces: [points || []],
16592
+ noise: [],
16593
+ planes: [],
16594
+ stats: {
16595
+ planeCount: 0,
16596
+ totalPoints: 0
16597
+ }
16598
+ };
16599
+ }
16600
+ const {
16601
+ // 点到平面的最大距离,单位与坐标一致
16602
+ threshold = 0.02,
16603
+ // 每次提取平面的 RANSAC 迭代次数
16604
+ iterations = 2e3,
16605
+ // 每个平面至少需要的样本内点数
16606
+ minInliers = 100,
16607
+ // 随机抽样数量
16608
+ sampleSize = 12e3,
16609
+ // 最多识别多少个平面
16610
+ maxPlanes = 10,
16611
+ // 平面内点至少占抽样点的比例
16612
+ minPlaneRatio = 0.03,
16613
+ // 判断是否为单平面的覆盖比例
16614
+ singlePlaneRatio = 0.9,
16615
+ // PCA 精拟合迭代次数
16616
+ refineIterations = 3,
16617
+ // 是否允许交界点同时属于多个面
16618
+ duplicateBoundaryPoints = false,
16619
+ // 随机种子
16620
+ seed = 12345
16621
+ } = options;
16622
+ const thresholdSq = threshold * threshold;
16623
+ const validPoints = [];
16624
+ const invalidPoints = [];
16625
+ for (const p of points) {
16626
+ if (p && Number.isFinite(p.x) && Number.isFinite(p.y) && Number.isFinite(p.z)) {
16627
+ validPoints.push(p);
16628
+ } else {
16629
+ invalidPoints.push(p);
16630
+ }
16631
+ }
16632
+ if (validPoints.length < 3) {
16633
+ return {
16634
+ isSplit: false,
16635
+ faces: [points],
16636
+ noise: [],
16637
+ planes: [],
16638
+ stats: {
16639
+ planeCount: 0,
16640
+ totalPoints: points.length
16641
+ }
16642
+ };
16643
+ }
16644
+ let randomSeed = seed >>> 0;
16645
+ function random() {
16646
+ randomSeed = randomSeed * 1664525 + 1013904223 >>> 0;
16647
+ return randomSeed / 4294967296;
16648
+ }
16649
+ function createSample(data, size) {
16650
+ const count = Math.min(size, data.length);
16651
+ const indices = new Array(data.length);
16652
+ for (let i = 0; i < data.length; i++) {
16653
+ indices[i] = i;
16654
+ }
16655
+ for (let i = 0; i < count; i++) {
16656
+ const j = i + Math.floor(random() * (data.length - i));
16657
+ const temp = indices[i];
16658
+ indices[i] = indices[j];
16659
+ indices[j] = temp;
16660
+ }
16661
+ const result = new Array(count);
16662
+ for (let i = 0; i < count; i++) {
16663
+ result[i] = data[indices[i]];
16664
+ }
16665
+ return result;
16666
+ }
16667
+ const samplePoints = createSample(
16668
+ validPoints,
16669
+ sampleSize
16670
+ );
16671
+ function createPlaneFromThreePoints(p1, p2, p3) {
16672
+ const ax = p2.x - p1.x;
16673
+ const ay = p2.y - p1.y;
16674
+ const az = p2.z - p1.z;
16675
+ const bx = p3.x - p1.x;
16676
+ const by = p3.y - p1.y;
16677
+ const bz = p3.z - p1.z;
16678
+ let nx = ay * bz - az * by;
16679
+ let ny = az * bx - ax * bz;
16680
+ let nz = ax * by - ay * bx;
16681
+ const len = Math.sqrt(nx * nx + ny * ny + nz * nz);
16682
+ if (len < 1e-10) return null;
16683
+ nx /= len;
16684
+ ny /= len;
16685
+ nz /= len;
16686
+ const d = -(nx * p1.x + ny * p1.y + nz * p1.z);
16687
+ return { nx, ny, nz, d };
16688
+ }
16689
+ function pointPlaneDistanceSq(p, plane) {
16690
+ const d = plane.nx * p.x + plane.ny * p.y + plane.nz * p.z + plane.d;
16691
+ return d * d;
16692
+ }
16693
+ function smallestEigenVector(matrix) {
16694
+ const a = matrix.map((row) => row.slice());
16695
+ const v2 = [
16696
+ [1, 0, 0],
16697
+ [0, 1, 0],
16698
+ [0, 0, 1]
16699
+ ];
16700
+ for (let iter = 0; iter < 40; iter++) {
16701
+ let p = 0;
16702
+ let q = 1;
16703
+ let max2 = Math.abs(a[0][1]);
16704
+ if (Math.abs(a[0][2]) > max2) {
16705
+ p = 0;
16706
+ q = 2;
16707
+ max2 = Math.abs(a[0][2]);
16708
+ }
16709
+ if (Math.abs(a[1][2]) > max2) {
16710
+ p = 1;
16711
+ q = 2;
16712
+ max2 = Math.abs(a[1][2]);
16713
+ }
16714
+ if (max2 < 1e-12) break;
16715
+ const theta = 0.5 * Math.atan2(
16716
+ 2 * a[p][q],
16717
+ a[q][q] - a[p][p]
16718
+ );
16719
+ const c = Math.cos(theta);
16720
+ const s = Math.sin(theta);
16721
+ const app = a[p][p];
16722
+ const aqq = a[q][q];
16723
+ const apq = a[p][q];
16724
+ a[p][p] = c * c * app - 2 * s * c * apq + s * s * aqq;
16725
+ a[q][q] = s * s * app + 2 * s * c * apq + c * c * aqq;
16726
+ a[p][q] = 0;
16727
+ a[q][p] = 0;
16728
+ for (let k = 0; k < 3; k++) {
16729
+ if (k !== p && k !== q) {
16730
+ const akp = a[k][p];
16731
+ const akq = a[k][q];
16732
+ a[k][p] = c * akp - s * akq;
16733
+ a[p][k] = a[k][p];
16734
+ a[k][q] = s * akp + c * akq;
16735
+ a[q][k] = a[k][q];
16736
+ }
16737
+ }
16738
+ for (let k = 0; k < 3; k++) {
16739
+ const vkp = v2[k][p];
16740
+ const vkq = v2[k][q];
16741
+ v2[k][p] = c * vkp - s * vkq;
16742
+ v2[k][q] = s * vkp + c * vkq;
16743
+ }
16744
+ }
16745
+ let minIndex = 0;
16746
+ if (a[1][1] < a[minIndex][minIndex]) {
16747
+ minIndex = 1;
16748
+ }
16749
+ if (a[2][2] < a[minIndex][minIndex]) {
16750
+ minIndex = 2;
16751
+ }
16752
+ let nx = v2[0][minIndex];
16753
+ let ny = v2[1][minIndex];
16754
+ let nz = v2[2][minIndex];
16755
+ const len = Math.sqrt(nx * nx + ny * ny + nz * nz);
16756
+ if (len < 1e-12) return null;
16757
+ nx /= len;
16758
+ ny /= len;
16759
+ nz /= len;
16760
+ return { nx, ny, nz };
16761
+ }
16762
+ function fitPlanePCA(data) {
16763
+ if (data.length < 3) return null;
16764
+ let cx = 0;
16765
+ let cy = 0;
16766
+ let cz = 0;
16767
+ for (const p of data) {
16768
+ cx += p.x;
16769
+ cy += p.y;
16770
+ cz += p.z;
16771
+ }
16772
+ cx /= data.length;
16773
+ cy /= data.length;
16774
+ cz /= data.length;
16775
+ let xx = 0;
16776
+ let xy = 0;
16777
+ let xz = 0;
16778
+ let yy = 0;
16779
+ let yz = 0;
16780
+ let zz = 0;
16781
+ for (const p of data) {
16782
+ const x = p.x - cx;
16783
+ const y = p.y - cy;
16784
+ const z = p.z - cz;
16785
+ xx += x * x;
16786
+ xy += x * y;
16787
+ xz += x * z;
16788
+ yy += y * y;
16789
+ yz += y * z;
16790
+ zz += z * z;
16791
+ }
16792
+ const matrix = [
16793
+ [xx, xy, xz],
16794
+ [xy, yy, yz],
16795
+ [xz, yz, zz]
16796
+ ];
16797
+ const normal = smallestEigenVector(matrix);
16798
+ if (!normal) return null;
16799
+ const { nx, ny, nz } = normal;
16800
+ const d = -(nx * cx + ny * cy + nz * cz);
16801
+ return { nx, ny, nz, d };
16802
+ }
16803
+ function getInliers(data, plane) {
16804
+ const result = [];
16805
+ for (const p of data) {
16806
+ if (pointPlaneDistanceSq(p, plane) <= thresholdSq) {
16807
+ result.push(p);
16808
+ }
16809
+ }
16810
+ return result;
16811
+ }
16812
+ function ransacPlane(data) {
16813
+ if (data.length < 3) return null;
16814
+ let bestPlane = null;
16815
+ let bestInliers = [];
16816
+ let bestError = Infinity;
16817
+ for (let i = 0; i < iterations; i++) {
16818
+ const i1 = Math.floor(random() * data.length);
16819
+ let i2 = Math.floor(random() * data.length);
16820
+ let i3 = Math.floor(random() * data.length);
16821
+ if (i1 === i2 || i1 === i3 || i2 === i3) {
16822
+ continue;
16823
+ }
16824
+ const plane2 = createPlaneFromThreePoints(
16825
+ data[i1],
16826
+ data[i2],
16827
+ data[i3]
16828
+ );
16829
+ if (!plane2) continue;
16830
+ const inliers2 = [];
16831
+ let error = 0;
16832
+ for (const p of data) {
16833
+ const distSq = pointPlaneDistanceSq(p, plane2);
16834
+ if (distSq <= thresholdSq) {
16835
+ inliers2.push(p);
16836
+ error += distSq;
16837
+ }
16838
+ }
16839
+ if (inliers2.length > bestInliers.length || inliers2.length === bestInliers.length && error < bestError) {
16840
+ bestPlane = plane2;
16841
+ bestInliers = inliers2;
16842
+ bestError = error;
16843
+ }
16844
+ }
16845
+ if (!bestPlane) return null;
16846
+ let plane = bestPlane;
16847
+ let inliers = bestInliers;
16848
+ for (let i = 0; i < refineIterations; i++) {
16849
+ if (inliers.length < 3) break;
16850
+ const refined = fitPlanePCA(inliers);
16851
+ if (!refined) break;
16852
+ plane = refined;
16853
+ inliers = getInliers(data, plane);
16854
+ }
16855
+ if (inliers.length < 3) return null;
16856
+ const finalPlane = fitPlanePCA(inliers);
16857
+ if (finalPlane) {
16858
+ plane = finalPlane;
16859
+ inliers = getInliers(data, plane);
16860
+ }
16861
+ return {
16862
+ plane,
16863
+ inliers,
16864
+ count: inliers.length
16865
+ };
16866
+ }
16867
+ const remaining = samplePoints.slice();
16868
+ const detectedPlanes = [];
16869
+ const minRequired = Math.max(
16870
+ minInliers,
16871
+ Math.ceil(samplePoints.length * minPlaneRatio)
16872
+ );
16873
+ for (let i = 0; i < maxPlanes; i++) {
16874
+ if (remaining.length < minRequired) break;
16875
+ const result = ransacPlane(remaining);
16876
+ if (!result) break;
16877
+ if (result.count < minRequired) break;
16878
+ if (i === 0 && result.count / samplePoints.length >= singlePlaneRatio) {
16879
+ return {
16880
+ isSplit: false,
16881
+ faces: [points],
16882
+ noise: [],
16883
+ planes: [{
16884
+ ...result.plane,
16885
+ sampleInlierCount: result.count,
16886
+ sampleInlierRatio: result.count / samplePoints.length
16887
+ }],
16888
+ stats: {
16889
+ planeCount: 1,
16890
+ totalPoints: points.length,
16891
+ validPointCount: validPoints.length,
16892
+ samplePointCount: samplePoints.length,
16893
+ singlePlaneRatio: result.count / samplePoints.length,
16894
+ noiseCount: 0
16895
+ }
16896
+ };
16897
+ }
16898
+ detectedPlanes.push({
16899
+ ...result.plane,
16900
+ sampleInlierCount: result.count,
16901
+ sampleInlierRatio: result.count / samplePoints.length
16902
+ });
16903
+ const inlierSet = new Set(result.inliers);
16904
+ let writeIndex = 0;
16905
+ for (let j = 0; j < remaining.length; j++) {
16906
+ const p = remaining[j];
16907
+ if (!inlierSet.has(p)) {
16908
+ remaining[writeIndex++] = p;
16909
+ }
16910
+ }
16911
+ remaining.length = writeIndex;
16912
+ }
16913
+ if (detectedPlanes.length < 2) {
16914
+ return {
16915
+ isSplit: false,
16916
+ faces: [points],
16917
+ noise: [],
16918
+ planes: detectedPlanes,
16919
+ stats: {
16920
+ planeCount: detectedPlanes.length,
16921
+ totalPoints: points.length,
16922
+ validPointCount: validPoints.length,
16923
+ samplePointCount: samplePoints.length,
16924
+ noiseCount: 0
16925
+ }
16926
+ };
16927
+ }
16928
+ let finalPlanes = detectedPlanes.map((p) => ({
16929
+ ...p,
16930
+ fullPointCount: 0
16931
+ }));
16932
+ let faces = finalPlanes.map(() => []);
16933
+ const noise = invalidPoints.slice();
16934
+ function classifyAll() {
16935
+ faces = finalPlanes.map(() => []);
16936
+ for (const plane of finalPlanes) {
16937
+ plane.fullPointCount = 0;
16938
+ }
16939
+ noise.length = 0;
16940
+ noise.push(...invalidPoints);
16941
+ for (const p of validPoints) {
16942
+ let bestIndex = -1;
16943
+ let bestDistSq = Infinity;
16944
+ const matched = [];
16945
+ for (let i = 0; i < finalPlanes.length; i++) {
16946
+ const distSq = pointPlaneDistanceSq(
16947
+ p,
16948
+ finalPlanes[i]
16949
+ );
16950
+ if (distSq <= thresholdSq) {
16951
+ matched.push(i);
16952
+ }
16953
+ if (distSq < bestDistSq) {
16954
+ bestDistSq = distSq;
16955
+ bestIndex = i;
16956
+ }
16957
+ }
16958
+ if (duplicateBoundaryPoints && matched.length > 1) {
16959
+ for (const index of matched) {
16960
+ faces[index].push(p);
16961
+ finalPlanes[index].fullPointCount++;
16962
+ }
16963
+ } else if (bestIndex !== -1 && bestDistSq <= thresholdSq) {
16964
+ faces[bestIndex].push(p);
16965
+ finalPlanes[bestIndex].fullPointCount++;
16966
+ } else {
16967
+ noise.push(p);
16968
+ }
16969
+ }
16970
+ }
16971
+ for (let iter = 0; iter < refineIterations; iter++) {
16972
+ classifyAll();
16973
+ for (let i = 0; i < finalPlanes.length; i++) {
16974
+ if (faces[i].length < 3) continue;
16975
+ const refined = fitPlanePCA(faces[i]);
16976
+ if (refined) {
16977
+ finalPlanes[i] = {
16978
+ ...finalPlanes[i],
16979
+ ...refined
16980
+ };
16981
+ }
16982
+ }
16983
+ }
16984
+ classifyAll();
16985
+ const validFaces = [];
16986
+ const validPlanes = [];
16987
+ for (let i = 0; i < finalPlanes.length; i++) {
16988
+ if (faces[i].length === 0) continue;
16989
+ validFaces.push(faces[i]);
16990
+ validPlanes.push({
16991
+ ...finalPlanes[i],
16992
+ fullPointCount: faces[i].length
16993
+ });
16994
+ }
16995
+ if (validFaces.length < 2) {
16996
+ return {
16997
+ isSplit: false,
16998
+ faces: [points],
16999
+ noise: [],
17000
+ planes: validPlanes,
17001
+ stats: {
17002
+ planeCount: validFaces.length,
17003
+ totalPoints: points.length,
17004
+ validPointCount: validPoints.length,
17005
+ samplePointCount: samplePoints.length,
17006
+ noiseCount: 0
17007
+ }
17008
+ };
17009
+ }
17010
+ const order = validFaces.map((face, index) => ({
17011
+ face,
17012
+ plane: validPlanes[index]
17013
+ })).sort((a, b) => b.face.length - a.face.length);
17014
+ const sortedFaces = order.map((item) => item.face);
17015
+ const sortedPlanes = order.map((item) => item.plane);
17016
+ const angles = [];
17017
+ for (let i = 0; i < sortedPlanes.length; i++) {
17018
+ for (let j = i + 1; j < sortedPlanes.length; j++) {
17019
+ const a = sortedPlanes[i];
17020
+ const b = sortedPlanes[j];
17021
+ const dot = Math.abs(
17022
+ a.nx * b.nx + a.ny * b.ny + a.nz * b.nz
17023
+ );
17024
+ const angle = Math.acos(Math.max(-1, Math.min(1, dot))) * 180 / Math.PI;
17025
+ angles.push({
17026
+ planeA: i,
17027
+ planeB: j,
17028
+ angle: Number(angle.toFixed(3))
17029
+ });
17030
+ }
17031
+ }
17032
+ return {
17033
+ isSplit: true,
17034
+ faces: sortedFaces,
17035
+ noise,
17036
+ planes: sortedPlanes,
17037
+ stats: {
17038
+ planeCount: sortedFaces.length,
17039
+ totalPoints: points.length,
17040
+ validPointCount: validPoints.length,
17041
+ samplePointCount: samplePoints.length,
17042
+ noiseCount: noise.length,
17043
+ facePointCounts: sortedFaces.map(
17044
+ (face) => face.length
17045
+ ),
17046
+ faceRatios: sortedFaces.map(
17047
+ (face) => Number(
17048
+ (face.length / validPoints.length).toFixed(4)
17049
+ )
17050
+ ),
17051
+ angles
17052
+ }
17053
+ };
17054
+ }
16502
17055
 
16503
17056
  // src/utils/clusert.mjs
16504
17057
  function alphaForTriangle(points, ia, ib, ic) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rm-graphical-computing-node",
3
- "version": "1.0.161",
3
+ "version": "1.0.162",
4
4
  "description": "墙体/梁线/点云语义计算库(依赖 Python 与 three.js)",
5
5
  "type": "module",
6
6
  "main": "dist/index.mjs",