答案1
欢迎!您可以pic
为此定义一个。并使用图钉。
\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[pics/sensor/.style={code={\draw[line cap=rect] (0,-6pt) coordinate(-b)
arc(-90:90:6pt) coordinate (-t); \node[circle,inner sep=2pt,fill,outer sep=0pt] (-c) at (0,0){};
}},every pin edge/.style={stealth-,shorten <=1pt}]
\pic (s){sensor};
\draw (s-t) -- coordinate[pin=above right:$a$] ++ (0,1) (s-b) -- ++ (0,-1)
(s-c) -- coordinate[pin=above left:$b$] ++ (-1,0);
\end{tikzpicture}
\end{document}