Skip to content

TorusSource ​

Introduction ​

vtkTorusSource creates a torus centered at a specified point and whose axis points in a specified direction. The torus is defined by the radius from its center to the center of the tube, the radius of the tube itself, and the arc length swept around the axis, which allows partial tori to be created.

Usage ​

js
import vtkTorusSource from '@kitware/vtk.js/Filters/Sources/TorusSource';

const torus = vtkTorusSource.newInstance({ radius: 1, tubeRadius: 0.1 });
const polydata = torus.getOutputData();

Methods ​

extend ​

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

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

getArcLength ​

Get the angle in radians swept by the torus around its axis.

getCenter ​

Get the center of the torus.

getCenterByReference ​

Get the center of the torus.

getDirection ​

Get the orientation vector of the torus.

getDirectionByReference ​

Get the orientation vector of the torus.

getRadius ​

Get the radius from the center of the torus to the center of the tube.

getResolution ​

Get the number of subdivisions along the arc of the torus.

getTubeRadius ​

Get the radius of the tube.

getTubeResolution ​

Get the number of subdivisions around the tube section.

newInstance ​

Method used to create a new instance of vtkTorusSource.

ArgumentTypeRequiredDescription
initialValuesITorusSourceInitialValuesNofor pre-setting some of its content

requestData ​

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setArcLength ​

Set the angle in radians swept by the torus around its axis.

ArgumentTypeRequiredDescription
arcLengthNumberYes

setCenter ​

Set the center of the torus.

ArgumentTypeRequiredDescription
centerVector3Yes

setCenter ​

Set the center of the torus.

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

setCenterFrom ​

Set the center of the torus.

ArgumentTypeRequiredDescription
centerVector3Yes

setDirection ​

Set the direction for the torus.

ArgumentTypeRequiredDescription
directionVector3Yes

setDirection ​

Set the direction for the torus.

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

setDirectionFrom ​

Set the direction for the torus.

ArgumentTypeRequiredDescription
directionVector3Yes

setRadius ​

Set the radius from the center of the torus to the center of the tube.

ArgumentTypeRequiredDescription
radiusNumberYes

setResolution ​

Set the number of subdivisions along the arc of the torus.

ArgumentTypeRequiredDescription
resolutionNumberYes

setTubeRadius ​

Set the radius of the tube.

ArgumentTypeRequiredDescription
tubeRadiusNumberYes

setTubeResolution ​

Set the number of subdivisions around the tube section.

ArgumentTypeRequiredDescription
tubeResolutionNumberYes