mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 02:00:34 +05:00
Added support for quality control (on polygons) - Aspect Ratio.
This commit is contained in:
parent
3de74ed8ab
commit
05fdecbb6a
@ -247,7 +247,7 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
{
|
{
|
||||||
int nbNodes = P.size();
|
int nbNodes = P.size();
|
||||||
|
|
||||||
if ( nbNodes != 3 && nbNodes != 4 )
|
if ( nbNodes < 3 )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
@ -271,10 +271,15 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
double aMinLen = Min( Min( aLen[ 0 ], aLen[ 1 ] ), Min( aLen[ 2 ], aLen[ 3 ] ) );
|
double aMinLen = aLen[ 0 ];
|
||||||
|
double aMaxLen = aLen[ 0 ];
|
||||||
|
|
||||||
|
for(int i = 1; i < nbNodes ; i++ ){
|
||||||
|
aMinLen = Min( aMinLen, aLen[ i ] );
|
||||||
|
aMaxLen = Max( aMaxLen, aLen[ i ] );
|
||||||
|
}
|
||||||
if ( aMinLen <= Precision::Confusion() )
|
if ( aMinLen <= Precision::Confusion() )
|
||||||
return 0.;
|
return 0.;
|
||||||
double aMaxLen = Max( Max( aLen[ 0 ], aLen[ 1 ] ), Max( aLen[ 2 ], aLen[ 3 ] ) );
|
|
||||||
|
|
||||||
return aMaxLen / aMinLen;
|
return aMaxLen / aMinLen;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user