Salome HOME
Debug 23078: [CEA 1498] Sewing of meshes without having to set the nodes ids
[modules/smesh.git] / src / SMESHUtils / SMESH_MeshAlgos.cxx
index dc157e716fdc6fb6ae24352638dcb5e9fe29ed83..1a9dd65bb6a5d6ea1c601ab841369e520ef1f5a3 100644 (file)
@@ -1210,19 +1210,13 @@ bool SMESH_MeshAlgos::IsOut( const SMDS_MeshElement* element, const gp_Pnt& poin
     {
       gp_Vec edge( xyz[i-1], xyz[i] );
       gp_Vec n1p ( xyz[i-1], point  );
-      // double dist = ( edge ^ n1p ).Magnitude() / edge.Magnitude();
-      // if ( dist > tol )
-      //   continue;
-      // gp_Vec n2p( xyz[i], point );
-      // if ( fabs( edge.Magnitude() - n1p.Magnitude() - n2p.Magnitude()) > tol )
-      //   continue;
       double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
-      if ( u < 0. ) {
+      if ( u <= 0. ) {
         if ( n1p.SquareMagnitude() < tol * tol )
           return false;
         continue;
       }
-      if ( u > 1. ) {
+      if ( u >= 1. ) {
         if ( point.SquareDistance( xyz[i] ) < tol * tol )
           return false;
         continue;