Description Usage Arguments Details Value Note Author(s) References See Also Examples
Returns an index matrix to the points of simplices (“triangles”) that form the smallest convex simplicial complex of a set of input points in N-dimensional space. This function interfaces the Qhull library.
1 |
p |
An |
options |
String containing extra options for the underlying Qhull command; see details below and Qhull documentation at http://www.qhull.org/html/qconvex.htm#synopsis. |
For slient operation, specify the option Pp
.
An m
-by-dim
index matrix of which each row
defines a dim
-dimensional “triangle”. The indices
refer to the rows in p
. If the option FA
is
provided, then the output is a list
with entries
hull
containing the matrix mentioned above, and area
and vol
with the generalised area and volume of the hull
described by the matrix. When applying convhulln to a 3D object,
these have the conventional meanings: vol
is the volume of
enclosed by the hull and area
is the total area of the
facets comprising the hull's surface. However, in 2D the facets of
the hull are the lines of the perimeter. Thus area
is the
length of the perimeter and vol
is the area enclosed.
This is a port of the Octave's (http://www.octave.org) geometry library. The Octave source was written by Kai Habel.
See further notes in delaunayn
.
Raoul Grasman, Robert B. Gramacy and David Sterratt david.c.sterratt@ed.ac.uk
Barber, C.B., Dobkin, D.P., and Huhdanpaa, H.T., “The Quickhull algorithm for convex hulls,” ACM Trans. on Mathematical Software, Dec 1996.
convex.hull
, delaunayn
,
surf.tri
, distmesh2d
1 2 3 4 5 6 7 8 9 10 | # example convhulln
# ==> see also surf.tri to avoid unwanted messages printed to the console by qhull
ps <- matrix(rnorm(3000), ncol=3) # generate points on a sphere
ps <- sqrt(3)*ps/drop(sqrt((ps^2) %*% rep(1, 3)))
ts.surf <- t(convhulln(ps)) # see the qhull documentations for the options
## Not run:
rgl.triangles(ps[ts.surf,1],ps[ts.surf,2],ps[ts.surf,3],col="blue",alpha=.2)
for(i in 1:(8*360)) rgl.viewpoint(i/8)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.