# Create a face entity with outer and inner loops

**URL:** <https://forums.sketchup.com/t/create-a-face-entity-with-outer-and-inner-loops/99472>\
**Category:** Ruby API\
**Created:** [July 23, 2019, 1:36pm UTC](https://forums.sketchup.com/t/create-a-face-entity-with-outer-and-inner-loops/99472 "2019-07-23T13:36:30Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Guy](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/guy/32/88_2.png) [@Guy](https://forums.sketchup.com/u/Guy)\
**Post date:** [July 26, 2019, 2:21pm UTC](https://forums.sketchup.com/t/create-a-face-entity-with-outer-and-inner-loops/99472/9 "2019-07-26T14:21:30Z")

</div>

You need to close the polygon with creating a reversed connection line.  
The inner loop should be reversed with the outer loop

```
pm = Geom::PolygonMesh.new
pm.add_point([0, 0, 0]) # 1
pm.add_point([10, 0, 0]) # 2
pm.add_point([10, -10, 0]) # 3
pm.add_point([0, -10, 0]) # 4
pm.add_point([3, -3, 0]) # 5
pm.add_point([6, -3, 0]) # 6
pm.add_point([6, -6, 0]) # 7
pm.add_point([3, -6, 0]) # 8
pm.add_polygon(1, 2, 3, 4, 1, 5, 8, 7, 6, 5, 1)
Sketchup.active_model.entities.fill_from_mesh(pm)

```

 ![image](https://global.discourse-cdn.com/sketchup/original/3X/d/f/df366993b531ebcae881749b657e7e5258017915.png)

---

_[View the full topic](https://forums.sketchup.com/t/create-a-face-entity-with-outer-and-inner-loops/99472)._
