Why are there jumping frames when I increase the radius?
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
- tikz bounding box / cropping: too much space for curves
- Bounding box is larger than expected when drawing a curved path
- Why do coordinates in Bezier curves add to the padding in TikZ?
- What type of curve is used by Tikz when I "bend" an edge?
Use a circle of radius \r (plus something) for calculating the bounding box.
\useasboundingbox
overrides automatic BBox calculation which includes invisible path components, such as control points of curves.
\documentclass[tikz]{standalone}
\begin{document}
\pgfmathsetmacro{\r}{1.95}
\foreach \j in {0,10,20,...,110}{%
\begin{tikzpicture}%
% \draw (-2.2,-2.2) rectangle (2.2,2.2);%
\useasboundingbox (0,0) circle (\r+0.01);
\draw(0,0) circle (.25);%
\foreach \i in {0,1,2}{\draw[rotate=\i*120] (\j:\r) arc (\j:90+\j:\r) -- (90+\j:.3) arc (90+\j:\j:.3) -- cycle;}%
\end{tikzpicture}}%
\end{document}