- 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 ] );
- }
-#ifdef WNT
- delete [] aLen;
-#endif
- if ( aMinLen <= Precision::Confusion() )
- return 0.;
-
- return aMaxLen / aMinLen;
+ // return aspect ratio of the worst triange which can be built
+ // taking three nodes of the quadrangle
+ TSequenceOfXYZ triaPnts(3);
+ // triangle on nodes 1 3 2
+ triaPnts(1) = P(1);
+ triaPnts(2) = P(3);
+ triaPnts(3) = P(2);
+ double ar = GetValue( triaPnts );
+ // triangle on nodes 1 3 4
+ triaPnts(3) = P(4);
+ ar = Max ( ar, GetValue( triaPnts ));
+ // triangle on nodes 1 2 4
+ triaPnts(2) = P(2);
+ ar = Max ( ar, GetValue( triaPnts ));
+ // triangle on nodes 3 2 4
+ triaPnts(1) = P(3);
+ ar = Max ( ar, GetValue( triaPnts ));
+
+ return ar;