From: eap Date: Fri, 9 Nov 2018 16:12:07 +0000 (+0300) Subject: PAL0023627: [IMACS] ASERIS: project point to the mesh X-Git-Tag: V9_3_0a1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8dc55ee0b75c97cc1a3d537cff6e992c6122b6d1;p=modules%2Fsmesh.git PAL0023627: [IMACS] ASERIS: project point to the mesh correct order of elements if the poly-line --- diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index cea314220..45c9547f8 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -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