- // Check shape validity
- BRepCheck_Analyzer ana (aShape, false);
- if (!ana.IsValid()) {
- // 08.07.2008 added by skl during fixing bug 19761 from Mantis
- ShapeFix_ShapeTolerance aSFT;
- aSFT.LimitTolerance(aShape, Precision::Confusion(),
- Precision::Confusion(), TopAbs_SHAPE);
- Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
- aSfs->Perform();
- aShape = aSfs->Shape();
- ana.Init(aShape);
- if (!ana.IsValid())
- StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
- }
+#if defined(FIX_CURVES_TOLERANCES)
+ bool isOk = GEOMUtils::FixShapeCurves(aShape);
+#elif defined(FIX_FACE_TOLERANCE)
+ bool isOk = GEOMUtils::FixShapeTolerance(aShape, TopAbs_FACE);
+#else
+ // 08.07.2008 added by skl during fixing bug 19761 from Mantis
+ bool isOk = GEOMUtils::CheckShape(aShape) || GEOMUtils::FixShapeTolerance(aShape);
+#endif
+ if ( !isOk )
+ StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");