Files
OpenScad_Designs/cooling_tube_splitter_bus.scad
2020-06-13 13:41:22 +02:00

80 lines
1.9 KiB
OpenSCAD

// fitting params
fitting_inside_diam_top = 66;
fitting_inside_diam_bottom = 61;
fitting_length = 23;
wall_thickness = 2.5;
curve_angle = 30;
$fn=100;
module fitting(r_in, r_out, length){
rotate(90,[1,0,0])
difference(){
linear_extrude(length)
circle(r=r_out);
linear_extrude(length)
circle(r=r_in);
}
}
function custom_y(w, angle) = (w/2-w*(1-cos(angle)))/tan(angle)+w*sin(angle);
module one_side(r, w, angle){
rotate_extrude(angle=angle)
translate([w/2,0,0])
circle(r=r);
y = custom_y(w, angle);
translate([w/2,y,0])
rotate(angle)
mirror([1,0,0])
rotate_extrude(angle=angle)
translate([w/2,0,0])
circle(r=r);
tri_x = w/2-w*(1-cos(angle));
tri_y = tri_x/tan(angle);
length = sqrt(pow(tri_y, 2) + pow(tri_x,2));
rotate(angle,[0,0,1])
translate([w/2,length,0])
rotate(90,[1,0,0])
linear_extrude(length)
circle(r=r);
}
module split_shape(r, w, angle){
union(){
one_side(r,w,angle);
mirror([1,0,0])
one_side(r,w,angle);
}
}
my_w = fitting_inside_diam_top+2*wall_thickness;
difference(){
split_shape(fitting_inside_diam_top/2+wall_thickness,
my_w,
curve_angle);
split_shape(fitting_inside_diam_bottom/2,
my_w,
curve_angle);
}
// one_side(fitting_inside_diam_top/2+wall_thickness,
// my_w,
// curve_angle);
translate([-my_w/2,0,0])
fitting(fitting_inside_diam_top/2,
fitting_inside_diam_top/2+wall_thickness,
fitting_length);
translate([my_w/2,0,0])
fitting(fitting_inside_diam_top/2,
fitting_inside_diam_top/2+wall_thickness,
fitting_length);
translate([0,custom_y(my_w, curve_angle)+fitting_length,0])
fitting(fitting_inside_diam_top/2,
fitting_inside_diam_top/2+wall_thickness,
fitting_length);