tikz add tag
Anonymous 1123
I read Johnson solid at [here](https://en.wikipedia.org/wiki/Johnson_solid). By using *Mathematica* with syntax
`PolyhedronData[{"Johnson", 80}, {"Vertices", "Faces"}]` I got
```
{{{-2.19149, -0.351484, -0.244698}, {-2.10378, -0.155834, 
   0.732046}, {-2.04429, 0.501655, -0.745182}, {-1.90236, 0.818222, 
   0.835221}, {-1.86559, 
   1.22457, -0.0777559}, {-1.79587, -0.866028, -1.00544}, {-1.64867, \
-0.0128901, -1.50592}, {-1.56623, -0.353811, 1.55171}, {-1.44725, 
   0.961166, -1.40275}, {-1.36482, 0.620245, 1.65488}, {-1.26855, 
   1.68408, -0.735321}, {-1.21761, 1.47338, 1.1544}, {-1.18084, 
   1.87973, 
   0.241422}, {-1.06803, -1.50293, -1.2596}, {-0.829841, -0.122523, \
-2.0694}, {-0.784177, -0.869794, 1.90121}, {-0.628423, 
   0.851534, -1.96623}, {-0.470986, -1.04342, -1.91716}, {-0.458277, 
   0.706262, 2.06815}, {-0.339292, 2.02124, -0.886307}, {-0.31107, 
   1.5594, 1.56766}, {-0.28597, -2.01891, -0.9101}, {-0.251577, 
   2.21689, 0.0904368}, {-0.0994221, -0.214633, 
   2.22039}, {-0.0563312, -1.5067, 1.64705}, {0.0563312, 
   1.5067, -1.64705}, {0.0994221, 
   0.214633, -2.22039}, {0.251577, -2.21689, -0.0904368}, {0.28597, 
   2.01891, 
   0.9101}, {0.31107, -1.5594, -1.56766}, {0.339292, -2.02124, 
   0.886307}, {0.458277, -0.706262, -2.06815}, {0.470986, 1.04342, 
   1.91716}, {0.628423, -0.851534, 1.96623}, {0.784177, 
   0.869794, -1.90121}, {0.829841, 0.122523, 2.0694}, {1.06803, 
   1.50293, 
   1.2596}, {1.18084, -1.87973, -0.241422}, {1.21761, -1.47338, \
-1.1544}, {1.26855, -1.68408, 
   0.735321}, {1.36482, -0.620245, -1.65488}, {1.44725, -0.961166, 
   1.40275}, {1.56623, 0.353811, -1.55171}, {1.64867, 0.0128901, 
   1.50592}, {1.79587, 0.866028, 1.00544}, {1.86559, -1.22457, 
   0.0777559}, {1.90236, -0.818222, -0.835221}, {2.04429, -0.501655, 
   0.745182}, {2.10378, 0.155834, -0.732046}, {2.19149, 0.351484, 
   0.244698}}, {{23, 20, 11, 13}, {13, 11, 5}, {11, 9, 3, 5}, {20, 26,
    17, 9, 11}, {9, 7, 3}, {3, 7, 6, 1}, {17, 15, 7, 9}, {17, 27, 
   15}, {27, 32, 18, 15}, {15, 18, 14, 6, 7}, {32, 30, 18}, {18, 30, 
   22, 14}, {13, 5, 4, 12}, {12, 4, 10}, {4, 2, 8, 10}, {5, 3, 1, 2, 
   4}, {25, 16, 8, 2, 1, 6, 14, 22, 28, 31}, {12, 10, 19, 21}, {21, 
   19, 33}, {19, 24, 36, 33}, {10, 8, 16, 24, 19}, {24, 34, 36}, {36, 
   34, 42, 44}, {16, 25, 34, 24}, {25, 31, 40, 42, 34}, {31, 28, 38, 
   40}, {21, 33, 37, 29}, {29, 37, 45, 50, 49, 43, 35, 26, 20, 
   23}, {33, 36, 44, 45, 37}, {44, 48, 50, 45}, {44, 42, 48}, {42, 40,
    46, 48}, {48, 46, 47, 49, 50}, {40, 38, 46}, {46, 38, 39, 
   47}, {26, 35, 27, 17}, {49, 47, 41, 43}, {43, 41, 32, 27, 35}, {47,
    39, 41}, {41, 39, 30, 32}, {23, 13, 12, 21, 29}, {39, 38, 28, 22, 
   30}}}
```
How can I draw 80'th Johnson solid by using data of Mathematica?
Top Answer
marmot
Here are some keys that allow you to import both lists.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools} % https://github.com/marmotghost/tikz-3dtools
\makeatletter 
\tikzset{3d/.cd,% may become part of 3dtools if sufficiently tested
reset vertex counter/.code={\c@pgf@counta0\relax},
add vertex/.code={\advance\c@pgf@counta by1\relax
\path (#1) coordinate (\the\c@pgf@counta);},
define vertices/.code={\c@pgf@counta0\relax
\tikzset{3d/add vertex/.list={#1}}},%
append vertices/.code={\tikzset{3d/add vertex/.list={#1}}},%
/tikz/3d/polyhedron/.cd,
create face from vertices/.code={\let\pgfutil@tmpa\relax%
\pgfutil@for\pgfutil@tmpb:={#1}\do{%
\ifx\pgfutil@tmpa\relax
\edef\pgfutil@tmpa{{(\pgfkeysvalueof{/tikz/name prefix}\pgfutil@tmpb)}}%
\else
\edef\pgfutil@tmpa{\pgfutil@tmpa,{(\pgfkeysvalueof{/tikz/name prefix}\pgfutil@tmpb)}}%
\fi
}%
\tikzset{3d/polyhedron/draw face with corners/.expanded=\pgfutil@tmpa}%
},%
create faces from vertex list/.style={/tikz/3d/polyhedron/create face from vertices/.list={#1}}%
}
\makeatother
\begin{document}
\pgfdeclarelayer{background} 
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground} 
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[same bounding box=A,line cap=round,line join=round,
	3d/install view={phi=\Angle,psi=0,theta=70}]
 % step 1: define vertices (with an optional name prefix)
 \edef\lstV{{-2.19149,-0.351484,-0.244698},{-2.10378,-0.155834,0.732046},{-2.04429,0.501655,-0.745182},{-1.90236,0.818222,0.835221},{-1.86559,1.22457,-0.0777559},{-1.79587,-0.866028,-1.00544},{-1.64867,-0.0128901,-1.50592},{-1.56623,-0.353811,1.55171},{-1.44725,0.961166,-1.40275},{-1.36482,0.620245,1.65488},{-1.26855,1.68408,-0.735321},{-1.21761,1.47338,1.1544},{-1.18084,1.87973,0.241422},{-1.06803,-1.50293,-1.2596},{-0.829841,-0.122523,-2.0694},{-0.784177,-0.869794,1.90121},{-0.628423,0.851534,-1.96623},{-0.470986,-1.04342,-1.91716},{-0.458277,0.706262,2.06815},{-0.339292,2.02124,-0.886307},{-0.31107,1.5594,1.56766},{-0.28597,-2.01891,-0.9101},{-0.251577,2.21689,0.0904368},{-0.0994221,-0.214633,2.22039},{-0.0563312,-1.5067,1.64705},{0.0563312,1.5067,-1.64705},{0.0994221,0.214633,-2.22039},{0.251577,-2.21689,-0.0904368},{0.28597,2.01891,0.9101},{0.31107,-1.5594,-1.56766},{0.339292,-2.02124,0.886307},{0.458277,-0.706262,-2.06815},{0.470986,1.04342,1.91716},{0.628423,-0.851534,1.96623},{0.784177,0.869794,-1.90121},{0.829841,0.122523,2.0694},{1.06803,1.50293,1.2596},{1.18084,-1.87973,-0.241422},{1.21761,-1.47338,-1.1544},{1.26855,-1.68408,0.735321},{1.36482,-0.620245,-1.65488},{1.44725,-0.961166,1.40275},{1.56623,0.353811,-1.55171},{1.64867,0.0128901,1.50592},{1.79587,0.866028,1.00544},{1.86559,-1.22457,0.0777559},{1.90236,-0.818222,-0.835221},{2.04429,-0.501655,0.745182},{2.10378,0.155834,-0.732046},{2.19149,0.351484,0.244698}}
 \tikzset{name prefix=V,%<- used for all vertices
 	3d/define vertices/.expanded={\lstV}}
 % step 2: define faces
 \edef\lstFaces{{23,20,11,13},{13,11,5},{11,9,3,5},{20,26,17,9,11},{9,7,3},{3,7,6,1},{17,15,7,9},{17,27,15},{27,32,18,15},{15,18,14,6,7},{32,30,18},{18,30,22,14},{13,5,4,12},{12,4,10},{4,2,8,10},{5,3,1,2,4},{25,16,8,2,1,6,14,22,28,31},{12,10,19,21},{21,19,33},{19,24,36,33},{10,8,16,24,19},{24,34,36},{36,34,42,44},{16,25,34,24},{25,31,40,42,34},{31,28,38,40},{21,33,37,29},{29,37,45,50,49,43,35,26,20,23},{33,36,44,45,37},{44,48,50,45},{44,42,48},{42,40,46,48},{48,46,47,49,50},{40,38,46},{46,38,39,47},{26,35,27,17},{49,47,41,43},{43,41,32,27,35},{47,39,41},{41,39,30,32},{23,13,12,21,29},{39,38,28,22,30}}
 % step 3: draw polyhedron
 \tikzset{3d/polyhedron/.cd,
	fore layer=foreground,back layer=background, 
	fore/.append style={fill opacity=0.7},  
	back/.append style={fill opacity=0.7}, 
 	create faces from vertex list/.expanded={\lstFaces}}
%
 \pgfmathtruncatemacro{\mydim}{dim({\lstV})} % number of vertices
 \foreach \X in {1,...,\mydim}
  {\edef\p{\pgfkeysvalueof{/tikz/name prefix}\X}
  \pgfmathsetmacro{\myp}{TD("(\p)")}
  \pgfmathtruncatemacro{\mysd}{sign(screendepth(\myp))}
  \ifnum\mysd<0
   \draw[fill=black,on layer=background] (\p) %node[above,scale=0.3]{$\p$} 
	  circle[radius=0.8 pt];
  \else
   \draw[fill=black,on layer=foreground] (\p) %node[above,scale=0.3]{$\p$} 
   circle[radius=0.8 pt];
  \fi}
\end{tikzpicture}}
\end{document} 
```
![ani.gif](/image?hash=6ad702ee12eed7cb5c99ca57c8427712b7214cb61f9042434363ef332e6ad4c2)

These keys have been added to the [`3dtools` library](https://github.com/marmotghost/tikz-3dtools). So with the most recent version you can use a shorter code.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools} % https://github.com/marmotghost/tikz-3dtools
\begin{document}
\pgfdeclarelayer{background} 
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground} 
\foreach \Angle in {5,15,...,355}
{\begin{tikzpicture}[same bounding box=A,line cap=round,line join=round,
	3d/install view={phi=\Angle,psi=0,theta=70}]
 % step 1: define vertices (with an optional name prefix)
 \edef\lstV{{-2.19149,-0.351484,-0.244698},{-2.10378,-0.155834,0.732046},{-2.04429,0.501655,-0.745182},{-1.90236,0.818222,0.835221},{-1.86559,1.22457,-0.0777559},{-1.79587,-0.866028,-1.00544},{-1.64867,-0.0128901,-1.50592},{-1.56623,-0.353811,1.55171},{-1.44725,0.961166,-1.40275},{-1.36482,0.620245,1.65488},{-1.26855,1.68408,-0.735321},{-1.21761,1.47338,1.1544},{-1.18084,1.87973,0.241422},{-1.06803,-1.50293,-1.2596},{-0.829841,-0.122523,-2.0694},{-0.784177,-0.869794,1.90121},{-0.628423,0.851534,-1.96623},{-0.470986,-1.04342,-1.91716},{-0.458277,0.706262,2.06815},{-0.339292,2.02124,-0.886307},{-0.31107,1.5594,1.56766},{-0.28597,-2.01891,-0.9101},{-0.251577,2.21689,0.0904368},{-0.0994221,-0.214633,2.22039},{-0.0563312,-1.5067,1.64705},{0.0563312,1.5067,-1.64705},{0.0994221,0.214633,-2.22039},{0.251577,-2.21689,-0.0904368},{0.28597,2.01891,0.9101},{0.31107,-1.5594,-1.56766},{0.339292,-2.02124,0.886307},{0.458277,-0.706262,-2.06815},{0.470986,1.04342,1.91716},{0.628423,-0.851534,1.96623},{0.784177,0.869794,-1.90121},{0.829841,0.122523,2.0694},{1.06803,1.50293,1.2596},{1.18084,-1.87973,-0.241422},{1.21761,-1.47338,-1.1544},{1.26855,-1.68408,0.735321},{1.36482,-0.620245,-1.65488},{1.44725,-0.961166,1.40275},{1.56623,0.353811,-1.55171},{1.64867,0.0128901,1.50592},{1.79587,0.866028,1.00544},{1.86559,-1.22457,0.0777559},{1.90236,-0.818222,-0.835221},{2.04429,-0.501655,0.745182},{2.10378,0.155834,-0.732046},{2.19149,0.351484,0.244698}}
 \tikzset{name prefix=V,%<- used for all vertices
 	3d/define vertices/.expanded={\lstV}}
 % step 2: define faces
 \edef\lstFaces{{23,20,11,13},{13,11,5},{11,9,3,5},{20,26,17,9,11},{9,7,3},{3,7,6,1},{17,15,7,9},{17,27,15},{27,32,18,15},{15,18,14,6,7},{32,30,18},{18,30,22,14},{13,5,4,12},{12,4,10},{4,2,8,10},{5,3,1,2,4},{25,16,8,2,1,6,14,22,28,31},{12,10,19,21},{21,19,33},{19,24,36,33},{10,8,16,24,19},{24,34,36},{36,34,42,44},{16,25,34,24},{25,31,40,42,34},{31,28,38,40},{21,33,37,29},{29,37,45,50,49,43,35,26,20,23},{33,36,44,45,37},{44,48,50,45},{44,42,48},{42,40,46,48},{48,46,47,49,50},{40,38,46},{46,38,39,47},{26,35,27,17},{49,47,41,43},{43,41,32,27,35},{47,39,41},{41,39,30,32},{23,13,12,21,29},{39,38,28,22,30}}
 % step 3: draw polyhedron
 \tikzset{3d/polyhedron/.cd,
	fore layer=foreground,back layer=background, 
	fore/.append style={fill opacity=0.7},  
	back/.append style={fill opacity=0.7}, 
 	create faces from vertex list/.expanded={\lstFaces}}
%
 \pgfmathtruncatemacro{\mydim}{dim({\lstV})} % number of vertices
 \foreach \X in {1,...,\mydim}
  {\edef\p{\pgfkeysvalueof{/tikz/name prefix}\X}
  \pgfmathsetmacro{\myp}{TD("(\p)")}
  \pgfmathtruncatemacro{\mysd}{sign(screendepth(\myp))}
  \ifnum\mysd<0
   \draw[fill=black,on layer=background] (\p) %node[above,scale=0.3]{$\p$} 
	  circle[radius=0.8 pt];
  \else
   \draw[fill=black,on layer=foreground] (\p) %node[above,scale=0.3]{$\p$} 
   circle[radius=0.8 pt];
  \fi}
\end{tikzpicture}}
\end{document} 
```

This does seem to work with arbitrary convex polyhedra. Notice that you may want to always remove spaces in `\lstFaces`, Ti*k*Z allows spaces in coordinate names, and they are created without spaces in `3d/define vertices`.
```
\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{3dtools} % https://github.com/marmotghost/tikz-3dtools
\begin{document}
\pgfdeclarelayer{background} 
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground} 
\foreach \Angle in {55} % {5,15,...,355}
{\begin{tikzpicture}[same bounding box=A,line cap=round,line join=round,
	3d/install view={phi=\Angle,psi=0,theta=70}]
 % step 1: define vertices (with an optional name prefix)
 \edef\lstV{{-1.,-1.30902,-3.42705},{-1.,-1.30902,3.42705},{-1.,1.30902,-3.42705},{-1.,1.30902,3.42705},{-0.5,-0.5,-3.73607},{-0.5,-0.5,3.73607},{-0.5,0.5,-3.73607},{-0.5,0.5,3.73607},{-0.5,-3.73607,-0.5},{-0.5,-3.73607,0.5},{-0.5,-2.11803,-3.11803},{-0.5,-2.11803,3.11803},{-0.5,3.73607,-0.5},{-0.5,3.73607,0.5},{-0.5,2.11803,-3.11803},{-0.5,2.11803,3.11803},{0.5,-0.5,-3.73607},{0.5,-0.5,3.73607},{0.5,0.5,-3.73607},{0.5,0.5,3.73607},{0.5,-3.73607,-0.5},{0.5,-3.73607,0.5},{0.5,-2.11803,-3.11803},{0.5,-2.11803,3.11803},{0.5,3.73607,-0.5},{0.5,3.73607,0.5},{0.5,2.11803,-3.11803},{0.5,2.11803,3.11803},{1.,-1.30902,-3.42705},{1.,-1.30902,3.42705},{1.,1.30902,-3.42705},{1.,1.30902,3.42705},{-3.42705,-1.,-1.30902},{-3.42705,-1.,1.30902},{-3.42705,1.,-1.30902},{-3.42705,1.,1.30902},{-2.92705,-1.80902,-1.61803},{-2.92705,-1.80902,1.61803},{-2.92705,1.80902,-1.61803},{-2.92705,1.80902,1.61803},{-1.80902,-1.61803,-2.92705},{-1.80902,-1.61803,2.92705},{-1.80902,1.61803,-2.92705},{-1.80902,1.61803,2.92705},{-1.30902,-3.42705,-1.},{-1.30902,-3.42705,1.},{-1.30902,-2.42705,-2.61803},{-1.30902,-2.42705,2.61803},{-1.30902,2.42705,-2.61803},{-1.30902,2.42705,2.61803},{-1.30902,3.42705,-1.},{-1.30902,3.42705,1.},{-2.61803,-1.30902,-2.42705},{-2.61803,-1.30902,2.42705},{-2.61803,1.30902,-2.42705},{-2.61803,1.30902,2.42705},{-3.73607,-0.5,-0.5},{-3.73607,-0.5,0.5},{-3.73607,0.5,-0.5},{-3.73607,0.5,0.5},{-1.61803,-2.92705,-1.80902},{-1.61803,-2.92705,1.80902},{-1.61803,2.92705,-1.80902},{-1.61803,2.92705,1.80902},{-3.11803,-0.5,-2.11803},{-3.11803,-0.5,2.11803},{-3.11803,0.5,-2.11803},{-3.11803,0.5,2.11803},{-2.11803,-3.11803,-0.5},{-2.11803,-3.11803,0.5},{-2.11803,3.11803,-0.5},{-2.11803,3.11803,0.5},{-2.42705,-2.61803,-1.30902},{-2.42705,-2.61803,1.30902},{-2.42705,2.61803,-1.30902},{-2.42705,2.61803,1.30902},{1.61803,-2.92705,-1.80902},{1.61803,-2.92705,1.80902},{1.61803,2.92705,-1.80902},{1.61803,2.92705,1.80902},{2.42705,-2.61803,-1.30902},{2.42705,-2.61803,1.30902},{2.42705,2.61803,-1.30902},{2.42705,2.61803,1.30902},{3.73607,-0.5,-0.5},{3.73607,-0.5,0.5},{3.73607,0.5,-0.5},{3.73607,0.5,0.5},{2.11803,-3.11803,-0.5},{2.11803,-3.11803,0.5},{2.11803,3.11803,-0.5},{2.11803,3.11803,0.5},{1.30902,-3.42705,-1.},{1.30902,-3.42705,1.},{1.30902,-2.42705,-2.61803},{1.30902,-2.42705,2.61803},{1.30902,2.42705,-2.61803},{1.30902,2.42705,2.61803},{1.30902,3.42705,-1.},{1.30902,3.42705,1.},{2.61803,-1.30902,-2.42705},{2.61803,-1.30902,2.42705},{2.61803,1.30902,-2.42705},{2.61803,1.30902,2.42705},{3.11803,-0.5,-2.11803},{3.11803,-0.5,2.11803},{3.11803,0.5,-2.11803},{3.11803,0.5,2.11803},{1.80902,-1.61803,-2.92705},{1.80902,-1.61803,2.92705},{1.80902,1.61803,-2.92705},{1.80902,1.61803,2.92705},{2.92705,-1.80902,-1.61803},{2.92705,-1.80902,1.61803},{2.92705,1.80902,-1.61803},{2.92705,1.80902,1.61803},{3.42705,-1.,-1.30902},{3.42705,-1.,1.30902},{3.42705,1.,-1.30902},{3.42705,1.,1.30902}}
 \tikzset{name prefix=V,%<- used for all vertices
 	3d/define vertices/.expanded={\lstV}}
 % step 2: define faces
 \edef\lstFaces{{2,6,8,4,44,56,68,66,54,42},{109,29,17,19,31,111,103,107,105,101},{24,30,18,6,2,12},{7,3,15,27,31,19},{58,57,33,37,73,69,70,74,38,34},{84,116,120,88,87,119,115,83,91,92},{90,89,81,113,117,85,86,118,114,82},{36,40,76,72,71,75,39,35,59,60},{5,17,29,23,11,1},{4,8,20,32,28,16},{67,55,43,3,7,5,1,41,53,65},{18,30,110,102,106,108,104,112,32,20},{79,83,115,103,111,97},{38,74,62,48,42,54},{4,16,50,44},{23,29,109,95},{96,110,30,24},{43,49,15,3},{53,41,47,61,73,37},{98,112,104,116,84,80},{69,45,9,10,46,70},{26,100,92,91,99,25},{82,114,102,110,96,78},{55,39,75,63,49,43},{1,11,47,41},{28,32,112,98},{61,47,11,23,95,77,93,21,9,45},{50,16,28,98,80,100,26,14,52,64},{97,111,31,27},{42,48,12,2},{44,50,64,76,40,56},{77,95,109,101,113,81},{63,51,13,25,99,79,97,27,15,49},{46,10,22,94,78,96,24,12,48,62},{52,14,13,51,71,72},{22,21,93,89,90,94},{115,119,107,103},{34,38,54,66},{71,51,63,75},{94,90,82,78},{114,118,106,102},{35,39,55,67},{70,46,62,74},{99,91,83,79},{65,53,37,33},{104,108,120,116},{77,81,89,93},{76,64,52,72},{59,35,67,65,33,57},{106,118,86,88,120,108},{68,56,40,36},{101,105,117,113},{80,84,92,100},{73,61,45,69},{34,66,68,36,60,58},{105,107,119,87,85,117},{7,19,17,5},{6,18,20,8},{14,26,25,13},{9,21,22,10},{58,60,59,57},{85,87,88,86}}
 % step 3: draw polyhedron
 \tikzset{3d/polyhedron/.cd,
	fore layer=foreground,back layer=background, 
	fore/.append style={fill opacity=0.7},  
	back/.append style={fill opacity=0.7}, 
 	create faces from vertex list/.expanded={\lstFaces}}
%
 \pgfmathtruncatemacro{\mydim}{dim({\lstV})} % number of vertices
 \foreach \X in {1,...,\mydim}
  {\edef\p{\pgfkeysvalueof{/tikz/name prefix}\X}
  \pgfmathsetmacro{\myp}{TD("(\p)")}
  \pgfmathtruncatemacro{\mysd}{sign(screendepth(\myp))}
  \ifnum\mysd<0
   \draw[fill=black,on layer=background] (\p) %node[above,scale=0.3]{$\p$} 
	  circle[radius=0.8 pt];
  \else
   \draw[fill=black,on layer=foreground] (\p) %node[above,scale=0.3]{$\p$} 
   circle[radius=0.8 pt];
  \fi}
\end{tikzpicture}}
\end{document} 
```
![Screen Shot 2021-02-06 at 7.30.55 AM.png](/image?hash=0a6c7d887938d73b6c68f55a0dab86127237a41a25bba11293f5f901cb04c9a0)

Enter question or answer id or url (and optionally further answer ids/urls from the same question) from

Separate each id/url with a space. No need to list your own answers; they will be imported automatically.