0032261: Mesh - some trivial improvements for mesher
authorDzmitry Razmyslovich <razmyslovich@volumegraphics.com>
Mon, 29 Mar 2021 11:54:42 +0000 (13:54 +0200)
committerbugmaster <bugmaster@opencascade.com>
Wed, 26 May 2021 17:09:15 +0000 (20:09 +0300)
BRepMesh_GeomTool::IntSegSeg misses one case, when the result is Glued

src/BRepMesh/BRepMesh_GeomTool.cxx

index 65efa22..abdb8dd 100644 (file)
@@ -342,18 +342,26 @@ BRepMesh_GeomTool::IntFlag BRepMesh_GeomTool::IntSegSeg(
     classifyPoint(theStartPnt2, theEndPnt2, theEndPnt1  )
   };
 
+  Standard_Integer aPosHash =
+    aPointHash[0] + aPointHash[1] + aPointHash[2] + aPointHash[3];
+
   // Consider case when edges have shared vertex
   if ( aPointHash[0] < 0 || aPointHash[1] < 0 )
   {
-    if ( isConsiderEndPointTouch )
-      return BRepMesh_GeomTool::EndPointTouch;
+    if (aPosHash == -1)
+    {
+      // -1 means, that 2 points are equal, and 1 point is on another curve
+      return BRepMesh_GeomTool::Glued;
+    }
+    else
+    {
+      if (isConsiderEndPointTouch)
+        return BRepMesh_GeomTool::EndPointTouch;
 
-    return BRepMesh_GeomTool::NoIntersection;
+      return BRepMesh_GeomTool::NoIntersection;
+    }
   }
 
-  Standard_Integer aPosHash = 
-    aPointHash[0] + aPointHash[1] + aPointHash[2] + aPointHash[3];
-
   /*=========================================*/
   /*  1) hash code == 1: