tikz issue (LaTeX based lab report)

TheReasoner

Former christian, current teapot agnostic.
Mar 14, 2005
10,292
684
Norway
✟29,461.00
Faith
Atheist
Marital Status
Married
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?

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}
Here's the result
GaAs2.png

As you can see, rotating it a little bit will reveal more of the bonds
 
Last edited:

TheReasoner

Former christian, current teapot agnostic.
Mar 14, 2005
10,292
684
Norway
✟29,461.00
Faith
Atheist
Marital Status
Married
Might wanna try a physics forum or somthing similar, i doubt many people acctually know what latex is and even for people like me who do, they probably just use MS word since the equation editor in 2007 came out :p

That equation editor doesn't cut it. LaTeX is far superior when the end result is to be considered. Not to mention versatility and compatibility. There are several compatibility issues with Word anyway. The equation editor does not yield results that are compatible across different versions of word, sometimes I have seen it fail even at displaying the equations correctly across the same version of Word - but across servicepacks.

Besides, don't get me started on table positioning in Word. Or the citation system. My one run-in with that was enough.

I rather like LaTeX. I get what I want, it looks extremely professional and there's none of that darn distracting GUI stuff Microsoft is so fond of. Besides, I've got it nailed down pretty well now as far as text and equations go. I've got my template down, I love it's cross platform compatibility, the versatility...

Still, you're probably right. Most people use Windows, too. Though I quit using it after working as a sysadmin for a few years. Not that I'm smug or anything, I just don't do what most people do.

Anyway, any forum suggestions?
 
Last edited:
Upvote 0

TheReasoner

Former christian, current teapot agnostic.
Mar 14, 2005
10,292
684
Norway
✟29,461.00
Faith
Atheist
Marital Status
Married
Upvote 0