Learn R Programming

cgalMeshes (version 2.2.0)

AFSreconstruction: Advancing front surface reconstruction

Description

Reconstruction of a surface from a cloud of 3D points.

Usage

AFSreconstruction(points, jetSmoothing = NULL)

Value

A cgalMesh object.

Arguments

points

numeric matrix which stores the points, one point per row

jetSmoothing

if not NULL, must be an integer higher than two, and then the points cloud is smoothed before the reconstruction, using this integer as the number of neighbors for the smoothing; note that this smoothing preprocessing relocates the points and then should not be used if the points have been sampled without noise on the surface

Details

See Advancing Front Surface Reconstruction.

Examples

Run this code
library(cgalMeshes)
data(bunny, package = "onion")
mesh <- AFSreconstruction(bunny)
rglMesh <- mesh$getMesh()
library(rgl)
open3d(windowRect = 50 + c(0, 0, 512, 512))
shade3d(rglMesh, color = "firebrick")

# jet smoothing example ####
library(cgalMeshes)
# no smoothing
mesh1 <- AFSreconstruction(SolidMobiusStrip)
mesh1$computeNormals()
rglMesh1 <- mesh1$getMesh()
# jet smoothing
mesh2 <- AFSreconstruction(SolidMobiusStrip, jetSmoothing = 30)
mesh2$computeNormals()
rglMesh2 <- mesh2$getMesh()
# plot
library(rgl)
open3d(windowRect = 50 + c(0, 0, 800, 400))
mfrow3d(1, 2)
view3d(20, -40, zoom = 0.85)
shade3d(rglMesh1, color = "gold")
next3d()
view3d(20, -40, zoom = 0.85)
shade3d(rglMesh2, color = "gold")

Run the code above in your browser using DataLab