The following is a rough overview of how to edit the vertices of a mesh, but for more details this link might help you.
List<Vector3> vertices = new List<Vector3>();
List<int> triangles = new List<int>();
GenerateMesh(vertices, triangles);
Mesh mesh = gameObject.GetComponent<MeshFilter>().mesh;
mesh.vertices = vertices.ToArray();
mesh.triangles = triangles.ToArray();
In terms of actually generating your mesh, I would suggest generating N points in a circle on a plane, this is your start point. Then repeatedly move the plane forward slightly, rotate it, and generate more points. Each time connect the points to the previous set of points generated to make your triangles.