A mock Bentley-Ottmann for training: http://nraynaud.github.io/polygonsJS/index.html
Beginning of a Medial Axis Transform for simple polygons here: http://nraynaud.github.io/polygonsJS/test_medial_axis.html
There are still 2 O(n^2) parts: point in polygon test and closest distance test filter, both to be solved with a KD tree