Project point on Curve

Hi,

How to project a point onto a curve? I know the following website talk about project point on Brep.

But we must appoint the projection vector, I hope it could automatically project on normal direction for the curve. And how to do?

http://developer.rhino3d.com/samples/rhinocommon/project_points_to_breps/

Best Regards,
Jerry

The point and the projection vector define a line. Use the Intersections.CurveCurve function as follows:

Curve crv; // defined elsewhere
Point3d point; // defined elsewhere
Vector3d direction; // projection direction, defined elsewhere
Line l = new Line(point, direction);
l.ExtendThroughBox(c.GetBoundingBox(true));
CurveIntersections x = Intersection.CurveCurve(c, l.ToNurbsCurve(), tolerance, tolerance);