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
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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | ITorusSourceInitialValues | No | (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.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ITorusSourceInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setArcLength
Set the angle in radians swept by the torus around its axis.
| Argument | Type | Required | Description |
|---|---|---|---|
arcLength | Number | Yes |
setCenter
Set the center of the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Vector3 | Yes |
setCenter
Set the center of the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setCenterFrom
Set the center of the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Vector3 | Yes |
setDirection
Set the direction for the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
direction | Vector3 | Yes |
setDirection
Set the direction for the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setDirectionFrom
Set the direction for the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
direction | Vector3 | Yes |
setRadius
Set the radius from the center of the torus to the center of the tube.
| Argument | Type | Required | Description |
|---|---|---|---|
radius | Number | Yes |
setResolution
Set the number of subdivisions along the arc of the torus.
| Argument | Type | Required | Description |
|---|---|---|---|
resolution | Number | Yes |
setTubeRadius
Set the radius of the tube.
| Argument | Type | Required | Description |
|---|---|---|---|
tubeRadius | Number | Yes |
setTubeResolution
Set the number of subdivisions around the tube section.
| Argument | Type | Required | Description |
|---|---|---|---|
tubeResolution | Number | Yes |