Spirograph is the name given to a drawing tool that makes “mathematical roulette curves” known as hypotrochoids.
In this lesson, you will learn how to use Python Turtle* to create a digital Spirograph, which will generate a Spirograph design, and convert that drawing into an edible pancake!
The lesson will provide the base code for the major elements of working with the Python Turtle library as well as the coordinate conversion to G-Code. Students will learn how to represent different curves and approximate them with short line segments and changes in the heading of the Turtle drawing tool.
*Turtle graphics is a popular way for introducing programming to kids. It was part of the original Logo programming language developed by Wally Feurzig and Seymour Papert in 1966.
For more information visit. https://docs.python.org/3/library/turtle.html#turtle.screensize
SAFETY FIRST
When operating the PancakeBot, there are few precautions one must take.
You will start off the lesson by running a Python Program that draws a spiral and exports the coordinates of the lines to G-Code. You will then print the pancake from the G-Code file.
Run the Python Program named OneSpiral.py. Watch and observe how the turtle draws out the spiral pancake. When the turtle is complete with drawing the pancake, save the GCODE file and copy it to your SD card for printing to the PancakeBot.
The colors of the path the turtle takes corresponds with the rest of the guide.
This will be the resulting pancake from the code.
A Spirograph creates elaborate spirals by using different shapes that spin in or around each other. Although there is a lot of geometry and mathematical calculations that can be used to achieve the desired spiral, we can use short straight lines drawn in Python Turtle to approximate those spirals with a few lines of code. One of the ways to do this is to hand draw your own spirograph and observe the critical movements needed to generate the design. You will hand draw or trace the curves created by the petals of a daisy and track the steps involved to make those curves.
Figure 1: A daisy flower detailing the different types of petals, or florets, of the flower.
Figure 2: Traced curve 1 over floret. With first Δ1 angle turn.
Figure 2: Traced curve 2 over floret with Δ2 angle turn.