/* -*-ePiX-*- */
/* torus.xp -- July 6, 2004 */
#include "epix.h"
using namespace ePiX;

const int N(8);

P F(double t1, double t2)
{
  return polar(2+Sin(t2), t1) + Cos(t2)*E_3;
}

domain R(P(0,0), P(1,1), mesh(4*N, 2*N), mesh(12*N, 6*N));

int main() 
{
  picture(P(-3,-3), P(3,3), "2x2in");

  begin();
  revolutions();
  camera.at(1.7,-1, 0.75);
  camera.range(8);

  rgb(0.2, 0.5, 0.7);

  plot(F, R.resize1(0,0.875));

  bold();
  rgb(0.5, 0.3, 0.9);
  plot(F, R.resize2(-0.375,0).resize1(0,0.125));

  red();
  dashed();
  plot(F, R.slice1(0));
  plot(F, R.slice2(0));

  end();
}

