top of page

QUILTING

Responsible for coding script.

Python.png

This program creates a quilt of a floral pattern using the modulus operator to arrange it.

W22_V705_E1_ChavezTrochezMonica.JPG

The main module creates a custom sized quilt with five different flower patterns using Turtle for Python. Each flower is created on a separate file by calling functions from another file where geometric shapes are created and looped for each component, such as drawing circles, ovals or custom shapes, they are placed radially using trigonometric identities. All of the components are adjustable depending on the needed use for each flower by assigning parameters within the function, like the size, radius, color, etc.

 

Each flower file follows the same structure, first the colors are assigned in variables and then, within a new function, the flower is created by calling the necessary functions from the file where the components are drawn and using them in the right order and with the right values on their parameters.

 

Lastly on the main module, there are three functions. The first one collects the number of rows and columns the user defines, then it checks if the numbers are within the suggested range and if the are not, it asks for them again. The second function adjusts the window depending on the number of columns and rows, having a limit for the maximum width and height. and creates the quilt using the modulo operator to define which pattern belongs on each tile. Finally, there is the main function where the latest functions are called, a border is set and the speed of the turtle is changed.

bottom of page