答案1
一种不太有效的方法是使用一些嵌套的 for 循环,仅在每个顶点绘制带有圆形节点的六边形节点。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary {shapes.geometric, calc}
\tikzset{
my hex/.style={regular polygon, regular polygon sides=6, draw, inner sep=0pt, outer sep=0pt, minimum size=1cm},
my circ/.style={draw, circle, fill=blue!50!white, inner sep=0pt, minimum size=1.5mm}
}
\begin{document}
\begin{tikzpicture}[thick]
\foreach \n[count=\k] in {3,4,5,4,3}{
\foreach \m in {1,...,\n}{
\node(h)[my hex] at (-\n/2+\m,{\k*sqrt(3)/2}){};
\foreach \t in {1,...,6} \node[my circ] at ($(h)+({(\t-1)*60}:.5)$){};
}
}
\end{tikzpicture}
\end{document}