def edges(ax, **kw):
    """
    Plot regular edges and rays (edges whose one endpoint is at infinity)
    """
    verts = kw['vertices']
    edges = kw['edges']
    for beg, end in edges:
        x0, y0 = verts[(beg), :]
        x1, y1 = verts[(end), :]
        ax.fill([x0, x1], [y0, y1], facecolor='none', edgecolor='k',
            linewidth=0.5)
    if 'ray_origins' not in kw or 'ray_directions' not in kw:
        return
    lim = ax.axis()
    ray_origin = kw['ray_origins']
    ray_direct = kw['ray_directions']
    for beg, (vx, vy) in zip(ray_origin.flatten(), ray_direct):
        x0, y0 = verts[(beg), :]
        scale = 100.0
        x1, y1 = x0 + scale * vx, y0 + scale * vy
        ax.fill([x0, x1], [y0, y1], facecolor='none', edgecolor='k',
            linewidth=0.5)
    ax.axis(lim)
