Thin triangles

Hello,

I'm using the latest version of Box2D from google repository. Indeed the polygons (triangles in my case) can be much thinner now.
But still there are some cases where trying to add a very small triangle to a body will cause an assertion failure in b2Body::ResetMassData()
(more specifically in line 312: b2Assert(m_I > 0.0f);).

In the previous version (stable release), I used to avoid assertion errors for very thin triangles by copying the corresponding
piece of code from inside the Box2D source and placing it into some function which would return true or false (depending on whether the triangle
would cause and error or not).

I think it would be nice if such methods existed in the API. (For example b2Body::canCreateFixture(b2FixtureDef* pFixtureDef)).

Thanks,
Dimitris
j/c where are these triangles coming from? code? xml made my you? automated parser of svg?
pTymN: The triangles are coming out from a delaunay triangulation method.
Try this method: viewtopic.php?f=3&t=4395

The page that I link to there has the C++ source (if you aren't using AS3). Bayazit's concave polygon decomposition method is very fast and produces polygons (not just triangles), so it produces very optimized Box2D polygons. Break down polygons with more than 8 verts into multiple polygons (easily done for the produced convex polygons from the algorithm).

Original thread: https://box2d.org/forum/viewtopic.php?t=4445