#include <Geom_Curve.hxx>
#include <Geom2d_Curve.hxx>
#include <Geom_Surface.hxx>
+#include <Precision.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
//=============================================================================
bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap)
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap)
{
MESSAGE("StdMeshers_MEFISTO_2D::Evaluate");
TopoDS_Face F = TopoDS::Face(aShape.Oriented(TopAbs_FORWARD));
double aLen = 0.0;
- double NbSeg = 0;
+ int NbSeg = 0;
bool IsQuadratic = false;
bool IsFirst = true;
TopExp_Explorer exp(F,TopAbs_EDGE);
P1 = P2;
}
}
+ if(NbSeg<1) {
+ std::vector<int> aResVec(SMDSEntity_Last);
+ for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+ SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
+ aResMap.insert(std::make_pair(sm,aResVec));
+ SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
+ smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,
+ "Submesh can not be evaluated",this));
+ return false;
+ }
aLen = aLen/NbSeg; // middle length
- _edgeLength = DBL_MAX;
+ _edgeLength = Precision::Infinite();
double tmpLength = Min( _edgeLength, aLen );
GProp_GProps G;
BRepGProp::SurfaceProperties(aShape,G);
double anArea = G.Mass();
- int nbFaces = (int) ( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
+ int nbFaces = Precision::IsInfinite( tmpLength ) ? 0 :
+ (int)( anArea/(tmpLength*tmpLength*sqrt(3.)/4) );
int nbNodes = (int) ( nbFaces*3 - (NbSeg-1)*2 ) / 6;
std::vector<int> aVec(SMDSEntity_Last);