pyvista.examples.cells.QuadraticTriangle

pyvista.examples.cells.QuadraticTriangle#

QuadraticTriangle() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single quadratic triangle.

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

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single quadratic triangle.

Examples

Create and plot a single quadratic triangle.

>>> from pyvista import examples
>>> grid = examples.cells.QuadraticTriangle()
>>> examples.plot_cell(grid, cpos='xy')

List the grid’s cells.

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

List the grid’s points.

>>> grid.points
pyvista_ndarray([[0. , 0. , 0. ],
                 [1. , 0. , 0. ],
                 [0. , 1. , 0. ],
                 [0.5, 0. , 0. ],
                 [0.5, 0.5, 0. ],
                 [0. , 0.5, 0. ]])
>>> grid.celltypes  # same as pyvista.CellType.QUADRATIC_TRIANGLE
array([22], dtype=uint8)
../../../_images/pyvista-examples-cells-QuadraticTriangle-1_00_00.png