translate

PolyData.translate(xyz: Union[list, tuple, numpy.ndarray])

Translate the mesh.

Parameters
xyzlist or tuple or np.ndarray

Length 3 list, tuple or array.

Examples

Create a sphere and translate it by (2, 1, 2).

>>> import pyvista
>>> mesh = pyvista.Sphere()
>>> mesh.center
[0.0, 0.0, 0.0]
>>> mesh.translate((2, 1, 2))
>>> mesh.center
[2.0, 1.0, 2.0]