# How to use several angle values in tikz l-system?

I need help on Tikz lindenmayersystem library. In this topic, JLDiaz presented a solution to draw segments of several lengths thanks to the command:

\symbol{S}{\pgflsystemstep=0.6\pgflsystemstep}


Is there a way to do the same thing with angles? I would like to use + or - 60 degree rotation and + or - 85 degree rotation to draw my figure.

I've tried:

\documentclass[tikz]{standalone}
\usepackage{tikz}

\usetikzlibrary{lindenmayersystems}

\begin{document}

\begin{tikzpicture}
\pgfdeclarelindenmayersystem{mySystem}{
\symbol{a}{\pgflsystemleftangle = 60}
\symbol{b}{\pgflsystemrightangle = 60}
\rule{X -> FaF+F-F-F+FbF}
}

\draw  [l-system={mySystem, step=10pt, angle=85, axiom=X, order=1}]
lindenmayer system ;
\end{tikzpicture}

\end{document}


without any success: "a" and "b" symbol are ignored.

Could you help me on this? Thank you!

-

You need to use \def\pgflsystemleftangle{60} or \def\pgflsystemrightangle{60} (note that the manual has some typos and inserts and extra r in the macro names in a couple of places). You can set them both at once with a custom macro as I have done below. Note that the angle remains changed in the current scope.

\documentclass[tikz]{standalone}
\usepackage{tikz}

\usetikzlibrary{lindenmayersystems}
\def\pgflsystemsetangle#1{%
\def\pgflsystemleftangle{#1}%
\def\pgflsystemrightangle{#1}%
}
\begin{document}

\begin{tikzpicture}
\pgfdeclarelindenmayersystem{mySystem}{
\symbol{a}{\pgflsystemsetangle{30}}
\symbol{b}{\pgflsystemsetangle{60}}
\symbol{c}{\pgflsystemsetangle{90}}
\rule{X -> Fa+Fb+Fc+Fa-Fb-Fc-F}
}

\draw  [l-system={mySystem, step=10pt, angle=85, axiom=X, order=1}]
lindenmayer system ;
\end{tikzpicture}

\end{document}


-
Thank you! That's exactly what I need! – Tobard Feb 25 '14 at 17:06