Salome HOME
22710: [CEA 1296] Regression of a MG-CADSurf mesh with face projection
[modules/smesh.git] / src / StdMeshers / StdMeshers_Projection_2D.cxx
index d2b943b5bacee02c9184ede2cc0aaecf8434118d..b4f3e3b5546ab8c426b877f7f7a36970b36dee59 100644 (file)
@@ -438,8 +438,11 @@ namespace {
       TopTools_IndexedMapOfShape edgeMap; // to detect seam edges
       for ( int iE = 0; iE < srcWire->NbEdges(); ++iE )
       {
-        TopoDS_Edge srcE = srcWire->Edge( iE );
-        TopoDS_Edge tgtE = TopoDS::Edge( shape2ShapeMap( srcE, /*isSrc=*/true));
+        TopoDS_Edge     srcE = srcWire->Edge( iE );
+        TopoDS_Edge     tgtE = TopoDS::Edge( shape2ShapeMap( srcE, /*isSrc=*/true));
+        TopoDS_Shape srcEbis = shape2ShapeMap( tgtE, /*isSrc=*/false );
+        if ( srcE.Orientation() != srcEbis.Orientation() )
+          tgtE.Reverse();
         // reverse a seam edge encountered for the second time
         const int index = edgeMap.Add( tgtE );
         if ( index < edgeMap.Extent() ) // E is a seam