light1_x =-100.0;
light1_y =100.0;
light1_z =100.0;
light1_vol =50;
light1_red =255;
light1_green =255;
light1_blue =255;
light2_x =5.773502;
light2_y =5.773502;
light2_z =5.773502;
light2_vol =70;
light2_red =255;
light2_green =255;
light2_blue =255;
light3_x =0.0;
light3_y =-100.0;
light3_z =100.0;
light3_vol =30;
light3_red =255;
light3_green =255;
light3_blue =255;
light4_x =0.0;
light4_y =0.0;
light4_z =0.0;
light4_vol =0;
light4_red =0;
light4_green =0;
light4_blue =0;
light5_x =0.0;
light5_y =0.0;
light5_z =0.0;
light5_vol =0;
light5_red =0;
light5_green =0;
light5_blue =0;
light6_x =0.0;
light6_y =0.0;
light6_z =0.0;
light6_vol =0;
light6_red =0;
light6_green =0;
light6_blue =0;
light7_x =0.0;
light7_y =0.0;
light7_z =0.0;
light7_vol =0;
light7_red =0;
light7_green =0;
light7_blue =0;
light8_x =0.0;
light8_y =0.0;
light8_z =0.0;
light8_vol =0;
light8_red =0;
light8_green =0;
light8_blue =0;
light9_x =0.0;
light9_y =0.0;
light9_z =0.0;
light9_vol =0;
light9_red =0;
light9_green =0;
light9_blue =0;
root_finder = d_chain_bisection; epsilon = 0.00000001;
illumination = ambient_light + diffuse_light + reflected_light + transmitted_light;
ambient      = 40;
diffuse      = 80;
reflected    = 80;
transmitted  = 20;
smoothness   = 50;
transparence = 0;
thickness = 10;
antialiasing = 6;
background_red=0;
background_green=0;
background_blue=0;
rot_x=0.0; rot_y=0.0; rot_z=0.0;
scale_x=0.175;//19342359767891684;
scale_y=0.175;//19342359767891684;
scale_z=0.175;//19342359767891684;
double PI = 2*arcsin(1);
// the parameters:
double a=0.05;
a=a;

// the equations (maple): (ChebyshevT(16,x)+ChebyshevT(16,y)+ChebyshevT(16,z)+1-2*a)/lcoeff(simplify(ChebyshevT(16,x)))
surface = x^16+y^16+z^16-4*x^14-4*y^14-4*z^14+(13/2)*x^12+(13/2)*y^12+(13/2)*z^12-(11/2)*x^10-(11/2)*y^10-(11/2)*z^10+(165/64)*x^8+(165/64)*y^8+(165/64)*z^8-(21/32)*x^6-(21/32)*y^6-(21/32)*z^6+(21/256)*x^4+(21/256)*y^4+(21/256)*z^4-(1/256)*x^2-(1/256)*y^2-(1/256)*z^2-(1/16384)*a+1/8192;

surface_red = 255;
surface_green = 51;
surface_blue = 102;
inside_red = 204;
inside_green = 204;
inside_blue = 204;
transparence = 20;


////
width=809;
height=width;

// the solitary points (shown as spheres):

// the rotation:
surface=rotate(surface,0.0,yAxis);
surface=rotate(surface,0.0,xAxis);
surface=rotate(surface,0.0,zAxis);
surface=rotate(surface,0.7478010935627327,yAxis);
surface=rotate(surface,-1.0747380621005074,xAxis);
surface=rotate(surface,-0.7667143729550303,zAxis);
clip = sphere;
radius = 10.0;

// the rotation:
draw_surface;

// the curves:

// save the image:
filename="chmutov_pn_16-"+itostr(width)+"x"+itostr(height)+".xxx";
color_file_format=ppm;
save_color_image;

filename="chmutov_pn_16-"+itostr(width)+"x"+itostr(height)+".xxx";
background=0.125;
//dithering_method=floyd_steinberg_filter;
dither_surface;
resolution=res_1200dpi;
dither_file_format=pgm;
save_dithered_image;
