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
5
NavaneethaRajesh_2024_MEC
By
Navaneetha Rajesh
Run
############################################################################ #outer flower petal designs #method: using squares of suitable size and rotating them to form petals #white petals o_1=rectangle(w=210,h=210,fill='#e5ddc1',stroke='none') outer_1=o_1 |repeat(24,rotate(15)) #yellow petals o_2=rectangle(w=195,h=195,fill='#e8ce45',stroke='none') outer_2=o_2 |repeat(24,rotate(15)) #orange petals o_3=rectangle(w=177,h=177,fill='#dd7034 ',stroke='none') outer_3=o_3 |repeat(20,rotate(18)) #red petals o_4=rectangle(w=155,h=155,fill='#8c1d1a',stroke='none') outer_4=o_4 |repeat(20,rotate(18)) | rotate(10) #combining outer sections outer=combine([outer_1,outer_2,outer_3,outer_4]) show(outer) ############################################################################ #dark background #method: using circle() bg_out=circle(r=90,fill='#130b0a') show(bg_out) ############################################################################ #multicolor petals #sq function to return squares using rectangle() function def sq(color,l,x,y): r=rectangle(h=l,w=l,x=x,y=y,stroke='none',fill=color) return r #pattern() function to return a single multicolor square def pattern(x,y,l): s1=sq(l=l,x=x,y=y,color='#8c1d1a') s2=sq(l=4*(l/5),x=x,y=y,color='#dd7034') s3=sq(l=3*(l/5),x=x,y=y,color='#e8ce45') s4=sq(l=2*(l/5),x=x,y=y,color='#e5ddc1') n=combine([s1,s2,s3,s4]) return n #calling pattern() function to make multiple squares #finally making a petal pattern by rotating appropriately a=pattern(x=30,y=30,l=50) | repeat(8,rotate(45)) |scale(1.1) show(a) ############################################################################ #background for centre piece #black border centre1=circle(r=60,fill='#130b0a') #orange band with red border centre2=circle(r=50,fill='#dd7034',stroke='#8c1d1a',stroke_width=5) #yellow band centre3=circle(r=40,fill='#e8ce45',stroke='none') #white band centre4=circle(r=35,fill='#e5ddc1',stroke='none') #combining entire background of centre centre_bg=combine([centre1,centre2,centre3,centre4]) show(centre_bg) ############################################################################ #foreground/centre #making of polygons for making tree shape #using a user-defined function tree() def tree(z,k,sc): z=z-1 k=k-6.5 #bark of the tree #points plotted with the help of cartesian system j1=point(x=z+0.3,y=k-1.98) j2=point(x=z+0.27,y=k-0.32) j3=point(x=z+0.23,y=k+1.18) j4=point(x=z+0.34,y=k+2.59) j5=point(x=z+0.87,y=k+4.82) j6=point(x=z+1.34,y=k+6.2) j7=point(x=z+0.73,y=k+6.29) j8=point(x=z+0.1,y=k+4.68) j9=point(x=z-0.35,y=k+2.98) j10=point(x=z-0.55,y=k+1.25) j11=point(x=z-0.52,y=k-0.31) j12=point(x=z-0.46,y=k-1.95) #polygon formed joining the points for the bark of tree stem=polygon([j1,j2,j3,j4,j5,j6,j7,j8,j9,j10,j11,j12],fill='brown') |scale(x=5,y=10) #leaves of the tree #points plotted using cartesian system l1_1=point(x=z+5.06,y=k+3.31) l1_2=point(x=z+5.09,y=k+4.67) l1_3=point(x=z+4.15,y=k+5.69) l1_4=point(x=z+0.96,y=k+6.68) l1_5=point(x=z+2.42,y=k+7.23) l1_6=point(x=z+3.78,y=k+7.16) l1_7=point(x=z+4.98,y=k+6.5) l1_8=point(x=z+5.64,y=k+5.22) #points joined to form a singular leaf l1=polygon([l1_1,l1_2,l1_3,l1_4,l1_5,l1_6,l1_7,l1_8],fill="green",stroke='none') #leaf duplicated and rotated to form multiple leaves leaf= l1 |repeat (3,rotate(30))|scale(10) #the leaves of one side mirrored to fill the other side l_rev= leaf |scale(x=-1) #circles for coconuts coconut=circle(r=0.001,fill='black',x=z+0.73,y=k+6.29)+circle(r=0.001,fill='black',x=z+1.34,y=k+6.2) |scale(10) #entire parts of tree combined t=combine([stem,leaf,l_rev,coconut]) show(t|scale(sc) | translate(x=-9,y=12)) #calling of tree() function tree(z=0,k=0,sc=0.4) #vallam() function to make the vallam/boat figure def vallam(f,g,sca,fi): #points plotted with the help of cartesian system p1=point(x=f-5,y=g+0) p2=point(x=f-3.28,y=g+0.22) p3=point(x=f-1.84,y=g+0.62) p4=point(x=f-0.64,y=g+1.22) p5=point(x=f+0.36,y=g+2.38) p6=point(x=f+1,y=g+3.8) p7=point(x=f+1,y=g+5) p8=point(x=f+0.78,y=g+5.98) p9=point(x=f+2.54,y=g+7.88) p10=point(x=f+2.92,y=g+6.72) p11=point(x=f+3.18,y=g+5.48) p12=point(x=f+3,y=g+4) p13=point(x=f+2.24,y=g+2.16) p14=point(x=f+0.48,y=g+0.82) p15=point(x=f-1.48,y=g+0.22) p16=point(x=f-3,y=g+0) #making a polygon to form the shape of vallam/boat sh=polygon([p1,p2,p3,p4,p5,p6,p7,p8,p9,p10,p11,p12,p13,p14,p15,p16],fill=fi) #3 circle figures on the vallam/boat cir1=circle(r=0.20,fill='white',x=f+1.37,y=g+5.88,stroke='none') cir2=circle(r=0.20,fill='white',x=f+1.96,y=g+6.46,stroke='none') cir3=circle(r=0.20,fill='white',x=f+2.4,y=g+7.01,stroke='none') #combining the entire vallam/boat figure n=combine([sh,cir1,cir2,cir3]) show(n|scale(sca)) #calling of vallam() function to form two vallams/boats vallam(f=3,g=-10,sca=2,fi='black') vallam(f=8,g=-10,sca=2,fi='black') ############################################################################
Comments
Want to discuss?
Post it here, our mentors will help you out.
Login