Pookkalam by Rijfas Usman K P

Code

# Theyyam based onapookkalam 
# Original design inspired from Kollad's first price winner theyyam pookkalam (https://4.bp.blogspot.com/-18JNNafIHC4/UDJy2En5f-I/AAAAAAAAHbE/RNbTmIXuqhQ/s1600/first-prize-winner-ritual+art-onam-pookalam.JPG)

# base of pookkalam
base = circle(r=145, fill='#3F2333')

# shield shape for face and kammal
shield = lambda fill, size=1 : circle(r=50, fill=fill, stroke='none') + rectangle(w=100, h=50, y=25, fill=fill, stroke='none') + ellipse(w=100, h=20, y=50, fill=fill, stroke='none') | scale(size)
# cross shape for pottu
cross = (polygon([Point(-3,0), Point(-3, 8), Point(0, 6), Point(3, 8), Point(3, 0)], fill='#BAC580', stroke='none')|repeat(4, rotate(90))) | rotate(20)

# sides
arikukal = (rectangle(w=200, h=100,fill='#3F2333', stroke='none')|translate(y=10)) + (polygon([Point(-2,0), Point(6, 12), Point(-42, 12), Point(-40, 0)], stroke='none', fill='#830208')+(cross|scale(0.5)|translate(x=-35, y=5))|translate(x=-100, y=30)) +  (polygon([Point(-12,0), Point(-4, 12), Point(-42, 12), Point(-38, 0)], stroke='none', fill='#830208')|translate(x=-100, y=15)) + (polygon([Point(-14,0), Point(-24, -22), Point(-36, 2)], stroke='none', fill='#830208')+(cross|scale(0.5)|translate(x=-26, y=-8))|translate(x=-100, y=10))  + (polygon([Point(10,0), Point(4, 12), Point(42, 12), Point(40, 0)], stroke='none', fill='#830208')+(cross|scale(0.5)|translate(x=35, y=5))|translate(x=100, y=30)) + (polygon([Point(14,0), Point(9, 12), Point(42, 12), Point(38, 0)], stroke='none', fill='#830208')|translate(x=100, y=15)) + (polygon([ Point(15, 12), Point(37, 12), Point(28, -10)], stroke='none', fill='#830208')+(cross|scale(0.5)|translate(x=25, y=6))|translate(x=100, y=0)) + (ellipse(w=140, h=170, fill='#FDA405', stroke='none') + (line(0, 0, 0, 5, stroke='#D20116', stroke_width=2)|translate(y=40)|repeat(360/5, rotate(5))) +  (line(0, 0, 0, 6, stroke='#D20116')|translate(y=30)|repeat(360/5, rotate(5)))) | translate(y=-60)

# kireedam 
kireedam = circle(r=100, fill='#E05103') + circle(r=85, fill='#FFFFFF', stroke='none')+ circle(r=80, fill='#7D0710', stroke='none') +  circle(r=75, fill='#E05103', stroke='none') + circle(r=60, fill='#FFFFFF', stroke='none') + arikukal + circle(r=55, fill='#7D0710', stroke='none') + circle(r=50, fill='#CC021B', stroke='none') + circle(r=45, fill='#E05103', stroke='none') + (circle(r=25, fill='#7D0710', stroke='none') | translate(y=15))
# ola designs
ola = (rectangle(w=30, h=4, fill='#BAC580', stroke='none') | translate(x=125) | repeat(41, rotate(360/80))) + (polygon([Point(0,5), Point(5,0), Point(0,-5)], fill='#BAC580', stroke='none') | translate(x=102) | repeat(26, rotate(360/50)))
# yellow arc on top of face and kammals
yellow_arc = rectangle(w=60, h=6, fill='yellow', stroke='none', y=26) + ellipse(w=60, h=9, stroke='none', fill='yellow', y=28) + ellipse(w=60, h=8, stroke='none', fill='#D20116', y=22)

# theyyam's face
def theyyam_face():
    thadi = shield(fill='#FFFFFF', size=0.6) | translate(y=-7)
    face = shield('#D20116',0.6) + shield('#FB5D00',0.5)
    left_eye = polygon([Point(0,0), Point(6,4), Point(0,8), Point(-6,4)], fill='black', stroke='none') + ellipse(w=10, h=6, fill='black', stroke='none', y=5)+ ellipse(w=8, h=4.5, fill='white', stroke='none', y=4) + (rectangle(w=1.2, h=6, fill='black', y=10)|rotate(20)) + circle(r=1.5, fill='black', y=2.5) + circle(r=0.5, fill='white', stroke='none', y=2.2) | scale(2) | translate(x=-10)
    right_eye = polygon([Point(0,0), Point(6,4), Point(0,8), Point(-6,4)], fill='black', stroke='none') + ellipse(w=10, h=6, fill='black', stroke='none', y=5)+ ellipse(w=8, h=4.5, fill='white', stroke='none', y=4) + (rectangle(w=1.2, h=6, fill='black', y=10)|rotate(-20)) + circle(r=1.5, fill='black', y=2.5) + circle(r=0.5, fill='white', stroke='none', y=2.2) | scale(2) | translate(x=10) 
    eyes = left_eye + right_eye
    nose = polygon([Point(0,0), Point(-5, 2), Point(-2, 2), Point(0, 8), Point(2, 2), Point(5, 2)], fill='yellow', stroke='none') | translate(y=-10)
    mouth = ellipse(h=7, w=16, fill='#d20116', stroke='none', y=-17) + (polygon([Point(-11,1), Point(11,1), Point(6,5), Point(-6,5)], fill='#86030D', stroke='none') | translate(y=-17)) + ellipse(h=3, w=8, stroke='none', fill='#FB5D00',y=-12)
    left_kombu = (circle(r=2, fill='#ffee9e', stroke='none')|translate(y=-4)) + rectangle(w=4, h=8, fill='#ffee9e', stroke='none') + (polygon([Point(-2,0), Point(2,0), Point(-3, 7)], fill='#ffee9e', stroke='none')|translate(y=4)) | rotate(20) | scale(0.8)
    right_kombu = (circle(r=2, fill='#ffee9e', stroke='none')|translate(y=-4)) + rectangle(w=4, h=8, fill='#ffee9e', stroke='none') + (polygon([Point(-2,0), Point(2,0), Point(3, 7)], fill='#ffee9e', stroke='none')|translate(y=4)) | rotate(-20) | scale(0.8)
    kombukal = (left_kombu | translate(x=-10, y=-13)) + (right_kombu | translate(x=10, y=-13)) + (yellow_arc|scale(0.8)|translate(y=6))
    return  combine([thadi, face, eyes, nose, mouth, kombukal])
# kammals
kammal = (shield('#CB0011') + (shield('#80030B')|scale(0.8))|scale(0.6))+ (yellow_arc|scale(0.8)|translate(y=6)) + (cross|scale(0.8))
# pookkalam combined
pookkalam = base + ola  + kireedam  + (kammal | translate(x=-50, y=-40))  + (kammal | translate(x=50, y=-40))  + (theyyam_face()|translate(y=-30)) + (cross | translate(y=30) | scale(0.6)) 
show(pookkalam)