pyvista.plotting.widgets.WidgetHelper.add_mesh_slice_spline#
- WidgetHelper.add_mesh_slice_spline(
- mesh,
- generate_triangles: bool = False,
- n_handles=5,
- resolution=25,
- widget_color=None,
- show_ribbon: bool = False,
- ribbon_color='pink',
- ribbon_opacity=0.5,
- initial_points=None,
- closed: bool = False,
- interaction_event=45,
- **kwargs,
Slice a mesh with a spline widget.
Add a mesh to the scene with a spline widget that is used to slice the mesh interactively.
The sliced mesh is saved to the
.spline_sliced_meshes
attribute on the plotter.- Parameters:
- mesh
pyvista.DataSet
orvtk.vtkAlgorithm
The input dataset to add to the scene and slice along the spline 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.- n_handles
int
,optional
The number of interactive spheres to control the spline’s parametric function.
- resolution
int
,optional
The number of points to generate on the spline.
- widget_color
ColorLike
,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'
- show_ribbonbool,
optional
If
True
, the poly plane used for slicing will also be shown.- ribbon_color
ColorLike
,optional
Color of the ribbon. Either a string, RGB sequence, or hex color string.
- ribbon_opacity
float
,optional
Opacity of ribbon. Defaults to 1.0 and must be between
[0, 1]
.- initial_pointssequence,
optional
The points to initialize the widget placement. Must have same number of elements as
n_handles
. If the first and last point are the same, this will be a closed loop spline.- closedbool,
optional
Make the spline a closed loop.
- interaction_event
vtk.vtkCommand.EventIds
,optional
The VTK interaction event to use for triggering the callback.
- **kwargs
dict
,optional
All additional keyword arguments are passed to
pyvista.Plotter.add_mesh()
to control how the mesh is displayed.
- mesh
- Returns:
vtk.vtkActor
VTK actor of the mesh.