Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

turn3d

Create a solid of rotation from a two-dimensional curve


Description

This function “turns” the curve (as on a lathe) to form a solid of rotation along the x axis.

Usage

turn3d(x, y = NULL, n = 12, smooth = FALSE, ...)

Arguments

x, y

Points on the curve, in a form suitable for xy.coords. The y values must be non-negative.

n

How many steps in the rotation?

smooth

logical; whether to add normals for a smooth appearance.

...

Additional parameters to pass to tmesh3d.

Value

A mesh object containing triangles and/or quadrilaterals.

Author(s)

Fang He and Duncan Murdoch

See Also

Examples

x <- 1:10
y <- rnorm(10)^2
shade3d(turn3d(x, y), col = "green")

rgl

3D Visualization Using OpenGL

v0.106.8
GPL
Authors
Duncan Murdoch [aut, cre], Daniel Adler [aut], Oleg Nenadic [ctb], Simon Urbanek [ctb], Ming Chen [ctb], Albrecht Gebhardt [ctb], Ben Bolker [ctb], Gabor Csardi [ctb], Adam Strzelecki [ctb], Alexander Senger [ctb], The R Core Team [ctb, cph], Dirk Eddelbuettel [ctb], The authors of Shiny [cph], The authors of knitr [cph], Jeroen Ooms [ctb], Yohann Demont [ctb], Joshua Ulrich [ctb], Xavier Fernandez i Marin [ctb], George Helffrich [ctb], Ivan Krylov [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.