Pookkalam by Nihad

Code

#Author-Nihad
c1 = circle(r=149,fill="Crimson")
c2 = circle(r=145,fill="#000000")
show(c1,c2)
#Drawing Outer Ring
def square (side,colour,rotation):
    s=rectangle (w=side,h=side,fill=colour,stroke="none")|rotate(rotation)
    return s
#Function that create squares
layer1=square(204.2,"#FF8C00",0)|repeat(10,rotate(10))
layer2=square(188.5,"#F8E63D",5)|repeat(10,rotate(10))
layer3=square(174,"white",0)|repeat(10,rotate(10))
layer4=square(160.5,"DarkSalmon",5) |repeat(10,rotate(10))
layer5=square(148,"Firebrick",0)|repeat (10,rotate(10))
show(layer1,layer2,layer3,layer4,layer5)
#Drawing different colored layers
c1=circle(r=96.5,fill="black",stroke="none")
c2=circle (r=95,fill= "LavenderBlush" , stroke="none")
show(c1,c2)
#Drawing the second Ring
line=line(x1=0,y1=60,x2=0,y2=94.9,stroke="olive")|repeat (200,rotate(2))
show(line)
#Drawing Vertical Lines
p1=point (-36,-88)
p2=point (-36,88)
p3=point (88,-36)
p4=point (-88,-36)
p5=point (36,88)
p6=point (36,-88)
p7=point (-88,36)
p8=point (88,36)
p9=point (-36,-88)
#cordinates of star
star=polygon([p1,p2,p3,p4,p5,p6,p7,p8,p9],fill="Tomato", stroke="none")
show (star)
#Drawing Star
c1=circle(r=62,fill="Maroon", stroke="none")
c2=circle(r=59.5,fill="silver", stroke="none")
c3=circle (r=10,fill="wheat")
show (c1,c2,c3)
#Drawing inner ring
def square(length,colour):
    s=rectangle(w=length,h=length,x=22,y=22,fill=colour,stroke="none")
    return s
#A function that Create Squares
squares=square(40,"#000000")+square (30,"#FF8C00")+square (20,"#F8E63D")+square (10,"white")
rotating_squares=squares|repeat(8, rotate (45))
show(rotating_squares)
#Drawing the squares in inner ring
p1=point(4,4)
p2=point (40,4)
p3=point (40,40)
s1=polygon([p1,p2,p3],fill="#000000")
p4=point(5,8)
p5=point (36,8)
p6=point (36.2,37.1)
s2=polygon ([p4,p5,p6],fill="#FF8C00",stroke="none")
p7=point(9,12)
p8=point(31,12)
p9=point (30.6,32)
s3=polygon ([p7,p8,p9],fill="#F8E63D",stroke="none")
p10=point (13.5,16)
p11=point(25,16)
p12=point (25,27)
s4=polygon ([p10,p11,p12],fill="white", stroke="none")
show(s1,s2,s3,s4)
#One of the squares in inner ring is not overlaped
#So 4 triangles are drawing with the same colour of square to make overlaped eachother
e = ellipse(x=0,y=5,w=5,h=10,fill="DeepSkyBlue", stroke="#0000FF")|repeat(13,rotate(30))|translate (x=0,y=78)
e1=e|repeat (8, rotate (45))
e2=ellipse (x=0,y=15,w=10,h=20,fill="red")|repeat(13,rotate(30))
show(e1,e2)
#Drawing the flowers
#HAPPY ONAM