From 9a93fe49f9146c1c0b96dc01efc32f8b9b12f39b Mon Sep 17 00:00:00 2001 From: eap Date: Tue, 11 Jun 2013 10:24:55 +0000 Subject: [PATCH] 0022229: [CEA 829] Error "Edge multiple times in surface mesh" Fix IsReversedSubMesh(), avoid getting uv on a faces at a singularity point of sphere --- src/SMESH/SMESH_MesherHelper.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index 65a19e286..316bcea62 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -2489,9 +2489,16 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace) { SMESH_TNodeXYZ nPnt[3]; SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator(); + int iNodeOnFace = 0, iPosDim = SMDS_TOP_VERTEX; for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes + { nPnt[ iN ] = nodesIt->next(); - + if ( nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition() > iPosDim ) + { + iNodeOnFace = iN; + iPosDim = nPnt[ iN ]._node->GetPosition()->GetTypeOfPosition(); + } + } // compute normal gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] ); if ( v01.SquareMagnitude() > RealSmall() && @@ -2499,7 +2506,7 @@ bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace) { Ne = v01 ^ v02; if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() ))) - uv = GetNodeUV( theFace, nPnt[0]._node, nPnt[2]._node, &normalOK ); + uv = GetNodeUV( theFace, nPnt[iNodeOnFace]._node, 0, &normalOK ); } } } -- 2.39.2