Salome HOME
PAL0023627: [IMACS] ASERIS: project point to the mesh
authoreap <eap@opencascade.com>
Fri, 9 Nov 2018 16:12:07 +0000 (19:12 +0300)
committereap <eap@opencascade.com>
Fri, 9 Nov 2018 16:12:07 +0000 (19:12 +0300)
  correct order of elements if the poly-line

src/SMESH/SMESH_MeshEditor.cxx

index cea314220460932062e7b7bd972eeced069adae7..45c9547f88956cd173c56f1557d2ee1086c7cb56 100644 (file)
@@ -13449,6 +13449,12 @@ namespace // utils for MakePolyLine
       if ( myPaths[ iSeg ].myPoints.empty() )
         throw SALOME_Exception( SMESH_Comment("Can't find a full path for PolySegment #") << iSeg );
 
+      // reverse the path
+      double d00 = ( polySeg.myXYZ[0] - myPaths[ iSeg ].myPoints.front() ).SquareModulus();
+      double d01 = ( polySeg.myXYZ[0] - myPaths[ iSeg ].myPoints.back()  ).SquareModulus();
+      if ( d00 > d01 )
+        std::reverse( myPaths[ iSeg ].myPoints.begin(), myPaths[ iSeg ].myPoints.end() );
+
     } // PolyPathCompute::Compute()
 
   }; // struct PolyPathCompute