Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve fill holes example #31

Open
haesleinhuepf opened this issue Dec 11, 2022 · 1 comment
Open

Improve fill holes example #31

haesleinhuepf opened this issue Dec 11, 2022 · 1 comment
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@haesleinhuepf
Copy link
Owner

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

@haesleinhuepf haesleinhuepf added the documentation Improvements or additions to documentation label Dec 11, 2022
@jo-mueller
Copy link
Collaborator

Hi @haesleinhuepf ,

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

  • create a convex hull (it's just much easier to spot holes in the convex hull mesh rather than the raw mesh)
  • creates a copy of the faces part of the surface tuple (faces = surface[1]) and randomly removes some of the faces from the list of all faces to create a mesh with holes.
  • Adds a new surface tuple with missing faces (surface[0], faces_del) where faces_del is the copy of the list of faces with some of the entries deleted
  • Fixes the holes in the mesh with holes (surface[0], faces_del).

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants