Salome HOME
0020676: EDF 1212 GEOM: Partition operation creates vertices which causes mesh comput...
[modules/smesh.git] / src / SMESH / SMESH_Block.cxx
index 821d8fa9f7940c3208bcad592856a7a297e86abd..c84d6413cb158153ef6dd4855e5ae4f6e75ba4be 100644 (file)
@@ -981,10 +981,13 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face&   theFace,
   TopoDS_Wire anOuterWire =
     theShapeAnalysisAlgo ? ShapeAnalysis::OuterWire( theFace ) : BRepTools::OuterWire( theFace );
   for ( TopoDS_Iterator wIt (theFace); wIt.More(); wIt.Next() )
-    if ( !anOuterWire.IsSame( wIt.Value() ))
-      aWireList.push_back( TopoDS::Wire( wIt.Value() ));
-    else
-      aWireList.push_front( TopoDS::Wire( wIt.Value() ));
+    if ( wIt.Value().ShapeType() == TopAbs_WIRE ) // it can be internal vertex!
+    {
+      if ( !anOuterWire.IsSame( wIt.Value() ))
+        aWireList.push_back( TopoDS::Wire( wIt.Value() ));
+      else
+        aWireList.push_front( TopoDS::Wire( wIt.Value() ));
+    }
 
   // loop on edges of wires
   theNbVertexInWires.clear();
@@ -1000,6 +1003,11 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face&   theFace,
       // edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
       theEdges.push_back( edge );
     }
+    if ( iE == 0 ) // wExp returns nothing if e.g. the wire contains one internal edge
+    { // Issue 0020676
+      for ( TopoDS_Iterator e( *wlIt ); e.More(); e.Next(), ++iE )
+        theEdges.push_back( TopoDS::Edge( e.Value() ));
+    }
     theNbVertexInWires.push_back( iE );
     iE = 0;
     if ( wlIt == aWireList.begin() && theEdges.size() > 1 ) { // the outer wire