# a non-convex polyhedron ####
library(MeshesTools)
library(rgl)
library(randomcoloR)
meshes <- convexParts(mesh = NonConvexPolyhedron)
ncp <- length(meshes)
colors <- randomColor(ncp, hue = "random", luminosity = "bright")
open3d(windowRect = c(50, 50, 562, 562), zoom = 0.8)
for(i in seq_len(ncp)){
shade3d(toRGL(meshes[[i]]), color = colors[i])
}
# pentagrammic prism ####
library(MeshesTools)
library(rgl)
library(randomcoloR)
data(pentagrammicPrism, package = "PolygonSoup")
meshes <- convexParts(mesh = pentagrammicPrism)
ncp <- length(meshes)
colors <- randomColor(ncp, hue = "random", luminosity = "bright")
open3d(windowRect = c(50, 50, 562, 562), zoom = 0.8)
for(i in seq_len(ncp)){
shade3d(toRGL(meshes[[i]]), color = colors[i])
}
Run the code above in your browser using DataLab