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
2
HAPPY Expecto PatrONAM
By
Prathyush Madhu
Run
""" Name : Prathyush Madhusoodhanan 2nd year btech student (CSE) TKM college of engineering, Kollam """ """ The program is mainly divided into four parts : 1) Main Outer Circle 2) Outer Layer 3) Middle Layer 4) Inner Layer 5) Inner Middle Layer """ # Main Outer Circle: c1 =circle(r=150,fill='#3c024c',stroke='black',stroke_width=(1.5)) show (c1) #Outer Layer: r1 = rectangle (w=208,h=209,fill='#8d07ad', stroke='black',stroke_width=(1.5)) | repeat (30,rotate(20)) r2=rectangle(w=192,h=192, fill='#de04a8',stroke='black',stroke_width=(1.5))|rotate(15)| repeat(30,rotate(20)) r3=rectangle(w=175,h=178,fill='#de0448',stroke='black',stroke_width=(1.5))|repeat(30,rotate(20)) r4=rectangle(w=163,h=166,fill='#fc99b8',stroke='black',stroke_width=(1.5))|rotate(15)|repeat(30,rotate(20)) r5=rectangle(w=152,h=155,fill='#fffafb',stroke='black',stroke_width=(1.5))|repeat(30,rotate(20)) show(r1,r2,r3,r4,r5) # Middle Layer: rec1=rectangle(w=150,h=150 ,fill='#fa9637',stroke='none')|rotate(22.5) rec2=rec1|rotate(45) rec3=rectangle(w=140,h=140 ,fill='#dc6e06',stroke='none')|rotate(22.5) rec4=rec3|rotate(45) rec5=rectangle(w=130,h=130 ,fill='#ef3910',stroke='none')|rotate(22.5) rec6=rec5|rotate(45) show(rec1,rec2,rec3,rec4,rec5,rec6) # Inner Layer: colour=['#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002','#E3BD36',"#F8E63D","#fff7f5",'#a92822','#Fd6002'] def polygon_1_layer(colour): p1 = point(x=-11,y=75) p2 = point(x=11,y=75) p3 = point(x=-6,y=65) p4 = point(x=6,y=65) p = polygon([p1,p2,p4,p3],fill=colour,stroke="none")|rotate(10+(index*10)) return(p) def polygon_2_layer(colour): p1 = point(x=-10.26,y=70) p2 = point(x=10.26,y=70) p3 = point(x=-5.53,y=60) p4 = point(x=5.53,y=60) p = polygon([p1,p2,p4,p3],fill=colour,stroke="none")|rotate(10+(index*10)) return(p) # Call above function """ Polygon first layer (containing consecutive 3 layer)""" for index in range(36): s1=polygon_1_layer(colour[index])|rotate(10)|scale(0.95) show(s1) for index in range(36): s2=polygon_1_layer(colour[index])|scale(1.05) show(s2) for index in range(36): s3=polygon_1_layer(colour[index])|rotate(-10)|scale(1.15) show(s3) """ Polygon second layer(another consecutive three layers)""" for index in range(36): s1=polygon_2_layer(colour[index])|rotate(10)|scale(0.88) show(s1) for index in range(36): s2=polygon_2_layer(colour[index])|scale(0.75) show(s2) for index in range(36): s3=polygon_2_layer(colour[index])|rotate(-10)|scale(0.65) show(s3) # Inner Middle Layer: p1 = point(0, 11.2) p2 = point(10, 10.2) p3 = point(3.2, 19) p4 = point(-3.2, 9) p5 = point(-10, 11.30) poly1 = polygon([p1, p2, p3, p4, p5], fill="#f8fcf8", stroke="none") poly2 = polygon([p1, p2, p3, p4, p5], fill="#228B22", stroke="none") poly3 = polygon([p1, p2, p3, p4, p5], fill="#32CD32", stroke="none") poly4 = polygon([p1, p2, p3, p4, p5], fill="#008000", stroke="none") poly1_rot = poly1 | repeat(4, rotate(90)) poly2_rot = poly2 | repeat(4, rotate(90)) | scale(2) poly3_rot = poly3 | repeat(4, rotate(90)) | scale(1.9) poly4_rot = poly4 | repeat(4, rotate(90)) | scale(1.8) show(poly1_rot + poly2_rot + poly3_rot + poly4_rot )
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login