]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
check orientation when re-loading points from a proxy mesh
authoreap <eap@opencascade.com>
Fri, 31 May 2013 11:56:32 +0000 (11:56 +0000)
committereap <eap@opencascade.com>
Fri, 31 May 2013 11:56:32 +0000 (11:56 +0000)
src/StdMeshers/StdMeshers_FaceSide.cxx

index 4d72e2f68bcab49d12faab351cc4564b4539ae49..d832081670d420b822ac0cd080b2d6dd19fa9306 100644 (file)
@@ -358,13 +358,18 @@ const vector<UVPtStruct>& StdMeshers_FaceSide::GetUVPtStruct(bool   isXConst,
       {
         const UVPtStructVec& edgeUVPtStruct = proxySubMesh[iE]->GetUVPtStructVec();
         std::copy( edgeUVPtStruct.begin(), edgeUVPtStruct.end(), & points[iPt] );
+        // check orientation
+        double du1 = edgeUVPtStruct.back().param - edgeUVPtStruct[0].param;
+        double du2 = myLast[iE] - myFirst[iE];
+        if ( du1 * du2 < 0 )
+          std::reverse( & points[iPt], & points[iPt + edgeUVPtStruct.size()]);
         // update normalized params
         if ( myEdge.size() > 1 ) {
           for ( size_t i = 0; i < edgeUVPtStruct.size(); ++i, ++iPt )
           {
             UVPtStruct & uvPt = points[iPt];
-            uvPt.normParam = prevNormPar + uvPt.normParam * paramSize;
-            uvPt.x = uvPt.y = uvPt.normParam;
+            uvPt.normParam    = prevNormPar + uvPt.normParam * paramSize;
+            uvPt.x = uvPt.y   = uvPt.normParam;
           }
           --iPt; // to point to the 1st VERTEX of the next EDGE
         }