UnstructuredGridFilters.warp_by_vector(vectors=None, factor=1.0, inplace=False, progress_bar=False)

Warp the dataset’s points by a point data vectors array’s values.

This modifies point coordinates by moving points along point vectors by the local vector times the scale factor.

A classical application of this transform is to visualize eigenmodes in mechanics.

vectorsstr, optional

Name of vector to warp by. Defaults to currently active vector.

factorfloat, optional

A scaling factor that multiplies the vectors to warp by. Can be used to enhance the warping effect.

inplacebool, optional

If True, the function will update the mesh in-place.

progress_barbool, optional

Display a progress bar to indicate progress.


The warped mesh resulting from the operation.


Warp a sphere by vectors.

>>> import pyvista as pv
>>> from pyvista import examples
>>> sphere = examples.load_sphere_vectors()
>>> warped = sphere.warp_by_vector()
>>> pl = pv.Plotter(shape=(1, 2))
>>> pl.subplot(0, 0)
>>> actor = pl.add_text("Before warp")
>>> actor = pl.add_mesh(sphere, color='white')
>>> pl.subplot(0, 1)
>>> actor = pl.add_text("After warp")
>>> actor = pl.add_mesh(warped, color='white')
>>> pl.show()

See Warping by Vectors for more examples using this filter.