// Analytically subdivide a face to the required detail level.

        void subdivide(Face3 face, int detail)
        {
            float cols = Mathf.Pow(2.0f, (float)detail);
            //float cells = Mathf.Pow (4.0f, (float)detail);
            THREEVector3 a = prepare(this.t_vertices [face.a]);
            THREEVector3 b = prepare(this.t_vertices [face.b]);
            THREEVector3 c = prepare(this.t_vertices [face.c]);

            List <List <THREEVector3> > v = new List <List <THREEVector3> > ();

            // Construct all of the vertices for this subdivision.

            for (int i = 0; i <= cols; i++)
            {
                //v[ i ] = new List<THREEVector3>();
                List <THREEVector3> vList = new List <THREEVector3> ();
                v.Add(vList);
                //v.Add (new List<THREEVector3>() );

                THREEVector3 aj   = prepare(a.clone().lerp(c, (float)i / cols));
                THREEVector3 bj   = prepare(b.clone().lerp(c, (float)i / cols));
                int          rows = (int)(cols - i);

                for (int j = 0; j <= rows; j++)
                {
                    THREEVector3 vv;
                    if (j == 0 && i == cols)
                    {
                        //v[ i ][ j ] = aj;
                        vv = aj;
                    }
                    else
                    {
                        //v[ i ][ j ] = prepare( aj.clone().lerp( bj, j / rows ) );
                        vv = prepare(aj.clone().lerp(bj, (float)j / rows));
                    }
                    vList.Add(vv);
                }
            }

            // Construct all of the faces.

            for (int i = 0; i < cols; i++)
            {
                for (int j = 0; j < 2 * (cols - i) - 1; j++)
                {
                    int k = Mathf.FloorToInt((float)j / 2.0f);

                    if (j % 2 == 0)
                    {
                        make(
                            v [i] [k + 1],
                            v [i + 1] [k],
                            v [i] [k]
                            );
                    }
                    else
                    {
                        make(
                            v [i] [k + 1],
                            v [i + 1] [k + 1],
                            v [i + 1] [k]
                            );
                    }
                }
            }
        }