X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_Slot.cxx;h=00c7e6ed22ab94a5b4b29cf876f9c3de1d928ae5;hb=d85d605175efca167efafe15543f2212e9702b1b;hp=b17225edc7a83dac24011fee79b042f2826fdecc;hpb=d66fe4a5001bedf93141cbac20a9b8c32f8af3bd;p=modules%2Fsmesh.git diff --git a/src/SMESHUtils/SMESH_Slot.cxx b/src/SMESHUtils/SMESH_Slot.cxx index b17225edc..00c7e6ed2 100644 --- a/src/SMESHUtils/SMESH_Slot.cxx +++ b/src/SMESHUtils/SMESH_Slot.cxx @@ -806,10 +806,10 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt, isOut( intPnt[1].myNode, planeNormal, intPnt[1].myIsOutPln, 1 ); const Segment * closeSeg[2] = { 0, 0 }; if ( intPnt[0].myIsOutPln[0] ) - closeSeg[0] = findTooCloseSegment( intPnt[0], 0.5 * theWidth - tol, tol, + closeSeg[0] = findTooCloseSegment( intPnt[0], 0.5 * theWidth - 1e-3*tol, tol, segment, n1, segmentsOfNode ); if ( intPnt[1].myIsOutPln[0] ) - closeSeg[1] = findTooCloseSegment( intPnt[1], 0.5 * theWidth - tol, tol, + closeSeg[1] = findTooCloseSegment( intPnt[1], 0.5 * theWidth - 1e-3*tol, tol, segment, n1, segmentsOfNode ); int nbCut = bool( closeSeg[0] ) + bool( closeSeg[1] ); if ( nbCut == 0 ) @@ -836,20 +836,22 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt, // 2) double minCutDist = theWidth; gp_XYZ projection, closestProj; - int iCut; - for ( size_t iC = 0; iC < closeSeg[iP]->myCuts.size(); ++iC ) + int iCut = -1; + for ( size_t iC2 = 0; iC2 < closeSeg[iP]->myCuts.size(); ++iC2 ) { - double cutDist = closeSeg[iP]->myCuts[iC].SquareDistance( intPnt[iP].myNode, + double cutDist = closeSeg[iP]->myCuts[iC2].SquareDistance( intPnt[iP].myNode, projection ); if ( cutDist < minCutDist ) { closestProj = projection; minCutDist = cutDist; - iCut = iC; + iCut = iC2; + if ( minCutDist < tol * tol ) + break; } - if ( minCutDist < tol * tol ) - break; } + if ( iCut < 0 ) + continue; // ??? double d1 = SMESH_MeshAlgos::GetDistance( neighborSeg->myEdge, closeSeg[iP]->myCuts[iCut][0].myNode ); double d2 = SMESH_MeshAlgos::GetDistance( neighborSeg->myEdge,