Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to use TikZ for drawing a christmas tree. Here's a start, I used the lindenmayersystems library for drawing a tree:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{lindenmayersystems}
\begin{document}
\begin{tikzpicture}
\draw [color=green!50!black, l-system={rule set={S -> [+++G][---G]TS,
  G -> +H[-G]L, H -> -G[+H]L, T -> TL, L -> [-FFF][+FFF]F}, step=4pt, angle=18,
 axiom=+++++SLFFF, order=11}] lindenmayer system -- cycle;
\end{tikzpicture}
\end{document}

Fractal tree

I found the tree in "The Science of fractal images" by Peitgen and Saupe.

Who can help to decorate it? Or to draw another tree with Christmas decorations, such as tinsel garland (lametta), candles, baubles (Christmas balls), a tree topper? Perhaps add a shading to the green?

For celebrating Christmas, I would like to put the tree on our blog, and on the TikZ example gallery.

share|improve this question
1  
I don't know if I'll get a chance to figure out the details of this so I'll record the idea as inspiration for domeone else to realise: for tinsel, try a curve with the snake decoration and rounded corners as in tex.stackexchange.com/q/38989/86 by adjusting the parameters then you get quite a variety of tinsel-like effects –  Loop Space Dec 23 '11 at 6:18
    
(Botheration. The iPad keyboard strikes again: "someone". And I haven't the accuracy to hit the "edit" link.) –  Loop Space Dec 23 '11 at 6:20
5  
I'm very happy Kjell accepts your offer to become the new maintainer of TeXample.net. It's a very good news ! Happy christmas Stephan !! –  Alain Matthes Dec 24 '11 at 10:30
6  
+1 for the {trees} tag :D –  doncherry Dec 24 '11 at 12:32

13 Answers 13

up vote 116 down vote accepted

Merry Christmas everyone!

\documentclass[11pt]{scrartcl} 
\usepackage[dvipsnames,svgnames]{xcolor}  
\usepackage{tikz}
\usetikzlibrary{shapes,decorations.shapes}
\newsavebox{\mycandle}
\savebox{\mycandle}{ 
\begin{tikzpicture}[scale=.1]
\shade[top color=yellow,bottom color=red] (0,0) .. controls (1,.2) and (1,.5) .. (0,2) .. controls (-1,.5)  and  (-1,.2) .. (0,0);
\fill[yellow!90!black] (.8,0) rectangle (-.8,-5); 
\end{tikzpicture} } 

\tikzset{
  paint/.style={draw=#1!50!black, fill=#1!50},
  my star/.style={decorate,decoration={shape backgrounds,shape=star},
                  star points=#1}
}  

\begin{document}
\begin{tikzpicture} 
   \draw[fill=Maroon,ultra thick] 
   (.75,-1)  ..  controls (.5,.5)  and   (.5,3)    .. (0.5,4) 
-- (-0.5,4)  ..  controls (-.5,3) and (-.5,.5)     .. (-.75,-1) ;
\draw[ultra thick,fill=green!50!black] 
      (0,10) .. controls  (0,8)     and   (1,7)    .. (1.5,7) 
             ..  controls (1,7)     and   (1,7)    .. (0.5,7.25) 
             ..  controls (1.5,5)   and   (2.5,4)  .. (3,4)
             ..  controls (2,4)     and   (1.25,4) .. (1,4.5)
             ..  controls (2,2)     and   (3.5,2)  .. (4,2)
             ..  controls (1,1)     and   (-1,1)   .. (-4,2) 
             ..  controls (-3.5,2)  and   (-2,2)   .. (-1,4.5)
             ..  controls (-1.25,4) and   (-2,4)   .. (-3,4) 
             ..  controls (-2.5,4)  and   (-1.5,5) .. (-0.5,7.25) 
             ..  controls  (-1,7)   and   (-1,7)   .. (-1.5,7)
             ..  controls  (-1,7)   and   (0,8)    .. (0,10)
              ;
\foreach \candle in {(2,5),(-2,5),(0.5,7.5),(-0.5,7.5),(-3,2.5), (3,2.5),
                    (1.5,1.75),(-1.5,1.75)}
\node at \candle {\usebox{\mycandle}} ; 
 \node [star, star point height=.5cm, minimum size=.5cm, draw,fill=yellow,thick]
       at (0,10) {};
       \begin{scope}[decoration={shape sep=.2cm, shape size=.25cm}] 
    \draw [my star=6, paint=red]  (-4,2)
             ..  controls (0,2)     and   (1,3.5)   .. (1,4.5)
             ..  controls (1,6)     and   (0.5,6)      .. (0.5,7.25); 
    \draw [my star=6, paint=blue]  (4,2)
             ..  controls  (0,2) and (-1,3.5)      .. (-1,4.5)             
             ..  controls (-1,6)     and   (-0.5,6)      .. (-0.5,7.25);    
       \end{scope}  
\end{tikzpicture}

\end{document} 

enter image description here

Update version 2 : The snow arrives, I added some balls and a shade on the tree

\documentclass[11pt]{scrartcl} 
\usepackage[dvipsnames,svgnames]{xcolor}  
\usepackage{tikz}
\usetikzlibrary{%
  shapes,
  decorations.shapes,
  decorations.fractals,
  decorations.markings,
  shadows
}

\newsavebox{\mycandle}
\savebox{\mycandle}{ 
\begin{tikzpicture}[scale=.1]
\shade[top color=yellow,bottom color=red] (0,0) .. controls (1,.2) and (1,.5) .. (0,2) .. controls (-1,.5)  and  (-1,.2) .. (0,0);
\fill[yellow!90!black] (.8,0) rectangle (-.8,-5); 
\end{tikzpicture} } 

\tikzset{
  paint/.style={draw=#1!50!black, fill=#1!50},
  my star/.style={decorate,decoration={shape backgrounds,shape=star},
                  star points=#1}
}  

\begin{document}
  \begin{tikzpicture}[  ball red/.style={
    decorate,
    decoration={
      markings,
      mark=between positions .2 and 1 step 3cm
      with
      {
        \pgfmathsetmacro{\sz}{2 + .5 * rand}
        \path[shading=ball,ball color=red] (0,0) circle[radius=\sz mm];
      }
    }
  } ,ball blue/.style={
    decorate,
    decoration={
      markings,
      mark=between positions 0.1 and .9 step 3cm
      with
      {
        \pgfmathsetmacro{\sz}{2 + .5 * rand}
        \path[shading=ball,ball color=blue] (0,0) circle[radius=\sz mm];
      }
    }
  }   
]

\draw[fill=Maroon,ultra thick] 
      (.75,-1)  ..  controls (.5,.5)  and   (.5,3)    .. (0.5,4) 
   -- (-0.5,4)  ..  controls (-.5,3) and (-.5,.5)     .. (-.75,-1) ;
\shade[ultra thick, top color=green!90!black,bottom color=green!10!black] 
      (0,10) .. controls  (0,8)     and   (1,7)    .. (1.5,7) 
             ..  controls (1,7)     and   (1,7)    .. (0.5,7.25) 
             ..  controls (1.5,5)   and   (2.5,4)  .. (3,4)
             ..  controls (2,4)     and   (1.25,4) .. (1,4.5)
             ..  controls (2,2)     and   (3.5,2)  .. (4,2)
             ..  controls (1,1)     and   (-1,1)   .. (-4,2) 
             ..  controls (-3.5,2)  and   (-2,2)   .. (-1,4.5)
             ..  controls (-1.25,4) and   (-2,4)   .. (-3,4) 
             ..  controls (-2.5,4)  and   (-1.5,5) .. (-0.5,7.25) 
             ..  controls  (-1,7)   and   (-1,7)   .. (-1.5,7)
             ..  controls  (-1,7)   and   (0,8)    .. (0,10)
              ;

\foreach \candle in {(2,5),(-2,5),(0.5,7.5),(-0.5,7.5),(-3,2.5), (3,2.5),
                    (1.5,1.75),(-1.5,1.75)}
\node at \candle {\usebox{\mycandle}} ; 
\node [star, star point height=.5cm, minimum size=.5cm,draw,fill=yellow,thick]
      at (0,10) {};
\begin{scope}[decoration={shape sep=.2cm, shape size=.25cm}] 
    \draw [my star=6, paint=red]  (-4,2)
             ..  controls (0,2)     and   (1,3.5)   .. (1,4.40); 
    \draw [my star=6, paint=red]  (-1.5,5.40)
             ..  controls (0,5.40)     and   (0.5,6.5)      .. (0.5,7);  
    \draw [my star=6, paint=blue]  (4,2)
             ..  controls  (0,2) and (-1,3.5)      .. (-1,4.40);             
    \draw [my star=6, paint=blue]  (1.5,5.40)
             ..  controls (0,5.40)     and   (-0.5,6.5)      .. (-0.5,7);     
\end{scope} 
% the balls
\path[ball red] 
      (0,10) .. controls  (0,8)     and   (1,7)    .. (1.5,7) 
             ..  controls (1,7)     and   (1,7)    .. (0.5,7.25) 
             ..  controls (1.5,5)   and   (2.5,4)  .. (3,4)
             ..  controls (2,4)     and   (1.25,4) .. (1,4.5)
             ..  controls (2,2)     and   (3.5,2)  .. (4,2)
             ..  controls (1,1)     and   (-1,1)   .. (-4,2) 
             ..  controls (-3.5,2)  and   (-2,2)   .. (-1,4.5)
             ..  controls (-1.25,4) and   (-2,4)   .. (-3,4) 
             ..  controls (-2.5,4)  and   (-1.5,5) .. (-0.5,7.25) 
             ..  controls  (-1,7)   and   (-1,7)   .. (-1.5,7)
             ..  controls  (-1,7)   and   (0,8)    .. (0,10)
              ; 
\path[ball blue] 
      (0,10) .. controls  (0,8)     and   (1,7)    .. (1.5,7) 
             ..  controls (1,7)     and   (1,7)    .. (0.5,7.25) 
             ..  controls (1.5,5)   and   (2.5,4)  .. (3,4)
             ..  controls (2,4)     and   (1.25,4) .. (1,4.5)
             ..  controls (2,2)     and   (3.5,2)  .. (4,2)
             ..  controls (1,1)     and   (-1,1)   .. (-4,2) 
             ..  controls (-3.5,2)  and   (-2,2)   .. (-1,4.5)
             ..  controls (-1.25,4) and   (-2,4)   .. (-3,4) 
             ..  controls (-2.5,4)  and   (-1.5,5) .. (-0.5,7.25) 
             ..  controls  (-1,7)   and   (-1,7)   .. (-1.5,7)
             ..  controls  (-1,7)   and   (0,8)    .. (0,10)
              ; 
 % the snow
\foreach \i in {0.5,0.6,...,1.6}
     \fill [white!80!blue,decoration=Koch snowflake,opacity=.9]
           [shift={(rand*5,rnd*8)},scale=\i]
           [double copy shadow={opacity=0.2,shadow xshift=0pt,
           shadow yshift=3*\i pt,fill=white,draw=none}]
        decorate {
          decorate {
            decorate {
              (0,0) -- ++(60:1) -- ++(-60:1) -- cycle
            }
          }
        };                  
\end{tikzpicture}

\end{document} 

enter image description here

share|improve this answer
9  
I love the elegance of this one. –  Loop Space Dec 23 '11 at 21:45
1  
Beautiful! I put this one to our blog right now. –  Stefan Kottwitz Dec 24 '11 at 14:48
3  
I like the Koch snowflakes! Great idea. –  Harold Cavendish Dec 24 '11 at 21:22
1  
The output is nice, but the input didn't look very christmasy so I optimised it a bit in an answer below. –  David Carlisle Oct 26 '12 at 9:16
    
@AlainMatthes I want to support 'Tents and Trees' puzzle in my logicpuzzle package and need some kind of tree. I've modified your tree a bit. May I kindly ask you for a waiver (based on cc-wiki) to use your code in logicpuzzle.sty and license it under LPPL? –  Josef May 3 '13 at 13:04

Christmas Tree

Just in case the code isn't clear from behind the picture, here it is in full:

\documentclass{article}
\usepackage{listings}
\usepackage{tikz}
\usetikzlibrary{%
  lindenmayersystems,
  decorations.pathmorphing,
  decorations.markings,
  shapes.geometric,
  calc%
}
\tikzset{
  tinsel/.style={
    #1,
    rounded corners=10mm,
    ultra thin,
    decorate,
    decoration={
      snake,
      amplitude=.1mm,
      segment length=10,
    }
  },
  baubles/.style={
    decorate,
    decoration={
      markings,
      mark=between positions .3 and 1 step 2cm
      with
      {
        \pgfmathsetmacro{\brad}{2 + .5 * rand}
        \path[shading=ball,ball color=#1] (0,0) circle[radius=\brad mm];
      }
    }
  },
  lights/.style={
    decorate,
    decoration={
      markings,
      mark=between positions 0 and 1 step 1cm
      with
      {
        \pgfmathparse{rand > 0 ? "dart" : "kite"}
        \let\lshape\pgfmathresult
         \pgfmathsetmacro{\tint}{100*rnd}
        \node[rotate=90,\lshape,shading=ball,inner sep=1pt,ball color=red!\tint!yellow] {};
      }
    }
  }
}

\begin{document}
\begin{center}
\tikz[remember picture,overlay] \coordinate (star) at (0,-1);
\end{center}

\lstinputlisting[
  breaklines=true,
  language=TeX,
  basicstyle=\tiny,
  firstline=63,
  lastline=103]{\jobname.tex}

\begin{tikzpicture}[overlay,remember picture]
\path (star) +(-50:7) coordinate (rhs) +(-130:7) coordinate (lhs);
\draw[brown!50!black,line width=5mm,line cap=round] (star) ++(-90:6.8) -- ++(0,-1) coordinate (base);
\node[scale=-1,trapezium,fill=black,minimum size=1cm] at (base) {};
\foreach \height/\colour in {%
  .2/blue,
  .4/yellow,
  .6/red,
  .8/orange,
  1/pink%
} {
  \draw[tinsel=\colour] ($(star)!\height!(lhs)$) to[bend right] ($(star)!\height!(rhs)$);
}
\path (star);
\pgfgetlastxy{\starx}{\stary}
\begin{scope}[xshift=\starx,yshift=\stary,yshift=-7cm]
\draw[color=green!50!black, l-system={rule set={S -> [+++G][---G]TS,  G -> +H[-G]L, H -> -G[+H]L, T -> TL, L -> [-FFF][+FFF]F}, step=4pt, angle=18, axiom=+++++SLFFF, order=11}] lindenmayer system -- cycle;
\end{scope}
\foreach \height/\colour in {%
  .1/pink,
  .3/red,
  .5/yellow,
  .7/blue,
  .9/orange%
} {
  \draw[tinsel=\colour] ($(star)!\height!(lhs)$) to[bend right] ($(star)!\height!(rhs)$);
}
\foreach \height in {.15,.35,...,1} {
  \draw[lights]  ($(star)!\height!(lhs)$) to[bend right] ($(star)!\height!(rhs)$);
}
\foreach \angle/\colour in {
  -50/red,
  -70/yellow,
  -90/blue,
  -110/pink,
  -130/purple%
} {
  \draw[baubles=\colour] (star) -- ++(\angle:7);
}
\node[star,star point ratio=2.5,fill=yellow,minimum size=1cm] at (star) {};
\end{tikzpicture}
\end{document}
share|improve this answer
1  
Thanks Andrew, posted to texample.net/tikz/examples/christmas-tree-2 ! Kindly tell me if I should change something. –  Stefan Kottwitz Dec 24 '11 at 16:15
    
@StefanKottwitz Looks great. The only change I'd make would be to put the (star) coordinate at (0,0) - it is at (0,-1) to put it at the right place with respect to the code listing. It just looks a little odd to put it at (0,-1) (but you should check that all the other pieces position correctly - I had quite a time with positioning the original tree). –  Loop Space Dec 24 '11 at 18:40

Another tree that can be decorated:

Merry Christmas, everybody!

\documentclass[border=5mm]{standalone}
\usepackage{pgfplots}

\begin{document}
%
\begin{tikzpicture}
\begin{axis}[
    hide axis, clip=false,
    y domain=0:2*pi,
    samples=30,axis equal, view={45}{20}]

\addplot3 [domain=0:4,surf,shader=flat,z buffer=sort,fill=green!50!brown, draw=green!50!black, line join=bevel] 
    ({(1.3*x-floor(x))*x^0.5*cos(deg(y))},
     {(1.3*x-floor(x))*x^0.5*sin(deg(y))},
     {-5*x});

\addplot3 [domain=0:4.5, samples=10, samples y=0, fill=yellow!85!red, draw=yellow!55!red] ({0},{sin(x/5*360) * (1 - x + floor(x)) },{cos(x/5*360) * (1 - x + floor(x) )  + 0.5}) -- cycle;
\end{axis}
\end{tikzpicture}%
%
\end{document}
share|improve this answer
3  
Haha! This is fantastic! Merry Christmas indeed! –  user2473 Dec 23 '11 at 1:50
2  
A great idea to use pgfplots for this drawing! –  Stefan Kottwitz Dec 24 '11 at 14:46
    
@StefanKottwitz wonder if you drawing gurus are willing to help with this fun idea: tex.stackexchange.com/questions/139733/… Thanks! –  Sibbs Gambling Oct 20 '13 at 16:50

Here's mine:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{scopes,svg.path,shapes.geometric,shadows}
\begin{document}
\begin{tikzpicture}[
  mystar/.style={star, minimum size=2cm, star point ratio=2.5, shade, thick,
    line join=round, color=yellow!80!black, draw=red!20!black,
    top color=yellow!80!white, bottom color=yellow!60!black},
  mytree/.style={scale=0.5, rotate=180, draw=green!60!black, thick,
    line join=round, inner color=green!60!yellow, outer color=green!50!black},
  myball/.style={shade, ball color=#1, circular drop shadow={
    shadow xshift=0pt, shadow yshift=-.5ex, fill=green!40!black}}
  ]
  {[mytree]
  \shadedraw svg "M355,430
    q90,10 105,-85 30,0 50,-30 20,30 50,30 50,-20 100,0 10,88 105,85
    -45,90 -205,25 Q400,520 355,430";
  \shadedraw svg "M380,325
    q83,10 105,-80 25,0 35,-30 20,25 40,30 20,-10 35,-25 20,20 40,25
    25,90 105,82 -15,50 -120,15 -30,-2 -60,12 -30,0 -52,-28
    C490,370 380,360 380,325";
  \shadedraw svg "M435,225
    q65,-8 90,-70 35,40 70,0 25,60 90,70 -30,52 -90,5 -36,48 -73,-3
    C520,254 445,265 435,225";
  \shadedraw svg "M470,139
    q50,5 90,-80 50,90 90,80 -30,30 -50,20 -40,45 -78,0
    Q500,170 470,139";
  }
  %\shadedraw svg[scale=0.5,rotate=180]
  %"M460,532 q50,-8 q77,-45 v-20 a20,13 0 1 1 48,0 v20 q30,40 77,45";
  %pgf/tikz doesn't like the arc operation, as stated in manual

  \node[mystar] at (-9.85,-1) {$\lambda$};

  \shade[myball=blue]   (-9.7,-2.2)   circle (.2cm);
  \shade[myball=red]    (-9.2,-3.8)   circle (.2cm);
  \shade[myball=green]  (-10.3,-4)    circle (.4cm);
  \shade[myball=yellow] (-8.95,-5.4)  circle (.4cm);
  \shade[myball=red]    (-10.7,-6.1)  circle (.4cm);
  \shade[myball=blue]   (-10.8,-5)    circle (.2cm);
  \shade[myball=yellow] (-9.5,-6.7)   circle (.2cm);
  \shade[myball=green]  (-8.3,-7.6)   circle (.4cm);
  \shade[myball=yellow] (-11.7,-7.6)  circle (.4cm);
  \shade[myball=blue]   (-10.5,-7.8)  circle (.2cm);
\end{tikzpicture}
\end{document}

which looks like:

christmastree

Merry Christmas!

share|improve this answer
6  
So beautiful with only a few lines! –  Stefan Kottwitz Dec 24 '11 at 14:50
1  
I am curious—why did you put a lambda inside the star? –  Harold Cavendish Dec 24 '11 at 22:50
2  
@Harrold: It was just a small easter egg (for lambda calculus). –  morbusg Dec 25 '11 at 8:23
6  
Easter egg at Christmas. Ha ha ha. (Or "ho ho ho") –  Loop Space Dec 26 '11 at 18:46
1  
@GarbageCollector: Heh, you are absolutely right. However, I get an error with plain which seems to relate to svgpath. –  morbusg Nov 8 '12 at 4:51

Having been having fun with straight-edge-and-compass constructions (thanks to What is the simplest way to draw this triangle exactly?), I thought I'd try my hand at a Christmas tree constructed using straight-edge and compass.

Static image of Christmas tree

(The animated version is about 5Mb. I'll have to stick it somewhere other than imgur and link to it.)

\documentclass[
%  handout, % use this to see the final construction
  xcolor=svgnames
]{beamer}
%\url{http://tex.stackexchange.com/q/142210/86}
%\url{http://tex.stackexchange.com/q/39149/86}
\usepackage{tikz}

\usetikzlibrary{decorations.text}

\usepackage[
%  draft
]{rulercompass}

\setbeamertemplate{navigation symbols}{}
\setbeamercolor{background canvas}{bg=Beige}

\pgfdeclarelayer{picture}
\pgfdeclarelayer{points}
\pgfsetlayers{picture,main,points}

\begin{document}
\begin{frame}[plain]
\hfill%
\begin{tikzpicture}[
    stop jumping,
    max size={\textwidth}{\textheight},
    pot/.style={
      draw=brown,
      on layer=picture,
      ultra thick
    },
    trunk/.style={
      draw=brown!50!black,
      on layer=picture,
      ultra thick
    },
    tree/.style={
      draw=green!50!black,
      on layer=picture,
      ultra thick
    },
    bauble/.style={
      fill=yellow,
      ultra thick,
      on layer=picture,
    },
    star/.style={
      draw=yellow,
      fill=red!50!black,
      on layer=picture
    },
    ruler compass,
    draft label/.style={
      reset label anchor,
      above,
      font=\tiny
    },
    every segment/.style={
    },
    every compass/.style={
      overlay,
    },
    every point/.style={
      node on layer=points,
      minimum size=1mm,
    },
    every arc/.style={
      on layer=picture,
      ultra thick
    },
    construction in use/.style={
      draw=gray!50,
    },
    construction not in use/.style={
      draw=gray!50,
    },
  ]
\path (0,0) node[name=0,ruler compass/point=red];
\path (0,1) node[name=1,ruler compass/point=red];
\pause
\ruler<+->[ruler compass/ruler length=40]{0}{1}
\compass<+->{0}{1}
\point<.->{r-0-1}{c-0-1}{2}
\compass<+->{1}{a}
\point<.->{r-0-1}{c-1-a}{1}
\compass<+->{a}{1}
\point<.->{c-a-1}{c-1-a}{1}
\point<.->{c-a-1}{c-1-a}{2}
\compass<+->{b}{c}
\compass<+->{b}{a}
\point<.->{c-b-a}{r-0-1}{1}
\compass<+->{e}{b}
\point<.->{c-e-b}{c-b-a}{1}
\point<.->{c-e-b}{c-b-a}{2}
\point<.->{c-e-b}{r-0-1}{1}
\ruler<+->{c}{g}
\ruler<.->{d}{f}
\compass<+->{h}{g}
\compass<+->{a}{g}
\ruler<+->{c}{d}
\point<.->{r-c-d}{c-0-1}{1}
\point<.->{r-c-d}{c-0-1}{2}
\compass<+->{b}{1}
\point<.->{c-b-1}{r-0-1}{1}
\compass<+->{b}{0}
\point<.->{c-b-0}{r-0-1}{1}
\ruler<+->{f}{g}
\compass<+->{k}{l}
\point<.->{c-k-l}{r-f-g}{1}
\point<.->{c-k-l}{r-f-g}{2}
\ruler<+->{i}{m}
\ruler<+->{j}{n}
\point<.->{r-j-n}{c-h-g}{2}
\point<.->{r-i-m}{c-h-g}{2}
\point<.->{r-j-n}{c-a-g}{1}
\point<.->{r-i-m}{c-a-g}{1}
\compass<+->{q}{o}
\compass<.->{r}{p}
\point<.->{c-q-o}{r-j-n}{1}
\point<.->{c-r-p}{r-i-m}{1}
\draw<.->[pot] (g) arc[centred arc to={a}{q}]
 (f) arc[arc flip,centred arc to={a}{r}];
\draw<.->[trunk] (o) -- (s) (p) -- (t);
\draw<.->[pot] (d) arc[centred arc to={b}{c}] -- (g) arc[arc flip,centred arc to={h}{f}] -- cycle;
\point<.->{c-h-g}{r-0-1}{1}
\compass<+->{u}{s}
\point<.->{c-u-s}{r-0-1}{1}
\compass<+->{v}{s}
\compass<+->{v}{u}
\point<.->{c-v-u}{r-0-1}{1}
\compass<+->{u}{w}
\compass<+->{w}{u}
\point<.->{c-u-w}{c-w-u}{1}
\point<.->{c-u-w}{c-w-u}{2}
\compass<+->{x}{v}
\compass<+->{y}{v}
\point<.->{c-x-v}{c-v-s}{2}
\point<.->{c-y-v}{c-v-s}{2}
\draw<.->[tree]
  (v)
  arc[centred arc to={x}{z}]
  arc[arc flip,centred arc to={v}{aa}]
  arc[centred arc to={y}{v}]
;
\compass<+->{v}{h}
\point<.->{c-v-h}{c-y-v}{2}
\point<.->{c-v-u}{c-y-v}{2}
\point<.->{c-v-u}{c-x-v}{2}
\point<.->{c-v-h}{c-x-v}{2}
\ruler<+->{ab}{ad}
\compass<+->{ab}{ad}
\compass<+->{ad}{ab}
\point<.->{c-ab-ad}{c-ad-ab}{1}
\compass<+->{af}{ab}
\point<.->{c-v-h}{r-i-m}{2}
\compass<+->{h}{ag}
\point<.->{c-v-h}{c-h-ag}{2}
\compass<+->{ag}{h}
\point<.->{c-v-h}{c-ag-h}{1}
\compass<+->{ai}{ag}
\point<.->{c-v-h}{c-ai-ag}{1}
\foreach[remember=\tpt as \ppt (initially i)] \tpt in {j,...,o}
{
  \compass<+->{a\tpt}{a\ppt}
  \point<.->{c-v-h}{c-a\tpt-a\ppt}{1}
}
\compass<+->{ah}{h}
\point<.->{c-v-h}{c-ah-h}{2}
\compass<+->{aq}{ah}
\point<.->{c-v-h}{c-aq-ah}{1}
\foreach[remember=\tpt as \ppt (initially q)] \tpt in {r,...,w}
{
  \compass<+->{a\tpt}{a\ppt}
  \point<.->{c-v-h}{c-a\tpt-a\ppt}{1}
}
\point<.->{c-v-u}{r-i-m}{2}
\compass<+->{u}{ay}
\compass<.->{ay}{u}
\point<.->{c-v-u}{c-ay-u}{1}
\compass<+->{az}{ay}
\point<.->{c-v-u}{c-az-ay}{1}
\point<.->{c-v-u}{c-u-ay}{2}
\compass<+->{bb}{u}
\point<.->{c-v-u}{c-bb-u}{2}
\compass<+->{bc}{bb}
\point<.->{c-v-u}{c-bc-bb}{1}
\compass<+->{bd}{bc}
\point<.->{c-bd-bc}{c-af-ab}{2}
\foreach[remember=\tpt as \ppt (initially d)] \tpt in {e,...,n}
{
  \compass<+->{b\tpt}{b\ppt}
  \point<.->{c-af-ab}{c-b\tpt-b\ppt}{2}
}
\foreach \bctr/\brad in {
  h/ag,
  aj/ai,
  am/al,
  ap/ao,
  ar/aq,
  au/at,
  ax/aw,
  ba/az,
  u/ay,
  bd/bc,
  bg/bf,
  bj/bi,
  bm/bl%
}
{
  \path<.->[bauble] (\bctr) to[circle through] (\brad);
}
\point<.->{c-ad-ab}{r-0-1}{1}
\compass<+->{v}{bp}
\compass<+->{bp}{v}
\point<.->{c-v-bp}{r-0-1}{2}
\compass<+->{bq}{v}
\point<.->{c-v-bp}{c-bp-v}{1}
\point<.->{c-v-bp}{c-bp-v}{2}
\point<.->{c-v-bp}{c-bq-v}{1}
\point<.->{c-v-bp}{c-bq-v}{2}
\fill<.->[star] (bp) -- (bu) -- (bt) -- cycle (bs) -- (br) -- (bq) -- cycle;
\compass<+->{b}{y}
{\huge
\path<+->[decorate,decoration={text along path,text align=center,text={Have a Constructive Christmas}}] (y) arc[arc flip,centred arc to={b}{x}];
}
\end{tikzpicture}%
\hspace*{\fill}%
\end{frame}
\end{document}

You also need the style file (save as rulercompass.sty) which also incorporates quite a few things from other questions and answers on this site:

\ProvidesPackage{rulercompass}
\usepackage{alphalph}
\usetikzlibrary{intersections,calc}

\newif\ifrc@draft
\newif\ifrc@beamer
\newif\ifrc@fliparc

\@ifclassloaded{beamer}{%
  \rc@beamertrue
}{}

\DeclareOption{draft}{%
  \rc@drafttrue
}

\DeclareOption{beamer}{%
  \rc@beamertrue
}

\ProcessOptions

\newcounter{pointlabels}
\setcounter{pointlabels}{0}
\resetcounteronoverlays{pointlabels}

\ifrc@beamer
\tikzset{
  onslide/.code args={<#1>#2}{%
    \only<#1>{\pgfkeysalso{#2}}%
  },
  alt/.code args={<#1>#2#3}{%
    \alt<#1>{\pgfkeysalso{#2}}{\pgfkeysalso{#3}}%
  },
  alt if exist/.code args={#1#2#3}{%
    \@ifundefined{path@#1}{%
      \pgfkeysalso{#2}%
    }{
      \alt<.-\csname path@#1\endcsname>{%
        \pgfkeysalso{#2}%
      }{
        \pgfkeysalso{#3}%
      }%
    }%
  },
  intersection/save/.code={%
    \begingroup
    \only<.>{%
    \tikz@intersect@path@names@parse#1\tikz@stop
    \protected@write\pgfutil@auxout{}{%
        \string\global\string\@namedef{path@\tikz@intersect@path@a}{\the\beamer@slideinframe}%
        \string\global\string\@namedef{path@\tikz@intersect@path@b}{\the\beamer@slideinframe}%
    }%
    }%
    \endgroup
  }
}

\newcommand<>\compass[3][]{%
  \draw#4[#1,ruler compass/compass={#2}{#3}];
}

\newcommand<>\ruler[3][]{%
  \draw#4[#1,ruler compass/ruler={#2}{#3}];
}

\newcommand<>\point[4][]{%
  \path#5 [name intersections={use=#2 and #3}] (intersection-#4) node[ruler compass/point,#1];
}

\else

\tikzset{
  alt if exist/.code args={#1#2#3}{%
    \pgfkeysalso{#2}%
  },
  onslide/.code args={<#1>#2}{%
    \pgfkeysalso{#2}%
  },
  intersection/save/.code={%
    \begingroup
    \tikz@intersect@path@names@parse#1\tikz@stop
    \protected@write\pgfutil@auxout{}{%
        \string\global\string\@namedef{path@\tikz@intersect@path@a}{\the\beamer@slideinframe}%
        \string\global\string\@namedef{path@\tikz@intersect@path@b}{\the\beamer@slideinframe}%
    }%
    \endgroup
  }
}

\newcommand\compass[2]{%
  \draw[ruler compass/compass={#1}{#2}];
}

\newcommand\ruler[2]{%
  \draw[ruler compass/ruler={#1}{#2}];
}

\newcommand\point[4][]{%
  \path [name intersections={use=#2 and #3}] (intersection-#4) node[ruler compass/point,#1];
}

\fi    

\tikzset{
  intersection/use/.style={%
    of=#1,
    save=#1,
  },
  circle through/.style={
    to path={
      \pgfextra{
        \tikz@scan@one@point\pgfutil@firstofone(\tikztostart)\relax
        \pgf@xa=\pgf@x
        \pgf@ya=\pgf@y
        \tikz@scan@one@point\pgfutil@firstofone(\tikztotarget)\relax
        \pgfmathsetmacro\rc@radius{veclen(\pgf@x - \pgf@xa,\pgf@y - \pgf@ya)}%
      }
      circle[radius=\rc@radius pt] (\tikztotarget)
    }
  },
  arc flip/.is if=
rc@fliparc,
  centred arc to/.code 2 args={%
    \tikz@scan@one@point\pgfutil@firstofone(#1)\relax
    \pgfmathsetmacro\rc@radius{veclen(\tikz@lastx-\pgf@x,\tikz@lasty-\pgf@y)}%
    \pgfmathsetmacro\rc@sangle{atan2(\tikz@lasty - \pgf@y,\tikz@lastx - \pgf@x)}%
    \pgf@xa=\pgf@x
    \pgf@ya=\pgf@y
    \tikz@scan@one@point\pgfutil@firstofone(#2)\relax
    \pgfmathsetmacro\rc@eangle{atan2(\pgf@y - \pgf@ya,\pgf@x - \pgf@xa)}%
    \pgfmathsetmacro\rc@eangle{\rc@eangle < \rc@sangle ? \rc@eangle +       360 : \rc@eangle}%
    \ifrc@fliparc
    \pgfmathsetmacro\rc@eangle{\rc@eangle - 360}%
    \fi
    \pgfkeysalso{start angle=\rc@sangle, end angle=\rc@eangle, radius=\rc@radius pt}
  },
  ruler compass/.is family,
  ruler compass/.cd,
  construction in use/.style={
    draw=blue
  },
  construction not in use/.style={
    draw=gray!75,
  },
  compass/.style 2 args={
    alt if exist={c-#1-#2}{
      ruler compass/construction in use/.try,
    }{
      ruler compass/construction not in use/.try
    },
    name path=c-#1-#2,
    ruler compass/every construction path/.try,
    ruler compass/every compass/.try,
    insert path={
      (#1) to[circle through] (#2)
      node[name=c-#1-#2-centre,ruler compass/aux point={#1}]
      node[name=c-#1-#2-rim,ruler compass/aux point={#2}]
    },
  },
  ruler/.style 2 args={
    overlay,
    alt if exist={r-#1-#2}{
      ruler compass/construction in use/.try
    }{
      ruler compass/construction not in use/.try
    },
    name path=r-#1-#2,
    ruler compass/every construction path/.try,
    ruler compass/every ruler/.try,
    insert path={
      ($(#1)!\pgfkeysvalueof{/tikz/ruler compass/ruler length}!(#2)$) -- ($(#2)!\pgfkeysvalueof{/tikz/ruler compass/ruler length}!(#1)$)
      node[name=r-#1-#2-start,ruler compass/aux point={#1}]
      node[name=r-#1-#2-end,ruler compass/aux point={#2}]
    },
  },
  ruler length/.initial=20,
  aux point/.style={
    circle,
    minimum width=4mm,
    onslide=<.|handout:0>{draw=red},
    node contents={},
    at={(#1)},
    ruler compass/every aux point/.try
  },
  point/.style={
    ruler compass/name it,
    coordinate,
    node contents={},
    ruler compass/every point/.try,
    insert path={
      node[
        fill=#1,
        circle,
        minimum width=1mm,
        inner sep=0mm,
        reset label anchor,
        anchor=center,
        node contents={}
        ]
    }
  },
  name it/.code={%
    \ifx\tikz@fig@name\pgfutil@empty
    \stepcounter{pointlabels}%
    \pgfkeysalso{name=\alphalph{\value{pointlabels}}}%
    \ifrc@draft
    \pgfkeysalso{label={[ruler compass/draft label/.try]\alphalph{\value{pointlabels}}}}%
    \fi
    \fi
  },
  point/.default=black,
}

\newcounter{jumping}
\resetcounteronoverlays{jumping}
\def\rc@scale{1}

\def\jump@setbb#1#2#3{%
  \@ifundefined{jump@#1@maxbb}{%
    \expandafter\gdef\csname jump@#1@maxbb\endcsname{#3}%
  }{%
    \csname jump@#1@maxbb\endcsname
    \pgf@xa=\pgf@x
    \pgf@ya=\pgf@y
    #3
    \pgfmathsetlength\pgf@x{max(\pgf@x,\pgf@xa)}%
    \pgfmathsetlength\pgf@y{max(\pgf@y,\pgf@ya)}%
    \expandafter\xdef\csname jump@#1@maxbb\endcsname{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
  }
  \@ifundefined{jump@#1@minbb}{%
    \expandafter\gdef\csname jump@#1@minbb\endcsname{#2}%
  }{%
    \csname jump@#1@minbb\endcsname
    \pgf@xa=\pgf@x
    \pgf@ya=\pgf@y
    #2
    \pgfmathsetlength\pgf@x{min(\pgf@x,\pgf@xa)}%
    \pgfmathsetlength\pgf@y{min(\pgf@y,\pgf@ya)}%
    \expandafter\xdef\csname jump@#1@minbb\endcsname{\noexpand\pgfpoint{\the\pgf@x}{\the\pgf@y}}%
  }
}

\tikzset{
  stop jumping/.style={
    execute at end picture={%
      \stepcounter{jumping}%
      \pgfmathsetlength\pgf@xa{\pgf@picminx/\rc@scale}%
      \pgfmathsetlength\pgf@ya{\pgf@picminy/\rc@scale}%
      \pgfmathsetlength\pgf@xb{\pgf@picmaxx/\rc@scale}%
      \pgfmathsetlength\pgf@yb{\pgf@picmaxy/\rc@scale}%
      \immediate\write\pgfutil@auxout{%
        \noexpand\jump@setbb{\the\value{jumping}}{\noexpand\pgfpoint{\the\pgf@xa}{\the\pgf@ya}}{\noexpand\pgfpoint{\the\pgf@xb}{\the\pgf@yb}}
      },
      \csname jump@\the\value{jumping}@maxbb\endcsname
      \path (\the\pgf@x,\the\pgf@y);
      \csname jump@\the\value{jumping}@minbb\endcsname
      \path (\the\pgf@x,\the\pgf@y);
    },
  },
  max size/.code 2 args={%
    \addtocounter{jumping}{1}%
    \pgfutil@ifundefined{jump@\the\value{jumping}@maxbb}{}{%
      \csname jump@\the\value{jumping}@maxbb\endcsname
      \pgf@xa=\pgf@x
      \pgf@ya=\pgf@y
      \csname jump@\the\value{jumping}@minbb\endcsname
      \advance\pgf@xa by -\pgf@x
      \advance\pgf@ya by -\pgf@y
      \pgfmathsetmacro\rc@xratio{\pgf@xa > #1 ? \pgf@xa/#1 : 1}%
      \pgfmathsetmacro\rc@yratio{\pgf@ya > #2 ? \pgf@ya/#2 : 1}%
      \pgfmathsetmacro\rc@scale{1/max(\rc@xratio,\rc@yratio)}%
      \pgfkeysalso{scale=\rc@scale}%
    }
    \addtocounter{jumping}{-1}%
  }
}

\tikzset{
  on layer/.code={
    \pgfonlayer{#1}\begingroup
    \aftergroup\endpgfonlayer
    \aftergroup\endgroup
  },
  node on layer/.code={
    \gdef\node@@on@layer{%
      \setbox\tikz@tempbox=\hbox\bgroup\pgfonlayer{#1}\unhbox\tikz@tempbox\endpgfonlayer\egroup}
    \aftergroup\node@on@layer
  },
  reset label anchor/.code={%
    \let\tikz@auto@anchor=\pgfutil@empty
    \def\tikz@anchor{#1}
  },
  reset label anchor/.default=center
}

\def\node@on@layer{\aftergroup\node@@on@layer}

\endinput
share|improve this answer
    
+1 as it can be used for Hanukkah as well :) –  Xoff Dec 10 '13 at 11:53
    
Very charming, but I'm getting an error: ./CompassRulerChristmasTree.tex:79: Package pgfkeys Error: I do not know the key '/tikz/node contents' and I am going to ignore it. Perhaps you misspelled it. I'm using MacTeX TeXLive 2013. –  sgmoye Dec 10 '13 at 12:28
    
Sometimes, with gifsicle -O3 anim.gif > anim_opt.gif one may get the file size optimized by factors up to 1000 and beyond. –  AlexG Dec 10 '13 at 12:31
    
@sgmoye I use the CVS version of PGF and the node contents is in there. The solution is a bit annoying, but doable: remove every node contents={} line and after every node[...] put an empty brace pair {}. –  Loop Space Dec 10 '13 at 12:57
    
@AlexG In the end, I made it into a proper video and uploaded it to YouTube: youtu.be/b83GoT62MHI –  Loop Space Dec 10 '13 at 12:59

Previous solutions don't really use the fact that the tree can be completely generated procedurally (I think this is what the OP originally intended):

And the picture will change every year! :)

Tree for 2012:

Fractal Christmas Tree

Tree for 2013:

Fractal Christmas Tree

Tree for 2014:

Fractal Christmas Tree

The solution added a new rule to the L-system, that collected some "good" points where decorations might be added. (good points are found on the main branches). From this list values are selected randomly, and baubles or lights are added to these points.

Code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc, lindenmayersystems,shapes,decorations,decorations.shapes}
\begin{document}

\def\pointlistleft{}
\def\pointlistright{}
\pgfmathsetseed{\year * 6}
\makeatletter
\pgfdeclarelindenmayersystem{Christmas tree}{
    \symbol{C}{\pgfgettransform{\t} \expandafter\g@addto@macro\expandafter\pointlistleft\expandafter{\expandafter{\t}}}
    \symbol{c}{\pgfgettransform{\t} \expandafter\g@addto@macro\expandafter\pointlistright\expandafter{\expandafter{\t}}}
    \rule{S -> [+++G][---g]TS}
    \rule{G -> +H[-G]CL}
    \rule{H -> -G[+H]CL}
    \rule{g -> +h[-g]cL}
    \rule{h -> -g[+h]cL}
    \rule{T -> TL}
    \rule{L -> [-FFF][+FFF]F}
}
\makeatother

\begin{tikzpicture}[rotate=90]
\draw [color=brown!50!black,line width=2.5pt] (0,0) -- (170pt,0);
\draw [color=green!50!black,l-system={Christmas tree,step=4pt,angle=16,axiom=LLLLLLSLFFF,order=10,randomize angle percent=20}] lindenmayer system -- cycle;

\pgfmathdeclarerandomlist{pointsleft}{\pointlistleft}
\pgfmathdeclarerandomlist{pointsright}{\pointlistright}
\pgfmathdeclarerandomlist{colors}{{red}{blue}{yellow}}

\foreach \i in {0,1,...,5}
{
    \pgfmathrandomitem{\c}{pointsleft}
    \pgfsettransform{\c}
    \pgfgettransformentries{\a}{\b}{\c}{\d}{\xx}{\yy}
    \pgfmathrandomitem{\c}{pointsright}
    \pgfsettransform{\c}
    \pgfgettransformentries{\a}{\b}{\c}{\d}{\XX}{\YY}
    \pgftransformreset

    \pgfmathsetmacro\calcy{min(\yy,\YY)-max((abs(\yy-\YY))/3,25pt)}

    \draw[draw=orange!50!black, fill=orange!50, decorate, decoration={shape backgrounds, shape=star, shape sep=3pt, shape size=4pt}, star points=5] (\xx,\yy) .. controls (\xx,\calcy pt) and (\XX,\calcy pt) .. (\XX,\YY);
}

\foreach \i in {0,1,...,15}
{
    \pgfmathrandomitem{\c}{pointsleft}
    \pgfsettransform{\c}
    \pgftransformresetnontranslations
    \draw[color=black] (0,0) -- (0,-4pt);
    \pgfmathrandomitem{\c}{colors}
    \shadedraw[ball color=\c] (0,-8pt) circle [radius=4pt];
}

\foreach \i in {0,1,...,15}
{
    \pgfmathrandomitem{\c}{pointsright}
    \pgfsettransform{\c}
    \pgftransformresetnontranslations
    \draw[color=black] (0,0) -- (0,-4pt);
    \pgfmathrandomitem{\c}{colors}
    \shadedraw[ball color=\c] (0,-8pt) circle [radius=4pt];
}

\end{tikzpicture}
\end{document}
share|improve this answer
{\let~\catcode~`A0 AgdefAs.#1.{Acsname#1Aendcsname}AdefAq#1#2#3#4#5#6#7#8#9{%#######################
AdefAy##1###1##3##4##5###3###2##8##9{AdefAw####1#####1####3####4####5#####3#####2####8####9{%#######
AdefAz########1#########1########3########4########5#########3#########2########8########9{Aegroup%#
As.d####9cum##5ntc#6##9ss.[11pt]{scr####4tc#6}%#####################################################
As.##3p##9c#4##9g##5.[dv##1psn##9m##5s#8svgn##9m##5s]{xc####9#6####9r}%#############################
As.##3p##9c#4##9g##5.{t##8z}As.##3t##8z#6ibr##9r#9.{%###############################################
sh##9p##5s#8########4##1####9ns.sh##9p##5s#8########4##1####9ns.#5r##9ct##9#6s#8%###################
########4##1####9ns.m####4#4##1ngs#8#########3####9ws}%#############################################
As.n##5ws##9v##5b####9x.{Amycd}%####################################################################
As.s##9v##5b####9x.{Amycd}{#####2###1{####1}[sc##9#6##5=.1]%########################################
Ashade[t####9p#####2c####9#6####9r=#9##5#6#6####9w#8b####9tt####9m#####2c####9#6####9r=r##5d]%######
#####2(####8#8####8###2#########1########1#####3#8.########8#####2########5#####2%##################
#####3#8####3###2#########1#####2(####8#8########8#########1########1#########21#8####3###2%########
#####2########5#####2#########21#8.########8#########1#####2(####8#8####8###2;%#####################
#7[#9##5#6#6####9w!9####8!b#6##9c#4]#####2(.8#8####8###2#####2r##5ct##9ng#6##5#####2%###############
#########2.8#8-5###2;%##############################################################################
###3{####1}#####2}As.t##8zs##5t.{p####5nt/.st#9#6##5={dr##9w=################1!5####8!b#6##9c#4%####
#8#####2#5##1#6#6=################1!5####8}#8%######################################################
m#9#####2st####4/.st#9#6##5={########4##5#8########4##1####9n={sh##9p##5#####2b##9c#4gr####9unds#8%#
sh##9p##5=st####4}#8st####4#####2p####9##1nts=################1}}%##################################
###1{d####9cum##5nt}%###############################################################################
###1{####1}[#####2b##9#6#6#####2r##5d/.st#9#6##5={%#################################################
########4##5#8#####2########4##1####9n={m####4#4##1ngs#8m####4#4=b##5tw##5##5n#####2%###############
p####9s##1t##1####9ns#####2.#1#####2########5#####21#####2st##5p#####23cm%##########################
w##1th#####2{As.pg##4hs##5tm##9cr####9.{Asz}{#1#####2+#####2####3#####2*#####2r########5}%##########
#####1[#########3##1ng=b##9#6#6#8b##9#6#6#####2c####9#6####9r=r##5d]#####2(####8#8####8###2#####2%##
c##1rc#6##5[r##9d##1us=Asz#####2mm];%###############################################################
}}}#####2#8b##9#6#6#####2b#6u##5/.st#9#6##5={########4##5#8########4##1####9n=%#####################
{m####4#4##1ngs#8m####4#4=b##5tw##5##5n#####2p####9s##1t##1####9ns#####2####8.1#####2########5%#####
#####2.9#####2st##5p#####23cm%######################################################################
w##1th#####2{As.pg##4hs##5tm##9cr####9.{Asz}{#1#####2+#####2####3#####2*#####2r########5}%##########
#####1[#########3##1ng=b##9#6#6#8b##9#6#6#####2c####9#6####9r=b#6u##5]#####2%#######################
(####8#8####8###2#####2c##1rc#6##5[r##9d##1us=Asz#####2mm];%########################################
}}}]Adraw[#5##1#6#6=M####4####9####9n#8u#6tr##9#####2th##1c#4]%#####################################
(.#25#8-1###2#####2########3#####2########1(####3#8####3###2#####2########5#####2(%#################
####3#83###2#####2########3#####2(####8####3#84###2%################################################
--#####2#########2####8####3#84###2#####2########3#####2########1#########2####3#83###2#####2%######
########5#####2#########2####3#8####3###2#####2########3#####2#########2.#25#8-1###2#####2;%########
Ashade[u#6tr##9#####2th##1c#4#8#####2t####9p#####2c####9#6####9r=gr##5##5n!9####8!b#6##9c#4#8%######
b####9tt####9m#####2c####9#6####9r=gr##5##5n!1####8!b#6##9c#4]%#####################################
(####8#81####8###2#####2########3########1#####2(####8#88###2#####2########5#####2#####3########9%##
#####2########3#####2#####3####3########9%##########################################################
########3#####2########1#####3########9#####2########5#####2#####3########9#####2########3#####2(%##
####8####3#8#2.#15###2%#############################################################################
########3#####2########1#####3####3#85###2#####2########5#####2(#1####3#84###2#####2########3#####2%
(3#84###2%##########################################################################################
########3#####2########1(#1#84###2#####2########5#####2#####3.#15#84###2#####2########3#####2%######
#####3#84####3###2%#################################################################################
########3#####2########1(#1#8########8#####2########5#####2(3####3#8########8#####2########3#####2(%
4#8########8%#######################################################################################
########3#####2########1#####3#81###2#####2########5#####2#########21#81###2#####2########3#####2%##
#########24#8########8%#############################################################################
########3#####2########1#########23####3#8########8#####2########5#####2#########2#1#8########8%####
#####2########3#####2#########21#84####3###2%#######################################################
########3#####2########1#########21.#15#84###2#####2########5#####2#########2#1#84###2#####2%#######
########3#####2#########23#84###2%##################################################################
########3#####2########1#########2#1####3#84###2#####2########5#####2#########21####3#85###2#####2%#
########3#####2#########2####8####3#8#2.#15###2%####################################################
########3#####2########1#####2#########21########9#####2########5#####2#########21########9#####2%##
########3#####2#########21####3########9%###########################################################
########3#####2########1#####2#########21########9#####2########5#####2(####8#88###2#####2########3%
#####2(####8#81####8###2;%##########################################################################
As.#5####9r##5##9ch.#####2Acd#####2##1n#####2{(#1#85###2#8#########2#1#85###2#8(####8####3#8#2####3%
###2#8#########2####8####3#8#2####3###2#8#########23#8#1####3###2#8#####2(3#8#1####3###2#8%#########
#####3####3#81.#25###2#8#########21####3#81.#25###2}%###############################################
Anode#####2##9t#####2Acd#####2{As.##3b####9x.{Amycd}}#####2;%#######################################
Anode#####2[st####4#8#####2st####4#####2p####9##1nt#####2h##5##1ght=####3cm#8#####2m##1n##1mum%#####
#####2s##1z##5=####3cm#8dr##9w#8#5##1#6#6=#9##5#6#6####9w#8th##1c#4]%###############################
##9t#####2(####8#81####8###2#####2{};###1{sc####9p##5}[########4##1####9n={sh##9p##5#####2s##5p=.#1%
cm#8#####2sh##9p##5#####2s##1z##5=.#15cm}]%#########################################################
Adraw#####2[m#9#####2st####4=#3#8#####2p####5nt=r##5d]#####2#########24#8########8%#################
########3#####2########1(####8#8########8#####2########5#####2#####3#83####3###2#####2########3%####
#####2#####3#84.4####8###2;%########################################################################
Adraw#####2[m#9#####2st####4=#3#8#####2p####5nt=r##5d]#####2#########21####3#85.4####8###2%#########
########3#####2########1(####8#85.4####8###2#####2########5#####2(####8####3#8#3####3###2#####2%####
########3#####2(####8####3########9;%###############################################################
Adraw#####2[m#9#####2st####4=#3#8#####2p####5nt=b#6u##5]#####2(4#8########8%########################
########3#####2########1#####2(####8#8########8#####2########5#####2#########21#83####3###2#####2%##
########3#####2#########21#84.4####8###2;%##########################################################
Adraw#####2[m#9#####2st####4=#3#8#####2p####5nt=b#6u##5]#####2#####3####3#85.4####8###2%############
########3#####2########1(####8#85.4####8###2#####2########5#####2#########2####8####3#8#3####3###2%#
#####2########3#####2#########2####8####3########9;%################################################
###3{sc####9p##5}#####1[b##9#6#6#####2r##5d](####8#81####8###2#####2########3########1#####2(####8%#
#88###2#####2########5#####2#####3########9#####2########3#####2#####3####3########9%###############
########3#####2########1#####3########9#####2########5#####2#####3########9#####2########3#####2(%##
####8####3#8#2.#15###2%#############################################################################
########3#####2########1#####3####3#85###2#####2########5#####2(#1####3#84###2#####2########3#####2%
(3#84###2%##########################################################################################
########3#####2########1(#1#84###2#####2########5#####2#####3.#15#84###2#####2########3#####2#####3%
#84####3###2%#######################################################################################
########3#####2########1(#1#8########8#####2########5#####2(3####3#8########8#####2########3#####2(%
4#8########8%#######################################################################################
########3#####2########1#####3#81###2#####2########5#####2#########21#81###2#####2########3#####2%##
#########24#8########8%#############################################################################
########3#####2########1#########23####3#8########8#####2########5#####2#########2#1#8########8%####
#####2########3#####2#########21#84####3###2%#######################################################
########3#####2########1#########21.#15#84###2#####2########5#####2#########2#1#84###2#####2%#######
########3#####2#########23#84###2%##################################################################
########3#####2########1#########2#1####3#84###2#####2########5#####2#########21####3#85###2#####2%#
########3#####2#########2####8####3#8#2.#15###2%####################################################
########3#####2########1#####2#########21########9#####2########5#####2#########21########9#####2%##
########3#####2#########21####3########9%###########################################################
########3#####2########1#####2#########21########9#####2########5#####2(####8#88###2#####2########3%
#####2(####8#81####8###2;%##########################################################################
#####1[b##9#6#6#####2b#6u##5](####8#81####8###2#####2########3########1#####2(####8#88###2#####2%###
########5#####2#####3########9#####2########3#####2#####3####3########9%############################
########3#####2########1#####3########9#####2########5#####2#####3########9#####2########3#####2(%##
####8####3#8#2.#15###2%#############################################################################
########3#####2########1#####3####3#85###2#####2########5#####2(#1####3#84###2#####2########3#####2%
(3#84###2%##########################################################################################
########3#####2########1(#1#84###2#####2########5#####2#####3.#15#84###2#####2########3#####2#####3%
#84####3###2%#######################################################################################
########3#####2########1(#1#8########8#####2########5#####2(3####3#8########8#####2########3#####2(%
4#8########8%#######################################################################################
########3#####2########1#####3#81###2#####2########5#####2#########21#81###2#####2########3#####2%##
#########24#8########8%#############################################################################
########3#####2########1#########23####3#8########8#####2########5#####2#########2#1#8########8%####
#####2########3#####2#########21#84####3###2%#######################################################
########3#####2########1#########21.#15#84###2#####2########5#####2#########2#1#84###2#####2%#######
########3#####2#########23#84###2%##################################################################
########3#####2########1#########2#1####3#84###2#####2########5#####2#########21####3#85###2#####2%#
########3#####2#########2####8####3#8#2.#15###2%####################################################
########3#####2########1#####2#########21########9#####2########5#####2#########21########9#####2%##
########3#####2#########21####3########9%###########################################################
########3#####2########1#####2#########21########9#####2########5#####2(####8#88###2#####2########3%
#####2(####8#81####8###2;%##########################################################################
As.#5####9r##5##9ch.#####2Ai#####2##1n#####2{####8####3#8####8.#3#8########3.#81.#3}%###############
#7#####2[wh##1t##5!8####8!b#6u##5#8########4##1####9n=K####9ch#####2sn####9w#5#6##9#4##5#8####9p%###
##9c##1t#9=.9]%#####################################################################################
[sh##1#5t={(r########5*5#8rnd*8###2}#8sc##9#6##5=Ai]%###############################################
[d####9ub#6##5#####2c####9p#9#####2#########3####9w={####9p##9c##1t#9=####8.#1#8#########3####9w%###
#####2xsh##1#5t=####8pt#8%##########################################################################
#########3####9w#####2#9sh##1#5t=3*Ai#####2pt#8#5##1#6#6=wh##1t##5#8dr##9w=n####9n##5}]%############
########4##5#####2{########4##5#####2{########4##5#####2{(####8#8####8###2#####2--#####2++(#3####8:%
1###2#####2--#####2++#########2#3####8:1###2#####2--#####2c#9c#6##5%################################
}}};###3{####1}###3{d####9cum##5nt}}Az{#####2c####9ntr####9#6s#####2}{#####2..}{..}{d##5c####9r##9t%
}{##9nd}{sh##9d}{(-}{#1###2}{#8#2###2}}Aw{t##8zp##1ctur##5}Apath{.5}{##9r}{##9##1}{(1}{ }0o}%#######
Ay iAbegin{use}{#5mat}eAend){i#4}a}Aq276kflAfill,y%#################################################
share|improve this answer
21  
Looks like a duplicate :) –  topskip Oct 26 '12 at 9:28
14  
Awesome!!I plan to use this as a showcase as to how easy TeX is to use... –  Peter Grill Oct 26 '12 at 16:21
17  
If you look at this code without blinking for 5 minutes, you start to see a christmas tree. :) –  Paulo Cereda Oct 27 '12 at 20:57
3  
Some code is just so transparently obvious that additional documentation is clearly unnecessary. –  David Carlisle Oct 27 '12 at 21:01
3  
save it as tree.tex and pdflatex tree –  David Carlisle Oct 27 '12 at 22:34
up vote 36 down vote
+100

Here's an invisible tree.

\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\pagecolor{black}
\usetikzlibrary{shapes.geometric,decorations}
\pgfmathdeclarerandomlist{colors}{{red}{yellow}{pink}{green}{orange}{purple}{blue}{white}}

\newcommand\drawstar[1][]{%
  \pgfmathsetmacro\s{rnd*2+2}
    \pgfmathsetmacro\t{rnd*.5cm+0.5cm}
    \pgfmathsetmacro\y{rand*0.125cm}
    \pgfmathsetmacro\r{rand*180}
    \pgfmathrandomitem{\c}{colors}
    \node [star, fill=\c, star point ratio=\s, rotate=\r, minimum size=\t, inner sep=0pt, every star/.try, #1] at (0cm,\y pt) {};
}
\pgfdeclaredecoration{stars}{start}{
  \state{start}[width=rnd*.5cm+.25cm]{\drawstar}
  \state{final}{\drawstar}
}

\begin{document}

\begin{tikzpicture}[line cap=round, x=1cm,y=1cm,]

\draw [every star/.style={opacity=0.125}, decoration=stars, decorate] 
  \foreach \i in {0,...,5}{ 
 plot [domain=\i*360:\i*360+180, samples=100] (\x/300*cos \x, -\x/150+\x/900*sin \x) };


\draw [every star/.style={opacity=0.5}, decoration=stars, decorate] 
\foreach \i in {0,...,5}{ 
  plot [domain=\i*360+180:\i*360+360, samples=100] (\x/300*cos \x, -\x/150+\x/900*sin \x) };

\drawstar[fill=yellow, minimum size=1.5cm]

\end{tikzpicture}

\end{document}

enter image description here

And another:

\documentclass[tikz, border=0.25cm]{standalone}
\usepackage{tikz}
\pagecolor{black}
\usetikzlibrary{decorations.pathreplacing}
\makeatletter
\newcount\tikzjointhedotsnumber


\pgfdeclaredecoration{join the dots}{initial}{%
  \state{initial}[width=0pt, next state=do dots, persistent precomputation={\global\tikzjointhedotsnumber=1}]{}
  %
  \state{do dots}[width=\pgfdecoratedinputsegmentlength, persistent postcomputation={\global\advance\tikzjointhedotsnumber by1}]{%
    \pgfcoordinate{@dot-\the\tikzjointhedotsnumber}{\pgfpointorigin}%
  }
  %
  \state{final}{%
    % Is the last point the same as the first?
      \pgfpointdiff{\pgfpointdecoratedpathlast}{\pgfpointdecoratedpathfirst}%
      \pgfmathveclen{\the\pgf@x}{\the\pgf@y}%
      \ifdim\pgfmathresult pt=0pt\relax%
        \global\advance\tikzjointhedotsnumber by-1\relax
      \else
        \pgftransformshift{\pgfpointdecoratedpathlast}%
        \pgfcoordinate{@dot-\the\tikzjointhedotsnumber}{\pgfpointorigin}%
      \fi
      % Ok, now we do everything. Draw the dots and place the numbers.
      %
      \c@pgf@counta=\tikzjointhedotsnumber%
      \c@pgf@countb=2\relax%
      \edef\lastdot{\the\tikzjointhedotsnumber}%
      \def\nextdot{2}%
      \pgftransformreset%
      \pgfmathloop%
      \ifnum\pgfmathcounter>\tikzjointhedotsnumber
      \else%
        % Draw the dot.
        \edef\tmp{\the\tikzjointhedotsnumber}%
                \tikzjointhedotsnumber=\pgfmathcounter\relax%
        \path [shift={(@dot-\pgfmathcounter)}, every dot/.try, dot \pgfmathcounter/.try]; 
         \tikzjointhedotsnumber=\tmp% 
        %
        % Calculate the dot number node anchor
        \pgfmathanglebetweenpoints{\pgfpointanchor{@dot-\pgfmathcounter}{center}}{\pgfpointanchor{@dot-\the\c@pgf@counta}{center}}%
        \pgf@xc=\pgfmathresult pt\relax%
        \ifdim0pt>\pgf@xc%
          \advance\pgf@xc by360pt\relax%
        \fi%
        \pgfmathanglebetweenpoints{\pgfpointanchor{@dot-\pgfmathcounter}{center}}{\pgfpointanchor{@dot-\the\c@pgf@countb}{center}}%
        \pgf@yc=\pgfmathresult pt\relax%
        \ifdim0pt>\pgf@yc%
          \advance\pgf@yc by360pt\relax%
        \fi%
        \ifdim\pgf@xc>\pgf@yc%
          \pgf@x=360pt\relax%
        \else%
          \pgf@x=0pt\relax%
        \fi%
        \advance\pgf@x by-\pgf@xc%
        \advance\pgf@x by\pgf@yc%
        \divide\pgf@x by2\relax%
        \advance\pgf@x by\pgf@xc%
        \advance\pgf@x by180pt\relax%
        \edef\dotnumberanchor{\the\pgf@x}%
        \node [anchor=\dotnumberanchor, every dot number/.try, dot number \pgfmathcounter/.try] 
          at (@dot-\pgfmathcounter)
          {\tikzjointhedotsnumber=\pgfmathcounter\relax\tikzjointhedotstypesetnumber{\tikzjointhedotsnumber}};
        \c@pgf@counta=\pgfmathcounter\relax%
            \advance\c@pgf@countb by1\relax%
            \ifnum\c@pgf@countb>\tikzjointhedotsnumber%
              \c@pgf@countb=1\relax%
            \fi%
        \repeatpgfmathloop%
  }
}

% Command for typesetting dot number
% #1 - a count register holding the current dot number
%
\def\tikzjointhedotstypesetnumber#1{\the#1}
\makeatletter
% Keys for setting dot number styles
\tikzset{%
  syle dot number range/.code args={#1 to #2 with #3}{%
    \c@pgf@counta=#1
    \pgfmathloop
    \ifnum\c@pgf@counta>#2\relax%
    \else%
      \tikzset{dot number \the\c@pgf@counta/.style={#3}}%
      \advance\c@pgf@counta by1
    \repeatpgfmathloop%
  },
    style dot number list/.code args={#1 with #2}{%
      \pgfutil@for\tmp:=#1\do{%
        \tikzset{dot number \tmp/.style={#2}}%
      }%
    }
}
\makeatother

\tikzset{%
  % Executed for every dot
  every dot/.style={fill=white,
    insert path={  circle [radius=1mm] coordinate [alias=dot-last] (dot-\the\tikzjointhedotsnumber)  }
  },
  % Executed for every dot number
  every dot number/.style={
   shape=circle,
   font=\sf,
   scale=2,
   text=white
  },
  join the dots/.style={
    decoration=join the dots, decorate
  },
  lines/.style={
    ultra thick,
    line join=round,
    line cap=round
  },
  crayon/.style={
    draw=#1,
    line join=round,
    line cap=round,
    line width=1mm
  },
  sketch/.style={
    bend right, out=rand*10, in=180-rand*10
  }
}

\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\begin{document}

\foreach \n in {1,...,40}{
\begin{tikzpicture}[line cap=round]



\draw [decoration=join the dots, decorate,x=10cm,y=10cm,
  dot number 16/.style={anchor=south},
  dot number 25/.style={anchor=south},
  dot 1/.style={fill=black}, dot number 1/.append style={text=black, anchor=south east},
  dot 40/.style={fill=black}, dot number 40/.append style={text=black, anchor=south west}] 
 (0,0) \foreach \i in {1,...,3} { -- ++(-1/8,-1/3) -- ++(-1/4,-1/3) -- ++(-3/8,-1/3) -- ++(\i/6,0) -- ++(\i/6,1/16) }
 -- ++(1/8,0)
 -- ++(0,-1/4)  -- ++(-1/2,0) -- ++(1/4,-1/2)  -- ++(6/8,0) -- ++(1/4, 1/2) -- ++(-1/2,0) -- ++(0,1/4)
 -- ++(1/8,0)
 \foreach \i in {3,...,1} { -- ++(\i/6,-1/16) -- ++(\i/6,0) -- ++(-3/8,1/3) -- ++(-1/4,1/3) -- ++(-1/8,1/3) };

\begin{pgfonlayer}{background}

\foreach \d in {4,9,14,27,32,37}{% 
  \tikzset{shift=(dot-\d), yshift=1pt}%
  \pgfmathsetseed{99+\d*50}%
  % Candle
  \fill [lines, fill=purple!80, rounded corners=0.125cm]
    (-1/3,0) to [sketch] (-1/3,2) -- (1/3,2)  to [sketch] (1/3,0);
  % Wick
  \draw [lines] (0,2) -- ++(0,1/4);
    \pgfmathsetseed{99+\n*50+\d*25}%
  \tikzset{shift={(0,2+1/8)}, xscale=round(rnd)*2-1,yscale=1+rand/8}
  \foreach \s/\c in {1/yellow,.5/red}
    \path [lines, fill=\c!50!orange, scale=\s]  
      (0,0) 
      arc (270:180:3/8) 
      .. controls ++(0,1/4) and ++(0,-1/4) .. (0,3/2)
      arc (90:0:3/8 and 1) arc (360:270:3/8 and 1/2);
} 

\path [fill=yellow!75!white, shift=(dot-1), rotate=22.5] (0:1.25)
  \foreach \i [evaluate={\j=mod(\i,2); \k=mod(\i+1,4)==0; \r=\j+1.25+\k+(\i==11);}] in {0,...,15}{
    -- (\i*22.5:\r)
  } -- cycle;
\end{pgfonlayer}

\pgfmathsetseed{99}
\draw [crayon=green!50!black, line width=1cm/8, sketch]
  (dot-1) \foreach \m in {1,...,\n}{ to [sketch] (dot-\m) };

\end{tikzpicture}
}
\end{document}

enter image description here

share|improve this answer
    
I get ! Package tikz Error: Giving up on this path. Did you forget a semicolon?. on line 26 of the first code? –  fuenfundachtzig Dec 20 '13 at 9:37
    
I don't know why that would be. It works for me although I am using the latest CVS version. –  Mark Wibrow Dec 20 '13 at 12:15
    
I could make it work with a few changes. In any case +1 and Merry Xmas :) –  fuenfundachtzig Dec 20 '13 at 13:31

I have learned a couple of new things in TikZ and created an own minimalistic version loosely based on Altermundus' first creation (and a beautiful one it is). Hopefully he does not mind. Merry Christmas to all of you!

\documentclass[border=2mm]{standalone}
\usepackage[dvipsnames]{xcolor}  
\usepackage{tikz}
\usetikzlibrary{shapes,decorations.shapes}
\newsavebox{\ball}
\savebox{\ball}{ 
\begin{tikzpicture}[scale=.1]
\draw (0,0) -- (0, 5);
\shadedraw[ball color=red] (0,0) circle (60pt);
\end{tikzpicture}
} 
\begin{document}
\begin{tikzpicture} 
   \draw[fill=RawSienna] 
   (-.5,-1)  -- (.5,-1) -- (.5,4) -- (-.5,4) -- (-.5,-1) ;
\draw[fill=green!50!black] 
(-3.5,2) -- (3.5, 2) -- (1.5,4) -- (3, 4) -- (1, 6) -- (2, 6) -- (0,9) -- (-2,6) -- (-1,6) -- (-3,4) -- (-1.5,4) -- (-3.5,2);
\foreach\deco in {(1.5,5.65),(-1.5,5.65),(0.75,7.5),(-0.75,7.5),(-2,3.65), (2,3.65), (2.6,1.65),(-2.6,1.65)}
\node at \deco {\usebox{\ball}} ; 
 \node [star, star point height=.3cm, minimum size=1.2cm, draw,fill=yellow] at (0,9.1) {};
\end{tikzpicture}
\end{document}

Christmas tree.

share|improve this answer

Merry Christmast everyone!

animation

\documentclass{beamer}
\usepackage{graphicx}
\usepackage{tikz}
\usetikzlibrary{shapes.geometric}

\usepackage{animate}
\usepackage{hyperref}
\hypersetup{pdfpagemode=FullScreen}
\usepackage{ifthen}
\newcounter{mycount}
\setcounter{mycount}{0}

\begin{document}

\begin{frame}[fragile]{}
\begin{center}
\resizebox{5cm}{!}{%
    \begin{animateinline}[loop, poster = first,controls]{10}
    \whiledo{\themycount<10}{
        \begin{tikzpicture}[ballstyle/.style={circle,draw=blue!50,fill=\c,thick, minimum size=6mm}]
             \pgfmathdeclarerandomlist{color}{{red}{blue}{yellow}{white}{purple}}
             \pgfmathrandomitem{\c}{color}
             \foreach\ycoord in {-3,0,3}{
                \draw[fill=green,draw=green] (-3,\ycoord)--(3,\ycoord)--(0,\ycoord+3)--cycle;
                \node at (3,\ycoord) [ballstyle] {};
                \node at (-3,\ycoord) [ballstyle] {};}
             \node at (0,6) [star,fill =yellow,minimum size=2cm] {};
             \draw[fill=brown,draw=black] (-1,-3)--(1,-3)--(1,-5)--(-1,-5)--cycle;
        \end{tikzpicture}
        \stepcounter{mycount}
        \ifthenelse{\themycount<10}{
                \newframe
        }{
                \end{animateinline}
        }
        }
    }
\end{center}
\end{frame}

\end{document}
share|improve this answer
2  
For slightly more realistic trees you could use the one here: tex.stackexchange.com/a/34676/2693 –  Alan Munn Dec 24 '11 at 18:36
    
@AlanMunn Thanks, I was looking for that post! I was mainly concentrating on the animation. –  cmhughes Dec 24 '11 at 18:40

We are still within the 12 days of Christmas and the wise men have not yet arrived bearing gifts, so I trust that I do not arrive too late.

I wondered...

If we have trees, why not a forest?

There is, of course, no reason whatsoever to draw a Christmas tree using forest....

Nadolig Llawen!

\PassOptionsToPackage{rgb,x11names,svgnames}{xcolor}
\documentclass[tikz, border=5pt]{standalone}
\usepackage{forest}
\usetikzlibrary{shapes.geometric,backgrounds,shadows,fit,fadings,calc}
\newcounter{tiercount}
\setcounter{tiercount}{1}
\pgfdeclarelayer{foreground}
\pgfdeclarelayer{boncyff}
\pgfdeclarelayer{canghennau}
\pgfdeclarelayer{goleuni}
\pgfsetlayers{background,canghennau,boncyff,goleuni,main,foreground}
\makeatletter
% adapted (simplified version) from tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
  \tikzset{%
    on foreground layer/.style={%
          execute at begin scope={%
            \pgfonlayer{foreground}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on foreground layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    on canghennau layer/.style={
          execute at begin scope={%
            \pgfonlayer{canghennau}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on canghennau layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    on boncyff layer/.style={
          execute at begin scope={%
            \pgfonlayer{boncyff}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on boncyff layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    on goleuni layer/.style={
          execute at begin scope={%
            \pgfonlayer{goleuni}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on goleuni layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    aa/.store in=\cfr@aa,
    aa=0,
    pics/anrheg/.style n args={2}{
      code={
        \node (-bocs) [anchor=north, rounded corners=2pt, outer sep=0pt, minimum width=5mm, minimum height=5mm, fill=#1, rotate=\cfr@aa] {};
        \path [fill=#2, draw=#2, rotate=\cfr@aa]
          ([xshift=-.5mm]-bocs.south)
            [out=80, in=-105] to ([xshift=.5mm]-bocs.north)
            [out=175, in=5] to ([xshift=-.5mm]-bocs.north)
            [out=-85, in=100] to ([xshift=.5mm]-bocs.south)
            [out=-175, in=-5] to cycle;
        \path [fill=#2, draw=#2, rotate=\cfr@aa]
          ([yshift=.5mm]-bocs.west)
            [out=-10, in=-175] to ([yshift=-.5mm]-bocs.east)
            [out=85, in=-85] to ([yshift=.5mm]-bocs.east)
            [out=-175, in=-10] to ([yshift=-.5mm]-bocs.west)
            [out=95, in=-95] to cycle;
      },
    },
  }
\makeatother
\newcounter{nodesygoeden}
\setcounter{nodesygoeden}{0}
\tikzfading[
  name=disglair,
  inner color=transparent!0,
  outer color=transparent!100]
\colorlet{lliw1}{Crimson}
\colorlet{lliw2}{DeepPink}
\colorlet{lliw3}{Violet}
\colorlet{lliw4}{Purple3}
\colorlet{lliw5}{Cyan}
\colorlet{lliw6}{Green1}
\colorlet{lliw7}{Gold}
\colorlet{lliw8}{Aquamarine1}
\colorlet{lliw0}{OrangeRed1}
\colorlet{lliwanrheg1a}{WildStrawberry}
\colorlet{lliwanrheg1b}{Ivory}
\colorlet{lliwanrheg2a}{Red1}
\colorlet{lliwanrheg2b}{Yellow1}
\colorlet{lliwanrheg3a}{Turquoise2}
\colorlet{lliwanrheg3b}{WildStrawberry}
\colorlet{lliwanrheg4a}{Yellow1}
\colorlet{lliwanrheg4b}{DodgerBlue3}
\colorlet{lliwanrheg5a}{Ivory}
\colorlet{lliwanrheg5b}{Turquoise2}
\colorlet{lliwanrheg0a}{DodgerBlue3}
\colorlet{lliwanrheg0b}{Red1}
\begin{document}
  \forestset{
    % canghennau
    cangen chwith/.style={
      edge path={
        \noexpand\scoped[on canghennau layer]{
          \noexpand\path [draw=ForestGreen, thick, \forestoption{edge}]
            (!u.parent anchor) +(0,20pt) [out=-90, in=150] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,15pt) [out=-90, in=150] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,10pt) [out=-90, in=150] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,5pt) [out=-90, in=150] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) [out=-90, in=150] to (.child anchor)\forestoption{edge label};
        }
      },
    },
    cangen dde/.style={
      edge path={
        \noexpand\scoped[on canghennau layer]{
          \noexpand\path [draw=ForestGreen, thick, \forestoption{edge}]
            (!u.parent anchor) +(0,20pt) [out=-90, in=30] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,15pt) [out=-90, in=30] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,10pt) [out=-90, in=30] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) +(0,5pt) [out=-90, in=30] to (.child anchor)\forestoption{edge label}
            (!u.parent anchor) [out=-90, in=30] to (.child anchor)\forestoption{edge label};
        }
      },
    },
    creu plant/.style={
      repeat=#1{
        prepend={[, bud, cangen chwith]},
        append={[, bud, cangen dde]},
      },
    },
    plant/.style={
      before typesetting nodes={
        creu plant=#1,
      },
    },
    boncyff/.style={
      edge path={
        \noexpand\scoped[on boncyff layer]{
          \noexpand\path [line cap=round, line width=2.5pt, draw=Chocolate4, \forestoption{edge}] (!u.parent anchor) -- (.child anchor)\forestoption{edge label};
        }
      },
    },
    seren/.style={
      star, minimum size=25pt, star points=7, star point ratio=3, parent anchor=south, outer sep=2pt, inner color=white, outer color=Gold1, draw=Goldenrod1, inner color=white, outer color=Silver, draw=Snow3, tikz={\scoped[on goleuni layer]\node (sglein) [minimum width=50pt, circle, inner color=white, outer color=Silver, path fading=disglair] {};}
    },
    enw/.style={
      enwi,
      name={n\thenodesygoeden},
    },
    enwi/.code={
      \stepcounter{nodesygoeden}
    },
    anrheg/.style={
      no edge, enw, anchor=north
    },
  }
  \begin{forest}
    bud/.style={
      inner sep=0pt,
      outer sep=0pt,
      parent anchor=center,
      child anchor=center,
      enw,
    },
    gwag/.style={
      inner sep=0pt,
      outer sep=0pt,
      parent anchor=center,
      child anchor=center,
      no edge,
    },
    for tree={
      if level=0{
      }{
        bud,
      },
      boncyff,
      if n=1{
        TeX={\stepcounter{tiercount}},
      }{},
      s sep+=7.5,
      before computing xy={
        l=4*\value{tiercount},
      },
      before typesetting nodes={
        if n children=0{
          append={
            [, bud, boncyff
              [, bud, l=2pt, boncyff
                [, anrheg, name=troed, before computing xy={l=0pt}
                ]
              ]
            ]
          },
          delay={
            for children={
              if={
                equal(n(),(n_children("!u")+1)/2)
              }{}{
                append={
                  [, gwag, l=2pt
                    [, anrheg, before computing xy={l=7.5pt}
                    ]
                  ]
                },
              },
            },
          },
        }{},
      },
    },
    [, seren, plant=1
      [, plant=2
        [, plant=3
          [, plant=4
            [, plant=5
              [, plant=6
              ]
            ]
          ]
        ]
      ]
    ]
    \foreach \i  in {1,...,50}
      {
        \ifnum\i=29\relax\else\ifnum\i=28\relax\else
          \pgfmathsetmacro{\result}{int(mod(\i,9))}
          \node [circle, ball color=lliw\result] at (n\i) {};
          \scoped[on goleuni layer] \node [circle, minimum width=20pt, inner color=lliw\result!50!white, outer color=lliw\result!50!Silver, path fading=disglair] at (n\i) {};
        \fi\fi
      }
    \foreach \i in {51,...,62}
      {
        \tikzset{aa=0}
        \pgfmathsetmacro{\result}{int(mod(\i,6))}
        \pgfmathsetmacro{\casgliad}{int(mod(4+\i,6))}
        \pgfmathsetmacro{\nesaf}{int(1+\i)}
        \ifnum\i>56
          \pic at (n\i) {anrheg={lliwanrheg\result a}{lliwanrheg\result b}};
        \else
          \pic at (n\i) {anrheg={lliwanrheg\result b}{lliwanrheg\result a}};
        \fi
        \tikzset{aa=45}
        \ifnum\i<56
            \pic at ([yshift=3.85mm,xshift=.25pt]$(n\i)!1/4!(n\nesaf)$) {anrheg={lliwanrheg\casgliad a}{lliwanrheg\casgliad b}};
        \fi
        \tikzset{aa=-45}
        \ifnum\i>56
          \ifnum\i<62
            \pic at ([yshift=3.85mm,xshift=-.25pt]$(n\i)!3/4!(n\nesaf)$) {anrheg={lliwanrheg\casgliad b}{lliwanrheg\casgliad a}};
          \fi
        \fi
      }
    \path
      (n29) ++(0,-1.5mm) coordinate (c0)
      (c0) arc (-90:0:5mm and 2.5mm) coordinate (c1)
      (c0) arc (-90:-180:5mm and 2.5mm) coordinate (c2)
      (c0) +(2.5mm,-4.5mm) coordinate (c3)
      (c0) +(-2.5mm,-4.5mm) coordinate (c4)
      (c1) +(0,-2mm) coordinate (c5)
      (c2) +(0,-2mm) coordinate (c6)
      ;
    \path [fill=Sienna1] (c2) arc (-180:0:5mm and 2.5mm) -- (c5) -- (c3) arc (0:-180:2.5mm and 1.25mm) -- (c6) -- cycle;
    \begin{scope}
      \clip (c2) arc (-180:0:5mm and 2.5mm) -- (c5) -- (c3) arc (0:-180:2.5mm and 1.25mm) coordinate [midway] (c7) -- (c6) -- cycle;
      \path [draw=Sienna3] (c6) arc (-180:0:5mm and 2.5mm);
      \path [draw=Sienna3] (c2) arc (-180:0:5mm and 2.5mm);
    \end{scope}
    \begin{scope}[on canghennau layer]
      \path [fill=Sienna1, draw=Sienna3] (c2) arc (-180:180:5mm and 2.5mm);
      \path [fill=Brown!50!black] (n29 |- c2) circle (4mm and 2mm);
    \end{scope}
    \scoped[on background layer] \node [fill=MidnightBlue, inner sep=15pt, fit=(sglein) (troed) (n21) (n35) (c7) (n51) (n62)] {};
%   \foreach \i in {1,...,62} \node (anrheg \i) [red] at (n\i) {\i};
  \end{forest}
\end{document}

coeden nadolig

Forgot the cat...

My cat has decided that under the Christmas tree is the place to be now most of the presents have been distributed. I thought my forest tree needed a cat but there is no room under the tree here, so this cat has decided to keep guard from above...

The cat is just a TiKZ pic compiled with standalone as a separate image (see below). Here the cat is simply included as an external image and scaled for the sake of simplicity:

\node (cath) [scale=.15, anchor=south, yshift=4.5mm, xshift=5mm] at (n34.north) {\includegraphics{cath-gorwedd}};

coeden nadolig gyda chath

Appendix: Cat Code

[If anybody spots what is messing up the bounding box, please let me know!]

\pdfminorversion=7
\RequirePackage[rgb,pdftex,dvipsnames,x11names]{xcolor}
\documentclass[tikz,border=5pt]{standalone}
\usetikzlibrary{calc,intersections,backgrounds}
\pgfdeclarelayer{foreground}
\pgfdeclarelayer{pen}
\pgfdeclarelayer{corff}
\pgfsetlayers{background,corff,main,pen,foreground}
\makeatletter
% adapted (simplified version) from tex/generic/pgf/frontendlayer/tikz/libraries/tikzlibrarybackgrounds.code.tex
  \tikzset{%
    on foreground layer/.style={%
          execute at begin scope={%
            \pgfonlayer{foreground}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on foreground layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    on pen layer/.style={
          execute at begin scope={%
            \pgfonlayer{pen}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on pen layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    on corff layer/.style={
          execute at begin scope={%
            \pgfonlayer{corff}%
            \let\tikz@options=\pgfutil@empty%
            \tikzset{every on corff layer/.try,#1}%
            \tikz@options%
          },
          execute at end scope={\endpgfonlayer}
    },
    stripiau cwt/.style={draw=#1, very thin, shorten >=-5mm, shorten <=-5mm, double=#1, double distance=3.5mm},
    stripiau corff/.style={very thin, draw=#1, fill=#1},
    trwyn/.style={circle, yshift=1.25mm, minimum width=2.5mm, inner sep=0pt},
    llenwi cath/.style={fill=#1},
    llygaid/.style n args=2{inner color=#1, outer color=#2, ultra thick, draw},
    pics/cath b/.style n args=5{
      code={
        [ultra thick]
        \begin{pgfonlayer}{pen}% ref. workaround from http://tex.stackexchange.com/a/218166/ (Mark Wibrow)
          \begin{scope}[very thin]% [on pen layer={very thin}]
          \path [clip]
            (0,10mm) coordinate (pen1) arc (90:65:19mm and 20mm) coordinate [pos=.75] (pp1) coordinate (pen2)
              arc (65:45:19mm and 20mm)  coordinate (pen3)
              arc (45:-60:19mm and 20mm) coordinate [pos=.05] (pp4) coordinate [pos=.4] (pp5) coordinate [pos=.45] (pp8) coordinate [pos=.75] (pp9)  coordinate (pen8)
              arc (-60:-90:19mm and 20mm) coordinate (pen10)
              arc (-90:-120:19mm and 20mm) coordinate (pen9)
              arc (-120:-225:19mm and 20mm) coordinate [pos=.25] (pp10) coordinate [pos=.55] (pp11) coordinate [pos=.6] (pp6) coordinate [pos=.95] (pp7) coordinate (pen4)
              arc (-225:-245:19mm and 20mm) coordinate (pen5)
              arc (-245:-270:19mm and 20mm) coordinate [pos=.25] (pp2)
              ;
          \path [stripiau corff=#1]
            (pp2) [out=-45, in=95] to ($(pen1) - (0,10mm)$) coordinate (pp3) [out=85, in=-135] to (pp1) |- +(5mm,5mm) -| cycle
            (pp4) [out=-135, in=25] to +(-7.5mm,-4mm) [out=-25, in=115] to (pp5) -| +(5mm,5mm) |- cycle
            (pp7) [out=-45, in=155] to +(7.5mm,-4mm) [out=-155, in=65] to (pp6) -| +(-5mm,5mm) |- cycle
            (pp8) [out=-135, in=-25] to +(-17.5mm,0mm) [out=-45, in=115] to (pp9) -| +(5mm,5mm) |- cycle
            (pp11) [out=-45, in=-155] to +(17.5mm,0mm) [out=-135, in=65] to (pp10) -| +(-5mm,5mm) |- cycle
            ;
          \end{scope}
        \end{pgfonlayer}
        \path
          (pen2) ++(4mm,7.5mm) coordinate (pen6)
          (pen5) ++(-4mm,7.5mm) coordinate (pen7);
        \path [rounded corners=1pt, llenwi cath=#2]
          (pen1) arc (90:65:19mm and 20mm)
            [out=80, in=-110] to (pen6) [out=-80, in=85] to
          (pen3) arc (45:-225:19mm and 20mm)
            [out=95, in=-100] to (pen7) [out=-70, in=100] to
          (pen5) arc (-245:-270:19mm and 20mm);
        \begin{scope}[on foreground layer={ultra thick}]
          \draw [rounded corners=1pt, ultra thick]
            (pen1) arc (90:65:19mm and 20mm)
              [out=80, in=-110] to (pen6) [out=-80, in=85] to
            (pen3) arc (45:-225:19mm and 20mm)
              [out=95, in=-100] to (pen7) [out=-70, in=100] to
            (pen5) arc (-245:-270:19mm and 20mm);
        \end{scope}
      \path [llenwi cath=#2]% corff
          (pp8) [out=35, in=100] to coordinate [pos=.075] (corff7) coordinate [pos=.1] (corff8) coordinate [pos=.2] (corff9) coordinate [pos=.225] (corff10) coordinate [pos=.325] (corff11) coordinate [pos=.35] (corff12) coordinate [pos=.45] (corff13) coordinate [pos=.475] (corff14) coordinate [pos=.575] (corff15) coordinate [pos=.6] (corff16) coordinate [pos=.7] (corff17) coordinate [pos=.725] (corff18) coordinate [pos=.825] (corff19) coordinate [pos=.86] (corff20) coordinate [pos=.96] (corff21) ++(75mm,-15mm) coordinate (corff5)
            [out=-80, in=-85] to coordinate [pos=.6] (corff6) coordinate [pos=.7] (corff22) coordinate [pos=.775] (corff23) coordinate [pos=.825] (corff24) coordinate [pos=.875] (corff27) coordinate [pos=.9] (corff25) coordinate [pos=.985] (corff26) (pen9);
         \begin{scope}[ultra thick]% stripiau'r corff
            \clip
              (pp8) [out=35, in=100] to (corff5)
                [out=-80, in=-85] to (pen9) |- cycle;
            \path [stripiau corff=#1]
              (pp8) [out=-95, in=65] to ++(7.5mm,-15mm) [out=45, in=-175] to (corff7)
              (corff8) [out=-85, in=50] to ++(7.5mm,-17.5mm) [out=45, in=-135] to (corff9)
              (corff10) [out=-90, in=60] to ++(5mm,-20mm) [out=50, in=-140] to (corff11)
              (corff12) [out=-100, in=55] to ++(2.5mm,-20mm) [out=50, in=-145] to (corff13)
              (corff14) [out=-110, in=50] to ++(0,-20mm) [out=40, in=-155] to (corff15)
              (corff16) [out=-115, in=40] to ++(-3.5mm,-18.5mm) [out=30, in=-170] to (corff17)
              (corff18) [out=-135, in=20] to ++(-7.5mm,-16.5mm) [out=10, in=-180] to (corff19)
              (corff20) [out=-170, in=-5] to ++(-10mm,-12.5mm) [out=-15, in=140] to (corff21)
              (corff26) [out=-45, in=-135] to ++(20mm,-1.5mm) [out=-115, in=45] to (corff25) -- +(-5mm,0) |- cycle
              (corff27) [out=40, in=-115] to ++(20mm,7.5mm) [out=-105, in=65] to (corff24) -- +(-5mm,0) |- cycle;
         \end{scope}
        \draw [ultra thick, name path=corff]
          (pp8) [out=35, in=100] to ++(75mm,-15mm)
            [out=-80, in=-85] to coordinate [pos=.6] (corff6) (pen9);
        \draw [ultra thick, llenwi cath=#2]% coesau
          (corff22) ++(17.5mm,12.5mm) coordinate (coes1)
          (corff23) ++(12.5mm,15mm) coordinate (coes2)
          (coes1) [out=-120, in=35] to (corff22) [out=-145, in=5] to ++(-20mm,-7.5mm) [out=-175, in=0] to ++(-5mm,0) arc (-90:90:-5mm and 3mm) coordinate (coes9) [out=0, in=-175] to ++(5mm,0) coordinate (coes11) [out=5, in=-145] to (corff23) [out=35, in=-100] to (coes2);
        \begin{pgfonlayer}{background}% ref. workaround from http://tex.stackexchange.com/a/218166/ (Mark Wibrow)
          \begin{scope}
            \draw [ultra thick, llenwi cath=#2]% coesau
              (corff23) [out=-145, in=5] to (coes11) [out=-175, in=0] to (coes9) arc (-90:90:-4mm and 2.5mm) [out=0, in=-145] to (corff24)
              ;
          \end{scope}
        \end{pgfonlayer}
        \path [llenwi cath=#2]% llenwi'r cwt
          (corff5) [out=-80, in=-15] to ($(corff6) + (0,-2.5mm)$) coordinate (cwt5)
            [out=165, in=-90] to ++(-5mm,5mm) coordinate (cwt6)
            [out=90, in=170] to ++(7.5mm,5mm) coordinate (cwt7)
            [out=-10, in=-95] to ($(corff5) + (-15mm,-2.5mm)$) coordinate (cwt8)
          ;
        \begin{scope}[ultra thick]% stripiau'r cwt
          \clip (corff5) [out=-80, in=-15] to
              coordinate [pos=.1] (cwt9)
              coordinate [pos=.15] (cwt10a)
              coordinate [pos=.25] (cwt11a)
              coordinate [pos=.345] (cwt12a)
              coordinate [pos=.44] (cwt13a)
              coordinate [pos=.53] (cwt14a)
              coordinate [pos=.62] (cwt15a)
              coordinate [pos=.71] (cwt16a)
              coordinate [pos=.805] (cwt17a)
              coordinate [pos=.9] (cwt18a)
              coordinate [pos=1] (cwt19a)
              (cwt5)
            [out=165, in=-90] to
              coordinate [pos=.45] (cwt20a)
              (cwt6)
            [out=90, in=170] to
              coordinate [pos=.65] (cwt20b)
              (cwt7)
            [out=-10, in=-95] to
              coordinate [pos=.025] (cwt19b)
              coordinate [pos=.125] (cwt18b)
              coordinate [pos=.225] (cwt17b)
              coordinate [pos=.325] (cwt16b)
              coordinate [pos=.425] (cwt15b)
              coordinate [pos=.525] (cwt14b)
              coordinate [pos=.625] (cwt13b)
              coordinate [pos=.725] (cwt12b)
              coordinate [pos=.825] (cwt11b)
              coordinate [pos=.925] (cwt10b)
              (cwt8)
            |- (corff21) -- cycle;
          \path [stripiau corff=#1]
            (corff5) [out=110, in=10] to ++(-7.5mm,-3.5mm) [out=0, in=120] to (cwt9);
          \path [llenwi cath=#1]
            (cwt20a) [out=80, in=-80] to (cwt20b) [out=170, in=90] to (cwt6) [out=-90, in=165] to cycle
            ;
          \foreach \i in {10,...,19}
            \draw [stripiau cwt=#1] (cwt\i a) [out=90, in=-60] to (cwt\i b);
        \end{scope}
        \draw [ultra thick, name path=cwt]
          (corff5) [out=-80, in=-15] to (cwt5)
            [out=165, in=-90] to (cwt6)
            [out=90, in=170] to (cwt7)
            [out=-10, in=-95] to (cwt8)
          ;
         \begin{scope}[on foreground layer={ultra thick}]
          \draw
            (pen10) -- ++(0,7.5mm) coordinate (ceg1)
              [out=-45, in=180] to +(5mm,-2.5mm) coordinate (ceg2)
              [out=0, in=-100] to +(2.5mm,3.5mm) coordinate (ceg3)
             ;
          \draw
            (ceg1)
              [out=-135, in=0] to +(-5mm,-2.5mm) coordinate (ceg4)
              [out=180, in=-80] to +(-2.5mm,3.5mm) coordinate (ceg5)
            ;
          \path (ceg1)
            node (trwyn1) [trwyn, anchor=west] {}
            node (trwyn2) [trwyn, anchor=east] {};
          \draw
            ($(trwyn1)!1/2!(trwyn2)$) coordinate (trwyn) [out=10,in=140] to +(25mm,7.5mm)
            (trwyn) [out=-10, in=120] to +(.5mm,-5mm)
            (trwyn) [out=-40, in=130] to +(-1.5mm,-5mm)
            ;
          \draw
            (trwyn) [out=170,in=40] to +(-25mm,7.5mm)
            (trwyn) [out=-170, in=60] to +(-.5mm,-5mm)
            (trwyn) [out=-140, in=50] to +(1.5mm,-5mm)
            ;
          \path (ceg1)
            node (trwyn1) [trwyn, draw, ball color=#5, anchor=west] {}
            node (trwyn2) [trwyn, draw, ball color=#5, anchor=east] {};
         \end{scope}
          \draw [llygaid={#3}{#4}]
          ({$(pen1)!2/5!(pen10)$} -| {$(pen8)!3/4!(pen4)$}) coordinate (llygad chwith)
            ++(-5mm,0) coordinate (llygad chwith 1) [out=20, in=180] to ++(6mm,2.5mm) coordinate (llygad chwith 2) [out=0, in=120] to ++(4mm,-2.5mm)
            [out=-120, in=0] to ++(-4mm,-2.5mm) [out=180, in=-20] to ++(-6mm,2.5mm)
          ;
          \draw [llygaid={#3}{#4}]
            ({$(pen1)!2/5!(pen10)$} -| {$(pen9)!3/4!(pen3)$}) coordinate (llygad de)
              ++(5mm,0) coordinate (llygad de 1) [out=160, in=0] to ++(-6mm,2.5mm) coordinate (llygad de 2) [out=180, in=40] to ++(-4mm,-2.5mm)
              [out=-40, in=180] to ++(4mm,-2.5mm) [out=0, in=-160] to ++(6mm,2.5mm)
          ;
          \fill [ball color=black] (llygad chwith 1 -| llygad chwith 2) circle (2.5mm);
          \fill [ball color=black] (llygad de 1 -| llygad de 2) circle (2.5mm);
          \begin{scope}[on foreground layer={ultra thick}]
            \draw [shorten >=1pt]
              ($(pen2)!7/10!(pen3)$) coordinate (clust1) [out=125, in=-80] to (pen6);
            \draw [shorten >=1pt]
              ($(pen5)!7/10!(pen4)$) coordinate (clust2) [out=55, in=-100] to (pen7);
          \end{scope}
          \begin{scope}% llenwi clust de
            \clip (clust1) [out=125, in=-80] to (pen6) [out=-110, in=80] to (pen2) |- cycle;
            \path [stripiau corff=#1, rounded corners=1pt]
              (clust1) [out=125, in=-80] to (pen6) [out=-110, in=80] to (pen2) arc (65:45:19mm and 20mm)
              ;
          \end{scope}
          \begin{scope}% llenwi clust chwith
            \clip (clust2) [out=55, in=-100] to (pen7) [out=-70, in=100] to (pen5) |- cycle;
            \path [stripiau corff=#1, rounded corners=1pt]
              (clust2) [out=55, in=-100] to (pen7) [out=-70, in=100] to (pen5) arc (-245:-225:19mm and 20mm)
              ;
          \end{scope}
          % dim yn ddefnyddiol ar hyn o bryd ond gobeithio bynnan nhw ar ôl iddyn nhw fix the bug!
          \coordinate (-pen) at (pen1);
          \coordinate (-clust chwith) at (pen7);
          \coordinate (-clust de) at (pen6);
        }
    },
}
\makeatother
\begin{document}
  \colorlet{lliw llygaid3}{Chartreuse1}
  \colorlet{lliw llygaid4}{Green4}
  \colorlet{lliw trwyn1}{LightPink2}
  \colorlet{cath5}{LavenderBlush3}
  \colorlet{cath6}{LavenderBlush4}
  \begin{tikzpicture}
    \pic {cath b={cath6}{cath5}{lliw llygaid3}{lliw llygaid4}{lliw trwyn1}};
llygaid2}{lliw trwyn2}};
  \end{tikzpicture}
\end{document}
share|improve this answer

Just a tree

tree

with extremely ugly code(I do not know how to do it corectly?! -ovelay and center):

\documentclass{article}
\usepackage{overpic}
\usepackage{graphicx} 
\begin{document}
\begin{overpic}[unit=1cm, width=8cm, height=12cm]{ttt}
\put(14.5,0){\includegraphics[width=4cm,height=12cm]{ttt}}
\put(23,0){\includegraphics[width=1.5cm,height=12cm]{ttt}}
\end{overpic}
\end{document}

ttt.pdf is the compiled tree from the question.

share|improve this answer
1  
I don't see how this answers the original question. –  Werner Feb 9 '12 at 2:16
6  
@werner: It doesn't, and I would never expect it to be accepted as an answer. I consider it to be a contribution never the less. –  Hans-Peter E. Kristiansen Feb 9 '12 at 4:47

I'm starting my Christmas decorating early, very early.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{lindenmayersystems}
\usepackage{stackengine}
\usepackage{simpsons}
\newcommand\ball[4][]{\stackinset{c}{}{c}{#1}{#4}{\textcolor{#2}{\scalebox{#3}{$\bullet$}}}}
\newlength\tmplen
\newcommand\rb[2]{\tmplen=#1\baselineskip\relax\tmplen=.07\tmplen\relax%
  \raisebox{\tmplen}{#2}}
\begin{document}
\setbox0=\hbox{
\begin{tikzpicture}
\draw [color=green!50!black, l-system={rule set={S -> [+++G][---G]TS,
  G -> +H[-G]L, H -> -G[+H]L, T -> TL, L -> [-FFF][+FFF]F}, step=4pt, angle=18,
 axiom=+++++SLFFF, order=11}] lindenmayer system -- cycle;
\end{tikzpicture}
}
\centering
\stackinset{c}{.6in}{b}{.8in}  {\ball[1pt] {green!15}{3}  {\P}}{%
\stackinset{c}{-1.2in}{b}{1in}  {\ball[.6pt]{red}     {4}  {\textcolor{white}{\S}}}{%
\stackinset{c}{0in}{b}{2.5in}   {\ball      {red!30}  {5}  {\tiny\LaTeX{}}}{%
\stackinset{c}{.2in}{b}{2in}    {\ball[1pt] {green!60}{3}  {@}}{%
\stackinset{c}{-.6in}{b}{1.3in} {\ball[.5pt]{yellow}  {2.5}{\footnotesize A}}{%
\stackinset{c}{1.4in}{b}{.8in}  {\ball[.5pt]{yellow}  {2.5}{\footnotesize $\Omega$}}{%
\stackinset{c}{.7in}{b}{1.1in}  {\ball[1pt] {blue!50} {4.3}{\scalebox{.42}{\Bart}}}{%
\stackinset{c}{-.24in}{b}{.8in} {\ball[1pt] {cyan!20} {4.3}{\scalebox{.42}{\Homer}}}{%
\stackinset{c}{-.3in}{b}{1.75in}{\ball[1pt] {cyan!40} {4.3}{\scalebox{.33}{\Marge}}}{%
\stackinset{c}{-0.7in}{b}{.75in}{\ball[1pt] {green!40}{4.3}{\scalebox{.42}{\Lisa}}}{%
\stackinset{c}{0.2in}{b}{1.4in} {\ball[1pt] {blue!10} {4.3}{\scalebox{.42}{\Maggie}}}{%
\hspace{5.8ex}\box0
}}}}}}}}}}}\par
\vspace{-.7in}\bfseries\noindent\hspace{5.8ex}%
\rb{12}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{M}}}\kern-2pt}%
\rb{7}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{e}}}\kern-2pt}%
\rb{3}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{r}}}\kern-2pt}%
\rb{1}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{r}}}\kern-2pt}%
\rb{0}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{y}}}\kern-2pt}%
\rb{1}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{ }}}\kern-2pt}%
\rb{4}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{C}}}\kern-2pt}%
\rb{9}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{h}}}\kern-2pt}%
\rb{9}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{r}}}\kern-2pt}%
\rb{4}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{i}}}\kern-2pt}%
\rb{1}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{s}}}\kern-2pt}%
\rb{0}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{t}}}\kern-2pt}%
\rb{0}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{m}}}\kern-2pt}%
\rb{1}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{a}}}\kern-2pt}%
\rb{4}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{s}}}\kern-2pt}%
\rb{9}{\ball[-2pt]{red}{3.4}{\smash{\textcolor{white}{!}}}\kern-2pt}%
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.