 
 # Here's a quick hack for switching traces on and off.
 
-trace = (s) -> #console.log s
+trace = (s) -> #console.log s()
 
 
 # ----

    # in which `t` is divided into three new triangles with `p` as a common
    # vertex.
    subdivide = (T, t, p) ->
      trace "subdivide [#{T.triangulation__.toSeq().join ', '}], #{t}, #{p}"
      [a, b, c] = t.vertices()
      new T.constructor(
        T.triangulation__.minus(a,b,c).plus(a,b,p).plus(b,c,p).plus(c,a,p),

    # edge `ab` lies in triangles `abc` and `bad`, then after the flip those
    # are replaced by new triangle `bcd` and `adc`.
    flip = (T, a, b) ->
      trace -> "flip [#{T.triangulation__.toSeq().join ', '}], #{a}, #{b}"
      c = T.third a, b
      d = T.third b, a
      children = seq [tri(b, c, d), tri(a, d, c)]
