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
New Sketch
By
Nevin Gonsalvas
Run
c=circle(r=120,fill=color(r=255,g=255,b=0),stroke="none") 2 show(c) 3 c = circle(x=0,y=122,r=5,fill=color(r=255,g=0,b=0),stroke="none")|repeat(36*2,rotate(5)) 4 show(c) 5 p1=point(x=25,y=70) 6 p2=point(x=-25,y=70) 7 p3=point(x=0,y=110) 8 p4=point(x=0,y=30) 9 s = polygon([p1,p4,p2,p3],fill=color(r=255,g=255,b=255),stroke="purple",stroke_width=3) | repeat(8,rotate(45)) 10 show(s) 11 c=circle(r=60,fill=color(r=255,g=255,b=0),stroke="none") 12 show(c) 13 c = circle(x=0,y=59,r=5,fill=color(r=255,g=0,b=0),stroke="none")|repeat(36*2,rotate(10)) 14 show(c) 15 c = circle(x=0,y=59,r=2,fill=color(r=255,g=215,b=0),stroke="none")|repeat(36*2,rotate(10)) 16 show(c) 17 shape = ellipse(w=100,h=50,fill=color(r=255,g=145,b=0),stroke="green",stroke_width=2)| repeat(6, rotate(60)) 18 show(shape) c=circle(r=35,fill=color(r=255,g=255,b=0),stroke="green",stroke_width=2) 20 show(c) 21 c=circle(x=0,y=30,r=2,fill=color(r=255,g=20,b=147),stroke="none")|repeat(36,rotate(10)) 22 show(c) 23 c=circle(x=0,y=15,r=2,fill=color(r=255,g=20,b=147),stroke="none")|repeat(18,rotate(20)) 24 show(c) 25 c = circle(r=10,fill="red",stroke="none") 26 show(c) 27 c = circle(r=5,fill="white",stroke="none") 28 show(c) 29 30 def random_color(): 31 r = random(255) 32 g = random(255) 33 b = random(255) 34 return color(r=r, g=g, b=b, a=0.5) 35 bud = circle(r=20,fill=random_color()) 36 petal1 = ellipse(y=60,w=20,h=100,stroke="#00000",stroke_width = 1,fill=random_color()) 37 petal2 = ellipse(y=40,w=20,h=50,stroke="#00000",stroke_width = 1,fill=random_color()) 38 petals = (petal1+petal2 | repeat(8,rotate(45))) 39 40 flower =(bud+petals) | scale(0.25) 41 flower_ring = flower | translate(x=50,y=30) | repeat(8,rotate(45)) 42 flowerbed = flower 53 44 num_layers = 5 45 46 for i in range(num_layers): 47 flowerbed = (flower_ring | scale(2**i) | rotate(60)) +flowerbed 48 49 show(rectangle(x=0,y=0,h=300,w=300,fill="#FFFF99"),flowerbed | scale(0.125))
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login