added a new stroke->polygon conversion function