Ian Jauslin
summaryrefslogtreecommitdiff
blob: f8b821cef1fa332362088cc817b3e41de8f75ca2 (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
\documentclass{standalone}
\usepackage{tikz}

% a global rescaling factor
\def\rescale{0.6}

% length of the axes
\def\axeslength{\rescale*3}
% width, length and height of a plate
\def\w{\rescale*2.5}
\def\l{\rescale*4}
\def\h{\rescale*0.2}

% space between figures
\def\interlen{\rescale*8}
% offset of the label of each figure
\def\labeloffsetx{\rescale*2}
\def\labeloffsety{\rescale*3}

% factor by which to multiply lengths to get depths
\def\rotx{0.5*0.5}
\def\roty{0.5*0.866}

% draw a plate at #1 of width #2, length #3 and height #4
\def\plate#1#2#3#4{
\def\width{#2}
\def\length{#3}
\def\height{#4}

% the center
\path#1coordinate(O);

% draw first half of axes
\draw(O)++(-\axeslength,0)--(O);
\path(O)++(\rotx*\axeslength,\roty*\axeslength)coordinate(t);
\draw[->](O)++(\rotx*0.5*\width,\roty*0.5*\width)--(t);
\draw(O)++(0,-\axeslength)--(O);

% define points
\path(O)++(-0.5*\length,-0.5*\height)++(-0.5*\rotx*\width,-0.5*\roty*\width)coordinate(A);
\path(A)++(\length,0)coordinate(B);
\path(B)++(\rotx*\width,\roty*\width)coordinate(C);
\path(C)++(-\length,0)coordinate(D);
\path(D)++(0,\height)coordinate(E);
\path(E)++(-\rotx*\width,-\roty*\width)coordinate(F);
\path(F)++(\length,0)coordinate(G);
\path(G)++(\rotx*\width,\roty*\width)coordinate(H);

% fill and stroke the plate (covers part of the axes)
\fill[color=white](A)--(B)--(C)--(H)--(E)--(F)--(A);
\draw(A)--(B)--(C)--(H)--(E)--(F)--(G)--(H);
\draw(A)--(F);
\draw(B)--(G);

% draw the second half of the axes after having filled the plate
\path(O)++(\axeslength,0)coordinate(t);
\draw[->](O)++(0.5*\length,0)--(t);
\path(O)++(-\rotx*0.5*\width,-\roty*0.5*\width)coordinate(t);
\draw(O)++(-\rotx*\axeslength,-\roty*\axeslength)--(t);
\path(O)++(0,\axeslength)coordinate(t);
\draw[->](O)++(0,0.5*\height)--(t);
}

\begin{document}
\begin{tikzpicture}

% 3a
\plate{(0,0)}{\w}{\l}{\h}
\path(-\labeloffsetx,\labeloffsety)node{$3_a$};
% 3b
\plate{(\interlen,0)}{\l}{\w}{\h}
\path(\interlen,0)++(-\labeloffsetx,\labeloffsety)node{$3_b$};
% 1a
\plate{(2*\interlen,0)}{\l}{\h}{\w}
\path(2*\interlen,0)++(-\labeloffsetx,\labeloffsety)node{$1_a$};
% 1b
\plate{(0,-\interlen)}{\w}{\h}{\l}
\path(0,-\interlen)++(-\labeloffsetx,\labeloffsety)node{$1_b$};
% 2a
\plate{(\interlen,-\interlen)}{\h}{\w}{\l}
\path(\interlen,-\interlen)++(-\labeloffsetx,\labeloffsety)node{$2_a$};
% 2b
\plate{(2*\interlen,-\interlen)}{\h}{\l}{\w}
\path(2*\interlen,-\interlen)++(-\labeloffsetx,\labeloffsety)node{$2_b$};

\end{tikzpicture}
\end{document}