python turtle画 美乐蒂


import turtle
# turtle.bgcolor("#a3dcf7")
turtle.setup(800,800)
p = turtle.Turtle()
p.speed(12)
p.pensize(4)
p.color("black")



#头
p.penup()
p.goto(-16,-150)
p.pendown()
p.fillcolor("#f29aaa")
p.begin_fill()
p.goto(-43,-199)
p.goto(-124,-158)
p.goto(-95,-131)
p.seth(341)
p.circle(119,-138)
p.goto(-70,206)
p.goto(-45,267)
p.goto(-22,299)
p.seth(231)
p.circle(51,-131)
p.goto(71,242)
p.goto(65,190)
p.seth(205)
p.circle(70,-113)
p.goto(159,63)
p.goto(159,51)
p.goto(168,39)
p.seth(127)
p.circle(117,-113)
p.goto(94,-151)
p.goto(116,-171)
p.goto(84,-192)
p.goto(38,-207)
p.goto(16,-153)
p.goto(-16,-150)
p.end_fill()


#耳朵
p.penup()
p.goto(123,116)
p.pendown()
p.goto(95,86)
p.goto(69,73)
p.seth(36)
p.circle(47,-140)
p.seth(250)
p.circle(110,-53)

#脸
p.fillcolor("white")
p.begin_fill()
p.penup()
p.goto(-101,-128)
p.pendown()
p.seth(337)
p.circle(60,-122)
p.seth(219)
p.circle(128,-43)
p.seth(182)
p.circle(186,-45)
p.seth(142)
p.circle(60,-114)
p.goto(76,-151)
p.goto(31,-153)
p.goto(-2,-152)
p.goto(-45,-145)
p.goto(-87,-135)
p.goto(-101,-128)
p.end_fill()

#花
p.begin_fill()
p.penup()
p.goto(-86,56)
p.pendown()
p.goto(-96,48)
p.seth(39)
p.circle(27,-169)
p.goto(-124,94)
p.seth(342)
p.circle(26,-153)
p.goto(-112,147)
p.goto(-97,142)
p.goto(-89,130)
p.seth(247)
p.circle(26,-175)
p.goto(-43,106)
p.goto(-48,97)
p.seth(147)
p.circle(29,-148)
p.goto(-75,48)
p.goto(-86,56)
p.end_fill()

#手
p.begin_fill()
p.penup()
p.goto(-88,-170)
p.pendown()
p.seth(312)
p.circle(23,-129)
p.seth(199)
p.circle(26,-178)
p.goto(-57,-181)
p.seth(90)
p.circle(44,-70)
p.seth(359)
p.circle(22,-97)
p.seth(277)
p.circle(26,-82)
p.goto(-88,-170)
p.end_fill()




p.fillcolor("yellow")
p.begin_fill()
p.seth(0)
p.penup()
p.goto(-88,75)
p.pendown()
p.circle(20)
p.end_fill()


p.fillcolor("#514139")
p.begin_fill()
p.penup()
p.goto(-103,-58)
p.pendown()
p.seth(260)
p.circle(15,172)
p.goto(-69,-54)
p.goto(-68,-42)
p.seth(84)
p.circle(15,155)
p.goto(-100,-43)
p.goto(-102,-57)
p.goto(-103,-58)
p.end_fill()
p.begin_fill()
p.penup()
p.goto(75,-57)
p.pendown()
p.seth(251)
p.circle(13,-151)
p.goto(104,-76)
p.goto(102,-88)
p.seth(76)
p.circle(14,-144)
p.goto(71,-79)
p.goto(72,-65)
p.goto(75,-57)
p.end_fill()


p.fillcolor("#fcfbbb")
p.begin_fill()
p.penup()
p.goto(-9,-72)
p.pendown()
p.seth(213)
p.circle(11,128)
p.goto(2,-92)
p.goto(8,-92)
p.seth(29)
p.circle(11,115)
p.goto(3,-71)
p.goto(-8,-70)
p.goto(-9,-72)
p.end_fill()

p.fillcolor("darkred")
p.begin_fill()
p.penup()
p.goto(-11,-123)
p.pendown()
p.goto(-11,-126)
p.goto(-11,-129)
p.goto(-9,-132)
p.goto(-6,-133)
p.goto(-1,-131)
p.goto(1,-127)
p.goto(1,-122)
p.goto(-1,-118)
p.goto(-3,-116)
p.goto(-6,-116)
p.goto(-11,-119)
p.goto(-10,-123)
p.goto(-11,-123)
p.end_fill()

美乐通常是指一种经典的日本卡通角色,如果你想用Python制作类似美乐的图像,你可以考虑使用PIL(Python Imaging Library)或者其后续版本Pillow库来绘制简单的图形。下面是一个简化的示例,展示如何使用Pillow创建一个基础的美乐头像: ```python from PIL import Image, ImageDraw, ImageFont # 定义美乐头部的基本形状 def draw_melody_face(size): img = Image.new('RGB', size, (255, 255, 255)) # 创建白色背景 draw = ImageDraw.Draw(img) # 眼睛、鼻子和嘴巴的位置 eye_pos = (size[0] // 4, size[1] // 2 - size[1] // 8) nose_pos = (eye_pos[0], eye_pos[1] + size[1] // 6) mouth_pos = (eye_pos[0], eye_pos[1] - size[1] // 4) # 绘制眼睛 draw.ellipse((eye_pos[0]-5, eye_pos[1]-5, eye_pos[0]+5, eye_pos[1]+5), fill="black") draw.ellipse((eye_pos[0]-3, eye_pos[1]-3, eye_pos[0]+3, eye_pos[1]+3), fill="white") # 绘制鼻子 draw.rectangle(nose_pos + (-3, -3, 3, 3), fill="red") # 绘制微笑的嘴形 mouth_width = size[0] // 10 mouth_top = mouth_pos[1] - size[1] // 12 mouth_bottom = mouth_top + size[1] // 3 draw.line([(mouth_pos[0], mouth_top), (mouth_pos[0], mouth_bottom)], fill="black", width=2) return img # 使用函数并保存图片 image = draw_melody_face((100, 100)) image.save("melody_face.png") ``` 这个例子非常基础,实际美乐的形象可能会更复杂,包括更多的细节。如果你想要制作更精致的美乐,可能需要学习更多关于矢量绘图的知识,并使用专门的设计工具。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值