pyvista.examples.cells.Pyramid#
- Pyramid() UnstructuredGrid [source]#
Create a
pyvista.UnstructuredGrid
containing a single pyramid.This cell corresponds to the
pyvista.CellType.PYRAMID
cell type.- Returns:
pyvista.UnstructuredGrid
UnstructuredGrid containing a single pyramid.
Examples
Create and plot a single pyramid.
>>> from pyvista import examples >>> grid = examples.cells.Pyramid() >>> examples.plot_cell(grid)
List the grid’s cells.
>>> grid.cells array([5, 0, 1, 2, 3, 4])
List the grid’s points.
>>> grid.points pyvista_ndarray([[ 0.5 , 0.5 , 0. ], [-0.5 , 0.5 , 0. ], [-0.5 , -0.5 , 0. ], [ 0.5 , -0.5 , 0. ], [ 0. , 0. , 0.70710678]])
>>> grid.celltypes # same as pyvista.CellType.PYRAMID array([14], dtype=uint8)