def surface_intersections(edge_nodes1, edge_nodes2, all_intersections):
    """Find all intersections among edges of two surfaces.

    This treats intersections which have ``s == 1.0`` or ``t == 1.0``
    as duplicates. The duplicates may be checked by the caller, e.g.
    by :func:`verify_duplicates`.

    Args:
        edge_nodes1 (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]): The
            nodes of the three edges of the first surface being intersected.
        edge_nodes2 (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]): The
            nodes of the three edges of the second surface being intersected.
        all_intersections (Callable): A helper that intersects B |eacute| zier
            curves. Takes the nodes of each curve as input and returns an
            array (``2 x N``) of intersections.

    Returns:
        Tuple[list, list, list, set]: 4-tuple of

        * The actual "unique" :class:`Intersection`-s
        * Duplicate :class:`Intersection`-s encountered (these will be
          corner intersections)
        * Intersections that won't be used, such as a tangent intersection
          along an edge
        * All the intersection classifications encountered
    """
    # NOTE: There is no corresponding "enable", but the disable only applies
    #       in this lexical scope.
    # pylint: disable=too-many-locals
    intersections = []
    duplicates = []
    for index1, nodes1 in enumerate(edge_nodes1):
        for index2, nodes2 in enumerate(edge_nodes2):
            st_vals, coincident = all_intersections(nodes1, nodes2)
            interior_curve = classify_coincident(st_vals, coincident)
            for s, t in st_vals.T:
                add_intersection(
                    index1,
                    s,
                    index2,
                    t,
                    interior_curve,
                    edge_nodes1,
                    edge_nodes2,
                    duplicates,
                    intersections,
                )
    all_types = set()
    to_keep = []
    unused = []
    for intersection in intersections:
        all_types.add(intersection.interior_curve)
        # Only keep the intersections which are "acceptable".
        if should_use(intersection):
            to_keep.append(intersection)
        else:
            unused.append(intersection)
    return to_keep, duplicates, unused, all_types
def surface_intersections ( edge_nodes1 , edge_nodes2 , all_intersections ) : intersections = [ ] duplicates = [ ] for index1 , nodes1 in enumerate ( edge_nodes1 ) : for index2 , nodes2 in enumerate ( edge_nodes2 ) : st_vals , coincident = all_intersections ( nodes1 , nodes2 ) interior_curve = classify_coincident ( st_vals , coincident ) for s , t in st_vals . T : add_intersection ( index1 , s , index2 , t , interior_curve , edge_nodes1 , edge_nodes2 , duplicates , intersections , ) all_types = set ( ) to_keep = [ ] unused = [ ] for intersection in intersections : all_types . add ( intersection . interior_curve ) if should_use ( intersection ) : to_keep . append ( intersection ) else : unused . append ( intersection ) return to_keep , duplicates , unused , all_types
Find all intersections among edges of two surfaces.

    This treats intersections which have ``s == 1.0`` or ``t == 1.0``
    as duplicates. The duplicates may be checked by the caller, e.g.
    by :func:`verify_duplicates`.

    Args:
        edge_nodes1 (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]): The
            nodes of the three edges of the first surface being intersected.
        edge_nodes2 (Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray]): The
            nodes of the three edges of the second surface being intersected.
        all_intersections (Callable): A helper that intersects B |eacute| zier
            curves. Takes the nodes of each curve as input and returns an
            array (``2 x N``) of intersections.

    Returns:
        Tuple[list, list, list, set]: 4-tuple of

        * The actual "unique" :class:`Intersection`-s
        * Duplicate :class:`Intersection`-s encountered (these will be
          corner intersections)
        * Intersections that won't be used, such as a tangent intersection
          along an edge
        * All the intersection classifications encountered