1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/tetramesh.R
\name{tetramesh}
\alias{tetramesh}
\title{Render tetrahedron mesh (3D)}
\usage{
tetramesh(T, X, col = grDevices::heat.colors(nrow(T)), clear = TRUE, ...)
}
\arguments{
\item{T}{T is a \code{m}-by-3 matrix in trimesh and \code{m}-by-4 in
tetramesh. A row of \code{T} contains indices into \code{X} of the vertices
of a triangle/tetrahedron. \code{T} is usually the output of delaunayn.}
\item{X}{X is an n-by-2/n-by-3 matrix. The rows of X represent \code{n}
points in 2D/3D space.}
\item{col}{The tetrahedron colour. See rgl documentation for details.}
\item{clear}{Should the current rendering device be cleared?}
\item{\dots}{Parameters to the rendering device. See the \link[rgl]{rgl}
package.}
}
\description{
\code{tetramesh(T, X, col)} uses the \link[rgl]{rgl} package to
display the tetrahedrons defined in the m-by-4 matrix T as mesh.
Each row of \code{T} specifies a tetrahedron by giving the 4
indices of its points in \code{X}.
}
\examples{
\dontrun{
# example delaunayn
d = c(-1,1)
pc = as.matrix(rbind(expand.grid(d,d,d),0))
tc = delaunayn(pc)
# example tetramesh
clr = rep(1,3) \%o\% (1:nrow(tc)+1)
rgl::view3d(60,fov=20)
rgl::light3d(270,60)
tetramesh(tc,pc,alpha=0.7,col=clr)
}
}
\seealso{
\code{\link{trimesh}}, \code{\link[rgl]{rgl}}, \code{\link{delaunayn}},
\code{\link{convhulln}}, \code{\link{surf.tri}}
}
\author{
Raoul Grasman
}
\keyword{hplot}
|