I'm trying to make a level editor where users can create polygons to be placed in a Box2D world.
Because there are Bézier curves involved, there can be hundreds of vertices on a single polygon. love.physics.newPolygonShape is limited to 8 vertices, so I decided to use love.math.triangulate to triangulate the polygons and add each triangle as a fixture. This works so far, except for some cases where I fiddle around with the level editor and get this Box2D error:
Code: Select all
"Box2D assertion failed: area > b2_epsilon"
My second guess would be that some triangles computed using love.math.triangulate are too tiny for Box2D, and thus the need to use another triangulation algorithm maybe? I am afraid I will get the same result.
One could also lower the resolution of the Bézier curve so that the vertices are further away from each other, but I am looking for another solution.
Thanks in advance for your suggestions / help!