]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
NPAL18205: MakePipe problem on Debian Etch 32bits.
authorjfa <jfa@opencascade.com>
Mon, 10 Dec 2007 13:51:11 +0000 (13:51 +0000)
committerjfa <jfa@opencascade.com>
Mon, 10 Dec 2007 13:51:11 +0000 (13:51 +0000)
src/GEOMImpl/GEOMImpl_PipeDriver.cxx

index 7bca5db26afc579953a1059d7cab7db6b7fb79eb..f11f6e33ab3aa52863fb121dce83614cae41d08d 100644 (file)
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 
+#include <GEOMAlgo_GlueAnalyser.hxx>
+
 #include <ShapeAnalysis_FreeBounds.hxx>
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeFix_Face.hxx>
 #include <ShapeFix_Shell.hxx>
+#include <ShapeFix_Shape.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
 
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 
 #include "utilities.h"
 
-//#include "BRepTools.hxx"
-//#include "GeomTools.hxx"
-#include <GEOMAlgo_GlueAnalyser.hxx>
-
 
 //=======================================================================
 //function : GetID
@@ -2295,19 +2295,28 @@ Standard_Integer GEOMImpl_PipeDriver::Execute(TFunction_Logbook& log) const
     aShape = CreatePipeShellsWithoutPath(aCI);
   }
 
+  if (aCI) delete aCI;
+
   if (aShape.IsNull()) return 0;
 
   BRepCheck_Analyzer ana (aShape, Standard_False);
   if (!ana.IsValid()) {
-    if(aCI) delete aCI;
-    Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
+    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("Algorithm have produced an invalid shape result");
   }
 
   TopoDS_Shape aRes = GEOMImpl_IShapesOperations::CompsolidToCompound(aShape);
   aFunction->SetValue(aRes);
 
   log.SetTouched(Label());
-  if(aCI) delete aCI;
   return 1;
 }