DataObjectFilters.translate#
- DataObjectFilters.translate( ) _MeshType_co[source]#
Translate the mesh.
Note
See also the notes at
transform()which is used by this filter under the hood.- Parameters:
- Returns:
- output
DataSet|MultiBlock Translated dataset. Return type matches input.
- output
See also
pyvista.Transform.translateConcatenate a translation matrix with a transformation.
Examples#
Download Python source code | Download Jupyter notebook
Create a sphere and translate it by (2, 1, 2).
>>> import pyvista as pv
>>> mesh = pv.Sphere()
>>> mesh.center
(0.0, 0.0, 0.0)
>>> trans = mesh.translate((2, 1, 2), inplace=False)
>>> trans.center
(2.0, 1.0, 2.0)