# How can i make a T-shaped mesh

Hello there,

how can i make a T-shaped mesh

I have tried and it does not come out

I have tried this way
/T/
border A(t=0,0.5){x=0;y=0.5-t;label=1;};
border B(t=0,0.5){x=t;y=0;label=1;};
border C(t=0,1.0){x=1-t;y=0.5;label=1;};
border D(t=0.5,1){x=0.5;y=1-t;label=1;};
border E(t=0.0,1){x=0.5+t;y=-0.5-t;label=1;};
border F(t=0,1.5){x=1;y=1+t;label=1;};
border G(t=0.0,1.5){x=t;y=0;label=1;};
border H(t=0.5,3){x=3-t;y=0.5;label=1;};
int n=10;
mesh Th=buildmesh(A(n)+ B(n)+ C(n)+ D(n)+ E(n)+ F(n)+ G(n)+ H(n));
plot(Th,wait=1,ps=“initial mesh”);

Hi,

Did you try to plot only the borders ?
with plot( A(n)+ B(n)+C(n)+D(n)+ E(n)+ F(n)+G(n)+H(n) , wait=1);

It doesn’t work for me, it throws a strange figure at me

Hi Daniela,
You should generate the mesh counterclockwise, see the following example:

//
border A(t=0,0.5){x=2+t;y=0; label=1;};
border B(t=0,2.5){x=2.5;y=t;label=2;};
border C(t=0,0.5){x=2.5+t;y=2.5;label=3;};
border D(t=0,0.5){x=3;y=2.5+t;label=4;};
border E(t=0,1){x=3-1.5*t;y=3;label=5;};
border F(t=0,0.5){x=1.5;y=3-t;label=6;};
border G(t=0,0.5){x=1.5+t;y=2.5;label=7;};
border H(t=0,2.5){x=2;y=2.5-t;label=8;};
int n=10;
mesh Th=buildmesh(A(n)+ B(n)+ C(n)+ D(n)+ E(n)+ F(n)+ G(n)+ H(n));
plot(Th,wait=1

);

Thank you very much Emma, it helped me a lot to see your example. Happy day