Added class for 2d map. Translate and interpolate for points. Calculating intersection of polygon using intersection map. Bounding box for polygon. Checking if point is contained in polygon. Sorting polygon points (WIP).
Converted cartesian coordinates into screen coordinates for rendering in fabric.js. Drew origin and centroid of polygon. Centroid for polygon. Various different attempts to sort a set of points for a concave polygon. arctan method didn't work, so I used a simpler approach.
Added grunt file for copying library files, karma test framework with requirejs config. Filtered out quads which had centroids outside the polygon, but this caused issues so testing is needed.
Added polygon spec and checked centroid, sorting points, edges and contained points. Implemented my own method for checking if a point is contained from wiki spec.
Added more tests for checking if a point is contained within a polygon, including for a concave one.
Fixed an edge case causing a point with the same y value as two edges sharing a common point to be considered outside the polygon.
Fixed a bug causing the wrong edges to be considered the "added" and "existing" for a quad due to automatic sorting of the points on construction.
Added support for exclusive contains() which are needed for the heuristic used for subtracting polygons. Wrote tests on a square subtraction and a square exclusive contains().
Refactored comparisons in polygon tests for contained points and edges. Added tests for subtraction. Cleanup.
Implemented iterative method for finding all optimal quads in a polygon. Found a bug where difference of a concave polygon with itself didn't remove all points. Cleanup and docs.
Fixed a bug causing points on gradient edges to be included even if inclusive mode was off in Polygon#contains(). Wrote tests to verify this fixed issues with difference().
Implemented subdivision of optimal quads using a grid method. Executing on the demo works. Added a method for drawing lines with fabricjs in the demo.
Refactored demo code to rotate through a set of polygons and perform the subdivision algorithm. Choose better colours.
Improved splitting to use longer side if needed.
Used luminance of fill colour to show which quads have higher scores. Added more demo examples and found more bugs. Added method for creating a polygon from an array of points. Stopped if no more optimal quads were found.
Fixed issue with quads that are triangles being selected instead of quads with lower scores.
Enabled all samples and changed min/max edge length constraints.
Added readme info.