0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh computation to fail with netgen

* In GetFaceWires(), create a separate wire for each internal edge
This commit is contained in:
eap 2010-06-08 11:33:26 +00:00
parent dd4eae00e6
commit 452d18f670

View File

@ -585,18 +585,17 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
TError & theError) TError & theError)
{ {
TopoDS_Vertex V1; TopoDS_Vertex V1;
list< TopoDS_Edge > edges; list< TopoDS_Edge > edges, internalEdges;
list< int > nbEdgesInWires; list< int > nbEdgesInWires;
int nbWires = SMESH_Block::GetOrderedEdges (theFace, V1, edges, nbEdgesInWires); int nbWires = SMESH_Block::GetOrderedEdges (theFace, V1, edges, nbEdgesInWires);
// split list of all edges into separate wires // split list of all edges into separate wires
TSideVector wires( nbWires ); TSideVector wires( nbWires );
list< int >::iterator nbE = nbEdgesInWires.begin(); list< int >::iterator nbE = nbEdgesInWires.begin();
list< TopoDS_Edge >::iterator from, to; list< TopoDS_Edge >::iterator from = edges.begin(), to = from;
from = to = edges.begin(); for ( int iW = 0; iW < nbWires; ++iW, ++nbE )
for ( int iW = 0; iW < nbWires; ++iW )
{ {
std::advance( to, *nbE++ ); std::advance( to, *nbE );
if ( *nbE == 0 ) // Issue 0020676 if ( *nbE == 0 ) // Issue 0020676
{ {
--nbWires; --nbWires;
@ -608,6 +607,7 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
// assure that there is a node on the first vertex // assure that there is a node on the first vertex
// as StdMeshers_FaceSide::GetUVPtStruct() requires // as StdMeshers_FaceSide::GetUVPtStruct() requires
if ( wireEdges.front().Orientation() != TopAbs_INTERNAL ) // Issue 0020676 if ( wireEdges.front().Orientation() != TopAbs_INTERNAL ) // Issue 0020676
{
while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true), while ( !SMESH_Algo::VertexNode( TopExp::FirstVertex( wireEdges.front(), true),
theMesh.GetMeshDS())) theMesh.GetMeshDS()))
{ {
@ -619,12 +619,24 @@ TSideVector StdMeshers_FaceSide::GetFaceWires(const TopoDS_Face& theFace,
return TSideVector(0); return TSideVector(0);
} }
} }
const bool isForward = true; }
else if ( *nbE > 1 ) // Issue 0020676 (Face_pb_netgen.brep) - several internal edges in a wire
{
internalEdges.splice( internalEdges.end(), wireEdges, ++wireEdges.begin(), wireEdges.end());
}
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh, StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, wireEdges, &theMesh,
isForward, theIgnoreMediumNodes); /*isForward=*/true, theIgnoreMediumNodes);
wires[ iW ] = StdMeshers_FaceSidePtr( wire ); wires[ iW ] = StdMeshers_FaceSidePtr( wire );
from = to; from = to;
} }
while ( !internalEdges.empty() )
{
StdMeshers_FaceSide* wire = new StdMeshers_FaceSide( theFace, internalEdges.back(), &theMesh,
/*isForward=*/true, theIgnoreMediumNodes);
wires.push_back( StdMeshers_FaceSidePtr( wire ));
internalEdges.pop_back();
}
return wires; return wires;
} }