vtk_points(points, deep=True, force_float=False)[source]#

Convert numpy array or array-like to a vtkPoints object.

pointsnumpy.ndarray or sequence

Points to convert. Should be 1 or 2 dimensional. Accepts a single point or several points.

deepbool, default: True

Perform a deep copy of the array. Only applicable if points is a numpy.ndarray.

force_floatbool, default: False

Casts the datatype to float32 if points datatype is non-float. Set this to False to allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.


The vtkPoints object.


>>> import pyvista as pv
>>> import numpy as np
>>> points = np.random.default_rng().random((10, 3))
>>> vpoints = pv.vtk_points(points)
>>> vpoints