python画小狗代码 | 您所在的位置:网站首页 › 玉桂狗全身画法 › python画小狗代码 |
一只脑门有点方的小狗,其实还可以把脑门和后脑勺完善一下,更圆润一些。 但这样也挺可爱,就保有这样不完美但独一无二的它吧。绘制过程主要就是拼接和调整圆弧,尽量做到过度自然。turtle库的circle()函数虽然初接触会略有不适应,但用起来之后会发现它很强大! image.png 代码如下 from turtle import * screensize(500,500) #【头部轮廓】 pensize(5) home() seth(0) pd() 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 circle(-50,10)#6 circle(50,70)#7 #确定鼻头大概位置 x_nose= xcor() y_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() #【眼睛】 |
CopyRight 2018-2019 实验室设备网 版权所有 |