updated to apply a pattern to the polygon