Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!uwvax!oddjob!hao!noao!arizona!naucse!sbw From: sbw@naucse.UUCP Newsgroups: comp.graphics Subject: Modified Liang-Barsky Polygon Clipping Message-ID: <258@naucse.UUCP> Date: Wed, 11-Mar-87 13:16:41 EST Article-I.D.: naucse.258 Posted: Wed Mar 11 13:16:41 1987 Date-Received: Fri, 13-Mar-87 21:13:03 EST Organization: Northern Arizona University, Flagstaff, Arizona Lines: 23 Keywords: Polygon Clipping I recently posted a query and a summary of responses concerning the Liang-Barsky Polygon clipping algorithm as published in CACM, VOL 26, Nov. 1983. The corrigenda in CACM, VOL 27, April 1984 provided the fix to the original algorithm. It also led me to examine my 'patched' version more closely. I now have a modified version of the algorithm that, while based upon my patch, appears (see below) to produce results identical to the corrected Liang-Barsky algorithm. The modified version is both slightly simpler and slightly faster (it averages about 6% faster over my test data) than the original. Is anyone interested in this modified algorithm (in C)? If so, then I'll post the source to the net (about 150 lines - should it go to net.sources?). I have only done limited testing of the code, using 10 randomly generated polygons (well 7 random and 3 'worst' case) with from 4 to 200 vertices (counting first vertex twice). In all cases the output is exactly the same as the corrected Liang-Barsky algorithm. Anyone who wants to really test it out is welcome to. Please mail me if it has problems.