non working version of triangulatePolygon2