# NOT RUN {
if (requireNamespace("alphashape3d", quietly = TRUE)) {
set.seed(123)
xyz <- rbind(cbind(runif(1000), runif(1000), runif(1000)),
cbind(runif(125, 1, 1.5),
runif(125, 0.25, 0.75),
runif(125, 0.25, 0.75)))
ash <- suppressMessages(alphashape3d::ashape3d(xyz, alpha = 0.2))
m <- as.mesh3d(ash, smooth = TRUE)
open3d()
mfrow3d(1, 2, sharedMouse = TRUE)
plot3d(xyz, size = 1)
plot3d(m, col = "red", alpha = 0.5)
points3d(xyz, size = 1)
}
# }
Run the code above in your browser using DataLab