200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 利用turtle库绘制图形---Python

利用turtle库绘制图形---Python

时间:2023-04-07 05:25:18

相关推荐

利用turtle库绘制图形---Python

引入turtle库

pip3 install 库名

1.在cmd里安装pyintsaller包

第一步安装将Python代码转成exe的工具包–pyinstaller:需要打开cmd,然后在cmd里输入一行命令即可

pip install pyinstaller

如果觉得安装太慢,还可以加入国内镜像下载pyinstaller,一共有六个国内镜像地址,你选择一个加入进去即可:

清华:https://pypi.tuna./simple

阿里云:/pypi/simple/

中国科技大学https://pypi.mirrors./simple/

华中理工大学:/

山东理工大学:/

豆瓣:/simple/

cmd中加入国内镜像下载工具包命令:

pip install -i https://pypi.tuna./simple pyinstaller

或者

pip3 install pyinstaller

2.在cmd里输入打包成exe的命令

安装好pyinstaller工具包后,首先要在cmd里跳转地址到Python代码所在的文件地址,然后输入以下命令,即可将Python代码转成exe,并生成一个名为dist的文件夹,在文件夹中可以找到刚打包完成的exe

pyinstaller -F xxxx.py(要打包的py文件)

pyinstaller -D xxxx.py(要打包的py文件)

功能注释:

-F 打包成一个文件

-D 打包成一个文件夹

-n 重新命名

–noconsole 去掉cmd命令窗口

-i 加入图标,图标需要是ico格式

打包举例:1.打包时候修改文件名,2.运行时候不显示命令窗口,3.改变游戏图标

例如pyinstaller -F -i tupian.ico main.py -n 游戏名字 --noconsole

3.问题总结

3.1 一闪而过怎么办?

原因: 打包的源 码或环境 有问题

解决办法:打包成有命令窗口的exe,并将exe在cmd里运行,运行不成功会显示报错信息,然后根据报错信息修改

3.2 打包后的文件太大怎么办?

原因:在python导包的时候,将包的全部函数打包成exe了

解决办法:这里需要在代码里更改导包方式,例如将import sys改为from sys import exit

3.3 缺少相关素材

将码所有涉及到素材的文件都改成绝对路径(针对本台电脑)

将相关素材的路径换成相对路径,并将所有素材和exe放到一个文件夹下(针对移植exe)

3.4 关于图标的ico文件去哪里转

在这个网址可以将图片转成ico图标 /

3.5 图标加载进去不显示怎么办

刷新界面或者将exe文件复制粘贴到其它路径下就能看到

4.pyintsaller --help

关于pyinstaller功能最最最全面的解释,可以在cmd里直接使用命令得到:

在Python里面调用turtle

import turtle

当然也可以from<库名> as <库别名>

使用from和import保留字共同完成:from<库名> import <函数名> from<库名>import*

<库名>.<函数名>(<函数参数>)

turtle命令

运动命令

画笔控制命令

全局控制命令

例子及其效果图

无角四边形

import turtleturtle.goto(40,0)turtle.penup()turtle.goto(50,-10)turtle.pendown()turtle.goto(50,-90)turtle.penup()turtle.goto(40,-100)turtle.pendown()turtle.goto(-40,-100)turtle.penup()turtle.goto(-50,-90)turtle.pendown()turtle.goto(-50,-10)turtle.penup()turtle.goto(-40,0)turtle.pendown()turtle.goto(0,0)

或者

import turtlefor i in range(4):turtle.forward(80)turtle.penup()turtle.forward(10)turtle.right(90)turtle.forward(10)turtle.pendown()

根据当前时间绘制七段数码管

