z-axis: ignore z_delta setting
[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/josefprusa/Prusa3
9
10 // ThingDoc entry
11 /**
12 * @description 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 include <functions.scad>
20
21 //guiding_wall_thickness of guiding wall
22 guiding_wall_thickness=layer_height * 4;
23
24
25 height = max(belt_width, idler_bearing[1]) + guiding_wall_thickness;
26 //How much the guiding wall overlaps the bearing wall (to the center)
27 wall_descent = 1;
28
29 module bearing_guide_inner(){
30 //inner (smaller) part of the guide
31 difference(){
32 cylinder(r=idler_bearing[0] / 2 + single_wall_width * 3, h=height - (max( idler_bearing[1], belt_width) - idler_bearing[1]) / 2);
33 translate([0, 0, -1])
34 cylinder(r=idler_bearing[0] / 2, h=height + 2);
35 }
36
37 difference(){
38 union() {
39 cylinder(r=idler_assy_r_outer(idler_bearing), h=guiding_wall_thickness); //guide wall
40 cylinder(r=idler_bearing[0] / 2, h=guiding_wall_thickness + (belt_width - idler_bearing[1])/2); //this centers the guide on bearing
41 }
42 translate([0,0,-1])
43 cylinder(r=idler_bearing[0] / 2 - wall_descent, h=guiding_wall_thickness + 10);
44 }
45 }
46
47 module bearing_guide_outer(){
48 difference(){
49 cylinder(r=idler_bearing[0] / 2 + 6 * single_wall_width + 0.2, h=height);
50 translate([0,0,-1])
51 cylinder(r=idler_bearing[0] / 2 + single_wall_width * 3, h=height + 2);
52 }
53
54 difference(){
55 union(){
56 cylinder(r=idler_assy_r_outer(idler_bearing), h=guiding_wall_thickness);
57 cylinder(r=idler_bearing[0] / 2, h=guiding_wall_thickness + (belt_width - idler_bearing[1])/2);
58 }
59 translate([0,0,-1])
60 cylinder(r=idler_bearing[0]/2-wall_descent, h=height + 5);
61 }
62 }
63
64 module bearing_assy(){
65
66 bearing_guide_inner();
67 translate([idler_assy_r_outer(idler_bearing) * 2 + 2, 0, 0])
68 bearing_guide_outer();
69 }
70
71 bearing_assy();