Better Comments on the Genus.

This commit is contained in:
Paolo Cignoni 2011-10-17 23:33:48 +00:00
parent ed9e9df701
commit 486795fcfb
1 changed files with 8 additions and 3 deletions

View File

@ -1009,7 +1009,7 @@ private:
For general polyhedra the <em>Euler Formula</em> is:
V + F - E = 2 - 2G - B
V - E + F = 2 - 2G - B
where V is the number of vertices, F is the number of faces, E is the
number of edges, G is the genus and B is the number of <em>boundary polygons</em>.
@ -1017,10 +1017,15 @@ private:
The above formula is valid for a mesh with one single connected component.
By considering multiple connected components the formula becomes:
V + F - E = 2C - 2Gs - B
V - E + F = 2C - 2Gs - B -> 2Gs = - ( V-E+F +B -2C)
where C is the number of connected components and Gs is the sum of
the genus of all connected components.*/
the genus of all connected components.
Note that in the case of a mesh with boundaries the intuitive meaning of Genus is less intuitive that it could seem.
A closed sphere, a sphere with one hole (e.g. a disk) and a sphere with two holes (e.g. a tube) all of them have Genus == 0
*/
static int MeshGenus(int nvert,int nedges,int nfaces, int numholes, int numcomponents)
{