Different Ways of Creating an Edge with Topo and Geom Packages - Problem

Hi there, i have created an EDGE in 2 different ways from this array of Points:

TColgp_Array1OfPnt PList1(1,2);
PList1.SetValue(1,gp_Pnt (40,0,10));
PList1.SetValue(2,gp_Pnt (40,60,10));

1. Way one relies on TopoDS Package:
TopoDS_Edge edge1 = BRepBuilderAPI_MakeEdge(PList1(1), PList1(2));

2. Way two will make a BSpline first and then use Adaptor Package to get to the Spline:
GeomAPI_PointsToBSpline spline = GeomAPI_PointsToBSpline(PList1);
Handle(Geom_Curve) curve= spline.Curve();
TopoDS_Edge edge2 = BRepBuilderAPI_MakeEdge(curve);

It should be obvious, that edge1 should be == edge2.

Unfortunately, when i try to convert edge1 to Geom,it compiles just fine but an exeption raises when running it.
Edge2 can be reconverted to Geom without a problem.

Can someone explain the difference between the two construction methods?

thanks.

-dave

Alexander Luger's picture

Edge1 is not equal to Edge2. My guess is that 1. creates a straight line and 2. creates a line with minimal curvature (not visible to the naked eye). If you analyse the Geom_Curve behind both construction modes (have a look at the class BRepAdaptor_Curve -> GetType()), you will find out that 1. produces a Geom_Line and 2. produces a Geom_BSplineCurve, which are geometrically different.

Hope that helped.

Regards,
Alex

davidlauter's picture

thanks for the explenation