X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=blobdiff_plain;f=src%2FShapeFix%2FShapeFix_Face.cxx;h=32dede1de679469bd185dd9d08a2307cb2389907;hb=6a9f983a1684d67d332e5a0d02822ac17575dd0f;hpb=22fa1da36ebcd97e604034d47c103dff0f39c24a diff --git a/src/ShapeFix/ShapeFix_Face.cxx b/src/ShapeFix/ShapeFix_Face.cxx index 0854b5b736..32dede1de6 100644 --- a/src/ShapeFix/ShapeFix_Face.cxx +++ b/src/ShapeFix/ShapeFix_Face.cxx @@ -1863,13 +1863,56 @@ Standard_Boolean ShapeFix_Face::FixMissingSeam() mySurf = new ShapeAnalysis_Surface ( RTS ); myResult = CompShell.Result(); -// if ( myFace.Orientation() == TopAbs_REVERSED ) res.Reverse(); + Context()->Replace ( myFace, myResult ); + + // Remove small wires and / or faces that can be generated by ComposeShell + // (see tests bugs step bug30052_4, de step_3 E6) + Standard_Integer nbFaces = 0; + TopExp_Explorer expF ( myResult, TopAbs_FACE ); + for (; expF.More(); expF.Next() ) + { + TopoDS_Face aFace = TopoDS::Face(expF.Value()); + TopExp_Explorer aExpW(aFace, TopAbs_WIRE); + Standard_Integer nbWires = 0; + for( ;aExpW.More(); aExpW.Next() ) + { + ShapeFix_Wire aSfw(TopoDS::Wire(aExpW.Value()), aFace, Precision()); + aSfw.SetContext(Context()); + if(aSfw.NbEdges()) + aSfw.FixSmall (Standard_True, Precision()); + if(!aSfw.NbEdges()) + { + Context()->Remove(aExpW.Value()); + continue; + } + nbWires++; + } + if(!nbWires) + { + Context()->Remove(aFace); + continue; + } + nbFaces++; + } + + myResult = Context()->Apply(myResult); for (TopExp_Explorer exp ( myResult, TopAbs_FACE ); exp.More(); exp.Next() ) { - myFace = TopoDS::Face ( exp.Current() ); + myFace = TopoDS::Face ( Context()->Apply(exp.Current() )); + if( myFace.IsNull()) + continue; + if(nbFaces > 1) + { + FixSmallAreaWire(Standard_True); + TopoDS_Shape aShape = Context()->Apply(myFace); + if(aShape.IsNull() ) + continue; + myFace = TopoDS::Face(aShape); + } BRepTools::Update(myFace); //:p4 } - + myResult = Context()->Apply(myResult); + SendWarning ( Message_Msg ( "FixAdvFace.FixMissingSeam.MSG0" ) );// Missing seam-edge added return Standard_True; }