Salome HOME
IPAL52438: Projection 2D fails
authoreap <eap@opencascade.com>
Thu, 3 Jul 2014 12:09:34 +0000 (16:09 +0400)
committereap <eap@opencascade.com>
Thu, 3 Jul 2014 12:09:34 +0000 (16:09 +0400)
  Merge w/o parameter check if nb of existing and new nodes is same

src/SMESH/SMESH_Pattern.cxx

index af13d45..0ae3591 100644 (file)
@@ -4018,26 +4018,41 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh,
           map< double, const SMDS_MeshNode* >::iterator u2n    = ++paramsOfNodes.begin();
           map< double, const SMDS_MeshNode* >::iterator u2nEnd = --paramsOfNodes.end();
           TPoint* p;
-          const double tolFact = ( paramsOfNodes.size() == points.size() ) ? 0.3 : 0.05;
-          while ( u2n != u2nEnd && pItF != points.end() )
+          if ( paramsOfNodes.size() == points.size() )
           {
-            const double         u = u2n->first;
-            const SMDS_MeshNode* n = u2n->second;
-            const double       tol = ( (++u2n)->first - u ) * tolFact;
-            do
+            for ( ; u2n != u2nEnd; ++u2n )
             {
               p = ( isForward ? *pItF : *pItR );
-              if ( Abs( u - p->myU ) < tol )
+              int pIndex = p - &myPoints[0];
+              if ( !nodesVector [ pIndex ] )
+                nodesVector [ pIndex ] = u2n->second;
+              ++pItF;
+              ++pItR;
+            }
+          }
+          else
+          {
+            const double tolFact = 0.05;
+            while ( u2n != u2nEnd && pItF != points.end() )
+            {
+              const double         u = u2n->first;
+              const SMDS_MeshNode* n = u2n->second;
+              const double       tol = ( (++u2n)->first - u ) * tolFact;
+              do
               {
-                int pIndex = p - &myPoints[0];
-                if ( !nodesVector [ pIndex ] )
-                  nodesVector [ pIndex ] = n;
-                ++pItF;
-                ++pItR;
-                break;
+                p = ( isForward ? *pItF : *pItR );
+                if ( Abs( u - p->myU ) < tol )
+                {
+                  int pIndex = p - &myPoints[0];
+                  if ( !nodesVector [ pIndex ] )
+                    nodesVector [ pIndex ] = n;
+                  ++pItF;
+                  ++pItR;
+                  break;
+                }
               }
+              while ( p->myU < u && ( ++pItF, ++pItR != points.rend() ));
             }
-            while ( p->myU < u && ( ++pItF, ++pItR != points.rend() ));
           }
           break;
         }