0

Imagine you have a polygon that has no holes and is not self intersecting. It is not necessarily convex.

My goal is to create another polygon that is "smaller", but not just scaled down. For each point on the original polygon, I want to create a new point that is "closer to the inside". It would be the equivalent of taking an arbitrary shape, and giving it "thickness", if that makes any sense.

Unfortunately I don't know the name of what this operation is, but I'm assuming it's quite common.

My target language is python, so perhaps GPC:

http://www.cs.man.ac.uk/~toby/alan/software/

or Shapely:

https://shapely.readthedocs.io/en/stable/manual.html

has an algorithm that can do this.

I just don't know the name of the operation.

cat pants
  • 1,485
  • 4
  • 13
  • 22
  • 2
    [Same problem, non-Python solution](https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons) – meowgoesthedog Apr 25 '19 at 08:10
  • 2
    In morphology it is called erosion https://en.wikipedia.org/wiki/Erosion_(morphology) – Lee Apr 25 '19 at 08:16
  • 1
    Morphological erosion maybe https://homepages.inf.ed.ac.uk/rbf/HIPR2/erode.htm – Mark Setchell Apr 25 '19 at 08:19
  • 4
    This is called *offsetting*. This operation is difficult to implement, and can cause a polygon to split in several independent parts. –  Apr 25 '19 at 09:29
  • see [How can I create an internal spiral for a polygon?](https://stackoverflow.com/a/31013424/2521214) and both sublinks in there... therms for googlings are **polygon offsetting** but beware that one is also used for depth offseting to resolve Z fitings which is not what you want. Safer is to search for **stroke line** as that one deals with rendering polylines/polygons with stroke with defined line width ... the internal stroke line is what you want. The morphological erosion operation is only for raster images not a vector operation... – Spektre Apr 26 '19 at 05:32

0 Answers0