# Building a Mesh in Two Steps

**URL:** <https://community.freefem.org/t/building-a-mesh-in-two-steps/1481>\
**Category:** General Discussion\
**Created:** [February 9, 2022, 2:48pm UTC](https://community.freefem.org/t/building-a-mesh-in-two-steps/1481 "2022-02-09T14:48:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![willrey](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/willrey/32/891_2.png) [@willrey](https://community.freefem.org/u/willrey)\
**Post date:** [February 9, 2022, 2:48pm UTC](https://community.freefem.org/t/building-a-mesh-in-two-steps/1481/1 "2022-02-09T14:48:42Z")

</div>

Hi there,

So that I can separate out functionality into different files, I’m trying to build one mesh from two sets of border definitions. Fundamentally, I’m trying to do this:

```auto
??? AdditionalBorders =
    MaterialBottom(50)
    +MaterialTop(50)
    +MaterialLeft(50)
    +MaterialRight(50);

mesh Th = buildmesh(
    Left(50)+Right(50)
    +Top(50)+Bottom(50)
    
    +AdditionalBorders
);

```

What type should I be using for the AdditionalBorders variable in order to achieve the above?

Many 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 9, 2022, 2:59pm UTC](https://community.freefem.org/t/building-a-mesh-in-two-steps/1481/2 "2022-02-09T14:59:15Z")

</div>

yes just do

func AdditionalBorders =  
MaterialBottom(50)  
+MaterialTop(50)  
+MaterialLeft(50)  
+MaterialRight(50);

because a func just put a name to an expression.

---

<div class="post-metadata">

**Author:** ![willrey](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/willrey/32/891_2.png) [@willrey](https://community.freefem.org/u/willrey)\
**Post date:** [February 9, 2022, 3:12pm UTC](https://community.freefem.org/t/building-a-mesh-in-two-steps/1481/3 "2022-02-09T15:12:28Z")

</div>

Perfect. Many thanks

---

<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 9, 2022, 4:31pm UTC](https://community.freefem.org/t/building-a-mesh-in-two-steps/1481/4 "2022-02-09T16:31:45Z")

</div>


