def stroke_curvature(it):
    """
    Compute the 2D curvature at the stroke vertex pointed by the iterator 'it'.
    K = 1 / R
    where R is the radius of the circle going through the current vertex and its neighbors
    """
    for _ in it:
        if it.is_begin or it.is_end:
            yield 0.0
            continue
        else:
            it.decrement()
            prev, current, succ = it.object.point.copy(), next(it).point.copy(
                ), next(it).point.copy()
            it.decrement()
        ab = current - prev
        bc = succ - current
        ac = prev - succ
        a, b, c = ab.length, bc.length, ac.length
        try:
            area = 0.5 * ab.cross(ac)
            K = 4 * area / (a * b * c)
        except ZeroDivisionError:
            K = 0.0
        yield abs(K)
