-// 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
int nbPnt = 1 + nbSeg;
vector<double> 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
an = eltSize;
eltSize *= q;
++nbParams;
+ if ( q < 1. && eltSize < 1e-100 )
+ return error("Too small common ratio causes too many segments");
}
if ( nbParams > 1 )
{
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))