pyvista.Tube

Contents

pyvista.Tube#

Tube(
pointa: VectorLike[float] = (-0.5, 0.0, 0.0),
pointb: VectorLike[float] = (0.5, 0.0, 0.0),
resolution: int = 1,
radius: float = 1.0,
n_sides: int = 15,
capping: bool = False,
) PolyData[source]#

Create a tube.

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 tube into.

radiusfloat, default: 1.0

Minimum tube radius (minimum because the tube radius may vary).

n_sidesint, default: 15

Number of sides for the tube.

cappingbool, default: False

Turn on/off whether to cap the ends with polygons.

Added in version 0.45.

Returns:
pyvista.PolyData

Tube mesh.

Examples

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

>>> import pyvista as pv
>>> mesh = pv.Tube((0, 0, 0), (0, 0, 1))
>>> mesh.plot()
../../../_images/pyvista-Tube-1_00_00.png