
int n=2;
meshL Th1 = segment(n);
meshL Th2 = segment(n,[0,x,0],orientation=1);
meshL Th3 = segment(n,[x,0,1],orientation=1);
meshL Th4 = segment(n,[0,0,x],orientation=-1);

meshL Th = Th1+Th2+Th3+Th4;
cout << "test nv: " << Th.nv << " nt: " << Th.nt << " nbe: "<< Th.nbe << endl;
Th=rebuildBorder(Th, angle=pi/2.+0.0001);
cout << "rebuildBorder test nv: " << Th.nv << " nt: " << Th.nt << " nbe: "<< Th.nbe << endl;

plot(Th);

meshL[int] Thglue(4);
Thglue[0] = Th1;
Thglue[1] = Th2;
Thglue[2] = Th3;
Thglue[3] = Th4;
plot(Thglue[0],Thglue[1],Thglue[2],Thglue[3]);
meshL Thglued = gluemesh(Thglue);
plot(Thglued,cmm="2");
