     @debug.reference = reference
     @debug.incident = incident
 
-    console.log "reference: #{reference.vertex} #{reference.from} -> #{reference.to} (vec #{reference.vec})"
-    console.log "incident: #{incident.vertex} #{incident.from} -> #{incident.to} (vec #{incident.vec})"
+    console.log "reference: #{reference.deepest} #{reference.from} -> #{reference.to} (vec #{reference.vec})"
+    console.log "incident: #{incident.deepest} #{incident.from} -> #{incident.to} (vec #{incident.vec})"
     console.log "flipped", flipped
 
     reference.normalize()


    points

  # Calculate the best edge (closest perpendicular edge given a separation axis)
  bestEdge: (minAxis) ->
    points = @points()

    # Find farthest vertex in the polygon along separation axis
    closestIndex = null
    maxProjection = -Infinity
    for vertex, i in points
      projection = Vec.dotProduct minAxis, vertex
      if projection > maxProjection
        maxProjection = projection
        closestIndex = i

    # Find edge which is most perpendicular to separation axis
    closest    = points[closestIndex]
    prevVertex = points[ (closestIndex - 1 + points.length) % points.length ]
    nextVertex = points[ (closestIndex + 1 + points.length) % points.length ]

    left = Vec.sub closest, prevVertex
    right = Vec.sub closest, nextVertex
    if Vec.dotProduct(right, minAxis) <= Vec.dotProduct(left, minAxis)
      new Edge closest, closest, nextVertex # right edge is better
    else
      new Edge closest, prevVertex, closest # left edge is better

  # Use Separating Axis Theorem to find minimum separation axis
  # from http://www.codezealot.org/archives/55 &c.

    refNorm = Vec.invert refNorm if flipped

    # get the largest depth
    max = Vec.dotProduct refNorm, reference.deepest

    trimmed = []
    # make sure the final points are not past this maximum
    unless Vec.dotProduct(refNorm, clipped[0]) - max < 0
      trimmed.push clipped[0]
    unless Vec.dotProduct(refNorm, clipped[1]) - max < 0
      trimmed.push clipped[1]

    console.log "trimmed", trimmed[0], trimmed[1]
    @debug.trimmed = trimmed
