Skip to content

RegularPolygonSource

Introduction

vtkRegularPolygonSource is a source object that creates a single n-sided polygon and/or polyline. The polygon is centered at a specified point, orthogonal to a specified normal, and with a circumscribing radius set by the user. The user can also specify the number of sides of the polygon ranging from [3,N].

Usage

js
import vtkRegularPolygonSource from '@kitware/vtk.js/Filters/Sources/RegularPolygonSource';

const regularPolygonSource = vtkRegularPolygonSource.newInstance();
const polydata = regularPolygonSource.getOutputData();

Methods

extend

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

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

getCenter

Get the center of the regular polygon.

Returns

TypeDescription
Vector3center of the polygon

getCenterByReference

Get a reference to the center of the regular polygon.

Returns

TypeDescription
Vector3reference to the center of the polygon

getGeneratePolygon

Get whether to generate polygon points.

Returns

TypeDescription
Booleantrue if polygon points are generated, false otherwise

getGeneratePolyline

Get whether to generate polyline points.

Returns

TypeDescription
Booleantrue if polyline points are generated, false otherwise

getNormal

Get the normal of the regular polygon.

Returns

TypeDescription
Vector3normal of the polygon

getNormalByReference

Get a reference to the normal of the regular polygon.

Returns

TypeDescription
Vector3reference to the normal of the polygon

getNumberOfSides

Get the number of sides for the regular polygon.

Returns

TypeDescription
Numbernumber of sides

getOutputPointsPrecision

Get the output points precision.

Returns

TypeDescription
DesiredOutputPrecisionthe output points precision

getRadius

Get the radius of the regular polygon.

Returns

TypeDescription
Numberradius of the polygon

newInstance

Method used to create a new instance of vtkRegularPolygonSource.

ArgumentTypeRequiredDescription
initialValuesIPlaneSourceInitialValuesNofor pre-setting some of its content

requestData

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setCenter

Set the center of the regular polygon.

ArgumentTypeRequiredDescription
centerVector3Yes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setGeneratePolygon

Set whether to generate polygon points.

ArgumentTypeRequiredDescription
generatePolygonYes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setGeneratePolyline

Set whether to generate polyline points.

ArgumentTypeRequiredDescription
generatePolylineYes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setNormal

Set the normal of the regular polygon.

ArgumentTypeRequiredDescription
normalVector3Yes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setNumberOfSides

Set the number of sides for the regular polygon.

ArgumentTypeRequiredDescription
numberOfSidesYes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setOutputPointsPrecision

Set the output points precision.

ArgumentTypeRequiredDescription
outputPointsPrecisionYes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise

setRadius

Set the radius of the regular polygon.

ArgumentTypeRequiredDescription
radiusYes

Returns

TypeDescription
Booleantrue if the value was changed, false otherwise