mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-12 01:30:34 +05:00
#19982 EDF 21954 - Compute mesh fails
This commit is contained in:
parent
611b13e233
commit
1ce54e1c12
@ -62,6 +62,7 @@ SET(_link_LIBRARIES
|
||||
${GEOM_GEOMUtils}
|
||||
SMESHimpl
|
||||
SMESHDS
|
||||
SMESHUtils
|
||||
${TBB_LIBS}
|
||||
)
|
||||
|
||||
|
@ -181,6 +181,41 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace,
|
||||
|
||||
} // loop on edges
|
||||
|
||||
// orient seam edges (#19982)
|
||||
const tol = Precision::Confusion();
|
||||
if ( NbEdges() > 1 && !myC2d[0].IsNull() )
|
||||
for ( int i = 0; i < NbEdges(); ++i )
|
||||
{
|
||||
int iPrev = SMESH_MesherHelper::WrapIndex( i - 1, NbEdges() );
|
||||
if ( !BRep_Tool::IsClosed( myEdge[i], myFace ) || !myC2d[iPrev] )
|
||||
continue;
|
||||
gp_Pnt2d pLastPrev = myC2d[iPrev]->Value( myLast[iPrev] );
|
||||
gp_Pnt2d pFirst = myC2d[i]->Value( myFirst[i] );
|
||||
if ( pLastPrev.IsEqual( pFirst, tol ))
|
||||
continue; // OK
|
||||
pFirst = myC2d[i]->Value( myLast[i] );
|
||||
if ( pLastPrev.IsEqual( pFirst, tol ))
|
||||
{
|
||||
std::swap( myFirst[i], myLast[i] );
|
||||
continue;
|
||||
}
|
||||
TopoDS_Edge E = myEdge[i];
|
||||
E.Reverse();
|
||||
Handle(Geom2d_Curve) c2dRev = BRep_Tool::CurveOnSurface( E, myFace, myFirst[i], myLast[i] );
|
||||
pFirst = c2dRev->Value( myFirst[i] );
|
||||
if ( pLastPrev.IsEqual( pFirst, tol ))
|
||||
{
|
||||
myC2d[i] = c2dRev;
|
||||
continue;
|
||||
}
|
||||
pFirst = c2dRev->Value( myLast[i] );
|
||||
if ( pLastPrev.IsEqual( pFirst, tol ))
|
||||
{
|
||||
myC2d[i] = c2dRev;
|
||||
std::swap( myFirst[i], myLast[i] );
|
||||
}
|
||||
}
|
||||
|
||||
// count nodes and segments
|
||||
NbPoints( /*update=*/true );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user