From: eap Date: Mon, 4 Aug 2014 13:37:39 +0000 (+0400) Subject: 0052474: Body Fitting with "Implement Edges"=ON crashes SALOME X-Git-Tag: V7_5_0a1~32 X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=commitdiff_plain;h=1eb7dc9cd0312d0c9a46d0342e026cd17dd01a03 0052474: Body Fitting with "Implement Edges"=ON crashes SALOME Fix sortVertexNodes() for the case of a FACE with several WIREs --- diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index 8b40fe2d9..3cd23ff35 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -3021,10 +3021,10 @@ namespace list< int > nbEdges; int nbW = SMESH_Block::GetOrderedEdges (face, edges, nbEdges); if ( nbW > 1 ) { - // select a WIRE + // select a WIRE - remove EDGEs of irrelevant WIREs from edges list< TopoDS_Edge >::iterator e = edges.begin(), eEnd = e; list< int >::iterator nE = nbEdges.begin(); - for ( ; nbW ; ++nE, --nbW ) + for ( ; nbW > 0; ++nE, --nbW ) { std::advance( eEnd, *nE ); for ( ; e != eEnd; ++e ) @@ -3037,13 +3037,14 @@ namespace ( std::find( &nShapeIds[0], nShapeIdsEnd, id ) != nShapeIdsEnd )) { edges.erase( eEnd, edges.end() ); // remove rest wires - e = eEnd; + e = eEnd = edges.end(); + --e; nbW = 0; break; } } if ( nbW > 0 ) - edges.erase( edges.begin(), eEnd ); // remove a current wire + edges.erase( edges.begin(), eEnd ); // remove a current irrelevant wire } } // rotate edges to have the first one at least partially out of the hexa