#Points hexagon
m=6
Execute(Sequence("A"+i+"=Rotate( (cos(pi/3*"+i+"), sin(pi/3*"+i+")), -pi/6, (0,0) )", i, 1, m))
#Hexagon
Poly01=Polygon(A1, A2, A3, A4, A5, A6)
#Origin
O=(0,0)
#Segment from center
S2=Segment(O, A2)
S4=Segment(O, A4)
S6=Segment(O, A6)
#Circles corners
r=Slider(0.1, 1, 0.1, 1, 140, false, true, false, false)
C1=Circle(A1, r)
C3=Circle(A3, r)
#Circle center
C0=Circle(O, r)
#Intersections
I1=Intersect( C1, a1 )
J1=Intersect( C3, a2 )
L1=Intersect( C0, S2 )
#Object
T1=Polygon( A1, I1, L1, J1, A3, O )
T2=Rotate(T1, 2*pi/3, O)
T3=Rotate(T1, -2*pi/3, O)
#Vectors
auxray=Ray(O, A1)
auxPoint=Intersect(C1, auxray, 2)
u1=Vector(O, auxPoint )
n=Slider(1,18,1, 1, 140, false, true, false, false)
u=Sequence(Rotate(u1, π / 3 i, O), i, 1, n)
v=Sequence( If(Mod(i, 2)==1, Rotate( 2*u1, pi/3*(i+1)/2, O ), Rotate( u1+Rotate(u1, pi/3, O), pi/3*(i/2), O ) ) , i, 1, n )
w=Sequence(If( Mod(i, 3)==1, Rotate(3*u1, pi/3*((i+2)/3), O) , If( Mod(i, 3)==2 , Rotate(2*u1+ Rotate(u1, pi/3, O ) , pi/3*((i+1)/3), O) , Rotate(u1+ 2*Rotate(u1, pi/3, O ) , pi/3*(i/3), O) ) ) , i, 1, n)
L_1=Sequence(Translate(T1, Element(u, i)), i, 1, 6)
L_2=Sequence(Translate(T2, Element(u, i)), i, 1, 6)
L_3=Sequence(Translate(T3, Element(u, i)), i, 1, 6)
L_4=Sequence(Translate(T1, Vector(Element(v, i))), i, 1, 12)
L_5=Sequence(Translate(T2, Vector(Element(v, i))), i, 1, 12)
L_6=Sequence(Translate(T3, Vector(Element(v, i))), i, 1, 12)
L_7=Sequence(Translate(T1, Vector(Element(w, i))), i, 1, 18)
L_8=Sequence(Translate(T2, Vector(Element(w, i))), i, 1, 18)
L_9=Sequence(Translate(T3, Vector(Element(w, i))), i, 1, 18)