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
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.
| Argument | Type | Required | Description |
|---|---|---|---|
publicAPI | Yes | object on which methods will be bounds (public) | |
model | Yes | object on which data structure will be bounds (protected) | |
initialValues | IPlaneSourceInitialValues | No | (default: {}) |
getCenter
Get the center of the regular polygon.
Returns
| Type | Description |
|---|---|
| Vector3 | center of the polygon |
getCenterByReference
Get a reference to the center of the regular polygon.
Returns
| Type | Description |
|---|---|
| Vector3 | reference to the center of the polygon |
getGeneratePolygon
Get whether to generate polygon points.
Returns
| Type | Description |
|---|---|
| Boolean | true if polygon points are generated, false otherwise |
getGeneratePolyline
Get whether to generate polyline points.
Returns
| Type | Description |
|---|---|
| Boolean | true if polyline points are generated, false otherwise |
getNormal
Get the normal of the regular polygon.
Returns
| Type | Description |
|---|---|
| Vector3 | normal of the polygon |
getNormalByReference
Get a reference to the normal of the regular polygon.
Returns
| Type | Description |
|---|---|
| Vector3 | reference to the normal of the polygon |
getNumberOfSides
Get the number of sides for the regular polygon.
Returns
| Type | Description |
|---|---|
| Number | number of sides |
getOutputPointsPrecision
Get the output points precision.
Returns
| Type | Description |
|---|---|
| DesiredOutputPrecision | the output points precision |
getRadius
Get the radius of the regular polygon.
Returns
| Type | Description |
|---|---|
| Number | radius of the polygon |
newInstance
Method used to create a new instance of vtkRegularPolygonSource.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IPlaneSourceInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setCenter
Set the center of the regular polygon.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setGeneratePolygon
Set whether to generate polygon points.
| Argument | Type | Required | Description |
|---|---|---|---|
generatePolygon | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setGeneratePolyline
Set whether to generate polyline points.
| Argument | Type | Required | Description |
|---|---|---|---|
generatePolyline | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setNormal
Set the normal of the regular polygon.
| Argument | Type | Required | Description |
|---|---|---|---|
normal | Vector3 | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setNumberOfSides
Set the number of sides for the regular polygon.
| Argument | Type | Required | Description |
|---|---|---|---|
numberOfSides | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setOutputPointsPrecision
Set the output points precision.
| Argument | Type | Required | Description |
|---|---|---|---|
outputPointsPrecision | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |
setRadius
Set the radius of the regular polygon.
| Argument | Type | Required | Description |
|---|---|---|---|
radius | Yes |
Returns
| Type | Description |
|---|---|
| Boolean | true if the value was changed, false otherwise |