# "compas.geometry.Polygon" and "Plotter.draw\_polygons"

**URL:** <https://forum.compas-framework.org/t/compas-geometry-polygon-and-plotter-draw-polygons/46>\
**Category:** compas\
**Created:** [February 9, 2018, 1:37pm UTC](https://forum.compas-framework.org/t/compas-geometry-polygon-and-plotter-draw-polygons/46 "2018-02-09T13:37:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![SalMo](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@SalMo](https://forum.compas-framework.org/u/SalMo)\
**Post date:** [February 9, 2018, 1:37pm UTC](https://forum.compas-framework.org/t/compas-geometry-polygon-and-plotter-draw-polygons/46/1 "2018-02-09T13:37:38Z")

</div>

When using Polygon from compas.geometry, how should the points be sorted in the input?

I also have problems inputting my polygon points in “Plotter.draw\_polygons”, the instructions are not clear. Could you please provide an example?

---

<div class="post-metadata">

**Author:** ![tomvanmele](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.compas-framework.org/tomvanmele/32/13_2.png) [@tomvanmele](https://forum.compas-framework.org/u/tomvanmele)\
**Post date:** [February 9, 2018, 7:30pm UTC](https://forum.compas-framework.org/t/compas-geometry-polygon-and-plotter-draw-polygons/46/2 "2018-02-09T19:30:03Z")

</div>

hi,

the polygon points should be provided to the constructor in the order as they appear in the polygon. the following is a square in the first quadrant of the coordinate system, formed in counter-clockwise direction.

```python
polygon = Polygon([[0, 0, 0], [1, 0, 0], [1, 1, 0], [0, 1, 0]])

```

as per the [docs](https://compas-dev.github.io/main/reference/generated/generated/compas.plotters.Plotter.draw_polygons.html), the `draw_polygons` method takes one positional argument, which is a `list of dict`. each `dict` should at least contain the coordinates of the points of the polygon

```python
plotter = Plotter()
plotter.draw_polygons([{'points': polygon.points}])
plotter.show()

```

however, i had never used the polygons directly with the plotters. when i tried the code above i got the error described in issue #41. this is now solved with the corresponding hotfix…

hope this helps.

best,  
tom

---

<div class="post-metadata">

**Author:** ![SalMo](https://avatars.discourse-cdn.com/v4/letter/s/a5b964/32.png) [@SalMo](https://forum.compas-framework.org/u/SalMo)\
**Post date:** [February 11, 2018, 5:15pm UTC](https://forum.compas-framework.org/t/compas-geometry-polygon-and-plotter-draw-polygons/46/3 "2018-02-11T17:15:17Z")

</div>

Thanks for the correction. I had the input the same way, but kept getting errors.
