pyvista.examples.cells.Pyramid

Contents

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([[ 1.        ,  1.        ,  0.        ],
                 [-1.        ,  1.        ,  0.        ],
                 [-1.        , -1.        ,  0.        ],
                 [ 1.        , -1.        ,  0.        ],
                 [ 0.        ,  0.        ,  1.60803807]])
>>> grid.celltypes  # same as pyvista.CellType.PYRAMID
array([14], dtype=uint8)
../../../_images/pyvista-examples-cells-Pyramid-1_00_00.png