Pookkalam by Krishna Prasad A

Code

# functions
# 1_triangle_maker

def triangle_maker(x1,y1,x2,y2,x3,y3,color,stroke_width,stroke):
    p1 = point(x=x1,y=y1)
    p2 = point(x=x2,y=y2)
    p3 = point(x=x3,y=y3)
    triangle = polygon([p1,p2,p3],fill=color,stroke_width=stroke_width,stroke=stroke)
    return triangle

# 2_square_maker

def square_maker(h,color,stroke_width,stroke):
    square = rectangle(w=h,h=h,fill=color,stroke_width=stroke_width,stroke=stroke)
    return square
# 3_repeater_rotator

def repeater_rotator(shape,rep_num,rot_angl):
    shape_1 = shape | repeat(rep_num,rotate(rot_angl))
    return shape_1

#structure1

shape__1 = triangle_maker(0,0,100,100,0,100,"#900C3F",10,"#FF3F00")
shape_1 = repeater_rotator(shape__1,6,60)
a1 = circle(r=150,fill="#FFCF68",stroke = "none")
shape1 = a1 + shape_1

shape1 = shape1 | scale(.25)

#structure2

a2 = circle(r=50,fill="#E57A1C",stroke="none")
b2 = circle(r=62.5,fill="#D25961",stroke="none")
c2 = circle(r=100,fill="#F5F6EE",stroke="none")
d_2 = triangle_maker(0,0,-25,98,25,98,"#800B9E",0,"none")
d2 = repeater_rotator(d_2,8,45)
e2 = circle(r=105,fill="#A60813",stroke="none")
shape2 = e2 + c2 + d2 + b2 + a2 + shape1

#structure3

a3 = square_maker(204,"#FF8103",0,"none")
b_3 = square_maker(204,"#E21414",0,"none")
b3 = b_3 | rotate(45)
c_3 = rectangle(h=288,w=120,fill="#F3F323",stroke="none")
c3 = repeater_rotator(c_3,4,45)
shape3 =c3 + a3 + b3 + shape2
shape3 = shape3 | scale(.5)

#structure4
a4 = square_maker(144,"#E21414",3,"black")
b_4 = square_maker(144,"#FF8103",3,"black")
b4 = b_4 | rotate(45)
c4 = circle(r=101.5,fill="#FCD8D4",stroke="none")
d4 = circle(r=110,fill="#05702C",stroke="none")
e4 = circle(r=130,fill="#460B92",stroke="none")
f4 = circle(r=149,fill="#8A4ED8",stroke="none")
g4 = circle(r=180,fill="#FFD384",stroke="#FA9905",stroke_width=5)
h4 = circle(r=5,fill="#FF5200",stroke="none")
i_4 = circle(x=0,y=180,r=25,fill="#FF5200",stroke="black",stroke_width=5)
j4 = circle(x=0,y=190,r=5,fill="yellow")
i_4 = i_4 + j4
i4 = repeater_rotator(i_4,25,15)
k4 = circle(r=208,fill="#580404",stroke="black")

shape4 = k4 + i4 + g4 + f4 + e4 + d4 + c4 + a4 + b4 + shape3 + h4 
shape4 = shape4 | scale(.5)
#structure5(triangular_colour)
a5 = triangle_maker(-100,0,100,0,0,150,"white",2,"black")
b5 = triangle_maker(-66,0,66,0,0,100,"#F2FF2B",0,"none")
b_6 = b5 | translate(x=-34)
b_7 = b5 | translate(x=34)
b_5 = b_6 + b_7 + b5
d5  = triangle_maker(0,0,100,0,50,75,"#F59A23",0,"none")
d_5  = d5 | repeat(4,translate(x=-33.5))
d7 = d5 + d_5
c5  = triangle_maker(-33,0,33,0,0,50,"#9B0707",0,"none")
c_5  = c5 | repeat(3,translate(x=-33.5))
c_6  = c5 | repeat(3,translate(x=33.5))
e5  = triangle_maker(-33,0,0,0,-15,25,"#580404",0,"none")
e_5  = e5 | repeat(3,translate(x=-33.5))
e_6  = e5 | repeat(4,translate(x=33.5))
shape_5 = a5 + b_5 + d7 + c_5 + c_6 + e_5 + e_6
shape5 = shape_5 | scale(.25)|translate(y=102)
shape6 = shape5 | repeat(15,rotate(30))

#structure6
a6 = circle(r=140,fill="#8C0000")
circle2 = circle(r=125,fill="white",stroke="none")
circle3 = circle(r=120,fill="#F2C618",stroke="none")
shape_6 = a6 + circle2 + circle3 + shape4 + shape6

#structure7
shape_6 = shape_6 | scale(.75)
a_7 = triangle_maker(-5,105,5,105,0,115,"white",0,"none")
a7 = repeater_rotator(a_7,125,5)
b7 = circle(r=115,fill="#DDFF30",stroke = "none")
shape7 =  b7 + a7 + shape_6 
#structure8
shape7 = shape7 | rotate(2.5)
a_8 = triangle_maker(-7,115,7,115,0,121,"#DDFF30",0,"none")
a8 = repeater_rotator(a_8,125,5)
b8 = circle(r=121,fill="#FF3F00",stroke = "none")
shape8 =  b8 + a8 + shape7
#structure9
shape8 = shape8 | rotate(2.5)
a_9 = triangle_maker(-9,121,9,121,0,130,"#FF3F00",0,"none")
a9 = repeater_rotator(a_9,125,5)
b9 = circle(r=130,fill="#BD1616",stroke = "none")
shape9 =  b9 + a9 + shape8
#structure10
shape9 = shape9 | rotate(2.5)
a_10 = triangle_maker(-10,130,10,130,0,140,"#BD1616",0,"none")
a10 = repeater_rotator(a_10,125,5)
b10 = circle(r=140,fill="#8D2828",stroke = "none")
shape10 =  b10 + a10 + shape9
#structure12
shape10 = shape10 | rotate(2.5)
a_12 = triangle_maker(-10,140,10,140,0,150,"#8D2828",0,"none")
a12 = repeater_rotator(a_12,125,5)
b12 = circle(r=150,fill="#BD1616",stroke = "none")
shape12 =  b12 + a12 +  shape10

#arrow 
shape12 = shape12 | rotate(35.5)
triangle = triangle_maker(-5,60,5,60,0,70,"black",0,"none")
arrow = rectangle(w=5,h=20,x=0,y=50,fill="black") + triangle
arrows = repeater_rotator(arrow,8,45)
a11 = square_maker(300,"white",0,"none")
shape11 = shape12 + arrows
shape11 = shape11 | scale(.95)
green_circle = circle(r=148,fill ="#54E346",stroke_width = 2,stroke="black")
final_shape = a11 + green_circle + shape11 
show(final_shape)
# The End