]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
+ // find out side orientation, which is important if there are several wires...
authoreap <eap@opencascade.com>
Wed, 5 Mar 2008 10:23:39 +0000 (10:23 +0000)
committereap <eap@opencascade.com>
Wed, 5 Mar 2008 10:23:39 +0000 (10:23 +0000)
+    bool isForward = true;
+    if ( nbWires > 1 ) {
       ...
+    }
+
     StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
-                                                         true, theIgnoreMediumNodes);
+                                                         isForward, theIgnoreMediumNodes);

src/StdMeshers/StdMeshers_FaceSide.cxx

index 3063577c05de8bdc4ca23a044ecdb8ce620b5734..d49ee92d9815468606101fd7ce6b35d817a4c59c 100644 (file)
@@ -44,6 +44,7 @@
 #include <BRep_Builder.hxx>
 #include <BRep_Tool.hxx>
 #include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Vertex.hxx>
 #include <TopoDS_Wire.hxx>
@@ -505,8 +506,17 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
         return TSideVector(0);
       }
     }
+    // find out side orientation, which is important if there are several wires (PAL19080) 
+    bool isForward = true;
+    if ( nbWires > 1 ) {
+      TopExp_Explorer e( theFace, TopAbs_EDGE );
+      while ( ! e.Current().IsSame( wireEdges.back() ))
+        e.Next();
+      isForward = ( e.Current().Orientation() == wireEdges.back().Orientation() );
+    }
+
     StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
-                                                         true, theIgnoreMediumNodes);
+                                                         isForward, theIgnoreMediumNodes);
     wires[ iW ] = StdMeshers_FaceSidePtr( wire );
     from = to;
   }