Pookkalam by Sarin M

Code

#flowerish_design
def flowerish_design(x,y):
    c1= circle(x=x+55,y=y,r=55,fill='yellow',stroke="white", stroke_width=5)
    c2= circle(x=x+50,y=y,r=50,fill='orange',stroke="none")
    c3= circle(x=x+45,y=y,r=45,fill='red',stroke="none")
    c4= circle(x=x+40,y=y,r=40,fill='brown',stroke="none")
    c5= circle(x=x+35,y=y,r=35,fill='black',stroke="none")
    c6= circle(x=x+30,y=y,r=30,fill='brown',stroke="none")
    c7= circle(x=x+25,y=y,r=25,fill='red',stroke="none")
    c8= circle(x=x+20,y=y,r=20,fill='orange',stroke="none")
    c9= circle(x=x+15,y=y,r=15,fill='yellow',stroke="none")
    c10= circle(x=x+10,y=y,r=10,fill='white',stroke="none")
    return c1+c2+c3+c4+c5+c6+c7+c8+c9+c10 | repeat(6,rotate(60))

#outer design
def square(color, side):
    return rectangle(w=side, h=side, fill=color, stroke='none')
outer_circle = circle(r=150,fill="black")
brown_layer = square(side=212.5,color='brown') | repeat(10,  rotate(10)) 
red_layer = square(side=196, color='red') | rotate(5) | repeat(10,  rotate(10)) 
orange_layer = square(side=182, color='orange') | repeat(10,  rotate(10)) 
yellow_layer = square(side=168, color='yellow') |rotate(5) | repeat(10,  rotate(10)) 
white_layer = square(side=155, color='white')  | repeat(10,  rotate(10))
outer_structure = outer_circle+brown_layer+red_layer+orange_layer+yellow_layer+white_layer

#maveli
def maveli():
    maveli_background = circle(r=65,stroke="white",stroke_width=5,fill="brown")
    #face
    face_rect = rectangle(w=22,h=12,stroke="none",fill="#f3cfbb")
    face_lower = ellipse(y=0,w=25,h=30,stroke="none",fill="#000000")
    #ear
    ear= ellipse(x=12.5,y=-3.6,w=2,h=5,fill="#f3cfbb",stroke="none") | repeat(2, translate(x=-25))
    #crown
    crown_inner_round = circle(y=10,r=15,stroke="none",fill="#ffd700")
    crown_top_ellipse = ellipse(y=25,w=5,h=15,stroke="none",fill="#ffd700")
    crown_middle_diamond = ellipse(y=15,w=5,h=10,stroke="none",fill="green")
    crown_side_diamond = ellipse(y=13,x=7,w=3,h=6,stroke_width=0.1,fill="violet") | repeat(2, translate(x=-14))
    crown_outer_ring = circle(y=18,r=18,stroke="#ffd700",stroke_width=5)
    crown = crown_outer_ring+crown_inner_round+crown_top_ellipse+crown_middle_diamond+crown_side_diamond
    #mask
    mask_body = rectangle(y=-8,h=11,w=18,fill="#87cefa",stroke="none")
    string1 = line(x1=9,y1=-3,x2=13,y2=-1,stroke="white",stroke_width=0.5)
    string2 = line(x1=8,y1=-13,x2=11.5,y2=-5.5,stroke="white",stroke_width=0.5)
    string3 = line(x1=-9,y1=-3,x2=-13,y2=-1,stroke="white",stroke_width=0.5)
    string4 = line(x1=-8,y1=-13,x2=-11.5,y2=-5.5,stroke="white",stroke_width=0.5)
    wringle1 = line(x1= 9,y1=-5,x2=2,y2=-5,stroke_width=0.1,stroke="blue")
    wringle2 = line(x1= 9,y1=-7,x2=2,y2=-7,stroke_width=0.1,stroke="blue")
    wringle3 = line(x1= 9,y1=-9,x2=-9,y2=-9,stroke_width=0.1,stroke="blue")
    wringle4 = line(x1= 9,y1=-11,x2=-9,y2=-11,stroke_width=0.1,stroke="blue")
    wringle5 = line(x1= -9,y1=-5,x2=-2,y2=-5,stroke_width=0.1,stroke="blue")
    wringle6 = line(x1= -9,y1=-7,x2=-2,y2=-7,stroke_width=0.1,stroke="blue")
    mask= string1+string2+string3+string4+mask_body+wringle1+wringle2+wringle3+wringle4+wringle5+wringle6
    #eyes
    eyebrow_left = line(x1=3,y1=2.9,x2=9,y2=2)
    eyebrow_right = line(x1=-3,y1=2.9,x2=-9,y2=2)
    eye_ball = circle(y=0,x=6,r=1,fill="black",stroke="none") | repeat(2, translate(x=-12))
    eye_outer = ellipse(y=0,x=6,w=4,h=2,fill="white",stroke_width=0.1) | repeat(2, translate(x=-12))
    eye= eye_outer+eye_ball+eyebrow_left+eyebrow_right
    #nose
    nose1 = line(x1=1,y1=0,x2=1.6,y2=-3,stroke_width=0.1)
    nose2 = line(x1=-1,y1=0,x2=-1.6,y2=-3,stroke_width=0.1)
    
    head = face_lower+ crown + face_rect+eye+ear+nose1+nose2+mask | scale(2.2) | translate(y=-26)
    return maveli_background+head

flowerish_design = flowerish_design(0,0) | rotate(90)
show(outer_structure+flowerish_design)

maveli = maveli() | scale(0.5) 
show(maveli)