if (is_not_cran()) {
sphere <- vcg_sphere(sub_division = 4L)
# roughen the sphere slightly so smoothing has something to do
sphere$vb[1, ] <- sphere$vb[1, ] * (1 + 0.05 * rnorm(ncol(sphere$vb)))
# Fix defects
sphere <- vcg_fix_defects(sphere)
smoothed <- mris_smooth(sphere, niterations = 5L, verbose = TRUE)
plot_mesh_polygon(
list(sphere, smoothed),
alpha = c(0.3, 0.5),
col = list("gray", "red"),
main = "Gray: original; red: smoothed"
)
}
Run the code above in your browser using DataLab