From f90e1ea49e27e4188ba8bff184ec45f28fd3574a Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 20 Mar 2014 14:43:30 +0400 Subject: [PATCH] 22516: [CEA 1075] Quadrangle mapping produces a bad mesh without raising error For a case of a FACE with only concave corners. --- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 -- 2.39.2