generated from mwc/project_drawing
Added two shift variables to increase readability
The halfShift and fullShift variables are based on the original face ellipse shape. They are the major and minor axis chord lengths of the two different arcs. The fullShift only gets used in positioning the lower half of the face, everything else is shifted left/right so works off of the halfShift since it aligns with the minor axis of the top part of the dog's face, which is the x-direction
This commit is contained in:
parent
88b6a7798f
commit
80b471cefb
18
drawing.py
18
drawing.py
|
@ -84,28 +84,32 @@ hideturtle()
|
|||
|
||||
faceLength = 200
|
||||
|
||||
# these shifts are based on the short and long chord-lengths of the original face ellipse
|
||||
halfShift = 2*(faceLength/2)*math.sin(math.pi/4)
|
||||
fullShift = 2*(faceLength)*math.sin(math.pi/4)
|
||||
|
||||
right(20)
|
||||
goto(2*(faceLength/2)*math.sin(math.pi/4)*0.5,0)
|
||||
goto(halfShift*0.5,0)
|
||||
ear(-faceLength,'sienna')
|
||||
goto(-2*(faceLength/2)*math.sin(math.pi/4)*0.5,0)
|
||||
goto(-halfShift*0.5,0)
|
||||
right(140)
|
||||
ear(faceLength,'sienna')
|
||||
|
||||
goto(-2*(faceLength/2)*math.sin(math.pi/4)*0.5,0)
|
||||
goto(-halfShift*0.5,0)
|
||||
setheading(-135)
|
||||
face(faceLength,'white')
|
||||
|
||||
goto(-2*(faceLength/2)*math.sin(math.pi/4),-2*(faceLength)*math.sin(math.pi/4)*1.25)
|
||||
goto(-halfShift,-fullShift*1.25)
|
||||
setheading(-45)
|
||||
face(faceLength,'sienna')
|
||||
|
||||
setheading(0)
|
||||
goto(-2*(faceLength/2)*math.sin(math.pi/4)*0.4,-faceLength/2)
|
||||
goto(-halfShift*0.4,-faceLength/2)
|
||||
eye(faceLength/12,'black')
|
||||
goto(2*(faceLength/2)*math.sin(math.pi/4)*0.4,-faceLength/2)
|
||||
goto(halfShift*0.4,-faceLength/2)
|
||||
eye(faceLength/12,'black')
|
||||
|
||||
goto(faceLength/12,-2*(faceLength/2)*math.sin(math.pi/4)*1.25)
|
||||
goto(faceLength/12,-halfShift*1.25)
|
||||
nose(faceLength/6)
|
||||
|
||||
done()
|
||||
|
|
Loading…
Reference in New Issue