Pookkalam by Gouri Hariharan

Code

def square(m, n, color, side):
    return rectangle(x=m, y=n, w=side, h=side, fill=color, stroke='none')

def pyramid(m, color):
    a=0
    final = 0
    pattern = square(0, 0, color, 20) | rotate(45)
    final = pattern
    for i in range(m):
        p = pattern | translate(x=a+25,y=0)
        a+=25
        final = final+p
    return final

#outer circle
outer_1 = circle(r=132, fill="#2E460B", stroke='none') 
outer_2 = circle(r=125, fill="#FDFDA8", stroke='none')
outer_3 = circle(r=120, fill="#40610F", stroke='none')
show(outer_1, outer_2, outer_3)

#flowers
layer_4 = ellipse(x=0, y=25, w=10, h=38, fill="#008EE6", stroke='none') | repeat(12,  rotate(30))
layer_3 = ellipse(x=0, y=25, w=10, h=38, fill="#A1045A", stroke='none') | repeat(12,  rotate(30)) | rotate(15)
layer_2 = ellipse(x=0, y=20, w=6, h=25, fill="#D71AD0", stroke='none') | repeat(12,  rotate(30)) 
layer_1 = ellipse(x=0, y=20, w=6, h=25, fill="#FFF1F2", stroke='none') | repeat(12,  rotate(30)) |rotate(15)
dot_1 = circle(r=10, fill="#537D13", stroke="none")
dot_2 = circle(r=6, fill="#009092", stroke="none")
flower = combine([layer_4, layer_3, layer_2, layer_1, dot_1, dot_2]) 
flo_outer = flower | translate(0,95) | repeat(6,rotate(60)) | scale(0.9)
show(flo_outer)

#little diamonds pattern using function
pn_5 = pyramid(0,"#FFFDD0") | translate(x=50, y=50)
pn_4 = pyramid(1,"#FFDF00") | translate(x=37.5, y=37.5)
pn_3 = pyramid(2,"#FE612C") | translate(x=25, y=25)
pn_2 = pyramid(3,"#9B111E") | translate(x=12.5, y=12.5)
pn_1 = pyramid(4,"Black")
pyr = combine([pn_1, pn_2, pn_3, pn_4,pn_5]) | rotate(-90) | translate(x=125, y=50) |scale(0.7)|repeat(6,rotate(60))
show(pyr)

#hexagon and circle layer
a,b,c,d,e,f = point(x=0, y=100),point(x=87, y=50),point(x=87, y=-50),point(x=0, y=-100),point(x=-87, y=-50),point(x=-87, y=50)
hexagon1 = polygon([a, b, c, d, e, f],fill="#000000", stroke="none") 
show(hexagon1)
c_1 = circle(r=85, fill="#2E460B", stroke="none")
c_2 = circle(r=80, fill="#FDFDA8", stroke="none")
c_3 = circle(r=75, fill="#537D13", stroke="none")
show(c_1, c_2, c_3)


#triangle pattern
p,q,r = point(x=50, y=0),point(x=25, y=0),point(x=0, y=100)
x,y,z = point(x=50, y=0),point(x=-50, y=0),point(x=0, y=100)
m,n,o = point(x=-50, y=0),point(x=0, y=0),point(x=0, y=100)
u,v,w = point(x=-50, y=0),point(x=-25, y=0),point(x=0, y=100)
triangle_2 = polygon([p, q, r],fill="#FFFDD0", stroke="none") | repeat(8, rotate(60))
triangle_3 = polygon([x, y, z],fill="#FFA12C", stroke="none") | repeat(8, rotate(60))
triangle_1 = polygon([m, n, o],fill="#FE612C", stroke="none") | repeat(8, rotate(60))
triangle_4 = polygon([u, v, w],fill="#F11D28", stroke="none") | repeat(8, rotate(60))
triangle = combine([triangle_3,triangle_2,triangle_1,triangle_4])
inner_triangle = triangle | scale(0.8) | rotate(30)
show(triangle, inner_triangle)

show(flower)