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
orint
,optional
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
,optional
The radius of the circumscribed sphere for the solid to create.
- centersequence,
optional
Three-length 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 >>> dodeca = pyvista.PlatonicSolid('dodecahedron') >>> dodeca.plot(categories=True)
See Platonic Solids for more examples using this filter.