pyvista.examples.cells.LagrangeCurve

Contents

pyvista.examples.cells.LagrangeCurve#

LagrangeCurve(*, cell_order: int = 3) UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single Lagrange curve.

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

Parameters:
cell_orderint, default: 3

Order of interpolation to use.

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single Lagrange curve.

Examples

Create and plot a single Lagrange curve.

>>> from pyvista import examples
>>> grid = examples.cells.LagrangeCurve()
>>> examples.plot_cell(grid)
../../../_images/pyvista-examples-cells-LagrangeCurve-c3bf7fce4efb2384_00_00.png

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.        ],
                 [0.33333334, 0.        , 0.        ],
                 [0.66666669, 0.        , 0.        ]])
>>> grid.celltypes  # same as pyvista.CellType.LAGRANGE_CURVE
array([68], dtype=uint8)