pyvista.Line#

Line(pointa=(-0.5, 0.0, 0.0), pointb=(0.5, 0.0, 0.0), resolution=1)[source]#

Create a line.

Parameters:
pointasequence[float], default: (-0.5, 0.0, 0.0)

Location in [x, y, z].

pointbsequence[float], default: (0.5, 0.0, 0.0)

Location in [x, y, z].

resolutionint, default: 1

Number of pieces to divide line into.

Returns:
pyvista.PolyData

Line mesh.

Examples

Create a line between (0, 0, 0) and (0, 0, 1).

>>> import pyvista as pv
>>> mesh = pv.Line((0, 0, 0), (0, 0, 1))
>>> mesh.plot(color='k', line_width=10)
https://d33wubrfki0l68.cloudfront.net/b0ecdae0a08e787b2055c88735b7d2212f4ccfd3/3e4cc/_images/pyvista-line-1_00_00.png