A polytope is convex if and only if any line containing an edge of the polytope does not contain any interior points. Thus a concave polytope is any polytope that is not convex. Clipping a convex polytope to a particular clipping region is in fact quite easy. The process simply involves traversing the edge of the polytope and marking every point at which the polytope leaves and enters the clipping region. Then all points external to the clipping region are deleted, and all marked points are connected, following the edges of the clipping region.
Problems arise when the polytope is concave.
Since concave polytopes are more common in practice, by nature of their unrestricted definition, a generic algorithm needs to be developed that given a rectangular clipping region and an arbitrary polytope will produce a new polytope, adequately representing the original, but limited to the clipping region. The algorithm extends the edges of the clipping region to infinity, and then clips the input polytope to each edge in succession. The result is a properly clipped polytope, but the algorithm is not without its faults, as will be discussed later. In addition let B be the set of boundaries of the clipping region, R be the region prescribed by B , and let L a,b be the line segment formed by joining V a and V b . The remaining conditionals deal with the case that L i,i-1 intersects the clipping region.