library(cgalMeshes)
library(rgl)
mesh <- cgalMesh$new(pentagrammicPrism, clean = FALSE)
vertices <- mesh$getVertices()
edges <- mesh$getEdges()
extEdges <- exteriorEdges(edges)
tmesh <- mesh$triangulate()$getMesh()
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.9)
shade3d(tmesh, color = "navy")
# we plot the exterior edges only
plotEdges(
vertices, extEdges, color = "gold",
tubesRadius = 0.02, spheresRadius = 0.02
)
# or only plot the edges whose corresponding dihedral angle is acute:
sharpEdges <- as.matrix(subset(edges, angle <= 91, select = c("i1", "i2")))
open3d(windowRect = 50 + c(0, 0, 512, 512), zoom = 0.9)
shade3d(tmesh, color = "maroon")
plotEdges(
vertices, sharpEdges, color = "darkred",
tubesRadius = 0.02, spheresRadius = 0.02
)
Run the code above in your browser using DataLab