pyvista.Transform.reflect#
- Transform.reflect(
- *normal,
- point: VectorLike[float] | None = None,
- multiply_mode: Literal['pre', 'post'] | None = None,
Concatenate a reflection matrix.
Create a reflection matrix and
concatenate()
it with the current transformationmatrix
according to pre-multiply or post-multiply semantics.Internally, the matrix is stored in the
matrix_list
.- Parameters:
- *normal
VectorLike
[float
] Normal direction for reflection.
- point
VectorLike
[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 thematrix_list
:translate()
topoint
before the reflectiontranslate()
away frompoint
after the reflection
- 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.
- *normal
See also
pyvista.DataSet.reflect()
Reflect a mesh.
Examples
Concatenate a reflection matrix.
>>> import pyvista as pv >>> transform = pv.Transform() >>> _ = transform.reflect(0, 0, 1) >>> transform.matrix array([[ 1., 0., 0., 0.], [ 0., 1., 0., 0.], [ 0., 0., -1., 0.], [ 0., 0., 0., 1.]])
Concatenate a second reflection matrix.
>>> _ = transform.reflect((1, 0, 0)) >>> transform.matrix array([[-1., 0., 0., 0.], [ 0., 1., 0., 0.], [ 0., 0., -1., 0.], [ 0., 0., 0., 1.]])