Xref: utzoo comp.graphics:1977 comp.sys.ibm.pc:13143 Path: utzoo!mnetor!uunet!mcvax!unido!ecrcvax!johng From: johng@ecrcvax.UUCP (John Gregor) Newsgroups: comp.graphics,comp.sys.ibm.pc Subject: Re: COMPLICATED PROBLEM; ONLY INTELLIGENT PEOPLE SHOULD READ Message-ID: <513@ecrcvax.UUCP> Date: 14 Mar 88 02:31:10 GMT References: <5740@cit-vax.Caltech.Edu> Reply-To: johng@ecrcvax.UUCP (John Gregor) Organization: ECRC, Munich 81, West Germany Lines: 29 In article <5740@cit-vax.Caltech.Edu> gtchen@tybalt.caltech.edu.UUCP (George T. Chen) writes: >Does any of the previously mentioned algorithm work with overlapping >polygons? For example, consider the grid > > [ Grid deleted ] > >Most algorithms (including the odd-even boundary method) will consider >the diamond region between 2 and 5 to be outside the polygon although >it's suppose to be inside. > >Comments? The non-zero winding number rule will completely fill the polygon. Like the even-odd rule, to determine if a point is "inside" take a ray from that point to infinity. For each ray-edge intersection increment the intersection count if the edge passes from left to right, and subtract one if the edge passes from right to left. If the count is 0, then the point is "outside" the polygon. See Adobe's Red Book (Postscript Reference Manual) for a couble of sample pictures. -- pqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpqpq bdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbdbd John Gregor johng%ecrcvax.UUCP@germany.CSNET