Convex hull algorithms are well known. However, in my case, the goal is slightly modified:
Given $N$ points in a plane, construct convex polygon with minimal area so that it contains all points, and there is no point that is closer than given distance $d$ from polygon edges, and number of vertices of such polygon is the same as number of vertices of the convex hull of given points.
In other words, given $N$ sheep:

... find the fence:

(Sheep can be considered points, but $d$ is still greater than $0$.)