pyvista.examples.cells.CubicLine

Contents

pyvista.examples.cells.CubicLine#

CubicLine() UnstructuredGrid[source]#

Create a pyvista.UnstructuredGrid containing a single cubic line.

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

Returns:
pyvista.UnstructuredGrid

UnstructuredGrid containing a single cubic line.

Examples

Create and plot a single cubic line.

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

List the grid’s cells.

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

List the grid’s points.

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