haesleinhuepf / napari-process-points-and-surfaces

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

added function to clean meshes (remove duplicate vertices, faces) #24

Closed jo-mueller closed 1 year ago

jo-mueller commented 1 year ago

Hi @haesleinhuepf ,

this fixes the issue with the smoothing you were describing in PR #23 . The problem here was a large number of duplicate vertices/faces in the mesh, which apparently happens easily with marching cubes outputs and has also been reported here (other problem, same cause).

The mesh.clean() function from vedo fixes this so I added it as a function. I also applied it to the output of the marching cubes so that downstream processing doesn't run into the same issue. Let me know what you think :)

jo-mueller commented 1 year ago

When I introduced the various subdivision methods in PR #25 , I noticed that all of the subdivision methods work on that branch - however, they don't work properly on this branch. It seems that mesh.clean() has some unexpected consequences for some other surface filters (i.e. subdivision) - I guess this should thus be a separate function rather than built into marching cubes.

Edit: See 56f96b6815fc315fc6d08d0dbaaef4a2fe791447

jo-mueller commented 1 year ago

Hi Robert @haesleinhuepf ,

thanks for checking and spotting the unused import!

Best, Johannes

haesleinhuepf commented 1 year ago

Thanks again @jo-mueller !