top of page

QUILTING OF LIFE

Software: Python Turtle

Personal coding project, responsible for all.

Purpose of Project: produce a quilt in turtle graphics and python, ask users to customize the size, rows, and columns of the quilt. The quilt will consist of five blocks, each with its own theme. (figure 0.0)

.png

Figure 0.0 Full pattern of quilt

Theme of Patterns

Five patterns designed for the quilt are based on my personality, all of these five patterns are symbols of my life. So I name the work 'Quilting of Life'. Click pictures below to see their full definitions.

Quilting

STEP1: Starting with Position

Now, I got five patterns. The next step is to let each quilt patterns appear in a cyclic movement. The basic idea is:

  • Get a starting position (xstart, ystart)

  • Using nest looping, draw squares of five pattern background (this is also a test to see whether the cyclic works in a proper way)

  • Put patterns above corresponding squares.

The cyclic movement is a table of 5 *7 (rows = 5, columns = 7) as the figure.1.0 shows below, the starting position is calculated as:

  • xstart =  - width / 2 + boarder / 2 - blocksize ( turtle drawing start at the left lower corner of a square)

  • ystart =  - width / 2 + boarder / 2

Anchor 1
pngtree-hand-drawn-cute-cartoon-christmas-snowman-png-image_2374352-09.png
pngtree-hand-drawn-cute-cartoon-christmas-snowman-png-image_2374352-10.png

Figure 1.0 Cyclic quilt

Figure 2.0 Nest loop

STEP 2: Nest Loop

Define a drawSquare function

Define a drawQuilt function

  • Use nest loop

  • Set a variable num = i + j (sum total loop as the figure 2.0 shows above)

  • Use if statement and “remainder operator" % to get the cyclic result

  • ypos = ystart + i * blockszie

  • xpos = xstart + i *blocksize

STEP 3: Import Patterns

Use import filename from * to import five patterns functions and drawSquare function as modules

  • Import drawSquare function before other patterns ( Figure 3.0)

  • call each of the functions below if statement under drawQuilt function ( Figure 4.0)

image (7).png

Figure 3.0 Import pattern files as modules

image (8).png

Figure 4.0 Call pattern functions

STEP 4: Customize

Let the user type in a series of numbers, then the program will decide how to arrange these patterns and draw them in an appropriate position. ( Figure 5.0)

  • Size of Quilt

  • Number of rows

  • Number of columns

1.png

Figure 5.0 Let users to input size, rows and columns

Code of Quilt

Drawing Process

Anchor 2

Breakdown PDF

Author: Yachan Yuan

Date: 08/4/2022

© 2023 by Yachan. Proudly created with Wix.com

bottom of page