use spokes instead of square for wheel
[challenge-bot] / 3d-printables / wheel-data.scad
index 7288895df8fc0f9c3da636fa2b77084d05e5be8d..5245266a8c857e637c8a741011094b8806ffd693 100644 (file)
@@ -1,29 +1,33 @@
+/*
+  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 = 100;
 
-wheel_square_spoke_size = 45;
-wheel_square_spoke_thickness = 2;
+wheel_spoke_length = 45;
+wheel_spoke_thickness = 2;
 
 wall_width = 3;
 
-wheel_width = 9;
-wheel_radius = sqrt(2 * pow(wheel_square_spoke_size / 2, 2)) + wall_width / 2;
+rim_width = 7;
+wheel_radius =
+  sqrt(2 * pow(wheel_spoke_length / 2, 2)) + wall_width / 2 + 1;
 
-motor_shaft_radius = 3.7;
-motor_shaft_flat_width = 4.8;
+motor_shaft_radius = 3.9;
+motor_shaft_flat_width = 5.2;
 
 tread_radius = 4 / 2;
 
 module mounting_screw_flat() {
-  circle(0.9); }
+  circle(1.1); }
 
 module motor_shaft_flat(radius, flat_width) {
   intersection() {
@@ -36,8 +40,8 @@ module motor_shaft(radius,
   linear_extrude(height = shaft_length) {
     motor_shaft_flat(radius, flat_width); } }
 
-module rim(radius, wall_width, wheel_width) {
-  linear_extrude(height = wheel_width) {
+module rim(radius, wall_width, rim_width) {
+  linear_extrude(height = rim_width) {
     difference() {
       circle(radius);
       circle(radius - wall_width); } } }
@@ -63,16 +67,39 @@ module wheel(radius,
              shaft_flat_width,
              wall_width,
              tread_radius) {
+  spoke_count = 7;
+  spoke_width = radius / 3;
   difference() {
     rim(radius, wall_width * 2, width);
     translate([0, 0, width / 2]) {
       tread(radius, tread_radius); } }
-  linear_extrude(height = wheel_square_spoke_thickness) {
+  linear_extrude(height = wheel_spoke_thickness) {
     difference() {
-      square(wheel_square_spoke_size, center = true);
+      union(){
+        for(spoke = [0: spoke_count - 1]) {
+          rotate(spoke * 360 / spoke_count) {
+            translate([-spoke_width / 2, 0]){
+            square([spoke_width, radius - 2]); } } } }
       mounting_screw_flat(); } }
-  translate([0, 0, wheel_square_spoke_thickness]) {
+  translate([0, 0, wheel_spoke_thickness]) {
     motor_shaft_holder(shaft_radius,
                        shaft_flat_width,
                        wall_width,
-                       width - wheel_square_spoke_thickness); } }
+                       width - wheel_spoke_thickness); } }
+
+/*
+  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/>.
+*/