I need to make quite a few "first-angle projection" in Tikz (see Wikipedia ) for an exercise sheet, so I was wondering if there is a routine to make them?
By this I mean that I could give a certain number of 3d coordinates for points, define the edges (and perhaps the surfaces too) and then get the 6 required planar projections (without having to change each time the code for the planar coordinates of the projected points, ideally without having to specify which edges/surfaces are above the other).
Of course, the solution for just one planar projection would be enough...
Here is an example of such a solid. Of course I could write the planar projections by hand, but that would be very tedious to do that for all the others again.
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\tikzset{
MyPersp/.style={scale=1,x={(-0.35355cm,-0.35355cm)},y={(1cm,0cm)}, z={(0cm,1cm)}}
}
\begin{tikzpicture}[line cap=round, rounded corners=.1mm,MyPersp]
% vertices
\coordinate (A) at (0,0,0);
\coordinate (B) at (2,0,0);
\coordinate (C) at (2,2,0);
\coordinate (D) at (0,2,0);
\coordinate (E1) at (0,0,1);
\coordinate (E2) at (0,1,2);
\coordinate (E3) at (1,0,2);
\coordinate (F) at (2,0,2);
\coordinate (G) at (2,2,2);
\coordinate (H) at (0,2,2);
% edges and surfaces
\fill[white,opacity=.5,draw=black,thick] (A) -- (D) -- (H) -- (E2) -- (E1) -- (A);
\fill[white,opacity=.5,draw=black,thick] (A) -- (B) -- (C) -- (D) -- (A);
\fill[white,opacity=.5,draw=black,thick] (E1) -- (E2) -- (E3) -- (E1);
\fill[white,opacity=.5,draw=black,thick] (A) -- (B) -- (F) -- (E3) -- (E1) -- (A);
\fill[white,opacity=.5,draw=black,thick] (C) -- (D) -- (H) -- (G) -- (C);
\fill[white,opacity=.5,draw=black,thick] (B) -- (C) -- (G) -- (F) -- (B);
\fill[white,opacity=.5,draw=black,thick] (F) -- (G) -- (H) -- (E2) -- (E3) -- (F);
% names
\draw (A) node{A};
\draw (B) node{B};
\draw (C) node{C};
\draw (D) node{D};
\draw (F) node{F};
\draw (G) node{G};
\draw (H) node{H};
\end{tikzpicture}
\end{document}



MyPerspstyle (Sidenote: your projection is not a perspective view but a cabinet projection). You can use a styleorthographic view/.style={x={(0cm,0cm)},y={(1cm,0cm)},z={(0cm,1cm)}}and define views by rotating around axes, e.g.left view/.style={orthographic view,rotate around z=90}. Note that commands that are issued later still get drawn on top, even if they should be in the back with the current view. – Max Aug 31 '18 at 09:02