Pookkalam by Adithya Praveen

Code

#Background
r = rectangle(w=300,h=300,fill='white')
show(r)
# Outer Circle
c1 = circle(r=150,fill='purple')
show(c1)
# sqaure pattern with multiple colors
for i in range(10):
        shape2 = rectangle(w=190, h=190,fill='yellow',stroke='none')  | repeat(10, rotate(10))
        shape3 = rectangle(w=200, h=200,fill='orange',stroke='none')  | repeat(10, rotate(10))
        shape4 = rectangle(w=210, h=210,fill='red')  | repeat(10, rotate(10))
show(shape4+shape3+shape2)
# inner circles
c2 = circle(r=130,fill='green')
c3 = circle(r=125,fill='pink')
show(c2+c3)
# red ellipse pattern
el = ellipse(w=240,h=100,fill='red') | repeat(6, rotate(30))
show(el)
# concentric squares 
for i in range(2):
    r1 = rectangle(w=140,h=140,fill='pink')
    r2 = rectangle(w=150,h=150,fill='yellow')
    r3 = rectangle(w=160,h=160,fill='orange')
    r4 = rectangle(w=170,h=170,fill='brown')
rec_copy = r4+r3+r2+r1 | repeat(4,rotate(30))
show(rec_copy+r4+r3+r2+r1)
# Biggest Section
#3.1
p25 = point(x=0, y=0)
p26 = point(x=75, y=150)
p27 = point(x=150, y=0)
p28 = point(x=75,y=-150)
d7 = polygon([p25, p26 ,p27,p28],fill='brown') |scale(0.45)|rotate(90)
show(d7)

#3.2
p29 = point(x=-150, y=0)
p30 = point(x=0, y=0)
p31 = point(x=75, y=-150)
p32 = point(x=-75,y=-150)
d8 = polygon([p29, p30 ,p31,p32],fill='orange') |scale(0.45)|rotate(90)
show(d8)

#3.3
p33 = point(x=-150, y=0)
p34 = point(x=-75, y=150)
p35 = point(x=75, y=150)
p36 = point(x=0,y=0)
d9 = polygon([p33, p34 ,p35,p36],fill='yellow') |scale(0.45)|rotate(90)
show(d9)

#3Bigger Sections
#2.1
p13 = point(x=-50, y=100)
p14 = point(x=50, y=100)
p15 = point(x=100, y=0)
p16 = point(x=0,y=0)
d4 = polygon([p13, p14, p15,p16],fill='orange')|scale(0.5)|rotate(90)

#2.2
p17 = point(x=0, y=0)
p18 = point(x=100, y=0)
p19 = point(x=50, y=-100)
p20 = point(x=-50,y=-100)
d5 = polygon([p17, p18 ,p19,p20],fill='yellow')|scale(0.5)|rotate(90)

#2.3
p21 = point(x=-100, y=0)
p22 = point(x=-50, y=100)
p23 = point(x=0, y=0)
p24= point(x=-50,y=-100)
d6 = polygon([p21, p22 ,p23,p24],fill='brown')|scale(0.5)|rotate(90)
big_hex = d4+d5+d6
show(big_hex)

# Inner hexagons
p1 = point(x=0, y=0)
p2 = point(x=25, y=50)
p4 = point(x=25, y=-50)
p3 = point(x=50,y=0)

d = polygon([p1, p2, p3,p4],fill='brown',stroke='none')|rotate(90)|scale(0.6)

p5 = point(x=-50, y=0)
p6 = point(x=-25, y=50)
p7 = point(x=25, y=50)
p8 = point(x=0,y=0)
d2 = polygon([p5, p6, p7,p8],fill='yellow',stroke='none')|rotate(90)|scale(0.6)

p9 = point(x=-50, y=0)
p10 = point(x=0, y=0)
p11 = point(x=25, y=-50)
p12 = point(x=-25,y=-50)
d3 = polygon([p9, p10, p11,p12],fill='orange',stroke='none')|rotate(90)|scale(0.6)
inner_hex = d+d2+d3
show(inner_hex)