PolyDataFilters.tube#
- PolyDataFilters.tube(
- radius=None,
- scalars=None,
- capping: bool = True,
- n_sides=20,
- radius_factor=10.0,
- absolute: bool = False,
- preference='point',
- inplace: bool = False,
- progress_bar: bool = False,
Generate a tube around each input line.
The radius of the tube can be set to linearly vary with a scalar value.
- Parameters:
- radius
float,optional Minimum tube radius (minimum because the tube radius may vary).
- scalars
str,optional Scalars array by which the radius varies.
- cappingbool, default:
True Turn on/off whether to cap the ends with polygons.
- n_sides
int, default: 20 Set the number of sides for the tube. Minimum of 3.
- radius_factor
float, default: 10.0 Maximum tube radius in terms of a multiple of the minimum radius.
- absolutebool, default:
False Vary the radius with values from scalars in absolute units.
- preference
str, default: ‘point’ The field preference when searching for the scalars array by name.
- inplacebool, default:
False Whether to update the mesh in-place.
- progress_barbool, default:
False Display a progress bar to indicate progress.
- radius
- Returns:
pyvista.PolyDataTube-filtered mesh.
Examples#
Download Python source code | Download Jupyter notebook
Convert a single line to a tube.
>>> import pyvista as pv
>>> line = pv.Line()
>>> tube = line.tube(radius=0.02)
>>> f'Line Cells: {line.n_cells}'
'Line Cells: 1'
>>> f'Tube Cells: {tube.n_cells}'
'Tube Cells: 22'
>>> tube.plot(color='lightblue')
Used In#
Guides
- Overview (1 use)
Docstring Examples
DataSetFilters.streamlines_evenly_spaced_2D(1 use)download_caffeine(1 use)download_m4_total_density(1 use)
Gallery Examples