Code
#CODE BY : Soumya Annie Thomas
# outer circle
c = circle(r=150, fill='red')
show(c)
#outer design
x=rectangle(h=209,w=209,fill="black",stroke="none")|repeat(36, rotate (10))
show(x)
#function
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
outer_layer_data = [ {"side":210, "color":'#FEFDF3'}, {"side":182, "color":'#E3BD36'}]
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(50) | repeat(1, rotate(10))
else:
layer = square(side=i['side'], color=i['color']) | repeat(10, rotate(100))
outer_layer.append(layer)
show(combine(outer_layer))
middle_c = circle(r=100, 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))
p1 = point(x=-20, y=0)
p2 = point(x=20, y=0)
p3 = point(x=0, y=95)
show(middle_c, white_layer, pink_layer, red_layer)
# 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()
c=circle(r=23,fill="white",stroke="none")
# center white circle
show(inner_c,c)
#Inner design
P1=point(x=5,y=5)
P2=point(x=15,y=20)
P3=point(x=0,y=10)
c11=polygon([P1,P2,P3],fill="yellow")|repeat(8,translate(x=3))
New_obj=c11|repeat(6,rotate(60))
show(c11, New_obj)