X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FStdMeshers%2FStdMeshers_Projection_2D.cxx;h=9c116919951270a001a2b5c4dbb8dd68ff636977;hb=b3c311b4d9295b449274c44d73035b66e438b612;hp=31db57e967fd3f2702c6bd6fbf8d17131acccf48;hpb=7ea81bbe6e068500dbaf7ff693dd05f33b974c53;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index 31db57e96..9c1169199 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -72,6 +72,10 @@ using namespace std; #define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; } +#ifdef _DEBUG_ +// enable printing algo + projection shapes while meshing +//#define PRINT_WHO_COMPUTE_WHAT +#endif namespace TAssocTool = StdMeshers_ProjectionUtils; //typedef StdMeshers_ProjectionUtils TAssocTool; @@ -436,7 +440,11 @@ namespace { if (( err && !err->IsOK() ) || ( srcWires.empty() )) return err; - +#ifdef PRINT_WHO_COMPUTE_WHAT + cout << "Projection_2D" << " F " + << tgtMesh->GetMeshDS()->ShapeToIndex( tgtFace ) << " <- " + << srcMesh->GetMeshDS()->ShapeToIndex( srcFace ) << endl; +#endif SMESH_MesherHelper srcHelper( *srcMesh ); srcHelper.SetSubShape( srcFace ); @@ -492,6 +500,11 @@ namespace { for ( int iE = 0; iE < srcWire->NbEdges(); ++iE ) { +#ifdef PRINT_WHO_COMPUTE_WHAT + if ( tgtMesh->GetSubMesh( tgtWire->Edge(iE) )->IsEmpty() ) + cout << "Projection_2D" << " E " + << tgtWire->EdgeID(iE) << " <- " << srcWire->EdgeID(iE) << endl; +#endif if ( srcMesh->GetSubMesh( srcWire->Edge(iE) )->IsEmpty() || tgtMesh->GetSubMesh( tgtWire->Edge(iE) )->IsEmpty() ) { @@ -540,7 +553,7 @@ namespace { //================================================================================ /*! - * \brief Preform projection in case if tgtFace.IsPartner( srcFace ) and in case + * \brief Perform projection in case if tgtFace.IsPartner( srcFace ) and in case * if projection by 3D transformation is possible */ //================================================================================ @@ -704,9 +717,9 @@ namespace { tgtMeshDS->SetNodeOnEdge( n, tgtE, srcU ); if ( !tgtFace.IsPartner( srcFace )) { - bool isOk = true; edgeHelper.SetSubShape( tgtE ); - edgeHelper.GetNodeU( tgtE, n, 0, &isOk ); + double tol = BRep_Tool::Tolerance( tgtE ); + bool isOk = edgeHelper.CheckNodeU( tgtE, n, srcU, 2 * tol, /*force=*/true ); if ( !isOk ) // projection of n to tgtE failed (23395) { double sF, sL, tF, tL; @@ -717,7 +730,6 @@ namespace { tgtMeshDS->SetNodeOnEdge( n, tgtE, tgtU ); gp_Pnt newP = BRepAdaptor_Curve( tgtE ).Value( tgtU ); double dist = newP.Distance( tgtP ); - double tol = BRep_Tool::Tolerance( tgtE ); if ( tol < dist && dist < 1000*tol ) tgtMeshDS->MoveNode( n, newP.X(), newP.Y(), newP.Z() ); } @@ -791,7 +803,7 @@ namespace { //================================================================================ /*! - * \brief Preform projection in case if the faces are similar in 2D space + * \brief Perform projection in case if the faces are similar in 2D space */ //================================================================================ @@ -961,7 +973,7 @@ namespace { //================================================================================ /*! - * \brief Preform projection in case of quadrilateral faces + * \brief Perform projection in case of quadrilateral faces */ //================================================================================ @@ -1058,7 +1070,7 @@ namespace { // } // else // { - // // find XY of src node withing the quadrilateral srcFace + // // find XY of src node within the quadrilateral srcFace // if ( !block.ComputeParameters( SMESH_TNodeXYZ( srcNode ), // tgtNodeOrXY.second, srcFaceBID )) // return false;