# How can i make a T-shaped mesh

**URL:** <https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215>\
**Category:** General Discussion\
**Created:** [September 21, 2021, 6:15am UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215 "2021-09-21T06:15:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![DanielaV](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DanielaV](https://community.freefem.org/u/DanielaV)\
**Post date:** [September 21, 2021, 6:15am UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/1 "2021-09-21T06:15:59Z")

</div>

Hello there,

how can i make a T-shaped mesh

I have tried and it does not come out

---

<div class="post-metadata">

**Author:** ![DanielaV](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DanielaV](https://community.freefem.org/u/DanielaV)\
**Post date:** [September 21, 2021, 6:17am UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/2 "2021-09-21T06:17:11Z")

</div>

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”);

---

<div class="post-metadata">

**Author:** ![tess35](https://avatars.discourse-cdn.com/v4/letter/t/ac8455/32.png) [@tess35](https://community.freefem.org/u/tess35)\
**Post date:** [September 22, 2021, 3:41pm UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/3 "2021-09-22T15:41:46Z")

</div>

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);

---

<div class="post-metadata">

**Author:** ![DanielaV](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DanielaV](https://community.freefem.org/u/DanielaV)\
**Post date:** [September 22, 2021, 9:00pm UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/4 "2021-09-22T21:00:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Emma87](https://avatars.discourse-cdn.com/v4/letter/e/e47774/32.png) [@Emma87](https://community.freefem.org/u/Emma87)\
**Post date:** [September 23, 2021, 12:56pm UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/5 "2021-09-23T12:56:47Z")

</div>

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

 ![mesh-T](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/21f98ba180290cec20ed9a2c11ba7485df03c814.png)  
);

---

<div class="post-metadata">

**Author:** ![DanielaV](https://avatars.discourse-cdn.com/v4/letter/d/7feea3/32.png) [@DanielaV](https://community.freefem.org/u/DanielaV)\
**Post date:** [September 23, 2021, 11:31pm UTC](https://community.freefem.org/t/how-can-i-make-a-t-shaped-mesh/1215/6 "2021-09-23T23:31:14Z")

</div>

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