Just a joke - reminder about my school days when I drew such cosine curves in polar coordinates with pencil and compass.
Update: I added a script to make a bulb over generic rhodonea curve. This is controlled by ratio of N and D variables (and gives the same results as the two earlier scripts with specific values). The related formulae and pattern samples could be found in https://en.wikipedia.org/wiki/Rose_%28mathematics%29
Update 12/27: add twist parameter to get twisted thing - compare rose2 against rose_gen.