revolutionMesh: Surface of revolution

View source: R/revolutionMesh.R

revolutionMeshR Documentation

Surface of revolution

Description

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

Usage

revolutionMesh(x, y, n = 100)

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

Value

A rgl triangle mesh (class mesh3d).

Examples

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")

cgalMeshes documentation built on July 9, 2023, 7:45 p.m.