delaunayn: Delaunay triangulation in N-dimensions The Delaunay...

Description Usage Arguments Value Note Author(s) References See Also Examples

View source: R/delaunayn.R

Description

Delaunay triangulation in N-dimensions

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

1
delaunayn(p, options = NULL, full = FALSE)

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.) The Qbb option is always passed to Qhull. The default options are Qcc Qc Qt Qz for dim <4 and Qcc Qc Qt Qx for dim>=4. If neither of the QJ or Qt options are supplied, the Qt option is passed to Qhull. The Qt option ensures all Delaunay regions are simplical (e.g., triangles in 2-d). See ../doc/html/qdelaun.html for more details. Contrary to the Qhull documentation, no degenerate (zero area) regions are returned with the Qt option since the R function removes them from the triangulation. For slient operation, specify the option Pp.

full

Return all information asscoiated with triangulation as a list. At present this is the triangulation (tri), a vector of facet areas (areas) and a list of neighbours of each facet (neighbours).

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.

Note

This function interfaces the Qhull library and is a port from Octave (http://www.octave.org) to R. Qhull computes convex hulls, Delaunay triangulations, halfspace intersections about a point, Voronoi diagrams, furthest-site Delaunay triangulations, and furthest-site Voronoi diagrams. It runs in 2-d, 3-d, 4-d, and higher dimensions. It implements the Quickhull algorithm for computing the convex hull. Qhull handles roundoff errors from floating point arithmetic. It computes volumes, surface areas, and approximations to the convex hull. See the Qhull documentation included in this distribution (the doc directory ../doc/index.html).

Qhull does not support constrained Delaunay triangulations, triangulation of non-convex surfaces, mesh generation of non-convex objects, or medium-sized inputs in 9-D and higher. A rudimentary algorithm for mesh generation in non-convex regions using Delaunay triangulation is implemented in distmesh2d (currently only 2D).

Author(s)

Raoul Grasman and Robert B. Gramacy; based on the corresponding Octave sources of Kai Habel.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# example delaunayn
d <- c(-1,1)
pc <- as.matrix(rbind(expand.grid(d,d,d),0))
tc <- delaunayn(pc)

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

## End(Not run)

Example output

Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl.init' failed, running with 'rgl.useNULL = TRUE'. 

geometry documentation built on May 2, 2019, 6:09 p.m.

Related to delaunayn in geometry...