Skip to content

PlatonicSolidSource ​

Introduction ​

vtkPlatonicSolidSource can generate each of the five Platonic solids: tetrahedron, cube, octahedron, icosahedron, and dodecahedron. Each of the solids is placed inside a sphere centered at the origin with radius 1.0.

Usage ​

js
import vtkPlatonicSolidSource from '@kitware/vtk.js/Filters/Sources/PlatonicSolidSource';

const platonicSolidSource = vtkPlatonicSolidSource.newInstance();
const polydata = platonicSolidSource.getOutputData();

Methods ​

extend ​

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

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

getOutputPointsPrecision ​

Get the desired output precision.

Returns ​

TypeDescription
DesiredOutputPrecision

getScale ​

Get the scale factor of the source.

getSolidType ​

Get the solid type of the source.

Returns ​

TypeDescription
SolidType

newInstance ​

Method used to create a new instance of vtkPlatonicSolidSource.

ArgumentTypeRequiredDescription
initialValuesIPlatonicSolidSourceInitialValuesNofor pre-setting some of its content

requestData ​

Request data for the source.

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setOutputPointsPrecision ​

Set the desired output precision.

ArgumentTypeRequiredDescription
outputPointsPrecisionDesiredOutputPrecisionYes

setScale ​

Set the scale factor of the source.

ArgumentTypeRequiredDescription
scaleNumberYesThe scale factor.

setSolidType ​

Set the solid type of the source.

ArgumentTypeRequiredDescription
solidTypeSolidTypeYes