+/*
+ Copyright (C) 2015 Daniel Watson
+ See the end of the file for license conditions.
+*/
// challenge-bot
// GNU AGPLv3 (or later at your option)
-// project available at these locations:
-// https://gitorious.org/ozzloy/challenge-bot
-// https://github.com/waynegramlich/challenge-bot
+// project available here:
+// https://challenge-bot.com/
// use $fn = 20 while developing, 100 when about to print
// 20 will make previews fast
// 100 will make printing smooth
-$fn = 20;
-
-wheel_depth = 6;
-wheel_radius = 68/2;
-
-module encoder_shaft(){
- // measured with calipers, checked against the motor shaft
- motor_shaft_big = 3.7; // radius, gets doubled in cylinder
- motor_shaft_small = 4.8; // total length of box
- motor_shaft_length = wheel_depth * 3 / 4;
-
- intersection(){
- cylinder(h = motor_shaft_length, r = motor_shaft_big, center = true);
- // x direction is multiplied by 2 because the radius of the cylinder
- // goes in both directions. the extra .1 is for overlap
- cube([motor_shaft_big * 2.1, motor_shaft_small, motor_shaft_length],
- center = true);}}
-
-module mounting_screw(){
- cylinder(h = wheel_depth * 1.1, r = 1, center = true);}
-
-module wheel(){
- translate([0, 0, wheel_depth / 2]){
- difference(){
- cylinder(h = wheel_depth, r = wheel_radius, center = true);
- translate([0, 0, wheel_depth / 4]){
- scale([1, 1, 1.1]){
- encoder_shaft();}}
- mounting_screw();
- for(i = [1 : 5]){
- rotate(i * 360/5, [0, 0, 1]){
- translate([0, 0, -0.6 * wheel_depth])
- between_spokes();}}
- translate([0, 0, wheel_depth / 4]){
- difference(){
- cylinder(h = wheel_depth / 1.2,
- r = 0.85 * wheel_radius,
- center = true);
- cylinder(h = wheel_depth / 1.2,
- r = 0.23 * wheel_radius,
- center = true);}}}}}
-
-module wheel_block(){
- cube([wheel_radius, wheel_radius, wheel_depth]);}
-
-module pie_slice(){
- intersection(){
- translate([0, 0, wheel_depth / 2]){
- cylinder(h = wheel_depth,
- r = 0.85 * wheel_radius,
- center = true);}
- translate([0, wheel_radius * 0.3, 0]){
- rotate([0, 0, (360 / 5) / 2]){
- intersection(){
- wheel_block();
- rotate([0, 0, 90 - 360 / 5])
- wheel_block();}}}}}
-
-module between_spokes(){
- minkowski(){
- pie_slice();
- cylinder(h = wheel_depth / 2, r = 1);}}
-
-wheel();
+include <wheel-data.scad>
+
+wheel(wheel_radius,
+ wheel_width,
+ motor_shaft_radius,
+ motor_shaft_flat_width,
+ wall_width,
+ tread_radius);
+
+/*
+ This file is part of challenge-bot.
+
+ Challenge-bot is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ GNU Affero Emacs is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with challenge-bot. If not, see <http://www.gnu.org/licenses/>.
+*/