View source: R/revolutionMesh.R
revolutionMesh | R Documentation |
Mesh of a surface of revolution. The axis of revolution is the z-axis.
revolutionMesh(x, y, n = 100)
x, y |
two numeric vectors of the same length defining the section to be revoluted |
n |
integer, the number of subdivisions used to construct the mesh |
A rgl triangle mesh (class mesh3d
).
library(cgalMeshes)
library(rgl)
t <- seq(0, 2*pi, length.out = 90)
x <- 4 + cos(t)/2
y <- sin(t)
rmesh <- revolutionMesh(x, y, n = 120)
rmesh <- addNormals(rmesh)
shade3d(rmesh, color = "red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.