# MeshBuilder.CreatePolygon Polygon with holes error. The two holes were not generated correctly。

**URL:** <https://forum.babylonjs.com/t/meshbuilder-createpolygon-polygon-with-holes-error-the-two-holes-were-not-generated-correctly/17130>\
**Category:** Questions\
**Tags:** tutorial\
**Created:** [January 4, 2021, 6:38am UTC](https://forum.babylonjs.com/t/meshbuilder-createpolygon-polygon-with-holes-error-the-two-holes-were-not-generated-correctly/17130 "2021-01-04T06:38:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zhang](https://avatars.discourse-cdn.com/v4/letter/z/aeb1de/32.png) [@zhang](https://forum.babylonjs.com/u/zhang)\
**Post date:** [January 4, 2021, 6:38am UTC](https://forum.babylonjs.com/t/meshbuilder-createpolygon-polygon-with-holes-error-the-two-holes-were-not-generated-correctly/17130/1 "2021-01-04T06:38:26Z")

</div>

> **[Babylon.js Playground](https://playground.babylonjs.com/#ZD60FU%236)**

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [January 4, 2021, 12:46pm UTC](https://forum.babylonjs.com/t/meshbuilder-createpolygon-polygon-with-holes-error-the-two-holes-were-not-generated-correctly/17130/2 "2021-01-04T12:46:10Z")

</div>

Adding @Evgeni_Popov who already played a bit with this kind of code and might have an idea 🙂

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [January 4, 2021, 1:42pm UTC](https://forum.babylonjs.com/t/meshbuilder-createpolygon-polygon-with-holes-error-the-two-holes-were-not-generated-correctly/17130/3 "2021-01-04T13:42:10Z")

</div>

You have an edge which is shared by the two holes, so you should create a single hole and not two.

If you still want two holes, you should make sure the vertices of this common edge are not exactly the same ones:

> **[Babylon.js Playground](https://playground.babylonjs.com/#ZD60FU%237)**

But that is a hack, you should definitely create a single hole.
