The plot tries to draw the joints and links of a robotic manipulator. Initially I defined the points for the joints as node
s and this resulted in some shift when lines were later drawn between them. Based on answers from SE, I changed this into a three step process where I first defined coordinate
s, then drew joints at the coordinates and later connected them with lines.
However, now the lines go inside the joint. I want to have the property of nodes where lines are drawn only upto node's borders and the property of coordinates where the lines are drawn exactly to the coordinate? (I realise that I can simply draw the joints after drawing the links thereby overwriting them, but i prefer to have the nodes as unfilled circles as in this figure for other reasons)
How do I achieve this.
MWE and results with nodes and coordinates below.
\documentclass[tikz]{standalone}
\usetikzlibrary{math}
\begin{document}
\foreach \mynodes/\numnodes in {{1/0,2/90,3/0}/3}{%
\begin{tikzpicture}[scale=1]
\draw (-1,-1) [help lines] grid (3,2);
% define coordinates for joints
\node (0,0)(n0){};
\path (0,0)
foreach \nodeid/\nodeangle in \mynodes{
++(\nodeangle:1) node(n\nodeid){}
};
%draw links
\draw [red, ultra thick](0,0)
foreach \nodeid in {1,...,\numnodes}{
-- (n\nodeid)
};
%draw joints
\foreach \nodeid in {0,1,...,\numnodes}{%
\draw [black, thick](n\nodeid) circle [radius=1mm];
};
\end{tikzpicture}
}
\end{document}