Skip to content

Algorithms to decompose and triangulate concave non-overlapping polygons, based on Graham Scan and Ear Clipping.

License

Notifications You must be signed in to change notification settings

sprinlittleWater/graham-decomposition

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Graham Decomposition of Concave Polygons

This is a set of Python and C++ implementations of Polygon Decomposition and Triangulation algorithms. The name Graham is a reference to the Graham Scan, which inspired the decomposition algorithm, however I'm looking for suggestions.

This is an attempt to balance performance, implementation complexity and output quality for a convex polygon triangulation algorithm. I've developed it for a personal project where the skinny triangles created by traditional Ear Clipping were a huge problem, and performance must be moderately good.

Two algorithms are proposed:

  • Graham Decomposition: splits a concave polygon into convex sub-polygons
  • Average Ear Clipping: a O(n*log(n)) implementation of Ear-Clipping, limited to convex polygons, which tries to keep the triangle areas homogeneous.

For a detailed description check the concept folder.

python sandbox

For language-specific instructions, open the README file on the language folder.

DISCLAIMER I'm not qualified to provide formal definitions and proofs. Please feel welcome to submit fixes to everything written in here.

About

Algorithms to decompose and triangulate concave non-overlapping polygons, based on Graham Scan and Ear Clipping.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 97.8%
  • Python 2.1%
  • C++ 0.1%