Pookkalam by Vishnu

Code

#center
def square(color, side):
    return rectangle(w=side, h=side, fill=color, stroke='none')
sq1=square(side=140,color='#e0dc65') | repeat(10,  rotate(15))
sq2=square(side=160,color='#f59e42') | rotate(30)|repeat(10,  rotate(15))
sq3=square(side=190,color='red') | rotate(37.5)|repeat(10,  rotate(15))
center1=combine([sq3,sq2,sq1])
center2=center1 | scale(0.5)




x4 = circle(r=100,fill="red",stroke="none")
x1 = ellipse(w=240,h=120,fill="#1a9933",stroke="none")|repeat(10,rotate(30))
x2 = ellipse(w=226,h=97,fill="#f0e91d",stroke="none")|rotate(15)|repeat(10,rotate(30))
x3 = ellipse(w=210,h=89,fill="orange",stroke="none")|rotate(30)|repeat(10,rotate(30))

center3=combine([x4,x1,x2,x3])




c5=ellipse(x=0,y=50,h=40,w=50,fill="#e67330",stroke="none")
c14=ellipse(x=0,y=70,h=30,w=40,fill="#e67330",stroke="none")
c15=circle(x=0,y=90,r=10,fill="#e67330",stroke="none")
c1=circle(r=50,x=0,y=0,fill="red",stroke="none")
c9=circle(r=60,x=0,y=0,fill="green",stroke="none")
c10=circle(r=65,x=0,y=0,fill="red",stroke="none")
c12=circle(r=75,x=0,y=0,fill="#2166b0",stroke="none")
c13=circle(r=85,x=0,y=0,fill="red",stroke="none")
z5=line(x1=0,y1=10,x2=0,y2=35,stroke="yellow")
c2=circle(x=0,y=-40,r=3,stroke="none",fill="white")
z6=z5 | repeat(72,rotate(5))

c4=c2 | repeat(36,rotate(10))
c6=ellipse(x=0,y=-35,w=130,h=20,fill="#be2d24",stroke="none")
c7=ellipse(x=0,y=-50,w=130,h=20,fill="#be2d24",stroke="none")
c8=ellipse(y=-65,x=0,h=150,w=100,fill="#5feb41",stroke="none")
c9=circle(x=-60,y=-80,r=25,fill="blue",stroke="none")+circle(x=-60,y=-80,r=20,fill="red",stroke="none")+circle(x=-60,y=-80,r=10,fill="yellow",stroke="none")
c10 = circle(x=-55,y=-45,r=15,fill="orange",stroke="none")+ circle(x=-55,y=-45,r=7,fill="blue",stroke="none")
shape2 = combine([c9,c10])
c11= shape2 | scale(x=-1)
r1 = rectangle(x=0,y=-65,h=15,w=30,fill="yellow",stroke="none")
d1= ellipse(x=0,y=-55,h=33,w=15,fill="none",stroke_width=3,stroke="red")
z1=line(x1=30,y1=-73,y2=-77,x2=12,stroke_width=4,stroke="black")
z2=z1 | scale(x=-1)
e1= ellipse(x=22,y=-85,w=20,h=10,stroke_width=4,fill="white")+circle(x=22,y=-85,r=4,fill="black")+circle(x=22,y=-85,r=2,fill="brown")

e2=e1 | scale(x=-1)
t1=ellipse(x=0,y=-100,w=150,h=100,fill="#f0f2f3",stroke="none")
z3=line(x1=0,x2=-12,y1=-115,y2=-115,stroke_width=6,stroke="red")+line(x1=0,x2=-12,y1=-115,y2=-115,stroke_width=4,stroke="#483f3f")+line(x1=-12,x2=-20,y1=-115,y2=-110,stroke_width=4,stroke="red")+line(x1=-12,x2=-20,y1=-115,y2=-110,stroke_width=3,stroke="#483f3f")+circle(x=-20,y=-110,r=4,fill="#483f3f",stroke="none")
z4=z3 | scale(x=-1)
shape = combine([c13,t1,c12,c10,c8,c9,c15,c14,c5,c1,c4,r1,z6,d1,c6,c7,c10,c9,c11,z1,z2,e1,e2,z3,z4])
pic = shape | scale(0.35)
kadhakali = pic | translate(y=10)
a3=circle(x=0,y=70,r=40,fill="#b32015",stroke="none")+circle(x=0,y=70,r=25,fill="#fc6f03",stroke="none")+circle(x=0,y=70,r=15,fill="#ffff00",stroke="none")+circle(x=0,y=70,r=10,fill="white",stroke="none")
a4=a3 | repeat(10,rotate(36)) | scale(0.8)
a5=circle(r=110,fill='#9e15b3')
cen = combine([a4,center2,kadhakali])
cen2 = cen | scale(0.9)

#sticks

e = ellipse(h=160,w=13,x=0,y=40,stroke="#ebdd26",stroke_width=2,fill="red")


shape= e
stick = shape | repeat(50,rotate(9))

# outer
c2=rectangle(h=220,w=220,fill="#da0b0b",stroke="none")|rotate(5)|repeat(10,rotate(10))

c4=rectangle(h=200,w=200,fill="#ff6600",stroke="none")|rotate(15)|repeat(10,rotate(10))

c6=rectangle(h=180,w=180,fill="#ffff00",stroke="none")|rotate(22)|repeat(50,rotate(9))





kalam=combine([c2,c4,c6,a5,center3,stick,cen2])
atham = kalam | scale(0.85)

rec1 = rectangle(w=220,h=220,fill="white",stroke="black",stroke_width=2)
rec2 = rec1 | repeat(6,rotate(30))

show(rec2,atham)