add_plane_widget

Plotter.add_plane_widget(callback, normal='x', origin=None, bounds=None, factor=1.25, color=None, assign_to_axis=None, tubing=False, outline_translation=False, origin_translation=True, implicit=True, pass_widget=False, test_callback=True, normal_rotation=True)

Add a plane widget to the scene.

This is useless without a callback function. You can pass a callable function that takes two arguments, the normal and origin of the plane in that order output from this widget, and performs a task with that plane.

Parameters
callbackcallable()

The method called every time the plane is updated. Takes two arguments, the normal and origin of the plane in that order.

normalstr or tuple(float)

The starting normal vector of the plane.

origintuple(float)

The starting coordinate of the center of the place.

boundstuple(float)

Length 6 tuple of the bounding box where the widget is placed.

factorfloat, optional

An inflation factor to expand on the bounds when placing.

colorstr or sequence, optional

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

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.

outline_translationbool, optional

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

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.

implicitbool, optional

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

pass_widgetbool, optional

If True, the widget will be passed as the last argument of the callback.

test_callbackbool, optional

If True, run the callback function after the widget is created.

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.

Returns
vtk.vtkImplicitPlaneWidget or vtk.vtkPlaneWidget

Plane widget.