JSPoly is a Javascript translation of the Boost Polygon Library originally written in C++. It can be used to generate the vornoi diagram and medial axis transform of a polygon with holes.
License : Boost Software License - Version 1.0
boundary = [{x: 1, y: 1}, {x: 2, y: 2}, {x: 3, y: 2}, {x: 4, y: 1}];
segments = JSPoly.construct_medial_axis(boundary, []);
for above example, resultant segments contains following
[{"point0":{"x":3,"y":2,"radius":0},"point1":{"x":2.7928932188134525,"y":1.5,"radius":0.4999999999999998}},{"point0":{"x":1,"y":1,"radius":0},"point1":{"x":2.2071067811865475,"y":1.5,"radius":0.49999999999999994}},{"point0":{"x":2,"y":2,"radius":0},"point1":{"x":2.2071067811865475,"y":1.5,"radius":0.5}},{"point0":{"x":2.2071067811865475,"y":1.5,"radius":0.5},"point1":{"x":2.7928932188134525,"y":1.5,"radius":0.5}},{"point0":{"x":2.7928932188134525,"y":1.5,"radius":0.4999999999999998},"point1":{"x":4,"y":1,"radius":0}}]

