Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to know if it is possible to draw an image like this in 3D using tikz? I am having some text around this picture, which looks great in tikz, but I am unable to draw this kind of 3D figure in tikz. Also the shadows around it looks quite complex to me.

Any examples, ideas, suggestions?

enter image description here

Thank You !

share|improve this question
yes, it is possible. You can have a look here tex.stackexchange.com/questions/58633/… or here tex.stackexchange.com/questions/42812/3d-bodies-in-tikz for some ideas on lighting and 3D-body-generation. –  LaRiFaRi May 5 at 13:14
I will say that this reminds me of a standard icon pack I used back in the day. That pack came with vectors for each icon; if you have a vector for the image, there is little purpose in trying to create it with TikZ (but you can have Inkscape 'convert' it for you). –  Sean Allred May 5 at 13:16
should i get this graphic from eps and embed in tikz? is it possible? just to avoid lot of coding. –  Raj May 5 at 13:18
In my opinion this is not suited for TikZ, here you have something “similar”. –  Manuel May 5 at 13:26
@Raj Yes, I would recommend against using TikZ if you have a vector already available. If you have the vector in the same folder, you can just use \includegraphics{my-vector}—no need for TikZ. I would recommend you convert whatever you have to PDF first, just for ease of use. –  Sean Allred May 5 at 13:37

2 Answers 2

up vote 21 down vote accepted

Definitely not perfect in any respect but anyway...

      \fill [white] ellipse [x radius=2, y radius=2/3];
      \path [left color=black!50, right color=black!50, middle color=black!25] 
        (-2+.05,-1.1) arc (180:360:2-.05 and 2/3-.05*2/3) -- cycle;
      \path [top color=black!25, bottom color=white] 
        (0,.05*2/3) ellipse [x radius=2-.05, y radius=2/3-.05*2/3];
      \path [left color=black!25, right color=black!25, middle color=white] 
        (-2,0) -- (-2,-1) arc (180:360:2 and 2/3) -- (2,0) arc (360:180:2 and 2/3);
      \foreach \r in {225,315}
        \foreach \i [evaluate={\s=30;}] in {0,2,...,30}
          \fill [black, fill opacity=1/50] 
            (0,0) -- (\r+\s-\i:2 and 2/3) -- ++(0,-1) 
            arc (\r+\s-\i:\r-\s+\i:2 and 2/3) -- ++(0,1) -- cycle;
      \foreach \r in {45,135}
        \foreach \i [evaluate={\s=30;}] in {0,2,...,30}
          \fill [black, fill opacity=1/50] 
            (0,0) -- (\r+\s-\i:2 and 2/3) 
            arc (\r+\s-\i:\r-\s+\i:2 and 2/3)  -- cycle;
  disc bottom/.style={
      \foreach \i in {0,2,...,30}
        \fill [black, fill opacity=1/60] (0,-1.1) ellipse [x radius=2+\i/40, y radius=2/3+\i/60];
      \path pic {disc};

\path (0,0) pic {disc bottom} (0,1.25) pic {disc} (0,2.5) pic {disc};


enter image description here

share|improve this answer
this is amazing ! :) –  Raj May 5 at 14:20
Short and impressive! I added also this to the TeXample TikZ gallery. Most TikZ graphics I bookmark here are yours. –  Stefan Kottwitz Jul 29 at 21:02

I'm afraid I also could not resist giving it a shot with Asymptote. Unlike the TikZ solution, this actually uses an underlying 3d model. In particular, the "white ring" around the top emerged naturally as a result of rounding the corner, together with Asymptote's shading capabilities.

    settings.outformat = "png";
    import three;
    import roundedpath;
    currentprojection = orthographic(0,4,1);

    int nslices = 20;
    pen colorfunction(int u, real v) {
        real t = (v/nslices)*4pi;
        static pen dark = gray(0.3);
        static pen light = white;
        return interp(dark, light, (sin(t)+1)/2);

    real radius = 2.0, height = 1.0;

    path3 to_revolve = path3(roundedpath((0,0) -- (radius,0) -- (radius,height) -- (0.9 radius, height) -- (0,height), R=0.05), YZplane);
    surface disk = surface(to_revolve, c=O, axis=Z, n=nslices, color = colorfunction);

    pen undercolorfunction(int u, real v) {
        pen overpen = colorfunction(u,v);
        real r = point(to_revolve, u).y;
        return interp(black, overpen, (r/radius)^5);

    surface underdisk = surface(to_revolve, c=O, axis=Z, n=nslices, color=undercolorfunction);



The result:

share|improve this answer
Added bonus is that you can embed the model into the PDF. –  bb010g May 6 at 1:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.