if(aProfileWire.IsNull())
return;
- //BRepTools::Write( aPathWire, "guideline.brep" );
- //BRepTools::Write( aProfileWire, "profile.brep" );
HYDROData_Canal3dAnd2d aChannelConstructor( aProfileWire, aPathWire );
aChannelConstructor.Create3dPresentation();
SetShape3D( aChannelConstructor.Get3dPresentation() );
SetTopShape( aChannelConstructor.Get2dPresentation() );
- //BRepTools::Write( aPathWire, "guideline.brep" );
- //BRepTools::Write( aProfileWire, "profile.brep" );
- //BRepTools::Write( aChannelConstructor.Get2dPresentation(), "channel2d.brep" );
- //BRepTools::Write( aChannelConstructor.Get3dPresentation(), "channel3d.brep" );
+ BRepTools::Write( aPathWire, "guideline.brep" );
+ BRepTools::Write( aProfileWire, "profile.brep" );
+ BRepTools::Write( aChannelConstructor.Get2dPresentation(), "channel2d.brep" );
+ BRepTools::Write( aChannelConstructor.Get3dPresentation(), "channel3d.brep" );
+
+ TopAbs_ShapeEnum aType = GetTopShape().ShapeType();
// Create groups for channel
TopoDS_Wire aLeftBank = aChannelConstructor.GetLeftBank();
#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();
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 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
+*/
const TopoDS_Wire& aGuideline,
const gp_Pnt& aMiddlePoint);
+ TopoDS_Wire CreateWireOnUnifiedPipe2d(const TopoDS_Wire& aWireOnPipe2d);
+
TopoDS_Wire GetBank(const TopoDS_Vertex& aFreeVertex);
//Queries
TopoDS_Shape Get3dPresentation();
- TopoDS_Shape Get2dPresentation();
+ TopoDS_Face Get2dPresentation();
TopoDS_Wire GetLeftBank();
TopoDS_Wire GetRightBank();
TopoDS_Wire GetInlet();
TopoDS_Shape myPipe3d;
TopoDS_Shape myPipe2d;
+ TopoDS_Shape myUnifiedPipe2d;
+ ShapeUpgrade_UnifySameDomain myUnifier;
TopoDS_Wire myInlet;
TopoDS_Wire myOutlet;
//TopoDS_Shape myLeftBank;