CubeSource
Introduction
vtkCubeSource creates a cube centered at origin. The cube is represented with four-sided polygons. It is possible to specify the length, width, and height of the cube independently.
Usage
import vtkCubeSource from '@kitware/vtk.js/Filters/Sources/CubeSource';
const cubeSource = vtkCubeSource.newInstance({ xLength: 5, yLength: 5, zLength: 5 });
const polydata = cubeSource.getOutputData();Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkCubeSource 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 | ICircleSourceInitialValues | No | (default: {}) |
getCenter
Get the center of the cube.
getCenterByReference
Get the center of the cube.
getGenerate3DTextureCoordinates
getGenerateFaces
Flag that indicates whether the output will generate faces of the outline.
Returns
| Type | Description |
|---|---|
| boolean |
getGenerateLines
Flag that indicates whether the output will generate wireframe lines of the outline.
Returns
| Type | Description |
|---|---|
| boolean |
getMatrix
Get the 4x4 transformation set to apply as a final trasformation to the output.
| Argument | Type | Required | Description |
|---|---|---|---|
matrix | Yes |
getRotations
getRotationsByReference
getXLength
Get the length of the cube in the x-direction.
getYLength
Get the length of the cube in the y-direction.
getZLength
Get the length of the cube in the z-direction.
newInstance
Method used to create a new instance of vtkCubeSource.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ICircleSourceInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setBounds
Convenience methods allows creation of cube by specifying bounding box.
| Argument | Type | Required | Description |
|---|---|---|---|
bounds | Bounds | Yes | The bounds for the cube. |
setBounds
Convenience methods allows creation of cube by specifying bounding box.
| Argument | Type | Required | Description |
|---|---|---|---|
xMin | Number | Yes | |
xMax | Number | Yes | |
yMin | Number | Yes | |
yMax | Number | Yes | |
zMin | Number | Yes | |
zMax | Number | Yes |
setCenter
Set the center of the cube.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Yes | ||
y | Yes | ||
z | Yes |
setCenterFrom
Set the center of the cube.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Yes |
setGenerate3DTextureCoordinates
| Argument | Type | Required | Description |
|---|---|---|---|
generate3DTextureCoordinates | Yes |
setGenerateFaces
Flag to indicate that the output should generate triangulated faces of the outline.
| Argument | Type | Required | Description |
|---|---|---|---|
generateFaces | boolean | Yes |
setGenerateLines
Flag to indicate that the output should generate wireframe of the outline.
| Argument | Type | Required | Description |
|---|---|---|---|
generateLines | boolean | Yes |
setMatrix
Set a 4x4 transformation that will be applied as a final trasformation to the output.
| Argument | Type | Required | Description |
|---|---|---|---|
matrix | Yes |
setRotations
Float array of size 3 representing the angles, in degrees, of rotation for the cube.
| Argument | Type | Required | Description |
|---|---|---|---|
xAngle | Yes | ||
yAngle | Yes | ||
zAngle | Yes |
setRotationsFrom
| Argument | Type | Required | Description |
|---|---|---|---|
rotations | Vector3 | Yes |
setXLength
Set the length of the cube in the x-direction.
| Argument | Type | Required | Description |
|---|---|---|---|
xLength | Yes |
setYLength
Set the length of the cube in the y-direction.
| Argument | Type | Required | Description |
|---|---|---|---|
yLength | Yes |
setZLength
Set the length of the cube in the z-direction.
| Argument | Type | Required | Description |
|---|---|---|---|
zLength | Yes |