X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FStdMeshers%2FStdMeshers_Projection_2D.cxx;h=af75b6a4ff1aa62db7b758b17ee29163f13de3e2;hb=refs%2Ftags%2FV5_1_1a2;hp=ed6027268ec1ecb5cd87f85e5e3301b788ef7eb0;hpb=cba66c58854a8e93f8708965324a65706e9a4e73;p=modules%2Fsmesh.git diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index ed6027268..af75b6a4f 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -415,18 +415,20 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // Check if node projection to a face is needed Bnd_B2d uvBox; SMDS_ElemIteratorPtr faceIt = srcSubMesh->GetSubMeshDS()->GetElements(); - for ( int nbN = 0; nbN < 3 && faceIt->more(); ) { + int nbFaceNodes = 0; + for ( ; nbFaceNodes < 3 && faceIt->more(); ) { const SMDS_MeshElement* face = faceIt->next(); SMDS_ElemIteratorPtr nodeIt = face->nodesIterator(); while ( nodeIt->more() ) { const SMDS_MeshNode* node = static_cast( nodeIt->next() ); if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) { - nbN++; + nbFaceNodes++; uvBox.Add( helper.GetNodeUV( srcFace, node )); } } } - const bool toProjectNodes = ( uvBox.IsVoid() || uvBox.SquareExtent() < DBL_MIN ); + const bool toProjectNodes = + ( nbFaceNodes > 0 && ( uvBox.IsVoid() || uvBox.SquareExtent() < DBL_MIN )); // Load pattern from the source face SMESH_Pattern mapper;