pervertexdata.smoothnn.adj | R Documentation |
Smooth per-vertex data using nearest-neighbor smoothing based on mesh adjacency information.
pervertexdata.smoothnn.adj( mesh_adj, pvdata, num_iter, method = "C++", silent = getOption("haze.silent", default = TRUE) )
mesh_adj |
list of vectors of integers, the adjacency list representation of the mesh. One can use the pre-computed adjacency for some special meshes, see |
pvdata |
numerical vector of per-vertex-data for the mesh, one value per vertex. Data values of |
num_iter |
positive integer, number of smoothing iterations. |
method |
character string, one of 'C++' or 'R'. The C++ version is much faster (about 30 times faster on our test machine), and there is little reason to ever use the R version in production code, so just ignore this. |
silent |
logical, whether to suppress output messages. |
numerical vector, the smoothed data (for vector input). If pvdata
is a matrix or a data.frame (with more than a single column), the result is also a matrix or data.frame.
pervertexdata.smoothnn
if you have a mesh and still need the connectivity to be computed.
## Not run: mesh = rgl::tetrahedron3d(); mesh_adj = mesh.adj(mesh, k = 1L); pvd = rnorm(nrow(mesh$vb), mean = 5.0, sd = 1.0); pvd_smoothed = pervertexdata.smoothnn.adj(mesh_adj, pvd, num_iter = 30L); ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.