/traversal-splitter

Haxe/AS3/PHP/JS: Orthogonal Polygon Partitioning

Primary LanguageActionScript

TraversalSplitter

This is a haxe implementation of an algorithm that partitions orthogonal polygons into several small rectangular areas. A more detailed description about the algorithm can be found on my blog.

AlgorithmRundown

  1. traverse the polygon clockwise and find vertices with counterclockwise rotation
  2. split the graph from those vertices to any direction
  3. pick a vertex and traverse the adjusted graph clockwise to build your rectangle

runtime:

  • multiple platform targets supported
  • simple input / output interface

development-time:

  • confusing line intersection algorithm
  • monster class