Surface reconstruction

Surface reconstruction#

This notebook demonstrates how to reconstruct a surface from a pointcloud with napari-stress. This plugin uses the recoSurface function as implemented in vedo.

import napari_stress
import vedo
import napari
viewer = napari.Viewer(ndisplay=3)
WARNING: DirectWrite: CreateFontFaceFromHDC() failed (Indicates an error in an input file such as a font file.) for QFontDef(Family="8514oem", pointsize=12, pixelsize=20, styleHint=5, weight=50, stretch=100, hintingPreference=0) LOGFONT("8514oem", lfWidth=0, lfHeight=-20) dpi=192

Let’s create some sample data:

points = vedo.shapes.Ellipsoid(res=100).points() * 10
points_layer = viewer.add_points(points, size=0.5)
napari.utils.nbscreenshot(viewer)
surface = napari_stress.reconstruct_surface(points, radius=5)
points_layer.visible = False
viewer.add_surface(surface)
napari.utils.nbscreenshot(viewer)