From: eap Date: Thu, 22 Nov 2012 11:00:20 +0000 (+0000) Subject: 0021996: EDF SMESH 1549: Regression in projection algorithms X-Git-Tag: V6_6_0rc1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=aca17796fdd7d8973f2c7a6ef9575878482a32e0;p=modules%2Fsmesh.git 0021996: EDF SMESH 1549: Regression in projection algorithms fix up "Improve seaching an initial VERTEX association by VERTEX closeness" --- diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 43cde5aea..76785fad0 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -1190,8 +1190,7 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the continue;//RETURN_BAD_RESULT("Only closed edges"); // find vertices closest to 2 linked vertices of shape 1 - double dist2[2] = { std::numeric_limits::max(), - std::numeric_limits::max() }; + double dist2[2] = { 1e+100, 1e+100 }; TopoDS_Vertex edge2VV[2]; for ( int i1 = 0; i1 < 2; ++i1 ) { @@ -1212,13 +1211,14 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the } } else if ( !edge2VV[0].IsNull() ) { - // select a closest vertex among ends of edges meeteing at edge2VV[0] + // select a closest vertex among ends of edges meeting at edge2VV[0] PShapeIteratorPtr edgeIt = SMESH_MesherHelper::GetAncestors( edge2VV[0], *theMesh2, TopAbs_EDGE); while ( const TopoDS_Shape* edge2 = edgeIt->next() ) for ( TopoDS_Iterator itV2( *edge2 ); itV2.More(); itV2.Next() ) { if ( itV2.Value().IsSame( edge2VV[ 0 ])) continue; + if ( !vMap2.Contains( itV2.Value() )) continue; TopoDS_Vertex V2 = TopoDS::Vertex( itV2.Value() ); gp_Pnt p2 = BRep_Tool::Pnt ( V2 ); double d2 = p1.SquareDistance( p2 ); @@ -1233,6 +1233,8 @@ bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& the VV2[0] = edge2VV[0]; VV2[1] = edge2VV[1]; minDist = dist2[0] + dist2[1]; + if ( minDist < 1e-10 ) + break; } }