Pookkalam by Sandeep K

Code

# Kathakali face using Joy :)

#background

x1 = circle(r=158, fill='yellow', stroke='none', stroke_width=5)
# bg = x1 + x2

def background(side,color):
    return rectangle(w=side,h=side,fill=color,stroke="none")

# firstCircle = circle(r=145,fill="black",stroke="none")
# show(firstCircle)
# maroon=background(side=203,color="#8b0000")|repeat(10,rotate(10))
# show(maroon)
# red=background(side=189,color="#ff0000")|rotate(5)|repeat(10,rotate(10))
# show(red)
bg1 = background(side=219,color="maroon")|rotate(10)|repeat(10,rotate(10))
bg3 = background(side=202,color="orange")|rotate(15)|repeat(10,rotate(10))
bg4 = background(side=187,color="#ff6700")|rotate(10)|repeat(10,rotate(10))

bg = bg1 + bg3 + bg4
#kireedam
c1 = circle(x=0,y=25,r=100,fill='red', stroke='white', stroke_width=5)
c2 = circle(x=0,y=25,r=75,fill='yellow', stroke='white', stroke_width=5)
c3 = circle(x=0,y=25,r=60,fill='blue', stroke='white', stroke_width=5)
c4 = circle(x=0,y=25,r=40,fill='yellow', stroke='white', stroke_width=5)
cSmall = circle(x=0, y=88, r=6, stroke_width=4,stroke='gold',fill='black')
cR = cSmall | repeat(20, rotate(20)) | translate(y=25)

#face
c5 = circle(x=0,y=-50,r=60,fill='green', stroke='yellow', stroke_width=5)

#eyes

#eye brows
e = ellipse(x=-25,y=-30,w=25, h=5, fill='black')
e1 = e | rotate(-10)
e2 = e | rotate(-20) | translate(x=10, y=-5)

#right eye
c6 = ellipse(x=18,y=-40,w=25,h=8,fill='white', stroke='black', stroke_width=3)
c7 = circle(x=18,y=-40,r=3,fill='black', stroke='none')
c11 = c6 + c7 | rotate(10)
c12 = c11 + e2

#left eye
c8 = ellipse(x=-18,y=-40,w=25,h=8,fill='white', stroke='black', stroke_width=3)
c9 = circle(x=-18,y=-40,r=3,fill='black', stroke='none')
c10 = c8 + c9 | rotate(-10)
e3 = e | rotate(20) | translate(x=35, y=12)
c13 = e3 + c10

#kireedam alangaram
r1 = rectangle(y=10, w=80, h=25, fill='red', stroke='white', stroke_width=5)
p1 = point(x=-50, y=10)
p2 = point(x=0, y=50)
p3 = point(x=50, y=10)

z = polygon([p1, p2, p3], fill='yellow', stroke='red', stroke_width=5)
z1 = z | scale(0.75)
z2 = z | scale(0.5)
z3 = z + z1 + z2

p4 = point(x=-25, y=50)
p5 = point(x=0, y=75)
p6 = point(x=25, y=50)

z4 = polygon([p4, p5, p6], fill='yellow', stroke='red', stroke_width=5)
z5 = z4 | scale(1.5)
z6 = z4 + z5 

j1 = point(x=0,y=140)
j2 = point(x=25,y=110)
j3 = point(x=-25,y=110)
a7 = circle(x=0, y=88,r=5, fill='blue', stroke='none')
tr = polygon([j1, j2, j3], fill='red', stroke='yellow', stroke_width=5) + a7


#facial alangram
pott = ellipse(x=0, y=-20,w=5, h=20, fill='red')

p7 = point(x=-20, y=-10)
p8 = point(x=20, y=-10)
p9 = point(x=20, y=-18)
p10 = point(x=0, y=-23)
p11 = point(x=-20, y=-18)

pott2 = polygon([p7, p8, p9, p10, p11], fill='yellow', stroke='red')

#nose
cNose1 = circle(x=8, y=-60,r=7, fill='#004011', stroke='none')
cNose2 = circle(x=-8, y=-60,r=7, fill='#004011', stroke='none')
cNose3 = circle(x=0, y=-60,r=7, fill='#004011', stroke='none')
cNose4 = circle(x=0, y=-52,r=9, fill='green', stroke='none')
nose = cNose3 + cNose1 + cNose2 + cNose4

#lips
l1 = point(x=-25,y=-75)
l2 = point(x=-5,y=-70)
l3 = point(x=0,y=-73)
l4 = point(x=5,y=-70)
l5 = point(x=25,y=-75)
l6 = point(x=5,y=-81)
l7 = point(x=0,y=-78)
l8 = point(x=-5,y=-81)

plip = polygon([l1,l2,l3,l4,l5,l6,l7,l8], fill='red', stroke='none')
clip1 = circle(x=-27, y=-73, r=8, fill='red', stroke='none')
clip2 = circle(x=27, y=-73, r=8, fill='red', stroke='none')
lip = plip + clip1 + clip2

#ear alangaram
a1 = circle(x=-80, y=-30,r=30, fill='yellow', stroke='red', stroke_width=7)
a2 = circle(x=80, y=-30,r=30, fill='yellow', stroke='red', stroke_width=7)

a3 = circle(x=-80, y=-30,r=15, fill='yellow', stroke='red', stroke_width=7)
a4 = circle(x=80, y=-30,r=15, fill='yellow', stroke='red', stroke_width=7)

a5 = circle(x=-80, y=-30,r=5, fill='blue', stroke='none')
a6 = circle(x=80, y=-30,r=5, fill='blue', stroke='none')

leftEar = a1 + a3 + a5
rightEar = a2 + a4 + a6
mod = leftEar + rightEar

#pug
ex = ellipse(x=0, y=-85, w=200, h=75, fill='white', stroke='none')

# Draw shape
shape = x1 + bg + ex + c1 + c2 + c3 + c4 + cR + c5 + c12 +c13 + r1 + z6  + z3 + pott2 + pott + tr + nose + lip + mod
show(shape)