platonicsolids

Platonic solids in Tikz
git clone https://git.tronto.net/platonicsolids
Download | Log | Files | Refs | README

dodecahedron.tex (1544B)


      1 \input{settings.ttt}
      2 
      3 \begin{document}
      4 \begin{tikzpicture}[scale=2, line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
      5 
      6 \input{coord-dod.tex}
      7 
      8 % Background varying in size depending on the main figure
      9 \fill[color=white] (-2,-2) rectangle (2,2);
     10 
     11 \filldraw[very thick, draw=my-color-draw-main,
     12 	  fill=my-color-fill-main, fill opacity = 0.5]
     13 	(P0) -- (P8) -- (P10) -- (P2) -- (P16) -- cycle;
     14 
     15 \filldraw[very thick, draw=my-color-draw-main,
     16 	  fill=my-color-fill-main, fill opacity = 0.2]
     17 	(P4) -- (P8) -- (P10) -- (P6) -- (P17) -- cycle;
     18 
     19 \filldraw[very thick, draw=my-color-draw-main,
     20 	  fill=my-color-fill-main, fill opacity = 0.5]
     21 	(P0) -- (P8) -- (P4) -- (P14) -- (P12) -- cycle;
     22 
     23 \filldraw[very thick, draw=my-color-draw-main,
     24 	  fill=my-color-fill-main, fill opacity = 0.8]
     25 	(P16) -- (P0) -- (P12) -- (P1) -- (P18) -- cycle;
     26 
     27 \filldraw[very thick, draw=my-color-draw-main,
     28 	  fill=my-color-fill-main, fill opacity = 0.8]
     29 	(P1) -- (P12) -- (P14) -- (P5) -- (P9) -- cycle;
     30 
     31 \filldraw[very thick, draw=my-color-draw-main,
     32 	  fill=my-color-fill-main, fill opacity = 0.5]
     33 	(P4) -- (P14) -- (P5) -- (P19) -- (P17) -- cycle;
     34 
     35 \draw[very thick, draw=my-color-draw-main, dashed] (P19) -- (P7) -- (P11) -- (P9);
     36 \draw[very thick, draw=my-color-draw-main, dashed] (P7) -- (P15) -- (P6);
     37 \draw[very thick, draw=my-color-draw-main, dashed] (P15) -- (P13) -- (P2);
     38 \draw[very thick, draw=my-color-draw-main, dashed] (P13) -- (P3) -- (P18);
     39 \draw[very thick, draw=my-color-draw-main, dashed] (P3) -- (P11);
     40 
     41 
     42 \end{tikzpicture}
     43 \end{document}
     44