Pookkalam by Shinjith P R

Code

def petal(x,y,col):
    pl = point(x=x+15,y=y+24)
    pr = point(x=x+15,y=y-24)
    pt = point(x=x+42,y=y)
    shape = polygon([pl,pt,pr],fill=col,stroke=col)
    return shape

plane = circle(r=150,fill="yellow",stroke="yellow")

base11 = petal(x=98,y=0,col="black") | repeat(11, rotate(33))
base12 = base11 | rotate(10.9)
base13 = base11 | rotate(21.8)
base1 = base11 + base12 + base13

base20 = petal(x=85,y=0,col="red") | repeat(11, rotate(33))
base21 = base20 | rotate(5.5)
base22 = base21 | rotate(10.9)
base23 = base21 | rotate(21.8)
base2 = base21 + base22 + base23

base31 = petal(x=74,y=0,col="orange") | repeat(11, rotate(33))
base32 = base31 | rotate(10.9)
base33 = base31 | rotate(21.8)
base3 = base31 + base32 + base33

base40 = petal(x=63,y=0,col="yellow") | repeat(11, rotate(33))
base41 = base40 | rotate(5.5)
base42 = base41 | rotate(10.9)
base43 = base41 | rotate(21.8)
base4 = base41 + base42 + base43

base51 = petal(x=52,y=0,col="white") | repeat(11, rotate(33))
base52 = base51 | rotate(10.9)
base53 = base51 | rotate(21.8)
base5 = base51 + base52 + base53

base = base1 + base2 + base3 + base4 + base5
show(plane)
show(base)

circl1 = circle(r=148,stroke="red",stroke_width=4)+ circle(r=143,stroke_width=6)
show(circl1)

circl2 = circle(r=83,fill="black")
circl3 =  circle(r=78,fill="orange",stroke="red",stroke_width=3)
show(circl2)
show(circl3)

def patern(x,y):
    circ = circle(x=x,y=y,r=27,fill="black")
    ellip1 = ellipse(x=x,y=y+3,w=44,h=42,fill="red",stroke="red")
    ellip2 = ellipse(x=x,y=y+5,w=36,h=38,fill="orange",stroke="orange")
    ellip3 = ellipse(x=x,y=y+7,w=28,h=34,fill="yellow",stroke="yellow")
    ellip4 = ellipse(x=x,y=y+9,w=20,h=30,fill="white",stroke="white")
    paterncx = circ + ellip1 + ellip2 + ellip3 + ellip4# + cir2 + cir3 + cir4 
    paterncy = paterncx | rotate(36)
    shape = paterncx + paterncy
    return shape

def triangl(x,y):
    pt = point(x=x-8,y=y+26)
    pb0 = point(x=x-2,y=y-5)
    pa0 = point(x=x+21,y=y+16)
    pb1 = point(x=x-7,y=y-10)
    pa1 = point(x=x+17,y=y+12)
    pb2 = point(x=x-12,y=y-15)
    pa2 = point(x=x+13,y=y+8)
    pb3 = point(x=x-17,y=y-20)
    pa3 = point(x=x+9,y=y+4)
    pb4 = point(x=x-22,y=y-25)
    pa4 = point(x=x+5,y=y+0)
    triang0 = polygon([pt,pa0,pb0],fill="black")
    triang1 = polygon([pt,pa1,pb1],fill="red",stroke="red")
    triang2 = polygon([pt,pa2,pb2],fill="orange",stroke="orange")
    triang3 = polygon([pt,pa3,pb3],fill="yellow",stroke="yellow")
    triang4 = polygon([pt,pa4,pb4],fill="white",stroke="white")
    triangx = triang0 + triang1 + triang2 +triang3 + triang4
    triangy = triangx | rotate(37)
    triang = triangx + triangy
    return triang

paternc = patern(x=43,y=0) | repeat(5, rotate(72)) 
paternt1 = triangl(x=43,y=0)
paternt2 = paternt1 | rotate(72)
paternt3 = paternt2 | rotate(72)
paternt4 = paternt3 | rotate(72)
paternt5 = paternt4 | rotate(73.5)
paternt = paternt1 + paternt2 + paternt3 + paternt4 + paternt5
paternf = paternc + paternt
show(paternf)

