Pookkalam by Parthiv R

Code

finalcircle=circle(r=142,fill="whitesmoke",stroke_width=2)
show(finalcircle)
#outerspiral design
green=color(r=0,g=220,b=0,a=0.5)
blue=color(r=0,g=0,b=210,a=0.30)
purple=color(r=220,g=0,b=220,a=0.50)
yellow=color(r=255,g=250,b=0,a=0.65)

spiral4 = circle(x=88,y=0,r=50,fill=yellow,stroke="none") | repeat(18,rotate(20))
spiral3 = circle(x=80,y=0,r=50,fill=green,stroke="none") | repeat(18,rotate(20))
spiral2 = circle(x=70,y=0,r=50,fill=blue,stroke="none") | repeat(18,rotate(20))
spiral1 = circle(x=54,y=0,r=50,fill=purple,stroke="none") | repeat(18,rotate(20))
show(spiral4,spiral3,spiral2,spiral1)


#leaf design
p11=point(x=0, y=65) 
p12=point(x=80,y=0)    
p13=point(x=0,y=-65)
p14=point(x=-25,y=0) 
leaf1=polygon([p11, p12, p13, p14],fill="navy")

p21=point(x=0, y=30) 
p22=point(x=50,y=0)     
p23=point(x=0,y=-30)
p24=point(x=-25,y=0) 
leaf2=polygon([p21, p22, p23, p24],fill="magenta")

leaf_main=combine([leaf1,leaf2])
leaf_main1=leaf_main | translate(x=170,y=0) | scale(0.47)
#showing leaf
leaf_main2= leaf_main1 |repeat(10, rotate(36))
show(leaf_main2)

#intermedate circles
circle6=circle(r=75,fill="yellow")
show(circle6)
circle5=circle(r=70,fill="white",stroke="none")
show(circle5)
circle4=circle(r=65,fill="orange",stroke="none")
show(circle4)

#innerpattern
s1=rectangle(w=100,h=100,fill="crimson",stroke_width=3,stroke="crimson")
s2=rectangle(w=80,h=80,fill="white",)
s3=rectangle(w=50,h=50,fill="yellow",)
shapesq=combine([s1,s2,s3])
s4=shapesq|translate(x=50,y=50)|scale(0.5)
s5=s4|repeat(8,rotate(45))
#triangle for completing the pattern
p1=point(x=0,y=0)
p2=point(x=50,y=0)
p3=point(x=50,y=50)
tra=polygon([p1,p2,p3],fill="crimson",stroke_width=3,stroke="crimson")
p4=point(x=5,y=5)
p5=point(x=45,y=5)
p6=point(x=45,y=45)
tra1=polygon([p4,p5,p6],fill="white",stoke="none")
p7=point(x=13,y=13)
p8=point(x=37,y=13)
p9=point(x=37,y=37)
tra2=polygon([p7,p8,p9],fill="yellow",stoke="none")
tra3=combine([tra,tra1,tra2])

#innercircles
inner_circle2=circle(r=23,fill="navy",stroke="none")
inner_circle1=circle(r=18,fill="royalblue",stroke="none")
inner_circle=circle(r=13,fill="gold",stroke="none")
#showing the innerpattern
pattern1=combine([s5,tra3,inner_circle2,inner_circle1,inner_circle])
show(pattern1)