def path_to_points(path, num_points, closed, reverse):
    """Convert SVG path to a 2D point list. Provide path, number of points,
    and whether or not this is a closed path (loop). For closed loops,
    the size of the point list returned is one element larger than the
    number of points passed, and the first and last elements will
    coincide."""
    points = []
    num_points = max(num_points, 2)
    if closed:
        div = float(num_points)
    else:
        div = float(num_points - 1)
    for point_num in range(num_points):
        if reverse:
            point = path.point(1.0 - point_num / div, error=1e-5)
        else:
            point = path.point(point_num / div, error=1e-5)
        points.append((point.real, point.imag))
    if closed:
        points.append(points[0])
    return points