import turtleimport timedef drawGap():turtle.penup()turtle.fd(5)def drawLine(draw):drawGap()turtle.pendown() if draw else turtle.penup()turtle.fd(40)drawGap()turtle.right(90)def drawDigit(digit):drawLine(True) if digit in [2,3,4,5,6,8,9] else drawLine(False)drawLine(True) if digit in [0,1,3,4,5,6,7,8,9] else drawLine(False)drawLine(True) if digit in [0,2,3,5,6,8,9] else drawLine(False)drawLine(True) if digit in [0,2,6,8] else drawLine(False)turtle.left(90)drawLine(True) if digit in [0,4,5,6,8,9] else drawLine(False)drawLine(True) if digit in [0,2,3,5,6,7,8,9] else drawLine(False)drawLine(True) if digit in [0,1,2,3,4,7,8,9] else drawLine(False)turtle.left(180)turtle.penup()turtle.fd(20)def drawDate(date):turtle.pencolor("gold") if date[-1]=='@' else turtle.pencolor("red")for i in date:if i=='-':turtle.right(90)turtle.fd(18)turtle.left(90)turtle.write('年',font=("Arial",18,"normal"))turtle.pencolor("green")turtle.left(90)turtle.fd(18)turtle.right(90)turtle.fd(40)elif i=='=':turtle.right(90)turtle.fd(18)turtle.left(90)turtle.write('月',font=("Arial",18,"normal"))turtle.pencolor("blue")turtle.left(90)turtle.fd(18)turtle.right(90)turtle.fd(40)elif i== '+':turtle.right(90)turtle.fd(18)turtle.left(90) turtle.write('日',font=("Arial",18,"normal"))turtle.pencolor("brown")turtle.left(90)turtle.fd(18)turtle.right(90)turtle.fd(40)elif i== '<':turtle.right(90)turtle.fd(18)turtle.left(90)turtle.write('时',font=("Arial",18,"normal"))turtle.pencolor("purple")turtle.left(90)turtle.fd(18)turtle.right(90)turtle.fd(40)elif i== '>':turtle.right(90)turtle.fd(18)turtle.left(90) turtle.write('分',font=("Arial",18,"normal"))turtle.left(90)turtle.fd(18)turtle.right(90)turtle.fd(40)elif i== '@':turtle.pencolor("gold")turtle.right(90)turtle.fd(18)turtle.left(90) turtle.write('秒',font=("Arial",18,"normal"))turtle.left(90)turtle.fd(18)turtle.right(90)else:drawDigit(eval(i))def main():turtle.setup(1400,350,200,200)turtle.speed("fastest")turtle.penup()turtle.fd(-600)turtle.pensize(5)drawDate(time.strftime('%Y-%m=%d+%H<%M>',time.localtime()))drawDate(time.strftime('%S@',time.localtime()))turtle.hideturtle()turtle.done()main()

动态时间

import turtle as timport timedef pen():t.up()t.fd(6)t.down()def drawline(draw):#绘制单段数码管pen()t.pendown() if draw else t.penup() # draw 为真则执行 pendown ,否则执行 penupt. fd(40)pen()t.right(90)def drawdigit(digit): #根据数字绘制七段数码管drawline(True) if digit in [2,3,4,5,6,8,9] else drawline(False)drawline(True) if digit in [0,1,3,4,5,6,7,8,9] else drawline(False)drawline(True) if digit in [0,2,3,5,6,8,9] else drawline(False)drawline(True) if digit in [0,2,6,8] else drawline(False)t.left(90)drawline(True) if digit in [0,4,5,6,8,9] else drawline(False)drawline(True) if digit in [0,2,3,5,6,7,8,9] else drawline(False)drawline(True) if digit in [0,1,2,3,4,7,8,9] else drawline(False)t.left(180)t.penup()t.fd(25)def drawday(day): #获取要输出的数字for i in day:if i == '-':t.write('时',font = ('隶书',28,'normal'))t.pencolor('green')t.fd(40)elif i == '=':t.write('分',font = ('隶书',28,'normal'))t.pencolor('blue')t.fd(40)elif i == '+':t.write('秒',font = ('隶书',28,'normal'))else:drawdigit(eval(i))def main():t.setup(800,350,200,200)t.speed(0)t.color('red')t.hideturtle()#隐藏画笔t.penup()t.fd(-360)t.pensize(5)while(1):t.penup( )t.goto(-300,0)t.pendown( )t.tracer(False)t.pencolor('red')drawday(time.strftime('%H-%M=%S+', time.localtime()))time.sleep(0.1)t.clear() #清屏t.done()main()

等边三角形

import turtleturtle.setheading(-60)turtle.forward(200)turtle.setheading(-180)turtle.forward(200)turtle.setheading(60)turtle.forward(100)turtle.setheading(0)turtle.forward(100)turtle.setheading(-120)turtle.forward(100)turtle.setheading(120)turtle.forward(100)turtle.setheading(60)turtle.forward(100)

彩色蟒蛇绘制

