研一了才知道编程重要性,本科时候有个python画图书馆的活动,但当时turtle库函数都不会
昨晚闲的没事(其实是摸鱼),就画了下哈工大机电学院的logo,文字旋转好像得用matplotlib库,稍微改了点颜色
出来的效果大概这样,对比下右侧原图,感觉还原度一般
有空画画我燕大校徽和机械院徽
import turtle as t
t.colormode(255)
#t.pencolor(0,100,200)
t.speed(100)
t.screensize(1080,720,"white")
t.pencolor('gold')
t.setup(width=800,height=800,startx=None,starty=None)
t.penup()
t.title('HIT-SME')
#外圆
t.pensize(4.5)
t.goto(-300,0)
t.pendown()
t.right(90)
t.circle(300,360)
t.penup()
#齿圈
t.pensize(3)
t.seth(0)
t.goto(-185,0)
t.pendown()
t.fillcolor('blue')
t.begin_fill()
t.back(25)
t.right(90)
for i in range(7):
t.circle(210,extent = 5)
t.right(90)
t.forward(20)
t.left(90)
t.circle(230,extent = 15.715)
t.left(90)
t.forward(20)
t.right(90)
t.circle(210,extent = 5)
t.goto(185,0)
t.circle(185,-180)
t.end_fill()
#上环
t.pencolor('blue')
t.goto(-180,0)
t.seth(-90)
t.pensize(10)
t.circle(180,-70)
t.penup()
t.goto(180,0)
t.pendown()
t.seth(90)
t.pensize(10)
t.circle(180,70)
t.penup()
t.goto(0,180)
t.dot(60,'blue')
#下环
t.pensize(2)
t.pencolor(120,0,165)
t.seth(0)
t.goto(-175,0)
t.pendown()
t.begin_fill()
t.fd(25)
t.right(90)
#凸圆部分
t.begin_fill()
t.circle(150,80.48)
t.circle(15,80)
t.goto(-5,-133)
t.seth(90)
t.goto(-5,115)
t.right(90)
t.fd(5)
t.right(90)
t.fd(290)
t.right(90)
t.circle(-175,90)
t.end_fill()
t.penup()#对称绘制
t.goto(150,0)
t.seth(270)
t.pendown()
t.begin_fill()
t.circle(-150,80.48)
t.circle(-15,80)
t.goto(5,-133)
t.seth(90)
t.goto(5,115)
t.left(90)
t.fd(5)
t.left(90)
t.fd(290)
t.left(90)
t.circle(175,90)
t.left(90)
t.fd(25)
t.penup()
t.end_fill()
#地球仪
t.pencolor('green')
t.pensize(7)
t.goto(0,115)
t.pendown()
t.circle(115,360)
t.right(36.87)
t.circle(143.75,-106.26)
t.penup()
t.goto(0,115)
t.pendown()
t.seth(-143.13)#
t.circle(143.75,106.26)
t.penup()
t.goto(0,67.5)
t.pendown()
t.seth(0)
t.circle(136.05,32.74)
t.penup()
t.goto(0,67.5)
t.pendown()
t.seth(180)
t.circle(-136.05,32.74)
t.penup()
t.goto(0,-67.5)
t.pendown()
t.seth(0)
t.circle(-136.05,32.74)
t.penup()
t.goto(0,-67.5)
t.pendown()
t.seth(180)
t.circle(136.05,32.74)
t.penup()
t.goto(-115,0)
t.pendown()
t.goto(115,0)
t.penup()
"""
t.right(90)
t.fd(25)
t.right(90)
t.circle(-175,180)
t.end_fill()
"""
#书写文字
t.pencolor('blue')
name = '哈尔滨工业大学机电工程学院'
t.goto(-285, 10)
k =71.5
for i in range(len(name)):
t.seth(k)
k = k - 13
t.write(name[i],font=('STHupo',35,"normal"))
t.forward(61.1297)
t.pencolor('blue')
Eng_name = 'SCHOOL OF MECHATRONICS ENGINEER,HIT'
t.goto(-280, -45)
k =-77.647
for i in range(len(Eng_name)):
t.seth(k)
k = k + 4.706
t.write(Eng_name[i],font=('SimHei',20,"bold"))
t.forward(22.994)
t.hideturtle()
t.done()