Get open circle info

I have the following intersection (see picture): 3 lines and 1 arc (open circle) define the surface.

While looping through the edges of the intersection (using BRepTools_WireExplorer) I get the Geom_Curve using BRep_Tool::Curve(theEdge). The region of interest, the arc, is marked blue in the picture. Using Geom_Curve::DynamicType you get that the arc is of the type 'Geom_Circle'. I can get all the information of the full circle as well as the starting and ending points (marked with blue crosses in the picture), however the 'circle' of interest, being the open arc, only follows a part of the circle.

What I need to know is a point on the circle that is part of the arc (so that is between starting and ending point and is on the circle) OR the direction you go from starting point to ending point on the circle (so ClockWise direction or CounterClockwise direction).

Remarks:

Geom_Curve::FirstParameter and Geom_Curve::LastParameter give 0 and Pi respectively (which makes sense for a circle). Using Geom_Curve::Value won't work (e.g. parameter 0 can lay on the full closed circle but not on the arc (open circle).

gp_Circle::Position::Direction won't work either. 

Any ideas?

Attachments: 
Kirill Gavrilov's picture

Parametric range might be encoded in two places - in curve itself (Geom_Curve::FirstParameter()/::LastParameter()) and at topology level. On geometry level trimming is normally done via Geom_TrimmedCurve, which is a curve referencing to another curve with another parametric range.

In your case, however, you get Geom_Circle, and not Geom_TrimmedCurve - so I guess that your arc is encoded at topology level. Check the values returned by method BRep_Tool::Curve() - First and Last should be filled with the trimmed range (notice that these are output values, not input!):

const Handle(Geom_Curve)& Curve (const TopoDS_Edge& E, TopLoc_Location& L, Standard_Real& First, Standard_Real& Last);
Thieme Vandeput's picture

You were right the parametric range was defined at topology level, BRep_Tool::Range(TopoDS_Edge) did the trick!

Thanks!