Pookkalam by Sreehari U S

Code

c1 =circle(r=150,fill='black')



#outer layer

sublayer1 = rectangle (w=209,h=209,fill="blue", stroke="black") | repeat (20,rotate(80))



sublayer2=rectangle(w=192,h=192, fill="red",stroke="black")|rotate(15)| repeat(20,rotate(60))



sublayer3=rectangle(w=178,h=178,fill="yellow",stroke="orange")|repeat(20,rotate(40))



sublayer4=rectangle(w=166,h=166,fill="green",stroke="white")|rotate(15)|repeat(20,rotate(20))



#middle layer

c2=circle(r=106,fill='black',stroke='black') + circle(r=95,fill='purple') + circle(r=89,fill='green') 




e1=ellipse(h=165,w=30,fill='sky blue',stroke_width=0.2)|repeat(15,rotate(40)) 

c = circle(r=120,fill='#168D6D')

c0=circle(r=130,fill="red")

m0=rectangle(h=184,w=184,fill="purple")|repeat(100,rotate(20))

m2=rectangle(h=175,w=175,fill="blue")|repeat(100,rotate(20))

m5=rectangle(h=158,w=158,fill="orange")|repeat(100,rotate(20))

m4=rectangle(h=150,w=150,fill="indigo")|repeat(100,rotate(20))

c=circle(r=90,fill="purple")
z=circle(r=50,x=20,y=20)
z1=z|repeat(36,rotate(30))
z2=circle(r=80,fill="red")
z3=circle(r=20,fill="black")
z4=circle(r=70,fill="yellow")
y = ellipse(x=60,w=50,h=10,fill="lightblue") | repeat(36,rotate(10))
def bottomEllipse(x,y,w,h,fill):
    e = ellipse(x,y+h/2,w,h,fill=fill,stroke="none")
    return(e)
def petal(x,y,h,c1,c2,c3):
    p1=bottomEllipse(x,y,h/2,h,fill=c1)
    p2=bottomEllipse(x,y,h/3,h/1.5,fill=c2)
    p3=bottomEllipse(x,y,h/4,h/2,fill=c3)
    return(p1+p2+p3)
def flower(n,c1,c2):
    d = petal(0,n/4,n,c1,c2,c1)|repeat(8,rotate(45))
    c=circle(r=n/4,fill=c2,stroke="none")
    return(d+c)
d1="pink"
d2="purple"
f1 = flower(25,d1,d2)


show(c1,sublayer1,sublayer2,sublayer3,sublayer4,c2,z1,z2,z3,z4,y,f1)