Modified version of the poly2tri library