pyvista.examples.cells.Tetrahedron#

Tetrahedron() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single Tetrahedron.

This cell corresponds to the pyvista.CellType.TETRA cell type.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single Tetrahedron.

Examples

Create and plot a single tetrahedron.

>>> from pyvista import examples
>>> grid = examples.cells.Tetrahedron()
>>> examples.plot_cell(grid)

List the grid’s cells.

>>> grid.cells
array([4, 0, 1, 2, 3])

List the grid’s points.

>>> grid.points
pyvista_ndarray([[ 1.,  1.,  1.],
                 [ 1., -1., -1.],
                 [-1.,  1., -1.],
                 [-1., -1.,  1.]])
>>> grid.celltypes  # same as pyvista.CellType.TETRA
array([10], dtype=uint8)
https://d33wubrfki0l68.cloudfront.net/537d4d1ed5466a4a7e9438b813f389e279b32fe1/77058/_images/pyvista-examples-cells-tetrahedron-1_00_00.png