// Make a segment of a cylindrical tube, where the inner and and outer // diameters of the tube walls are given by rinner and router respectively, // with the start and end angles of the segment specified by astart and aend. // The difference between astart and aend must be > 1 degree <= 180 degrees. module cylinderTubeSegment180(rinner,router,height,astart,aend) { difference() { cylinder(r=router,h=height); cylinder(r=rinner,h=height); rotate([0,0,(270+astart)%360]) cube(size=[router+1,router+1,height],centered=false); rotate([0,0,(181+astart)%360]) cube(size=[router+1,router+1,height],centered=false); rotate([0,0,aend]) cube(size=[router+1,router+1,height],centered=false); rotate([0,0,(aend+89)%360]) cube(size=[router+1,router+1,height],centered=false); } } // Make a solid mask of the inside of the siphon. // a,b,c = x,y,z dimensions of the siphon body // d = inner diameter of curved parts of exit tube // e = width of exit tube // f = length of upward vertical section of exit tube // g = height of exit tube // h = length of downward vertical section of exit tube // i = y-dimension of forked part of exit tube module siphonMask(a,b,c,d,e,f,g,h,i,surround) { cube(size=[a,b,c],center=false); translate(v=[a,b-d-e,0]) cylinderTubeSegment180(d,d+e,g,0,90.1); translate(v=[a+d,b-d-e-f,0]) cube(size=[e,f,g],center=false); translate(v=[a+d+e+d,b-d-e-f,0]) cylinderTubeSegment180(d,d+e,g,180,0); translate(v=[a+d+e+d+d,b-d-e-f,0]) cube(size=[e,d+e+h+e*sin(45)+f,g],center=false); translate(v=[a+d+e+d+d+e,b+h,0]) rotate([0,0,45]) cube(size=[i/cos(45),e,g],center=false); translate(v=[a+d+e+d+d,b+h,0]) rotate([0,0,45]) cube(size=[e,i/cos(45),g],center=false); } // Make a siphon // a-i = as for siphonMask // surround = width of material surrounding the siphon // foot = depth of the base of the siphon module siphon(a,b,c,d,e,f,g,h,i,surround,foot) { difference() { union() { cube(size=[a+d+e+d+e+d+2*surround,b+surround,c+foot],center=false); translate(v=[surround+a+d+e+d+d-surround,b,0]) cube(size=[e+2*surround,h+e+surround,c+foot],center=false); translate(v=[a+d+e+d+d-i*tan(45),b+h,0]) cube(size=[e+2*i*tan(45)+2*surround,i,c+foot],centered=false); } translate(v=[a+d+e+d+d,b+h,0]) rotate([0,0,90+45]) cube(size=[i/cos(45),i*sin(45),c+foot],centered=false); translate(v=[a+d+e+d+d+e+2*surround,b+h,0]) rotate([0,0,-45]) cube(size=[i*sin(45),i/cos(45),c+foot],centered=false); translate(v=[a+d+e+d+d+e/2+surround,b+h+e+surround,0]) rotate([0,0,45]) cube(size=[i/sin(45),i/cos(45),c+foot],centered=false); translate(v=[surround,0,0]) siphonMask(a,b,c,d,e,f,g,h,i,surround); } } rotate([180,0,0]) siphon(20,23,5,3,3,5,3,20,10,3,1.2);