[Tex/LaTex] Recreate the sphere in TeX.SX logo

asymptotemetapostpst-solides3dpstrickstikz-pgf

I'm trying to recreate this

enter image description here quack

But looking in this Meta question the only code provided doesn't give that output

%!TEX TS-program = xelatex
\documentclass{minimal}
\usepackage{pst-solides3d}

\begin{document} 

\psset{viewpoint=50 20 10 rtp2xyz,Decran=50}
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psSolid[object=sphere,r=4,action=draw*,ngrid=9 9,resolution=720]%
\defFunction[algebraic]{helicespherique}(t)%
  {4*cos(10*t)*cos(t)}%
  {4*sin(10*t)*cos(t)}%
  {4*sin(t)}
\psSolid[object=courbe,linecolor=blue,
        resolution=720,range=pi -2 div pi 2 div,
       function=helicespherique,r=0.05]
%\gridIIID[Zmin=-4,Zmax=4](-4,4)(-4,4)
\end{pspicture}

\end{document} 

enter image description here

But I know nothing about PSTricks

How can I reproduce the sphere in the backround of this site?

I'm looking for code (in TikZ, MetaPost, Asymptote or PStricks) to reproduce the image. An important thing is that what's behind the ball should be in another layer (thinner or gray). Like the image from this site.

In any case, this is what I ended up with a few changes from the code

\documentclass{standalone}
\usepackage{pst-solides3d}

\begin{document} 

\psset{viewpoint=50 20 40 rtp2xyz,Decran=50}
\psset{unit=0.75}
\begin{pspicture}(-5,-5)(5,5)
\psSolid[object=sphere,r=4,fillcolor=white,ngrid=14 14,resolution=720,linewidth=.1pt,linecolor=gray]%
\defFunction[algebraic]{helicespherique}(t)%
  {4*cos(2*t)*cos(t)}%
  {4*sin(2*t)*cos(t)}%
  {4*sin(t)}
\psSolid[object=courbe,linecolor=black,
        resolution=720,range=pi -2 div pi 2 div,
       function=helicespherique,r=0.0001]
\end{pspicture}

\end{document} 

enter image description here

Best Answer

The (original) image was created using ePiX (available from CTAN). The source sphere.xp can be compiled using

elaps <options> sphere.xp

to produce

enter image description here

sphere.xp:

/* -*-ePiX-*- */
#include "epix.h"
using namespace ePiX;

const double k(2*M_PI/(360*sqrt(3))); // assume "degrees" mode

double exp_cos(double t) { return exp(k*t)*Cos(t); }
double exp_sin(double t) { return exp(k*t)*Sin(t); }
double minus_exp_cos(double t) { return -exp_cos(t); }
double minus_exp_sin(double t) { return -exp_sin(t); }

int main()
{
  picture(P(-1,-1), P(1,1), "2.5 x 2.5in");

  begin();
  degrees(); // set angle units
  camera.at(P(1, 2.5, 3));

  sphere(); // draw unit sphere's horizon

  pen(Blue(1.6)); // hidden portions of loxodromes
  backplot_N(exp_cos, exp_sin, -540, 540, 180);
  backplot_N(minus_exp_cos, minus_exp_sin, -540, 540, 180);

  pen(Red(1.6));
  backplot_N(exp_sin, minus_exp_cos, -540, 540, 180);
  backplot_N(minus_exp_sin, exp_cos, -540, 540, 180);

  pen(Black(0.3)); // coordinate grid

  for (int i=0; i<=12; ++i) {
    latitude(90-15*i, 0, 360);
    longitude(30*i, 0, 360);
  }

  bold(Blue()); // visible portions of loxodromes
  frontplot_N(exp_cos, exp_sin, -540, 540, 360);
  frontplot_N(minus_exp_cos, minus_exp_sin, -540, 540, 360);

  pen(Red());
  frontplot_N(exp_sin, minus_exp_cos, -540, 540, 360);
  frontplot_N(minus_exp_sin, exp_cos, -540, 540, 360);

  end();
}

Possible outputs: