diff --git a/readme.md b/readme.md index 32d0154..73245b9 100644 --- a/readme.md +++ b/readme.md @@ -223,6 +223,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour | Function | Description | |:--- |:--- | | ```belt_pitch(type)``` | Pitch in mm | +| ```belt_pitch_height(type)``` | Offset of the pitch radius from the tips of the teeth | | ```belt_thickness(type)``` | Total thickness including teeth | | ```belt_tooth_height(type)``` | Tooth height | | ```belt_width(type)``` | Width in mm | @@ -231,7 +232,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour | Function | Description | |:--- |:--- | | ```belt_length(points, gap = 0)``` | Compute belt length given path and optional gap | -| ```belt_pitch_height(type)``` | Offset of the pitch radius from the tips of the teeth | +| ```belt_pitch_to_back(type)``` | Offset of the back from the pitch radius | ### Modules | Module | Description | @@ -244,7 +245,7 @@ Individual teeth are not drawn, instead they are represented by a lighter colour | Qty | Module call | BOM entry | | ---:|:--- |:---| | 1 | ```belt(GT2x6, [ ... ])``` | Belt GT2 x 6mm x 128mm | -| 1 | ```belt(GT2x6, [ ... ], 80, [0, 0.81])``` | Belt GT2 x 6mm x 694mm | +| 1 | ```belt(GT2x6, [ ... ], 80, [0, 0.314])``` | Belt GT2 x 6mm x 696mm | | 1 | ```belt(T2p5x6, [ ... ])``` | Belt T2.5 x 6mm x 130mm | | 1 | ```belt(T5x10, [ ... ])``` | Belt T5 x 10mm x 130mm | | 1 | ```belt(T5x6, [ ... ])``` | Belt T5 x 6mm x 130mm | diff --git a/tests/png/belts.png b/tests/png/belts.png index 9553d20..2475485 100644 Binary files a/tests/png/belts.png and b/tests/png/belts.png differ diff --git a/vitamins/belt.scad b/vitamins/belt.scad index 920b9fc..0ec3196 100644 --- a/vitamins/belt.scad +++ b/vitamins/belt.scad @@ -34,7 +34,9 @@ function belt_pitch(type) = type[1]; //! Pitch in mm function belt_width(type) = type[2]; //! Width in mm function belt_thickness(type) = type[3]; //! Total thickness including teeth function belt_tooth_height(type) = type[4]; //! Tooth height -function belt_pitch_height(type) = belt_tooth_height(type) + type[4]; //! Offset of the pitch radius from the tips of the teeth +function belt_pitch_height(type) = type[5] + belt_tooth_height(type); //! Offset of the pitch radius from the tips of the teeth + +function belt_pitch_to_back(type) = belt_thickness(type) - belt_pitch_height(type); //! Offset of the back from the pitch radius function no_point(str) = chr([for(c = str) if(c == ".") ord("p") else ord(c)]); // @@ -56,24 +58,26 @@ module belt(type, points, gap = 0, gap_pt = undef, belt_colour = grey(20), tooth module shape() rounded_polygon(points, tangents); + ph = belt_pitch_height(type); + th = belt_tooth_height(type); module gap() if(gap) - translate(gap_pt) + translate(gap_pt + [0, -ph + thickness / 2]) square([gap, thickness + eps], center = true); color(belt_colour) linear_extrude(width, center = true) difference() { - offset(thickness - belt_pitch_height(type)) shape(); - offset(-belt_pitch_height(type) + belt_tooth_height(type)) shape(); + offset(-ph + thickness ) shape(); + offset(-ph + th) shape(); gap(); } color(tooth_colour) linear_extrude(width, center = true) difference() { - offset(-belt_pitch_height(type) + belt_tooth_height(type)) shape(); - offset(-belt_pitch_height(type)) shape(); + offset(-ph + th) shape(); + offset(-ph) shape(); gap(); } }