绘制玫瑰

from turtle import *
setup(0.3,0.9)
speed(0)
#填色
begin_fill()
fillcolor("red")
#上面的
circle(80,20)
circle(5,150)
circle(160,20)
circle(6,150)
circle(200,18)
circle(15,160)
circle(80,30)
circle(240,10)
a=pos()
a1=heading()
a2=a1-180

#左面的一瓣外圆弧
seth(-90)
fd(35)
l1=pos()
seth(120)
fd(10)
seth(-100)
fd(10)
circle(80,80)
l2=pos()
#右面的一瓣
seth(8)
circle(80,80)
circle(240,10)
end_fill()
seth(-120)
fd(35)
r1=pos()
circle(-80,20)
circle(80,53)
#左面的一瓣内圆弧
seth(30)
circle(25,125)
circle(-100,36)
goto((l1))
#小的
seth(90)
fd(35)
seth(a2)
circle(-240,10)
circle(-80,30)
circle(-15,80)
goto((r1))
#根
pu()
goto((l2))
pd()
pensize(4)
pencolor("green")
seth(-100)
circle(100,40)
fd(100)
g1=pos()
g2=heading()
#叶脉
pensize(2)
pencolor("green")
pu()
fd(-100)
seth(10)
pd()
circle(200,10)
#1叶子下沿
pensize(1)
pencolor("black")
pu()
left(180)
circle(-200,6)
pd()
left(180)
begin_fill()
fillcolor("green")
seth(-30)
circle(60,120)
#1叶子上沿
seth(150)
circle(60,120)
end_fill()
seth(10)
circle(200,16)
#叶脉
pensize(2)
pencolor("green")
pu()
goto((g1))
pd()
seth((g2))
fd(-20)
seth(170)
circle(200,8)
#2叶子下沿
pensize(1)
pencolor("black")
begin_fill()
fillcolor("green")
seth(-120)
circle(-60,120)
#2叶子上沿
seth(60)
circle(-60,120)
seth(170)
circle(200,16)
end_fill()

  绘制玫瑰_第1张图片

你可能感兴趣的:(绘制玫瑰)