Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tetramesh

Render tetrahedron mesh (3D)


Description

tetramesh(T, X, col) uses the rgl package to display the tetrahedrons defined in the m-by-4 matrix T as mesh. Each row of T specifies a tetrahedron by giving the 4 indices of its points in X.

Usage

tetramesh(T, X, col = grDevices::heat.colors(nrow(T)), clear = TRUE,
  ...)

Arguments

T

T is a m-by-3 matrix in trimesh and m-by-4 in tetramesh. A row of T contains indices into X of the vertices of a triangle/tetrahedron. T is usually the output of delaunayn.

X

X is an n-by-2/n-by-3 matrix. The rows of X represent n points in 2D/3D space.

col

The tetrahedron colour. See rgl documentation for details.

clear

Should the current rendering device be cleared?

...

Parameters to the rendering device. See the rgl package.

Author(s)

Raoul Grasman

See Also

Examples

## Not run: 
# 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::rgl.viewpoint(60,fov=20)
rgl::rgl.light(270,60)
tetramesh(tc,pc,alpha=0.7,col=clr)

## End(Not run)

geometry

Mesh Generation and Surface Tessellation

v0.4.5
GPL (>= 3)
Authors
Jean-Romain Roussel [cph, ctb] (wrote tsearch function with QuadTrees), C. B. Barber [cph], Kai Habel [cph, aut], Raoul Grasman [cph, aut], Robert B. Gramacy [cph, aut], Pavlo Mozharovskyi [cph, aut], David C. Sterratt [cph, aut, cre] (<https://orcid.org/0000-0001-9092-9099>)
Initial release
2019-12-02

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.