# Help me put static complex shapes in box2d

**URL:** <https://discourse.processing.org/t/help-me-put-static-complex-shapes-in-box2d/21736>\
**Category:** Libraries\
**Created:** [June 10, 2020, 1:40pm UTC](https://discourse.processing.org/t/help-me-put-static-complex-shapes-in-box2d/21736 "2020-06-10T13:40:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yhlaskerimov](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/yhlaskerimov/32/9725_2.png) [@yhlaskerimov](https://discourse.processing.org/u/yhlaskerimov)\
**Post date:** [June 10, 2020, 1:40pm UTC](https://discourse.processing.org/t/help-me-put-static-complex-shapes-in-box2d/21736/1 "2020-06-10T13:40:56Z")

</div>

Hello everyone, help me please…  
I think everyone knows box2d library written by Shiffman.  
In his examples he adds boundaries only rectangle shape.I want to add a half circle to the edges of that rectangle. (From left and right). And I want to rotate them 45 degrees…Please help me doing this.

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [June 11, 2020, 5:15pm UTC](https://discourse.processing.org/t/help-me-put-static-complex-shapes-in-box2d/21736/2 "2020-06-11T17:15:26Z")

</div>

> [@yhlaskerimov](#):
>
> I want to add a half circle to the edges of that rectangle. (From left and right). And I want to rotate them 45 degrees

It sounds like you want to create a D-shaped boundary, is that right?

[![](https://img.youtube.com/vi/oBcv_P_YDrw/hqdefault.jpg "5.6: Static Bodies and Chain Shapes in Box2D - The Nature of Code") ](https://www.youtube.com/watch?v=oBcv_P_YDrw)

You can make a curve out of many small edges, for example using chain shapes:

> <https://stackoverflow.com/questions/20866626/which-object-is-better-for-creating-a-curve-using-b2edgeshape-vs-b2chainshape>

So, complex shapes that are curves are actually polygons with many, many small sides. All the normal rules of complex polygons apply.

[![](https://img.youtube.com/vi/V95dzuDw0Jg/maxresdefault.jpg "5.7: Complex Shapes in Box2D - The Nature of Code") ](https://www.youtube.com/watch?v=V95dzuDw0Jg)

Keep in mind that you can draw something different from what Box2D is modeling. So if you want to model the shape and track its location physics with box2D, but draw it using a curve or a bezier curve, you can – you can draw on top of it, or draw to a separate canvas, etc.
