From 315665caedc3625a3ea07282d0de7dea3418ab1c Mon Sep 17 00:00:00 2001 From: jfa Date: Fri, 21 Nov 2008 11:52:24 +0000 Subject: [PATCH] Bug 0020043: EDF 865 GEOM: Object is non valid after translation. Fix object after translation. --- src/GEOMImpl/GEOMImpl_TranslateDriver.cxx | 32 ++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx b/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx index fba11c209..5854f6b71 100644 --- a/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_TranslateDriver.cxx @@ -24,11 +24,15 @@ #include #include #include -#include -#include -#include -#include + +#include +#include + +#include #include +#include +#include + #include #include #include @@ -37,7 +41,10 @@ #include #include #include -#include + +#include +#include +#include //======================================================================= //function : GetID @@ -237,9 +244,22 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const } else return 0; - if (aShape.IsNull()) return 0; + BRepCheck_Analyzer ana (aShape, Standard_True); + if (!ana.IsValid()) { + ShapeFix_ShapeTolerance aSFT; + aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion()); + Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape); + aSfs->SetPrecision(Precision::Confusion()); + aSfs->Perform(); + aShape = aSfs->Shape(); + + ana.Init(aShape, Standard_False); + if (!ana.IsValid()) + Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result"); + } + aFunction->SetValue(aShape); log.SetTouched(Label()); -- 2.39.2