Skip to content

ShrinkPolyData ​

Introduction ​

vtkShrinkPolyData shrinks cells composing a polygonal dataset (e.g., vertices, lines, polygons, and triangle strips) towards their centroid. The centroid of a cell is computed as the average position of the cell points. Shrinking results in disconnecting the cells from one another. The output dataset type of this filter is polygonal data.

During execution the filter passes its input cell data to its output. Point data attributes are copied to the points created during the shrinking process.

Methods ​

extend ​

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

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

getShrinkFactor ​

Get the shrink factor.

newInstance ​

Method used to create a new instance of vtkShrinkPolyData.

ArgumentTypeRequiredDescription
initialValuesIShrinkPolyDataInitialValuesNofor pre-setting some of its content

requestData ​

Expose methods

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setShrinkFactor ​

Set the shrink factor.

ArgumentTypeRequiredDescription
shrinkFactorNumberYes

shrinkLine ​

Shrink two points towards their midpoint by a shrink factor.

ArgumentTypeRequiredDescription
p1Vector3Yes- The [x, y, z] coordinates of the first point
p2Vector3Yes- The [x, y, z] coordinates of the second point
shrinkFactornumberYes- The shrink factor (0.0 to 1.0)
shrunkPointsArray[Number]No- Optional array to store the shrunk points

Returns ​

TypeDescription
Array[Number]Array containing the two new points