How to shrink 2D complex shapes in themselves?

155 Views Asked by At

Is there a robust method that can shrink 2D shapes in themselves like seen on the images? I am talking about more complex shapes than the ones on the image. Shapes that don't necessarily have such a clear segmentation (like an oval, and 2 squares).

enter image description here

One simple way would be to just run through all the points and add an offset in the direction of the normal, right? But, that would not exactly be the same, because you would have curves at the corners. At the corner, I would interpolate the normal on the left to the normal on the right.

So it would look something like this instead:

enter image description here

1

There are 1 best solutions below

0
On

Methods related to this problem: