generated from mwc/project_drawing
time I started by attempting to incorporate animation. I worked with this process for a long time and ultimately realized that it was further confusing me and how to integrate iterations into the code. Once again I put myself in the shoes of a student and tried to take a step back. I recognized that this was making me frustrated and the process that was previously exciting and where I could see the information synthesizing was becoming murkey and I was losing the origional concept entirely. I thought about if I was a teacher to this student what would I do? I would tell that student to evaluate what the core concepts of this project were and what I needed to know and master in order to continue learning. So, I decided to go back. Instead of trying to incorporate animation, I went back through the code I had already written and looked for opportunities to revies and integrate iteration instead of having repitetitive code. There were a few different places that needed to be adjusted and that was difficult at times, but I was able to complete them all! This was a really big win for me in a process that has not been easy. For the future, I want to incorporate a different planning strategy that will be a little less create and play and a little more step by step.
236 lines
3.0 KiB
Python
236 lines
3.0 KiB
Python
# drawing.py
|
|
# ----------
|
|
# By ____(you)___________
|
|
#
|
|
# (Briefly describe what this program does.)
|
|
|
|
from turtle import *
|
|
penup()
|
|
right(180)
|
|
forward(200)
|
|
pendown()
|
|
def rectangle(width,height):
|
|
for _ in range(2):
|
|
forward(width)
|
|
left(90)
|
|
forward(height)
|
|
left(90)
|
|
|
|
def book_decal_triangle(side_length):
|
|
forward(side_length)
|
|
right(120)
|
|
forward(side_length)
|
|
right(120)
|
|
forward(side_length)
|
|
right(120)
|
|
|
|
def book_decal_rectangle(height,width):
|
|
for _ in range(2):
|
|
forward(width)
|
|
left(90)
|
|
forward(height)
|
|
left(90)
|
|
|
|
def half_arc_left(radius):
|
|
circle(radius, 180)
|
|
|
|
def half_arc_right(radius):
|
|
circle(-radius, 180)
|
|
|
|
def square(side_length):
|
|
for _ in range(4):
|
|
forward(side_length)
|
|
right(90)
|
|
|
|
|
|
rectangle(20,100)
|
|
left(180)
|
|
forward(20)
|
|
right(90)
|
|
forward(100)
|
|
right(180)
|
|
forward(200)
|
|
right(90)
|
|
forward(40)
|
|
right(90)
|
|
forward(200)
|
|
right(180)
|
|
forward(215)
|
|
right(90)
|
|
forward(100)
|
|
right(90)
|
|
forward(215)
|
|
right(180)
|
|
"all above after large book, and turned around"
|
|
rectangle(20,100)
|
|
"above is bottom decoration on large book"
|
|
forward(150)
|
|
right(90)
|
|
forward(75)
|
|
right(90)
|
|
"below standard book"
|
|
forward(150)
|
|
right(180)
|
|
forward(150)
|
|
right(90)
|
|
forward(76)
|
|
right(90)
|
|
forward(150)
|
|
right(180)
|
|
forward(200)
|
|
right(90)
|
|
forward(76)
|
|
right(90)
|
|
forward(200)
|
|
right(90)
|
|
forward(500)
|
|
"below starts the wooden shelf below"
|
|
left(90)
|
|
forward(50)
|
|
left(90)
|
|
forward(600)
|
|
left(90)
|
|
forward(50)
|
|
left(90)
|
|
forward(100)
|
|
|
|
forward(45)
|
|
penup()
|
|
right(90)
|
|
forward(70)
|
|
pendown()
|
|
|
|
for _ in range(4):
|
|
book_decal_triangle(20)
|
|
penup()
|
|
forward(30)
|
|
pendown()
|
|
|
|
left(90)
|
|
penup()
|
|
forward(90)
|
|
left(90)
|
|
forward(90)
|
|
|
|
"Above is final book decorations"
|
|
|
|
pendown()
|
|
book_decal_rectangle(20,55)
|
|
left(90)
|
|
penup()
|
|
forward(20)
|
|
pendown()
|
|
right(90)
|
|
book_decal_rectangle(20,55)
|
|
"Above are matching rectangles on book 6"
|
|
penup()
|
|
forward(65)
|
|
right(90)
|
|
forward(75)
|
|
pendown()
|
|
|
|
for _ in range(6):
|
|
book_decal_triangle(10)
|
|
right(60)
|
|
|
|
left(60)
|
|
penup()
|
|
forward(60)
|
|
right(60)
|
|
"Above is design on book 5"
|
|
forward(60)
|
|
right(90)
|
|
forward(100)
|
|
pendown()
|
|
book_decal_rectangle(10,110)
|
|
left(90)
|
|
penup()
|
|
forward(65)
|
|
pendown()
|
|
|
|
circle(10)
|
|
right(90)
|
|
penup()
|
|
right(180)
|
|
forward(110)
|
|
pendown()
|
|
|
|
circle(10)
|
|
right(90)
|
|
penup()
|
|
forward(5)
|
|
right(90)
|
|
forward(8)
|
|
left(90)
|
|
pendown()
|
|
|
|
"Below creates wood eye"
|
|
half_arc_left(13)
|
|
penup()
|
|
forward(30)
|
|
pendown()
|
|
half_arc_left(13)
|
|
penup()
|
|
forward(45)
|
|
pendown()
|
|
half_arc_left(15)
|
|
penup()
|
|
forward(55)
|
|
pendown()
|
|
half_arc_left(15)
|
|
|
|
penup()
|
|
forward(70)
|
|
pendown()
|
|
forward(60)
|
|
|
|
penup()
|
|
right(180)
|
|
forward(150)
|
|
pendown()
|
|
forward(100)
|
|
right(90)
|
|
|
|
penup()
|
|
forward(15)
|
|
left(90)
|
|
pendown()
|
|
forward(200)
|
|
|
|
"Below book on end"
|
|
penup()
|
|
forward(40)
|
|
left(90)
|
|
forward(40)
|
|
pendown()
|
|
book_decal_rectangle(30,200)
|
|
|
|
half_arc_right(30)
|
|
right(180)
|
|
forward(200)
|
|
half_arc_left(30)
|
|
penup()
|
|
forward(10)
|
|
left(90)
|
|
forward(10)
|
|
pendown()
|
|
|
|
forward(30)
|
|
right(180)
|
|
penup()
|
|
forward(30)
|
|
left(90)
|
|
forward(10)
|
|
left(90)
|
|
pendown()
|
|
forward(30)
|
|
right(180)
|
|
penup()
|
|
forward(30)
|
|
left(90)
|
|
forward(10)
|
|
left(90)
|
|
pendown()
|
|
forward(30)
|
|
|
|
input() |