       new T.constructor(
         T.triangulation__.minus(a,b,c).minus(b,a,d).plus(b,c,d).plus(a,d,c),
         T.position__,
+        T.nextIndex__,
         T.sites__,
         T.children__.plus([T.find(a,b,c), children], [T.find(b,a,d), children])
       )


    # The method `position` returns the coordinates corresponding to a given
    # vertex number as a `Point2d` instance.
    position: (n) -> @position__[n]

    # The method `sideOf` determines which side of the oriented line given by
    # the sites with indices `a` and `b` the point `p` (a `Point2d` instance)

    subdivide = (T, t, p) ->
      trace "subdivide [#{T.triangulation__.toSeq()}], #{t}, #{p}"
      [a, b, c] = t.vertices()
      n = T.nextIndex__
      new T.constructor(
        T.triangulation__.minus(a,b,c).plus(a,b,n).plus(b,c,n).plus(c,a,n),
        T.position__.plus([n, p]),
        n + 1,
        T.sites__.plus(p),
        T.children__.plus([T.find(a,b,c),
                           seq tri(a,b,n), tri(b,c,n), tri(c,a,n)])
