// shape7.java plot 3d data Utah Graphics to shape7.dat shape7.stl // javac -cp . shape7.java // _ java -cp . shape7 > shape7_java.out // // // // import java.io.*; public class shape7 // only 2d lines first cut, z=0 { boolean debug = true; int pts, pt, np, j, kk; int k = 0; // index into newpts k++ datread DR; // = new datread(filename); // defines data structures int new_points = 0; // for each x,y,z point kept int new_polys = 0; // k/4 for datwrite double xyz[][] = new double[10000][3]; // x, y, z for output int newpts[] = new int[40000]; // 2, xyz1, xyz2 for output String fileout = "shape7.dat"; int new_points2 = 0; // for each x,y,z 2point kept int new_polys2 = 0; // k/3 for datwrite double xyz2[][] = new double[10000][3]; // x, y, z for output int newpts2[] = new int[40000]; // 2, xyz1, xyz2 for output String fileout2 = "shape7a.dat"; int newpts3[] = new int[40000]; // 2, xyz1, xyz2 for output int new_polys3 = 0; // k/4 for datwrite String fileout3 = "shape7b.dat"; int new_points4 = 0; // for each x,y,z 2point kept int new_polys4 = 0; // k/3 for datwrite double xyz4[][] = new double[10000][3]; // x, y, z for output int newpts4[] = new int[40000]; // 2, xyz1, xyz2 for output String fileout4 = "shape7c.dat"; double Pi = Math.PI; double ang = 0.0; double dang = 0.0; double r1 = 10.0; // center at 0.0 double r2 = 20.0; double r3 = 30.0; int n=32; double x[] = new double[8]; // for inside double y[] = new double[8]; // 0 to 7, 1 to 2, 3 to 4, 5 to 6 double xx[] = new double[8]; // for outside x,y to xx,yy double yy[] = new double[8]; double ra, rb; int mov[] = {67,68,69,70,71,100,99,101,102, 75,76,77,78,79,104,103,105,106, 83,84,85,86,87,108,107,109,110, 91,92,93,94,95,112,111,97,98}; int tri[][] = {{ 1,51, 2},{ 2,51, 3},{ 3,51,23}, { 3,23, 4},{ 4,23, 5},{ 5,23,24}, { 5,24, 6},{ 6,24, 7},{ 7,24,32}, { 7,32, 8},{ 8,32, 9},{ 9,32,33}, { 9,33,10},{10,33,11},{11,33,41}, {11,41,12},{12,41,13},{13,41,42}, {13,42,14},{14,42,15},{15,42,50}, {15,50,16},{16,50, 1},{ 1,50,51}, {51,52,17},{51,17,18},{51,18,19}, {51,19,23},{23,19,20},{23,20,21}, {23,21,22},{24,25,26},{24,26,27}, {24,27,28},{24,28,32},{32,28,29}, {32,29,30},{32,30,31},{33,34,35}, {33,35,36},{33,36,37},{33,37,41}, {41,37,38},{41,38,39},{41,39,40}, {42,43,44},{42,44,45},{42,45,46}, {42,46,50},{50,46,47},{50,47,48}, {50,48,49}}; public shape7() { double xc, yc, r, ang1, ang2, rxc, ryc; double pt1x, pt1y, pt2x, pt2y, dx, dy; int ca0, ca1, ca2, ca3, ca4, ca5, ca6, ca7; // inner arcs System.out.println("shape7.java running"); new_polys = 0; new_points = 0; ra = Math.sqrt(r2*r2-r1*r1); rb = Math.sqrt(r3*r3-r1*r1); System.out.println("r1="+r1+" r2="+r2+" r3="+r3); System.out.println("ra="+ra+" rb="+rb); System.out.println(" "); System.out.println("generate n points of pattern, inside"); dang = 2.0*Pi/(double)n; ang = 0.0; for(int i=0; i