Questions about BRepAdaptor_Curve usage

Hi all,
I am building my own hobby geometric modeller (with its own C++ data structure representations) and wish to use OpenCascade 7.4.0 API's to perform booleans (and probably fillets/blends in the future). So I convert my classes to equivalent OCC classes, invoke the Boolean api, and then
need to convert resultant Topology/Geometry representation of Opencascade into my own datastructures.
Specifically - I am using BRepAdaptor_Curve class to get underlying geometry curve of the TopoDS_Edge (this is while 'walking through' the topology of the resultant cut body).
Have following questions:-
a) I noticed that BRepAdaptor returns gp_Elips/gp_Circ (if the underlying geometry is indeed elliptic/circular in nature) - but gp_Elips/gp_Circ seems to represent only full ellipse/full circle (this is understanding i get from the documentation).
What if the resultant edge was an elliptic arc or circular arc ? How do I come to know that - Am I supposed to use IsClosed() method (and if false, meaning its an open arc) - then to convert resultant arc into ellipse/circle arc using GC_MakeArcOfEllipse/GC_MakeArcOfCircle constructors?

b) I iterate through the TopoDS_Edges of all the face (in order) using BRepTools_WireExplorer.
So when I use BRepAdaptorCurve to get the geometry of TopoDS_Edge (which is the edge of some face) - then which form of the adapter constructor to use? BRep_AdaptorCurve(TopoDS_Edge& ) or BRep_AdaptorCurve(TopoDS&, Face&)?

Any clarification on the above would be appreciated.

Regards,
Sanjeev.

Dmitrii Pasukhin's picture

Hello. My apologies for spam filter, sometimes it not so friendly. But the moderator needs some time to approve your post. Please don't worry about that.

a) As for a BRepAdaptor_Curve. You have a FirstParameter and LastParameter. Which you can project on curve and extracy start and end points. Any curves on OCC can be trimmered by topology as a StartVertex and EndVertex or by geometry as a Geom_TrimmeredCurve with UV limitation(FirstParameter and LastParameter). OCC has no pure CircleArc type.

b) Depends on your needs, the most common and fast way to extract just geometry is "BRep_Tool::Curve" that gives you last and end parameter. BRep_AdaptorCurve(Edge&, Face&) extract curve on surface.

Best regards, Dmitrii.