# Movemesh() to generate a circle

**URL:** <https://community.freefem.org/t/movemesh-to-generate-a-circle/3113>\
**Category:** General Discussion\
**Created:** [April 19, 2024, 4:49pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113 "2024-04-19T16:49:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [April 19, 2024, 4:49pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113/1 "2024-04-19T16:49:46Z")

</div>

Hi there, if we use

> Th = movemesh(Th0, [x_cos(y), x_sin(y)])

to generate a circular mesh

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/7/7ef4cd1f122446d217be5709b48b28bbde8feadf.png)

from a rectangle:

 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/2/2e722431cc34ba4af7e8b056c5fac4623bd422af.png)

**How to collapse the overlapped line at y=0** so that it becomes a proper structured mesh?

Seems there is parameter `ptmerge,` but it is only for 3D?

Thank you for your help 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:** [April 20, 2024, 5:16pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113/2 "2024-04-20T17:16:44Z")

</div>

Sorry due to missing code you have to use two 2 mesh add glut this 2 mesh with operator +

```auto
mesh Th=square(32,10,[(1+y)*cos(pi*x),(1+y)*sin(x*pi)]) + square(32,10,[(1+y)*cos(pi*(x+1)),(1+y)*sin((x+1)*pi)]) ;
Th =change(Th,rmInternalEdges=1);
plot(Th,wait=1);

```

---

<div class="post-metadata">

**Author:** ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)\
**Post date:** [April 20, 2024, 6:58pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113/3 "2024-04-20T18:58:22Z")

</div>

Thank you very much!

---

<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:** [April 25, 2024, 1:19pm UTC](https://community.freefem.org/t/movemesh-to-generate-a-circle/3113/4 "2024-04-25T13:19:09Z")

</div>

This bug was fixed in develop branch,
