pyvista.Prop3D.transform#
- Prop3D.transform(
- trans: pyvista.TransformLike,
- multiply_mode: Literal['pre', 'post'] = 'post',
- *,
- inplace: bool = False,
Apply a transformation to this object’s
user_matrix
.Note
This applies a transformation by modifying the
user_matrix
. This differs from methods likerotate_x()
,rotate_y()
,rotate_z()
, androtation_from()
which apply a transformation indirectly by modifying theorientation
. See theProp3D
class description for more information about how this class is transformed.Added in version 0.45.
- Parameters:
- trans
TransformLike
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-multiplytrans
with theuser_matrix
, i.e.user_matrix @ trans
. The transformation is applied before the current user-matrix.'post'
: post-multiplytrans
with theuser_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.
- trans
- Returns:
Prop3D
Transformed prop.
See also
pyvista.Transform
Describe linear transformations via a 4x4 matrix.
pyvista.DataObjectFilters.transform
Apply a transformation to a mesh.