Add endstop holing ability to tube clamps
[clinton/prusa3.git] / box_frame / extras / tube_clamp.scad
CommitLineData
e11b3a11
VAH
1//makes tube clamping part. Useful for strenghtening Z axis tubing or as holder for Z axis endstop.
2// GNU GPL v3
3// Václav 'ax' Hůla <axtheb@gmail.com>
4include <../configuration.scad>;
2f03cc4a 5$fn=64;
e11b3a11 6
6cc93f2f 7module tube_clamp(tube_r, wall_width=3, endstop=false, h=10) {
8472e504 8 //wall_width is in single_wall_widths
e11b3a11 9 difference() {
0af030a8 10 union(){
e11b3a11
VAH
11 intersection() {
12 union(){
6cc93f2f
VAH
13 cylinder(r=tube_r + wall_width * single_wall_width, h=h);
14 translate([-4.5, 0, 0]) cube([9, 20, h]);
e11b3a11 15 }
6cc93f2f 16 cylinder(r=tube_r + 5 + wall_width * single_wall_width, h=h);
0af030a8
VAH
17 }
18 if (endstop) {
6cc93f2f 19 translate([-4.5, 5 + tube_r, 0]) cube([4.5, 30, h]);
0af030a8 20 }
e11b3a11 21 }
6cc93f2f
VAH
22 translate([0, 0, -0.5]) cylinder(r=tube_r, h=h + 1);
23 translate([-0.5, 0, -0.5]) cube([1, 45, h + 1]);
e11b3a11 24
6cc93f2f 25 translate([-7, max (6, tube_r + wall_width * single_wall_width + 0.5) , h / 2]) {
e11b3a11 26 rotate([0, 90, 0]) screw(r=1.7, r_head=m3_washer_diameter/2, head_drop=3, slant=false);
2f03cc4a 27 translate([10, 0, 0]) rotate([0, 90, 0]) cylinder(r=m3_nut_diameter_horizontal/2, $fn=6, h=2);
e11b3a11 28 }
0af030a8 29 if (endstop) {
6cc93f2f 30 translate([-7, 10 + tube_r, h / 2]) rotate([0, 90, 0]) {
0af030a8
VAH
31 cylinder(r = 1.2, h=10);
32 translate([0, 10, 0])
33 cylinder(r = 1.2, h=10);
c1685d20
VAH
34 translate([0, 20, 0])
35 cylinder(r = 1.2, h=10);
0af030a8
VAH
36 }
37 }
e11b3a11
VAH
38
39 }
40}
41
42tube_clamp(3.5);
24342922
VAH
43translate([15, 0, 0]) tube_clamp(3.5);
44translate([0, 20, 0]) {
6cc93f2f
VAH
45 tube_clamp(bushing_xy[0], endstop=true, h=12);
46 translate([20, 0, 0]) tube_clamp(bushing_xy[0], endstop=true, h=12);
47 translate([-20, 0, 0]) tube_clamp(bushing_z[0], endstop=true, h=12);
24342922 48}