# Creating an array of spheres

**URL:** <https://community.freefem.org/t/creating-an-array-of-spheres/1361>\
**Category:** General Discussion\
**Created:** [November 30, 2021, 2:41am UTC](https://community.freefem.org/t/creating-an-array-of-spheres/1361 "2021-11-30T02:41:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaojiemo](https://avatars.discourse-cdn.com/v4/letter/x/a4c791/32.png) [@xiaojiemo](https://community.freefem.org/u/xiaojiemo)\
**Post date:** [November 30, 2021, 2:41am UTC](https://community.freefem.org/t/creating-an-array-of-spheres/1361/1 "2021-11-30T02:41:56Z")

</div>

hello.everyone.I am struggling of creating an array of sphere and I have tried through “mmgs”.  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/521aab1fbab662c6f479d81c4b775b7089ea6e98.png)  
while it completely cannnot work. Is there anyone can provide suggestions?

---

<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:** [November 30, 2021, 1:45pm UTC](https://community.freefem.org/t/creating-an-array-of-spheres/1361/2 "2021-11-30T13:45:26Z")

</div>

Heelo,

This ways to program is crazy,

the simple way is to build 1 mesh of sphere add after you just move the sphere to change the centre to  
[ox[i],oy[0],oz[0]] for each i with movemesh function.

---

<div class="post-metadata">

**Author:** ![xiaojiemo](https://avatars.discourse-cdn.com/v4/letter/x/a4c791/32.png) [@xiaojiemo](https://community.freefem.org/u/xiaojiemo)\
**Post date:** [December 2, 2021, 3:08am UTC](https://community.freefem.org/t/creating-an-array-of-spheres/1361/3 "2021-12-02T03:08:16Z")

</div>

hello，  
I have tried this method,  
 ![image](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/f7801b8e0ddd1660a631658786e1447cb3cb8a01.png)  
the procedure said that the Th3 does not exist.

---

<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:** [December 4, 2021, 3:33pm UTC](https://community.freefem.org/t/creating-an-array-of-spheres/1361/4 "2021-12-04T15:33:39Z")

</div>

Yes because the mesh Th3 is remove outside of brace

{  
mesh3 Th3 = …  
}  
here Th3 do not exist (like in C++)
