答案1
众多可能性之一。
\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{shapes.misc}
\begin{document}
\begin{tikzpicture}[bullet/.style={fill,circle,inner sep=2pt}]
\node[rounded rectangle,draw,minimum width=3cm,minimum height=4mm,rotate=20](A) at (0,0){};
\node[rounded rectangle,draw,minimum width=3cm,minimum
height=4mm,rotate=80,anchor=west](B)
at ([xshift=-1mm]A.south east){};
\node[bullet,shift={(200:2mm)}] at (A.east){};
\node[bullet,shift={(20:2mm)}] at (A.west){};
\end{tikzpicture}
\end{document}
答案2
只是另一种解决方案。
\documentclass[tikz,border=3.14mm]{standalone}
\begin{document}
\begin{tikzpicture}
\fill circle(2pt) coordinate(a) ++(20:2cm) circle(2pt) coordinate(b);
\draw (a)++(110:2mm) arc (110:290:2mm)--++(20:2cm) arc (-70:110:2mm)--cycle;
\draw (b)++(170:2mm) arc (170:350:2mm)--++(80:2cm) arc (-10:170:2mm)--cycle;
\end{tikzpicture}
\end{document}
答案3
答案4
另一个选择:这个元帖子使用该mplib
包,因此您需要使用lualatex
它来编译它。在 Overleaf 中,点击左上角的“菜单”,选择“LuaLaTeX”作为编译器。
\documentclass[border=5mm]{standalone}
\usepackage{luatex85}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
vardef arm(expr extent, radius, mark_start, mark_end) =
save P, A;
picture P; path A;
A = halfcircle scaled 2 radius rotated 90
-- halfcircle scaled 2 radius rotated -90 shifted (extent, 0)
-- cycle;
P = image(draw A;
if mark_start > 0:
fill fullcircle scaled 2 mark_start;
fi
if mark_end > 0:
fill fullcircle scaled 2 mark_end shifted (extent, 0);
fi
); P
enddef;
draw arm(200, 16, 0, 6) rotated 200;
draw arm(200, 16, 6, 0) rotated 60;
endfig;
\end{mplibcode}
\end{document}