0022229: [CEA 829] Error "Edge multiple times in surface mesh"

Fix IsReversedSubMesh(), avoid getting uv on a faces at a singularity
point of sphere
This commit is contained in:
eap 2013-06-11 10:24:55 +00:00
parent f0faaf2c4f
commit 9a93fe49f9

View File

@ -2489,9 +2489,16 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
{ {
SMESH_TNodeXYZ nPnt[3]; SMESH_TNodeXYZ nPnt[3];
SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator(); SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
int iNodeOnFace = 0, iPosDim = SMDS_TOP_VERTEX;
for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes
{
nPnt[ iN ] = nodesIt->next(); nPnt[ iN ] = nodesIt->next();
if ( nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition() > iPosDim )
{
iNodeOnFace = iN;
iPosDim = nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition();
}
}
// compute normal // compute normal
gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] ); gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
if ( v01.SquareMagnitude() > RealSmall() && if ( v01.SquareMagnitude() > RealSmall() &&
@ -2499,7 +2506,7 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
{ {
Ne = v01 ^ v02; Ne = v01 ^ v02;
if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() ))) if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() )))
uv = GetNodeUV( theFace, nPnt[0]._node, nPnt[2]._node, &normalOK ); uv = GetNodeUV( theFace, nPnt[iNodeOnFace]._node, 0, &normalOK );
} }
} }
} }