How to find closest point on collision shape with a point and a direction

I need find a point on any collsion shape that is cloest to another point along with a given direction. like this ↓