I am trying to create a drawing of part of a circuit with 3D perspective like so:

enter image description here

How can this be done?

The main body of the capacitors has now been created in latex, all that remains is to create the line from either side of the shaded circle.

  • related: tex.stackexchange.com/questions/104529/… – jub0bs Feb 8 '14 at 15:39
  • Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – jub0bs Feb 8 '14 at 16:14
  • Adam, I'm curious: what is the hashed circle supposed to represent? – jub0bs Feb 9 '14 at 12:06
  • Its a circular disk that will be used to derive the magnetic field at some distance r from the wire – Adam Feb 9 '14 at 13:40
  • 1
    not really, its just a drawing that will be used in the maths as a circular surface – Adam Feb 9 '14 at 13:44

The following should get you started.

Edit: you can control the opacity of draw and fill elements independently, using the draw opacity and fill opacity keys, respectively. See Tikz: use opacity for fill, yet leave draw (lines) untouched for more details.

enter image description here


    mark=at position .3 with {\arrow{triangle 90}}},postaction={decorate}},

\def\Cplanesep{3} % <--- adjust the distance between the planes here
\def\Cwirelen{4}  % <--- adjust the wire length here
\path[use as bounding box]
  ({3-\Cwirelen}, -3) rectangle ({3.2+\Cplanesep+\Cwirelen}, 3.5);
  % necessary for cropping the picture
  % because control points lie way out
  % (dimensions adjusted manually...)
  \begin{scope}[xshift=#1 cm]
  \filldraw[thick,draw=black,fill=gray,fill opacity=.3]
      (2.5,-2.5) --
      (2.5,1)    --
      (4,3)      --
      (4,-0.5)   --
  minimum height = 1.5cm,
  minimum width  = 1cm,
  pattern = north east lines,
  fill opacity = .7,
  rotate       = -20
] (hc) at (1.5,0) {};
  ({3-\Cwirelen},0) -- ++(\Cwirelen,0)
  node[pos=.3,anchor=north] {$I$};
\draw[thick] ({3.2+\Cplanesep},0) -- ++(\Cwirelen,0) ;
  .. controls (6,10) and (5, -9) ..
  • Thanks, i have now got a diagram close to what i wanted to achieve. How should i add further questions with code? Do i edit my original post or post code in a comment reply? – Adam Feb 8 '14 at 16:30
  • @Adam Your question should be as complete as possible to begin with; it's bad practice to gradually move the goalpost in the same question. However, if the answers you get are missing something important, editing your question for clarification is perfeclty fine and highly encouraged. – jub0bs Feb 8 '14 at 16:34
  • Perhaps it is best to ask in comment here as the question is only small. I have adjusted the \filldraw[fill=white,opacity=1] to \filldraw[black,fill=gray,opacity=0.3] but it seems this also affects the opacity of the lines surrounding the boxes. How can I make these lines be black with opacity=1? – Adam Feb 8 '14 at 16:37
  • I am now very close to what i wanted to achieve. The final thing i want to do is draw a line from the top of the hashed circle that then goes inbetween both capacitors and finally connects again to the bottom of the hashed circle. Is there any way to plot custom lines like this? – Adam Feb 8 '14 at 16:54

This code uses hobby tikz library to draw the envelope:

\usetikzlibrary{decorations.markings, arrows,calc,patterns,shapes,hobby,backgrounds}

        decoration={markings, mark=at position .5 with {\arrow{triangle 45}}},
    \coordinate (a) at (0,0);
    \coordinate (b) at (2,0);
    \coordinate (c) at (2,2);
    \coordinate (d) at (0,2);
    \coordinate (a1) at (0.65,0.5);
    \coordinate (b1) at (2.65,0.5);
    \coordinate (c1) at (2.65,2.5);
    \coordinate (d1) at (0.65,2.5);
    \draw[thick,fill=gray!30] (d) -- coordinate(da) (a) -- (a1) -- (d1) -- cycle;
    \draw[thick,fill=gray!30] (b) -- (b1) -- (c1) -- (c) -- cycle;
    \draw[single] (-2,1) -- (da)node[midway,above] {I};
    \draw(2.3,1) -- (4,1);
            minimum height = 1cm,
            minimum width  = 0.5cm, 
            pattern = north east lines,            
            fill opacity = .5,
            rotate       = -10
        ] (el) at (-0.5,1) {};
    \begin{scope}[on background layer]
    \draw (el.north)
        to[curve through={(-0.3,1.7) .. (0.5,2.6) .. (0.6,2.6) ..
                  (0.9,1)   .. (0.75,0) ..

enter image description here

  • Thanks for your answer. I started to work with the other answer before yours but i do appreciate the help. – Adam Feb 8 '14 at 17:48
  • I --> $I$ :) – Svend Tveskæg Feb 8 '14 at 23:52

With PSTricks.



enter image description here

  • Your plates are transparent.. Wires can be seen through ;) – user11232 Feb 8 '14 at 17:17
  • @HarishKumar: It can be changed easily later if the OP wants. – kiss my armpit Feb 8 '14 at 17:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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