From: skl Date: Fri, 23 Apr 2010 09:05:42 +0000 (+0000) Subject: Changes for bug 0021699 from Mantis. X-Git-Tag: V5_1_4rc1~31 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c03bea8f9856ee8d1cbaa1ec4ac2e1abb6404a5a;p=modules%2Fgeom.git Changes for bug 0021699 from Mantis. --- 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 {