7

I need to plot a spiral around an inverted truncated cone, starting and ending at the centre of both bases. Something like this:

enter image description here

I've searched and found a similar solution, but for cylinders only: Helix on a cylinder

I couldn't adapt it to my geometric shape in question, so any help would be appreciated.

The code for the cone only:

\documentclass[border=0.125cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{3d,calc}

\begin{document}

\begin{tikzpicture}

    \draw (-1,0) arc (180:370:2cm and 1cm);
    \draw (-1,0) arc (180:10:2cm and 1cm);
    \draw (0,-3) arc (180:360:1cm and 0.5cm);
    \draw[dashed] (0,-3) arc (180:0:1cm and 0.5cm);
    \draw(0,-3)  -- (-0.97,-0.18);
    \draw(2,-3)  -- (2.97,-0.18);

    \shade[left color=blue!5!white,right color=blue!60!white,opacity=0.3] (-0.97,-0.18) arc (190:350:2 and 1) -- (2,-3) arc (360:180:1cm and 0.5cm) -- cycle;
    \shade[left color=blue!5!white,right color=blue!60!white,opacity=0.3] (1,0) ellipse (2cm and 1cm);

    \draw[dashed] (0.7,-3) arc (180:0:0.3cm and 0.15cm);
    \draw[dashed] (0.7,-3) arc (180:360:0.3cm and 0.15cm);

\end{tikzpicture}

\end{document}

Thanks in advance,

Dinis Nunes

EDIT:

Following Ignasi suggestion, I've added a spiral function, but my goal was making the line follow closely the wall of the cone.

enter image description here

Code:

\node[xshift=1cm,yshift=-3cm] (dummy) {};
\draw[densely dotted,scale=0.09,variable=\x,shift=(dummy)] plot[domain = 0:10*pi, samples = 400] ({\x*0.6*sin(0.3*pi*deg(\x))},{\x},{\x*0.6*cos(0.3*pi*deg(\x)});
  • Welcome to TeX.SX! Nice problem! – egreg Sep 1 '15 at 14:36
  • May be you can adapt cited answer with these equations mathworld.wolfram.com/ConicalSpiral.html – Ignasi Sep 1 '15 at 15:05
  • I did try something like that, although the spiral does no fit the cone, and doesn't look very good either. – Dinis Nunes Sep 1 '15 at 15:29
8

Here's one possibility using pgfplots; the spiral is drawn first and used to draw the truncated code:

enter image description here

The code:

\documentclass[dvipsnames,border=5pt]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc}
\pgfplotsset{compat=newest}

\colorlet{myblue}{blue!30}

\def\Pointi{42.67}
\def\Pointii{12.6}

\begin{document}

\begin{tikzpicture}
\begin{axis}[
 view={-10}{-10},
 axis lines=none,
 zmax=60,
 clip=false,
 height=16cm,
 width=15cm,
 xtick=\empty,
 ytick=\empty,
 ztick=\empty
]
\addplot3+[
  draw=none,
  no marks,
  domain=10.3:14.405*pi,
  samples=400,
  samples y=0,
]
  ({5*x*sin(0.20*pi*deg(x))},{5*x*cos(0.20*pi*deg(x)},{x});

\coordinate (br)
  at ({5*\Pointii*sin(0.20*pi*deg(\Pointii))},{5*\Pointii*cos(0.20*pi*deg(\Pointii)},{\Pointii});
\coordinate (ur)
  at ({5*\Pointi*sin(0.20*pi*deg(\Pointi))},{5*\Pointi*cos(0.20*pi*deg(\Pointi)},{\Pointi});

\coordinate (BR) at ( $(ur)!1.113!(br) $ );
\coordinate (UR) at ( $(br)!1.24!(ur) $ );

\path
  (BR) 
  arc [start angle=0,end angle=360,x radius=38pt,y radius=10pt]
  coordinate[midway] (BL);
\filldraw[ball color=MidnightBlue!20,fill opacity=0.7,draw=black]
  (UR) 
  arc [start angle=0,end angle=360,x radius=204pt,y radius=20pt]
  coordinate[midway] (UL);
\filldraw[ball color=MidnightBlue!20]
  (UR) --
  (BR) arc [start angle=360,end angle=180,x radius=38pt,y radius=10pt] --
  (BL) -- 
  (UL)
  arc [start angle=180,end angle=360,x radius=204pt,y radius=20pt];
\draw[dashed]
  (BR) 
  arc [start angle=0,end angle=180,x radius=38pt,y radius=10pt];
\draw[dashed]
  ([xshift=-19pt]BR) 
  arc [start angle=0,end angle=360,x radius=19pt,y radius=4pt];
\addplot3+[
  mark=none,
  ultra thick,
  BrickRed,
  domain=10.3:14.405*pi,
  samples=400,
  samples y=0,
]
  ({5*x*sin(0.20*pi*deg(x))},{5*x*cos(0.20*pi*deg(x)},{x});
\end{axis}
\end{tikzpicture}

\end{document}

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.