move bearing-guide.scad to inc/, add guides to x-end/y-drivetrain
[clinton/prusa3.git] / box_frame / inc / bearing-guide.scad
1 // PRUSA iteration3
2 // Bearing guide
3 // GNU GPL v3
4 // Josef Průša <josefprusa@me.com>
5 // Václav 'ax' Hůla <axtheb@gmail.com>
6 // Original design by Greg Frost
7 // http://www.reprap.org/wiki/Prusa_Mendel
8 // http://github.com/prusajr/PrusaMendel
9
10
11 /**
12 * Helps to hold belt aligned on the bearing.
13 * @id bearing-guide
14 * @name Bearing guide
15 * @category Printed
16 */
17
18 include <../configuration.scad>
19
20 //thickness of guiding wall
21 thickness=1;
22
23 belt_width = 7;
24 height = belt_width + thickness;
25 //height of the guiding wall, from beraring surface
26 wall_ascent = 4.5;
27 //guiding wall extends to sides of bearing too
28 wall_descent = 1;
29
30 module bearing_guide_inner()
31 {
32 difference(){
33 cylinder(r=idler_bearing[0] / 2 + single_wall_width * 2, h=height - (belt_width - idler_bearing[1])/2);
34 translate([0,0,-1])
35 cylinder(r=idler_bearing[0]/2,h=height+2);
36 }
37
38 difference(){
39 union() {
40 cylinder(r=idler_bearing[0] / 2 + wall_ascent, h=thickness);
41 cylinder(r=idler_bearing[0] / 2, h=thickness + (belt_width - idler_bearing[1])/2);
42 }
43 translate([0,0,-1])
44 cylinder(r=idler_bearing[0]/2-wall_descent,h=thickness+10);
45 }
46 }
47
48 module bearing_guide_outer()
49 {
50 difference(){
51 cylinder(r=idler_bearing[0]/2+2*single_wall_width*2+0.2,h=height);
52 translate([0,0,-1])
53 cylinder(r=idler_bearing[0]/2+single_wall_width*2+0.2,h=height+2);
54 }
55
56 difference(){
57 union(){
58 cylinder(r=idler_bearing[0]/2+wall_ascent,h=thickness);
59 cylinder(r=idler_bearing[0] / 2, h=thickness + (belt_width - idler_bearing[1])/2);
60 }
61 translate([0,0,-1])
62 cylinder(r=idler_bearing[0]/2-wall_descent,h=thickness+2);
63 }
64 }
65
66 if (idler_bearing[3] == 1) {
67
68 translate([0,idler_bearing[0]+2*wall_ascent+2,0]){
69 bearing_guide_inner();
70 translate([idler_bearing[0]+2*wall_ascent+2,0,0])
71 bearing_guide_outer();
72
73 }
74 } else {
75 cube([0.1,0.1,0.1]);
76 echo ("None");
77 }