Skip to content

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

js
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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICircleSourceInitialValuesNo(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

TypeDescription
boolean

getGenerateLines

Flag that indicates whether the output will generate wireframe lines of the outline.

Returns

TypeDescription
boolean

getMatrix

Get the 4x4 transformation set to apply as a final trasformation to the output.

ArgumentTypeRequiredDescription
matrixYes

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.

ArgumentTypeRequiredDescription
initialValuesICircleSourceInitialValuesNofor pre-setting some of its content

requestData

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setBounds

Convenience methods allows creation of cube by specifying bounding box.

ArgumentTypeRequiredDescription
boundsBoundsYesThe bounds for the cube.

setBounds

Convenience methods allows creation of cube by specifying bounding box.

ArgumentTypeRequiredDescription
xMinNumberYes
xMaxNumberYes
yMinNumberYes
yMaxNumberYes
zMinNumberYes
zMaxNumberYes

setCenter

Set the center of the cube.

ArgumentTypeRequiredDescription
xYes
yYes
zYes

setCenterFrom

Set the center of the cube.

ArgumentTypeRequiredDescription
centerYes

setGenerate3DTextureCoordinates

ArgumentTypeRequiredDescription
generate3DTextureCoordinatesYes

setGenerateFaces

Flag to indicate that the output should generate triangulated faces of the outline.

ArgumentTypeRequiredDescription
generateFacesbooleanYes

setGenerateLines

Flag to indicate that the output should generate wireframe of the outline.

ArgumentTypeRequiredDescription
generateLinesbooleanYes

setMatrix

Set a 4x4 transformation that will be applied as a final trasformation to the output.

ArgumentTypeRequiredDescription
matrixYes

setRotations

Float array of size 3 representing the angles, in degrees, of rotation for the cube.

ArgumentTypeRequiredDescription
xAngleYes
yAngleYes
zAngleYes

setRotationsFrom

ArgumentTypeRequiredDescription
rotationsVector3Yes

setXLength

Set the length of the cube in the x-direction.

ArgumentTypeRequiredDescription
xLengthYes

setYLength

Set the length of the cube in the y-direction.

ArgumentTypeRequiredDescription
yLengthYes

setZLength

Set the length of the cube in the z-direction.

ArgumentTypeRequiredDescription
zLengthYes