Polyhedron#
- Polyhedron() UnstructuredGrid[source]#
Create a
pyvista.UnstructuredGridcontaining a single polyhedron.This cell corresponds to the
pyvista.CellType.POLYHEDRONcell type.- Returns:
pyvista.UnstructuredGridUnstructuredGrid containing a single polyhedron.
Examples#
Download Python source code | Download Jupyter notebook
Create and plot a single polyhedron.
>>> from pyvista import examples
>>> grid = examples.cells.Polyhedron()
>>> examples.plot_cell(grid)
A polyhedron is defined by it’s faces. List the grid’s faces.
>>> grid.get_cell(0).faces
[Cell...
..., Cell...
..., Cell...
...]
>>> grid.celltypes # same as pyvista.CellType.POLYHEDRON
array([42], dtype=uint8)