note issues with current rev in code
[clinton/wilson.git] / scad / bearing.scad
1 // PRUSA iteration3
2 // Bearing holders
3 // GNU GPL v3
4 // Josef Průša <iam@josefprusa.cz> and contributors
5 // http://www.reprap.org/wiki/Prusa_Mendel
6 // http://prusamendel.org
7 // Alterations for Wilson by MRice <mrice411@gmail.com>
8
9 include <configuration.scad>
10
11 module horizontal_bearing_base(bearings=1){
12 translate(v=[0,0,6]) cube(size = [24,8+bearings*25,12], center = true);
13 }
14 module horizontal_bearing_holes(bearings=1){
15 cutter_lenght = 10+bearings*25;
16 one_holder_lenght = 8+25;
17 holder_lenght = 8+bearings*25;
18
19 // Main bearing cut
20 difference(){
21 translate(v=[0,0,12])
22 rotate(a=[90,0,0]) translate(v=[0,0,-cutter_lenght/2]) cylinder(h = cutter_lenght, r=bearing_diameter/2, $fn=50);
23 // Bearing retainers
24 translate(v=[0,1-holder_lenght/2,3]) cube(size = [24,6,8], center = true);
25 translate(v=[0,-1+holder_lenght/2,3]) cube(size = [24,6,8], center = true);
26 }
27
28 // Ziptie cutouts
29 ziptie_cut_ofset = 0;
30 for ( i = [0 : bearings-1] ){
31 // For easier positioning I move them by half of one
32 // bearing holder then add each bearign lenght and then center again
33 translate(v=[0,-holder_lenght/2,0]) translate(v=[0,one_holder_lenght/2+i*25,0]) difference(){
34 union(){
35 translate(v=[0,2-6,12]) rotate(a=[90,0,0]) translate(v=[0,0,0]) cylinder(h = 4, r=12.5, $fn=50);
36 translate(v=[0,2+6,12]) rotate(a=[90,0,0]) translate(v=[0,0,0]) cylinder(h = 4, r=12.5, $fn=50);
37 }
38 translate(v=[0,10,12]) rotate(a=[90,0,0]) translate(v=[0,0,0]) cylinder(h = 24, r=10, $fn=50);
39 }
40 }
41
42 }
43
44 module horizontal_bearing_test(){
45 difference(){
46 horizontal_bearing_base(1);
47 horizontal_bearing_holes(1);
48 }
49 translate(v=[30,0,0]) difference(){
50 horizontal_bearing_base(2);
51 horizontal_bearing_holes(2);
52 }
53 translate(v=[60,0,0]) difference(){
54 horizontal_bearing_base(3);
55 horizontal_bearing_holes(3);
56 }
57 }
58
59
60
61 thinwall = 3;
62 bearing_size = bearing_diameter + 2 * thinwall;
63
64 module vertical_bearing_base(){
65 translate(v=[-2-bearing_size/4,0,x_box_height/2]) cube(size = [4+bearing_size/2,bearing_size,x_box_height], center = true);
66 cylinder(h = x_box_height, r=bearing_size/2, $fn = 90);
67 }
68
69 module vertical_bearing_holes(){
70 translate(v=[0,0,-4]) cylinder(h = x_box_height + 3, r=bearing_diameter/2 + bearing_cut_extra, $fn = 60);
71 translate(v=[0,0,x_box_height-4]) cylinder(h=x_box_height,r=bearing_diameter/2-1,$fn=60);
72 // TODO: make translate(z) use x_box_height to correctly position slit
73 #rotate(a=[0,0,-50]) translate(v=[8,0,24/*was 31.5 mjr*/]) cube(size = [10,2 /*was 1 mjr*/ ,x_box_height+13], center = true);
74 translate([0,0,-1]) cylinder(h=9,r1=bearing_diameter/2+thinwall/2+1,r2=4,$fn=60);
75 //#translate([0,0,49]) cylinder(h=9,r2=bearing_diameter/2+thinwall/2,r1=4,$fn=60);
76 }
77
78 difference(){
79 vertical_bearing_base();
80 vertical_bearing_holes();
81 }