home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!vnet.ibm.com
- From: capelli@vnet.ibm.com (Ron Capelli)
- Message-ID: <19921215.155422.690@almaden.ibm.com>
- Date: Tue, 15 Dec 92 17:49:24 EST
- Newsgroups: comp.graphics
- Subject: Re: Clipping polygon to rectangle
- Disclaimer: This posting represents the poster's views, not those of IBM
- News-Software: UReply 3.0
- References: <724442088.9285@minster.york.ac.uk>
- Lines: 39
-
- In <724442088.9285@minster.york.ac.uk> john@minster.york.ac.uk writes:
- >I have read the subsections of ``Computer graphics: principles
- >and practice'' [Foley90], which describe algorithms for clipping a
- >polygon to a rectangle. None of the algorithms there meet my desire
- >for correctness with simplicity and practicality. (I do not require
- >completeness, as I am prepared to accept the output of a single degenerate
- >polygon instead of a list of disjoint polygons.) I've not found
- >anything better in older graphics textbooks, or in a brief literature
- >search. (Ok, so I'm crying for the moon - but someone out there
- >probably has a method of reaching it. :-))
- >
- >The Sutherland-Hodgman algorithm (described in [Foley90] and older
- >graphics texts I have read) clips against each side of the
- >rectangle in turn, and produces three intermediate polygons - which
- >I assume require a (single, extra) temporary buffer to hold them.
- >This I do not like.
-
- No intermediate polygons need be saved between stages of a
- Sutherland-Hodgman polygon clipper.
-
- The clipped edges output for each side of the clipping region
- (eg., rectangle) are in the order they need to be considered
- for the next side. Therefore, the stages can be cascaded in a
- recursive-like way. The output of each stage except the last
- can be implemented as a call to the subsequent stage, and the
- last stage outputs the edges of the clipped polygon, possibly
- with degenerate edges along the sides of the clipping region.
-
- The title of the original paper by Sutherland and Hodgman,
- "Reentrant Polygon Clipping", CACM, vol 17, no 1, Jan 1974,
- refers to this cascading of clipping stages.
- _______________________________________________________________________
-
- ...Ron Capelli IBM Corp. Dept. C13, Bldg. 703-2
- capelli@vnet.ibm.com PO Box 950
- (914) 435-1673 Poughkeepsie, NY 12602
- _______________________________________________________________________
-
- "There are no answers, only cross-references."
-