Code
def boatandumbrella():
#boat
p1=point(x=-30,y=3)
p2=point(x=0,y=3)
p3=point(x=10,y=21.2)
p4=point(x=20,y=21.2)
p5=point(x=5,y=-7)
p6=point(x=-30,y=-7)
boat=polygon([p1,p2,p3,p4,p5,p6],fill='black',stroke="none")
#umbrella
s=ellipse(w=6, h=15, x=4, y=24, fill='blue',stroke="none")|rotate(45)
l=ellipse(w=6, h=15, x=30, y=2, fill='purple',stroke="none")|rotate(135)
k=ellipse(w=6, h=15, x=-18, y=18, fill='green',stroke="none")
#oars
oar1 = line(x1=-15, y1=5, x2=-5, y2=-20,stroke_width=1.5)
oar2 = line(x1=-5, y1=5, x2=5, y2=-20,stroke_width=1.5)
stick = line(x1=-18, y1=12, x2=-18, y2=-5)
#tipofboat-triangle
p1 = point(x=20, y=21)
p2 = point(x=27, y=35)
p3 = point(x=-5, y=21)
triangle = polygon([p1, p2, p3], fill='black', stroke="none")
return combine([boat,s,l,k,oar1,oar2,stick,triangle])
def inner_colourful_circle():
#multicoloured inner circles
c6 = circle(r=50,fill='#c20c27')
c5 = circle(r=46,fill='red', stroke="none")
c4 = circle(r=42,fill='#ff8c00', stroke="none")
c3 = circle(r=38,fill='#fff708', stroke="none")
c2 = circle(r=34,fill='white', stroke="none")
c1 = circle(r=30,fill='#fff708', stroke="none")
#purple and red triangles
r1 = rectangle(w=90, h=90, fill="purple")
r1 = r1 | rotate (45)
r2 = rectangle(w=90, h=90, fill="red")
r2 = r2 | rotate (90)
return combine([r1,r2,c6,c5,c4,c3,c2,c1])
def middle_circle():
#yellow triangles
p1 = point(x=-50, y=0)
p2 = point(x=50, y=0)
p3 = point(x=0, y=80)
triangle_circle = polygon([p1, p2, p3], fill='#fff708')| repeat(12, rotate(45))
#green,yellow,orange subcircles
circle1 = circle(r=38,y=57,fill="#ff8c00")
circle2 = circle(r=28,y=57,fill="#fff708")
circle3 = circle(r=18,y=57,fill="green")
subCircle1 = circle1+circle2+circle3
subCircle2 = subCircle1 | translate(y=-114)
Combine1 = subCircle1+subCircle2
Combine2 = Combine1 | rotate(90)
last1 = Combine1+Combine2
last2 = last1 |rotate(45)
#green layer
f1 = rectangle( w=180,h=120,fill="green",stroke="#1b5228",stroke_width=4)|repeat(200,rotate(30))
return combine([f1,last1,last2,triangle_circle])
def outer_circle():
#outer multicoloured circles
outer_black = circle(r=149,fill='black')
deepred_layer = square(side=212,color='#91030a') | repeat(10, rotate(10))
red_layer = square(side=196, color='red') | rotate(5) | repeat(10, rotate(10))
orange_layer = square(side=182, color='#ff8c00') | repeat(10, rotate(10))
yellow_layer = square(side=168, color='#fff708') | rotate(5) | repeat(10, rotate(10))
white_layer = square(side=155, color='white') | repeat(10, rotate(10))
return combine([outer_black,deepred_layer,red_layer,orange_layer,yellow_layer,white_layer])
def square(color, side):
return rectangle(w=side, h=side, fill=color, stroke='none')
outer_layer=outer_circle()
show(outer_layer)
middle_layer=middle_circle()
show(middle_layer)
inner_layer=inner_colourful_circle()+boatandumbrella()
show(inner_layer)