// hcyl1_curv8.java compile javac -cp . hcyl1_curv8.java // execute java -cp . hcyl1_curv8 // writes hcyl1_curv8.dat // execute dat_to_stl hcyl1_curv8.dat hcyl1_curv8.stl // // curved version of cyl1_pipe update phi,y,z per rc, then rotate phi about x // make two, glue together, have pipe of a toroide. public class hcyl1_curv8 // make hcyl1_curv8.dat then .stl for 3D printer { double pi = 3.14159265358979323846; double Mx[][] = new double[3][3]; // rotation matrix double My[][] = new double[3][3]; double Mz[][] = new double[3][3]; public hcyl1_curv8() { boolean debug = false; int num_points = 0; double data_points[][] = new double[5000][3]; int num_polys = 0; int k = 0; // k index+1/4 = num_polys int data_polys[] = new int[5000]; // 3 pt1 pt2 pt3 +1 index double theta, x, y, z; double phi, xp, yp, zp, del; // rotated points double r = 10.0; double rc = 30.0; // curv cyl int pts = 5; // then 17 theta int tpts = 8; // then 32 phi double dtheta = pi/4.0; // then pi/16.0 double dphi = pi/4.0; // then pi/16.0; double vp[] = new double[3]; double vr[] = new double[3]; int pti = 0; int pt0=0; // pt0 for triangles int pt1=0; // next neighbor int pt2=0; // for bottom int pt3=0; int ptin=tpts*pts; // inside pyin bottom System.out.println("hcyl1_curv8.java writing hcyl1_curv8.stl"); System.out.println("r="+r+", pts="+pts+", dtheta="+dtheta); System.out.println("rc="+rc+", tpts="+tpts+", dphi="+dphi); r = 10.0; for(int j=0; j