Pookkalam by Joseph Johnson

Code

#Functions
def triangle(p1, p2, p3):
    return polygon([p1,p2,p3])
def square(side, color):
    return rectangle(w=side, h=side, stroke='none', fill=color)

canvas = rectangle(w=800, h=800, fill='#eeebd0')
#show(canvas)
blacktrans = color(r=0,g=0,b=0, a=0.4)
shadow = rectangle(w=900, h=900, fill=blacktrans)

#Large Circle
Large_Circle = circle(r=150, fill='#004b23', stroke='none')
#show(Large_Circle)

#Large rectangles
large_rect1 = square(side=265, color='#007f5f') | repeat(3, rotate(45))
large_rect2 = square(side=250, color='#2b9348') | repeat(3, rotate(45))
large_rect3 = square(side=235, color='#55a630') | repeat(3, rotate(45))
large_rect4 = square(side=220, color='#80b918') | repeat(3, rotate(45))
large_rect5 = square(side=205, color='#aacc00') | repeat(3, rotate(45))
pattern1 = large_rect1 + large_rect2 + large_rect3 + large_rect4 + large_rect5
#show(pattern1)

#Half Circles
half_circle1 = circle(r=27, fill='#fff9ec', stroke='none') | translate(x=-100) | repeat(8, rotate(-45))
half_circle2 = circle(r=21, fill='#FA9905', stroke='none') | translate(x=-100) | repeat(8, rotate(-45))
half_circle3 = circle(r=10, fill='#FF616D', stroke='none') | translate(x=-105) | repeat(4, rotate(-90))
inner_rect1 = square(side=163, color='#FF616D')
half_circles = half_circle1 + half_circle2
#show(half_circles)

#Medium Circle
medium_circle1 = circle(r=115, fill='#220901', stroke='none')
medium_circle2 = circle(r=110, fill='#e9ecef', stroke='none')
#med_circle = medium_circle1 + medium_circle2
#show(med_circle)

#Inner Rectangles
inner_rect1 = square(side=155, color='#370617') | repeat((10),rotate(20))
inner_rect2 = square(side=140, color='#6a040f') | rotate(5) | repeat((10),rotate(10))
inner_rect3 = square(side=130, color='#d00000') | repeat((10),rotate(10))
inner_rect4 = square(side=120, color='#dc2f02') | rotate(5) | repeat((10),rotate(10))
inner_rect5 = square(side=110, color='#e85d04') | repeat((10),rotate(10))
pattern2= inner_rect1 + inner_rect2 + inner_rect3 + inner_rect4 + inner_rect5
#show(pattern2)

#Small Circles

mla =color(r=200,g=200,b=200, a=1)
small_circle1 = circle(r=70, fill='white', stroke='none')
#small_circle2 = circle(r=65, fill='#1f1f1f',stroke='none')
#show(small_circle1)
#show(small_circle2)

#Margin and Border
margin = circle(r=188, fill='none', stroke='#eeebd0', stroke_width=70)
#show(margin)
border = circle(r=150, fill='none', stroke='#003619', stroke_width=5)
#show(border)

#Inner Pattern
x1 = circle(r=38, x=33, stroke='none', fill='#053742')
x2 = circle(r=30, x=25, stroke='none', fill='#39A2DB')
x3 = circle(r=25, x=20, stroke='none', fill='#51C4D3')
x4 = circle(r=20, x=15, stroke='none', fill='#E8F0F2')
y2 = x1 + x2 + x3 + x4 | scale(1)

ola1 = ellipse(w=20, h=50, stroke='none', fill='#E27802') #| rotate(30) | translate(y=-70) | repeat(10,rotate(10))
ola2 = ellipse(w=10, h=40, stroke='none', fill='#F88F01')
ola = ola1+ola2  | rotate(30) | translate(y=-70) | repeat(37,rotate(10)) | scale(0.8)
y2 = y2 | repeat(3,rotate(120)) | repeat(2,rotate(-180) | scale(0.9)) | rotate(30) | rotate(180)
pattern3 = ola + y2 | scale(0.96)

#Center Flower
bla =color(r=105,g=48,b=195, a=0.6)
bla2 =color(r=86,g=207,b=225, a=0.3)
bla3 =color(r=217,g=237,b=146, a=0.1)
p1 = ellipse(w=20, h=70, stroke='#5E31A5', fill=bla) | repeat(20,rotate(20))
p2 = ellipse(w=20, h=50, stroke='none', fill=bla2) | repeat(20,rotate(20))
p3 = ellipse(w=10, h=30, stroke='none', fill=bla3) | repeat(20,rotate(10))
flower = p1 + p2 + p3 | scale(0.8)
#show(pattern3)

#Lamps
la = circle(r=13, fill="#7f4f24", stroke='none')
mp = ellipse(w=20,h=18, fill="#582f0e", stroke='none')  | translate(x=0, y=-1)
fla = ellipse(w=10,h=15, fill="#f48c06", stroke='none') #| rotate(180)
me = ellipse(w=5,h=13, fill="#ffe66d", stroke='none') | translate(x=0, y=-2) #| rotate(180)
flame = fla + me | translate(y=-7)
l = combine([la, mp, flame])
l2 = l  | scale(0.6) | translate(x=0, y=-110)
lamps = l2 | repeat(10, rotate(45))
#show(lamps)

#Petals
bla4 = '#224a0d'
petw = ellipse(w=7, h=40, y=-40, stroke='none',fill='#65a322') | repeat(12, rotate(30))  | repeat(10, scale(0.9)|rotate(20))
petx = ellipse(w=7, h=35, y=-40, stroke='none',fill='#b3e63c') | repeat(12, rotate(30)) | rotate(15)  | repeat(20, scale(0.9)|rotate(10))
pety = ellipse(w=7, h=40, y=-40, stroke='none',fill=bla4) | repeat(12, rotate(30))
petz = ellipse(w=7, h=40, y=-40, stroke='none',fill='#38610d') | repeat(12, rotate(30)) | rotate(15)
petback = pety + petz | rotate(-7.5) | repeat(2, rotate(7.5) | scale(0.9))
petfront = petw + petx | scale(0.94) 
petgreen =  petback + petfront | scale(1.33)  | scale(1)

pet1 = ellipse(w=7, h=40, y=-40, stroke='none',fill='#ff8500') | repeat(12, rotate(30))
pet2 = ellipse(w=7, h=40, y=-40, stroke='none',fill='#ff9100') | repeat(12, rotate(30)) | rotate(15)
pet3 = ellipse(w=7, h=50, y=-40, stroke='none',fill='#ff6d00') | repeat(12, rotate(30))
pet4 = ellipse(w=7, h=50, y=-40, stroke='none',fill='#ff7900') | repeat(12, rotate(30)) | rotate(15)
petback = pet3 + pet4 | rotate(7.5)
petorange =  petback + pet1 + pet2  | scale(0.84) | repeat(8, scale(0.9)|rotate(20))

petals = petgreen + petorange | scale(0.9)

#Pookalam Combined
poo = canvas + Large_Circle + pattern1 + half_circles + pattern2 + ola + petals + flower + margin + border| scale(0.9)
pookalam = poo + lamps
show(pookalam)