def get_next_first(intersection, intersections, to_end=True):
    """Gets the next node along the current (first) edge.

    .. note::

       This is a helper used only by :func:`get_next`, which in
       turn is only used by :func:`basic_interior_combine`, which itself
       is only used by :func:`combine_intersections`.

    Along with :func:`get_next_second`, this function does the majority of the
    heavy lifting in :func:`get_next`. **Very** similar to
    :func:`get_next_second`, but this works with the first curve while the
    other function works with the second.

    Args:
        intersection (.Intersection): The current intersection.
        intersections (List[.Intersection]): List of all detected
            intersections, provided as a reference for potential
            points to arrive at.
        to_end (Optional[bool]): Indicates if the next node should just be
            the end of the first edge or :data:`None`.

    Returns:
        Optional[.Intersection]: The "next" point along a surface of
        intersection. This will produce the next intersection along the
        current (first) edge or the end of the same edge. If ``to_end`` is
        :data:`False` and there are no other intersections along the current
        edge, will return :data:`None` (rather than the end of the same edge).
    """
    along_edge = None
    index_first = intersection.index_first
    s = intersection.s
    for other_int in intersections:
        other_s = other_int.s
        if other_int.index_first == index_first and other_s > s:
            if along_edge is None or other_s < along_edge.s:
                along_edge = other_int
    if along_edge is None:
        if to_end:
            # If there is no other intersection on the edge, just return
            # the segment end.
            return _intersection_helpers.Intersection(
                index_first,
                1.0,
                None,
                None,
                interior_curve=CLASSIFICATION_T.FIRST,
            )

        else:
            return None

    else:
        return along_edge
Gets the next node along the current (first) edge.

    .. note::

       This is a helper used only by :func:`get_next`, which in
       turn is only used by :func:`basic_interior_combine`, which itself
       is only used by :func:`combine_intersections`.

    Along with :func:`get_next_second`, this function does the majority of the
    heavy lifting in :func:`get_next`. **Very** similar to
    :func:`get_next_second`, but this works with the first curve while the
    other function works with the second.

    Args:
        intersection (.Intersection): The current intersection.
        intersections (List[.Intersection]): List of all detected
            intersections, provided as a reference for potential
            points to arrive at.
        to_end (Optional[bool]): Indicates if the next node should just be
            the end of the first edge or :data:`None`.

    Returns:
        Optional[.Intersection]: The "next" point along a surface of
        intersection. This will produce the next intersection along the
        current (first) edge or the end of the same edge. If ``to_end`` is
        :data:`False` and there are no other intersections along the current
        edge, will return :data:`None` (rather than the end of the same edge).