I'm sure this is very basic, but I haven't found a solution yet. I have a TopoDS_Edge that was created using the BRepBuilderAPI_MakeEdge2d function. I would like to turn the TopoDS_Edge into a Geom2d_Curve. I noticed that this is straightforward in 3d: a TopoDS_Edge can be converted to a Geom_Curve. However, in 2d, the following code leads to a segmentation fault:
TopoDS_Edge myEdge = BRepBuilderAPI_MakeEdge2d( ... );
Standard_Real first, last;
C = BRep_Tool::CurveOnSurface(myEdge, surface, location, first, last);
Is there a simple conversion that I'm totally missing?