/* make_helix.c write out a helix_635.dat for run4 */ /* actually, a troidal helix, the toroid is made by make_torrus_635.c */ #include #include #define LINES 259 /* storage max for nx */ #define POINTS 259 /* storage max for ny */ #define TRIS 68000 /* storage max for points */ main(int argc, char *argv[]) { struct point { float x,y,z; int index; }; struct point raw[LINES][POINTS]; struct tri_poly { int p1, p2, p3; }; struct tri_poly tri_raw[TRIS]; FILE *fp; int debug; /* 0 for no debug print in xterm */ float phi, theta; float phi1, theta1; int i, j; int points, polys; int status; float x0, y0, z0; float x1, y1, z1; float x2, y2, z2; float x3, y3, z3; float x2d, y2d, z2d, r2d, r2n; float vx2, vy2, vz2; float rx2, ry2, rz2; double pi = 3.141592653589793238462643383279502884197; float r1 = 8.0; /* major radius of torrus */ float r2 = 4.0; /* minor radius of torrus */ float r3 = 1.0; /* minor radius of helix */ float F = 8.0; /* wrapping factor of r2 around r1 */ /* for big helix */ float phi_step = pi/128.0; int nx = 257; float theta_step = pi/8.0; int ny = 17; /* for smooth shaded helix, smaller steps */ phi_step = pi/64.0; nx = 129; theta_step = pi/8.0; ny = 17; printf("make_helix_635 running \n"); points = 1; /* thats the standard */ phi1 = 0.0; for(i=0; i