def dots():
    pdot = circle(x=72,y=0,r=2.5,fill="#641E16") | rotate (18)
    dotsr = pdot | repeat(10,rotate(36))
    return dotsr
show(dots())
def sqrp(x,y,cols):
    pt = point(x=x+8,y=y+5)
    pb = point(x=x+8,y=y-5)
    pv = point(x=x+18,y=y)
    rectn = rectangle(x=x,y=y,w=16,h=8,fill=cols,stroke=cols)
    sqrpt = polygon([pt,pv,pb],fill=cols,stroke=cols)
    sqrpr = rectn + sqrpt
    return sqrpr

leaf1 = sqrp(x=50,y=0,cols="black")
leaf2 = sqrp(x=56,y=0,cols="red")
leaf3 = sqrp(x=60,y=0,cols="orange")
leaf4 = sqrp(x=62,y=0,cols="yellow")
leaf5 = sqrp(x=64,y=0,cols="white")
leaft = leaf5 + leaf4 + leaf3 + leaf2 + leaf1
leafs = leaft | repeat(4,rotate(90))
#show(leafs)

circl41 = circle(r=40.5,fill="black",stroke="yellow",stroke_width=2)
circl42 = circle(r=36,fill="#DC7633",stroke="yellow",stroke_width=2)
circl4 = circl41 + circl42
show(circl4)

def kadhakali():
    smcirc = circle(x=22.5,y=0,r=0.8,fill="orange",stroke="orange") | repeat(40,rotate(12))
    smhcirc = circle(x=12,y=0,r=4,fill="yellow") | repeat(10,rotate(36))
    lin1 = line(x1=-9.5,y1=-2,x2=9.5,y2=-2)
    lin2 = line(x1=-8.5,y1=0,x2=8.5,y2=0)
    lin3 = line(x1=-7,y1=3,x2=7,y2=3)
    smrcirc = circle(x=-12,y=-4,r=0.5,fill="black") | repeat(8,translate(x=3))
    smline = line(x1=-10,y1=-14,x2=-6,y2=-6) | repeat(8,translate(x=3,y=0))
    bgcircl = circle(r=25,fill="red") + smcirc + circle(r=20,fill="white") + circle(r=18,fill="orange") + smhcirc + circle(r=12,fill="red") 
    bgrect = circle(x=0,y=-4,r=10,fill="orange") + smrcirc + lin1 + lin2 + lin3 + rectangle(x=0,y=-10,w=20,h=8,fill="red") + smline
    kireedamx = bgcircl + bgrect
    kireedam = kireedamx | translate(x=0,y=8)
    earr1 = circle(x=11,y=-10,r=2,fill="orange") + circle(x=11,y=-10,r=0.5,fill="red")
    earr2 = circle(x=13,y=-14,r=3,fill="orange") + circle(x=13,y=-14,r=1,fill="red")
    earl1 = earr1 | translate(x=-22,y=0)
    earl2 = earr2 | translate(x=-26,y=0)
    ears = earl1 + earl2 + earr1 + earr2
    ellips = ellipse(x=0,y=-22,w=25,h=13,fill="white") + ellipse(x=0,y=-22,w=20,h=12,fill="white")
    face = ellips + ellipse(x=0,y=-17,w=18,h=21,fill="green") + rectangle(x=0,y=-8,w=18,h=3,fill="red",stroke="red") + rectangle(x=0,y=-10,w=18,h=2,fill="white",stroke="white") 
    eyel = ellipse(x=-3.5,y=-15.5,w=5,h=2) + circle(x=-3.5,y=-15.5,r=0.5,fill="black")
    eyer = eyel | translate(x=7,y=0)
    eyes = eyel + eyer
    lip = rectangle(x=0,y=-24,w=4,h=0.5,fill="red",) + line(x1=2,y1=-24,x2=3,y2=-23,fill="red") + circle(x=3,y=-23,r=0.5,fill="red") + line(x1=-2,y1=-24,x2=-3,y2=-23,fill="red") + circle(x=-3,y=-23,r=0.5,fill="red")
    facein = line(x1=0,y1=-17,x2=0,y2=-20.5) + rectangle(x=0,y=-20.5,w=2,h=0.5) + lip
    art = kireedam + ears + face + eyes + facein
    return art
show(kadhakali())