Skip to content

CutterMapper

Introduction

vtkCutterMapper renders the zero-isosurface of a supported implicit function on the GPU. Supported implicit functions are currently plane, sphere, box, cylinder, and cone.

The mapper generates the cut surface geometry. By default, the cut surface is colored by data scalars from the underlying mesh. For uniform coloring, disable scalar visibility and use the Actor's property color instead.

  • For a plane, only displacement along the plane normal changes the cut. Moving the plane origin parallel to the plane still describes the same plane in 3D, so the cut does not move.
  • For a sphere, box, cylinder, or cone, translating the center changes the position of the implicit function, so the cut follows that translation.

Usage

javascript
const mapper = vtkCutterMapper.newInstance({
  cutFunction: plane,
  cutValue: 0.0,
  cutWidth: 1.5,
});
mapper.setScalarVisibility(false); // Use uniform color
actor.setMapper(mapper);
actor.getProperty().setColor(0, 1, 0); // Set cut color to green

Methods

extend

Method used to decorate a given object (publicAPI+model) with vtkCutterMapper characteristics.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesICutterMapperInitialValuesNo(default: {})

getCutFunction

Returns the current implicit cut function.

getCutValue

Returns the scalar offset applied to the implicit function.

For a plane this acts as an additional displacement along the plane normal.

getCutWidth

Returns the screen-space cut width multiplier used by the shader.

getSupportedImplicitFunctionName

Returns the VTK.js class name of the supported implicit function currently in use, or null when the cut function is missing or unsupported.

newInstance

Method used to create a new instance of vtkCutterMapper

ArgumentTypeRequiredDescription
initialValuesICutterMapperInitialValuesYesfor pre-setting some of its content

setCutFunction

Sets the implicit function used to generate the cut on the GPU.

Supported implicit functions are currently plane, sphere, box, cylinder, and cone.

setCutValue

Sets the scalar offset applied to the implicit function.

For a plane, changing the plane origin only changes the cut when the displacement has a component along the plane normal. Moving the origin parallel to the plane describes the same plane in 3D, so the cut does not move. cutValue can also be used to offset the plane along its normal.

setCutWidth

Sets the screen-space cut width multiplier used by the shader.