Nexorade Grid
Setup
ft(b,c)= b^2 + b*c + c^2
Lkit1 = Zip(Zip( If(Mod(ft(b,c),7)==0, (ft(b,c),b,c)), c,0..b), b,1..12)
Lkit2 = RemoveUndefined(Flatten(Lkit1))
Lkit3 = Sort(Lkit2,x(Lkit2))
n = Slider(1,20,1, 1,200,false)
tbc= Lkit3(n)
t = x(tbc)
b = y(tbc)
c = z(tbc)
Kitrick = "Nex"+t+"("+b+","+c+")"
Sgn = If(Mod(3b + 2c, 7) == 0, 1, -1)
v = (2b + c, Sgn*sqrt(3)*c)
M1 = { {2, -1} , {0, sqrt(3) } }
M2 = { {x(v),-y(v)} , {y(v), x(v)} }
M3 = Invert(M2) M1
tri1 = ApplyMatrix(M3, Polygon({(1,-1), (3,1), (1,1)}))
tri2 = Zip(Rotate(tri1, k*60°), k,0..1)
M4 = M3 { {2,1} , {-1,3} }
Lgrid = Flatten(Zip(Zip(M4*(u,v), u,-4..12), v,-4..12))
Ltri2 = Zip(translate(tri2,v), v,Lgrid)
triang = Polygon({ (0,0), (1,0), (0.5,sqrt(3)/2) })
M = ( 3, sqrt(3) ) / 6