Search code examples
c#convexpolyhedra

How do I determine if a polyhedron is convex?


I'm looking for an efficient algorithm that determines if a polyhedron is convex.

I started by checking that the Euler characteristic is 2. And I'm also checking that every face is convex. But that still doesn't catch a lot of cases.


Solution

  • I had another idea: For each face check that all the other vertices lie on the same side of that face.

    You can check this by calculating the normal vector for each face (by cross-product) and then computing the dot-product for each vector from one vertex (of the face) to all the others. The signs must be the same.

    The algorithms should both work, but the may differ in compute time.