Pookkalam by Anandu.S

Code

outer_circle=circle(r=150,fill='#080A09')
show(outer_circle)
# function for creating square
def square(color, side):
    return rectangle(w=side, h=side, fill=color, stroke='none') 

# creating the outer running leaves
layer1 = square(side=212.5,color='#4F913F') | repeat(10,  rotate(10)) 
layer2 = square(side=196, color='#F8E63D') | rotate(5) | repeat(10,  rotate(10)) 
layer3 = square(side=182, color='#F36636') | repeat(10,  rotate(10)) 
layer4 = square(side=168, color='#a92822') | rotate(5) | repeat(10,  rotate(10)) 
layer5 = square(side=155, color='#050f03')  | repeat(10,  rotate(10))

show(layer1,layer2,layer3,layer4,layer5)


# function for creating arrow
def arrow(color,h=0):
    p1=point(x=6,y=0)
    p2=point(x=0,y=18)
    p3=point(x=-6,y=0)
    head=polygon([p1,p2,p3],fill=color,stroke='none')|translate(y=20)
    rect=rectangle(w=12,h=40,fill=color,stroke='none')
    arr=head+rect| translate(y=h) | repeat(12,rotate(30))
    show(arr)
    
# displaying all arrows    
h=110       
for i in ['white','yellow','orange','#1B0108','#0B0D0B']:
    arrow(h=h,color=i)
    h-=10

inner_circle=circle(r=92,fill='#301B3F',stroke='none')
show(inner_circle)

a_circle=circle(r=59,fill='#07012e') | scale(1.4)
show(a_circle )


b_circle=circle(r=47,stroke_width=3,stroke='red')


def poly(points, color,a=36):
    return polygon(points,fill=color,stroke='none')| scale(0.8) | translate(y=10) |  rotate(a)
# function for creating the trapezoidal shape in the middle
def bud(x,y,color,a):
    p11=point(x=-x,y=y)
    p12=point(x=x,y=y)
    p13=point(x=4,y=0)
    p14=point(x=-4,y=0)
    return poly([p11,p12,p13,p14],color,a)

# function to draw the trapezoidal shape
def draw_bud():
    a=36
    for i in range(10): 
        if i%2==0:
            inside_bud=bud(19,46,'#ffff03',a)+bud(15,35,'#ed7513',a)+bud(12,23,'#fc0000',a)  
        else:
            inside_bud=bud(19,46,'#ffff03',a)+bud(15,35,'#19e62e',a)+bud(12,23,'#3a8742',a)
        a+=36   
    
        show(inside_bud | rotate(17) | scale(0.75))

draw_bud() 

# white arrows in the middle
p1=point(x=-18,y=0)
p2=point(x=0,y=50)
p3=point(x=18,y=0)
p4=point(x=0,y=20)
pol=polygon([p1,p2,p3,p4],fill='white') | translate(y=55) | scale(0.8) | repeat(10, rotate(36))
shape1=pol | scale(0.8)
show(shape1)

# function for creating triangles
def triangle(x1,x2,color,s='none'):
    p11=point(x=x1-4,y=40)
    p12=point(x=1,y=-1)
    p13=point(x=-x2+5,y=40)
    return polygon([p11,p12,p13],fill=color,stroke_width=s) | translate(y=50) |rotate(18)
tri=triangle(40,40,'#ff29d8')+triangle(40,20,'#0e0024')+triangle(40,-3,'red')+triangle(40,-30,'none',s=2)
show(tri | repeat(10,rotate(36)) | scale(0.8))

# creating middle polygen
p5=point(x=0,y=12)
p6=point(x=18,y=0)
p7=point(x=0, y=-10)
p8=point(x=-18,y=0)
p9=point(x=-13,y=-40)
p10=point(x=0,y=-40)
poly2=polygon([p5,p6,p7,p8],fill='red',stroke='none')
poly3=combine([polygon([p8,p9,p10,p7],fill='#f7580f',stroke='none'),polygon([p8,p9,p10,p7],fill='#ffe600',stroke='none') | scale(x=-1)]) 
shape2=combine([poly2,poly3]) | scale(0.8) | translate(y=114) | repeat(26,rotate(13.84))


l1=line(x1=5.8,y1=8,x2=32,y2=43,stroke_width=4.8,stroke='#07012e') | repeat(10,rotate(36))


middle_circle=circle(r=15,fill='white',storke='none')
show(shape2+l1+middle_circle | scale(0.75))