如何使用python绘制雪容融

大家好,我是于翱睿,今天我给大家更新一次如何使用python绘制雪容融

那么,在分享代码之前,我先给大家介绍一下雪容融是什么。

“雪容融”是一个红彤彤的可爱大娃娃,是以中国的红灯笼为原型,灯笼代表着收获、喜庆、温暖和光明。

“雪”象征洁白、美丽,是冰雪运动的特点;“容融”意喻着包容、宽容,交流互鉴。顶部的如意造型寓意着吉祥幸福,如意从古至今都是中国的代表,象征着美好的祝福。

好的,那么了解完雪容融是什么之后,我们就开始我们的代码学习吧!

from turtle import*
speed(6)
penup()
pencolor('black')
goto(-20,130)
fillcolor('red')
begin_fill()
pendown()
setheading(16)
circle(-50,-150)
setheading(0)
forward(60)
setheading(196)
circle(-50,-150)
setheading(180)
forward(60)
end_fill()

penup()
pencolor('red')
goto(-20,130)
fillcolor('red')
begin_fill()
pendown()
setheading(196)
circle(120,-30)
end_fill()

penup()
pencolor('yellow')
goto(-39,118)
fillcolor('yellow')
begin_fill()
pendown()
setheading(20)
circle(20,40)
end_fill()

penup()
pencolor('yellow')
goto(-30,128)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-75)
circle(200,2)
setheading(11)
circle(-100,10)
setheading(75)
circle(200,2)
end_fill()
penup()
pencolor('red')
goto(-25,123)
fillcolor('red')
begin_fill()
pendown()
setheading(8)
forward(10)
setheading(130)
forward(4)
setheading(90)
forward(4)
end_fill()

penup()
pencolor('yellow')
goto(-8,129)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-75)
circle(200,2)
setheading(8)
circle(-100,10)
setheading(75)
circle(200,2)
end_fill()
penup()
pencolor('red')
goto(-3,124)
fillcolor('red')
begin_fill()
pendown()
setheading(8)
forward(10)
setheading(130)
forward(4)
setheading(90)
forward(4)
end_fill()

penup()
pencolor('yellow')
goto(13,129)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-75)
circle(200,2)
setheading(4)
circle(-100,10)
setheading(80)
circle(200,2)
end_fill()
penup()
pencolor('red')
goto(18,124)
fillcolor('red')
begin_fill()
pendown()
setheading(8)
forward(10)
setheading(130)
forward(4)
setheading(90)
forward(4)
end_fill()

penup()
pencolor('yellow')
goto(35,129)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-75)
circle(200,2)
setheading(-5)
circle(-100,5)
setheading(40)
circle(300,1.5)
end_fill()
penup()
pencolor('red')
goto(38,124)
fillcolor('red')
begin_fill()
pendown()
setheading(8)
forward(8)
setheading(130)
forward(3)
setheading(90)
forward(3)
end_fill()

penup()
pencolor('yellow')
goto(58,120)
fillcolor('yellow')
begin_fill()
pendown()
setheading(110)
circle(4,150)
end_fill()

penup()
pencolor('black')
goto(-43,117)
pendown()
setheading(10)
circle(-310,20)

penup()
pencolor('black')
goto(-30,119)
pendown()
setheading(53)
circle(-58,-98)

penup()
goto(-8,122)
pendown()
setheading(78)
circle(-168,-31)

penup()
goto(24,121)
pendown()
setheading(-80)
circle(-300,17)

penup()
goto(50,120)
pendown()
setheading(-63)
circle(-80,67)

penup()
pencolor('black')
goto(-21,60)
fillcolor('white')
begin_fill()
pendown()
setheading(-22)
circle(78,53)
setheading(-44)
circle(12,253)
setheading(44)
circle(12,223)
setheading(124)
circle(18,123)
setheading(134)
circle(18,130)
setheading(-176)
circle(12,230)
end_fill()

penup()
pencolor('black')
goto(-5,80)
fillcolor('black')
begin_fill()
pendown()
circle(5)
end_fill()
penup()
goto(37,80)
fillcolor('black')
begin_fill()
pendown()
circle(5)
end_fill()

