/* Mesh test: Mix Transfinite and Blossom
 * Sebastian Eiser, July 2012
 */

n = 19; // Couldn't find a `cltest` for `n = 20`
cltest = 5.28; // tuning parameter with which I tried to get rid of the triangles

Mesh.RecombineAll=1; //recombine all defined surfaces
Mesh.Algorithm=8;    //delquad mesher
Mesh.RecombinationAlgorithm=1; //blossom

// square 1
Point(1) = {0, 0, 0, 1.0};
Point(2) = {0, 100, 0, 1.0};
Point(3) = {100, 100, 0, cltest};
Point(4) = {100, 0, 0, cltest};
Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};
Transfinite Line{1,2,3,4} = n;

Line Loop(5) = {3, 4, 1, 2};
Plane Surface(6) = {5};

// this line will mesh with regular 2d tris
Transfinite Surface{6}; // = {1,2,3,4}; //optional point numbers

// this line recombines tris to quads
Recombine Surface{6} = 0; // argument (optional) max angle

// square 2
Point(5) = {200, 100, 0, cltest};
Point(6) = {200, 0, 0, cltest};
Line(7) = {5, 6};
Line(8) = {6, 4}; 
Line(10) = {3, 5};
// if I uncomment the following line, I get triangles in surface 2 (except for `cltest = 5.28`)
//Transfinite Line{7,8,10} = n;
// however, if I uncomment only this line, I get no triangles in surface 2 independent of `cltest`
//Transfinite Line{7} = n;

Line Loop(11) = {7, 8, -3, 10};
Plane Surface(12) = {11};

//Transfinite Surface{12}; // = {1,2,3,4}; //optional point numbers
//Recombine Surface{12} = 0; // argument (optional) max angle
