This is a small tool that can fit a polygon onto arbitrary contours.
It is not an easy problem to solve cause the number of polygon corners usually cannot be estimated objectively. Some parts of the contour may form a sharper corner, others may be too shallow to be labeled as such. We can only guess which parts are "good enough" to form a corner.
More information here.
Copyright 2016 Łukasz Nocuń