I am tackling IMO very hard problem from geometry "How to find closest point out of collision".
To explain it better I've drawn an image explaining it. Basically: given a point on 2D plane( yellow dot) I want to find closest point( blue one ) on plane not affected by collision( green part ) objects( orange ones ).

Is there any smart way of finding this point?
If the orange stuff is made out of seimple shapes as here (polygons and circles), there are only a few candidates for the point you are looking for: Either the blue point is an intersection of two boundary lines, or it is a concave vertex of a nonconvex polygon, or it is the orthogonal projection onto a polygon edge, or it is the intersection of a cricle with the line through th eyellow point and the circle center. You need only test these finitely many points if they are valid (i.e. not covered by another shape) and pick the closest one.