Back to class index
| Polyhedron::IsConvexSyntaxbool Polyhedron::IsConvex() const; [26 lines of code]Returns true if this polyhedron is convex. The running time is O(F*V) ~ O(V^2). See AlsoWork in progress:Todo: in bool Polyhedron::IsConvex() const: Real-Time Collision Detection, p. 64: A faster O(n) approach is to compute for each face F of P the centroid C of F, and for all neighboring faces G of F test if C lies behind the supporting plane of G. If some C fails to lie behind the supporting plane of one or more neighboring faces, P is concave, and is otherwise assumed convex. However, note that just as the corresponding polygonal convexity test may fail for a pentagram this test may fail for, for example, a pentagram extruded out of its plane and capped at the ends. |