-
Notifications
You must be signed in to change notification settings - Fork 262
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
Some subdivide functions return meshes with 0 points #813
Comments
Hi Robert import vedo
filename = "https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/napari_process_points_and_surfaces/data/gastruloid.ply"
mesh_in = vedo.Mesh(filename)
non_manifold_boundaries = mesh_in.boundaries(
non_manifold_edges=True,
boundary_edges=False,
)
print("Mesh in points", mesh_in.npoints)
vedo.show(mesh_in, non_manifold_boundaries) some subdivision methods are insensitive to it but others may not be... |
PS: to spot the cell you can click on a region of the mesh then press mesh_in.delete_cells([3721])
mesh_in.clean()
print("Mesh in points", mesh_in.npoints)
mesh_out = mesh_in.subdivide(n=1, method=0)
print("Mesh out points", mesh_out.npoints)
vedo.show(mesh_out, non_manifold_boundaries).close() cures the problem. |
Thanks for the rapid response @marcomusy !
Yes, agreed! We'll look into this. We already use
Would it make sense to remove non-manifold edges after any of those steps in general? We had a similar discussion about Thanks again! |
..i've been playing with it this afternoon and this is what i've come up with (you need the dev16 version in master branch): from vedo import *
filename = "https://github.com/haesleinhuepf/napari-process-points-and-surfaces/raw/main/napari_process_points_and_surfaces/data/gastruloid.ply"
msh = Mesh(filename)
print("msh is_manifold:", msh.is_manifold())
msh.non_manifold_faces(collapse_edges=False, remove_boundary=False, remove_all=True)
print("msh is_manifold:", msh.is_manifold())
msh.fill_holes()
msh.backcolor("p5").linewidth(1)
show(msh, msh.boundaries(), axes=1) Implemented in Line 745 in 0bc914d
|
..in any case the marching cube algorithm should not generate non manifold isosurfaces... |
Thanks again for your time and effort!
I was suspecting the scikit-image version to be buggy when was saw it produces duplicate vertices. Are there alternatives? When searching the vedo documentation for "marching" it doesn't find any... Also let me get @jo-mueller in the loop as he's more knowledgeable in the mesh context than I am: Johannes could you do me a favor and check if the above solution can be used to fix the issue in nppas? Or shall we replace marching cubes? Looking forward to hear what you think. Big thanks to you both! |
Hi, the method doing the marching cube is called |
I'm investigating an issue with
mesh.subdivide
. Depending on the method (e.g. linear, loop, butterfly), the resulting mesh has zero vertices. I'm wondering if this is a bug or has something to do with my example data. If the data is the problem, is there a way of fixing it? Do meshes have to fulfill some constraints when being passed to these functions?Code to reproduce:
The output shows that three of the five methods result in meshes with 0 vertices:
See also:
The text was updated successfully, but these errors were encountered: