Best way to create 2D concave shapes?

Poita_
Posts: 9
Joined: Sun Oct 04, 2009 10:00 am

Best way to create 2D concave shapes?

Post by Poita_ »

What is the best way to construct 2D non-convex shapes? In particular, I want to make a cog, which is essential a circle with many "teeth" around the edge.

I know that I can make it as a compound shape, with each of the teeth as separate convex shapes, but is there any way I can specify at simply a list of points on the edge of the concave polygon, or any other way for that matter?

Thanks in advance.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Best way to create 2D concave shapes?

Post by Erwin Coumans »

It is the best to use a btCompoundShape in combination with a btConvex2DShape (if you really want to simulate in 2D). See the Bullet/Demos/Box2dDemo for further info.

Moving concave triangle meshes are not supported well, in particular in 2D. (for static / non-moving world environment you can use btBvhTriangleMeshShape).

Thanks,
Erwin
Poita_
Posts: 9
Joined: Sun Oct 04, 2009 10:00 am

Re: Best way to create 2D concave shapes?

Post by Poita_ »

Thanks.