pyvista.Plotter.add_volume_clip_plane#

Plotter.add_volume_clip_plane(
volume,
normal='x',
invert=False,
widget_color=None,
value=0.0,
assign_to_axis=None,
tubing=False,
origin_translation=True,
outline_translation=False,
implicit=True,
normal_rotation=True,
interaction_event='end',
origin=None,
outline_opacity=None,
**kwargs,
)[source]#

Clip a volume using a plane widget.

Parameters:
volumepyvista.plotting.volume.Volume or pyvista.ImageData or pyvista.RectilinearGrid

New dataset of type pyvista.ImageData or pyvista.RectilinearGrid, or the return value from pyvista.plotting.volume.Volume from Plotter.add_volume().

normalstr or tuple(float), optional

The starting normal vector of the plane.

invertbool, optional

Flag on whether to flip/invert the clip.

widget_colorColorLike, optional

Either a string, RGB list, or hex color string.

valuefloat, optional

Set the clipping value along the normal direction. The default value is 0.0.

assign_to_axisstr or int, optional

Assign the normal of the plane to be parallel with a given axis. Options are (0, 'x'), (1, 'y'), or (2, 'z').

tubingbool, optional

When using an implicit plane wiget, this controls whether or not tubing is shown around the plane’s boundaries.

origin_translationbool, optional

If False, the plane widget cannot be translated by its origin and is strictly placed at the given origin. Only valid when using an implicit plane.

outline_translationbool, optional

If False, the box widget cannot be translated and is strictly placed at the given bounds.

implicitbool, optional

When True, a vtkImplicitPlaneWidget is used and when False, a vtkPlaneWidget is used.

normal_rotationbool, optional

Set the opacity of the normal vector arrow to 0 such that it is effectively disabled. This prevents the user from rotating the normal. This is forced to False when assign_to_axis is set.

interaction_eventvtk.vtkCommand.EventIds, optional

The VTK interaction event to use for triggering the callback.

origintuple(float), optional

The starting coordinate of the center of the plane.

outline_opacitybool or float, optional

Set the visible of outline. Only valid when using an implicit plane. Either a bool or float.

Added in version 0.44.0.

**kwargsdict, optional

All additional keyword arguments are passed to Plotter.add_volume() to control how the volume is displayed. Only applicable if volume is either a pyvista.ImageData and pyvista.RectilinearGrid.

Returns:
vtk.vtkPlaneWidget or vtk.vtkImplicitPlaneWidget

The VTK plane widget depending on the value of implicit.