BRepBuilderAPI_MakeEdge

Hi,

I tried to build an edge with below code.
gp_Pnt2d P1,P2,P3;
P1.SetCoord(0.,0.);
P2.SetCoord(0.,10.);
P3.SetCoord(20.,0.);
Handle(Geom2d_TrimmedCurve) aNewCurve = GCE2d_MakeArcOfCircle(P1,P2,P3).Value() ;
gp_Dir aDir;
gp_Pnt P4(0.,0.,0.);
aDir.SetCoord(1.,0.,0.);
gp_Pln Pln(P4,aDir);
Handle(Geom_Plane) aPln= new Geom_Plane(Pln);
BRepBuilderAPI_MakeEdge ME(aNewCurve,aPln);

I found this edge is not valid with BRepCheck_Analyzer, and could not to get the parameter with below methold.

double First,Last;
TopoDS_Edge anEdge=ME.Edge();
Handle(Geom_Curve) aCurve=BRep_Tool::Curve(anEdge,First,Last);

But I can build the edge with below code.
Handle(Geom_Curve) aCurve=GeomAPI::To3d(aNewCurve,Pln);
BRepBuilderAPI_MakeEdge ME1(aCurve);

What is the problem with the first methold?

Thanks.

DU's picture

Hi,
You can try to the method:

TopoDS_Edge anEdge=ME.Edge();
BRepLib::BuildCurve3d(anEdge, adTolerance);

regards,

Du

Liu Ailin's picture

Dear Du,

I had tried BuildCurve3d(). It made no difference.

Thanks.