Closed JeffreyWardman closed 2 weeks ago
Number of genus can be counted via -(m.vertices.shape[0] - len(m.edges) + len(m.cells) - 2 - len(m.boundaries().split()))/2
. Unsure about determining the location.
I think a -1 is needed in the above. Anyway consider the following:
https://en.wikipedia.org/wiki/Reeb_graph
from vedo import *
mesh = Mesh("https://discourse.paraview.org/uploads/short-url/qVuZ1fiRjwhE1qYtgGE2HGXybgo.stl")
mesh.rotate_x(10).rotate_y(15).alpha(0.5)
mesh.pointdata["scalars"] = mesh.vertices[:, 0]
printc("is_closed :", mesh.is_closed())
printc("is_manifold:", mesh.is_manifold())
printc("euler_char :", mesh.euler_characteristic())
printc("genus :", mesh.genus())
reeb = mesh.to_reeb_graph()
ids = reeb[0].pointdata["Vertex Ids"]
pts = Points(mesh.vertices[ids], r=10)
show([[mesh, pts], reeb], N=2, sharecam=False)
to be honest i'm not sure if that really answers the question properly, but I hope it can help.
I want to be able to find where "tunnels"/"holes" are in the mesh (see below). A count of them and their bounding box would be ideal return values. For my particular use case, I want to remove them as they cause significant problems and only occur in poorly scanned regions.