Module scan_segmentation

Module scan_segmentation 

Source
Expand description

Plane and cylinder detection in point clouds (#6870): scan-to-BIM groundwork.

  1. voxel: points average into voxels with exact integer sums, so the result does not depend on point order or chunking; the voxel size doubles when the working set exceeds its budget.
  2. normals: PCA over the neighbouring voxel means gives each voxel a normal and a curvature.
  3. grow: regions grow from the flattest voxels, gated by angle and distance to a plane refitted as the region grows.
  4. refit: a median/MAD trim and refit per region; adjacent coplanar regions merge through union-find; regions whose normals turn like a column’s are refused.
  5. plane_report: area, in-plane extent, orientation hint and facing side.
  6. cylinder: seeded RANSAC over the smoothly connected voxels no plane claimed, a least-squares refit, and refusal of spheres, narrow arcs and short pieces: columns and pipes.
  7. ring and prism: rings of vertical planes about a common axis are wide round columns split into strips, or polygonal columns (#6893); columns runs 6 and 7 and gives a column precedence over the planes it is made of, so a surface is reported once.

Every stage is bounded by the voxel count, which the budget bounds; the report’s limits says when a budget acted. A clean-room implementation of the published technique (region growing on voxel means); no third-party code was consulted.

Structs§

PlaneExtent
Oriented box of the plane’s inlier voxel means within the plane. For vertical and sloped planes v_axis points up (along the fall line) and u_axis is horizontal; horizontal planes take the minimum-area rectangle. u_axis x v_axis = normal.
ScanCylinder
A detected cylinder (column, pipe). The axis runs from axis_start to axis_end over the inliers’ extent. A polygonal column of six or more faces is reported here too, with faceted set.
ScanFacets
The faces of a polygonal (prism) column: a regular polygon of faces sides about the cylinder’s axis, radius being its circumradius (axis to corner).
ScanPlane
ScanRegion
Axis-aligned crop box in the positions’ frame (inclusive).
ScanSegmentationLimits
Which bounds acted. A bound that acts is always reported here.
ScanSegmentationOptions
ScanSegmentationReport
ScanSegmentationStats
ScanVoxelizer
Streaming entry: add points chunk by chunk (any order, any split) and segment once. The result is identical to one segment_scan_points call.

Enums§

AxisOrientation
Axis direction relative to options.up_axis, with the plane tolerance.
NormalSource
Which side the reported normal faces.
PlaneOrientation
Classification hint relative to options.up_axis.

Functions§

segment_scan_points
Segment one buffer of xyz f32 positions (metres).