Pookkalam by Dilsha Shirin

Code

c=circle(r=300,fill="white")
#BOAT

import math
def part_of_ellipse(w,h,theta):
    return point(math.sin(theta)*(w),math.cos(theta)*h)
points = [point(3,0)]
w = 20 
h = 35 
part = 0.5 
step = 0.01  
i = 0
while i < (3.14*(part*2)):
    points.append(part_of_ellipse(w,h,i))
    i = i+step # Step size
boat= polygon(points,fill="black")|rotate(285)|scale(0.85)
oar1=line(x1=-18, y1=-3, x2=-2, y2=-20,stroke="orange",stroke_width=2)
oar2=line(x1=-12, y1=-4, x2=3, y2=-22,stroke="orange",stroke_width=2)
p3= point(x=-38,y=2)
p4= point(x=-21,y=-16)
p5= point(x=-5,y=-15)

boatpart= polygon([p3,p4,p5],fill="black")
show(boatpart)

#UMBRELLA
umbstick = line(x1=8, y1=-3, x2=13, y2=15,stroke_width=2)

def part_of_circle(r,theta):
    return point(math.sin(theta)*r,math.cos(theta)*r)
points2 = [point(0,0)]

r = 12 
part = 0.5
step = 0.01  

i = 0
while i < (3.14*(part*2)):
    points2.append(part_of_circle(r,i))
    i = i+step 

umbrella=polygon(points2,fill="black",fill_opacity=0.85)  | rotate(75) | translate ( x=12, y= 12)
#WATER
water=ellipse(w=65,h=20,x=0,y=-20,fill="#25e5f7",stroke="none",fill_opacity=0.5)
#COMBINED FIGURE
picture=combine([water,boat,boatpart,umbrella,umbstick,oar1,oar2])

#OUTER DETAILS

e=ellipse(w=95,h=290,fill="#47081a",stroke="none")|rotate(21)|repeat(8,rotate(45))
ee1=ellipse(w=85,h=280,fill="#875266",stroke="none",fill_opacity=0.5)|rotate(21)|repeat(8,rotate(45))
ee2=ellipse(w=75,h=270,fill="#db7da1",stroke="none",fill_opacity=0.5)|rotate(21)|repeat(8,rotate(45))
ee3=ellipse(w=65,h=260,fill="#f7aac8",stroke="none",fill_opacity=0.5)|rotate(21)|repeat(8,rotate(45))
ee4=ellipse(w=55,h=250,fill="#f9cadc",stroke="none",fill_opacity=0.5)|rotate(21)|repeat(8,rotate(45))
ee5=ellipse(w=45,h=240,fill="#f7edf1",stroke="none",fill_opacity=0.5)|rotate(21)|repeat(8,rotate(45))                                                                                      

e1=ellipse(w=90,h=280,fill="#770013",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
e2=ellipse(w=80,h=270,fill="#bc3841",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
e3=ellipse(w=70,h=260,fill="#ea6227",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
e4=ellipse(w=60,h=250,fill="#fc751b",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
e5=ellipse(w=50,h=240,fill="#ffcd38",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
e6=ellipse(w=40,h=230,fill="#ffe496",fill_opacity=0.5,stroke="none")|repeat(10,rotate(45))
outerdes1=combine([e,ee1,ee2,ee3,ee4,ee5,e1,e2,e3,e4,e5,e6])
#CONCENTRIC PART-1
c2 = circle(r=100,fill="white",stroke="none")
c3= circle(r=95,fill="#f7d00e",stroke="none",fill_opacity=0.85)
c4 = circle(r=90,fill="#f9b116",stroke="none")
c5= circle(r=85,fill="#fc751b",stroke="none",fill_opacity=0.5)
c6 = circle(r=80,fill="#ff6816",stroke="none")
c7=circle(r=53,fill="#ef072d",stroke="none")

concentric1= combine([c2,c3, c4,c5,c6,c7])

#FLOWER PATTERN
r1= rectangle(w=115, h=115,fill="#770013",stroke="none",fill_opacity=0.5) | repeat(10, rotate(30))
r2= rectangle(w=105, h=105,fill="#ef072d",stroke="none",fill_opacity=0.5) | repeat(10, rotate(30))
r3=rectangle(w=95, h=95,fill="#ff6816",stroke="none",fill_opacity=0.5) | repeat(10, rotate(30))
r4= rectangle(w=85, h=85,fill="#fcc614",stroke="none",fill_opacity=0.5) | repeat(10, rotate(30))
r5=rectangle(w=75, h=75,fill="white",stroke="none",fill_opacity=0.5) | repeat(10, rotate(30))
e7=ellipse(h=130,w=6,fill="#9b012a",stroke="none")|rotate(1)|repeat(12,rotate(30))
#CONCENTRIC PART-2
c8 = circle(r=50,fill="#770013",stroke="none")
c9 = circle(r=40,fill="#ef072d",stroke="none",fill_opacity=0.5)
c10 = circle(r=30,fill="#ff6816",stroke="none",fill_opacity=0.5)
c11= circle(r=20,fill="orange",stroke="none",fill_opacity=0.5)
c12 =circle(r=10,fill="orange",stroke="none")
concentric2= combine([c8,c9, c10, c11,c12])
#INNER DETAILS
c8= circle(x=100, y=0, r=20,fill="white",stroke="none",fill_opacity=0.5) | repeat(8, rotate(45))
c9=circle(r=45,fill="white",stroke="none",fill_opacity=0.5)
#SUN RAYS
square= rectangle(x=0,y=15,w=10,h=10,fill="#fcfcfc",stroke="none",fill_opacity=0.45) | repeat(12,rotate(30))
#RESULT
show(c,outerdes1,concentric1,r1,r2,r3,r4,r5,e7,concentric2,square,c9,picture)