import typing


def discretize_layer(width: float, stretch_factor: float = 1.3,  minimum_division=0.001, maximum_division=0.2) \
        -> typing.List[float]:
    """
    Creates a subdivision of the material to be used for the discretization.

    :param width: Width of the material to be subdivided
    :param minimum_division: Width of the smallest division
    :param stretch_factor: Increase in subdivisions
    :param maximum_division: Maximum size of a cell
    :return: List containing width of subdivisions
    """

    processed_width = 0
    next_ = minimum_division
    left_side = []
    right_side = []

    while processed_width < width:
        remaining = width - processed_width

        if next_*2 <= remaining:
            left_side.append(next_)
            right_side.append(next_)
            processed_width += next_*2

        else:
            if remaining <= maximum_division:
                left_side.append(remaining)
                processed_width += remaining
            else:
                left_side.append(remaining/2)
                right_side.append(remaining/2)
                processed_width += remaining

        next_ = min(next_ * stretch_factor, maximum_division)

    new_grid = left_side + right_side[::-1]

    return new_grid