Merge branch 'master' of git://github.com/Thav/Prusa3 into Thav-master
[clinton/prusa3.git] / box_frame / inc / functions.scad
index 40ee477..bdf217f 100644 (file)
@@ -5,7 +5,7 @@
 // Václav 'ax' Hůla <axtheb@gmail.com>
 // Vlnofka <>
 // http://www.reprap.org/wiki/Prusa_Mendel
-// http://github.com/prusajr/PrusaMendel
+// http://github.com/josefprusa/Prusa3
 
 
 module nut(d,h,horizontal=true){
@@ -18,18 +18,6 @@ module nut(d,h,horizontal=true){
     }
 }
 
-// Based on nophead research
-module polyhole(d, h, center=false) {
-    n = max(round(2 * d),3);
-    rotate([0,0,180])
-        cylinder(h = h, r = (d / 2) / cos (180 / n), $fn = n);
-}
-
-// make it interchangeable between this and cylinder
-module cylinder_poly(r, h, center=false){
-    polyhole(d=r*2, h=h, center=center);
-}
-
 module fillet(radius, height=100, $fn=0) {
     //this creates acutal fillet
     translate([-radius, -radius, -height / 2 - 0.02]) difference() {
@@ -150,16 +138,19 @@ module plate_screw(long=0) {
 }
 
 //radius of the idler assembly (to surface that touches belt, ignoring guide walls)
-function idler_assy_r_inner(idler_bearing) = (idler_bearing[0] / 2) + 4 * single_wall_width * idler_bearing[3];
-//radius of the idler assembly (to smooth side of belt)
-function idler_assy_r_outer(idler_bearing) = (idler_bearing[0] / 2) + (idler_bearing[3] ? (5.5 * idler_bearing[3]) : 3);
+function idler_assy_r_inner(idler_bearing) = (idler_bearing[0] / 2) + (6 * single_wall_width + 0.2) * idler_bearing[3];
+//outer radius of the idler assembly (to smooth side of belt) 
+function idler_assy_r_outer(idler_bearing) = idler_assy_r_inner(idler_bearing) + belt_thickness + 1;
 
 
 module idler_assy(idler_bearing = [22, 7, 8, 1]) {
 
+    //bearing axle
     translate([0,0,-1]) cylinder(h = 120, r=(idler_bearing[2] + 1) / 2, $fn=small_hole_segments, center=true);
     //bearing shadow
     %cylinder(h = idler_bearing[1], r=idler_bearing[0]/2, center=true);
+    //belt shadow
+    %cylinder(h = belt_width, r=idler_assy_r_outer(idler_bearing), center=true);
 
     cylinder(h = idler_width + 1, r=idler_assy_r_outer(idler_bearing) + 0.5, center=true);
 }