Fri, 06 Dec 2024 16:16:48 -0500
alg_tools now support stable, so return to edition 2021 now to allow stable rust.
21 | 1 | \documentclass[tikz]{standalone} |
2 | ||
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
3 | \input{plotsetup} |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
4 | |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
5 | \def\datapath{../res/cube} |
21 | 6 | |
7 | \begin{document} | |
8 | ||
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
9 | \begin{tikzpicture} |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
10 | \pgfplotsset{ |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
11 | onlyfront/.code = \pgfplotsset{x filter/.expression={% |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
12 | or(\thisrow{face} == 2, or(\thisrow{face} == 4, \thisrow{face} == 6)) ? x : nan% |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
13 | },}, |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
14 | onlyback/.code = \pgfplotsset{x filter/.expression={% |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
15 | or(\thisrow{face} == 1, or(\thisrow{face} == 3, \thisrow{face} == 5)) ? x : nan% |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
16 | },}, |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
17 | } |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
18 | |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
19 | \begin{axis}[illustr3d] |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
20 | % Hidden edges |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
21 | \addplot3[edge] coordinates {(0, 0, 0) (0, 1, 0) (0, 1, 1) }; |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
22 | \addplot3[edge] coordinates {(0, 1, 0) (1, 1, 0) }; |
21 | 23 | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
24 | % Data on hidden faces |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
25 | \addplot3[backdata] table[x=x,y=y,z=z] {\datapath/data.csv}; |
21 | 26 | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
27 | % Iterates on hidden faces |
24 | 28 | \addplot3[backiter1] table[x=x,y=y,z=z] {\datapath/x1_log.csv}; |
29 | \addplot3[backiter2] table[x=x,y=y,z=z] {\datapath/x2_log.csv}; | |
30 | \addplot3[backiter3] table[x=x,y=y,z=z] {\datapath/x3_log.csv}; | |
21 | 31 | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
32 | % Surface |
21 | 33 | \addplot3[ |
34 | surf, | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
35 | mesh/ordering=x varies, % the second input coordinate stays fixed while first varies |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
36 | mesh/cols=32, % number of first input coordinate points untils second changes |
21 | 37 | surfstyle, |
38 | ] table [ | |
39 | x = u, | |
40 | z = v, | |
41 | y expr = 0.0, | |
42 | point meta = \thisrow{value}, | |
43 | ] {\datapath/F4.csv}; | |
44 | \addplot3[ | |
45 | surf, | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
46 | mesh/ordering=x varies, % the second input coordinate stays fixed while first varies |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
47 | mesh/cols=32, % number of first input coordinate points untils second changes |
21 | 48 | surfstyle, |
49 | ] table [ | |
50 | x expr = 1.0, | |
51 | y = u, | |
52 | z = v, | |
53 | point meta = \thisrow{value}, | |
54 | ] {\datapath/F2.csv}; | |
55 | \addplot3[ | |
56 | surf, | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
57 | mesh/ordering=x varies, % the second input coordinate stays fixed while first varies |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
58 | mesh/cols=32, % number of first input coordinate points untils second changes |
21 | 59 | surfstyle, |
60 | ] table [ | |
61 | x = u, | |
62 | y = v, | |
63 | z expr = 1.0, | |
64 | point meta = \thisrow{value}, | |
65 | ] {\datapath/F6.csv}; | |
66 | ||
67 | % Edges | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
68 | \addplot3[edge] coordinates {(0, 0, 0) (1, 0, 0) (1, 0, 1) (0, 0, 1) (0, 0, 0)}; |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
69 | \addplot3[edge] coordinates {(0, 0, 1) (0, 1, 1) (1, 1, 1) (1, 0, 1)}; |
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
70 | \addplot3[edge] coordinates {(1, 0, 0) (1, 1, 0) (1, 1, 1)}; |
21 | 71 | |
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
72 | % Data |
21 | 73 | \addplot3[data,onlyfront] table[x=x,y=y,z=z] {\datapath/data.csv}; |
74 | \addlegendentry{Data} | |
75 | ||
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
76 | % Iterates |
24 | 77 | \addplot3[iter1,onlyfront] table[x=x,y=y,z=z] {\datapath/x1_log.csv}; |
78 | \addlegendentry{Iterates 1} | |
79 | \addplot3[iter2,onlyfront] table[x=x,y=y,z=z] {\datapath/x2_log.csv}; | |
80 | \addlegendentry{Iterates 2} | |
81 | \addplot3[iter3,onlyfront] table[x=x,y=y,z=z] {\datapath/x3_log.csv}; | |
82 | \addlegendentry{Iterates 3} | |
42 | 83 | |
84 | % Origin | |
85 | \addplot3[origin,onlyfront] table[x=x,y=y,z=z] {\datapath/origin.csv}; | |
86 | \addlegendentry{Origin} | |
21 | 87 | \end{axis} |
88 | \end{tikzpicture} | |
89 | ||
37
d7cd14b8ccc0
Basic cylinder implementation
Tuomo Valkonen <tuomov@iki.fi>
parents:
34
diff
changeset
|
90 | \end{document} |