#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopExp_Explorer.hxx>
+#include <ShapeUpgrade_UnifySameDomain.hxx>
/**
* GEOMImpl_Fillet1dPoint is an internal class for 1D fillet algorithm
TopExp::Vertices(myProfile, myLeftVertex, myRightVertex);
gp_Pnt LeftPoint = BRep_Tool::Pnt(myLeftVertex);
gp_Pnt RightPoint = BRep_Tool::Pnt(myRightVertex);
- myFilletRadius = (LeftPoint.Distance(RightPoint))/2.;
+ myFilletRadius = (LeftPoint.Distance(RightPoint))/2. * 1.5;
myTolAngular = 0.01;
MakeSharpVertexList();
if (!mySharpVertexList.IsEmpty())
MakeFillet();
+ else
+ myGuideline = myOriginalGuideline;
ProjectWireOntoXOY(myGuideline, myProjectedGuideline);
Make2dProfile();
mySweep3d = new BRepOffsetAPI_MakePipeShell(myGuideline);
mySweep3d->SetMode(gp::DZ()); //optional
mySweep3d->Add(myTransformedProfile3d);
- //mySweep3d->SetTransitionMode(BRepBuilderAPI_RightCorner); //optional
+ //Set approx parameters
+ mySweep3d->SetMaxDegree(14);
+ mySweep3d->SetMaxSegments(500);
+ ///////////////////////
mySweep3d->Build();
if (!mySweep3d->IsDone())
return Standard_False;
mySweep2d = new BRepOffsetAPI_MakePipeShell(myProjectedGuideline);
mySweep2d->SetMode(gp::DZ()); //optional
mySweep2d->Add(myTransformedProfile2d);
- //mySweep2d->SetTransitionMode(BRepBuilderAPI_RightCorner); //optional
+ //Set approx parameters
+ mySweep2d->SetMaxDegree(14);
+ mySweep2d->SetMaxSegments(500);
+ ///////////////////////
mySweep2d->Build();
if (!mySweep2d->IsDone())
return Standard_False;
myPipe2d = mySweep2d->Shape();
- myInlet = TopoDS::Wire(mySweep2d->FirstShape());
- myOutlet = TopoDS::Wire(mySweep2d->LastShape());
+ myUnifier.Initialize(myPipe2d);
+ myUnifier.Build();
+ myUnifiedPipe2d = myUnifier.Shape();
+
+ TopoDS_Wire OriginalInlet = TopoDS::Wire(mySweep2d->FirstShape());
+ TopoDS_Wire OriginalOutlet = TopoDS::Wire(mySweep2d->LastShape());
+ myInlet = CreateWireOnUnifiedPipe2d(OriginalInlet);
+ myOutlet = CreateWireOnUnifiedPipe2d(OriginalOutlet);
TopoDS_Vertex V1, V2, V3, V4;
TopExp::Vertices(myTransformedProfile2d, V1, V2);
- TopExp::Vertices(myInlet, V3, V4);
+ TopExp::Vertices(OriginalInlet, V3, V4);
gp_Pnt P1 = BRep_Tool::Pnt(V1);
gp_Pnt P3 = BRep_Tool::Pnt(V3);
if (P1.IsEqual(P3, Precision::Confusion()))
MW.Add(GeneratedShapes);
aBank = MW.Wire();
- return aBank;
+ TopoDS_Wire aBankOnUnifiedPipe2d = CreateWireOnUnifiedPipe2d(aBank);
+
+ return aBankOnUnifiedPipe2d;
+}
+
+TopoDS_Wire HYDROData_Canal3dAnd2d::CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d)
+{
+ BRepLib_MakeWire MW;
+ BRepTools_WireExplorer wexp(aWireOnPipe2d);
+ for (; wexp.More(); wexp.Next())
+ {
+ TopoDS_Shape anEdge = wexp.Current();
+ TopoDS_Shape NewEdge = myUnifier.Generated(anEdge);
+ if (!NewEdge.IsNull())
+ MW.Add(TopoDS::Edge(NewEdge));
+ }
+ return MW.Wire();
}
TopoDS_Shape HYDROData_Canal3dAnd2d::Get3dPresentation()
return myPipe3d;
}
-TopoDS_Shape HYDROData_Canal3dAnd2d::Get2dPresentation()
+TopoDS_Face HYDROData_Canal3dAnd2d::Get2dPresentation()
{
- return myPipe2d;
+ TopoDS_Iterator iter(myUnifiedPipe2d);
+ return TopoDS::Face(iter.Value());
}
TopoDS_Wire HYDROData_Canal3dAnd2d::GetInlet()
{
return myProjectedGuideline;
}
-*/
\ No newline at end of file
+*/