Pyramid#
- Pyramid() UnstructuredGrid[source]#
Create a
pyvista.UnstructuredGridcontaining a single pyramid.This cell corresponds to the
pyvista.CellType.PYRAMIDcell type.- Returns:
pyvista.UnstructuredGridUnstructuredGrid containing a single pyramid.
Examples#
Download Python source code | Download Jupyter notebook
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)