Pookkalam by George P Joy

Code

#outer circle part
c0=circle(x=0,y=0,r=153,fill="black",stroke="none",stroke_width=2)
c1 =circle(x=0,y=0,r=150,fill="#2c392f",stroke="none",stroke_width=2)
f=(2*(150**2))**0.5
r1=rectangle(w=f,h=f,fill="yellow",stroke="none")|rotate(45)|repeat(2,rotate(7.5))
r2=rectangle(w=f,h=f,fill="orange",stroke="none")|rotate(41.25)|repeat(3,rotate(7.5))|scale(0.94)
r3=rectangle(w=f,h=f,fill="#0eb519",stroke="none")|rotate(37.5)|repeat(4,rotate(7.5))|scale(0.94**2)
r4=rectangle(w=f,h=f,fill="#02770a",stroke="none")|rotate(33.75)|repeat(5,rotate(7.5))|scale(0.94**3)
r5=rectangle(w=f,h=f,fill="ivory",stroke="none")|rotate(30)|repeat(12,rotate(7.5))|scale(0.94**4)
r6=rectangle(w=f,h=f,fill="yellow",stroke="none")|rotate(0)|repeat(2,rotate(7.5))
r7=rectangle(w=f,h=f,fill="orange",stroke="none")|rotate(-3.75)|repeat(3,rotate(7.5))|scale(0.94)
r8=rectangle(w=f,h=f,fill="red",stroke="none")|rotate(-7.5)|repeat(4,rotate(7.5))|scale(0.94**2)
r9=rectangle(w=f,h=f,fill="#991706",stroke="none")|rotate(-11.25)|repeat(5,rotate(7.5))|scale(0.94**3)
r10=rectangle(w=f,h=f,fill="#02770a",stroke="none")|rotate(42.5)|repeat(2,rotate(12.5))
r11=rectangle(w=f,h=f,fill="#02770a",stroke="none")|rotate(-2.5)|repeat(2,rotate(12.5))
r12=rectangle(w=f,h=f,fill="red",stroke="none")|rotate(-5)|repeat(2,rotate(17.5))
r13=rectangle(w=f,h=f,fill="red",stroke="none")|rotate(40)|repeat(2,rotate(17.5))
r14=rectangle(w=f,h=f,fill="orange",stroke="none")|rotate(37.5)|repeat(2,rotate(22.5))
r15=rectangle(w=f,h=f,fill="orange",stroke="none")|rotate(-7.5)|repeat(2,rotate(22.5))
r16=rectangle(w=f,h=f,fill="yellow",stroke="none")|rotate(35)|repeat(2,rotate(27.5))
r17=rectangle(w=f,h=f,fill="yellow",stroke="none")|rotate(-10)|repeat(2,rotate(27.5))
s1=c1+r16+r17+r15+r14+r12+r13+r10+r11+r1+r2+r3+r6+r7+r8+r9+r4+r5
#inner circle part
c2=circle(x=0,y=0,r=108,fill="#2c392f",stroke="none")
g=(2*(108**2))**0.5
ir1=rectangle(w=g,h=g,fill="yellow",stroke="none")|rotate(33.75)|repeat(4,rotate(22.5))
ir2=rectangle(w=g,h=g,fill="gold",stroke="none")|rotate(45)|scale(x=0.9)|repeat(8,rotate(22.5))|scale(0.85)
ir3=rectangle(w=g,h=g,fill="orange",stroke="none")|rotate(32.5)|scale(x=0.9)|repeat(8,rotate(22.5))|scale(0.842**2)
ir4=rectangle(w=g,h=g,fill="red",stroke="none")|rotate(45.5)|scale(x=0.9)|repeat(8,rotate(22.5))|scale(0.835**3)
ir5=rectangle(w=g,h=g,fill="darkred",stroke="none")|rotate(32.9)|scale(x=0.9)|repeat(8,rotate(22.5))|scale(0.834**4)
s2=ir1+ir2+ir3+ir4+ir5
#kadhakali face-------------
e1=ellipse(x=0,y=40,w=178,h=110,fill="yellow",stroke="#759306",stroke_width=7)
e2=ellipse(x=0,y=30,w=178,h=110,fill="red",stroke="none")
c3=circle(x=-40,y=12,r=48,fill="#759306",stroke="none")
c4=c3|scale(x=-1)
e3=ellipse(x=0,y=-50,w=240,h=81,stroke="white",stroke_width=7)
e4=ellipse(x=0,y=-50,w=225,h=82,fill="#759306",stroke="#759306",stroke_width=8)|translate(y=1)
c5=circle(x=88,y=0,r=15,stroke="gold",stroke_width=6)
c6=circle(x=88,y=0,r=14,fill="#759306",stroke="#759306",stroke_width=7)|translate(x=-5)
s3=c5+c6
s4=s3|scale(x=-1)
e5=ellipse(x=0,y=-50,w=160,h=62,stroke="white",stroke_width=6)
e6=ellipse(x=0,y=-50,w=149,h=63,fill="#759306",stroke="#759306",stroke_width=7)
e7=ellipse(x=0,y=-45,w=149,h=63,fill="#759306",stroke="#759306",stroke_width=8)
e8=ellipse(x=0,y=-50,w=128,h=78,stroke="white",stroke_width=6)|rotate(-54)|translate(x=10)
e9=ellipse(x=0,y=-50,w=128,h=70,fill="#759306",stroke="#759306",stroke_width=8)|rotate(-54)|translate(x=10)
s5=e8+e9|translate(y=-10)
s6=s5|scale(x=-1)
e10=ellipse(x=0,y=-60,w=28,h=7,stroke="none",fill="red")
e11=ellipse(x=-5.5,y=-57,w=17,h=6,stroke="none",fill="red")|rotate(-2)
e12=e11|scale(x=-1)
e13=e12|translate(y=-2)
e14=e13|scale(x=-1)
c7=circle(x=-18.5,y=-56,r=2.5,stroke="none",fill="red")
c8=c7|scale(x=-1)
lips=e10+e11+e12+c7+c8+e13+e14|scale(1.4)|translate(y=15)
s7=e1+e2+s3+s4+e3+e4+s5+s6+e5+e6+e7+lips+c3+c4
def ctr(x,y,w,h):
    c=circle(r=h/2-2,fill="black")|translate(x=6)
    eye=ellipse(x=x,y=y,w=w,h=h,fill="ivory",stroke="none")
    s=eye+c
    return s
