LagrangeTriangle#
- LagrangeTriangle(*, cell_order: int = 3) UnstructuredGrid[source]#
Create a
pyvista.UnstructuredGridcontaining a single Lagrange triangle.This cell corresponds to the
pyvista.CellType.LAGRANGE_TRIANGLEcell type.- Parameters:
- cell_order
int, default: 3 Order of interpolation to use.
- cell_order
- Returns:
pyvista.UnstructuredGridUnstructuredGrid containing a single Lagrange triangle.
Examples#
Download Python source code | Download Jupyter notebook
Create and plot a single Lagrange triangle.
>>> from pyvista import examples
>>> grid = examples.cells.LagrangeTriangle()
>>> examples.plot_cell(grid, cpos='xy')
List the grid’s cells.
>>> grid.cells
array([10, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]...)
List the grid’s points.
>>> grid.points
pyvista_ndarray([[0. , 0. , 0. ],
[1. , 0. , 0. ],
[0. , 1. , 0. ],
[0.33333334, 0. , 0. ],
[0.66666669, 0. , 0. ],
[0.66666669, 0.33333334, 0. ],
[0.33333334, 0.66666669, 0. ],
[0. , 0.66666669, 0. ],
[0. , 0.33333334, 0. ],
[0.33333334, 0.33333334, 0. ]])
>>> grid.celltypes # same as pyvista.CellType.LAGRANGE_TRIANGLE
array([69], dtype=uint8)