TikZ folding: Preparing for the archimedean solids

Some years ago I played around with the folding library of TikZ. I extended it a bit to include all platonic solids and also added two Archimedean solids. I wrote a blog article about this, which can be found here. In that article I promised to finish the remaining Archimedean solids. I didn’t let it lie for a while, and, as is unfortunately often the case with these hobby projects, I eventually forgot about it. Until recently Martin Quinson made a comment on the aforementioned article. He noted that this code still wasn’t included in TikZ and asked some help in creating a folding net for the truncated icosidodecahedron. This rekindled my interest in the subject, and this blog article is the result of this renewed interest.

First let me comment on the fact that this code wasn’t yet included in TikZ. I’m afraid I have to take the blame for this. I just sent an email saying: “I have written an extension for the folding library. Do you want it?” I was young, enthusiastic and unaware of busy schedules. These days I know that you have to at least invest some effort to make it easy for the developers who have to integrate your code. So this time I made a patch of the changes I made and used the proper channels on SourceForge. Within days I received a reply and the code is now on its way to inclusion.

Next let me give some explanation on the preparations I have been making for the inclusion of the remaining Archimedean solids. There were two things that needed to be addressed before these remaining solids could be included. The largest number of faces any Archimedean solid can have is 92. The snub dodecahedron is the only one that has that many, but still, the library currently only supports up to 20 faces. The second thing that needed to be addressed is the possible face sizes. The truncated dodecahedron and the truncated icosidodecahedron both have decagonal faces, and the truncated cube and the truncated cuboctahedron both have octagonal faces. These two face sizes weren’t supported yet by the library.

Adding 72 more faces seems like a lot of type work. I didn’t really feel like spending my time copy-pasting, changing the code and hoping that I didn’t make a typo. So I wrote the following short script to generate the code I needed. The script is written in Python (I’ve started teaching lessons in Python this year, and I’m really loving it for this kind of short scripts).

for i in range(26):
    print '\\tikzoption{face %d}{\\def\\tikz@lib@fold@face@%s{#1}}'\
                   % (i+1, chr(ord('A')+i))

for j in range(3):
    for i in range(26):
        if 27+j*26+i<=92:
            print '\\tikzoption{face %d}{\\def\\tikz@lib@fold@face@%s%s{#1}}'\
                           % (27+j*26+i, chr(ord('A')+j), chr(ord('A')+i))

for i in range(26):
    print '\\let\\tikz@lib@fold@face@%s=\\pgfutil@empty'\
                % (chr(ord('A')+i))

for j in range(3):
    for i in range(26):
        if 27+j*26+i<=92:
            print '\\let\\tikz@lib@fold@face@%s%s=\\pgfutil@empty'\
                        % (chr(ord('A')+j), chr(ord('A')+i))

Running this script produces the following code:

