December 2012
Intermediate to advanced
631 pages
13h 10m
English
Raman V. Srinivasan, SDRC, Milford, Ohio
This chapter focuses on a fast circle-clipping algorithm. Clipping a circle to a rectangular region potentially results in four circular arc segments. If there is one or more clipped segments (n > 0), the visible segments are extracted by culling out the clipped portions. Because it is possible that two clipped portions may overlap, an overlap index is maintained. That index is incremented on encountering a crossing type of START and decremented on a crossing type of END. A value of zero for the overlap index denotes that a visible segment of the circle has been entered and must be added to the list of visible segments. The pseudocode that ...
Read now
Unlock full access