def determine_non_fit_area(shape, basic_shape, max_error=None):
    """
    Determines the area of the part of the basic shape that does not fit the
    given shape (i.e. what is left after differencing the two shapes,
    and optionally negative buffering with the max error).

    Parameters
    ----------
    shape : polygon
        The shape of the points.
    basic_shape : polygon
        The shape of the rectangle or triangle
    max_error : float, optional
        The maximum error (distance) a point may have to the shape.

    Returns
    -------
    area : float
        The area of the part of the basic shape that did not fit the
        given shape.
    """
    diff = basic_shape - shape
    if max_error is not None:
        diff = diff.buffer(-max_error)
    print('non fit area: {}'.format(diff.area))
    return diff.area