玫瑰花绘制

我们主要采用turtle库,运用circle来实现弧的绘制。

import turtle
turtle.setup(800,600,0,0)
turtle.speed(7)
turtle.pensize(1)
turtle.penup()
turtle.goto(0,100)
turtle.begin_fill()
turtle.fillcolor('red')
turtle.pendown()
turtle.circle(10,180)
turtle.circle(15,90)
turtle.seth(320)
turtle.circle(30,120)
turtle.seth(150)
turtle.circle(50,100)
turtle.seth(-80)
turtle.fd(50)
turtle.circle(50,70)
turtle.circle(50,30)
turtle.circle(50,30)
turtle.seth(40)
turtle.circle(30,60)
turtle.fd(20)
turtle.seth(120)
turtle.fd(60)#到花中心的右上方
turtle.end_fill()

turtle.speed(30)
turtle.begin_fill()
turtle.fillcolor('red')
turtle.seth(0)
turtle.circle(-20,70)
turtle.seth(70)
turtle.fd(20)
turtle.seth(-40)
turtle.circle(-90,100)#右弧
turtle.circle(-30,60)#di
turtle.seth(170)#左弧
turtle.circle(-90,100)
turtle.seth(270)
turtle.circle(100,60)
turtle.seth(0)
turtle.circle(-40,81)#底部

turtle.seth(130)
turtle.circle(-120,30)
turtle.seth(80)
turtle.circle(-80,30)
turtle.seth(70)
turtle.circle(-40,30)
turtle.seth(83)
turtle.fd(22)
turtle.end_fill()

turtle.speed(15)
turtle.penup()#茎
turtle.goto(50,-13)
turtle.pendown()
turtle.seth(-90)
turtle.circle(180,60)
turtle.seth(-30)
turtle.circle(-180,40)


turtle.penup()#叶子
turtle.goto(74,-105)
turtle.pendown()
turtle.seth(40)
turtle.circle(180,20)
turtle.penup()
turtle.goto(94,-85)
turtle.fillcolor('green')
turtle.begin_fill()
turtle.pendown()
turtle.seth(100)
turtle.circle(-60,100)
turtle.seth(-80)
turtle.circle(-60,100)
turtle.end_fill()
turtle.seth(45)
turtle.fd(60)

turtle.penup()
turtle.goto(152,-178)
turtle.pendown()
turtle.seth(160)
turtle.circle(180,20)
turtle.penup()
turtle.goto(120,-168)
turtle.begin_fill()
turtle.seth(130)
turtle.pendown()
turtle.circle(60,100)
turtle.seth(-50)
turtle.circle(60,100)
turtle.end_fill()
turtle.seth(160)
turtle.circle(100,40)
turtle.exitonclick()

  成员:王梦瑶 孟丹

posted @ 2017-11-01 08:32  王梦瑶  阅读(208)  评论(0编辑  收藏  举报