I try to modify rectangle bounding box to square and plus 10% enlarge! I wish below logic work but error reported:
\documentclass[border=0pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\usetikzlibrary{backgrounds}
\begin{document}
\begin{tikzpicture}
%\tikzset{background rectangle/.style={fill=gray!20}, show background rectangle}
\tikzset{
save path/.code 2 args={
\pgfkeysalso{#1/.estyle={insert path={#2}}}%
\global\expandafter\let\csname pgfk@\pgfkeyscurrentpath/.@cmd\expandafter\endcsname
\csname pgfk@\pgfkeyscurrentpath/.@cmd\endcsname
\pgfkeysalso{#1}%
}
}
\coordinate (O) at (5,5);
\foreach \i in {30,150,-30,-150} {
\begin{scope}[rotate around={\i:(O)}]
\coordinate (P) at (7.45,5);
\begin{scope}[rotate around={180:(P)}]
\draw[fill=white] (5.65,5) -- ++(1.8,1.5) -- ++(0,-1) -- ++(1.8,0)
-- ++(0,-1) -- ++(-1.8,0) -- ++(0,-1) -- cycle;
\end{scope}
\end{scope}
}
\path let \p1=(current bounding box.center),
\p2=(current bounding box.east),
\p2=(current bounding box.north),
\n1={max(\x2-\x1,\y3-\y1)*1.1},
\x3={x1-\n1},
\y3={y1-\n1},
\x4={x1+\n1},
\y4={y1+\n1}
in
useasboundingbox (\x3,\y3) rectangle (\x4,\y4);
\end{tikzpicture}
\end{document}
Error message:
! Undefined control sequence.
\pgfmath@dimen@ ...men@@ #1=0.0pt\relax \pgfmath@
l.30 \n1={max(\x2-\x1,\y3-\y1)*1.1}
,
?



\makeatletter, aren't you? – Dec 07 '18 at 02:00\p2? You can't define\x3and\y3(these values are automatically defined from point\p3). – Paul Gaborit Dec 07 '18 at 02:02