pyvista.vtk_points#
- vtk_points(
- points: VectorLike[float] | MatrixLike[float],
- deep: bool = True,
- force_float: bool = False,
- allow_empty: bool = True,
Convert numpy array or array-like to a vtkPoints object.
- Parameters:
- points
numpy.ndarrayor 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
pointsis anumpy.ndarray.- force_floatbool, default:
False Casts the datatype to
float32if points datatype is non-float. Set this toFalseto allow non-float types, though this may lead to truncation of intermediate floats when transforming datasets.- allow_emptybool, default:
True Allow
pointsto be an empty array. IfFalse, points must be strictly one- or two-dimensional.Added in version 0.45.
- points
- Returns:
Examples
>>> import pyvista as pv >>> import numpy as np >>> points = np.random.default_rng().random((10, 3)) >>> vpoints = pv.vtk_points(points) >>> vpoints (vtkmodules.vtkCommonCore.vtkPoints)0x7f0c2e26af40