From 95a19da7967c32e1bba45b7fe7dd7bdd777c44c5 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 29 Oct 2009 08:31:59 +0000 Subject: [PATCH] 0020557: EDF 1151 SMESH: Netgen 2D fail to mesh a ring and merge with V5 --- src/StdMeshers/StdMeshers_FaceSide.cxx | 45 +++++++++++++++++++------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 13cc6b789..aa5e16ae5 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -97,6 +97,7 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, myMesh = theMesh; myMissingVertexNodes = false; myIgnoreMediumNodes = theIgnoreMediumNodes; + myDefaultPnt2d = gp_Pnt2d( 1e+100, 1e+100 ); if ( nbEdges == 0 ) return; SMESHDS_Mesh* meshDS = theMesh->GetMeshDS(); @@ -157,6 +158,34 @@ StdMeshers_FaceSide::StdMeshers_FaceSide(const TopoDS_Face& theFace, //dump(); } +//================================================================================ +/*! + * \brief Constructor of a side for vertex using data from other FaceSide + * \param theVertex - the vertex + * \param theSide - the side + */ +//================================================================================ + +StdMeshers_FaceSide::StdMeshers_FaceSide(const SMDS_MeshNode* theNode, + const gp_Pnt2d thePnt2d, + const StdMeshers_FaceSide* theSide) +{ + myC2d.resize(1); + myLength = 0; + myMesh = theSide->GetMesh(); + myDefaultPnt2d = thePnt2d; + + myPoints = theSide->GetUVPtStruct(); + myNbPonits = myNbSegments = myPoints.size(); + std::vector::iterator it = myPoints.begin(); + for(; it!=myPoints.end(); it++) { + (*it).u = thePnt2d.X(); + (*it).v = thePnt2d.Y(); + (*it).y = 0.0; + (*it).node = theNode; + } +} + //================================================================================ /*! * \brief Return info on nodes on the side @@ -186,7 +215,8 @@ const vector& StdMeshers_FaceSide::GetUVPtStruct(bool isXConst, double prevNormPar = ( i == 0 ? 0 : myNormPar[ i-1 ]); // normalized param if ( node ) { // internal nodes may be missing u2node.insert( make_pair( prevNormPar, node )); - } else if ( i == 0 ) { + } + else if ( i == 0 ) { MESSAGE(" NO NODE on VERTEX" ); return myPoints; } @@ -472,7 +502,8 @@ gp_Pnt2d StdMeshers_FaceSide::Value2d(double U) const double r = ( U - prevU )/ ( myNormPar[ i ] - prevU ); return myC2d[ i ]->Value( myFirst[i] * ( 1 - r ) + myLast[i] * r ); } - return gp_Pnt2d( 1e+100, 1e+100 ); + //return gp_Pnt2d( 1e+100, 1e+100 ); + return myDefaultPnt2d; } //================================================================================ @@ -513,15 +544,7 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace, return TSideVector(0); } } - // find out side orientation, which is important if there are several wires (PAL19080) - bool isForward = true; - if ( nbWires > 1 ) { - TopExp_Explorer e( theFace, TopAbs_EDGE ); - while ( ! e.Current().IsSame( wireEdges.back() )) - e.Next(); - isForward = ( e.Current().Orientation() == wireEdges.back().Orientation() ); - } - + const bool isForward = true; StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh, isForward, theIgnoreMediumNodes); wires[ iW ] = StdMeshers_FaceSidePtr( wire ); -- 2.39.2