绘制玫瑰
Posted SXSY
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了绘制玫瑰相关的知识,希望对你有一定的参考价值。
import turtle turtle.setup(0.35,0.75) turtle.seth(90) turtle.penup() turtle.fd(200) turtle.seth(0) turtle.pendown() turtle.fillcolor("red") turtle.begin_fill() for i in range(1,4): turtle.circle(20*i,200) turtle.circle(20,30) turtle.seth(-90) turtle.fd(40) turtle.fd(60) turtle.seth(120) turtle.fd(10) turtle.fd(10) turtle.left(180) turtle.seth(-135) turtle.seth(-120) turtle.circle(100,45) turtle.circle(100,45) turtle.circle(100,10) turtle.circle(100,10) turtle.seth(30) turtle.circle(180,80) turtle.seth(-100) turtle.circle(-180,10) turtle.seth(120) turtle.circle(50,30) turtle.end_fill() turtle.seth(-30) turtle.circle(-50,30) turtle.seth(-100) turtle.circle(-180,30) turtle.circle(138,46) turtle.seth(45) turtle.circle(50,45) turtle.circle(50,45) turtle.circle(50,10) turtle.circle(-145,32) turtle.penup() turtle.goto(30,200) turtle.seth(45) turtle.fd(32) turtle.seth(-90) turtle.pendown() turtle.fd(80) turtle.penup() turtle.goto(0,15) turtle.pendown() turtle.circle(180,30) turtle.seth(10) turtle.circle(180,20) turtle.penup() turtle.left(180) turtle.fd(30) turtle.seth(180) turtle.fd(20) turtle.seth(-90) turtle.fd(2) turtle.pendown() turtle.fillcolor("green") turtle.begin_fill() turtle.seth(75) turtle.circle(-80,80) turtle.seth(-100) turtle.circle(-75,90) turtle.end_fill() turtle.seth(20) turtle.circle(100,40) turtle.left(180) turtle.circle(-100,40) turtle.seth(200) turtle.fd(10) turtle.seth(-60) turtle.fd(100) turtle.seth(180) turtle.circle(100,10) turtle.seth(150) turtle.begin_fill() turtle.circle(80,80) turtle.seth(150) turtle.fd(5) turtle.seth(-30) turtle.circle(90,75) turtle.end_fill() turtle.seth(-160) turtle.circle(-100,30) turtle.left(180) turtle.circle(100,30) turtle.seth(15) turtle.fd(15) turtle.seth(-60) turtle.fd(100) turtle.exitonclick()
以上是关于绘制玫瑰的主要内容,如果未能解决你的问题,请参考以下文章