added ComputePerFaceQualityAvg function

This commit is contained in:
nico 2017-01-25 17:27:46 +01:00
parent 555fd55b35
commit 8eda1c1d2f
1 changed files with 16 additions and 0 deletions

View File

@ -100,6 +100,22 @@ public:
return minmax;
}
static ScalarType ComputePerFaceQualityAvg( MeshType & m)
{
tri::RequirePerFaceQuality(m);
ScalarType AvgQ = 0;
FaceIterator fi;
size_t num=0;
for(fi = m.face.begin(); fi != m.face.end(); ++fi)
{
if((*fi).IsD())continue;
AvgQ+= (*fi).Q();
num++;
}
return (AvgQ/(ScalarType)num);
}
static std::pair<ScalarType,ScalarType> ComputePerEdgeQualityMinMax( MeshType & m)
{
tri::RequirePerEdgeQuality(m);