as3GeomAlgoÂ is aÂ small collection of geometry algorithms. It contains the implementation of several methods able toÂ createÂ a geometric representation of an image, e.g. fill an image with triangles. This library is useful to be used in aÂ GPU powered workflow.
Among the implemented methods, the library hasÂ Marching Squares,Â Ramer-Douglas-Peucker,Â Ear ClippingÂ andÂ Bayazit PolyDecomp. The library is a port of the hxGeomAlgo, the Haxe versionÂ which isÂ based on implementations in several different languages.
var originalBMD :BitmapData = Bitmap(new ASSET()).bitmapData; var clipRect:Rectangle = originalBMD.rect; var marchingSquares :MarchingSquares = new MarchingSquares(originalBMD, 1, clipRect); var perimeter :Vector = marchingSquares.march(); addChild(getTextField("MarchSqrs\n" + perimeter.length + " pts", x, y));