【Python绘图】Rose

        画了一朵玫瑰花,还是没能处理好颜色填充的问题~~~

        代码:

#Rose
import turtle as t
t.screensize(800,600,"pink")
t.setup(0.4,0.8)
t.pensize(4)
#1
t.fillcolor("red")
t.begin_fill()
t.penup()
t.goto(0,150)
t.pendown()
t.fd(12)
t.circle(-8,195)
t.fd(22)
t.seth(110)
t.circle(-23,230)
#2
t.seth(-164)
t.circle(-90,42)
t.seth(75)
t.fd(22)
t.seth(25)
t.circle(-140,15)
t.seth(5)
t.fd(32)
t.seth(-50)
t.circle(-40,75)
t.seth(200)
t.circle(65,45)
t.fd(15)
t.seth(90)
t.circle(-60,60)
t.seth(187)
t.circle(-120,40)
t.seth(-80)
t.fd(38)
#3
t.penup()
t.goto(-4,175)
t.pendown()
t.seth(75)
t.fd(14)
t.seth(183)
t.circle(92,40)
t.right(45)
t.circle(23,145)
t.penup()
t.goto(9,177)
t.pendown()
t.seth(80)
t.fd(19)
t.seth(0)
t.circle(-227,12)
t.left(20)
t.circle(-24,135)
t.seth(-124)
t.circle(-200,15)
t.seth(-94)
t.circle(-48,57)
#4
t.seth(-24)
t.fd(11)
t.seth(173)
t.circle(-127,28)
t.right(15)
t.circle(95,49)
t.seth(-70)
t.circle(100,24)
t.right(24)
t.circle(62,120)
t.seth(0)
t.circle(50,40)
t.seth(60)
t.circle(-45,55)
t.seth(165)
t.circle(-50,25)
t.seth(105)
t.circle(16,92)
t.penup()
t.goto(-75,95)
t.pendown()
t.seth(185)
t.circle(92,20)
t.seth(-17)
t.fd(31)
t.seth(-85)
t.circle(32,110)
t.end_fill()
#5
t.seth(0)
t.fd(20)
t.seth(-87)
t.fd(58)
t.right(5)
t.fd(80)
t.left(9)
t.fd(30)
#6
t.penup()
t.goto(-12,10)
t.pendown()
t.fillcolor("green")
t.begin_fill()
t.seth(162)
t.fd(20)
t.seth(110)
t.circle(28,100)
t.seth(-75)
t.circle(29,100)
t.end_fill()
t.penup()
t.goto(-9,-22)
t.pendown()
t.begin_fill()
t.seth(20)
t.fd(27)
t.seth(85)
t.circle(-24,100)
t.seth(-92)
t.circle(-25,104)
t.end_fill()
#署名
t.penup()
t.goto(180,-150)
t.pendown()
t.pencolor("white")
t.write("LD Yang",align="right",font=("Ink Free","19","normal"))
t.done()

        参考图片: 

 

        运行效果: 

        今天发现了一个有趣的库,下次绘图应该会用到~~~ 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值