# Uniform grid meshing help

**URL:** <https://community.freefem.org/t/uniform-grid-meshing-help/1468>\
**Category:** General Discussion\
**Created:** [February 3, 2022, 6:56am UTC](https://community.freefem.org/t/uniform-grid-meshing-help/1468 "2022-02-03T06:56:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumantkr](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/sumantkr/32/2681_2.png) [@sumantkr](https://community.freefem.org/u/sumantkr)\
**Post date:** [February 3, 2022, 6:56am UTC](https://community.freefem.org/t/uniform-grid-meshing-help/1468/1 "2022-02-03T06:56:05Z")

</div>

Dear All  
Is there any way to generate a uniform grid for using `buildmesh` command?

in the case of a square domain:  
if we use `mesh Th = square(4, 5);`  
that gives us a meshing with a uniform triangular element.

 ![squaregrid](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/c18c0444c6507747205bf77eb93bdf9191094d65.png)

but in the

 ![lshape](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/091afc13352c0e0afa5345385dddf097389f65a2.png)  
case of builmesh command we got a zig-zag orientation of mesh elements:

Can we get a uniform alignment of triangles ( like in square case) using builmesh command.

Thanks in advance!!!

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [February 3, 2022, 8:52am UTC](https://community.freefem.org/t/uniform-grid-meshing-help/1468/2 "2022-02-03T08:52:24Z")

</div>

Sorry, they no algorithme to do that  
but for you example you can

```auto
int[int] labs=[10,20,30,40];// bot., right, top, left labels
mesh Th1 = square(10,10,label=labs,region=0,[x,y]); //  
plot(Th1,wait=1);
 mesh Th = trunc(Th1,(x<0.5) | (y < 0.5),label=1); // remove 1/2 square top , right
 plot(Th,cmm="Th",wait=1);

```

---

<div class="post-metadata">

**Author:** ![sumantkr](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/sumantkr/32/2681_2.png) [@sumantkr](https://community.freefem.org/u/sumantkr)\
**Post date:** [February 3, 2022, 9:05am UTC](https://community.freefem.org/t/uniform-grid-meshing-help/1468/3 "2022-02-03T09:05:46Z")

</div>

Thanks, Prof. @frederichecht Sir  
It helps me to shape my problem accordingly.

---

<div class="post-metadata">

**Author:** ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)\
**Post date:** [February 4, 2022, 5:18pm UTC](https://community.freefem.org/t/uniform-grid-meshing-help/1468/4 "2022-02-04T17:18:12Z")

</div>


