IV.3

A FAST CIRCLE CLIPPING ALGORITHM

Raman V. Srinivasan,     SDRC, Milford, Ohio

Publisher Summary

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 ...

Get Graphics Gems III (IBM Version) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.