Given a list of polygons that are guaranteed to be not intersecting each other (and also guaranteed to not be self-intersecting), I would like to write an algorithm (or use a library) that generates an outward polygon offset "where possible" with the following characteristics:
The picture below should give an idea of what I am looking for.
The picture is not accurate.
I do not think the term "fairly" is correct and there might be multiple strategies.
Ideally I would like to apply a strategy that is close to the one in the picture.
I found different questions on how to offset polygons (e.g. An algorithm for inflating/deflating (offsetting, buffering) polygons). But I cannot find anything around offsetting multiple polygons at the same time.
Your proposed rules:
Under these rules, a few weird things happen:
Nevertheless, the way to accomplish this is to find the "segment Voronoi diagram" of the shapes (its set of boundaries is also known as the "medial axis"), and find the intersection of each shape's boundaries with that shape's inflated version. CGAL or a similar geometry library should be able to do this straightforwardly.
You haven't talked about your use case, so it's not clear what your actual needs are, but in this situation I would use "dilation" (aka "buffering"), not boundary offsetting, so that the rules and computation would be simpler (basically just a Voronoi diagram with truncated distances) and acute corners wouldn't give me so much grief. The resultant shapes would have circular arcs corresponding to original vertices.
Incidentally, you'll find the most interest in this sort of problem in the GIS community.