
Make sure you know how to use \pgfresetboundingbox or \pgfinterruptboundingbox.
Playing code
This is basically the example of show path construction in the manual. In addition to curves I showed the support points so it can be seen that it is the support points that exceeds the frame.
\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.pathreplacing}
\begin{document}
\pgfmathsetmacro{\r}{2.1}
\tikzset{
decoration={
show path construction,
moveto code={
\fill[red](\tikzinputsegmentfirst)circle(2pt)
node[fill=none,below]{moveto};},
lineto code={
\draw[blue,->](\tikzinputsegmentfirst)--(\tikzinputsegmentlast)
node[pos=.5,auto]{lineto};
},
curveto code={
\draw[green!75!black,dashed](\tikzinputsegmentfirst)--(\tikzinputsegmentsupporta)
(\tikzinputsegmentlast)--(\tikzinputsegmentsupportb);
\draw[green!75!black,->](\tikzinputsegmentfirst)..controls
(\tikzinputsegmentsupporta)and(\tikzinputsegmentsupportb)
..(\tikzinputsegmentlast)node[pos=.5,auto]{curveto};
},
closepath code={
\draw[orange,->](\tikzinputsegmentfirst)--(\tikzinputsegmentlast)
node[pos=.5,auto]{closepath};
}
}
}
\foreach \j in {0,5,...,119}{
\tikz[scale=3]{
\draw[line width=1.2](-2.2,-2.2)rectangle(2.2,2.2)(0,0)circle(.25);
\foreach\i in{0,1,2}{
\draw[rotate=\i*120,decorate](\j:\r)arc(\j:90+\j:\r)--(90+\j:.3)arc(90+\j:\j:.3)--cycle;
}%
}
}%
\end{document}
See also
\draw[red] (-2.3,-2.3) rectangle (2.3,2.3);. Still now i don't know the reason for this behaviour. It also appear with a smaller radius and smaller rectangle (r=1.7, and rectangle =(-2.0,-2.0) to (2.0,2.0)). – Bobyandbob Aug 17 '17 at 18:54