Changed the overlap algorithm to use the plane sweep technique for
finding intersections and remove overlapping curves.