mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-05-28 00:57:50 +05:00
Debug of thru sections. Added workaround for thru sections on arcs
This commit is contained in:
parent
277688e40f
commit
33e36193c9
@ -42,7 +42,9 @@
|
|||||||
#include <Standard_NullObject.hxx>
|
#include <Standard_NullObject.hxx>
|
||||||
#include <Standard_TypeMismatch.hxx>
|
#include <Standard_TypeMismatch.hxx>
|
||||||
#include <Standard_ConstructionError.hxx>
|
#include <Standard_ConstructionError.hxx>
|
||||||
|
#include <ShapeFix_Shape.hxx>
|
||||||
|
#include <ShapeFix_ShapeTolerance.hxx>
|
||||||
|
#include <Precision.hxx>
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : GetID
|
//function : GetID
|
||||||
//purpose :
|
//purpose :
|
||||||
@ -85,7 +87,9 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co
|
|||||||
if(!aNbSections )
|
if(!aNbSections )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
BRepOffsetAPI_ThruSections aBuilder(isSolid,aType == THRUSECTIONS_RULED,aPreci);
|
BRepOffsetAPI_ThruSections aBuilder(isSolid,aType ==THRUSECTIONS_RULED,aPreci);
|
||||||
|
|
||||||
|
|
||||||
aBuilder.CheckCompatibility(Standard_False);
|
aBuilder.CheckCompatibility(Standard_False);
|
||||||
//added sections for building surface
|
//added sections for building surface
|
||||||
Standard_Integer i =1;
|
Standard_Integer i =1;
|
||||||
@ -103,9 +107,8 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co
|
|||||||
TopoDS_Shape aShapeSection = aSection->GetValue();
|
TopoDS_Shape aShapeSection = aSection->GetValue();
|
||||||
TopAbs_ShapeEnum aTypeSect = aShapeSection.ShapeType();
|
TopAbs_ShapeEnum aTypeSect = aShapeSection.ShapeType();
|
||||||
if(aTypeSect == TopAbs_WIRE)
|
if(aTypeSect == TopAbs_WIRE)
|
||||||
{
|
|
||||||
aBuilder.AddWire(TopoDS::Wire(aShapeSection));
|
aBuilder.AddWire(TopoDS::Wire(aShapeSection));
|
||||||
}
|
|
||||||
else if(aTypeSect == TopAbs_EDGE) {
|
else if(aTypeSect == TopAbs_EDGE) {
|
||||||
TopoDS_Edge anEdge = TopoDS::Edge(aShapeSection);
|
TopoDS_Edge anEdge = TopoDS::Edge(aShapeSection);
|
||||||
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge);
|
TopoDS_Wire aWire = BRepBuilderAPI_MakeWire(anEdge);
|
||||||
@ -120,20 +123,28 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co
|
|||||||
}
|
}
|
||||||
if(!nbAdded)
|
if(!nbAdded)
|
||||||
Standard_TypeMismatch::Raise("ThruSections aborted : invalid types of sections");
|
Standard_TypeMismatch::Raise("ThruSections aborted : invalid types of sections");
|
||||||
|
|
||||||
//make surface by sections
|
//make surface by sections
|
||||||
aBuilder.Build();
|
aBuilder.Build();
|
||||||
TopoDS_Shape aShape = aBuilder.Shape();
|
TopoDS_Shape aShape = aBuilder.Shape();
|
||||||
|
|
||||||
if (aShape.IsNull()) {
|
if (aShape.IsNull()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
BRepCheck_Analyzer ana (aShape, Standard_False);
|
BRepCheck_Analyzer ana (aShape, Standard_False);
|
||||||
if (!ana.IsValid()) {
|
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);
|
aFunction->SetValue(aShape);
|
||||||
|
|
||||||
log.SetTouched(Label());
|
log.SetTouched(Label());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user