Reputation: 21
I'm trying to draw some space-filling curves with tikz and the Lindenmayer system.
My goal was this curve:
So I tried it out:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary[lindenmayersystems]
\begin{document}
\pgfdeclarelindenmayersystem{Turtle}{
\rule{L -> +FFFF-FR} %rule 1
\rule{R -> -FFFF+FL} %rule 2
}
\begin{tabular}{cc}
\begin{tikzpicture}
\shadedraw [bottom color=white, top color=white, draw=black]
[l-system={Turtle, axiom=L, order=6, step=0.25cm, angle=90}]
lindenmayer system;
\end{tikzpicture}
\end{tabular}
\end{document}
For "order=6" this results in: Curve with Order 6
This should be the third picture in the first row of the first picture.
But when i tried it out, I ran into 2 Problems: \
So my question is, is there a rule for which I get my space-filling curve which are dependend on the order? Or can this be done without the depency of the order?
As an aditional task I also tried to get a grid in the background, so that I get cells size is equal to a step, but I did not get the scale right, when I wanted to make in dependent on the order. I tried it with
...
lindenmayer system;
\draw[step=0.25cm, gray, very thin] (0,0) grid (1,1);
...
But just as before, this does not scale and we can clearly see how the curve does not fill up this space (grid):
Can anybody help me or give me advise?
Upvotes: 2
Views: 92