pyvista.plotting.widgets.WidgetHelper.add_mesh_slice_orthogonal

pyvista.plotting.widgets.WidgetHelper.add_mesh_slice_orthogonal#

WidgetHelper.add_mesh_slice_orthogonal(
mesh,
generate_triangles: bool = False,
widget_color=None,
tubing: bool = False,
interaction_event: pyvista.InteractionEventType = 'end',
**kwargs,
)[source]#

Slice a mesh with three interactive planes.

Adds three interactive plane slicing widgets for orthogonal slicing along each cartesian axis.

Parameters:
meshpyvista.DataSet or vtk.vtkAlgorithm

The input dataset to add to the scene and threshold or algorithm that produces said mesh.

generate_trianglesbool, optional

If this is enabled (False by default), the output will be triangles otherwise, the output will be the intersection polygons.

widget_colorColorLike, optional

Color of the widget. Either a string, RGB sequence, or hex color string. For example:

  • color='white'

  • color='w'

  • color=[1.0, 1.0, 1.0]

  • color='#FFFFFF'

tubingbool, optional

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

interaction_eventInteractionEventType, optional

The VTK interaction event to use for triggering the callback. Accepts either the strings 'start', 'end', 'always' or a vtk.vtkCommand.EventIds.

**kwargsdict, optional

All additional keyword arguments are passed to pyvista.Plotter.add_mesh() to control how the mesh is displayed.

Returns:
list

List of vtk.vtkActor(s).

Examples

Shows an interactive plane sliced along each cartesian axis of the mesh.

>>> import pyvista as pv
>>> pl = pv.Plotter()
>>> mesh = pv.Wavelet()
>>> _ = pl.add_mesh(mesh.outline())
>>> _ = pl.add_mesh_slice_orthogonal(mesh)
>>> pl.show()
../../../_images/pyvista-plotting-widgets-WidgetHelper-add_mesh_slice_orthogonal-1_00_00.png