Does anyone has code examples on how to draw silica tetrahedron and alumina octahedron. I need to include them in my beamer presentation. Graphics are not so good. So I would like to draw them using Tikz.
3 Answers
Update I follow this link
// silica (regular) tetradhedron
unitsize(8mm);
import solids;
import three;
currentprojection=orthographic(2,1.5,5,zoom=.9,center=true);
triple A=(1,0,0), B=(0,1,0), C=(0,0,1), D=(1,1,1); // for 4 oxygen atoms
triple Si=(.5,.5,.5); // for 1 silicon atom
triple[] points={A,B,C,D};
for(var p : points){
draw(surface(sphere(p,.2)),red);
draw(Si--(Si+p)/2,gray+4pt);
draw(p--(Si+p)/2,red+4pt);
}
draw(surface(sphere(Si,.2)),gray);
For silica tetrahedron, we can illustrate with a regular tetrahedron. Feel free to choose another view with currentprojection.
Run on http://asymptote.ualberta.ca/
// silica (regular) tetradhedron
unitsize(5cm);
import solids;
import three;
currentprojection=orthographic(2,1.5,5,zoom=.9,center=true);
triple A=(1,0,0), B=(0,1,0), C=(0,0,1), D=(1,1,1); // for 4 oxygen atoms
triple Si=(.5,.5,.5); // for 1 silicon atom
draw(A--B--C--D--cycle^^A--C^^B--D,gray+3pt);
draw(Si--A^^Si--B^^Si--C^^Si--D,magenta+10pt);
triple[] points={A,B,C,D};
for(var p : points)
draw(surface(sphere(p,.1)),red);
draw(surface(sphere(Si,.15)),orange);
// to see how I draw a regular tetradhedron
//draw(unitbox,lightgray);
//dot(O,red);
- 17,569
-
1Thank you very much – Ziauddin Ahmed Mohammed Nov 10 '21 at 12:13
Another TikZ option.
I use the calc library to find the edges ends (where they intersect with the atoms). Then, the order in which the various elements are drawn is the key to visibility.
\documentclass [tikz,border=2mm]{standalone}
\usetikzlibrary{3d,calc,perspective}
\tikzset
{% Styles
O atom/.style={shading=ball,ball color=red},
Si atom/.style={shading=ball,ball color=gray},
edge/.style={ultra thick},
bond/.style={ultra thick,blue}
}
\begin{document}
\begin{tikzpicture}[line cap=round,isometric view,rotate around z=-50]
% dimensions
\def\bd{3} % bond distance Si-O (center to center)
\pgfmathsetmacro\el{4/sqrt(6)\bd} % edge length (tetrahedron)
\pgfmathsetmacro\ba{acos(-1/3)} % bond angle
\def\rO{0.3} % radius, oxigen
\pgfmathsetmacro\rSi{11/6\rO} % radius, silicon
% coordinates
\foreach[count=\ii]\i in {A,B,C}
{
\begin{scope}[rotate around z=240-120*\ii,canvas is xz plane at y=0]
\coordinate (\i0) at (90-\ba:\bd); % center O
\coordinate (\i1) at (90-\ba:\bd-\rO); % surface O
\coordinate (\i2) at (90-\ba:\rSi); % surface Si
\end{scope}
}
\coordinate (D0) at (0,0,\bd); % center O
\coordinate (D1) at (0,0,\bd-\rO); % surface O
\coordinate (D2) at (0,0,\rSi); % surface Si
\coordinate (O) at (0,0,0); % center Si
% atoms, bonds and tetrahedron
\draw[O atom] (A0) circle (\rO cm);
\draw[edge] ($(A0)!\rO/\el!(B0)$) -- (B0);
\draw[edge] ($(A0)!\rO/\el!(C0)$) -- (C0);
\draw[edge] ($(A0)!\rO/\el!(D0)$) -- (D0);
\draw[bond] (A1) -- (A2);
\draw[Si atom] (O) circle (\rSi cm);
\draw[O atom] (B0) circle (\rO cm);
\draw[bond] (B1) -- (B2);
\draw[bond] (C1) -- (C2);
\draw[bond] (D1) -- (D2);
\draw[edge] ($(B0)!\rO/\el!(C0)$) -- (C0);
\draw[edge] ($(B0)!\rO/\el!(D0)$) -- (D0);
\draw[O atom] (D0) circle (\rO cm);
\draw[O atom] (C0) circle (\rO cm);
\draw[edge] ($(D0)!\rO/\el!(C0)$) -- ($(C0)!\rO/\el!(D0)$);
\end{tikzpicture}
\end{document}
Update: Improvement of tetrahedron distances, and removing the not too accurate SiO2 label as suggested.
- 28,426
-
1
-
1Please note from this picture alone you cannot judge if you show a SiO2 or SiO4. Drawn like this it looks more like a orthosilicate (SiO4). To clearly indicate that it is SiO2 you would have to connect every oxygen atom to another Si atom. (Reference) – Roland Nov 11 '21 at 00:03
-
@Roland, thanks for pointing it. I don't know much about chemistry as you can see :-) – Juan Castaño Nov 11 '21 at 07:40
An easy pure Tikz construct of a tetrahedron as a start:
\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\tikzset{
ball/.style = {circle,shading=ball,minimum width=0.152cm,ball color=gray},
ball2/.style = {circle,shading=ball,minimum width=0.210cm,ball color=red!40},
ball3/.style = {circle,shading=ball,minimum width=0.097cm,ball color=green!40},
ball4/.style = {circle,shading=ball,minimum width=0.184cm,ball color=blue!40},
}
\usepackage{mhchem}
\begin{document}
\begin{tikzpicture}
\node[ball] (A) at (0,0) {};
\node[ball] (B) at (-0.5,1) {};
\node[ball] (C) at (2,0.5) {};
\node[ball] (D) at (0.75,3) {};
\node[ball2] (Si) at (0.75,1.5) {};
\draw[] (A)--(B) -- (A)--(C) (A)--(C) (B)--(D) (A)--(D) (C)--(D);
\draw[dashed] (B)--(C);
%\draw[thick,blue] (A)--(Si) -- (B)--(Si) (C)--(Si) (D)--(Si); % uncomment if you want to have bonds
\node[yshift=-2cm] at (Si) {\ce{[SiO4]^4-}};
\end{tikzpicture}
\begin{tikzpicture}
\node[ball3] (A) at (0,0) {};
\node[ball3] (B) at (3,0) {};
\node[ball3] (C) at (3.75,0.5) {};
\node[ball3] (D) at (4,2.25) {};
\node[ball3] (E) at (1,1.75) {};
\node[ball3] (F) at (1.75,2.25) {};
\node[ball4] (Al) at (2.25,1.25) {};
\draw[] (A)--(E) (A)--(B) (B)--(E) (B)--(C) (C)--(D) (D)--(F) (F)--(E) (E)--(D) (D)--(B);
\draw[dashed,red] (A)--(F) (A)--(C) (C)--(F);
\node[yshift=-2cm] at (Al) {\ce{Al(OH)3}};
\end{tikzpicture}
\end{document}
- 6,655
-
1it is good for sketchy imagination. Are you sure the figure fit with the description of a silica tetrahedron ? and what does the dash mean? – Black Mild Nov 10 '21 at 06:50
-
@Black Mild I do not really know what you want to tell me. Nearly every chemistry book I own draws it that way. So yes I am pretty sure it shows a silica tetrahedron. – Roland Nov 11 '21 at 01:39
-
why numbers
(0.75,3), (2,0.5), etc?Siis the centroid ofA,B,C,D? – Black Mild Nov 11 '21 at 07:52 -
@Black Mild Just because I drew it that way. You do not need to like it. It still is a silica tetrahedron. – Roland Nov 11 '21 at 07:56
-
Please be calm, Roland! your figures look almost the same as in most chemistry textbooks. My question is straight, not biased! – Black Mild Nov 11 '21 at 11:20





