added ply2Triangles, buildPlyFiles functions