Projection 2D failure due to incorrect detection of distorted result faces

This commit is contained in:
eap 2014-11-20 16:06:53 +03:00
parent b73d2603ed
commit 9933995f6c
2 changed files with 6 additions and 6 deletions

View File

@ -2575,7 +2575,7 @@ bool SMESH_MesherHelper::IsDistorted2D( SMESH_subMesh* faceSM,
if ( !smDS || smDS->NbElements() == 0 ) return false; if ( !smDS || smDS->NbElements() == 0 ) return false;
SMDS_ElemIteratorPtr faceIt = smDS->GetElements(); SMDS_ElemIteratorPtr faceIt = smDS->GetElements();
double prevArea2D = 0; double prevArea = 0;
vector< const SMDS_MeshNode* > nodes; vector< const SMDS_MeshNode* > nodes;
vector< gp_XY > uv; vector< gp_XY > uv;
bool* toCheckUV = checkUV ? & checkUV : 0; bool* toCheckUV = checkUV ? & checkUV : 0;
@ -2613,15 +2613,15 @@ bool SMESH_MesherHelper::IsDistorted2D( SMESH_subMesh* faceSM,
uv[ i ] = helper.GetNodeUV( F, nodes[ i ], inFaceNode, toCheckUV ); uv[ i ] = helper.GetNodeUV( F, nodes[ i ], inFaceNode, toCheckUV );
// compare orientation of triangles // compare orientation of triangles
double faceArea = 0;
for ( int iT = 0, nbT = nodes.size()-2; iT < nbT; ++iT ) for ( int iT = 0, nbT = nodes.size()-2; iT < nbT; ++iT )
{ {
gp_XY v1 = uv[ iT+1 ] - uv[ 0 ]; gp_XY v1 = uv[ iT+1 ] - uv[ 0 ];
gp_XY v2 = uv[ iT+2 ] - uv[ 0 ]; gp_XY v2 = uv[ iT+2 ] - uv[ 0 ];
double area2D = v2 ^ v1; faceArea += v2 ^ v1;
if (( haveBadFaces = ( area2D * prevArea2D < 0 )))
break;
prevArea2D = area2D;
} }
haveBadFaces = ( faceArea * prevArea < 0 );
prevArea = faceArea;
} }
return haveBadFaces; return haveBadFaces;

View File

@ -732,7 +732,7 @@ namespace {
(( uv - uvBis ).SquareModulus() < tol2d )) (( uv - uvBis ).SquareModulus() < tol2d ))
++nbOkPos; ++nbOkPos;
else else
nbOkPos = 0; nbOkPos = -((int) src2tgtNodes.size() );
break; break;
} }
case SMDS_TOP_EDGE: case SMDS_TOP_EDGE: