Salome HOME
PAL13409: EDF282 SMESH: Tetrahedron is added if we specify Mefisto.
[modules/smesh.git] / src / StdMeshers / StdMeshers_AutomaticLength.cxx
index fa74a7dc5d5a86ac3544761e0b76af666b2a14fc..a91ccebb8f9c7e086795d80b3682384d52c89847 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -300,7 +300,10 @@ bool StdMeshers_AutomaticLength::SetParametersByMesh(const SMESH_Mesh*   theMesh
     SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge );
     if ( !eSubMesh )
       return false;
-    double segLen = L / eSubMesh->NbElements();
+    int nbSeg = eSubMesh->NbElements();
+    if ( nbSeg < 1 )
+      continue;
+    double segLen = L / nbSeg;
 
     // get segment length from _TShapeToLength
     map<const TopoDS_TShape*, double>::iterator tshape_length =