Project point on Curve


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?

Best Regards,

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);
CurveIntersections x = Intersection.CurveCurve(c, l.ToNurbsCurve(), tolerance, tolerance);