DataObjectFilters.flip_normal

DataObjectFilters.flip_normal#

DataObjectFilters.flip_normal(
normal: VectorLikeFloat,
*,
point: VectorLikeFloat | None = None,
transform_all_input_vectors: bool = False,
inplace: bool = False,
) → _MeshType_co[source]#

Flip mesh about the normal.

Note

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

Parameters:
normalVectorLikeFloat

Normal vector to flip about.

pointVectorLikeFloat, optional

Point to rotate about. Defaults to center of mesh at center.

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:
outputDataSet | MultiBlock

Dataset flipped about its normal. Return type matches input.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> from pyvista import examples
>>> pl = pv.Plotter(shape=(1, 2))
>>> pl.subplot(0, 0)
>>> pl.show_axes()
>>> mesh1 = examples.download_teapot()
>>> _ = pl.add_mesh(mesh1)
>>> pl.subplot(0, 1)
>>> pl.show_axes()
>>> mesh2 = mesh1.flip_normal([1.0, 1.0, 1.0], inplace=False)
>>> _ = pl.add_mesh(mesh2)
>>> pl.show(cpos='xy')
../../../_images/pyvista-DataObjectFilters-flip_normal-493f25339dc12329_00_00.png

See Also#

pyvista.Transform.reflect

Concatenate a reflection matrix with a transformation.