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.
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.
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.
Check this out: http://liam.flookes.com/cs/geo/
Basically:
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.
© 2022 - 2024 — McMap. All rights reserved.