eye=ctr(x=0,y=0,w=150,h=50)|scale(0.3)|translate(x=-40,y=10)
def ibr(x1,y1,x2,y2,x3,y3,x4="#",y4="#",x5="#",y5="#",x6="#",y6="#",x7="#",y7="#",a="black"):
    p1=point(x=x1,y=y1)
    p2=point(x=x2,y=y2)
    p3=point(x=x3,y=y3)
    p4=point(x=x4,y=y4)
    p5=point(x=x5,y=y5)
    p6=point(x=x6,y=y6)
    p7=point(x=x7,y=y7)
    s=polygon([p1,p2,p3,p4,p5,p6,p7],fill=a)
    return s
shade1=ibr(x1=-15,y1=15,x2=-55,y2=35,x3=-65,y3=30,x4=-79,y4=40,x5=-83,y5=30,x6=-65,y6=23,x7=-52,y7=25)
shade2=ibr(x1=-15,y1=9,x2=-62,y2=13,x3=-86,y3=23,x4=-86,y4=19,x5=-42,y5=-4)
s8=shade1+shade2+eye
s9=s8|scale(x=-1)
e15=ellipse(x=0,y=-40,w=39,h=18,stroke="black")
e16=ellipse(x=0,y=-40,w=37,h=21,fill="#759306",stroke="#759306")
s10=ibr(x1=0,y1=35,x2=-38,y2=39,x3=-38,y3=30,x4=0,y4=20,x5=38,y5=30,x6=38,y6=39,a="yellow")
s11=s7+s8+s9+e15+e16+s10|scale(0.33)
s12=c0+s1+c2+s2+s11|scale(0.98)
show(s12)