def ToLayer(width, material, role):
    """ Creates a Layer based on strings containing the width, the material and the role

    :param width: Width of the layer
    :param material: Material of the layer, as a string
    :param role: The role of the layer
    :return: A Solcore Layer
    """
    return eval('Layer( width=%s, material=%s, role="%s"  )' % (width,
        material, role))
