PolyDataFilters.plot_normals

PolyDataFilters.plot_normals#

PolyDataFilters.plot_normals(
*,
show_mesh: bool = True,
mag: float = 1.0,
flip: bool = False,
use_every: int = 1,
faces: bool = False,
color: ColorLike | None = None,
**kwargs,
) → _ShowReturnType[source]#

Plot the point normals of a mesh.

Parameters:
show_meshbool, default: True

Plot the mesh itself.

magfloat, default: 1.0

Size magnitude of the normal arrows.

flipbool, default: False

Flip the normal direction when True.

use_everyint, default: 1

Display every nth normal. By default every normal is displayed. Display every tenth normal by setting this parameter to 10.

facesbool, default: False

Plot face normals instead of the default point normals.

colorColorLike, optional

Color of the arrows. Defaults to pyvista.plotting.themes.Theme.edge_color.

**kwargsdict, optional

All additional keyword arguments will be passed to pyvista.Plotter.add_mesh().

Returns:
pyvista.CameraPosition

List of camera position, focal point, and view up. Returned when return_cpos is True.

Examples#

Download Python source code | Download Jupyter notebook

Plot the point normals of a sphere.

>>> import pyvista as pv
>>> sphere = pv.Sphere(phi_resolution=10, theta_resolution=10)
>>> sphere.plot_normals(mag=0.1, show_edges=True)
../../../_images/pyvista-PolyDataFilters-plot_normals-d25c0372b728d23d_00_00.png

Plot the face normals of a sphere.

>>> import pyvista as pv
>>> sphere = pv.Sphere(phi_resolution=10, theta_resolution=10)
>>> sphere.plot_normals(mag=0.1, faces=True, show_edges=True)
../../../_images/pyvista-PolyDataFilters-plot_normals-d25c0372b728d23d_01_00.png