\tikzoption{face 1}{\def\tikz@lib@fold@face@A{#1}}
\tikzoption{face 2}{\def\tikz@lib@fold@face@B{#1}}
\tikzoption{face 3}{\def\tikz@lib@fold@face@C{#1}}
\tikzoption{face 4}{\def\tikz@lib@fold@face@D{#1}}
\tikzoption{face 5}{\def\tikz@lib@fold@face@E{#1}}
\tikzoption{face 6}{\def\tikz@lib@fold@face@F{#1}}
\tikzoption{face 7}{\def\tikz@lib@fold@face@G{#1}}
\tikzoption{face 8}{\def\tikz@lib@fold@face@H{#1}}
\tikzoption{face 9}{\def\tikz@lib@fold@face@I{#1}}
\tikzoption{face 10}{\def\tikz@lib@fold@face@J{#1}}
\tikzoption{face 11}{\def\tikz@lib@fold@face@K{#1}}
\tikzoption{face 12}{\def\tikz@lib@fold@face@L{#1}}
\tikzoption{face 13}{\def\tikz@lib@fold@face@M{#1}}
\tikzoption{face 14}{\def\tikz@lib@fold@face@N{#1}}
\tikzoption{face 15}{\def\tikz@lib@fold@face@O{#1}}
\tikzoption{face 16}{\def\tikz@lib@fold@face@P{#1}}
\tikzoption{face 17}{\def\tikz@lib@fold@face@Q{#1}}
\tikzoption{face 18}{\def\tikz@lib@fold@face@R{#1}}
\tikzoption{face 19}{\def\tikz@lib@fold@face@S{#1}}
\tikzoption{face 20}{\def\tikz@lib@fold@face@T{#1}}
\tikzoption{face 21}{\def\tikz@lib@fold@face@U{#1}}
\tikzoption{face 22}{\def\tikz@lib@fold@face@V{#1}}
\tikzoption{face 23}{\def\tikz@lib@fold@face@W{#1}}
\tikzoption{face 24}{\def\tikz@lib@fold@face@X{#1}}
\tikzoption{face 25}{\def\tikz@lib@fold@face@Y{#1}}
\tikzoption{face 26}{\def\tikz@lib@fold@face@Z{#1}}
\tikzoption{face 27}{\def\tikz@lib@fold@face@AA{#1}}
\tikzoption{face 28}{\def\tikz@lib@fold@face@AB{#1}}
\tikzoption{face 29}{\def\tikz@lib@fold@face@AC{#1}}
\tikzoption{face 30}{\def\tikz@lib@fold@face@AD{#1}}
\tikzoption{face 31}{\def\tikz@lib@fold@face@AE{#1}}
\tikzoption{face 32}{\def\tikz@lib@fold@face@AF{#1}}
\tikzoption{face 33}{\def\tikz@lib@fold@face@AG{#1}}
\tikzoption{face 34}{\def\tikz@lib@fold@face@AH{#1}}
\tikzoption{face 35}{\def\tikz@lib@fold@face@AI{#1}}
\tikzoption{face 36}{\def\tikz@lib@fold@face@AJ{#1}}
\tikzoption{face 37}{\def\tikz@lib@fold@face@AK{#1}}
\tikzoption{face 38}{\def\tikz@lib@fold@face@AL{#1}}
\tikzoption{face 39}{\def\tikz@lib@fold@face@AM{#1}}
\tikzoption{face 40}{\def\tikz@lib@fold@face@AN{#1}}
\tikzoption{face 41}{\def\tikz@lib@fold@face@AO{#1}}
\tikzoption{face 42}{\def\tikz@lib@fold@face@AP{#1}}
\tikzoption{face 43}{\def\tikz@lib@fold@face@AQ{#1}}
\tikzoption{face 44}{\def\tikz@lib@fold@face@AR{#1}}
\tikzoption{face 45}{\def\tikz@lib@fold@face@AS{#1}}
\tikzoption{face 46}{\def\tikz@lib@fold@face@AT{#1}}
\tikzoption{face 47}{\def\tikz@lib@fold@face@AU{#1}}
\tikzoption{face 48}{\def\tikz@lib@fold@face@AV{#1}}
\tikzoption{face 49}{\def\tikz@lib@fold@face@AW{#1}}
\tikzoption{face 50}{\def\tikz@lib@fold@face@AX{#1}}
\tikzoption{face 51}{\def\tikz@lib@fold@face@AY{#1}}
\tikzoption{face 52}{\def\tikz@lib@fold@face@AZ{#1}}
\tikzoption{face 53}{\def\tikz@lib@fold@face@BA{#1}}
\tikzoption{face 54}{\def\tikz@lib@fold@face@BB{#1}}
\tikzoption{face 55}{\def\tikz@lib@fold@face@BC{#1}}
\tikzoption{face 56}{\def\tikz@lib@fold@face@BD{#1}}
\tikzoption{face 57}{\def\tikz@lib@fold@face@BE{#1}}
\tikzoption{face 58}{\def\tikz@lib@fold@face@BF{#1}}
\tikzoption{face 59}{\def\tikz@lib@fold@face@BG{#1}}
\tikzoption{face 60}{\def\tikz@lib@fold@face@BH{#1}}
\tikzoption{face 61}{\def\tikz@lib@fold@face@BI{#1}}
\tikzoption{face 62}{\def\tikz@lib@fold@face@BJ{#1}}
\tikzoption{face 63}{\def\tikz@lib@fold@face@BK{#1}}
\tikzoption{face 64}{\def\tikz@lib@fold@face@BL{#1}}
\tikzoption{face 65}{\def\tikz@lib@fold@face@BM{#1}}
\tikzoption{face 66}{\def\tikz@lib@fold@face@BN{#1}}
\tikzoption{face 67}{\def\tikz@lib@fold@face@BO{#1}}
\tikzoption{face 68}{\def\tikz@lib@fold@face@BP{#1}}
\tikzoption{face 69}{\def\tikz@lib@fold@face@BQ{#1}}
\tikzoption{face 70}{\def\tikz@lib@fold@face@BR{#1}}
\tikzoption{face 71}{\def\tikz@lib@fold@face@BS{#1}}
\tikzoption{face 72}{\def\tikz@lib@fold@face@BT{#1}}
\tikzoption{face 73}{\def\tikz@lib@fold@face@BU{#1}}
\tikzoption{face 74}{\def\tikz@lib@fold@face@BV{#1}}
\tikzoption{face 75}{\def\tikz@lib@fold@face@BW{#1}}
\tikzoption{face 76}{\def\tikz@lib@fold@face@BX{#1}}
\tikzoption{face 77}{\def\tikz@lib@fold@face@BY{#1}}
\tikzoption{face 78}{\def\tikz@lib@fold@face@BZ{#1}}
\tikzoption{face 79}{\def\tikz@lib@fold@face@CA{#1}}
\tikzoption{face 80}{\def\tikz@lib@fold@face@CB{#1}}
\tikzoption{face 81}{\def\tikz@lib@fold@face@CC{#1}}
\tikzoption{face 82}{\def\tikz@lib@fold@face@CD{#1}}
\tikzoption{face 83}{\def\tikz@lib@fold@face@CE{#1}}
\tikzoption{face 84}{\def\tikz@lib@fold@face@CF{#1}}
\tikzoption{face 85}{\def\tikz@lib@fold@face@CG{#1}}
\tikzoption{face 86}{\def\tikz@lib@fold@face@CH{#1}}
\tikzoption{face 87}{\def\tikz@lib@fold@face@CI{#1}}
\tikzoption{face 88}{\def\tikz@lib@fold@face@CJ{#1}}
\tikzoption{face 89}{\def\tikz@lib@fold@face@CK{#1}}
\tikzoption{face 90}{\def\tikz@lib@fold@face@CL{#1}}
\tikzoption{face 91}{\def\tikz@lib@fold@face@CM{#1}}
\tikzoption{face 92}{\def\tikz@lib@fold@face@CN{#1}}

\let\tikz@lib@fold@face@A=\pgfutil@empty
\let\tikz@lib@fold@face@B=\pgfutil@empty
\let\tikz@lib@fold@face@C=\pgfutil@empty
\let\tikz@lib@fold@face@D=\pgfutil@empty
\let\tikz@lib@fold@face@E=\pgfutil@empty
\let\tikz@lib@fold@face@F=\pgfutil@empty
\let\tikz@lib@fold@face@G=\pgfutil@empty
\let\tikz@lib@fold@face@H=\pgfutil@empty
\let\tikz@lib@fold@face@I=\pgfutil@empty
\let\tikz@lib@fold@face@J=\pgfutil@empty
\let\tikz@lib@fold@face@K=\pgfutil@empty
\let\tikz@lib@fold@face@L=\pgfutil@empty
\let\tikz@lib@fold@face@M=\pgfutil@empty
\let\tikz@lib@fold@face@N=\pgfutil@empty
\let\tikz@lib@fold@face@O=\pgfutil@empty
\let\tikz@lib@fold@face@P=\pgfutil@empty
\let\tikz@lib@fold@face@Q=\pgfutil@empty
\let\tikz@lib@fold@face@R=\pgfutil@empty
\let\tikz@lib@fold@face@S=\pgfutil@empty
\let\tikz@lib@fold@face@T=\pgfutil@empty
\let\tikz@lib@fold@face@U=\pgfutil@empty
\let\tikz@lib@fold@face@V=\pgfutil@empty
\let\tikz@lib@fold@face@W=\pgfutil@empty
\let\tikz@lib@fold@face@X=\pgfutil@empty
\let\tikz@lib@fold@face@Y=\pgfutil@empty
\let\tikz@lib@fold@face@Z=\pgfutil@empty
\let\tikz@lib@fold@face@AA=\pgfutil@empty
\let\tikz@lib@fold@face@AB=\pgfutil@empty
\let\tikz@lib@fold@face@AC=\pgfutil@empty
\let\tikz@lib@fold@face@AD=\pgfutil@empty
\let\tikz@lib@fold@face@AE=\pgfutil@empty
\let\tikz@lib@fold@face@AF=\pgfutil@empty
\let\tikz@lib@fold@face@AG=\pgfutil@empty
\let\tikz@lib@fold@face@AH=\pgfutil@empty
\let\tikz@lib@fold@face@AI=\pgfutil@empty
\let\tikz@lib@fold@face@AJ=\pgfutil@empty
\let\tikz@lib@fold@face@AK=\pgfutil@empty
\let\tikz@lib@fold@face@AL=\pgfutil@empty
\let\tikz@lib@fold@face@AM=\pgfutil@empty
\let\tikz@lib@fold@face@AN=\pgfutil@empty
\let\tikz@lib@fold@face@AO=\pgfutil@empty
\let\tikz@lib@fold@face@AP=\pgfutil@empty
\let\tikz@lib@fold@face@AQ=\pgfutil@empty
\let\tikz@lib@fold@face@AR=\pgfutil@empty
\let\tikz@lib@fold@face@AS=\pgfutil@empty
\let\tikz@lib@fold@face@AT=\pgfutil@empty
\let\tikz@lib@fold@face@AU=\pgfutil@empty
\let\tikz@lib@fold@face@AV=\pgfutil@empty
\let\tikz@lib@fold@face@AW=\pgfutil@empty
\let\tikz@lib@fold@face@AX=\pgfutil@empty
\let\tikz@lib@fold@face@AY=\pgfutil@empty
\let\tikz@lib@fold@face@AZ=\pgfutil@empty
\let\tikz@lib@fold@face@BA=\pgfutil@empty
\let\tikz@lib@fold@face@BB=\pgfutil@empty
\let\tikz@lib@fold@face@BC=\pgfutil@empty
\let\tikz@lib@fold@face@BD=\pgfutil@empty
\let\tikz@lib@fold@face@BE=\pgfutil@empty
\let\tikz@lib@fold@face@BF=\pgfutil@empty
\let\tikz@lib@fold@face@BG=\pgfutil@empty
\let\tikz@lib@fold@face@BH=\pgfutil@empty
\let\tikz@lib@fold@face@BI=\pgfutil@empty
\let\tikz@lib@fold@face@BJ=\pgfutil@empty
\let\tikz@lib@fold@face@BK=\pgfutil@empty
\let\tikz@lib@fold@face@BL=\pgfutil@empty
\let\tikz@lib@fold@face@BM=\pgfutil@empty
\let\tikz@lib@fold@face@BN=\pgfutil@empty
\let\tikz@lib@fold@face@BO=\pgfutil@empty
\let\tikz@lib@fold@face@BP=\pgfutil@empty
\let\tikz@lib@fold@face@BQ=\pgfutil@empty
\let\tikz@lib@fold@face@BR=\pgfutil@empty
\let\tikz@lib@fold@face@BS=\pgfutil@empty
\let\tikz@lib@fold@face@BT=\pgfutil@empty
\let\tikz@lib@fold@face@BU=\pgfutil@empty
\let\tikz@lib@fold@face@BV=\pgfutil@empty
\let\tikz@lib@fold@face@BW=\pgfutil@empty
\let\tikz@lib@fold@face@BX=\pgfutil@empty
\let\tikz@lib@fold@face@BY=\pgfutil@empty
\let\tikz@lib@fold@face@BZ=\pgfutil@empty
\let\tikz@lib@fold@face@CA=\pgfutil@empty
\let\tikz@lib@fold@face@CB=\pgfutil@empty
\let\tikz@lib@fold@face@CC=\pgfutil@empty
\let\tikz@lib@fold@face@CD=\pgfutil@empty
\let\tikz@lib@fold@face@CE=\pgfutil@empty
\let\tikz@lib@fold@face@CF=\pgfutil@empty
\let\tikz@lib@fold@face@CG=\pgfutil@empty
\let\tikz@lib@fold@face@CH=\pgfutil@empty
\let\tikz@lib@fold@face@CI=\pgfutil@empty
\let\tikz@lib@fold@face@CJ=\pgfutil@empty
\let\tikz@lib@fold@face@CK=\pgfutil@empty
\let\tikz@lib@fold@face@CL=\pgfutil@empty
\let\tikz@lib@fold@face@CM=\pgfutil@empty
\let\tikz@lib@fold@face@CN=\pgfutil@empty

And that’s all you need to support up to 92 faces.

There was however something else I wanted to include before continuing. While implementing the other Platonic solids and the first couple of Archimedean solids I often used testing code which looked like this

\begin{tikzpicture}[transform shape,every cut/.style=red,every fold/.style=dotted]
	\tikzfoldingalternatedodecahedron
	[folding line length=20mm,
	face 1={\node{1};},
	face 2={\node{2};},
	face 3={\node{3};},
	face 4={\node{4};},
	face 5={\node{5};},
	face 6={\node{6};},
	face 7={\node{7};},
	face 8={\node{8};},
	face 9={\node{9};},
	face 10={\node{10};},
	face 11={\node{11};},
	face 12={\node{12};}];
\end{tikzpicture}

For 12 faces it is still doable to manually type all the face numbers. With 92 faces I wasn’t looking forward to always doing it by hand. So I adapted the script above and created the following style:

\tikzstyle{numbered faces}=[%
	face 1={\node{1};},
	face 2={\node{2};},
	face 3={\node{3};},
	face 4={\node{4};},
	face 5={\node{5};},
	face 6={\node{6};},
	face 7={\node{7};},
	face 8={\node{8};},
	face 9={\node{9};},
	face 10={\node{10};},
	face 11={\node{11};},
	face 12={\node{12};},
	face 13={\node{13};},
	face 14={\node{14};},
	face 15={\node{15};},
	face 16={\node{16};},
	face 17={\node{17};},
	face 18={\node{18};},
	face 19={\node{19};},
	face 20={\node{20};},
	face 21={\node{21};},
	face 22={\node{22};},
	face 23={\node{23};},
	face 24={\node{24};},
	face 25={\node{25};},
	face 26={\node{26};},
	face 27={\node{27};},
	face 28={\node{28};},
	face 29={\node{29};},
	face 30={\node{30};},
	face 31={\node{31};},
	face 32={\node{32};},
	face 33={\node{33};},
	face 34={\node{34};},
	face 35={\node{35};},
	face 36={\node{36};},
	face 37={\node{37};},
	face 38={\node{38};},
	face 39={\node{39};},
	face 40={\node{40};},
	face 41={\node{41};},
	face 42={\node{42};},
	face 43={\node{43};},
	face 44={\node{44};},
	face 45={\node{45};},
	face 46={\node{46};},
	face 47={\node{47};},
	face 48={\node{48};},
	face 49={\node{49};},
	face 50={\node{50};},
	face 51={\node{51};},
	face 52={\node{52};},
	face 53={\node{53};},
	face 54={\node{54};},
	face 55={\node{55};},
	face 56={\node{56};},
	face 57={\node{57};},
	face 58={\node{58};},
	face 59={\node{59};},
	face 60={\node{60};},
	face 61={\node{61};},
	face 62={\node{62};},
	face 63={\node{63};},
	face 64={\node{64};},
	face 65={\node{65};},
	face 66={\node{66};},
	face 67={\node{67};},
	face 68={\node{68};},
	face 69={\node{69};},
	face 70={\node{70};},
	face 71={\node{71};},
	face 72={\node{72};},
	face 73={\node{73};},
	face 74={\node{74};},
	face 75={\node{75};},
	face 76={\node{76};},
	face 77={\node{77};},
	face 78={\node{78};},
	face 79={\node{79};},
	face 80={\node{80};},
	face 81={\node{81};},
	face 82={\node{82};},
	face 83={\node{83};},
	face 84={\node{84};},
	face 85={\node{85};},
	face 86={\node{86};},
	face 87={\node{87};},
	face 88={\node{88};},
	face 89={\node{89};},
	face 90={\node{90};},
	face 91={\node{91};},
	face 92={\node{92};}]

This means you can now write the following code to get the same as the example above.

\begin{tikzpicture}[transform shape,every cut/.style=red,every fold/.style=dotted]
	\tikzfoldingalternatedodecahedron[folding line length=20mm,numbered faces];
\end{tikzpicture}

Ok, so we have the 92 faces. Time to add the different face sizes. I think in the previous article I maybe did a poor job of explaining how these faces work. So let’s try again. A n-gon is a command which takes n+1 arguments. This command doesn’t actually draw anything. All the drawing (sides, folds, ears and face content) is the responsibility of the arguments that are passed on to that command. All the command for the face does, is perform n+1 coordinate transformations: one for the content of the face and one for each side of the face.
The first argument is the content of the face. For the content the coordinate system is transformed such that the origin is at the center of the face. The remaining arguments correspond to the sides of the face. For each side the coordinate system is transformed such that the origin is at a vertex incident to the side, the vertical axis points away from the face and the side is on the positive part of the horizontal axis.

For the octagon this gives the following code

\def\tikz@lib@fold@octagon#1#2#3#4#5#6#7#8#9{%
  \begin{scope}[xshift=.5\tikz@lib@fold@length,yshift=1.20711\tikz@lib@fold@length]
    #1
  \end{scope}
  \begin{scope}[yshift=2.41421\tikz@lib@fold@length]
    #2
  \end{scope}
  \begin{scope}[xshift=\tikz@lib@fold@length,yshift=2.41421\tikz@lib@fold@length,rotate=-45]
    #3
  \end{scope}
  \begin{scope}[xshift=1.70711\tikz@lib@fold@length,yshift=1.70711\tikz@lib@fold@length,rotate=-90]
    #4
  \end{scope}
  \begin{scope}[xshift=1.70711\tikz@lib@fold@length,yshift=.70711\tikz@lib@fold@length,rotate=-135]
    #5
  \end{scope}
  \begin{scope}[xshift=\tikz@lib@fold@length,rotate=180]
    #6
  \end{scope}
  \begin{scope}[rotate=135]
    #7
  \end{scope}
  \begin{scope}[xshift=-.70711\tikz@lib@fold@length,yshift=.70711\tikz@lib@fold@length,rotate=90]
    #8
  \end{scope}
  \begin{scope}[xshift=-.70711\tikz@lib@fold@length,yshift=1.70711\tikz@lib@fold@length,rotate=45]
    #9
  \end{scope}
}

At the beginning of this macro the origin is at the left vertex of the bottom side, the vertical axis points upwards and the horizontal axis points to the right. We shift the coordinate system to the right by half a side length and upwards by \frac{1}{2}+\frac{\sqrt{2}}{2} to get to the center of the face. Next we start shifting for the different sides:

  • we shift upwards by 1 + \sqrt{2} for the north side
  • we shift upwards by 1 + \sqrt{2} and to right by 1 followed by a rotation of 45 degrees clockwise for the north-east side
  • we shift upwards by 1 + \frac{\sqrt{2}}{2} and to right by 1 + \frac{\sqrt{2}}{2} followed by a rotation of 90 degrees clockwise for the east side
  • we shift upwards by \sqrt{2} and to right by 1 + \frac{\sqrt{2}}{2} followed by a rotation of 135 degrees clockwise for the south-east side
  • we shift to the right by 1 followed by a rotation of 180 degrees for the south side
  • we rotate 135 degrees counterclockwise for the south-west side
  • we shift upwards by \sqrt{2} and to left by \frac{\sqrt{2}}{2} followed by a rotation of 90 degrees counterclockwise for the west side
  • we shift upwards by 1 + \sqrt{2} and to left by \frac{\sqrt{2}}{2} followed by a rotation of 45 degrees counterclockwise for the north-west side

For the decagon we are faced with a problem. In TeX a command can only have 9 arguments, but we need 11 arguments to create a decagon. This can be solved by using a trick from the TeX FAQ. This trick is especially suited for this case, since we don’t need all 11 arguments at the same time, so we don’t even need to store the first arguments. This gives us the following two macros:

\def\tikz@lib@fold@decagon#1#2#3#4#5#6#7{%
  \begin{scope}[shift={(72:1.61803\tikz@lib@fold@length)}]
    #1
  \end{scope}
  \begin{scope}
          [shift={(36:\tikz@lib@fold@length)},
           shift={(72:\tikz@lib@fold@length)},
           shift={(108:\tikz@lib@fold@length)},
           shift={(144:\tikz@lib@fold@length)}]
    #2
  \end{scope}
  \begin{scope}
          [xshift=\tikz@lib@fold@length,
           shift={(36:\tikz@lib@fold@length)},
           shift={(72:\tikz@lib@fold@length)},
           shift={(108:\tikz@lib@fold@length)},
           shift={(144:\tikz@lib@fold@length)},
           rotate=-36]
    #3
  \end{scope}
  \begin{scope}
          [xshift=\tikz@lib@fold@length,
           shift={(36:\tikz@lib@fold@length)},
           shift={(72:\tikz@lib@fold@length)},
           shift={(108:\tikz@lib@fold@length)},
           rotate=-72]
    #4
  \end{scope}
  \begin{scope}
          [xshift=\tikz@lib@fold@length,
           shift={(36:\tikz@lib@fold@length)},
           shift={(72:\tikz@lib@fold@length)},
           rotate=-108]
    #5
  \end{scope}
  \begin{scope}
          [xshift=\tikz@lib@fold@length,
           shift={(36:\tikz@lib@fold@length)},
           rotate=-144]
    #6
  \end{scope}
  \begin{scope}
          [xshift=\tikz@lib@fold@length,
           rotate=180]
    #7
  \end{scope}
  \tikz@lib@fold@decagonbis
}

\def\tikz@lib@fold@decagonbis#1#2#3#4{%
  \begin{scope}
          [rotate=144]
    #1
  \end{scope}
  \begin{scope}
          [shift={(144:\tikz@lib@fold@length)},
           rotate=108]
    #2
  \end{scope}
  \begin{scope}
          [shift={(144:\tikz@lib@fold@length)},
           shift={(108:\tikz@lib@fold@length)},
           rotate=72]
    #3
  \end{scope}
  \begin{scope}
          [shift={(144:\tikz@lib@fold@length)},
           shift={(108:\tikz@lib@fold@length)},
           shift={(72:\tikz@lib@fold@length)},
           rotate=36]
    #4
  \end{scope}
}

Maybe just a short explanation of the transformation used for the center of the face is needed. A regular decagon with side length 1 has a radius that is equal to the golden ratio.

So now that we have all the tools we can start constructing the Archimedean solids, but that will be for another article.

Advertisements
Comments
2 Responses to “TikZ folding: Preparing for the archimedean solids”
Trackbacks
Check out what others are saying...
  1. […] I explained in a previous post, my interest in the TikZ folding library was recently rekindled, three years after I first added […]

  2. […] Preparing for the Archimedean solids […]



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: