From: gka Date: Thu, 18 May 2006 14:52:39 +0000 (+0000) Subject: Debug of thru sections. Added workaround for thru sections on arcs X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=33e36193c9dd075b7b151d3409339cdd1edd8eb3;p=modules%2Fgeom.git Debug of thru sections. Added workaround for thru sections on arcs --- diff --git a/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx b/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx index 1a2fe76bd..f27b16919 100644 --- a/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx @@ -42,7 +42,9 @@ #include #include #include - +#include +#include +#include //======================================================================= //function : GetID //purpose : @@ -85,7 +87,9 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co if(!aNbSections ) return 0; - BRepOffsetAPI_ThruSections aBuilder(isSolid,aType == THRUSECTIONS_RULED,aPreci); + BRepOffsetAPI_ThruSections aBuilder(isSolid,aType ==THRUSECTIONS_RULED,aPreci); + + aBuilder.CheckCompatibility(Standard_False); //added sections for building surface Standard_Integer i =1; @@ -103,9 +107,8 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co TopoDS_Shape aShapeSection = aSection->GetValue(); TopAbs_ShapeEnum aTypeSect = aShapeSection.ShapeType(); if(aTypeSect == TopAbs_WIRE) - { aBuilder.AddWire(TopoDS::Wire(aShapeSection)); - } + else if(aTypeSect == TopAbs_EDGE) { TopoDS_Edge anEdge = TopoDS::Edge(aShapeSection); TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge); @@ -120,20 +123,28 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co } if(!nbAdded) Standard_TypeMismatch::Raise("ThruSections aborted : invalid types of sections"); - //make surface by sections aBuilder.Build(); TopoDS_Shape aShape = aBuilder.Shape(); - if (aShape.IsNull()) { - return 0; + return 0; } BRepCheck_Analyzer ana (aShape, Standard_False); if (!ana.IsValid()) { - Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result"); + //algoritm thru section creats on the arcs invalid shapes gka + 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"); } + aFunction->SetValue(aShape); log.SetTouched(Label());