0

I want to draw with Tikz a topology as illustrated below enter image description here

The shape of node preferred is ball, can you help me ?

enter image description here

2
  • @cfr, can you help me? – MEDIOUNI Jun 26 '16 at 0:09
  • As this is your 4th question with an answer which seems to solve your problem, you should consider accepting them (by clicking on the checkmark ✓). Furthermore you can thank the people by upvoting the answers (with the upward pointing arrow to the left of it). – samcarter_is_at_topanswers.xyz Jun 26 '16 at 10:49
5

This isn't hugely difficult, and the pictures use nothing that isn't obviously in the manual:

\documentclass[varwidth,border=5]{standalone}
\usepackage{tikz}
\tikzset{ball/.style={shape=circle, shading=ball, ball color=blue!50!cyan!50,
  minimum size=0.375cm}}
\begin{document}
\centering
\begin{tikzpicture}
\draw circle [radius=1];
\foreach \i in {0,...,7}
   \node [ball] (n-\i) at (\i*45:1) {};
\foreach \i [evaluate={\j=int(\i+4);}] in {0,...,3}
   \draw (n-\i) -- (n-\j);
\end{tikzpicture}
\\[1em]
\begin{tikzpicture}
\draw grid (2, 2);
\foreach \i in {0,...,2}\foreach \j in {0,...,2}
    \node [ball] (n-\i-\j) at (\j, \i) {};
\end{tikzpicture}
\\[1em]
\begin{tikzpicture}
\draw grid (2, 2);
\draw [shift={(0, 0, 1)}] grid (2, 2);
\foreach \i in {0,...,2}\foreach \j in {0,...,2}\foreach \k in {0,1}
   \node [ball] (n-\i-\j-\k) at (\j, \i, \k) {};
\foreach \i in {0,...,2}\foreach \j in {0,...,2}
  \draw (n-\i-\j-0) -- (n-\i-\j-1);
\end{tikzpicture}
\end{document}

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.