Polygon Polygon Clipping

From CGAFaq

Jump to: navigation, search

Klamer Schutte, klamer@ph.tn.tudelft.nl has developed and implemented some code in C++ to perform clipping of two possibly concave 2D polygons. A description can be found at:

http://clippoly.sourceforge.net

To compile the source code you will need a C++ compiler with templates, such as g++. The source code is available at:

http://sourceforge.net/project/showfiles.php?group_id=132364

See also http://members.xoom.com/msleonov/pbcomp.html, which extends the above to permit holes.

Alan Murta released a polygon clipper library (in C) which uses a modified version of the Vatti algorithm:

http://www.cs.man.ac.uk/aig/staff/alan/software/index.html

Angus Johnson has released a freeware polygon clipping library written in Delphi (Pascal) and also in C++ which is based on the Vatti algorithm:

http://sourceforge.net/projects/polyclipping/

References

  • Weiler, K. "Polygon Comparison Using a Graph Representation", SIGGRAPH '80, pg. 10-18
  • Vatti, Bala R. "A Generic Solution to Polygon Clipping", Communications of the ACM, July 1992, Vol 35, No. 7, pg. 57-63
Personal tools