I wish to draw an object with tikz
by a macro, therefore I have to calculate expressions like:
defined by:
\newcommand{\myhexagon}{2}{...}
\newcommand{\myobject}{2}{
\myheaxgon{#1}{0.5*#2}
\myhexagon{0.89*#1-4mm}{0.79*(#1-(0.89*#1-4mm))+#2}}
}
called by (e.g):
\myobject{2cm}{3mm}
\myobject{12mm}{3mm}
I've tried to solve with
\newcommand{\myobject}{2}{
\def\const{0.89}
\def\constII{0.79}
\myheaxgon{#1}{0.5*#2}
\myheaxgon{\the\dimexpr \const#1 -4mm\relax}{\the\dimexpr\constII\the\dimexpr#1-\the\dimexpr\const#1-4mm\relax\relax+#2\relax}
}
(viz. replace '0.89*' by '\const' and '()' by '\the\dimexpr ... \relax
') but I failed. Does anyone have some idea?
\newcommand{\myobject}{2}{
must be\newcommand{\myobject}[2]{
(square brackets around the number of parameters. Same formyhexagon
.