vcg_subset_vertex | R Documentation |
Subset mesh by vertex
vcg_subset_vertex(x, selector)
x |
surface mesh |
selector |
logical vector (must not contain NA), and length must be
consistent with the number of vertices in |
A triangular mesh of class 'mesh3d'
, a subset of x
sphere <- vcg_sphere()
nv <- ncol(sphere$vb)
selector <- seq_len(nv) > (nv / 2)
sub <- vcg_subset_vertex(sphere, selector)
if(is_not_cran()) {
rgl_view({
# subset sphere will be displayed in red
rgl_call("shade3d", sub, col = 'red')
# Original sphere will be displayed as wireframe
rgl_call("wire3d", sphere, col = (2 - selector))
})
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.