X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Regular_1D.cxx;h=77d1d66f130767f283bacdee9ae6e4a428eb3c48;hb=a88c5ba91e8840a2378a303cedd3bebe5f4f2570;hp=d1aa0122d9c53fdaa32d895c8d8506c92ea23749;hpb=8a9d91b414c3f26586dea735c22c7700898a0a1e;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index d1aa0122d..77d1d66f1 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -362,7 +362,10 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, int nbPnt = 1 + nbSeg; vector x( nbPnt, 0. ); - if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, 1E-4 )) + + const double eps = Min( 1E-4, 1./nbSeg/100. ); + + if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, eps )) return false; // apply parameters in range [0,1] to the space of the curve @@ -974,6 +977,8 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, an = eltSize; eltSize *= q; ++nbParams; + if ( q < 1. && eltSize < 1e-100 ) + return error("Too small common ratio causes too many segments"); } if ( nbParams > 1 ) { @@ -1138,7 +1143,7 @@ bool StdMeshers_Regular_1D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & t if ( !nFirst || !nLast ) return error( COMPERR_BAD_INPUT_MESH, "No node on vertex"); - // remove elements created by e.g. patern mapping (PAL21999) + // remove elements created by e.g. pattern mapping (PAL21999) // CLEAN event is incorrectly ptopagated seemingly due to Propagation hyp // so TEMPORARY solution is to clean the submesh manually if (SMESHDS_SubMesh * subMeshDS = meshDS->MeshElements(theShape))