# Physics libraries, bodies inside bodies

**URL:** https://discourse.processing.org/t/physics-libraries-bodies-inside-bodies/24073
**Category:** Libraries
**Created:** [September 23, 2020, 7:52am UTC](https://discourse.processing.org/t/physics-libraries-bodies-inside-bodies/24073 "2020-09-23T07:52:58Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![opheliagame](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/opheliagame/32/8552_2.png) [@opheliagame](https://discourse.processing.org/u/opheliagame)
#### Post date: [September 23, 2020, 7:52am UTC](https://discourse.processing.org/t/physics-libraries-bodies-inside-bodies/24073/1 "2020-09-23T07:52:58Z")

</div>

I want to make a simulation that has bodies inside bodies. The only way I have been able to achieve this is by making blobby bodies by Daniel Shiffman and then making new bodies inside the blob. How could I try to make more rigid structures, such that other smaller bodies can be contained inside it? Should I be combining Constant volume joint with distance joints…?  
Or is there another library that I could try out  
Thanks 🙂

---

<div class="post-metadata">

### Author: ![solub](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/solub/32/333_2.png) [@solub](https://discourse.processing.org/u/solub)
#### Post date: [September 24, 2020, 1:22pm UTC](https://discourse.processing.org/t/physics-libraries-bodies-inside-bodies/24073/2 "2020-09-24T13:22:10Z")

</div>

Hi @opheliagame,

Would you mind being a little bit more specific ? Maybe providing a hand-drawing or a diagram of what you have in mind ?

Am I correct in understanding that you would like to have rigid bodies (as 2D polygons) whose shape is preserved when colliding with each other ? And having the possibility to create other rigid bodies inside of a larger one ?

My first guess would be to try with the Fisica library using the [FPoly()](http://www.ricardmarxer.com/fisica/reference/fisica/FPoly.html) class or with any other library that deals with rigid bodies (like Box2D). I can think of other workarounds but not sure it would work in your case.

---

<div class="post-metadata">

### Author: ![opheliagame](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/opheliagame/32/8552_2.png) [@opheliagame](https://discourse.processing.org/u/opheliagame)
#### Post date: [September 25, 2020, 11:40am UTC](https://discourse.processing.org/t/physics-libraries-bodies-inside-bodies/24073/3 "2020-09-25T11:40:57Z")

</div>

Hi @solub Thank you for replying 🙂  
Yes exactly, I do want rigid bodies inside other rigid bodies. This term did not strike me while posting the question.  
I did think about creating shapes that have a hole, but I am not sure of how to go about this with respect to the vertices. I did now know about the Fisica library before, so will definitely check that out!

The simulation I have in mind is pretty simple in concept, I just want some smaller bodies inside a bigger body. And as a second step, packing the bigger body’s inner volume with the smaller bodies.
