1. The soultion to the cie diagram problem: cie.cpp.
3.

To avoid this problem, we need to keep track of polygon fragments. An algorithm that does this is the Weiler-Atherton clipper, which switches between following the polygon and following the clipping window at each intersection.