Code
c = circle(r=150, fill='#341118')
show(c)
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
def tinkerhub_logo():
r1 = rectangle(w=105, h=50, fill='blue', 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=[]
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
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))
p1 = point(x=-20, y=0)
p2 = point(x=20, y=0)
p3 = point(x=0, y=95)
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)
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 =20, fill='#E3BD36', y=-32, stroke='none') | rotate(30)
else:
shape = shape + rectangle(h=12, w=20, fill='#36a810', y=-32, stroke='none') | rotate(30)
return shape
inner_c = circle(r=50, fill="yellow")+circle(r=26, fill='#ff4102')+inner_box_ring()
inner_button = circle(r=13, fill='#ffffff', stroke_width=3) +rectangle(w=30,h=30,fill="pink") | repeat(20, rotate (20) | scale(0.9))
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)
petal = ellipse(x=0,y=10,w=10,h=20,fill="pink")
flower= petal | repeat(12,rotate(30))
flower_link = flower | translate(x=55,y=55) | repeat (8,rotate(45))
e1 = flower_link | scale(1.5)
show(e1)
petal = ellipse(x=0,y=10,w=10,h=20,fill="pink")
flower= petal | repeat(12,rotate(30))
flower_link = flower | translate(x=55,y=55) | repeat (8,rotate(45))
e1 = flower_link | scale(.7)
show(e1)