pyvista.PlatonicSolid#

PlatonicSolid(kind='tetrahedron', radius=1.0, center=(0.0, 0.0, 0.0))[source]#

Create a Platonic solid of a given size.

Parameters:
kindstr | int, default: ‘tetrahedron’

The kind of Platonic solid to create. Either the name of the polyhedron or an integer index:

  • 'tetrahedron' or 0

  • 'cube' or 1

  • 'octahedron' or 2

  • 'icosahedron' or 3

  • 'dodecahedron' or 4

radiusfloat, default: 1.0

The radius of the circumscribed sphere for the solid to create.

centersequence[float], default: (0.0, 0.0, 0.0)

Sequence defining the center of the solid to create.

Returns:
pyvista.PolyData

One of the five Platonic solids. Cell scalars are defined that assign integer labels to each face (with array name "FaceIndex").

Examples

Create and plot a dodecahedron.

>>> import pyvista as pv
>>> dodeca = pv.PlatonicSolid('dodecahedron')
>>> dodeca.plot(categories=True)
../../../_images/pyvista-PlatonicSolid-1_00_00.png

See Platonic Solids for more examples using this filter.