include $fa=1; $fs=0.2; module T_bar(n_1, n_2, n_3, angle1, angle3, thickness, hole_rad, hole_sep, e_m=true, alpha=0.9){ //n_1 = # holes for bar on +x side -> (|x|,y) plane //n_2 = # holes for central bar //n_3 = # holes for bar on -x side -> (-|x|, y) plane //angle1 = angle of bar_1 with central bar //angle3 = angle of bar_3 with central bar //e_m = "empty middle", //distance of the furthest hole of .. //..bar on +x side max_center1 = (n_1-1)*hole_rad + ((n_1-1)/2)*hole_sep; //..central bar max_center2 = (n_2-1)*hole_rad + ((n_2-1)/2)*hole_sep; //..bar on -x side max_center3 = (n_3-1)*hole_rad + ((n_3-1)/2)*hole_sep; difference(){ //add three bars together union(){ //central bar h_bar(thickness, n_2, hole_rad, hole_sep, alpha); //bar on (|x|,y) plane translate([max_center2, 0, 0]) rotate([0,0,angle1]) // brings furthest hole at the center translate([max_center1, 0, 0]) h_bar(thickness, n_1, hole_rad, hole_sep, alpha); //bar on (-|x|,y) plane translate([-max_center2, 0, 0]) rotate([0,0,-angle3]) // brings furthest hole at the center translate([-max_center3, 0, 0]) h_bar(thickness, n_3, hole_rad, hole_sep, alpha); }; /* DO NOT READ FOLLOWING SECTION - USELESS (but you never know) //border of bars exceed holes at intersection //need to empty them again //intersection in +x translate([max_center2-(2*hole_rad+hole_sep), 0, 0]) cylinder(h=3*thickness, r=hole_rad, center=true); translate([max_center2, 0, 0]) rotate([0,0,angle1]) translate([(2*hole_rad)+hole_sep, 0, 0]) cylinder(h=3*thickness, r=hole_rad, center=true); //intersection in -x translate([-(max_center2-(2*hole_rad+hole_sep)), 0, 0]) cylinder(h=3*thickness, r=hole_rad, center=true); translate([-max_center2, 0, 0]) rotate([0,0,-angle3]) translate([-(2*hole_rad)-hole_sep, 0, 0]) cylinder(h=3*thickness, r=hole_rad, center=true); */ //make the middle holes empty if (e_m==true && 3