def check_connection_clearance(graph, node1, node2, cut_off=0.7):
    """
    Function for checking if one component will pass through another.

    Parameters
    ----------
    graph: (Di)Graph object
    node1: dict
        A dictionary of node attributes.
    node2: dict
        A dictionary of node attributes.
    cut_off: 0 < float < 1
        A ration of the nominal component size used as a filter, e.g. if set
        to 0.7, if node 1 has a size of 5, only a node with a size greater than
        3.5 will be considered.

    Returns
    -------
    graph: (Di)Graph object
        Graph with an edge added if node2 will drift node1, with a `clearance`
        attribute indicating the clearance between the critical outer diameter
        of node2 and the drift of node1.
    """
    try:
        node2_connection_od = node2['coupling_outside_diameter']
    except KeyError:
        node2_connection_od = node2['box_outside_diameter']
    clearance = min(
            node1['pipe_body_drift'],
            node1['connection_inside_diameter']
    ) - max(
        node2_connection_od,
        node2['pipe_body_inside_diameter']
        + 2 * node2['pipe_body_wall_thickness']
    )
    if all((
        clearance > 0,
        node2['size'] / node1['size'] > cut_off
    )):
        graph.add_edge(node1['uid'], node2['uid'], **{'clearance': clearance})
    
    return graph