pyvista.examples.cells.Quadrilateral#

Quadrilateral() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single quadrilateral.

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

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single quadrilateral.

Examples

Create and plot a single quad.

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

List the grid’s cells.

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

List the grid’s points.

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