注釈
Go to the end をクリックすると完全なサンプルコードをダウンロードできます.
サーフェスの再構築#
表面再構成は,PyVistaでは専用のフィルタが用意されており, pyvista.PolyDataFilters.reconstruct_surface()
で処理されます. これは pyvista.DataSetFilters.delaunay_3d()
よりもはるかに良いパフォーマンスを示す傾向があります.
from __future__ import annotations
import pyvista as pv
球体から点群を作成し,その点群からサーフェスを再構成します.
points = pv.wrap(pv.Sphere().points)
surf = points.reconstruct_surface()
surf
点群と再構成された球体をプロットします.
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()

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