From: eap Date: Fri, 14 Feb 2014 15:31:40 +0000 (+0400) Subject: 0022360: EDF SMESH: Body Fitting algorithm: incorporate edges X-Git-Tag: V7_4_0a1~72 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8585067de85b397b7691032e6aeb18caaca31fa4;p=modules%2Fsmesh.git 0022360: EDF SMESH: Body Fitting algorithm: incorporate edges --- diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index f4700221f..9999157ac 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -1907,7 +1907,7 @@ namespace if ( !findChain( n2, nFirst, quad, chainNodes )) { if ( !closePolygon( polygon, chainNodes )) - ;//chainNodes.push_back( nFirst ); + chainNodes.push_back( nFirst ); } for ( size_t i = 1; i < chainNodes.size(); ++i ) { @@ -1954,7 +1954,7 @@ namespace freeLinks.push_back( & polygon._links[ iL ]); } int nbFreeLinks = freeLinks.size(); - if ( nbFreeLinks < 3 ) return; + if ( nbFreeLinks > 0 && nbFreeLinks < 3 ) return; set usedFaceIDs; @@ -1968,7 +1968,8 @@ namespace _OrientedLink* curLink = 0; _Node* curNode; - if ( !hasEdgeIntersections ) + if (( !hasEdgeIntersections ) || + ( nbFreeLinks < 4 && _vertexNodes.empty() )) { // get a remaining link to start from for ( size_t iL = 0; iL < freeLinks.size() && !curLink; ++iL ) @@ -2102,12 +2103,15 @@ namespace // TODO: to reorder _vertexNodes within polygon, if there are several ones } } - polyLink._nodes[0] = polygon._links[0].LastNode(); - polyLink._nodes[1] = curNode; - polygon._polyLinks.push_back( polyLink ); - polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() )); - freeLinks.push_back( &polygon._links.back() ); - ++nbFreeLinks; + // if ( polygon._links.size() > 1 ) + { + polyLink._nodes[0] = polygon._links[0].LastNode(); + polyLink._nodes[1] = curNode; + polygon._polyLinks.push_back( polyLink ); + polygon._links.push_back( _OrientedLink( &polygon._polyLinks.back() )); + freeLinks.push_back( &polygon._links.back() ); + ++nbFreeLinks; + } } } // if there are intersections with EDGEs