Skip to content

ConeSource ​

Introduction ​

vtkConeSource creates a cone centered at a specified point and pointing in a specified direction. (By default, the center is the origin and the direction is the x-axis.) Depending upon the resolution of this object, different representations are created. If resolution=0 a line is created; if resolution=1, a single triangle is created; if resolution=2, two crossed triangles are created. For resolution > 2, a 3D cone (with resolution number of sides) is created. It also is possible to control whether the bottom of the cone is capped with a (resolution-sided) polygon, and to specify the height and radius of the cone.

Usage ​

js
import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource';

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

Methods ​

extend ​

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

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

getCapping ​

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

getCenter ​

Get the center of the cone.

getCenterByReference ​

Get the center of the cone.

getDirection ​

Get the orientation vector of the cone.

getDirectionByReference ​

Get the orientation vector of the cone.

getHeight ​

Get the height of the cone.

getRadius ​

Get the base radius of the cone.

getResolution ​

Get the number of facets used to represent the cone.

newInstance ​

Method used to create a new instance of vtkConeSource.

ArgumentTypeRequiredDescription
initialValuesIConeSourceInitialValuesNofor pre-setting some of its content

requestData ​

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setCapping ​

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

ArgumentTypeRequiredDescription
cappingBooleanYes

setCenter ​

Set the center of the cone. It is located at the middle of the axis of the cone. !!! warning This is not the center of the base of the cone!

ArgumentTypeRequiredDescription
centerVector3Yes

setCenter ​

Set the center of the cone. It is located at the middle of the axis of the cone. !!! warning This is not the center of the base of the cone!

ArgumentTypeRequiredDescription
xNumberYes
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setCenterFrom ​

Set the center of the cone. It is located at the middle of the axis of the cone. !!! warning This is not the center of the base of the cone!

ArgumentTypeRequiredDescription
centerVector3Yes

setDirection ​

Set the direction for the cone.

ArgumentTypeRequiredDescription
directionVector3Yes

setDirection ​

Set the direction for the cone.

ArgumentTypeRequiredDescription
directionVector3YesThe direction coordinates.

setDirection ​

Set the direction for the cone.

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

setDirectionFrom ​

Set the direction for the cone.

ArgumentTypeRequiredDescription
directionVector3Yes

setHeight ​

Set the height of the cone. This is the height along the cone in its specified direction.

ArgumentTypeRequiredDescription
heightNumberYes

setRadius ​

Set the base radius of the cone.

ArgumentTypeRequiredDescription
radiusNumberYes

setResolution ​

Set the number of facets used to represent the cone.

ArgumentTypeRequiredDescription
resolutionYes