]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
PAL10872. Evaluate quadrangle faces quality when computing 3D aspect ratio
authoreap <eap@opencascade.com>
Tue, 13 Dec 2005 06:52:11 +0000 (06:52 +0000)
committereap <eap@opencascade.com>
Tue, 13 Dec 2005 06:52:11 +0000 (06:52 +0000)
src/Controls/SMESH_Controls.cxx

index 7e6603b61fe4908ac5dae05643c1cdb4a44ecd58..717f8e66ae41e82d0d06fdeef300d432aca0ff2d 100644 (file)
@@ -645,6 +645,21 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P )
     break;
   }
   }
+  if ( nbNodes > 4 ) {
+    // avaluate aspect ratio of quadranle faces
+    AspectRatio aspect2D;
+    SMDS_VolumeTool::VolumeType type = SMDS_VolumeTool::GetType( nbNodes );
+    int nbFaces = SMDS_VolumeTool::NbFaces( type );
+    TSequenceOfXYZ points(4);
+    for ( int i = 0; i < nbFaces; ++i ) { // loop on faces of a volume
+      if ( SMDS_VolumeTool::NbFaceNodes( type, i ) != 4 )
+        continue;
+      const int* pInd = SMDS_VolumeTool::GetFaceNodesIndices( type, i, true );
+      for ( int p = 0; p < 4; ++p ) // loop on nodes of a quadranle face
+        points( p + 1 ) = P( pInd[ p ] + 1 );
+      aQuality = max( aQuality, aspect2D.GetValue( points ));
+    }
+  }
   return aQuality;
 }