Keeping objects binded with each other

Hi all this is probably a ofxBox2d related question.
I have drawing that also has illegal concave sides (see section 5.10 in http://natureofcode.com/book/chapter-5-physics-libraries/ , look for “Convex shapes only”).
I would like to brake it down (triangulate it), so that it will only be made up of legal (convex) triangles that can be used in physics box2d world, but at the same time I want these trianges to be firmly connected to each other so that the drawing (ie body) will keep its shape.

Is this possible ? is ofxBox2d the way forward here?

thank you for your help

you need to use a triangulation library. ofxBox2d actually comes with one, there’s also something similar here:

which might be related to this:

https://code.google.com/p/ofx-kikko/

I have made something similar to ofxTriangle, which uses some flags in triangle library (http://www.cs.cmu.edu/~quake/triangle.html) to add points if you need a more dense mesh:

ps: please look at the complex polygon example in ofxBox2d, which does break a complex shape down into triangles:

https://github.com/vanderlin/ofxBox2d/blob/master/example-ComplexPolygon/src/testApp.cpp

maybe this is helpful?

(as a side note, box2d lets you make shapes out of multiple triangles, which is what this shows… it binds them together…)

Dear @zach,
I have been going through this answer of yours from the past. I encountered a similar problem as @synthnassizer is reporting. I have made significant progress with it but my simple example is not working quite as expected. The triangles are being pushed apart by the falling circles.
I have been trying to solve this for quite some time as I want to make solid objects where an box2D object can’t pass through.
I posted a bit more detail and very short sample code here:

If you have time could you give me a hint on what I am doing wrong?

Thanks,
marinero