Drawing molecules with tikz

I have to draw a molecule in 3D with a little pore represented by a 3D sphere inside of it with the same center. I have never used TikZ but I know that it's useful for drawing in LaTeX and I hope that someone will can give me pointers...

• I searched a little bit and found this: tex.blogoverflow.com/2011/09/drawing-molecules I think it might be helpfull for you. – Dave Sep 24 '13 at 21:45
• @Dave: I've read that before , but thanks anyway :) – JaCkO91 Sep 24 '13 at 21:50
• I think the way to go about this is to use a third party tool; perhaps there is a python module to logically model molecules—an output routine could be constructed for such a thing. (There is also Mathematica if you happen to have a license, but AFAIK it won't create TikZ.) also check a package I just learned about (linked to in the question) tex.stackexchange.com/questions/132985/matlab2tikz-logo – Sean Allred Sep 24 '13 at 22:44
• @SeanAllred thanks a lot, have you any ideas about drawing a 3D sphere inside another 3D sphere with the same center using tikz or some other package , and thanks again for you help :) – JaCkO91 Sep 24 '13 at 23:07
• Here is probably a nice place to start; I haven't much experience with TikZ for 3D figures. – Sean Allred Sep 24 '13 at 23:16

Since you allowed in a comment the option of using "some other package," here's a rendition of nested spheres using Asymptote: Here's the code:

\documentclass{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
settings.outformat="pdf";
settings.render=0;
size(200);
import solids;
path3 upperhalfcircle = Arc(c=O, v1=Y, v2=-Y, normal=X, n=20);
surface backhemi = surface(revolution(upperhalfcircle,axis=-Y,angle1=0,angle2=180));
surface fronthemi = reflect(O,Y,Z)*backhemi;
pen outerpen = gray + opacity(0.5);
draw(backhemi,surfacepen = outerpen, meshpen = outerpen);
draw(scale3(0.5)*backhemi, surfacepen=blue);
draw(scale3(0.5)*fronthemi, surfacepen=blue);
draw(fronthemi, surfacepen=outerpen, meshpen=outerpen);
\end{asy}
\end{document}


@SeanAllred Hi , I finally get solution for a 3D sphere with a 3D pore in tikz, this is the code for ones who need it :

\documentclass{article}
\usepackage[utf8]{inputenc}

\usepackage{tikz}
\def \Rc{3.0}
\def \Rh{\Rc*0.1}

\begin{document}

\begin{tikzpicture}

\filldraw[ball color=white] (0,0) circle (\Rc);
\filldraw[ball color=black] (0,0) circle (\Rh);

\end{tikzpicture}

\end{document}


i hope it will helps others :)

Here's the result: 