PointSource
Introduction
vtkPointSource is a source object that creates a user-specified number of points within a specified radius about a specified center point. By default location of the points is random within the sphere. It is also possible to generate random points only on the surface of the sphere. The output PolyData has the specified number of points and 1 cell - a vtkPolyVertex containing all of the points.
Usage
import vtkPointSource from '@kitware/vtk.js/Filters/Sources/PointSource';
const point = vtkPointSource.newInstance({ numberOfPoints: 10 });
const polydata = point.getOutputData();Methods
extend
Method used to decorate a given object (publicAPI+model) with vtkPointSource 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 | IPointSourceInitialValues | No | (default: {}) |
getCenter
Get the center of the plane.
getCenterByReference
Get the center of the plane.
getNumberOfPoints
Get the number of points to generate.
getRadius
Get the radius of the point cloud.
newInstance
Method used to create a new instance of vtkPointSource.
| Argument | Type | Required | Description |
|---|---|---|---|
initialValues | IPointSourceInitialValues | No | for pre-setting some of its content |
requestData
| Argument | Type | Required | Description |
|---|---|---|---|
inData | Yes | ||
outData | Yes |
setCenter
Set the center of the point cloud.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Vector3 | Yes | The center point's coordinates. |
setCenter
Set the center of the point cloud.
| Argument | Type | Required | Description |
|---|---|---|---|
x | Number | Yes | The x coordinate. |
y | Number | Yes | The y coordinate. |
z | Number | Yes | The z coordinate. |
setCenterFrom
Set the center of the point cloud.
| Argument | Type | Required | Description |
|---|---|---|---|
center | Vector3 | Yes | The center point's coordinates. |
setNumberOfPoints
Set the number of points to generate.
| Argument | Type | Required | Description |
|---|---|---|---|
numberOfPoints | Number | Yes | The number of points to generate. |
setRadius
Set the radius of the point cloud. If you are generating a Gaussian distribution, then this is the standard deviation for each of x, y, and z.
| Argument | Type | Required | Description |
|---|---|---|---|
radius | Number | Yes | The radius value. |