import turtledef drawSnake(rad,angle,len,neckrad):colors = ["red","orange","yellow","green","cyan","blue"]for i in range(len):turtle.color(colors[i])turtle.circle(rad,angle)turtle.circle(-rad,angle)turtle.color("purple")turtle.circle(rad,angle/2)turtle.fd(rad)turtle.circle(neckrad+1,180)turtle.fd(rad*2/3)def main():turtle.setup(1300,800,0,0)turtle.penup()turtle.goto(-350,0)turtle.pendown()pythonsize = 30turtle.pensize(pythonsize)turtle.seth(-40)drawSnake(40,80,6,pythonsize/2)main()

八边形

import turtlefor i in range(8):turtle.forward(100)turtle.right(45)

八角形

import turtlefor i in range(8):turtle.forward(300)turtle.left(135)

魔法少女—小圆晓美焰

有难度

import turtle as teimport timeWriteStep = 15 # 贝塞尔函数的取样次数Speed = 5Width = 600 # 界面宽度Height = 500 # 界面高度Xh = 0 # 记录前一个贝塞尔函数的手柄Yh = 0def Bezier(p1, p2, t): # 一阶贝塞尔函数return p1 * (1 - t) + p2 * tdef Bezier_2(x1, y1, x2, y2, x3, y3): # 二阶贝塞尔函数te.goto(x1, y1)te.pendown()for t in range(0, WriteStep + 1):x = Bezier(Bezier(x1, x2, t / WriteStep),Bezier(x2, x3, t / WriteStep), t / WriteStep)y = Bezier(Bezier(y1, y2, t / WriteStep),Bezier(y2, y3, t / WriteStep), t / WriteStep)te.goto(x, y)te.penup()def Bezier_3(x1, y1, x2, y2, x3, y3, x4, y4): # 三阶贝塞尔函数x1 = -Width / 2 + x1y1 = Height / 2 - y1x2 = -Width / 2 + x2y2 = Height / 2 - y2x3 = -Width / 2 + x3y3 = Height / 2 - y3x4 = -Width / 2 + x4y4 = Height / 2 - y4 # 坐标变换te.goto(x1, y1)te.pendown()for t in range(0, WriteStep + 1):x = Bezier(Bezier(Bezier(x1, x2, t / WriteStep), Bezier(x2, x3, t / WriteStep), t / WriteStep),Bezier(Bezier(x2, x3, t / WriteStep), Bezier(x3, x4, t / WriteStep), t / WriteStep), t / WriteStep)y = Bezier(Bezier(Bezier(y1, y2, t / WriteStep), Bezier(y2, y3, t / WriteStep), t / WriteStep),Bezier(Bezier(y2, y3, t / WriteStep), Bezier(y3, y4, t / WriteStep), t / WriteStep), t / WriteStep)te.goto(x, y)te.penup()def Moveto(x, y): # 移动到svg坐标下(x,y)te.penup()te.goto(-Width / 2 + x, Height / 2 - y)def line(x1, y1, x2, y2): # 连接svg坐标下两点te.penup()te.goto(-Width / 2 + x1, Height / 2 - y1)te.pendown()te.goto(-Width / 2 + x2, Height / 2 - y2)te.penup()def lineto(dx, dy): # 连接当前点和相对坐标(dx,dy)的点te.pendown()te.goto(te.xcor() + dx, te.ycor() - dy)te.penup()def Lineto(x, y): # 连接当前点和svg坐标下(x,y)te.pendown()te.goto(-Width / 2 + x, Height / 2 - y)te.penup()def Horizontal(x): # 做到svg坐标下横坐标为x的水平线te.pendown()te.setx(x - Width / 2)te.penup()def horizontal(dx): # 做到相对横坐标为dx的水平线te.seth(0)te.pendown()te.fd(dx)te.penup()def vertical(dy): # 做到相对纵坐标为dy的垂直线te.seth(-90)te.pendown()te.fd(dy)te.penup()te.seth(0)def polyline(x1, y1, x2, y2, x3, y3): # 做svg坐标下的折线te.penup()te.goto(-Width / 2 + x1, Height / 2 - y1)te.pendown()te.goto(-Width / 2 + x2, Height / 2 - y2)te.goto(-Width / 2 + x3, Height / 2 - y3)te.penup()def Curveto(x1, y1, x2, y2, x, y): # 三阶贝塞尔曲线到(x,y)te.penup()X_now = te.xcor() + Width / 2Y_now = Height / 2 - te.ycor()Bezier_3(X_now, Y_now, x1, y1, x2, y2, x, y)global Xhglobal YhXh = x - x2Yh = y - y2def curveto_r(x1, y1, x2, y2, x, y): # 三阶贝塞尔曲线到相对坐标(x,y)te.penup()X_now = te.xcor() + Width / 2Y_now = Height / 2 - te.ycor()Bezier_3(X_now, Y_now, X_now + x1, Y_now + y1,X_now + x2, Y_now + y2, X_now + x, Y_now + y)global Xhglobal YhXh = x - x2Yh = y - y2def Smooth(x2, y2, x, y): # 平滑三阶贝塞尔曲线到(x,y)global Xhglobal Yhte.penup()X_now = te.xcor() + Width / 2Y_now = Height / 2 - te.ycor()Bezier_3(X_now, Y_now, X_now + Xh, Y_now + Yh, x2, y2, x, y)Xh = x - x2Yh = y - y2def smooth_r(x2, y2, x, y): # 平滑三阶贝塞尔曲线到相对坐标(x,y)global Xhglobal Yhte.penup()X_now = te.xcor() + Width / 2Y_now = Height / 2 - te.ycor()Bezier_3(X_now, Y_now, X_now + Xh, Y_now + Yh,X_now + x2, Y_now + y2, X_now + x, Y_now + y)Xh = x - x2Yh = y - y2te.tracer(10)te.setup(Width, Height, 0, 0)te.pensize(1)te.speed(Speed)te.penup()# 图层_2time.sleep(20)te.color("black", "#F2F2F2") # 外套Moveto(61, 462)te.begin_fill()smooth_r(12, -41, 27, -58)curveto_r(-6, -36, 6, -118, 9, -132)curveto_r(-15, -27, -23, -51, -26, -74)curveto_r(4, -66, 38, -105, 65, -149)Horizontal(486)curveto_r(12, 24, 40, 99, 33, 114)curveto_r(39, 82, 55, 129, 39, 144)smooth_r(-31, 23, -39, 28)smooth_r(-12, 37, -12, 37)lineto(50, 92)Horizontal(445)smooth_r(-29, -38, -31, -46)smooth_r(78, -107, 72, -119)Smooth(355, 178, 340, 176)Smooth(272, 63, 264, 64)smooth_r(-29, 67, -27, 73)Curveto(99, 292, 174, 428, 173, 439)smooth_r(-8, 23, -8, 23)Lineto(61, 462)te.end_fill()Moveto(60.5, 461.5) # 阴影te.color("black", "#D3DFF0")te.begin_fill()curveto_r(0, 0, 17, -42, 27, -59)curveto_r(-6, -33, 6, -128, 10, -133)curveto_r(-15, -10, -27, -66, -27.285, -75)te.pencolor("#D3DFF0")curveto_r(12.285, 11, 82.963, 156, 82.963, 156)te.pencolor("black")smooth_r(12.322, 75, 19.322, 86)curveto_r(-1, 11, -8, 25, -8, 25)Horizontal(60.5)te.end_fill()Moveto(444.5, 464)te.begin_fill()curveto_r(0, 0, -29, -36, -31, -46)smooth_r(53.59, -82.337, 53.59, -82.337)te.pencolor("#D3DFF0")smooth_r(86.41, -47.663, 96.072, -54.85)Curveto(563.5, 297.5, 570.5, 299.5, 518.5, 334)te.pencolor("black")curveto_r(-2, 16, -12, 33, -12, 37)smooth_r(50, 92, 50, 93)Horizontal(444.5)te.end_fill()Moveto(195, 49)te.begin_fill()te.pencolor("#D3DFF0")polyline(195, 49, 175.5, 106.5, 202.522, 49)te.pencolor("black")Horizontal(195)te.pencolor("#D3DFF0")te.end_fill()Moveto(327.997, 49)te.begin_fill()te.pencolor("#D3DFF0")curveto_r(0, 0, 11.503, 121.087, 13.503, 128.087)curveto_r(11, 2, 54, 37, 54, 37)lineto(-40, -165.087)te.pencolor("black")Horizontal(327.997)te.pencolor("#D3DFF0")te.end_fill()te.pencolor("black")line(94.5, 397.5, 107.5, 373.5) # 皱纹line(122.5, 317.5, 95.875, 274.699)line(122.5, 341.5, 141.5, 402.5)line(141.5, 409.5, 153.5, 431.5)# line(328,47.712,344,175.977)line(340.023, 49, 360.5, 144)# line(353.5,47.5,395.5,208.5)line(478.5, 95.5, 518.5, 161.5)line(518.5, 332.5, 460.5, 359.5)polyline(506.5, 369.5, 493.5, 402.5, 502.5, 443.5)Moveto(530, 429)curveto_r(4, 16, -5, 33, -5, 33)# 图层_3te.color("black", "#2b1d2a") # 外套内侧Moveto(225, 462)te.begin_fill()Horizontal(165)smooth_r(9, -15, 8, -25)curveto_r(-47, -126, 6, -212, 12, -225)Curveto(185, 305, 202, 428, 225, 462)Lineto(225, 462)te.end_fill()Moveto(390, 462)te.begin_fill()curveto_r(10, -23, 34, -180, 35, -222) # !!!227curveto_r(7, 4, 54, 45, 61, 61) # 61smooth_r(-73, 101, -72, 118)curveto_r(5, 15, 31, 46, 31, 45)Lineto(390, 462)te.end_fill()# 图层_4te.color("black", "#2b1d29") # 外套内侧Moveto(225, 462)te.begin_fill()curveto_r(-28, -50, -40, -166, -40, -250)curveto_r(6, 51, -6, 87, 45, 106)smooth_r(64, 27, 89, 24)smooth_r(49, -18, 56, -20)smooth_r(50, -10, 51, -85)curveto_r(0, 29, -25, 201, -36, 225)Lineto(225, 462)te.end_fill()# 图层_5te.color("black", "#3D3D3D") # 衣服Moveto(225, 462)te.begin_fill()curveto_r(-5, -5, -22, -53, -23, -70)lineto(32, -13)curveto_r(3, -25, 6, -28, 12, -36)smooth_r(13, -12, 16, -12)vertical(-2)curveto_r(45, 20, 64, 14, 94, 1)vertical(2)curveto_r(8, -2, 15, 2, 17, 4)smooth_r(0, 6, -2, 9)curveto_r(10, 10, 10, 29, 11, 33)smooth_r(23, 4, 25, 6)smooth_r(-17, 83, -17, 78)Lineto(225, 462)te.end_fill()# 图层_6te.color("black", "#968281") # 脖子Moveto(262, 329)te.begin_fill()vertical(17)curveto_r(1, 2, 44, 14, 45, 15)smooth_r(3, 12, 3, 12)horizontal(3)vertical(-5)curveto_r(1, -3, 4, -6, 5, -7)lineto(36, -14)curveto_r(1, -1, 3, -16, 2, -17)Curveto(318, 348, 296, 344, 262, 329)te.end_fill()# 图层_8te.color("black", "#E7F1FF") # 白色褶皱Moveto(225, 462)te.begin_fill()lineto(-3, -5) # -3,-3,-3,-5curveto_r(0, -2, 4, -4, 5, -6)smooth_r(16, 3, 19, -8)smooth_r(0, -7, 0, -11)smooth_r(5, -8, 9, -5)smooth_r(19, -8, 19, -11)smooth_r(6, -7, 6, -7)smooth_r(7, -2, 9, -4)lineto(41, -2)lineto(12, 9)smooth_r(3, 15, 7, 18)smooth_r(15, 4, 17, 4)smooth_r(4, -4, 6, -4)smooth_r(6, 4, 5, 9)smooth_r(0, 9, 0, 9)smooth_r(1, 7, 7, 6)smooth_r(8, 0, 8, 0)lineto(-2, 8)Lineto(225, 462)te.end_fill()te.pensize(2)Moveto(240, 450)smooth_r(0, 9, 3, 12)Moveto(372, 462)curveto_r(-2, -4, -5, -29, -7, -28)te.pensize(1)# 图层_7te.color("black", "#A2B8D6") # 衣领Moveto(262, 331)te.begin_fill()curveto_r(0, 8, -1, 13, 0, 15)smooth_r(43, 14, 45, 15)lineto(3, 12)horizontal(3)smooth_r(-1, -3, 0, -5)lineto(5, -7)lineto(36, -14)curveto_r(1, -1, 2, -12, 2, -15)smooth_r(25, -2, 15, 13)curveto_r(-2, 4, -7, 29, -7, 32)smooth_r(-35, 19, -41, 22)smooth_r(-9, 14, -12, 14)smooth_r(-7, -12, -14, -15)curveto_r(-19, -2, -41, -25, -41, -25)smooth_r(-10, -26, -10, -30)Smooth(255, 332, 262, 331)te.end_fill()Moveto(262, 346)lineto(-12, -6)Moveto(369, 333)curveto_r(2, 4, -6, 10, -15, 14)# 图层_9te.color("black", "#151515") # 领结Moveto(247, 358)te.begin_fill()curveto_r(-5, 3, -8, 20, -6, 23)curveto_r(25, 21, 50, 17, 50, 17)lineto(-23, 64)horizontal(22)smooth_r(1, -13, 2, -16)lineto(13, -50)curveto_r(2, 2, 7, 3, 10, 1)smooth_r(18, 65, 18, 65)horizontal(19)lineto(-24, -65)curveto_r(21, 5, 39, -10, 44, -13)curveto_r(5, -20, 1, -21, 0, -24)curveto_r(-18, -2, -49, 15, -52, 17)smooth_r(-11, -3, -15, -1)Smooth(252, 356, 247, 358)te.end_fill()# 图层_10te.color("black", "#A2B8D6") # 衣领(透过领结)Moveto(297, 387)te.begin_fill()lineto(-11, 6)curveto_r(-1, 0, -20, -7, -30, -19)Curveto(259, 373, 297, 385, 297, 387)te.end_fill()Moveto(323, 384)te.begin_fill()lineto(8, 7)lineto(30, -14)curveto_r(1, -1, 5, -6, 4, -7)Smooth(329, 379, 323, 384)te.end_fill()# 图层_11te.color("black", "#F3EEEB") # 脸Moveto(185, 212)te.begin_fill()curveto_r(4, -9, 46, -77, 52, -75)curveto_r(-2, -17, 19, -68, 27, -73)curveto_r(16, 15, 71, 108, 76, 112)smooth_r(76, 53, 86, 60)curveto_r(0, 65, -27, 75, -31, 76)curveto_r(-50, 28, -70, 30, -85, 30)smooth_r(-77, -22, -86, -26)Curveto(180, 302, 186, 228, 185, 212)te.end_fill()# 图层_12te.color("black", "#2B1D29") # 头发Moveto(189, 202)te.begin_fill()curveto_r(-1, 22, 19, 51, 19, 51)smooth_r(-10, -42, 7, -92)Curveto(212, 168, 196, 189, 189, 202)te.end_fill()Moveto(221, 155)te.begin_fill()curveto_r(-2, 6, 5, 48, 5, 48)smooth_r(18, -28, 20, -48)curveto_r(-5, 24, 4, 43, 7, 50)curveto_r(-10, -49, 3, -72, 13, -106)curveto_r(-2, -7, -3, -32, -3, -35)curveto_r(-17, 18, -27, 71, -27, 71)Lineto(221, 155)te.end_fill()Moveto(264, 64)te.begin_fill()curveto_r(-4, 5, 14, 100, 14, 100)smooth_r(-6, -79, -5, -85)curveto_r(0, 98, 49, 139, 49, 139)smooth_r(8, -50, 3, -65)Smooth(272, 64, 264, 64)te.end_fill()Moveto(342, 176)te.begin_fill()curveto_r(-1, 27, -10, 57, -10, 57)smooth_r(20, -33, 17, -54)Lineto(342, 176)te.end_fill()te.penup()te.begin_fill()polyline(349, 180, 353, 203, 361, 203)polyline(361, 203, 362, 188, 349, 180)te.end_fill()# 图层_13te.pensize(2)Moveto(210, 180) # 眉毛curveto_r(5, -4, 63, 9, 63, 14)Moveto(338, 193)curveto_r(0, -3, 18, -6, 18, -6)te.pensize(1)# 图层_14te.color("black", "#D1D1D1") # 眼睛1te.pensize(2)Moveto(206, 212)te.begin_fill()lineto(15, -7)curveto_r(4, -1, 26, -2, 30, 0)smooth_r(10, 3, 12, 7)te.pencolor("#D1D1D1")te.pensize(1)smooth_r(2, 27, -1, 30)smooth_r(-39, 5, -44, 1)Smooth(206, 212, 206, 212)te.end_fill()Moveto(384, 204)te.begin_fill()te.pencolor("black")te.pensize(2)curveto_r(-3, -1, -18, -1, -28, 1)smooth_r(-9, 6, -10, 9)te.pencolor("#D1D1D1")te.pensize(1)smooth_r(3, 18, 6, 23)smooth_r(38, 6, 40, 4)smooth_r(10, -9, 13, -22)te.pencolor("black")te.pensize(2)Lineto(384, 204)te.end_fill()# 图层_15te.color("#0C1631", "#0C1631") # 眼睛2te.pensize(1)Moveto(216, 206)te.begin_fill()curveto_r(-1, 5, 0, 26, 7, 35)smooth_r(30, 2, 33, 0)smooth_r(5, -31, 2, -34)Smooth(219, 203, 216, 206)te.end_fill()Moveto(354, 207)te.begin_fill()curveto_r(-2, 1, 2, 29, 4, 31)smooth_r(30, 3, 33, 1)smooth_r(6, -24, 4, -27)lineto(-11, -8)Curveto(382, 204, 357, 206, 354, 207)te.end_fill()# 图层_17te.color("#F5F5F5", "#F5F5F5") # 眼睛3Moveto(253, 211)te.begin_fill()curveto_r(-3, 0, -8, 8, 1, 10)Smooth(258, 210, 253, 211)te.end_fill()Moveto(392, 209)te.begin_fill()lineto(4, 3)vertical(4)lineto(-4, 2)Curveto(386, 214, 392, 209, 392, 209)te.end_fill()# 图层_18te.color("#352F53", "#352F53") # 眼睛4Moveto(219, 229)te.begin_fill()smooth_r(2, -5, 6, -4)smooth_r(18, 13, 27, 1)curveto_r(3, 0, 5, 3, 5, 3)vertical(13)Horizontal(224)Lineto(219, 229)te.end_fill()Moveto(357, 227)te.begin_fill()smooth_r(4, -6, 10, -2)smooth_r(10, 13, 19, 1)curveto_r(6, 0, 8, 6, 8, 6)lineto(-2, 9)curveto_r(-12, 3, -29, 0, -32, -2)Smooth(357, 227, 357, 227)te.end_fill()# 图层_19te.color("#9A90CB", "#9A90CB") # 眼睛5Moveto(227, 231)te.begin_fill()curveto_r(-6, 0, -5, 5, -3, 8)smooth_r(24, 2, 27, 0)smooth_r(0, -8, -1, -8)Smooth(234, 231, 227, 231)te.end_fill()Moveto(361, 227)te.begin_fill()curveto_r(2, 18, 26, 14, 30, 6)smooth_r(-1, -3, -2, -4)smooth_r(-15, 9, -24, -4)Curveto(363, 224, 361, 225, 361, 227)te.end_fill()# 图层_16te.pencolor("black") # 眼睛(线条)te.pensize(3)# Moveto(206,213)# lineto(14,-8)# curveto_r(3,-1,30,0,33,1)# lineto(10,6)Moveto(225, 215)curveto_r(10, 28, 22, 16, 24, 6)Moveto(365, 219)curveto_r(4, 14, 18, 24, 22, -3)te.pensize(2)line(240.5, 207.5, 227.5, 211.5)line(245.5, 209.5, 227.5, 214.5)line(247.5, 211.5, 227.5, 217.5)line(247.5, 214.5, 229.5, 220.5)line(247.5, 218.5, 230.5, 223.5)line(246.5, 222.5, 232.5, 226.5)line(244.5, 225.5, 234.5, 228.5)line(377.5, 207.5, 367.5, 210.5)line(384.5, 207.5, 366.5, 212.5)line(385.5, 210.5, 366.5, 215.5)line(384.5, 213.5, 366.5, 218.5)line(384.5, 215.5, 367.5, 220.5)line(384.5, 218.5, 368.5, 223.5)# line(383.5,220.5,368.5,225.5)line(382.5, 223.5, 370.5, 227.5)# line(381.5,226.5,373.5,229.5)# 图层_20te.pencolor("black")Moveto(309, 270) # 鼻子、嘴curveto_r(0, 0, 4, 7, 1, 9)line(296.5, 307.5, 303.5, 307.5)Moveto(315, 307)smooth_r(10, -1, 10, 2)te.penup()te.hideturtle()te.update()te.done()

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。