-// 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
//=============================================================================
StdMeshers_Regular_1D::StdMeshers_Regular_1D(int hypId,
- int studyId,
SMESH_Gen * gen)
- :SMESH_1D_Algo( hypId, studyId, gen )
+ :SMESH_1D_Algo( hypId, gen )
{
_name = "Regular_1D";
_shapeType = (1 << TopAbs_EDGE);
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
// * \brief Clean mesh on edges
// * \param event - algo_event or compute_event itself (of SMESH_subMesh)
// * \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh)
-// * \param subMesh - the submesh where the event occures
+// * \param subMesh - the submesh where the event occurs
// */
// void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh,
// EventListenerData*, const SMESH_Hypothesis*)
double L = GCPnts_AbscissaPoint::Length( theC3d, *itU, l);
static StdMeshers_Regular_1D* auxAlgo = 0;
if ( !auxAlgo ) {
- auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _studyId, _gen );
+ auxAlgo = new StdMeshers_Regular_1D( _gen->GetANewId(), _gen );
auxAlgo->_hypType = BEG_END_LENGTH;
}
auxAlgo->_value[ BEG_LENGTH_IND ] = Lm;
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))