3
\begin{tikzpicture}
  \def\nuPi{3.1459265}
\foreach \a in {0,6,12,18,24}{
\foreach \x in {0,3}{
\foreach \y in {0,2*sqrt(3),4*sqrt(3),6*sqrt(3)}{
  \foreach \i in {0,...,5}{
\draw [ultra thick,blue]({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) -- ({\x + \a+2*cos(360*(\i+1)/6)},{\y+sqrt(\x)+2*sin(360*(\i+1)/6)});
      \shade[ball color=red] ({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) circle(0.45);
    }
  }
 }
}
\end{tikzpicture}

How can I put this picture of graphene on an inclined plane? All hexagons should be deformed, how can I make this deformations in TikZ?

  • Something like this: \begin{tikzpicture}[xslant=.5]? – Sigur Nov 23 '13 at 15:09
  • @Sigur Looks close what I need, but there is no perspective. Without perspective it looks like deformed figure in the same plane. – user41563 Nov 23 '13 at 15:27
  • 2
    Use yslant also. [xslant=.5,yslant=.6] – user11232 Nov 23 '13 at 15:49
  • Can you show us what you mean? Which inclined plane do you mean? Is Draw a Kohonen SOM feature map? related? – Qrrbrbirlbel Nov 24 '13 at 7:06
  • @Qrrbrbirlbel Thank you for this reference. I'm beginner in TikZ, but I use LaTeX already 20 years. I'm delighted with TikZ, it is really very helpful and useful package. I'll try to use your reference. – user41563 Nov 24 '13 at 16:43
2

Putting a box on an inclined plane with PSTricks.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\psset{dimen=monkey,fillstyle=solid,opacity=.5}

\def\object{%
    \psframe[linestyle=none,fillcolor=blue](-2,-1)(2,1)
    \psaxes[linecolor=gray,labels=none,ticks=none]{->}(0,0)(-3,-3)(3,2)[$x$,0][$y$,90]
    \rput{*0}{%
        \psline{->}(0,-2)%
        \uput[-90]{*0}(0,-2){$\vec{w}$}}
}

\begin{document}
\multido{\i=0+10}{5}{%
\begin{pspicture}(9,7)
    \pspolygon[fillcolor=gray](8,0)(!8 dup \i\space tan mul)
    \rput(5;\i){\rput{\i}{\rput(0,1){\object}}}
\end{pspicture}}
\end{document}

enter image description here

1

As mentioned in the comments, you can use xslant and yslant` both with suitable values.

\documentclass[tikz]{standalone}
\begin{document}

\begin{tikzpicture}[xslant=.6,yslant=.8]
  \def\nuPi{3.1459265}
\foreach \a in {0,6,12,18,24}{
\foreach \x in {0,3}{
\foreach \y in {0,2*sqrt(3),4*sqrt(3),6*sqrt(3)}{
  \foreach \i in {0,...,5}{
      \draw [ultra thick,blue,]({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) -- ({\x + \a+2*cos(360*(\i+1)/6)},{\y+sqrt(\x)+2*sin(360*(\i+1)/6)});
      \shade[ball color=red] ({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) circle(0.45);
    }
  }
 }
}
\end{tikzpicture}

\end{document}

enter image description here

You can check for suitable values of xslant and yslant this way. (takes time to compile)

\documentclass[tikz]{standalone}
\begin{document}
\foreach \xslant in {.4,.8}{
\foreach \yslant in {.1,.2,...,.9}{
\begin{tikzpicture}
 \useasboundingbox (-8,-8) rectangle (65,45);
  \def\nuPi{3.1459265}
\foreach \a in {0,6,12,18,24}{
\foreach \x in {0,3}{
\foreach \y in {0,2*sqrt(3),4*sqrt(3),6*sqrt(3)}{
  \foreach \i in {0,...,5}{
      \draw [ultra thick,blue,xslant=\xslant,yslant=\yslant]({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) -- ({\x + \a+2*cos(360*(\i+1)/6)},{\y+sqrt(\x)+2*sin(360*(\i+1)/6)});
      \shade[ball color=red,xslant=\xslant,yslant=\yslant] ({\x + \a+2*cos(360*\i/6)},{\y+sqrt(\x)+2*sin(360*\i/6)}) circle(0.45);
    }
  }
 }
}
\end{tikzpicture}
}
}
\end{document}

enter image description here

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.