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
feat: add method to compute number of handles for meshes with & without boundary #2249
Comments
Thanks for the question, Keenan. Could you please provide a reference for V - E + F + B = χ being standard? I've always seen V - E + F = χ, as on wikipedia which also states
χ = 1 is also what I expect for the Euler characteristic of a disk. Adding the number of boundary loops (B=1) would produce χ=2 causing a single triangle to have the same Euler characteristic as a tetrahedron (4 - 6 + 4 = 2). The V - E + F = χ formula (and specifically (3-3+1=1 for a single triangle) is used throughout David Eppstein's proofs. |
Yeah, you’re right—the definition you cite also agrees with the definition based on Betti numbers. (Perhaps I should file an issue on Geometry Central instead…) The practical issue is that the Euler characteristic alone is ambiguous when trying to perform some reasonably common tasks. For instance a double torus and a disk with two holes both have characteristic -1. In the context of the SGI project, students were trying to extract patches that can be flattened, and checking the Euler characteristic alone was giving them the wrong answer (patches could have handles). It looks like you can get the number of handles h by calling So, perhaps a more constructive suggestion for this is to make a feature request:
(Will change the issue title also.) Thanks! |
euler_characteristic
doesn't give right result for meshes with boundary
That's a nice feature request. I have that in matlab gptoolbox's statistics and in C++ in gp-cli. Might as well add it to libigl sometime. |
See also #1331 (comment) |
During an SGI project, we discovered that the
euler_characteristic
method does not return the right result for meshes with boundary. The standard Euler characteristic formula isV - E + F + B = (2-2g) = χ,
but the current implementation of
euler_characteristic
does not compute the number of boundary loops. This number could be computed via theboundary_loops
method.Compare with the Geometry Central implementation found here:
https://github.com/nmwsharp/geometry-central/blob/071756157a6122ead8fa978a35b06d1acc16451f/src/surface/manifold_surface_mesh.cpp#L515
The text was updated successfully, but these errors were encountered: