| 1 | // challenge-bot |
| 2 | // GNU AGPLv3 (or later at your option) |
| 3 | // project available at these locations: |
| 4 | // https://gitorious.org/ozzloy/challenge-bot |
| 5 | // https://github.com/waynegramlich/challenge-bot |
| 6 | |
| 7 | // use $fn = 20 while developing, 100 when about to print |
| 8 | // 20 will make previews fast |
| 9 | // 100 will make printing smooth |
| 10 | $fn = 100; |
| 11 | |
| 12 | wheel_square_spoke_size = 45; |
| 13 | wheel_square_spoke_thickness = 2; |
| 14 | |
| 15 | wall_width = 3; |
| 16 | |
| 17 | wheel_width = 9; |
| 18 | wheel_radius = |
| 19 | sqrt(2 * pow(wheel_square_spoke_size / 2, 2)) + wall_width / 2 + 1; |
| 20 | |
| 21 | motor_shaft_radius = 3.7; |
| 22 | motor_shaft_flat_width = 4.8; |
| 23 | |
| 24 | tread_radius = 4 / 2; |
| 25 | |
| 26 | module mounting_screw_flat() { |
| 27 | circle(1.1); } |
| 28 | |
| 29 | module motor_shaft_flat(radius, flat_width) { |
| 30 | intersection() { |
| 31 | circle(radius); |
| 32 | square([flat_width, radius * 2], center = true); } } |
| 33 | |
| 34 | module motor_shaft(radius, |
| 35 | flat_width, |
| 36 | shaft_length) { |
| 37 | linear_extrude(height = shaft_length) { |
| 38 | motor_shaft_flat(radius, flat_width); } } |
| 39 | |
| 40 | module rim(radius, wall_width, wheel_width) { |
| 41 | linear_extrude(height = wheel_width) { |
| 42 | difference() { |
| 43 | circle(radius); |
| 44 | circle(radius - wall_width); } } } |
| 45 | |
| 46 | module motor_shaft_holder_flat(radius, flat_width, wall_width) { |
| 47 | difference() { |
| 48 | motor_shaft_flat(radius + wall_width, |
| 49 | flat_width + wall_width); |
| 50 | motor_shaft_flat(radius, flat_width); } } |
| 51 | |
| 52 | module motor_shaft_holder(radius, flat_width, wall_width, height) { |
| 53 | linear_extrude(height = height) { |
| 54 | motor_shaft_holder_flat(radius, flat_width, wall_width); } } |
| 55 | |
| 56 | module tread(wheel_radius, tread_radius) { |
| 57 | rotate_extrude(convexity = 10) { |
| 58 | translate([wheel_radius, 0]) { |
| 59 | circle(tread_radius); } } } |
| 60 | |
| 61 | module wheel(radius, |
| 62 | width, |
| 63 | shaft_radius, |
| 64 | shaft_flat_width, |
| 65 | wall_width, |
| 66 | tread_radius) { |
| 67 | difference() { |
| 68 | rim(radius, wall_width * 2, width); |
| 69 | translate([0, 0, width / 2]) { |
| 70 | tread(radius, tread_radius); } } |
| 71 | linear_extrude(height = wheel_square_spoke_thickness) { |
| 72 | difference() { |
| 73 | square(wheel_square_spoke_size, center = true); |
| 74 | mounting_screw_flat(); } } |
| 75 | translate([0, 0, wheel_square_spoke_thickness]) { |
| 76 | motor_shaft_holder(shaft_radius, |
| 77 | shaft_flat_width, |
| 78 | wall_width, |
| 79 | width - wheel_square_spoke_thickness); } } |