pyvista.examples.cells.Line#

Line() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single Line.

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

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single line.

Examples

Create and plot a single line.

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

List the grid’s cells.

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

List the grid’s points.

>>> grid.points
pyvista_ndarray([[0., 0., 0.],
                 [1., 0., 0.]])
>>> grid.celltypes  # same as pyvista.CellType.LINE
array([3], dtype=uint8)
https://d33wubrfki0l68.cloudfront.net/e0d55ba0f66861d9429fdbb19620e9a8c4833749/fb08f/_images/pyvista-examples-cells-line-1_00_00.png