PageRenderTime 54ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/contrib3/clusters-of-atoms.tex

https://bitbucket.org/berteun/texample
LaTeX | 160 lines | 123 code | 15 blank | 22 comment | 0 complexity | 58fd616a714499579f7fe4e7f628474c MD5 | raw file
Possible License(s): CC-BY-3.0
  1. % Clusters of atoms
  2. % Author: Agustin E. Bolzan
  3. \documentclass{article}
  4. \usepackage[gray]{xcolor}
  5. \usepackage{tikz,pgffor}
  6. %%%<
  7. \usepackage{verbatim}
  8. \usepackage[active,tightpage]{preview}
  9. \PreviewEnvironment{tikzpicture}
  10. \setlength\PreviewBorder{5pt}%
  11. %%%>
  12. \begin{comment}
  13. :Title: Clusters of atoms
  14. A three dimensional illustration of various clusters of atoms.
  15. \end{comment}
  16. \usetikzlibrary{shadows}
  17. \begin{document}
  18. %\begin{figure}
  19. \centering
  20. \begin{tikzpicture}
  21. %\draw[help lines] (0,0) grid (10,10); %used just for visualising the positions of objects during construction
  22. \begin{scope}[yshift=-180,yslant=0.5,xslant=-1]
  23. %the rectangular surface onto which the clusters are located
  24. \filldraw[black!10,very thick] (0.5,1) rectangle (10,7);
  25. %circle circumventing the smallest cluster
  26. \node[circle,circular glow,fill=red!20,draw=red,thick]
  27. at (4.1,4.9) {\phantom{perimetro}};
  28. \end{scope}
  29. %atom clusters are rotated for a better visualisation
  30. \begin{scope}[rotate around = {-5:(0,0,0)}]
  31. %text describing the objects in the picture
  32. \draw[-latex,thick] (6,3) node[right,text width=3cm]
  33. {$\mathsf{potent\; perimeter\; sites}$} to [out=180,in=0] (4.5,1);
  34. \draw[-latex,thick](3,-1)node[right]
  35. {$\mathsf{Non-metallic\; molecule}$} to[out=180,in=0] (2.6,-3);
  36. \draw[-latex,thick](-3,-1)node[above]
  37. {$\mathsf{extra \; electron}$} to[out=-90,in=180] (-1.4,-2);
  38. %now we start with the clusters (maybe this code could be improved by a tikz expert)
  39. %the layers are built starting from the very lowest one
  40. %largest cluster
  41. %first row
  42. \foreach \x in {1.5,2,2.5,3,3.5,4}%
  43. \shadedraw [ball color= red] (\x,1,-0.5) circle (0.25cm);
  44. \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}%
  45. \shadedraw [ball color= red] (\x,1,0) circle (0.25cm);
  46. \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}%
  47. \shadedraw [ball color= red] (\x,1,0.5) circle (0.25cm);
  48. \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75}%
  49. \shadedraw [ball color= red] (\x,1,1) circle (0.25cm);
  50. \foreach \x in {0.5,1,1.5,2,2.5,3,3.5,4,4.5,5}%
  51. \shadedraw [ball color= red] (\x,1,1.5) circle (0.25cm);
  52. \foreach \x in {0.5,1,1.5,2,2.5,3,3.5,4,4.5,5}
  53. \shadedraw [ball color=red] (\x,1,2) circle (0.25cm);
  54. \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75}%
  55. \shadedraw [ball color= red] (\x,1,2.5) circle (0.25cm);
  56. \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}%
  57. \shadedraw [ball color= red] (\x,1,3) circle (0.25cm);
  58. \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}%
  59. \shadedraw [ball color= red] (\x,1,3.5) circle (0.25cm);
  60. \foreach \x in {1.5,2,2.5,3,3.5,4}%
  61. \shadedraw [ball color= red] (\x,1,4) circle (0.25cm);
  62. %second row
  63. \foreach \x in {1.75,2.25,2.75,3.25,3.75}
  64. \shadedraw [ball color=yellow] (\x,1.5,0) circle (0.25cm);
  65. \foreach \x in {1.5,2,2.5,3,3.5,4}
  66. \shadedraw [ball color=yellow] (\x,1.5,0.5) circle (0.25cm);
  67. \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}
  68. \shadedraw [ball color=yellow] (\x,1.5,1) circle (0.25cm);
  69. \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}
  70. \shadedraw [ball color=yellow] (\x,1.5,1.5) circle (0.25cm);
  71. \foreach \x in {0.75,1.25,1.75,2.25,2.75,3.25,3.75,4.25,4.75}
  72. \shadedraw [ball color=yellow] (\x,1.5,2) circle (0.25cm);
  73. \foreach \x in {1,1.5,2,2.5,3,3.5,4,4.5}
  74. \shadedraw [ball color=yellow] (\x,1.5,2.5) circle (0.25cm);
  75. \foreach \x in {1.25,1.75,2.25,2.75,3.25,3.75,4.25}
  76. \shadedraw [ball color=yellow] (\x,1.5,3) circle (0.25cm);
  77. \foreach \x in {1.5,2,2.5,3,3.5,4}
  78. \shadedraw [ball color=yellow] (\x,1.5,3.5) circle (0.25cm);
  79. \foreach \x in {1.75,2.25,2.75,3.25,3.75}
  80. \shadedraw [ball color=yellow] (\x,1.5,4) circle (0.25cm);
  81. %third row
  82. \foreach \x in {2,2.5,3,3.5}
  83. \shadedraw [ball color=yellow] (\x,2,1) circle (0.25cm);
  84. \foreach \x in {1.75,2.25,2.75,3.25,3.75}
  85. \shadedraw [ball color=yellow] (\x,2,1.5) circle (0.25cm);
  86. \foreach \x in {1.5,2,2.5,3,3.5,4}
  87. \shadedraw [ball color=yellow] (\x,2,2) circle (0.25cm);
  88. \foreach \x in {1.25,1.75,2.25,2.75,3.5,3.75,4.25}
  89. \shadedraw [ball color=yellow] (\x,2,2.5) circle (0.25cm);
  90. \foreach \x in {1.5,2,2.5,3,3.5,4}
  91. \shadedraw [ball color=yellow] (\x,2,3) circle (0.25cm);
  92. \foreach \x in {1.75,2.25,2.75,3.25,3.75}
  93. \shadedraw [ball color=yellow] (\x,2,3.5) circle (0.25cm);
  94. \foreach \x in {2,2.5,3,3.5}
  95. \shadedraw [ball color=yellow] (\x,2,4) circle (0.25cm);
  96. %fourth row
  97. \foreach \x in {2.25,2.75,3.25}
  98. \shadedraw [ball color=yellow] (\x,2.5,2) circle (0.25cm);
  99. \foreach \x in {2,2.5,3,3.5}
  100. \shadedraw [ball color=yellow] (\x,2.5,2.5) circle (0.25cm);
  101. \foreach \x in {1.75,2.25,2.75,3.25,3.75}
  102. \shadedraw [ball color=yellow] (\x,2.5,3) circle (0.25cm);
  103. \foreach \x in {2,2.5,3,3.5}
  104. \shadedraw [ball color=yellow] (\x,2.5,3.5) circle (0.25cm);
  105. \foreach \x in {2.25,2.75,3.25}
  106. \shadedraw [ball color=yellow] (\x,2.5,4) circle (0.25cm);
  107. %medium cluster
  108. %first row
  109. \foreach \x in {6.75,7.25}
  110. \shadedraw [ball color=yellow] (\x,2.5,13) circle (0.25cm);
  111. \foreach \x in {6.5,7,7.5}
  112. \shadedraw [ball color=yellow] (\x,2.5,13.5) circle (0.25cm);
  113. \foreach \x in {6.25,6.75,7.25,7.75}
  114. \shadedraw [ball color=yellow] (\x,2.5,14) circle (0.25cm);
  115. \foreach \x in {6.5,7,7.5}
  116. \shadedraw [ball color=yellow] (\x,2.5,14.5) circle (0.25cm);
  117. \foreach \x in {6.75,7.25}
  118. \shadedraw [ball color=yellow] (\x,2.5,15) circle (0.25);
  119. %second row
  120. \foreach \x in {7} %this foreach is used to be general, but it makes no sense if we put just one sphere!
  121. \shadedraw [ball color=yellow] (\x,3,13.25) circle (0.25cm);
  122. \foreach \x in {6.75,7.25}
  123. \shadedraw [ball color=yellow] (\x,3,13.75) circle (0.25cm);
  124. \foreach \x in {6.5,7,7.5}
  125. \shadedraw [ball color=yellow] (\x,3,14.25) circle (0.25cm);
  126. \foreach \x in {6.75,7.25}
  127. \shadedraw [ball color=yellow] (\x,3,14.75) circle (0.25cm);
  128. \foreach \x in {7}
  129. \shadedraw [ball color=yellow] (\x,3,15.25) circle (0.25);
  130. %smallest cluster of atoms
  131. \foreach \x in {2.75,3.25,3.75}
  132. \shadedraw [ball color = gray] (\x,2,10) circle (0.25);
  133. \foreach \x in {3,3.5}
  134. \shadedraw [ball color=gray] (\x,2,10.5) circle (0.25);
  135. \shadedraw [ball color = gray] (3.25,2,11) circle (0.25);
  136. \foreach \x in {3,3.5}
  137. \shadedraw [ball color = gray] (3,2.5,10.25) circle (0.25);
  138. \shadedraw [ball color = gray] (3.5,2.5,11) circle (0.25);
  139. \shadedraw [ball color=gray] (2,1,12.5) circle(0.25);
  140. \draw[-latex,thick](-4,-3)node[above]
  141. {$\mathsf{single \; metal\; atom}$} to[out=-90,in=180] (-3,-4);
  142. \end{scope}
  143. \end{tikzpicture}
  144. %\end{figure}
  145. \end{document}