#include <TopTools_ListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <Precision.hxx>
+#include <BRepCheck_Analyzer.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
+#include <ShapeFix_Shape.hxx>
#include <Standard_ConstructionError.hxx>
#include <StdFail_NotDone.hxx>
}
if (aShape.IsNull()) return 0;
- if (!BRepAlgo::IsValid(aShape)) {
- Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
+
+ // 08.07.2008 skl for bug 19761 from Mantis
+ BRepCheck_Analyzer ana (aShape, Standard_True);
+ ana.Init(aShape);
+ if (!ana.IsValid()) {
+ 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())
+ Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
}
+ //if (!BRepAlgo::IsValid(aShape)) {
+ // Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
+ //}
aFunction->SetValue(aShape);
#include <TopAbs.hxx>
#include <TopExp_Explorer.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
+#include <ShapeFix_Shape.hxx>
+
#include <Precision.hxx>
#include <gp_Pnt.hxx>
#include <StdFail_NotDone.hxx>
// Check shape validity
BRepCheck_Analyzer ana (aShape, false);
if (!ana.IsValid()) {
- StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
+ // 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");
}
aFunction->SetValue(aShape);
#include <TopTools_MapOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
+#include <ShapeFix_Shape.hxx>
+
#include <TColStd_ListIteratorOfListOfInteger.hxx>
#include <TColStd_ListOfInteger.hxx>
#include <Standard_NullObject.hxx>
if (aShape.IsNull()) return 0;
if (!BRepAlgo::IsValid(aShape)) {
- Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
+ // 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();
+ if (!BRepAlgo::IsValid(aShape))
+ Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
}
aFunction->SetValue(aShape);