Explore
Courses
Batches
Sketches
Statistics
Code a Pookkalam
Jobs
Devsprint
People
Course Creation
Create a Course
Guidelines
Resources
Support
Blogs
My Profile
About Us
Login
Sketches
0
asher_sketch
By
Asher Mathews
Run
import random import math colors=["blue","red","green","black","purple"] def rose_flower(x,y,size,bud_color="green",petal_color="pink"): circle=Circle(center=Point(x=0,y=0),radius=size/4,stroke="orange",fill=bud_color) ellipses=Ellipse(center=Point(x=0,y=0),width=4*size,height=size,stroke="red",fill=petal_color)|rotate(angle=45)|scale(x=0.5,y=0.5)|repeat(4,rotate(angle=45)) return ellipses+circle|Translate(x=x,y=y) def lotus_flower(x,y,size,color="pink"): ellipse1=Ellipse(center=Point(x=0,y=0),width=size/2,height=2*size,fill=color)|repeat(2,rotate(angle=90)) ellipse2=Ellipse(center=Point(x=0,y=0),width=size/2,height=2*size,fill="red")|repeat(2,rotate(angle=90))|scale(x=0.75,y=0.75)|rotate(angle=45) ellipse3=Ellipse(center=Point(x=0,y=0),width=size/2,height=2*size,fill="black")|repeat(2,rotate(angle=90))|scale(x=0.5,y=0.5)|rotate(angle=90) return ellipse1+ellipse2+ellipse3|Translate(x=x,y=y) def basic_flower(x,y,size,color="red"): shape1=Ellipse(center=Point(x=0,y=0),width=size/2,height=2*size,fill=color,stroke=color)|repeat(10,rotate(angle=36)) shape1=shape1+(Circle(x=0,y=0,radius=size/4,fill="black")) return shape1|Translate(x=x,y=y) final=rose_flower(0,0,20,"black","pink")+(basic_flower(20,20,7)|repeat(12,rotate(angle=360/12)))+(basic_flower(7,17,4)|repeat(8,rotate(360/8))) final=final+lotus_flower(30,30,10,"green")|repeat(17,rotate(360/17)) rectangles=Rectangle(width=100,height=100,stroke="black",fill="#008080")|repeat(10,rotate(angle=360/10)) final=rectangles+final show(final)
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login