pyvista.Transform.flip_x

pyvista.Transform.flip_x#

Transform.flip_x(
*,
point: VectorLike[float] | None = None,
multiply_mode: Literal['pre', 'post'] | None = None,
) Transform[source]#

Concatenate a reflection about the x-axis.

Create a reflection about the x-axis and concatenate() it with the current transformation matrix according to pre-multiply or post-multiply semantics.

Internally, the matrix is stored in the matrix_list.

Parameters:
pointVectorLike[float], optional

Point to reflect about. By default, the object’s point is used, but this can be overridden. If set, two additional transformations are concatenated and added to the matrix_list:

multiply_mode‘pre’ | ‘post’, optional

Multiplication mode to use when concatenating the matrix. By default, the object’s multiply_mode is used, but this can be overridden. Set this to 'pre' for pre-multiplication or 'post' for post-multiplication.

See also

pyvista.DataSetFilters.flip_x

Flip a mesh about the x-axis.

Examples

Concatenate a reflection about the x-axis.

>>> import pyvista as pv
>>> transform = pv.Transform()
>>> _ = transform.flip_x()
>>> transform.matrix
array([[-1.,  0.,  0.,  0.],
       [ 0.,  1.,  0.,  0.],
       [ 0.,  0.,  1.,  0.],
       [ 0.,  0.,  0.,  1.]])

Concatenate a second reflection, but this time about a point.

>>> _ = transform.flip_x(point=(4, 5, 6))
>>> transform.matrix
array([[1., 0., 0., 8.],
       [0., 1., 0., 0.],
       [0., 0., 1., 0.],
       [0., 0., 0., 1.]])