From: eap Date: Thu, 20 Mar 2014 10:43:30 +0000 (+0400) Subject: 22516: [CEA 1075] Quadrangle mapping produces a bad mesh without raising error X-Git-Tag: V7_4_0a1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f90e1ea49e27e4188ba8bff184ec45f28fd3574a;p=modules%2Fsmesh.git 22516: [CEA 1075] Quadrangle mapping produces a bad mesh without raising error For a case of a FACE with only concave corners. --- diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 8bd1896fc..0a7e33017 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -3971,7 +3971,7 @@ bool StdMeshers_Quadrangle_2D::check() // find a right angle VERTEX int iVertex; - double maxAngle = 0; + double maxAngle = -1e100; for ( int i = 0; i < wire->NbEdges(); ++i ) { int iPrev = myHelper->WrapIndex( i-1, wire->NbEdges() ); @@ -3984,7 +3984,7 @@ bool StdMeshers_Quadrangle_2D::check() iVertex = i; } } - if ( maxAngle == 0 ) return isOK; + if ( maxAngle < -2*M_PI ) return isOK; // get a sign of 2D area of a corner face @@ -4010,6 +4010,9 @@ bool StdMeshers_Quadrangle_2D::check() } okSign = v2 ^ v1; + + if ( maxAngle < 0 ) + okSign *= -1; } // Look for incorrectly oriented faces