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:
- kind
str
|int
, default: ‘tetrahedron’ The kind of Platonic solid to create. Either the name of the polyhedron or an integer index:
'tetrahedron'
or0
'cube'
or1
'octahedron'
or2
'icosahedron'
or3
'dodecahedron'
or4
- radius
float
, 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.
- kind
- 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)
See Platonic Solids for more examples using this filter.