Given a two-dimensional polygon, this generates a three-dimensional extrusion of the shape by triangulating the polygon and creating a cylinder with that shape as the end faces.
extrude3d(x, y = NULL, thickness = 1, smooth = FALSE, ...)
A polygon description in one of the forms supported by
The extrusion will have this thickness.
logical; should normals be added so that the edges of the extrusion appear smooth?
Other parameters to pass to
The extrusion is always constructed with the polygon in the xy plane at
z = 0 and another copy at
z = thickness. Use
the transformation functions (e.g.
obtain other orientations and placements.
A mesh object containing a triangulation of the polygon for each face, and quadrilaterals for the sides.
polygon3d for a simple polygon,
turn3d for a solid of rotation.
x <- c(1:10, 10:1) y <- rev(c(rep(c(0, 2), 5), rep(c(1.5, -0.5), 5))) plot(x, y, type = "n") polygon(x, y) open3d() shade3d( extrude3d(x, y), col = "red" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.