by azrafe7

azrafe7 /hxGeomAlgo

Small collection of computational geometry algorithms in Haxe 3.3+.

132 Stars 11 Forks Last release: Not found Other 189 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


Small collection of computational geometry algorithms in Haxe 3.3.

swf demo | js demo

Marching Squares (Contour Tracing)

Based on:

  • http://devblog.phillipspiess.com/2010/02/23/better-know-an-algorithm-1-marching-squares/ (C# - by Phil Spiess)
  • http://www.tomgibara.com/computer-vision/marching-squares (Java - by Tom Gibara)

Ramer-Douglas-Peucker (Polyline Simplification)

Based on:

  • http://karthaus.nl/rdp/ (JS - by Marius Karthaus)
  • http://stackoverflow.com/questions/849211/shortest-distance-between-a-point-and-a-line-segment (JS - by Grumdrig)

Ear Clipping (Triangulation and Poly Decomposition w/ Hole Support)

Based on:

  • https://github.com/mapbox/earcut (JS - by Vladimir Agafonkin)
  • http://www.ewjordan.com/earClip/ (Java - by Eric Jordan)

Bayazit (Poly Decomposition)

Based on:

  • http://mnbayazit.com/406/bayazit (C - by Mark Bayazit)
  • http://www.dyn4j.org/ (Java - by William Bittle)

Visibility Polygon and Homogeneous Coords (2D)

Based on:

  • http://www.cs.ubc.ca/~snoeyink/demos/convdecomp/VPDemo.html (Java - by Jack Snoeyink)

Snoeyink-Keil (Minimum Convex Decomposition)

Based on:

Connected Components Labeling and Contour Tracing (w/ Hole Support)

Based on:

Visvalingam-Whyatt (Polyline Simplification)

Based on:

Tess2 (Tesselation to Triangles and Convex Polygons, Poly Boolean Ops)

Based on:

  • GLU Libtess (by Eric Veach, July 1994)
  • tess2.js (JS - by Mikko Mononen, Aug 2013)

IsoContours (Contour Tracing)

Based on:

  • http://en.wikipedia.org/wiki/Marching_squares
  • https://github.com/deltaluca/nape (Haxe - by Luca Deltodesco)
  • https://github.com/scikit-image/scikit-image (Python - by scikit-image team)

Hertel-Mehlhorn (Convex Polygons from Arbitrary Triangulation)

Based on:

  • https://github.com/ivanfratric/polypartition (CPP - by Ivan Fratric)
  • http://www.philvaz.com/compgeom (by Phil Porvaznik)


The only dependency is hxPixels, and only for the algorithms needing access to pixels.


Code is extensively doc-commented, and I tried my best to make it easy/intuitive to use. You can also take a look at the demo for a quick overview on how to use the different classes.


hxGeomAlgo is based on the work of many developers and it wouldn't exist if it weren't for them. See the CREDITS file for details.


hxGeomAlgo is developed by Giuseppe Di Mauro (azrafe7) and released under the MIT license (except for

, which is licensed under SGI B 2.0). See the LICENSE file for details.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.