# Draw a semicircle that has a segment as its diameter

I'm trying to draw a simple schematic of an ATM machine and I can not represent the counter. The schema of a counter is a semicircle with a segment. Their position is on the right extreme and on the bottom (I managed to draw only the segments).

This is my code:

\documentclass{scrbook}

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}

\usepackage{amsfonts, amsthm, amsmath, braket}
\usepackage{tikz}
\usetikzlibrary{angles, quotes,calc,patterns}

\begin{document}

\begin{tikzpicture}

\draw[thick] (0,0) rectangle (1.5, 0.5);

%== CUBO
\draw[thick] (1.5, 0.25) -- (3,0.25);
\draw[thick] (3,0.25) -- (3, -0.25) -- (4, -0.25) -- (4, 0.75) -- (3, 0.75) -- (3, 0.25);
\draw[thick] (3, 0.75) -- (3.3, 0.95);
\draw[thick] (4, 0.75) -- (4.3, 0.95);
\draw[thick] (3.3, 0.95) -- (4.3, 0.95);
\draw[thick] (4, -0.25) -- (4.3, -0.05);
\draw[thick] (4.3, 0.95) -- (4.3, -0.05);

\draw[dashed] (5.5,0.21) -- (4, 0.21);
\draw[dashed] (5.5,0.29) -- (4, 0.29);
\draw[thick] (4.3, 0.21) -- (5.5,0.21);
\draw[thick] (4.3, 0.29) -- (5.5,0.29);

\draw[thick] (5.5,0.29) -- (5.5, -0.25) -- (5.8, -0.05) -- (5.8, 0.95);
\draw[thick] (5.5,0.29) -- (5.5, 0.75) -- (5.8, 0.95);

\draw[dashed] (5.5, 0.21) -- (5.8, 0.21);
\draw[dashed] (5.5, 0.29) -- (5.8, 0.29);

\draw[thick] (6.5, 0.29) -- (6.5, -0.25);
\draw[thick, ->] (6.5, 0.29) -- (6.5, 0.95);

\draw[thick] (5.8, 0.21) -- (7.5, 0.21);
\draw[thick] (5.8, 0.29) -- (7.5, 0.29);

\draw[thick] (7.5, 0.25) -- (7.5, -0.25) -- (8.5,-0.25) -- (8.5, 0.75) -- (7.5, 0.75) -- (7.5, 0.25);
\draw[thick] (7.5, 0.75) -- (8.5,-0.25);

\draw[dashed] (7.5, 0.21) -- (8, 0.21) -- (8, -0.22);
%P_\theta
\draw[thick] (8, -0.22) -- (8, -1.5);
\draw[thick] (8, -1.5) -- (7.5, -1.5) -- (7.5, -2.5) -- (8.5, -2.5) -- (8.5, -1.5) -- (7.5, -1.5);

\draw[thick] (8, -2.5) -- (8, -3.5);
\draw[thick] (8, -3.5) -- (7.5, -3.5);
\draw[thick] (8, -3.5) -- (8.5, -3.5);

%P_\varphi
\draw[thick] (7.5, 0.29) -- (10, 0.29);
\draw[thick] (10, 0.29) -- (10, -0.25) -- (11, -0.25) -- (11, 0.75) -- (10, 0.75) -- (10, 0.29);

\draw[thick] (11, 0.29) -- (12.5, 0.29);
\draw[thick] (12.5, 0.29) -- (12.5, -0.3);
\draw[thick] (12.5, 0.29) -- (12.5, 0.8);
%\draw (12.5, 0.8) arc (-90:180:1);

\end{tikzpicture}

\end{document}


I don't know exactly how you want it, but here is a suggestion:

(The code can be simplified, but that's not really necessary, since that is just a quick answer.)

\documentclass{scrbook}

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}

\usepackage{amsfonts, amsthm, amsmath, braket}
\usepackage{tikz}
\usetikzlibrary{angles, quotes,calc,patterns}

\begin{document}

\begin{tikzpicture}

\draw[thick] (0,0) rectangle (1.5, 0.5);

%== CUBO
\draw[thick] (1.5, 0.25) -- (3,0.25);
\draw[thick] (3,0.25) -- (3, -0.25) -- (4, -0.25) -- (4, 0.75) -- (3, 0.75) -- (3, 0.25);
\draw[thick] (3, 0.75) -- (3.3, 0.95);
\draw[thick] (4, 0.75) -- (4.3, 0.95);
\draw[thick] (3.3, 0.95) -- (4.3, 0.95);
\draw[thick] (4, -0.25) -- (4.3, -0.05);
\draw[thick] (4.3, 0.95) -- (4.3, -0.05);

\draw[dashed] (5.5,0.21) -- (4, 0.21);
\draw[dashed] (5.5,0.29) -- (4, 0.29);
\draw[thick] (4.3, 0.21) -- (5.5,0.21);
\draw[thick] (4.3, 0.29) -- (5.5,0.29);

\draw[thick] (5.5,0.29) -- (5.5, -0.25) -- (5.8, -0.05) -- (5.8, 0.95);
\draw[thick] (5.5,0.29) -- (5.5, 0.75) -- (5.8, 0.95);

\draw[dashed] (5.5, 0.21) -- (5.8, 0.21);
\draw[dashed] (5.5, 0.29) -- (5.8, 0.29);

\draw[thick] (6.5, 0.29) -- (6.5, -0.25);
\draw[thick, ->] (6.5, 0.29) -- (6.5, 0.95);

\draw[thick] (5.8, 0.21) -- (7.5, 0.21);
\draw[thick] (5.8, 0.29) -- (7.5, 0.29);

\draw[thick] (7.5, 0.25) -- (7.5, -0.25) -- (8.5,-0.25) -- (8.5, 0.75) -- (7.5, 0.75) -- (7.5, 0.25);
\draw[thick] (7.5, 0.75) -- (8.5,-0.25);

\draw[dashed] (7.5, 0.21) -- (8, 0.21) -- (8, -0.22);
%P_\theta
\draw[thick] (8, -0.22) -- (8, -1.5);
\draw[thick] (8, -1.5) -- (7.5, -1.5) -- (7.5, -2.5) -- (8.5, -2.5) -- (8.5, -1.5) -- (7.5, -1.5);

\draw[thick] (8, -2.5) -- (8, -3.5);
\draw[thick] (8, -3.5) -- (7.5, -3.5);
\draw[thick] (8, -3.5) -- (8.5, -3.5);

%P_\varphi
\draw[thick] (7.5, 0.29) -- (10, 0.29);
\draw[thick] (10, 0.29) -- (10, -0.25) -- (11, -0.25) -- (11, 0.75) -- (10, 0.75) -- (10, 0.29);

\draw[thick] (11, 0.29) -- (12.5, 0.29);
\draw[thick] (12.5, 0.29) -- (12.5, -0.3);
\draw[thick] (12.5, 0.29) -- (12.5, 0.8);
\draw (12.5, -.3) arc (-90:90:.55);

\end{tikzpicture}

\end{document}


Here is the output:

• Thanks for the solution !! You talk about simplifications, can you give me some suggestions for improve my knowledge about tikz? – Ilmionome456 Aug 9 '18 at 15:50
• @IImionome456: Actually yes – there are just (at least for me) two big tips: (1) pracitce a lot – this means that you try to do almost everything in TikZ (street signs, things that you see in everyday life) and (2) when you start to code you have always to ask you: What exactly do I want to draw/do; What is the rough idea to achieve this; After the idea is completed than you have to see some things that can be simplified – through expirience or questions. – current_user Aug 9 '18 at 16:39