Code
# Author:JOBIN S
# outer circle
c = circle(r=150, fill='#341118')
show(c)
# create an function for square creation
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
# create an function for TinkerHub logo
def tinkerhub_logo():
r1 = rectangle(w=105, h=50, fill='#2CC0CF', stroke='none', x=-45, y=70)
r2 = rectangle(w=50, h=50, fill='#2078F9', stroke='none', x=50, y=70)
layer1 = r1 + r2
layer2 = rectangle(w=175, h=50, fill='#FECD3D', stroke='none', x=-12, y=0)
r1 = rectangle(w=70, h=50, fill='#EE3C35', stroke='none', x=-65, y=-70)
r2 = rectangle(w=42, h=50, fill='#91BF23', stroke='none', x=0, y=-70)
r3 = rectangle(w=42, h=50, fill='#045768', stroke='none', x=52, y=-70)
layer_three = r1 + r2 + r3
return combine([layer1, layer2, layer_three]) | scale(0.08) | translate(x=1)
outer_layer_data = [ {"side":212.5, "color":'#FEFDF3'}, {"side":196, "color":'#F8E63D'}, {"side":182, "color":'#E3BD36'}, {"side":168, "color":'#F36636'}, {"side":155, "color":'#a92822'} ]
outer_layer=[]
# creating outerlayer with outer_layer_data
for i in outer_layer_data:
if(outer_layer_data.index(i) % 2 == 0 ):
layer = square(side=i['side'], color=i['color']) | rotate(5) | repeat(10, rotate(10))
else:
layer = square(side=i['side'], color=i['color']) | repeat(10, rotate(10))
outer_layer.append(layer)
show(combine(outer_layer))
middle_c = circle(r=97, fill='#6e962d') # middle circle of pookalam
# pattern inside middle circle
white_layer = square(side=136,color='#FEFDF3') | repeat(3, rotate(30))
pink_layer = square(side=123,color='#E65A99') | repeat(3, rotate(30))
red_layer = square(side=105,color='#AE2924') | repeat(3, rotate(30))
arrow_head = square(side=85,color='black') | repeat(5, rotate(30))
# trianlge's (polygon) points
p1 = point(x=-20, y=0)
p2 = point(x=20, y=0)
p3 = point(x=0, y=95)
# creating triangle ring with triangle and an ellipse in it
triangle_ring = polygon([p1, p2, p3], fill='#F36636') + ellipse(w=6, h=15, x=0, y=65, fill='#F8E63D') | repeat(12, rotate(30))
show(middle_c, white_layer, pink_layer, red_layer,triangle_ring, arrow_head)
# box ring inside inner circle
def inner_box_ring():
shape = rectangle(h=12, w=17, fill='#E3BD36', y=-32, stroke='none')
for i in range(1, 13) :
if i % 2 == 0:
shape = shape + rectangle(h=12, w=17, fill='#E3BD36', y=-32, stroke='none') | rotate(30)
else:
shape = shape + rectangle(h=12, w=17, fill='#36a810', y=-32, stroke='none') | rotate(30)
return shape
inner_c = circle(r=50, fill='#F8E63D') + circle(r=26, fill='#ff4102')+inner_box_ring()
# center white circle with TinkerHub logo
inner_button = circle(r=13, fill='#ffffff', stroke_width=3) + tinkerhub_logo()
inner_line_ring = line(x1=13, y1=0, x2=50, y2=0, stroke_width=3) | repeat(12, rotate(30)) | rotate(15)
show(inner_c,inner_button, inner_line_ring)