[Tex/LaTex] Drawing coaxial cables: TikZ or pstricks

3dpstrickstikz-pgf



enter image description here
I want to draw this. I don't find any way to do

I can draw some things… but it's so bad! and it's not realistic! please HELP…

\begin{document}
\newcommand\innenleiter[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
 cylinder end fill = brown, cylinder body fill = brown, minimum height =2cm,
 minimum width = 0.5cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
 }
 \newcommand\dielektrikum[3]{%
 \tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
 cylinder end fill = gray, cylinder body fill = gray, minimum height =3cm,
 minimum width = 2cm, opacity = 1, aspect = 2.5}}
 \node[Cylin] (#3) at (#1,#2) {}; 
 }

\newcommand\aussenleiter[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = brown, cylinder body fill = brown, minimum height =3cm,
minimum width = 3cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}

\newcommand\mantel[3]{%
\tikzset{Cylin/.style={cylinder, draw, cylinder uses custom fill,
cylinder end fill = black, cylinder body fill = black, minimum height =3cm,
minimum width = 4cm, opacity = 1, aspect = 2.5}}
\node[Cylin] (#3) at (#1,#2) {};
}

\begin{tikzpicture}[]
\tikzset{>=latex}
\draw[->] (1,0,0)--(2,0,0) node[right] {$x$};
\draw[->] (0,1,0)--(0,2,0) node[right] {$y$};
\draw[->] (0,0,1)--(0,0,2) node[left] {$z$};

\begin{scope}[canvas is zy plane at x=4]
    \mantel{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=6]
    \aussenleiter{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=8.4]
    \dielektrikum{0}{0}{};
\end{scope}
\begin{scope}[canvas is zy plane at x=10.4]
    \innenleiter{0}{0}{};
\end{scope}

\end{tikzpicture}
\end{document}

Best Answer

This should be a starting point. I am colour blind at the moment.

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes.geometric,calc}
\tikzset{my cylinder/.style={cylinder, cylinder uses custom fill,rotate=-30,outer sep=0pt}
}
\begin{document}

\begin{tikzpicture}[]
\node [my cylinder,shape aspect=1,minimum width=5mm,minimum height=1cm, cylinder body fill=lightgray!20,cylinder end fill=lightgray!50] (c1) at (0,0){};
\node [my cylinder,shape aspect=0.7,minimum width=4mm,minimum height=1cm, cylinder body fill=red!20,cylinder end fill=red!50,anchor=west,xshift=-0.5mm] (c2) at ($(c1.after top)!0.5!(c1.before top)$){};
\node [my cylinder,shape aspect=0.5,minimum width=3mm,minimum height=1cm, cylinder body fill=magenta!20,cylinder end fill=magenta!50,anchor=west,xshift=-0.5mm] (c3) at ($(c2.after top)!0.5!(c2.before top)$){};
\node [my cylinder,shape aspect=0.4,minimum width=2mm,minimum height=1cm, cylinder body fill=blue!20,cylinder end fill=blue!50,anchor=west,xshift=-0.25mm] (c4) at ($(c3.after top)!0.5!(c3.before top)$){};
\draw (c1.north) -- +(60:0.5cm)node[font=\tiny,pos=1.2]{4};
\draw ([yshift=-1mm]c2.base) -- +(240:0.5cm)node[font=\tiny,pos=1.2]{3};
\draw ([yshift=1mm]c3.center) -- +(60:0.5cm)node[font=\tiny,pos=1.2]{2};
\draw ([yshift=-1mm]c4.base) -- +(240:0.5cm)node[font=\tiny,pos=1.2]{1};
\end{tikzpicture}
\end{document}

enter image description here

Again adjust colours and fadings.

\documentclass[border=5pt]{standalone}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[]
\clip (-2,-1.1) rectangle (1,1.5);
\begin{scope}[rotate=-30]
\fill[gray!30] (-3,-1) rectangle (0,1);
\fill[gray!20] (0,0) circle(1cm);
\begin{scope}
\clip(0,0) circle(1cm);
\fill[gray!40] (-3,-0.2) rectangle (0,0.2);
\fill[gray!50] (0,0) circle(2mm);
\end{scope}
\draw[-stealth] (120:1) -- node[right,font=\tiny]{$U$}(120:0.2);
\draw[stealth-] ([yshift=-0.5\pgflinewidth]0,1) -- node[above,font=\tiny]{$I$}([yshift=-0.5\pgflinewidth]0.5,1);
\draw[-stealth] ([yshift=-0.5\pgflinewidth]0,0) -- node[above,font=\tiny]{$I$}([yshift=-0.5\pgflinewidth]0.5,0);
\end{scope}

\end{tikzpicture}
\end{document}

enter image description here