pyvista.Prop3D.transform

pyvista.Prop3D.transform#

Prop3D.transform(
trans: pyvista.TransformLike,
multiply_mode: Literal['pre', 'post'] = 'post',
*,
inplace: bool = False,
)[source]#

Apply a transformation to this object’s user_matrix.

Note

This applies a transformation by modifying the user_matrix. This differs from methods like rotate_x(), rotate_y(), rotate_z(), and rotation_from() which apply a transformation indirectly by modifying the orientation. See the Prop3D class description for more information about how this class is transformed.

Added in version 0.45.

Parameters:
transTransformLike

Transformation matrix as a 3x3 or 4x4 array, 3x3 or 4x4 vtkMatrix, vtkTransform, or a SciPy Rotation instance.

multiply_mode‘pre’ | ‘post’, default: ‘post’

Multiplication mode to use.

  • 'pre': pre-multiply trans with the user_matrix, i.e. user_matrix @ trans. The transformation is applied before the current user-matrix.

  • 'post': post-multiply trans with the user_matrix, i.e. trans @ user_matrix. The transformation is applied after the current user-matrix.

inplacebool, default: False

When True, modifies the prop inplace. Otherwise, a copy is returned.

Returns:
Prop3D

Transformed prop.

See also

pyvista.Transform

Describe linear transformations via a 4x4 matrix.

pyvista.DataObjectFilters.transform

Apply a transformation to a mesh.