I think the best approach is to use Lindenmayer systems.
The following code defines a Lindenmayer rules for drawing a single "arm" of the snowflake. I think it is crucial that the "arm" is symmetric. Then this arm is repeated rotated 60 degrees each time to produce the complete snowflake.
Changing the Lindenmayer rule, the angle turned by the rules +
and -
, and the line width, an astonishing number of possibilities flourish. Unfortunately these kind of figures take a time to compile, so I became impatient before trying other rules, and I decided to post the preliminary results. But it is so much fun to play with these parameters that I'll probably come back with more designs :-)
The following figure uses only two rules, which I named "A" and "B":
- Rule A:
F -> FF[+F][-F]
- Rule B:
F -> ffF[++FF][--FF]
![Snowflakes](https://i.stack.imgur.com/iDMF4.png)
The snowflakes in each row use the same rule and angle, and the different aspect is due only to change in the line width. The rules and angles for each row are:
- Row 1. Rule A, angle 60
- Row 2. Rule A, angle 90
- Row 3. Rule B, angle 60
- Row 4. Rule B, angle 30
This is the code:
\documentclass{article}
\usepackage{tikz,nopageno}
\usetikzlibrary{lindenmayersystems}
\pgfdeclarelindenmayersystem{A}{
\rule{F -> FF[+F][-F]}
}
\pgfdeclarelindenmayersystem{B}{
\rule{F -> ffF[++FF][--FF]}
}
\tikzset{
type/.style={l-system={#1, axiom=F,order=3,step=4pt,angle=60},
blue, opacity=0.4, line width=.5mm, line cap=round
},
}
\newcommand\drawsnowflake[2][scale=0.2]{
\tikz[#1]
\foreach \a in {0,60,...,300} {
\draw[rotate=\a,#2] l-system;
};
}
\begin{document}
\foreach \width in {.2,.4,...,.8}
{ \drawsnowflake{type=A, line width=\width mm} }
\foreach \width in {.2,.4,...,.8}
{ \drawsnowflake[scale=0.3]{type=A, l-system={angle=90}, line width=\width mm} }
\foreach \width in {.2,.4,...,.8}
{ \drawsnowflake[scale=0.3]{type=B, line width=\width mm} }
\foreach \width in {.2,.4,...,.8}
{ \drawsnowflake{type=B, l-system={angle=30}, line width=\width mm} }
\end{document}
I have to play with the axiom too! :-)
Update
Inspired by the page suggested by Torbjørn T., I tried to reproduce the first one:
![Snow](https://i.stack.imgur.com/HVxMt.jpg)
For that I used a new rule:
\pgfdeclarelindenmayersystem{C}{
\symbol{G}{\pgflsystemdrawforward}
\rule{F -> F[+F][-F]FG[+F][-F]FG}
}
And the flakes were drawn with:
\drawsnowflake[scale=0.2]{type=C, l-system={order=2}, line width=0.2mm}
\drawsnowflake[scale=0.2]{type=C, l-system={order=2}, line width=0.4mm}
Update: Playing with axioms
The same rule (C) used in previous example can produce different variations if we start with an axiom different of the simple F
.
![Variations](https://i.stack.imgur.com/3J7Yz.jpg)
I devised a new rule, aimed to produce flakes of the type "plate", which can also produce interesting variations depending on the axiom. This is the rule:
\pgfdeclarelindenmayersystem{D}{
\symbol{G}{\pgflsystemdrawforward}
\symbol{H}{\pgflsystemdrawforward}
\rule{F -> H[+HG][-HG]G}
\rule{G -> HF}
}
And these are some variations:
\drawsnowflake[scale=0.5]{type=D, l-system={order=4,angle=60,axiom=GF}, line width=0.7mm}
\drawsnowflake[scale=0.5]{type=D, l-system={order=4,angle=60,axiom=GfF}, line width=0.7mm}
\drawsnowflake[scale=0.5]{type=D, l-system={order=4,angle=60,axiom=FG}, line width=0.7mm}
\drawsnowflake[scale=0.5]{type=D, l-system={order=4,angle=60,axiom=FfG}, line width=0.7mm}
![Plates](https://i.stack.imgur.com/CMZqD.jpg)
Best Answer
This is my third answer and my second non-CW answer here :) Don't worry, I'll shut up now.
Because this doesn't relate to the Kaila, I decided to post another answer instead of edit the other post.
1 | [inspired by this] For the sake of completeness, let's have some Unicode dogs!
My comment: The dog face (U+1F436) is so sweet! It should be the base of a
tikzlings-dog
, I think.2 | [inspired by Raaja] For the sake of completeness (again), let's have ASCII-art! This is a German Shepherd for GermanShepherd :))
Image Source: here
Original Image: