1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0029717: Shape Healing - ShapeFix_Face::FixSmallAreaWire delivers a face with wrong-oriented wires + 1 small crash-fix

- Fix FixSmallAreaWire for the reversed faces.

- Add nullptr check for FixOrient...

- Test bugs heal bug25923 is corrected to avoid relying on wrong orientation of face after fixing small wire
This commit is contained in:
drazmyslovich
2018-04-23 17:38:32 +03:00
committed by bugmaster
parent bbd8ce1008
commit 3f50e94e33
2 changed files with 12 additions and 21 deletions

View File

@@ -1156,6 +1156,10 @@ Standard_Boolean ShapeFix_Face::FixOrientation(TopTools_DataMapOfShapeListOfShap
for(;ew.More(); ew.Next()) {
TopoDS_Edge ed = TopoDS::Edge (ew.Value());
Handle(Geom2d_Curve) cw = BRep_Tool::CurveOnSurface (ed,myFace,cf,cl);
if (cw.IsNull ())
{
continue;
}
Geom2dAdaptor_Curve gac;
Standard_Real aFirst = cw->FirstParameter();
Standard_Real aLast = cw->LastParameter();
@@ -1888,6 +1892,7 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire(const Standard_Boolean theIsRem
TopoDS_Shape anEmptyCopy = myFace.EmptyCopied();
TopoDS_Face aFace = TopoDS::Face(anEmptyCopy);
aFace.Orientation (TopAbs_FORWARD);
const Standard_Real aTolerance3d = ShapeFix_Root::Precision();
for (TopoDS_Iterator aWIt(myFace, Standard_False); aWIt.More(); aWIt.Next())
@@ -1931,8 +1936,9 @@ Standard_Boolean ShapeFix_Face::FixSmallAreaWire(const Standard_Boolean theIsRem
#ifdef OCCT_DEBUG
std::cout << "Warning: ShapeFix_Face: " << nbRemoved << " small area wire(s) removed" << std::endl;
#endif
if ( !Context().IsNull() )
Context()->Replace(myFace, aFace);
aFace.Orientation (myFace.Orientation ());
if (!Context ().IsNull ())
Context ()->Replace (myFace, aFace);
myFace = aFace;
return Standard_True;