penup()
pencolor('black')
goto(-8,83)
fillcolor('white')
begin_fill()
pendown()
circle(2)
end_fill()
penup()
goto(34,83)
fillcolor('white')
begin_fill()
pendown()
circle(2)
end_fill()

penup()
pencolor('red')
goto(-26,62)
fillcolor('red')
begin_fill()
pendown()
circle(8)
end_fill()
penup()
goto(63,68)
fillcolor('red')
begin_fill()
pendown()
circle(8)
end_fill()

penup()
pencolor('black')
goto(-17,32)
fillcolor('red')
begin_fill()
pendown()
setheading(-100)
circle(200,5)
circle(25,90)
setheading(-5)
circle(200,5)
setheading(5)
circle(25,90)
circle(200,5.5)
end_fill()

penup()
pencolor('white')
goto(28,10)
fillcolor('white')
begin_fill()
pendown()
circle(16)
end_fill()

penup()
pencolor('black')
goto(-17.5,30)
fillcolor('red')
begin_fill()
pendown()
setheading(145)
circle(-190,4)
circle(10,190)
setheading(-20)
circle(55,10)
setheading(-15)
circle(55,11.5)
end_fill()

penup()
goto(42,30)
fillcolor('red')
begin_fill()
pendown()
setheading(-45)
circle(40,30)
setheading(-48)
circle(-10,185.3)
end_fill()

penup()
goto(-11,-7)
fillcolor('red')
begin_fill()
pendown()
setheading(-75)
forward(16)
setheading(-18)
circle(20,40)
setheading(75)
forward(11)
end_fill()

penup()
goto(36,-6)
fillcolor('red')
begin_fill()
pendown()
setheading(-98)
forward(15)
setheading(-155)
circle(-20,40)
setheading(103)
forward(10)
end_fill()

penup()
pencolor('yellow')
goto(-7.5,-19)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-22)
circle(20,42)
setheading(75)
forward(3)
setheading(-160)
circle(-20,47)
end_fill()

penup()
goto(34,-18)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-160)
circle(-30,27)
setheading(110)
forward(3)
setheading(-18)
circle(21,46)
end_fill()

penup()
pencolor('black')
goto(-17,32)
pendown()
setheading(-100)
circle(200,5)
circle(25,90)
setheading(-5)
circle(200,5)
setheading(5)
circle(25,90)
circle(200,5.5)

penup()
pencolor('yellow')
goto(-13,24)
fillcolor('yellow')
begin_fill()
pendown()
setheading(-95)
forward(16)
setheading(-10)
forward(12)
setheading(85)
forward(16)
setheading(-3)
circle(200,12)
circle(7,200)
setheading(-172)
circle(-200,15)
circle(7,210)
end_fill()
penup()
pencolor('red')
goto(-10.5,16)
pendown()
setheading(-95)
forward(10)
penup()
goto(-6.5,16)
pendown()
setheading(-95)
forward(11)

penup()
pencolor(0,0,1)
goto(-25,127)
fillcolor('white')
begin_fill()
pendown()
setheading(-10)
circle(15,50)
setheading(20)
circle(-10,60)
setheading(-8)
circle(10,55)
setheading(32)
circle(-13,85)
setheading(-18)
circle(12,45)
setheading(25)
circle(-15,60)
circle(2,210)
setheading(150)
circle(50,30)
setheading(138)
circle(20,90)
setheading(-178)
circle(50,30)
circle(2,210)
end_fill()

penup()
pencolor('gold')
goto(1,142)
pendown()
setheading(22)
circle(-25,45)
setheading(75)
forward(6)
setheading(-25)
circle(5,260)
setheading(95)
circle(10,180)
setheading(110)
circle(5,270)
setheading(-70)
forward(6)
setheading(25)
forward(6)
circle(4,140)
penup()
goto(19,142)
pendown()
setheading(165)
forward(6)
circle(-4,140)

hideturtle()

运行上方代码之后,我们就可以看到一个类似下图的雪容融。如果觉得本期作品还不错,那么就给我来一个大拇指吧!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值