I am looking for algorithm to merge lots of relatively small 2d polygons to one or some big polygons. In case two small polygons are touching or overlapping, they should be merged to one polygon.
My big goal is to sufficiently decrease amount of points/lines required to describe collider. Resulting collider can include some polygons, btw.
Could you propose an algorithm or library to do this? (Finally I will implement solution in C# for Unity3d).
P.S. Here is one picture of task I need to solve. Look this http://epsiloncool.ru/i/E20160624-224050.png Green lines is a colliders. I need to merge them all to get one collider (or some)