streamlines

PolyDataFilters.streamlines(vectors=None, source_center=None, source_radius=None, n_points=100, start_position=None, return_source=False, pointa=None, pointb=None, progress_bar=False, **kwargs)

Integrate a vector field to generate streamlines.

The default behavior uses a sphere as the source - set its location and radius via the source_center and source_radius keyword arguments. n_points defines the number of starting points on the sphere surface. Alternatively, a line source can be used by specifying pointa and pointb. n_points again defines the number of points on the line.

You can retrieve the source by specifying return_source=True.

Optional keyword parameters from pyvista.DataSetFilters.streamlines_from_source() can be used here to control the generation of streamlines.

Parameters
vectorsstr, optional

The string name of the active vector field to integrate across.

source_centertuple(float), optional

Length 3 tuple of floats defining the center of the source particles. Defaults to the center of the dataset.

source_radiusfloat, optional

Float radius of the source particle cloud. Defaults to one-tenth of the diagonal of the dataset’s spatial extent.

n_pointsint, optional

Number of particles present in source sphere or line.

start_positiontuple(float), optional

A single point. This will override the sphere point source.

return_sourcebool, optional

Return the source particles as pyvista.PolyData as well as the streamlines. This will be the second value returned if True.

pointa, pointbtuple(float), optional

The coordinates of a start and end point for a line source. This will override the sphere and start_position point source.

progress_barbool, optional

Display a progress bar to indicate progress.

**kwargsdict, optional

See pyvista.DataSetFilters.streamlines_from_source().

Returns
streamlinespyvista.PolyData

This produces polylines as the output, with each cell (i.e., polyline) representing a streamline. The attribute values associated with each streamline are stored in the cell data, whereas those associated with streamline-points are stored in the point data.

sourcepyvista.PolyData

The points of the source are the seed points for the streamlines. Only returned if return_source=True.

Examples

See the Streamlines example.