Estimates and orients surface normals for an unoriented point cloud using CGAL's PCA-based normal estimation algorithm.
Arguments
- mesh
A
mesh3dobject representing a point cloud (may have an empty$itface matrix).- n_neighbors
Number of nearest neighbours used for local PCA. Default
18L.- orient
Whether to orient the estimated normals consistently. Default
TRUE.- delete_unoriented
Whether to remove points whose normals could not be reliably oriented. Default
TRUE.
Value
A mesh3d object identical to the input but with an additional
$normals field (3×N numeric matrix, one column per point).
Examples
# \donttest{
f <- system.file("extdata", "torus.stl", package = "vespa")
mesh <- read_stl(f)
cloud <- mesh; cloud$it <- matrix(integer(0), 3L, 0L)
cloud_n <- pca_estimate_normals(cloud)
# }