# Nautilus Shell in TikZ or PSTricks

Any ideas on how to recreate the cross-section of a nautilus shell like in the diagram below:

-
Welcome to TeX.SX! What is your MWE that shows your effort and difficulties? – kiss my armpit Sep 18 '13 at 2:17
@PGFTricks Thanks for the welcome!lol I have been participating in this site for more than a year so i kinda know the rules of TX.SX but I do agree i do not have a MWE. What I am looking for, is to learn the possible algorithm that could create such a diagram like the one you shared and the others as well. But thanks again for the concern. – azetina Sep 18 '13 at 19:17

A --shell-output (it had to be done sorry)

Fibonacci approximation for the spiral. Complete guess at the color. Stealing Jake's ncbar (again!).

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings,calc}
\tikzset{nctopath/.style={
to path=(\tikztostart) ..controls ($(\tikztostart)!1cm*#1!-90:(\tikztotarget)$) and
($(\tikztotarget)!($(\tikztostart)!1cm*#1!-50:(\tikztotarget)$)!70:(\tikztostart)$)..
(\tikztotarget)
},
}
\begin{document}
\begin{tikzpicture}
\def\totx{1}
\coordinate (n-1-1) at (0,0) {};
\foreach \x[count=\xi from 2, evaluate=\x as \temptotx using int(\x+\totx)] in {1,...,9}{
\draw[decoration={
markings,mark=between positions 0 and 1 step 0.249 with {
\coordinate (n-\x-\pgfkeysvalueof{/pgf/decoration/mark info/sequence number}) ;
}
},postaction=decorate
]
(n-\x-1) arc (\x*90+180:(\x+1)*90+180:{(\temptotx)*3mm})
coordinate (n-\xi-1)
\pgfextra{\xdef\totx{\temptotx}};
}

\foreach \x[count=\xi from 5] in {1,...,4}{
\foreach \y in {2,...,5}{
\draw[ultra thick,draw=green!50,] (n-\x-\y) to[nctopath=\x] (n-\xi-\y);
}
}
\end{tikzpicture}
\end{document}


Needs a little make up though. Maybe shading those sections nicely and placing a fading in the middle of the shell for the sun flare etc.

-

run with xelatex or latex->dvips->ps2pdf

\documentclass[preview,border=12pt]{standalone}
\usepackage{pst-solides3d}

\begin{document}

\begin{pspicture}(-5.5,-6)(2,3)
\psset{viewpoint=20 120 60 rtp2xyz,Decran=20,lightsrc=-10 15 10}
% Parametric Surfaces
\psSolid[object=grille,base=-4 4 -4 4,action=draw*,linecolor={[cmyk]{1,0,1,0.5}}](0,0,-3)
\defFunction{shell}(u,v)
{1.2 v exp u Sin dup mul v Cos mul mul}
{1.2 v exp u Sin dup mul v Sin mul mul}
{1.2 v exp u Sin u Cos mul mul}
\psSolid[object=surfaceparametree,
linecolor={[cmyk]{1,0,1,0.5}},
base=0 pi pi 4 div neg 5 pi mul 2 div,
fillcolor=yellow!50,incolor=green!50,
function=shell,linewidth=0.5\pslinewidth,ngrid=25]
\end{pspicture}

\end{document}


-
+1: I think you need to cut it and show the cross section. :-) – kiss my armpit Sep 18 '13 at 6:59

With PSTricks just for fun. The following is not the final.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\psset{polarplot,algebraic}
\def\foo{2^(x/10)}
\def\goo#1{2 #1 10 div exp}

\def\hoo#1{%
\pscurve

\def\atom#1{%
\pscustom[fillstyle=solid,fillcolor=orange,linejoin=1]
{
\hoo{#1}
\closepath
}}

\begin{document}
\begin{pspicture}(-5,-5)(5,5)
\foreach \i in {16,15.7,...,-55}{\atom\i}
\end{pspicture}
\end{document}


Hopefully the next edit will make it more realistic. But you should get the rough idea.

To reduce the file size, plotpoints=10 is more than enough. The default is plotpoints=50. – kiss my armpit Sep 18 '13 at 6:51