1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
|
% Copyright 2006 by Till Tantau
%
% This file may be distributed and/or modified
%
% 1. under the LaTeX Project Public License and/or
% 2. under the GNU Public License.
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
\ProvidesFileRCS[v\pgfversion] $Header: /cvsroot/pgf/pgf/generic/pgf/libraries/pgflibrarytikzfolding.code.tex,v 1.3 2007/03/09 17:49:32 tantau Exp $
%
% Length of a standard line in a folding
%
\tikzoption{folding line length}{\pgfmathsetlength\tikz@lib@fold@length{#1}}
\newdimen\tikz@lib@fold@length
\tikz@lib@fold@length=2cm
\def\tikz@lib@fold@pentagon#1#2#3#4#5#6{%
\begin{scope}[xshift=.5\tikz@lib@fold@length,yshift=0.68819\tikz@lib@fold@length]
#1
\end{scope}
\begin{scope}[shift={(108:\tikz@lib@fold@length)},shift={(36:\tikz@lib@fold@length)},rotate=-36]
#2
\end{scope}
\begin{scope}[xshift=\tikz@lib@fold@length,shift={(72:\tikz@lib@fold@length)},rotate=-108]
#3
\end{scope}
\begin{scope}[xshift=\tikz@lib@fold@length,rotate=180]
#4
\end{scope}
\begin{scope}[rotate=108]
#5
\end{scope}
\begin{scope}[shift={(108:\tikz@lib@fold@length)},rotate=36]
#6
\end{scope}
}
\def\tikz@lib@fold@path{\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);}
\def\tikz@lib@fold@cut@path{\draw[every cut](0,0) -- (\tikz@lib@fold@length,0pt);}
\def\tikz@lib@fold@ear@path{
\draw[every fold](0,0) -- (\tikz@lib@fold@length,0pt);
\draw[every cut] (0,0) -- (.5\tikz@lib@fold@length,.2\tikz@lib@fold@length) --(\tikz@lib@fold@length,0pt);}
\tikzstyle{every cut}=[]
\tikzstyle{every fold}=[help lines]
\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}}
\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
\def\tikzfoldingdodecahedron#1[#2]#3;{%
\begingroup%
\tikz@setkeys{#2}%
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@A}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@B}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@C}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@ear@path}
}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@D}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@E}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@F}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@G}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@H}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@I}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@ear@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@ear@path}
}
{\tikz@lib@fold@ear@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@cut@path}
}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@J}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@K}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{
\tikz@lib@fold@pentagon{\tikz@lib@fold@face@L}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@path}{\tikz@lib@fold@cut@path}{\tikz@lib@fold@cut@path}
}
}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@path}
{\tikz@lib@fold@cut@path}
{\tikz@lib@fold@cut@path}
}
\endgroup
}
|