Hey guys.
For those who are not aware: tikz is a LaTeX package.
I've been working on learning some tikz today, in anticipation of my master's and I was working on creating a few simple representations related to a lab report I will need to write in a few weeks.
The representation giving me some grief is in three dimensions. It is of a GaAs unit cell, which I then intend to position relative another part of my figure, representing my substrate (consisting of GaAs)
I'll be making these parts as commands, because I will need to show a few of the relevant steps in the wafer processing I go through in the lab. So repeating a large amount of code by using only one line instead of repeating the entire code would be preferable.
Any tips?
Here's the result
As you can see, rotating it a little bit will reveal more of the bonds
For those who are not aware: tikz is a LaTeX package.
I've been working on learning some tikz today, in anticipation of my master's and I was working on creating a few simple representations related to a lab report I will need to write in a few weeks.
The representation giving me some grief is in three dimensions. It is of a GaAs unit cell, which I then intend to position relative another part of my figure, representing my substrate (consisting of GaAs)
I'll be making these parts as commands, because I will need to show a few of the relevant steps in the wafer processing I go through in the lab. So repeating a large amount of code by using only one line instead of repeating the entire code would be preferable.
Any tips?
Code:
\newcommand{\AtomOne}[1]{%
\shade[ball color=green!20,fill opacity=0.5] (#1) circle (0.5);\draw (#1);
}
\newcommand{\AtomTwo}[1]{%
\shade[ball color=blue!20,fill opacity=0.5] (#1) circle (0.5);\draw (#1);
}
\newcommand{\AtomThree}[1]{%
\shade[ball color=yellow!20,fill opacity=0.5] (#1) circle (1);\draw (#1);
}
\newcommand{\UnitCell}{%
\draw [color=gray!25](0,0,10)--(0,0,0)--(0,10,0)
(0,0,0)--(10,0,0)--(10,10,0)--(10,10,10)--(10,0,10)--(10,0,0)%
(10,10,10)--(0,10,10)--(0,10,0)
(10,10,0)--(0,10,0) (10,0,10)--(0,0,10)--(0,10,10);
\draw [red,very thick] (10,10,10)--(7.5,7.5,7.5)--(10,5,5)(5,5,10)--(7.5,7.5,7.5)--(5,10,5)
(5,10,5)--(2.5,7.5,2.5)--(0,10,0)(5,5,0)--(2.5,7.5,2.5)--(0,5,5)
(0,0,10)--(2.5,2.5,7.5)--(5,5,10)(5,0,5)--(2.5,2.5,7.5)--(0,5,5)
(10,0,0)--(7.5,2.5,2.5)--(10,5,5)(5,0,5)--(7.5,2.5,2.5)--(10,5,5);
%\draw (10,0,0) node {X};
%\draw (0,10,0) node {Y};
%\draw (0,0,10) node {Z};
\AtomOne{0,10,0}
\AtomOne{0,10,10}
\AtomOne{0,0,0}
\AtomOne{0,0,10}
\AtomOne{0,5,5}
\AtomOne{5,5,0}
\AtomOne{5,0,5}
\AtomOne{10,0,0}
\AtomOne{10,0,10}
\AtomOne{10,10,10}
\AtomOne{10,10,0}
\AtomOne{10,5,5}
\AtomOne{5,10,5}
\AtomOne{5,5,10}
\AtomTwo{2.5,7.5,2.5}
\AtomTwo{2.5,2.5,7.5}
\AtomTwo{7.5,2.5,2.5}
\AtomTwo{7.5,7.5,7.5}
}
\begin{tikzpicture}[scale=.25]
\UnitCell{0,0,0}
\end{tikzpicture}
As you can see, rotating it a little bit will reveal more of the bonds
Last edited: