Skip to content

CylinderSource

Introduction

vtkCylinderSource creates a polygonal cylinder centered at Center; The axis of the cylinder is aligned along the global y-axis. The height and radius of the cylinder can be specified, as well as the number of sides. It is also possible to control whether the cylinder is open-ended or capped. If you have the end points of the cylinder, you should use a vtkLineSource followed by a vtkTubeFilter instead of the vtkCylinderSource.

Usage

js
import vtkCylinderSource from '@kitware/vtk.js/Filters/Sources/CylinderSource';

const cylinder = vtkCylinderSource.newInstance({ height: 2, radius: 1, resolution: 80 });
const polydata = cylinder.getOutputData();

Methods

extend

Method used to decorate a given object (publicAPI+model) with vtkCylinderSource characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICylinderSourceInitialValuesNo(default: {})

getCapping

Get the cap the base of the cylinder with a polygon.

getCenter

Get the center of the cylinder.

getCenterByReference

Get the center of the cylinder.

getDirection

Get the orientation vector of the cylinder.

getDirectionByReference

Get the orientation vector of the cylinder.

getHeight

Get the height of the cylinder.

getInitAngle

Get the initial angle along direction

getOtherRadius

Get the radius on Z axis. If not null and different from radius, the cylinder base becomes an ellipse instead of a circle.

getRadius

Get the base radius of the cylinder.

getResolution

Get the number of facets used to represent the cylinder.

newInstance

Method used to create a new instance of vtkCylinderSource.

ArgumentTypeRequiredDescription
initialValuesICylinderSourceInitialValuesNofor pre-setting some of its content

requestData

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setCapping

Turn on/off whether to cap the base of the cone with a polygon.

ArgumentTypeRequiredDescription
cappingBooleanYesThe capping value.

setCenter

Set the center of the cylinder.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setCenterFrom

Set the center of the cylinder.

ArgumentTypeRequiredDescription
centerVector3YesThe center point's coordinates.

setDirection

Set the direction for the cylinder.

ArgumentTypeRequiredDescription
directionVector3YesThe direction coordinates.

setDirection

Set the direction for the cylinder.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setDirectionFrom

Set the direction for the cylinder.

ArgumentTypeRequiredDescription
directionVector3YesThe direction coordinates.

setHeight

Set the height of the cylinder.

ArgumentTypeRequiredDescription
heightNumberYesThe height along the cylinder in its specified direction.

setInitAngle

Set the initial angle along direction.

ArgumentTypeRequiredDescription
initAngleNumberYesThe initial angle in radian.

setOtherRadius

Set the base Z radius of the cylinder.

ArgumentTypeRequiredDescription
radiusNumberYesThe radius of the cylinder in Z.

setRadius

Set the base radius of the cylinder.

ArgumentTypeRequiredDescription
radiusNumberYesThe radius of the cylinder.

setResolution

Set the number of facets used to represent the cylinder.

ArgumentTypeRequiredDescription
resolutionNumberYesThe number of facets used to represent the cylinder.