-// Copyright (C) 2007-2019 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
} // loop on edges
+ // orient seam edges (#19982)
+ const double 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 );
for ( size_t j = 0; j < u2nodeVec.size(); ++j )
u2node.insert( u2node.end(), u2nodeVec[j] );
}
+ continue;
} // loop on myEdge's
// Add 2nd VERTEX node for a last EDGE
if ( mesh->HasModificationsToDiscard() ) // check nb of nodes on the EDGE sub-mesh
{
int iQuad = sm->NbElements() ? sm->GetElements()->next()->IsQuadratic() : 0;
- int nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
+ smIdType nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements();
if ( nbExpect != sm->NbNodes() ) // some nodes are moved from the EDGE by MergeNodes()
{
// add nodes of all segments
// since creation of this side
//=======================================================================
-int StdMeshers_FaceSide::NbPoints(const bool update) const
+smIdType StdMeshers_FaceSide::NbPoints(const bool update) const
{
if ( !myPoints.empty() )
return myPoints.size();
// since creation of this side
//=======================================================================
-int StdMeshers_FaceSide::NbSegments(const bool update) const
+smIdType StdMeshers_FaceSide::NbSegments(const bool update) const
{
return NbPoints( update ), myNbSegments;
}
MESSAGE_ADD ( "\tF: "<<myFirst[i]<< " L: "<< myLast[i] );
MESSAGE_END ( "\tnormPar: "<<myNormPar[i]<<endl );
}
+#else
+ (void)msg; // unused in release mode
#endif
}