Trying to fix Euler characteristic (fail unit tests/TestTorus)

This commit is contained in:
James E McClure
2015-11-22 19:47:55 -05:00
parent 1923d091e1
commit 945cd14cd5

View File

@@ -4436,15 +4436,18 @@ inline double geomavg_EulerCharacteristic(DTMutableList<Point> &Points, IntArray
}
}
// Number of faces is number of triangles
nface = 1.0*ntris;
// Each vertex is shared by four cubes
nvert = 0.25*double(npts);
// Subtract shared sides to avoid double counting
//nside = 3.0*ntris - ShareSideInternal - 0.5*CountSideExternal;
nside = 2.0*double(npts)- 3.0 - 0.5*double(npts);
// Number of faces is number of triangles
nface = 1.0*ntris;
double nside_extern = double(npts);
double nside_intern = double(npts)-3.0;
EulerChar = (nvert - nside + nface);
EulerChar = (nvert - nside_intern - 0.5*nside_extern + nface);
return EulerChar;
}