pyvista.DataSet.scale#

DataSet.scale(xyz: int | float | ndarray[Any, dtype[number]] | Sequence[int | float], transform_all_input_vectors: bool = False, inplace: bool = False)[source]#

Scale the mesh.

Note

See also the notes at transform() which is used by this filter under the hood.

Parameters:
xyzNumber | Vector

A vector sequence defining the scale factors along x, y, and z. If a scalar, the same uniform scale is used along all three axes.

transform_all_input_vectorsbool, default: False

When True, all input vectors are transformed. Otherwise, only the points, normals and active vectors are transformed.

inplacebool, default: False

Updates mesh in-place.

Returns:
pyvista.DataSet

Scaled dataset.

Examples

>>> import pyvista as pv
>>> from pyvista import examples
>>> pl = pv.Plotter(shape=(1, 2))
>>> pl.subplot(0, 0)
>>> pl.show_axes()
>>> _ = pl.show_grid()
>>> mesh1 = examples.download_teapot()
>>> _ = pl.add_mesh(mesh1)
>>> pl.subplot(0, 1)
>>> pl.show_axes()
>>> _ = pl.show_grid()
>>> mesh2 = mesh1.scale([10.0, 10.0, 10.0], inplace=False)
>>> _ = pl.add_mesh(mesh2)
>>> pl.show(cpos="xy")
../../../_images/pyvista-DataSet-scale-1_00_00.png