]> 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:28:46 +0000 (10:28 +0000)
committereap <eap@opencascade.com>
Wed, 5 Mar 2008 10:28:46 +0000 (10:28 +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 5850cb74ea5523b2b9922e542490b845c7488303..eccc3f5afd625e80f53836c09c7fdc3a9a1168c0 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,12 +506,20 @@ 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;
   }
   return wires;
 }
 
-