Pookkalam by Haleel

Code

#background
bg=rectangle(h=300,w=300,fill='white',stroke='white')
#on outer design I pushed the circle to top to get a 3d perception
#like the top half area is less than bottom half(as in 3d pictures)
#outer design pt1
#colors
color=['#000000','#4c0c11','#9a3c40','#e25f00','#ffdf0e','#ffe6c2','#ffffff']
#cordinates of simple shape(bar(similar to a small rectangel but bended))
#these bars are building blocks of outer design
a=point(x=0,y=-127.1)
b=point(x=8.4,y=-126.8)
c=point(x=16.6,y=-126)
d=point(x=18.3,y=-138.8)
e=point(x=10,y=-139.6)
f=point(x=0,y=-140)
#outer design pt2
#fuction to make the bar adjacent to each other and add color in growing shade as in color list
#n indicate order of colors to be distributed

def bar_with_colors(n):
    c1=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=0)|scale(1)
    n+=1
    c2=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=1)|scale(0.91)
    n+=1
    c3=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=2)|scale(0.8281)
    n+=1
    c4=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=3)|scale(0.753)
    n+=1
    c5=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=4)|scale(0.685)
    n+=1
    c6=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=5)|scale(0.624)
    n+=1
    c7=polygon([a,b,c,d,e,f],fill=color[n%7],stroke=color[n%7])|translate(y=6)|scale(0.567)
    
    return c1+c2+c3+c4+c5+c6+c7

#function to make these bars multiply and rotate around as a circle

def bar_total(m=0,l=1,a=0):
    m=m+24
    bars=bar_with_colors(0)|scale(x=l)
    for i in range(m):
        d1=bar_with_colors((i-a)*l)|rotate(i*7.5)|scale(0.98**i)|scale(x=l)
        bars=bars+d1
    return bars
#big outer circle
circle0=circle(r=140,fill='black',stroke=None)|translate(y=41)|scale(x=1.06,y=0.73)

#inner design
#brown circle
circle=circle(r=50,fill='#802500',stroke=None)
#orange
circle1=rectangle(w=70,h=70,fill='#ff7700',stroke='#ff7700')|repeat(6,rotate(36))
#yellow
circle2 = rectangle (w=60,h=60,fill='#ffd01d', stroke='#ffd01d') |rotate(10)| repeat (6,rotate(36))
#creamcolor
circle3 = rectangle (w=50,h=50,fill='white', stroke='white')| repeat (15,rotate(36))
#lightblue
circle4 = rectangle (w=42,h=42,fill='#503aa9', stroke='#503aa9')|rotate(10)|repeat (6,rotate(36))
#darkblue
circle5 = rectangle (w=35,h=35,fill='#200f35', stroke='#200f35')| repeat (6,rotate(36))
#whiteflower
circle6 = ellipse(w=2,h=18,fill='white',stroke='white')|repeat(30, rotate(20)) 

#final show()
c1=bar_total()+bar_total(m=3,l=-1,a=6)
c=circle+circle1+circle2+circle3+circle4+circle5+circle6
c=c|translate(y=-10)|scale(x=1.1,y=1.1)
c=c+c1|translate(y=60)|scale(x=1.3,y=0.86)
final=circle0+c|translate(y=-30)
show(bg,final)

'''
#happty onam text(failed)
#h
h1=line(y1=-69,x1=-117,y2=-92,x2=-133,stroke='orange',stroke_width=5)
h2=line(y1=-76,x1=-103,y2=-103,x2=-117,stroke='orange',stroke_width=5)
h3=line(y1=-80,x1=-125,y2=-88,x2=-109,stroke='orange',stroke_width=5)
H=h1+h2+h3
#a
a1=line(x1=-89,y1=-87,x2=-107,y2=-112,stroke='orange',stroke_width=5)
a2=line(x1=-89,y1=-87,x2=-92,y2=-120,stroke='orange',stroke_width=5)
a3=line(x1=-98.5,y1=-101,x2=-89.5,y2=-105,stroke='orange',stroke_width=5)
A=a1+a2+a3
#p
p1=point(x=-75,y=-126)
p2=point(x=-71,y=-94)
p3=point(x=-56,y=-95)
p4=point(x=-57,y=-110)
p5=point(x=-73,y=-109)
P=polygon([p1,p2,p3,p4,p5],stroke='orange',stroke_width=5)
#p
p1=point(x=-44,y=-130)
p2=point(x=-41,y=-97)
p3=point(x=-24,y=-99)
p4=point(x=-26,y=-114)
p5=point(x=-42,y=-114.5)
P2=polygon([p1,p2,p3,p4,p5],stroke='orange',stroke_width=5)
#y
y1=line(x1=4,y1=-113,x2=-9,y2=-98,stroke='orange',stroke_width=5)
y2=line(x1=4,y1=-113,x2=9,y2=-98,stroke='orange',stroke_width=5)
y3=line(x1=4,y1=-113,x2=-1,y2=-131,stroke='orange',stroke_width=5)
Y=y1+y2+y3
#o
o1=point(x=35,y=-97)
o2=point(x=54.5,y=-96)
o3=point(x=57,y=-112)
o4=point(x=57,y=-126)
o5=point(x=43,y=-129)
o6=point(x=39,y=-115)
O=polygon([o1,o2,o3,o4,o5,o6],stroke='orange',stroke_width=5)
#n
n1=point(x=80,y=-124)
n2=point(x=71,y=-95)
n3=point(x=96,y=-110)
n4=point(x=87,y=-84)
n5=point(x=96,y=-110)
n6=point(x=71,y=-95)
N=polygon([n1,n2,n3,n4,n5,n6],stroke='orange',stroke_width=5)
#a
a1=line(x1=100,y1=-76,x2=109,y2=-109,stroke='orange',stroke_width=5)
a2=line(x1=100,y1=-76,x2=124,y2=-98,stroke='orange',stroke_width=5)
a3=line(x1=112,y1=-90,x2=105,y2=-95,stroke='orange',stroke_width=5)
A2=a1+a2+a3
#m
m1=point(x=131,y=-93)
m2=point(x=113,y=-69)
m3=point(x=130,y=-75)
m4=point(x=127,y=-58)
m5=point(x=145,y=-82)
m6=point(x=127,y=-58)
m7=point(x=130,y=-75)
m8=point(x=113,y=-69)
M=polygon([m1,m2,m3,m4,m5,m6,m7,m8],stroke='orange',stroke_width=5)

text=H+A+P+P2+Y+O+N+A2+M

show(text)
'''