DataObjectFilters.translate#
- DataObjectFilters.translate(
- xyz: VectorLike[float],
- transform_all_input_vectors: bool = False,
- inplace: bool = False,
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
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)
See Also#
pyvista.Transform.translateConcatenate a translation matrix with a transformation.
Used In#
Guides
- Cameras (1 use)
Docstring Examples
DataObjectFilters.convex_hull(1 use)DataSetFilters.extract_cells_by_type(1 use)Follower(1 use)PolyDataFilters.append_polydata(1 use)UnstructuredGridFilters.clean(1 use)plot_ants_plane(1 use)
Gallery Examples