Question about Edge orientation

Hello,

I have build an Edge and I have tried to reverse it but the only thing that changes is the orientation flag.

TopoDS_Edge aEdge = BRepBuilderAPI_MakeEdge(gp_Pnt(0.,0.,0.),gp_Pnt(100 ,0.,0.));
BRepAdaptor_Curve ac1(aEdge);
double a=ac1.Line().Angle(gp_Lin(gp::OX())); -->angle = 0
double Umin = ac1.FirstParameter(); --> from 0
double Umax = ac1.LastParameter(); --> to 100
gp_Pnt coordI = ac1.Value(Umin); --> 0,0,0
gp_Pnt coordF = ac1.Value(Umax); --> 100,0,0

aEdge.Reverse(); --> I reverse the edge
BRepAdaptor_Curve ac2(aEdge);
double a1=ac2.Line().Angle(gp_Lin(gp::OX())); --> angle 0
double Umin1 = ac2.FirstParameter(); --> from 0
double Umax1 = ac2.LastParameter(); --> to 100
gp_Pnt coordI1 = ac2.Value(Umin); --> 0,0,0
gp_Pnt coordF1 = ac2.Value(Umax); --> 100,00,0

Is there any method to reverse the underlying geometry of the line ?

Ashish's picture

You could get Handle(Geom_Curve) for given TopoDS_Edge object using BRep_Tool.
Then use Geom_Curve::Reverse() method of Geom_Curve. This will make you original start point as end point of curve. Hope this answers your question.

Fabian Hachenberg's picture

You can create a reversed version of the underlying curve using the Reversed()-Method of Geom_Curve/Geom2d_Curve. If you want to recreate your edge on basis of that geometry, you will have to transform your edge's interval as well: Use the ReversedParameter-Method for that purpose.