Surface Reconstruction

Surface Reconstruction#

Surface reconstruction has a dedicated filter in PyVista and is handled by pyvista.PolyDataFilters.reconstruct_surface(). This tends to perform much better than pyvista.DataSetFilters.delaunay_3d().

from __future__ import annotations

import pyvista as pv

Create a point cloud from a sphere and then reconstruct a surface from it.

PolyData (0x73718d47eb60)
  N Cells:    832
  N Points:   418
  N Strips:   0
  X Bounds:   -4.989e-01, 4.995e-01
  Y Bounds:   -4.986e-01, 4.986e-01
  Z Bounds:   -4.985e-01, 4.985e-01
  N Arrays:   0


Plot the point cloud and the reconstructed sphere.

pl = pv.Plotter(shape=(1, 2))
pl.add_mesh(points)
pl.add_title('Point Cloud of 3D Surface')
pl.subplot(0, 1)
pl.add_mesh(surf, color=True, show_edges=True)
pl.add_title('Reconstructed Surface')
pl.show()
surface reconstruction

Tags: filter

Total running time of the script: (0 minutes 0.191 seconds)

Gallery generated by Sphinx-Gallery