tetramesh              package:geometry              R Documentation

_D_i_s_p_l_a_y _t_r_i_a_n_g_l_e_s _m_e_s_h (_2_D) _r_e_n_d_e_r _t_e_t_r_a_h_e_d_r_o_n _m_e_s_h (_3_D)

_D_e_s_c_r_i_p_t_i_o_n:

     'tetramesh(T, X, col)' uses the rgl package to display the
     tetrahedrons defined in the m-by-4 matrix T as mesh.

_U_s_a_g_e:

     tetramesh(T, X, col = heat.colors(nrow(T)), clear = TRUE, ...)
     trimesh(T, p, p2, add = FALSE, axis = FALSE, boxed = FALSE, ...)

_A_r_g_u_m_e_n_t_s:

       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. 

       p: A vector or a matrix. 

      p2: if 'p' is not a matrix 'p' and 'p2' are bind to a matrix with
          'cbind'. 

     add: Add to existing plot in current active device? 

    axis: Draw axes? 

   boxed: Plot box? 

     col: The tetrahedron color. See rgl documentation for details. 

   clear: Should the current rendering device be cleared?  

     ...: Parameters to the rendering device. See the rgl package. 

_D_e_t_a_i_l_s:

     Each row of 'T' specifies a triangle by giving the 3 indices of
     its points in 'X'. Each row of 'T' specifies a thetrahedron by
     giving the 4 indices of its points in 'X'.

_A_u_t_h_o_r(_s):

     Raoul Grasman

_S_e_e _A_l_s_o:

     'rgl', 'delaunayn', 'convhulln', 'surf.tri'

_E_x_a_m_p_l_e_s:

     #example trimesh
     p = cbind(x=rnorm(30), y=rnorm(30))
     tt = delaunayn(p)
     trimesh(tt,p)

     ## Not run: 
     # example delaunayn
     d = c(-1,1)
     pc = as.matrix(rbind(expand.grid(d,d,d),0))
     tc = delaunayn(pc)

     # example tetramesh
     library(rgl)
     clr = rep(1,3) 
     rgl.viewpoint(60,fov=20)
     rgl.light(270,60)
     tetramesh(tc,pc,alpha=0.7,col=clr)
     ## End(Not run)

