In a way, this is just a reminder of an old unsolved question but arguably with some new insight or tilt. (And I do not think the actual question is a duplicate of the old one.) The fillbetween library has the feature of providing access to intersection segments. I am aware of Heiko Oberdiek's statement that this might be not always precise, but I find that in many cases it is actually precise enough. IMHO the real problem is that reverse does not work in plain TikZ, while in pgfplots it just works fine. Consider this MWE:
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots} % loads tikz
\pgfplotsset{compat=1.15}
\usetikzlibrary{intersections,fillbetween}
\begin{document}
\begin{tikzpicture}
\path[name path = line1, draw] (-1,0) to[out=90,in=90] (1,1) to[out=-90,in=0] (0,-1);
\path[name path = line2, draw] (-1,1) -- (1,-1);
\draw[very thick, intersection segments={of=line1 and line2,sequence=L2}];
\end{tikzpicture}
\begin{tikzpicture}
\path[name path = line1, draw] (-1,0) to[out=90,in=90] (1,1) to[out=-90,in=0] (0,-1);
\path[name path = line2, draw] (-1,1) -- (1,-1);
\draw[very thick, intersection segments={of=line1 and line2,sequence=L1 R2}];
\end{tikzpicture}
% The following does not work.
%
% \begin{tikzpicture}
% \path[name path = line1, draw] (-1,0) to[out=90,in=90] (1,1) to[out=-90,in=0] (0,-1);
% \path[name path = line2, draw] (-1,1) -- (1,-1);
% \draw[very thick, intersection segments={of=line1 and
% line2,sequence=L2[reverse] R2}];
% \end{tikzpicture}
\end{document}
If I were to uncomment the last part, I'd trigger an error. In fact, any attempt to make reverse work lead to an error.
QUESTION: Is there a (simple) way to fix this?
COMMENT: Once reverse works, the old unsolved question should be solved as well.


L2[reverse] R2->{L2[reverse] R2}– Salim Bou Mar 24 '18 at 07:15