Pookkalam by Mohamed Arish

Code

import math  # math is not that hard imo


def arrow(a, b, c, d, e, f, clr):  # for them cool arrows
    return polygon([a, b, c, d, e, f], fill=clr, stroke='none')


def triangle(a, b, c, clr):  # yay trigonometry
    return polygon([a, b, c], fill=clr, stroke='none')


def tan(angle):  # tangent
    return math.tan(math.radians(angle))


def cos(angle):  # cosine
    return math.cos(math.radians(angle))


def sin(angle):  # sine
    return math.sin(math.radians(angle))


out_circle = circle(r=150, fill='#0a0c0e', stroke='none')  # the start to it all

show(out_circle)

white_arrow = arrow(point(150, 0), point(140, 140 * tan(3)), point(130, 130 * tan(3)), point(140, 0),
                    point(130, -130 * tan(3)), point(140, -140 * tan(3)), clr='#cbcdb9')
yellow_arrow = arrow(point(140, 0), point(130, 130 * tan(3)), point(120, 120 * tan(3)), point(130, 0),
                     point(120, -120 * tan(3)), point(130, -130 * tan(3)), clr='#c6b149')
orange_arrow = arrow(point(130, 0), point(120, 120 * tan(3)), point(110, 110 * tan(3)), point(120, 0),
                     point(110, -110 * tan(3)), point(120, -120 * tan(3)), clr='#cdbe61')
red_arrow = arrow(point(120, 0), point(110, 110 * tan(3)), point(100, 100 * tan(3)), point(110, 0),
                  point(100, -100 * tan(3)), point(110, -110 * tan(3)), clr='#d77726')

small_sum = white_arrow + yellow_arrow + orange_arrow + red_arrow | repeat(12, rotate(
    90 / 3))  # the small neck-ties coming out

arrow_red = arrow(point(140 * cos(15), 140 * sin(15)), point(130 * cos(27), 130 * sin(27)),
                  point(120 * cos(27), 120 * sin(27)), point(130 * cos(15), 130 * sin(15)), point(120, 120 * tan(3)),
                  point(130, 130 * tan(3)), clr='#d77726')
arrow_orange = arrow(point(130 * cos(15), 130 * sin(15)), point(120 * cos(27), 120 * sin(27)),
                     point(110 * cos(27), 110 * sin(27)), point(120 * cos(15), 120 * sin(15)), point(110, 110 * tan(3)),
                     point(120, 120 * tan(3)), clr='#dab12b')
arrow_yellow = arrow(point(120 * cos(15), 120 * sin(15)), point(110 * cos(27), 110 * sin(27)),
                     point(100 * cos(27), 100 * sin(27)), point(110 * cos(15), 110 * sin(15)), point(100, 100 * tan(3)),
                     point(110, 110 * tan(3)), clr='#cdbe61')
arrow_white = arrow(point(110 * cos(15), 110 * sin(15)), point(100 * cos(27), 100 * sin(27)),
                    point(90 * cos(27), 90 * sin(27)), point(100 * cos(15), 100 * sin(15)), point(90, 90 * tan(3)),
                    point(100, 100 * tan(3)), clr='#cbcdb9')
purple_triangle = triangle(point(100 * cos(15), 100 * sin(15)), point(90 * cos(27), 90 * sin(27)),
                           point(90, 90 * tan(3)), clr='#6d6aa2')

large_sum = arrow_red + arrow_orange + arrow_yellow + arrow_white + purple_triangle | repeat(12, rotate(
    90 / 3))  # the fat neck-ties

inner_circle = circle(r=90, fill='#0a0c0e', stroke='none')  # the beggining to part 2

show(small_sum, large_sum, inner_circle)

lred_circles = circle(x=80, y=0, r=80 * tan(15), fill='#b91e45', stroke='none') | repeat(4, rotate(90))
dred_circles = circle(x=80 * cos(30), y=80 * sin(30), r=80 * tan(15), fill='#861431', stroke='none') | repeat(4, rotate(
    90))
ylw_circles = circle(x=80 * cos(60), y=80 * sin(60), r=80 * tan(15), fill='#fee974', stroke='none') | repeat(4,
                                                                                                             rotate(90))

mega_circles = lred_circles + dred_circles + ylw_circles  # the big colorful bulges

mini_grn = circle(x=70, y=0, r=70 * tan(15), fill='#71864e', stroke='none') | repeat(4, rotate(90))
mini_lred = circle(x=70 * cos(30), y=70 * sin(30), r=70 * tan(15), fill='#ba3c1f', stroke='none') | repeat(4,
                                                                                                           rotate(90))
mini_prpl = circle(x=70 * cos(60), y=70 * sin(60), r=70 * tan(15), fill='#a03d71', stroke='none') | repeat(4,
                                                                                                           rotate(90))

mini_crcls = mini_grn + mini_lred + mini_prpl  # the small colorful bulges

mini_wtcr = circle(r=70, fill='#dfcfb2', stroke='none')
mini_ylcr = circle(r=65, fill='#f4dd6f', stroke='none')
mini_orcr = circle(r=60, fill='#f1b135', stroke='none')
mini_rcr = circle(r=55, fill='#e16601', stroke='none')

linezz = line(x1=50 * cos(15), y1=50 * sin(15), x2=70 * cos(15), y2=70 * sin(15)) | repeat(12, rotate(30))

strt_nxt = circle(r=50, fill='#9f272c', stroke='none')

show(mega_circles, mini_crcls, mini_wtcr, mini_ylcr, mini_orcr, mini_rcr, linezz,
     strt_nxt)  # the layer between the innermost layer the bulgy layer

mini_s = circle(x=40, y=0, r=7, fill='#0a0c0e', stroke='none') | repeat(12, rotate(30))

in_prpl = circle(r=40, fill='#4f5194', stroke='none')
in_mrn = circle(r=30, fill='#8d3b60', stroke='none')
in_wht = circle(r=25, fill='#e3d2d3', stroke='none')

show(mini_s, in_prpl, in_mrn, in_wht)  # the inner design till just before the flower(cherry) on top

in_flwr = circle(r=20, fill="#ae3cac")
flwr_dtl = circle(x=7.5, y=0, r=15, stroke="#491247") | repeat(13, rotate(30))

show(in_flwr, flwr_dtl)  # cherry on top