implemented mesh triangulation