Salome HOME
22350: EDF 2747 SMESH: Coincident nodes with BLSURF (BLSURFissue2.tar.gz)
authoreap <eap@opencascade.com>
Wed, 4 Dec 2013 14:41:03 +0000 (14:41 +0000)
committereap <eap@opencascade.com>
Wed, 4 Dec 2013 14:41:03 +0000 (14:41 +0000)
 In getNodeGroupsToMerge() fix a tolerance to compare nodes, which was
 too small in case of only two nodes on an EDGE

src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx

index 4cfa4f0d1f1beeffc215698b614d33e18e1c7a0b..a146e6a92d3137866e10e5e61030259eaae13815 100644 (file)
@@ -1645,7 +1645,11 @@ namespace
       }
       if ( u2node.size() < 2 ) return;
 
-      double tol = (( u2node.rbegin()->first - u2node.begin()->first ) / 20.) / u2node.size();
+      //double tol = (( u2node.rbegin()->first - u2node.begin()->first ) / 20.) / u2node.size();
+      Standard_Real f,l;
+      BRep_Tool::Range( TopoDS::Edge( shape ), f,l );
+      double tol = (( l - f ) / 20.) / u2node.size();
+
       std::multimap< double, const SMDS_MeshNode* >::iterator un2, un1;
       for ( un2 = u2node.begin(), un1 = un2++; un2 != u2node.end(); un1 = un2++ )
       {