X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Import_1D2D.cxx;h=04d9035088dd04dbeae6e114312a624785b2339a;hp=f0d4925c82cbdad6c6a7a5d59a41926880b16409;hb=0fc0831670e27a5611b941c52dc152fd63964515;hpb=8d297d6698f361d4f2dde723050bcfbaea050920 diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx index f0d4925c8..04d903508 100644 --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D2D.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 @@ -40,6 +40,7 @@ #include "SMESH_Mesh.hxx" #include "SMESH_MesherHelper.hxx" #include "SMESH_OctreeNode.hxx" +#include "SMESH_MeshEditor.hxx" #include "SMESH_subMesh.hxx" #include "Utils_SALOME_Exception.hxx" @@ -48,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -199,7 +201,8 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & gp_Pnt p; gp_Vec du, dv; // BRepClass_FaceClassifier is most time consuming, so minimize its usage - BRepClass_FaceClassifier classifier; + const double clsfTol = 10 * BRep_Tool::Tolerance( geomFace ); + BRepTopAdaptor_FClass2d classifier( geomFace, clsfTol ); //Brimless_FaceClassifier classifier; Bnd_B2d bndBox2d; Bnd_Box bndBox3d; { @@ -306,10 +309,12 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & const double groupTol = 0.5 * sqrt( getMinElemSize2( srcGroup )); minGroupTol = std::min( groupTol, minGroupTol ); + // clsfTol is 2D tolerance of a probe line //GeomAdaptor_Surface S( surface ); // const double clsfTol = Min( S.UResolution( 0.1 * groupTol ), -- issue 0023092 // S.VResolution( 0.1 * groupTol )); - const double clsfTol = BRep_Tool::Tolerance( geomFace ); + // another idea: try to use max tol of all edges + //const double clsfTol = 10 * BRep_Tool::Tolerance( geomFace ); // 0.1 * groupTol; if ( helper.HasSeam() ) onEdgeClassifier.SetMesh( srcMesh->GetMeshDS() ); @@ -373,8 +378,8 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & //int iCoo; if ( !isOut && !isIn ) // classify { - classifier.Perform( geomFace, uv, clsfTol ); - nodeState[i] = classifier.State(); + nodeState[i] = classifier.Perform( uv ); //classifier.Perform( geomFace, uv, clsfTol ); + //nodeState[i] = classifier.State(); isOut = ( nodeState[i] == TopAbs_OUT ); if ( isOut && helper.IsOnSeam( uv ) && onEdgeClassifier.IsSatisfy( (*node)->GetID() )) { @@ -417,8 +422,8 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & { if ( nodeState[i] != TopAbs_UNKNOWN ) continue; gp_XY uv = helper.GetNodeUV( geomFace, newNodes[i] ); - classifier.Perform( geomFace, uv, clsfTol ); - nodeState[i] = classifier.State(); + nodeState[i] = classifier.Perform( uv ); //geomFace, uv, clsfTol ); + //nodeState[i] = classifier.State(); isIn = ( nodeState[i] == TopAbs_IN ); } if ( !isIn ) // classify face center @@ -439,8 +444,9 @@ bool StdMeshers_Import_1D2D::Compute(SMESH_Mesh & theMesh, const TopoDS_Shape & Standard_Real U,V; proj.LowerDistanceParameters(U,V); gp_XY uv( U,V ); - classifier.Perform( geomFace, uv, clsfTol ); - if ( classifier.State() != TopAbs_IN ) + //classifier.Perform( geomFace, uv, clsfTol ); + TopAbs_State state = classifier.Perform( uv ); + if ( state != TopAbs_IN ) continue; } }