I want to draw a cycle with 12 vertices, and the circle's style is a regular 12-sided polygon, so I use the following code:
\documentclass[tikz, border=1mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\node[regular polygon, regular polygon sides=12, draw, minimum size=6cm]
(outer_poly) {};
\foreach \n in {1,...,12}
{
\fill (outer_poly.corner \n) circle (5pt) {};
}
\end{tikzpicture}
\end{document}
I want to change the vertices with odd-numbered indices to squares, and I do not how to change.
\documentclass[tikz, border=1mm]{standalone}
\usetikzlibrary{shapes.geometric}
\begin{document}
\begin{tikzpicture}
\tikzset{bluenode/.style={fill=blue, draw=blue, shape=rectangle, minimum
size=0.15cm, inner sep=4pt}};
\node[regular polygon, regular polygon sides=12, draw, minimum size=3cm]
(outer_poly) {};
\foreach \i in {1,...,12}
{
\ifodd\i % test if i odd or even
\fill (outer_poly.corner \i) circle (2pt); % I want to change the style of bluenode!
\else
\fill (outer_poly.corner \i) circle (2pt);
\fi
}
\end{tikzpicture}
\end{document}
I want to draw it in the following style: