From c03bea8f9856ee8d1cbaa1ec4ac2e1abb6404a5a Mon Sep 17 00:00:00 2001 From: skl Date: Fri, 23 Apr 2010 09:05:42 +0000 Subject: [PATCH] Changes for bug 0021699 from Mantis. --- src/GEOMImpl/GEOMImpl_OffsetDriver.cxx | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx index 0bf2a926f..edd84de19 100644 --- a/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_OffsetDriver.cxx @@ -38,6 +38,11 @@ #include #include +#include +#include +#include + +#include #include //======================================================================= @@ -91,7 +96,22 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const aTol); if (MO.IsDone()) { aShape = MO.Shape(); - } else { + // 23.04.2010 skl for bug 21699 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"); + } + } + else { StdFail_NotDone::Raise("Offset construction failed"); } } else {