summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/pmdraw/examples/example-20.tex
blob: 8d0bc25cb3c6d9e0455581b93ef923aac3fc040e (plain)
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
%!TEX root = ../pmdraw.tex

% *------------------------------*
% |0````````````````````````````9|
% |`````____````____`````````````|
% |````|MFMF\  /MFMF|````````````|
% |````|MF|MF\/MF|MF|````````````|
% |````|MF|\MFMF/|MF|_______`````|
% |````|MF|``````|MFMFMFMFMF|````|
% |````|MF|``````|MF|````````````|
% |````|MF|``````|MF|___`````````|
% |``````````````|MFMFMF|````````|
% |``````````````|MF|````````````|
% |``````````````|MF|````````````|
% |``````````````|MF|````````````|
% |3````````````````````````````8|
% *------------------------------*

\usetikzlibrary{patterns}

\newcommand{\blockStyles}{
    \tikzstyle{typeI} = [
        very thick,
        rounded corners=5pt,
        red,
        preaction={fill, red!3}
    ]
    \tikzstyle{typeT} = [
        very thick,
        rounded corners=5pt,
        dash pattern={on 7.5pt off 2.5pt},
        green,
        preaction={fill, green!3}
    ]
    \tikzstyle{typeB} = [
        very thick,
        rounded corners=5pt,
        dash pattern={on 2.5pt off 2.5pt},
        blue,
        preaction={fill, blue!3}
    ]
    \tikzstyle{typeO} = [
        very thick,
        rounded corners=5pt,
        dash pattern={on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
        orange,
        preaction={fill, orange!3}
    ]
    \tikzstyle{typeU} = [
        very thick,
        rounded corners=5pt,
        dash pattern={on 2.5pt off 2.5pt on 2.5pt off 2.5pt on 7.5pt off 2.5pt},
        violet,
        preaction={fill, violet!3}
    ]
    \tikzstyle{typeN} = [
        very thick,
        rounded corners=5pt,
        dash pattern={on 7.5pt off 2.5pt on 7.5pt off 2.5pt on 2.5pt off 2.5pt},
        yellow,
        preaction={fill, yellow!3}
    ]
}

\pmdProduct[ % Options
    decorate before={
        \blockStyles
        \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (3.4, 0.7) -- (3.4, -3.4) -- (2.6, -3.4) -- (2.6, -1.7) -- (0.6, -1.7) -- cycle;
        \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
        \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
    }
]{ % Added edges
    {1}{3}
}{ % Top Diagram
    { % Brick 1
        [ % Options
            degree=3
        ]{ % Upper non transversal edges
            {2}{3}
        }{ % Lower non transversal edges
            {2}{3}
        }{ % Transversal edges
            {1}{1}
        }
    }
}{ % Bottom Diagram
    { % Brick 1
        [ % Options
            degree=3
        ]{ % Upper non transversal edges
            {1}{2}
        }{ % Lower non transversal edges
            {1}{2}
        }{ % Transversal edges
            {3}{3}
        }
    }
}
\hspace{5em}
\pmdProduct[ % Options
    decorate before={
        \blockStyles
        \draw[typeI] (0.6, 2.4) -- (1.4, 2.4) -- (1.4, 0.7) -- (10.4, 0.7) -- (10.4, -3.4) -- (9.6, -3.4) -- (9.6, -1.7) -- (0.6, -1.7) -- cycle;
        \foreach \x in {0,2,7} {
            \begin{scope}[shift={(\x,0)}]
                \draw[typeT] (1.6, 1.3) rectangle (3.4, 2.4);
            \end{scope}
        }
        \foreach \x in {0,2,4,7} {
            \begin{scope}[shift={(\x,0)}]
                \draw[typeB] (0.6, -3.4) rectangle (2.4, -2.3);
            \end{scope}
        }
    }
]{ % Added edges
    {1}{5}
    {9}{10}
}{ % Top Diagram
    { % Brick 1
        [ % Options
            degree=5
        ]{ % Upper non transversal edges
            {2}{3}
            {4}{5}
        }{ % Lower non transversal edges
            {2}{3}
            {4}{5}
        }{ % Transversal edges
            {1}{1}
        }
    }{ % Brick 2
        [ % Options
            blank top=2,
            degree top=2,
            blank bottom=2,
            degree bottom=2
        ]{ % Upper non transversal edges
            {3}{4}
        }{ % Lower non transversal edges
            {3}{4}
        }{ % Transversal edges
            \pmdEmpty
        }
    }
}{ % Bottom Diagram
    { % Brick 1
        [ % Options
            degree=6
        ]{ % Upper non transversal edges
            {1}{2}
            {3}{4}
            {5}{6}
        }{ % Lower non transversal edges
            {1}{2}
            {3}{4}
            {5}{6}
        }{ % Transversal edges
            \pmdEmpty
        }
    }{ % Brick 2
        [ % Options
            degree=3
        ]{ % Upper non transversal edges
            {1}{2}
        }{ % Lower non transversal edges
            {1}{2}
        }{ % Transversal edges
            {3}{3}
        }
    }
}