LineSource
Introduction
vtkLineSource creates a line segment from point1 to point2; The resolution can be specified, which determines the number of points along the line. Following a vtkLineSource by a vtkTubeFilter is a convenient way to create a cylinder based on endpoints.
Usage
import vtkLineSource from '@kitware/vtk.js/Filters/Sources/LineSource';
const line = vtkLineSource.newInstance({ resolution: 10 });
const polydata = line.getOutputData();Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkLineSource 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 | ILineSourceInitialValues | No | (default: {}) |
getPoint1
Get the starting point of the line.
getPoint1ByReference
Get the starting point of the line.
getPoint2
Get the ending point of the line.
getPoint2ByReference
Get the ending point of the line.
getResolution
Get the resolution of the line.
newInstance
Method used to create a new instance of vtkLineSource.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | ILineSourceInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setPoint1
Set the starting point of the line.
| Argument | Type | Required | Description |
|---|---|---|---|
point1 | Vector3 | Yes | The starting point's coordinates. |
setPoint1
Set the starting point of the line.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setPoint1From
Set the starting point of the line.
| Argument | Type | Required | Description |
|---|---|---|---|
point1 | Vector3 | Yes | The starting point's coordinates. |
setPoint2
Set the ending point of the line.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setPoint2From
Set the ending point of the line.
| Argument | Type | Required | Description |
|---|---|---|---|
point2 | Vector3 | Yes | The ending point's coordinates. |
setResolution
Set the number of segments used to represent the line.
| Argument | Type | Required | Description |
|---|---|---|---|
resolution | Number | Yes | The number of segments. |