Learn R Programming

cgalMeshes (version 2.2.0)

revolutionMesh: Surface of revolution

Description

Mesh of a surface of revolution. The axis of revolution is the z-axis.

Usage

revolutionMesh(x, y, n = 100)

Value

A rgl triangle mesh (class mesh3d).

Arguments

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

Examples

Run this code
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")

Run the code above in your browser using DataLab