haesleinhuepf / napari-process-points-and-surfaces

Process and analyze surfaces using vedo in napari.
BSD 3-Clause "New" or "Revised" License
21 stars 4 forks source link

Improve fill holes example #31

Open haesleinhuepf opened 1 year ago

haesleinhuepf commented 1 year ago

Currently, on the open3d-vedo-conversion branch, in the demo notebook, there is example code for fill holes:

surface = vedo_points_to_convex_hull_surface(points_layer.data)
faces_del = np.delete(surface[1], np.random.randint(0, surface[1].shape[0], 10), axis=0)
viewer.add_surface((surface[0], faces_del), name='Surface with hole')

and

hide_all(viewer)
viewer.add_surface(vedo_fill_holes((surface[0], faces_del), size_limit=1000), name='Filled hole')
nbscreenshot(viewer)

I do not understand this example and the code. What is (surface[0], faces_del)? Would it be possible to give this thing a name, by storing it in a variable? The three related screenshots look the same. We should improve this example. Maybe, it would be better suited to do that with a different dataset.

@jo-mueller I think you introduced this example and fill_holes. Would you mind taking a look? Thanks

jo-mueller commented 1 year ago

Hi @haesleinhuepf ,

thanks for pointing it out, I have improved the example. What the code basically does is:

I have changed the example a bit so that the hole in the mesh is better visible and the code is cleaner. PR coming