小狗,作为人类最忠实的朋友之一,总是以它们可爱的模样和活泼的性格,赢得了无数人的喜爱。从呆萌的小狗眼神到摇晃的尾巴,每一处细节都充满了温暖和快乐。今天,我们将用 Python Turtle 模块,绘制一只可爱的小狗,捕捉它那份纯真与活力。
from turtle import * import turtle as t t.screensize(500, 500) # 【头部轮廓】 t.pensize(5) t.home() t.seth(0) t.pd() t.color('black') t.circle(20, 80) # 0 t.circle(200, 30) # 1 t.circle(30, 60) # 2 t.circle(200, 29.5) # 3 t.color('black') t.circle(20, 60) # 4 t.circle(-150, 22) # 5 t.circle(-50, 10) # 6 t.circle(50, 70) # 7 # 确定鼻头大概位置 x_nose = t.xcor() y_nose = t.ycor() t.circle(30, 62) # 8 t.circle(200, 15) # 9 # 【鼻子】 t.pu() t.goto(x_nose, y_nose + 25) t.seth(90) t.pd() t.begin_fill() t.circle(8) t.end_fill() # 【眼睛】 t.pu() t.goto(x_nose + 48, y_nose + 55) t.seth(90) t.pd() t.begin_fill() t.circle(8) t.end_fill() # 【耳朵】 t.pu() t.color('#444444') t.goto(x_nose + 100, y_nose + 110) t.seth(182) t.pd() t.circle(15, 45) # 1 t.color('black') t.circle(10, 15) # 2 t.circle(90, 70) # 3 t.circle(25, 110) # 4 t.rt(4) t.circle(90, 70) # 5 t.circle(10, 15) # 6 t.color('#444444') t.circle(15, 45) # 7 # 【身体】 t.pu() t.color('black') t.goto(x_nose + 90, y_nose - 30) t.seth(-130) t.pd() t.circle(250, 28) # 1 t.circle(10, 140) # 2 t.circle(-250, 25) # 3 t.circle(-200, 25) # 4 t.circle(-50, 85) # 5 t.circle(8, 145) # 6 t.circle(90, 45) # 7 t.circle(550, 5) # 8 # 【尾巴】 t.seth(0) t.circle(60, 85) # 1 t.circle(40, 65) # 2 t.circle(40, 60) # 3 t.lt(150) t.circle(-40, 90) # 4 t.circle(-25, 100) # 5 t.lt(5) t.fd(20) t.circle(10, 60) # 6 # 【背部】 t.rt(80) t.circle(200, 35) # 【项圈】 t.pensize(20) t.color('#F03C3F') t.lt(10) t.circle(-200, 25) # 5 # 【爱心铃铛】 t.pu() t.fd(18) t.lt(90) t.fd(18) t.pensize(6) t.seth(35) t.color('#FDAF17') t.begin_fill() t.lt(135) t.fd(6) t.right(180) # 画笔掉头 t.circle(6, -180) t.backward(8) t.right(90) t.forward(6) t.circle(-6, 180) t.fd(15) t.end_fill() # 【前小腿】 t.pensize(5) t.pu() t.color('black') t.goto(x_nose + 100, y_nose - 125) t.pd() t.seth(-50) t.fd(25) t.circle(10, 150) t.fd(25) # 【后小腿】 t.pensize(4) t.pu() t.goto(x_nose + 314, y_nose - 125) t.pd() t.seth(-95) t.fd(25) t.circle(-5, 150) t.fd(2) t.hideturtle() t.done()
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129相关知识
用 Python Turtle 绘制一只可爱的小狗:用代码捕捉狗狗的萌态
Python turtle库绘制同心圆
教你轻松用CSS3绘制萌态花猫:纯代码打造时尚宠物插画
Python+Turtle实现绘制可爱的小仓鼠
教你用python画一个可爱皮卡丘!
【Python程序】用200行Python代码制作有趣的桌面宠物(源码可分享),大打工人解压放松程序,如何用Python制作一个桌面宠物!
呆萌可爱的小狗简笔画绘制教程 可爱好看的小狗简笔画带步骤
python 250行代码开发一个贪吃蛇
用 Python 实现浪漫表白程序
绘制可爱角色的Python Turtle教程
网址: 用 Python Turtle 绘制一只可爱的小狗:用代码捕捉狗狗的萌态 https://m.mcbbbk.com/newsview1171814.html
上一篇: 蓝天下草地上可爱棕色泰迪犬的萌态 |
下一篇: 可爱狗狗摄影图片 |