Introduction
vtkConeSource creates a cone centered at a specified point and pointing in a specified direction.
(By default, the center is the origin and the direction is the x-axis.) Depending upon the resolution of this object,
different representations are created. If resolution=0 a line is created; if resolution=1, a single triangle is created;
if resolution=2, two crossed triangles are created. For resolution > 2, a 3D cone (with resolution number of sides)
is created. It also is possible to control whether the bottom of the cone is capped with a (resolution-sided) polygon,
and to specify the height and radius of the cone.
Usage
import vtkConeSource from '@kitware/vtk.js/Filters/Sources/ConeSource'; |
Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkConeSource 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 |
IConeSourceInitialValues | No | (default: {}) |
getCapping
Get the cap the base of the cone with a polygon.
getCenter
Get the center of the cone.
getCenterByReference
Get the center of the cone.
getDirection
Get the orientation vector of the cone.
getDirectionByReference
Get the orientation vector of the cone.
getHeight
Get the height of the cone.
getRadius
Get the base radius of the cone.
getResolution
Get the number of facets used to represent the cone.
newInstance
Method used to create a new instance of vtkConeSource.
Argument | Type | Required | Description |
---|---|---|---|
initialValues |
IConeSourceInitialValues | No | for pre-setting some of its content |
requestData
Expose methods
Argument | Type | Required | Description |
---|---|---|---|
inData |
Yes | ||
outData |
Yes |
setCapping
Turn on/off whether to cap the base of the cone with a polygon.
Argument | Type | Required | Description |
---|---|---|---|
capping |
Boolean | Yes |
setCenter
Set the center of the cone.
It is located at the middle of the axis of the cone.
!!! warning
This is not the center of the base of the cone!
Argument | Type | Required | Description |
---|---|---|---|
center |
Vector3 | Yes |
setCenter
Set the center of the cone.
It is located at the middle of the axis of the cone.
!!! warning
This is not the center of the base of the cone!
Argument | Type | Required | Description |
---|---|---|---|
x |
Number | Yes | |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
setCenterFrom
Set the center of the cone.
It is located at the middle of the axis of the cone.
!!! warning
This is not the center of the base of the cone!
Argument | Type | Required | Description |
---|---|---|---|
center |
Vector3 | Yes |
setDirection
Set the direction for the cone.
Argument | Type | Required | Description |
---|---|---|---|
direction |
Vector3 | Yes |
setDirection
Set the direction for the cone.
Argument | Type | Required | Description |
---|---|---|---|
direction |
Vector3 | Yes | The direction coordinates. |
setDirection
Set the direction for the cone.
Argument | Type | Required | Description |
---|---|---|---|
x |
Number | Yes | The x coordinate. |
y |
Number | Yes | The y coordinate. |
z |
Number | Yes | The z coordinate. |
setDirectionFrom
Set the direction for the cone.
Argument | Type | Required | Description |
---|---|---|---|
direction |
Vector3 | Yes |
setHeight
Set the height of the cone.
This is the height along the cone in its specified direction.
Argument | Type | Required | Description |
---|---|---|---|
height |
Number | Yes |
setRadius
Set the base radius of the cone.
Argument | Type | Required | Description |
---|---|---|---|
radius |
Number | Yes |
setResolution
Set the number of facets used to represent the cone.
Argument | Type | Required | Description |
---|---|---|---|
resolution |
Yes |
Source
import { vtkAlgorithm, vtkObject } from '../../../interfaces'; |
import macro from 'vtk.js/Sources/macros'; |