cylinder: create a mesh representation of a cylinder

View source: R/cylinder.r

cylinderR Documentation

create a mesh representation of a cylinder

Description

create a mesh representation of a cylinder

Usage

cylinder(
  x,
  dirs,
  length,
  radius = 1,
  fine = 20,
  addNormals = FALSE,
  closelids = TRUE
)

Arguments

x

coordinates of center of the cylinders base - either a 3D-vector of a matrix of dim k x 3

dirs

directions of the cylinder to point - either a 3D-vector of a matrix of dim k x 3

length

length of the cylinder

radius

radius of the cylinder's base

fine

amount of vertices to create the base circle

addNormals

logical: if TRUE, normal vectors for each vertex are calculated.

closelids

logical: if TRUE, the end caps will be closed.

Value

a triangular mesh of class 'mesh3d'

Examples

cyl <- cylinder(1:3,1:3,4,addNormals = TRUE)
## Not run: 
require(rgl)
wire3d(cyl)

## End(Not run)

zarquon42b/mesheR documentation built on Jan. 28, 2024, 2:17 p.m.