add polygon approximation function to Contour class and integrate it into the example