Skip to content

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

js
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.

ArgumentTypeRequiredDescription
publicAPIYesobject on which methods will be bounds (public)
modelYesobject on which data structure will be bounds (protected)
initialValuesIPointSourceInitialValuesNo(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.

ArgumentTypeRequiredDescription
initialValuesIPointSourceInitialValuesNofor pre-setting some of its content

requestData

ArgumentTypeRequiredDescription
inDataYes
outDataYes

setCenter

Set the center of the point cloud.

ArgumentTypeRequiredDescription
centerVector3YesThe center point's coordinates.

setCenter

Set the center of the point cloud.

ArgumentTypeRequiredDescription
xNumberYesThe x coordinate.
yNumberYesThe y coordinate.
zNumberYesThe z coordinate.

setCenterFrom

Set the center of the point cloud.

ArgumentTypeRequiredDescription
centerVector3YesThe center point's coordinates.

setNumberOfPoints

Set the number of points to generate.

ArgumentTypeRequiredDescription
numberOfPointsNumberYesThe 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.

ArgumentTypeRequiredDescription
radiusNumberYesThe radius value.