I need to buffer a polygon with a different distance in the x and y directions. I should add that my polygon has the following properties:
- closed (obviously)
- simple (no edge crossing, no more than 2 edges at any given vertex)
- potentially concave
- may or may not have hole(s) that may or may not be concave (this being said, 90% of the time there won't be any hole so I'm OK to leave this out)
I understand the buffer of a polygon is basically the Minkowski sum of that polygon and a circle of radius r (r = buffer distance), so I thought my problem may just be computing the Minkowski sum of a polygon with an ellipse.
I have read a lot on the subject of Minkowski sum here, here and there and found some algorithms easy enough to implement in Python (see below) but these are usually for convex polygons which is not my case.
I even set out to decipher CGAL's Minkowski_sum_by_reduced_convolution code but it is way too cryptic for me (I am not familiar with C).
Can you point me to a
Python version or anything actually readable (pseudo-code included) of the above or similar algorithm?
For reference only (this is not what I'm trying to implement):