From ccb3502a56de8842750d792324f675330ef2c134 Mon Sep 17 00:00:00 2001 From: Dzmitry Razmyslovich Date: Mon, 29 Mar 2021 13:54:42 +0200 Subject: [PATCH] 0032261: Mesh - some trivial improvements for mesher BRepMesh_GeomTool::IntSegSeg misses one case, when the result is Glued --- src/BRepMesh/BRepMesh_GeomTool.cxx | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/BRepMesh/BRepMesh_GeomTool.cxx b/src/BRepMesh/BRepMesh_GeomTool.cxx index 65efa22573..abdb8ddead 100644 --- a/src/BRepMesh/BRepMesh_GeomTool.cxx +++ b/src/BRepMesh/BRepMesh_GeomTool.cxx @@ -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: