How to triangulate a surface from point cloud

@T4mmi, you may benefit from checking out PyVista’s interface to VTK to make working with your VTK dataset a bit easier. Here’s an example with the numpy array you shared:

import pyvista as pv
import numpy as np

pts = np.random.rand(512*3).reshape(-1,3)

# Make vtkPolyData of the points array
point_cloud = pv.PolyData(pts)
point_cloud.plot(render_points_as_spheres=True, point_size=10)

# runs the delaunay 3D algorithm
mesh = point_cloud.delaunay_3d(alpha=0.25)

# Make a wireframe with some data
wires = mesh.compute_cell_sizes(length=False, area=False, volume=True).wireframe()
# Plot it
wires.plot(line_width=2)

4 Likes