Python绘制圣诞树

2021-12-19 23:50

python绘制圣诞树终章

一位朋友送给相爱18年的闺蜜的圣诞树,是定制款呐



# 袜子
seth(-20)
pensize(2)
penup()
goto(-30, 130)
pencolor("black")
pendown()
begin_fill()
fillcolor('white')
fd(32)
circle(4, 180)
fd(32)
circle(4, 180)
end_fill()
penup()
goto(-25, 130)
pendown()
begin_fill()
fillcolor("red")
seth(-110)
fd(20)
seth(150)
fd(7)
circle(10, 180)
seth(-25)
fd(20)
circle(10, 90)
seth(68)
fd(28)
seth(160)
fd(26)
end_fill()
penup()
seth(0)
goto(-50, -240)
pendown()
hideturtle()

# # 苹果
penup()
goto(58, 30)
pendown()
pensize(2)
begin_fill()
circle(15)
fillcolor('red')
end_fill()
penup()
goto(45, 27)
pendown()
pensize(3)
seth(-100)
circle(5, 180)
penup()
goto(50, 20)
pendown()
pensize(2)
seth(85)
for i in range(5):
    fd(4)
    right(8)

# 圣诞棒
pencolor('black')
penup()
goto(-80, -50)
pendown()
begin_fill()
fillcolor('red')
seth(110)
circle(-6, 180)
seth(20)
fd(10)
seth(110)
circle(16, 180)
seth(-60)
fd(45)
seth(20)
for i in range(9):
    fd(1)
    left(5)
seth(120)
fd(42)
end_fill()

# 圣诞帽
seth(-20)
pensize(3)
penup()
goto(-60, -144)
pencolor("black")
pendown()
begin_fill()
fillcolor('white')
fd(45)
circle(4, 180)
fd(45)
circle(4, 180)
end_fill()
penup()
goto(-55, -135)
seth(75)
pendown()
begin_fill()
seth(60)
for i in range(10):
    fd(4)
    right(6)
seth(-10)
for i in range(8):
    fd(8)
    right(15)
seth(115)
for i in range(4):
    fd(5)
    left(2)
seth(90)
for i in range(5):
    fd(2)
    left(5)
seth(-90)
for i in range(4):
    fd(5)
    right(15)
seth(161)
fd(45)
fillcolor('red')
end_fill()
penup()
goto(3, -162)
pendown()
pensize(2)
pencolor('black')
circle(5)
————————————————

这里就放几个比较好看的的呐,需要自取哦,喜欢就点个赞,给个关注吧

分享到:
文章评论 · 所有评论
评论请遵守当地法律法规
点击加载更多
本月点击排行
精彩图片
京ICP备14056871号
Copyright ©2022 USN, All Rights Reserved