// shape8.java plot 3d data Utah Graphics to shape8.dat // javac -cp . shape8.java // java -cp . shape8 > shape8_java.out // java -cp . dat_to_stl shape8.dat shape8.stl // // leafs /\ // \/ this shape, right side, defined by points // | then reverse x to -x // <>-+-<> // | then rotate 90, 180, 270 // /\ // \/ import java.io.*; public class shape8 { boolean debug = true; int pts, pt, n2, n3, n4, n5, n6; int new_points = 0; // for each x,y,z point kept int new_polys = 0; // changed k/4 int k = 0; // index for newpts double xyz[][] = new double[10000][3]; // x, y, z for output int newpts[] = new int[40000]; // 3, xyz1, xyz2, xyz3 for output String fileout = "shape8.dat"; String fileouta = "shape8a.dat"; String fileoutc = "shape8c.dat"; double Pi = Math.PI; double r; double ang; int np; // first new_points int n = 40; double x, y, z, dz; double sxy[][] = new double[40][2]; int ntri = 39; int tri[][] = {{ 2, 4, 3},{ 4, 6, 5},{ 2, 6, 4}, { 8,10, 9},{10,12,11},{ 7,10, 8}, { 7,12,10},{12,14,13},{16,18,17}, {18,20,19},{20,22,21},{22,24,23}, {20,25,22},{25,24,22},{18,25,20}, {25,27,26},{27,29,28},{18,27,25}, {16,27,18},{16,29,27},{16,30,29}, {31,33,32},{33,36,34},{34,36,35}, {31,37,33},{37,36,33},{31,37,36}, {31,39,38},{15,30,16},{15,31,30}, {15,39,31},{39,31,15},{ 7,14,12}, {39,15,14},{39,14, 7},{31,38,37}, {39, 7, 6},{39, 6, 2},{39, 2, 1}}; // 39 int tri2[][] = {{45,47,46},{48,50,49},{45,48,47}, {45,50,48},{57,59,58},{56,59,57}, {56,60,59},{54,56,55},{52,54,53}, {56,61,60},{54,61,56},{54,62,61}, {54,63,62},{52,63,54},{63,65,64}, {52,65,63},{51,65,52},{51,66,65}, {50,66,51},{71,73,72},{69,71,70}, {67,69,68},{69,73,71},{69,74,73}, {75,77,76},{77,79,78},{75,79,77}, {42,80,79},{42,79,75}, {42,75,74},{42,74,69},{42,69,67}, {42,67,66},{42,66,50},{42,50,45}, {42,45,44},{42,44,43}}; int ntri2=37; public shape8() { System.out.println("shape8.java running"); new_polys = 0; k = 0; new_points = 0; System.out.println("sphere8.java running "); System.out.println(" "); System.out.println("generate top side_right points "); sxy[0][0]=0.0; // side_r at z = 0.0 sxy[0][1]=28.0; sxy[1][0]=0.5; sxy[1][1]=26.5; sxy[2][0]=1.0; sxy[2][1]=26.5; sxy[3][0]=1.5; sxy[3][1]=26.0; sxy[4][0]=2.0; sxy[4][1]=26.5; sxy[5][0]=1.5; sxy[5][1]=24.0; sxy[6][0]=2.0; sxy[6][1]=22.5; sxy[7][0]=3.0; sxy[7][1]=23.0; sxy[8][0]=4.0; sxy[8][1]=23.5; sxy[9][0]=3.5; sxy[9][1]=22.5; sxy[10][0]=4.0; sxy[10][1]=22.0; sxy[11][0]=3.0; sxy[11][1]=20.5; sxy[12][0]=3.5; sxy[12][1]=20.0; sxy[13][0]=3.0; sxy[13][1]=18.0; sxy[14][0]=3.0; sxy[14][1]=17.0; sxy[15][0]=4.0; sxy[15][1]=18.0; sxy[16][0]=5.0; sxy[16][1]=20.0; sxy[17][0]=5.5; sxy[17][1]=19.5; sxy[18][0]=6.5; sxy[18][1]=21.0; sxy[19][0]=7.0; sxy[19][1]=21.0; sxy[20][0]=7.5; sxy[20][1]=21.5; sxy[21][0]=8.0; sxy[21][1]=21.5; sxy[22][0]=9.0; sxy[22][1]=22.5; sxy[23][0]=8.5; sxy[23][1]=21.0; sxy[24][0]=8.0; sxy[24][1]=20.5; sxy[25][0]=8.5; sxy[25][1]=20.0; sxy[26][0]=8.0; sxy[26][1]=19.0; sxy[27][0]=9.0; sxy[27][1]=18.0; sxy[28][0]=8.0; sxy[28][1]=16.5; sxy[29][0]=6.5; sxy[29][1]=15.0; sxy[30][0]=6.0; sxy[30][1]=14.0; sxy[31][0]=8.5; sxy[31][1]=14.0; sxy[32][0]=8.5; sxy[32][1]=13.0; sxy[33][0]=9.0; sxy[33][1]=12.5; sxy[34][0]=11.0; sxy[34][1]=11.5; sxy[35][0]=8.0; sxy[35][1]=11.5; sxy[36][0]=6.5; sxy[36][1]=10.5; sxy[37][0]=6.0; sxy[37][1]=10.0; sxy[38][0]=0.5; sxy[38][1]=10.5; sxy[39][0]=0.5; sxy[39][1]=0.5; n = 40; System.out.println("top_r "); z = 0.0; for(int i=0; i