python画⼩狗代码_⽤Python画⼀只有点⽅的⼩狗狗——turtle
库circle(。。。
⼀只脑门有点⽅的⼩狗,其实还可以把脑门和后脑勺完善⼀下,更圆润⼀些。 但这样也挺可爱,就保有这样不完美但独⼀⽆⼆的它吧。绘制过程主要就是拼接和调整圆弧,尽量做到过度⾃然。turtle库的circle()函数虽然初接触会略有不适应,但⽤起来之后会发现它很强⼤!
image.png
代码如下
from turtle import *
screensize(500,500)
#【头部轮廓】
hbuilder怎么换背景颜pensize(5)
home()
seth(0)
pd()
delphi xe10 组件路径color('black')
circle(20,80)#0
circle(200,30)#1
circle(30,60)#2
circle(200,29.5)#3
color('black')
circle(20,60)#4
circle(-150,22)#5
python代码画图案circle(-50,10)#6
circle(50,70)#7
#确定⿐头⼤概位置
x_nose= xcor()
structural distributingy_nose= ycor()
circle(30,62)#8
circle(200,15)#9
#【⿐⼦】
pu()
goto(x_nose,y_nose+25)
seth(90)
pd()
begin_fill()
circle(8)
end_fill()
#【眼睛】
pu()
goto(x_nose+48,y_nose+55) seth(90)
pd()
begin_fill()
circle(8)
end_fill()
#【⽿朵】
pu()
color('#444444')
goto(x_nose+100,y_nose+110) seth(182)
pd()
fastjson反序列化漏洞特征circle(15,45)#1
color('black')
circle(10,15)#2
circle(90,70)#3
circle(25,110)#4
rt(4)
circle(90,70)#5
circle(10,15)#6
color('#444444')
circle(15,45)#7
#【⾝体】
pu()
color('black')
goto(x_nose+90,y_nose-30) seth(-130)
substrate缩写pd()
circle(250,28)#1
circle(10,140)#2 circle(-250,25)#3 circle(-200,25)#4 circle(-50,85)#5 circle(8,145)#6 circle(90,45)#7 circle(550,5)#8 #【尾巴】
seth(0)
circle(60,85)#1 circle(40,65)#2 circle(40,60)#3
lt(150)
circle(-40,90)#4 circle(-25,100)#5 lt(5)
fd(20)
circle(10,60)#6 #【背部】
rt(80)
circle(200,35)
#【项圈】
pensize(20)
color('#F03C3F') lt(10)
circle(-200,25)#5 #【爱⼼铃铛】
pu()
fd(18)
lt(90)
fd(18)
pensize(6)
seth(35)
color('#FDAF17')
begin_fill()
lt(135)
fd(6)
right(180)#画笔掉头
circle(6,-180)
backward(8)
right(90)
forward(6)
circle(-6,180)
fd(15)
end_fill()
#【前⼩腿】
pensize(5)
pu()
color('black')
goto(x_nose+100,y_nose-125) pd()
seth(-50)
fd(25)
circle(10,150)
fd(25)
#【后⼩腿】
pensize(4)
pu()
goto(x_nose+314,y_nose-125) pd()
seth(-95)
fd(25)
circle(-5,150)
fd(2)
hideturtle()
done()
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论