Salome HOME
#17828 [CEA 17805] Polyhedron Mesh volume calculation and volume orientation criterion
[modules/smesh.git] / src / Controls / SMESH_Controls.cxx
index 06c40dae2ad9c8b21d5ec8098df9528899d990c8..676c68aca662e0b24be7b68fbd17913e2f5a6a8d 100644 (file)
@@ -2286,7 +2286,19 @@ bool BadOrientedVolume::IsSatisfy( long theId )
     return false;
 
   SMDS_VolumeTool vTool( myMesh->FindElement( theId ));
-  return !vTool.IsForward();
+
+  bool isOk = true;
+  if ( vTool.IsPoly() )
+  {
+    isOk = true;
+    for ( int i = 0; i < vTool.NbFaces() && isOk; ++i )
+      isOk = vTool.IsFaceExternal( i );
+  }
+  else
+  {
+    isOk = vTool.IsForward();
+  }
+  return !isOk;
 }
 
 SMDSAbs_ElementType BadOrientedVolume::GetType() const