if(is_not_cran()) {
# Prepare mesh with no normals
data("left_hippocampus_mask")
# Grow 2mm on each direction to fill holes
volume <- grow_volume(left_hippocampus_mask, 2)
# Initial mesh
mesh <- vcg_isosurface(volume)
# Start: examples
rgl_view({
rgl_call("mfrow3d", 2, 4)
rgl_call("title3d", "Naive ISOSurface")
rgl_call("shade3d", mesh, col = 2)
rgl_call("next3d")
rgl_call("title3d", "Implicit Smooth")
rgl_call("shade3d", col = 2,
x = vcg_smooth_implicit(mesh, degree = 2))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - taubin")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "taubin"))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - laplace")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "laplace"))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - angWeight")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "angWeight"))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - HClaplace")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "HClaplace"))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - fujiLaplace")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "fujiLaplace"))
rgl_call("next3d")
rgl_call("title3d", "Explicit Smooth - surfPreserveLaplace")
rgl_call("shade3d", col = 2,
x = vcg_smooth_explicit(mesh, "surfPreserveLaplace"))
})
}
Run the code above in your browser using DataLab