# ShapeAnalysis_curve not respecting boundaries when periodic

Hi,
I am trying to project a point on a curve. If the curve is periodic, even using the bounds, will not enforce the right result.
Even the returned parameter is outside the range.
The code looks like this:

Handle(Geom_Curve) a_curve;
TopLoc_Location loc;
Standard_Real first_point = 0;
Standard_Real last_point = 0;
a_curve = BRep_Tool::Curve(TopoDS::Edge(an_edge), loc, first_point, last_point);
Standard_Real dist = ShapeAnalysis_Curve().Project(a_curve, a_pnt,tolerance, new_pnt, param, first_point, last_point, false);

My understanding is, that param should fall between first_point and last_point. This is not always the case if the edge is periodic.
If the edge is an arc of a circle, let's say from 0 to PI. So, if the point is at 3/2PI the projection will be at 3/2PI and dist < 1e-7.
Clearly outside the range [0,PI].
Param is sometimes negative or positive, the calculated distance, however, is always smaller than it should.
When projecting from 3/2PI I would expect 2R as the projection distance. It is however < 1e-7.

Is there a way of using the real 3D location of the arc to check this? I could use param for this, but then, there is another problem...

The point can sometimes be slightly outside the param range due to a lower tolerance in the geometry, but not necessarily one period away. So, -0.001 can either be a point at PI-0.001 or a point at -0.001 (actually at 0.0, but with a bad tolerance). If the edge were in 3D it would be easy to distinguish both cases. With the parameter, however, both will have the same value of -0.001. Is there a way of knowing, If I have the edge information, which case I am dealing with (period or bad tolerance?)