Learn R Programming

geometry (version 0.3-2)

delaunayn: Delaunay triangulation in N-dimensions

Description

The Delaunay triangulation is a tessellation of the convex hull of the points such that no N-sphere defined by the N-triangles contains any other points from the set.

Usage

delaunayn(p, options = "")

Arguments

p
p is an n-by-dim matrix. The rows of p represent n points in dim-dimensional space.
options
String containing extra options for the underlying Qhull command.(See the Qhull documentation (../doc/html/qdelaun.html) for the available options.)

Value

  • The return matrix has m rows and dim+1 columns. It contains for each row a set of indices to the points, which describes a simplex of dimension dim. The 3D simplex is a tetrahedron.

Details

The Qt option is supplied to Qhull by default. The code ensures that one of Qt or QJ is passed to Qhull. See ../doc/html/qdelaun.html for more details.

For slient operation, specify the option Pp.

References

Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., The Quickhull algorithm for convex hulls, ACM Trans. on Mathematical Software, Dec 1996.

http://www.qhull.org

See Also

tri.mesh, convhulln, surf.tri, distmesh2d

Examples

Run this code
# example delaunayn
d <- c(-1,1)
pc <- as.matrix(rbind(expand.grid(d,d,d),0))
tc <- delaunayn(pc)

# example tetramesh
library(rgl)
rgl.viewpoint(60)
rgl.light(120,60)
tetramesh(tc,pc, alpha=0.9)

Run the code above in your browser using DataLab