Skip to contents

Reconstructs a closed triangulated surface from an oriented point cloud using CGAL's Poisson surface reconstruction algorithm. The input point cloud must carry estimated normals (e.g., from pca_estimate_normals()).

Usage

poisson_reconstruction(
  mesh,
  min_angle = 20,
  max_size = 2,
  distance = 0.375,
  gen_normals = TRUE
)

Arguments

mesh

A mesh3d object representing a point cloud. Must contain a $normals field (3×N matrix) produced by pca_estimate_normals().

min_angle

Minimum triangle angle in the output mesh (degrees). Default 20.

max_size

Maximum triangle size relative to the average point spacing. Default 2.

distance

Maximum distance from the reconstructed surface to the input points, relative to average spacing. Default 0.375.

gen_normals

Whether to generate normals on the output surface. Default TRUE.

Value

A mesh3d object with the reconstructed surface.

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)
result  <- poisson_reconstruction(cloud_n)
# }