I ran into the following problem: Constructing a path using "plot", I fail to find intersections that fall exactly onto the coordinates used to construct that path. In the example below, the 2nd intersection is only found when I move the rectangle so that it intersects the plot path before or after the x=4.
This looks a bit to me like the "plot" path would actually not be a single path but segments that are joined, and that the intersection is not found at the points where the segments are linked.
Is this intended, or might it be a bug?
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,intersections,scopes,calc,positioning}
\begin{document}
\begin{tikzpicture}[scale=1, transform shape]
\tikzstyle{dot}=[fill=blue,circle,inner sep=.3ex]
\draw[name path=b,yellow] (2cm,-.5cm) rectangle (4.0cm,2); %3.9cm works
\draw [name path=p, blue, thick]
plot [smooth] coordinates { (0,0) (1,.1) (2,1) (3,1) (4,0.1) (5,0) };
\path [name intersections={of=b and p}]
(intersection-1) node[dot] {}
(intersection-2) node[dot] {};
\end{tikzpicture}
\end{document}

\draw[name path=b,yellow] (2cm,-.5cm) rectangle ++(2cm,2.5cm);– CarLaTeX Jun 03 '18 at 06:58