Projection of point on line

Can anyone point me at a way of finding the location of a point projected onto a line?

something like

gp_Pnt gp_Lin::Projection(gp_Pnt) ?

Thanks

Benedicte Martin's picture

hi,
perhaps, i've got a solution for you.
you can use BRepExtrema_DistShapeShape or BRepExtrema_ExtPC. But you must convert your point on Vertex and your line on Edge.

benedicte

Stephane Routelous's picture

Hi,

If your point don't belong on the curve, you can use GeomAPI_ProjectPointOnCurve to have the closest point.

If you are sure that the point is on the curve, you can use ElCLib to have its parameter.

HTH,

Stephane
http://www.exotk.org