Criss Cross triangulation

I would like to do some calculations on the unit square using criss-cross meshes.
Is there a simple way to create such a mesh on a unit square?


Do you mean a mesh like this?

It should be quite similar, but I think it isn’t the one you plotted. The procedure that I want to use can be described as follows:
partition the domain into triangles by first subdividing it into squares with sides of length 2h (here h is 2^(-k), k integer).
Then dividing each of these squares firstly into four squares with sides of length h and then into eight
triangles by dividing the large square by its diagonals.

Is this what you’re looking for:

in freefem just do:

mesh Th = square(n, m, [x0+(x1-x0)*x, y0+(y1-y0)*y], flags=1);// 

build a will produce a Union Jack flag type of mesh or criss-cross meshes.