separate data into *-data.scad for 3d models
authordaniel watson <ozzloy@gmail.com>
Sat, 28 Feb 2015 00:14:42 +0000 (16:14 -0800)
committerdaniel watson <ozzloy@gmail.com>
Sat, 28 Feb 2015 00:14:42 +0000 (16:14 -0800)
moving the data to a separate file without the drawing makes
combining several models easier

34 files changed:
3d-printables/Makefile
3d-printables/angle-bracket-data.scad [new file with mode: 0644]
3d-printables/angle-bracket.scad
3d-printables/astyle-options [new file with mode: 0644]
3d-printables/caster-standoff-data.scad [new file with mode: 0644]
3d-printables/caster-standoff-dimensions.scad [deleted file]
3d-printables/caster-standoff.scad
3d-printables/deck-data.scad [new file with mode: 0644]
3d-printables/deck-holder-data.scad [new file with mode: 0644]
3d-printables/deck-holder.scad [new file with mode: 0644]
3d-printables/deck.scad
3d-printables/makerfarm-i3-v-8in.ini [new file with mode: 0644]
3d-printables/motor-mount-data.scad [new file with mode: 0644]
3d-printables/motor-mount-dimensions.scad [deleted file]
3d-printables/motor-mount-drill-jig.scad [deleted file]
3d-printables/motor-mount.scad
3d-printables/nut-data.scad [new file with mode: 0644]
3d-printables/nut.scad [deleted file]
3d-printables/oshw-data.scad [new file with mode: 0644]
3d-printables/oshw.scad
3d-printables/qr.scad [deleted file]
3d-printables/schematic-3d-printable.scad [deleted file]
3d-printables/schematic.scad [deleted file]
3d-printables/sonar-table-top-holder-data.scad [new file with mode: 0644]
3d-printables/sonar-table-top-holder-dimensions.scad [deleted file]
3d-printables/sonar-table-top-holder.scad
3d-printables/wheel-black.scad [deleted file]
3d-printables/wheel-data.scad [new file with mode: 0644]
3d-printables/wheel-dimensions.scad [deleted file]
3d-printables/wheel-white.scad [deleted file]
3d-printables/wheel.scad
3d-printables/wire-jig-data.scad [new file with mode: 0644]
3d-printables/wire-jig-dimensions.scad [deleted file]
3d-printables/wire-jig.scad

index 9122a3e4305ed347f8ced4ab0749a231e2cd190a..34bf30b04981627f03456f823073ed0bb147dfd4 100644 (file)
-%.stl: %.scad %-dimensions.scad
+%.stl: %.scad %-data.scad
        openscad $< -o $@
 
 %.gcode: %.stl
        slic3r \
        openscad $< -o $@
 
 %.gcode: %.stl
        slic3r \
-        -o $@ \
-        --bed-temperature 70 \
-        --first-layer-bed-temperature 80 \
-        --temperature 225 \
-        --first-layer-temperature 235 \
-        --threads 4 \
-        --nozzle-diameter 0.4 \
-        --print-center 95,95 \
-        --z-offset 0 \
-        --gcode-flavor reprap \
-        --filament-diameter 1.75 \
-        --extrusion-multiplier 1 \
-        --travel-speed 100 \
-        --perimeter-speed 75 \
-        --small-perimeter-speed 50 \
-        --external-perimeter-speed '70%' \
-        --infill-speed 100 \
-        --solid-infill-speed 100 \
-        --top-solid-infill-speed 100 \
-        --support-material-speed 50 \
-        --bridge-speed 150 \
-        --gap-fill-speed 50 \
-        --first-layer-speed '30%' \
-        --perimeter-acceleration 0 \
-        --infill-acceleration 0 \
-        --bridge-acceleration 0 \
-        --default-acceleration 0 \
-        --layer-height 0.2 \
-        --first-layer-height 0.35 \
-        --infill-every-layers 1 \
-        --solid-infill-every-layers 0 \
-        --perimeters 3 \
-        --top-solid-layers 4 \
-        --bottom-solid-layers 3 \
-        --fill-density '20%' \
-        --fill-angle 45 \
-        --fill-pattern honeycomb \
-        --solid-fill-pattern rectilinear \
-        --start-gcode start.gcode \
-        --end-gcode end.gcode \
-        --extra-perimeters \
-        --seam-position nearest \
-        --avoid-crossing-perimeters \
-        --only-retract-when-crossing-perimeters \
-        --solid-infill-below-area 70 \
-        --support-material-threshold 0 \
-        --support-material-pattern rectilinear \
-        --support-material-spacing 2.5 \
-        --support-material-angle 0 \
-        --support-material-interface-layers 0 \
-        --support-material-interface-spacing 0 \
-        --raft-layers 0 \
-        --retract-length 1 \
-        --retract-speed 30 \
-        --retract-restart-extra 0 \
-        --retract-before-travel 2 \
-        --retract-lift 0 \
-        --retract-layer-change \
-        --cooling \
-        --min-fan-speed 35 \
-        --max-fan-speed 100 \
-        --bridge-fan-speed 100 \
-        --fan-below-layer-time 60 \
-        --slowdown-below-layer-time 30 \
-        --min-print-speed 10 \
-        --disable-fan-first-layers 0 \
-        --fan-always-on \
-        --skirts 1 \
-        --skirt-distance 6 \
-        --skirt-height 1 \
-        --min-skirt-length 0 \
-        --brim-width 0 \
-        --bed-size 200,200 \
-        --extruder-clearance-radius 20 \
-        --extruder-clearance-height 20 \
-        --resolution 0 \
-        --extrusion-width 0 \
-        --first-layer-extrusion-width '200%' \
-        --perimeter-extrusion-width 0 \
-        --infill-extrusion-width 0 \
-        --solid-infill-extrusion-width 0 \
-        --top-infill-extrusion-width 0 \
-        --support-material-extrusion-width 0 \
-        --bridge-flow-ratio 1 \
-        $<
-
-%-green.gcode: %.stl
-       slic3r \
-        -o $@ \
-        --bed-temperature 70 \
-        --first-layer-bed-temperature 90 \
-        --temperature 215 \
-        --first-layer-temperature 235 \
-        --perimeters 3 \
-        --top-solid-layers 4 \
-        --bottom-solid-layers 3 \
-        --fill-density 20 \
-        --fill-pattern honeycomb \
-        --skirts 1 \
-        --skirt-distance 6 \
-        --skirt-height 1 \
-        --brim-width 0 \
-        --layer-height 0.2 \
-        --fill-angle 45 \
-        --min-skirt-length 0 \
-        --threads 4 \
-        --nozzle-diameter 0.4 \
-        --print-center 95,95 \
-        --z-offset 0 \
-        --gcode-flavor reprap \
-        --filament-diameter 1.75 \
-        --extrusion-multiplier 1 \
-        --travel-speed 100 \
-        --perimeter-speed 75 \
-        --small-perimeter-speed 50 \
-        --external-perimeter-speed '70%' \
-        --infill-speed 100 \
-        --solid-infill-speed 100 \
-        --top-solid-infill-speed 100 \
-        --support-material-speed 50 \
-        --bridge-speed 150 \
-        --gap-fill-speed 50 \
-        --first-layer-speed '30%' \
-        --perimeter-acceleration 0 \
-        --infill-acceleration 0 \
-        --bridge-acceleration 0 \
-        --default-acceleration 0 \
-        --first-layer-height 0.35 \
-        --infill-every-layers 1 \
-        --solid-infill-every-layers 0 \
-        --solid-fill-pattern rectilinear \
-        --start-gcode start.gcode \
-        --end-gcode end.gcode \
-        --extra-perimeters \
-        --seam-position aligned \
-        --avoid-crossing-perimeters \
-        --only-retract-when-crossing-perimeters \
-        --solid-infill-below-area 70 \
-        --support-material-threshold 0 \
-        --support-material-pattern rectilinear \
-        --support-material-spacing 2.5 \
-        --support-material-angle 0 \
-        --support-material-interface-layers 0 \
-        --support-material-interface-spacing 0 \
-        --raft-layers 0 \
-        --retract-length 1 \
-        --retract-speed 30 \
-        --retract-restart-extra 0 \
-        --retract-before-travel 2 \
-        --retract-lift 0 \
-        --retract-layer-change \
-        --cooling \
-        --min-fan-speed 35 \
-        --max-fan-speed 100 \
-        --bridge-fan-speed 100 \
-        --fan-below-layer-time 60 \
-        --slowdown-below-layer-time 30 \
-        --min-print-speed 10 \
-        --disable-fan-first-layers 0 \
-        --fan-always-on \
-        --bed-size 200,200 \
-        --extruder-clearance-radius 20 \
-        --extruder-clearance-height 20 \
-        --resolution 0 \
-        --extrusion-width 0 \
-        --first-layer-extrusion-width '200%' \
-        --perimeter-extrusion-width 0 \
-        --infill-extrusion-width 0 \
-        --solid-infill-extrusion-width 0 \
-        --top-infill-extrusion-width 0 \
-        --support-material-extrusion-width 0 \
-        --bridge-flow-ratio 1 \
-        $<
+       -o $@ \
+       --load makerfarm-i3-v-8in.ini \
+       $<
 
 %.print: %.gcode
 
 %.print: %.gcode
-       cp $< /media/3D-PRINTER
+       cp $< /media/${USER}/3D-PRINTER
        sleep 1
        sleep 1
-       umount /media/3D-PRINTER
+       umount /media/${USER}/3D-PRINTER
+
+pretty-angle-bracket:
+       astyle --options=astyle-options --recursive "*angle-bracket.scad"
+
+clean:
+       rm -f *.gcode
+       rm -f *.stl
diff --git a/3d-printables/angle-bracket-data.scad b/3d-printables/angle-bracket-data.scad
new file mode 100644 (file)
index 0000000..bd69d59
--- /dev/null
@@ -0,0 +1,27 @@
+// 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
+
+// this needs to be updated with actual measurements
+length = 5;
+width = 5;
+thickness = 1;
+
+module plate(length, width, thickness) {
+  difference() {
+    cube([length, width, thickness]);
+    translate([0, 0, -0.05 * thickness]) {
+      scale([1, 1, 1.1]) {
+        translate([length / 2, (width + thickness) / 2, 0]) {
+          cylinder(h = thickness, r = 0.5, $fn = 20); } } } } }
+
+
+module bracket(length, width, thickness) {
+  translate([0, thickness / 2, thickness / 2]) {
+    translate([0, - thickness / 2, - thickness / 2]) {
+      plate(length, width, thickness); }
+    rotate([90, 0, 0]) {
+      translate([0, - thickness / 2, - thickness / 2]) {
+        plate(length, width, thickness); } } } }
index fdd2b50eb095d0e7c4663c94daf34453d1d4e0c9..788e6b4e271757a17db6eedab92b79a00f5dea18 100644 (file)
@@ -4,26 +4,6 @@
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
-// this needs to be updated with actual measurements
-length=5;
-width=5;
-thickness=1;
-
-module plate(length, width, thickness){
-  difference(){
-    cube([length, width, thickness]);
-    translate([0, 0, -0.05 * thickness])
-      scale([1, 1, 1.1])
-        translate([length / 2, (width + thickness) / 2, 0])
-          cylinder(h = thickness, r = 0.5, $fn = 20);}}
-
-
-module bracket (length, width, thickness){
-  translate ([0, thickness/2, thickness/2]){
-    translate([0, - thickness / 2, - thickness / 2])
-      plate(length, width, thickness);
-    rotate([90,0,0])
-      translate([0, - thickness / 2, - thickness / 2])
-        plate(length, width, thickness);}}
+include <angle-bracket-data.scad>
 
 bracket(length, width, thickness);
 
 bracket(length, width, thickness);
diff --git a/3d-printables/astyle-options b/3d-printables/astyle-options
new file mode 100644 (file)
index 0000000..acc1f46
--- /dev/null
@@ -0,0 +1,50 @@
+# 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
+
+# put opening and closing braces on same line as other code
+# example:
+# if (condition) {
+#  consequent; }
+style=lisp
+
+# use 2 spaces for each level of indentation.  no tabs
+indent=spaces=2
+
+# continuation lines should be indented at most 80 spaces
+max-instatement-indent=80
+
+# put space between construct keywors (like "if"), and "("
+# example:
+#  original:
+#   if(condition) {
+#  becomes:
+#   if (condition) {
+pad-header
+
+# remove spaces around parens
+# example:
+#  original:
+#   bar ( a, b );
+#  becomes:
+#   bar(a, b);
+unpad-paren
+
+# add brackets around single statement conditional branches
+# example:
+#  if (condition)
+#    consequent;
+# becomes:
+#  if (condition) {
+#    consequent; }
+add-brackets
+
+# attempt to break up long lines to stay within 80 columns
+# breaking will occur at logical conditionals (||, &&, ...), comma, paren,
+#  or space
+max-code-length=80
+
+# use lf for all line endings
+lineend=linux
diff --git a/3d-printables/caster-standoff-data.scad b/3d-printables/caster-standoff-data.scad
new file mode 100644 (file)
index 0000000..e1e46e8
--- /dev/null
@@ -0,0 +1,95 @@
+// 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
+
+use <oshw.scad>
+
+// use 10 ish for development, 60 or so for printing
+$fn = 60;
+
+/* measured with calipers */
+ball_diameter = 11 + 0.75; // extra bit added for printing imprecision
+ball_radius = ball_diameter / 2;
+
+standoff_height = 60; // kyle eyeballed
+
+gap = 3;
+wall_thickness = 1;
+holder_floor = 3;
+holder_arms_length = 20;
+holder_height =
+  holder_floor + holder_arms_length + (11 / 16) * ball_diameter;
+
+holder_radius = ball_radius + wall_thickness;
+holder_diameter = holder_radius * 2;
+
+standoff_radius = holder_radius; // 0.580 / 2 inches from spec sheet
+standoff_lower_portion_height = standoff_height - holder_height;
+
+// eyeballed caster flange height, (0.580/5) inches, times 2 to be stronger
+caster_flange_height = 5;
+caster_flange_width = 20.32;  // 0.800 inches
+
+deck_pitch = 25.4; // measured center to center on grid on pegboard
+deck_flange_height = 2.9464;
+deck_flange_screw_radius = 3.556 / 2;  // For #6 machine screws
+deck_flange_radius = (deck_pitch) / 2 + deck_flange_screw_radius + 3;
+
+module deck_flange() {
+  deck_pitch_diagonal = sqrt(2 * pow(deck_pitch, 2));
+  difference() {
+    scale([0.35, 0.35, 1]) {
+      linear_extrude(height = deck_flange_height) {
+        oshw(); } }
+    for (ii = [-1, 1]) {
+      translate([deck_pitch_diagonal / 2 * ii, 0, -.1])
+      cylinder(h = deck_flange_height * 1.1,
+               r = deck_flange_screw_radius); }
+    translate([0, deck_pitch_diagonal / 2, -.1])
+    cylinder(h = deck_flange_height * 1.1,
+             r = deck_flange_screw_radius); } }
+
+module deck_flange_reinforcement() {
+  translate([-deck_flange_radius,
+             -.5 * deck_flange_height / 2,
+             deck_flange_height]) {
+    difference() {
+      cube([deck_flange_radius, deck_flange_height / 2, deck_flange_radius]);
+      translate([-.1, -.05 * deck_flange_height, 0]) {
+        rotate([0, -45, 0]) {
+          cube([deck_flange_radius * 1.5, // 1.5 is bigger than sqrt(2)
+                deck_flange_height * 1.1, // 1.1 is bigger than 1
+                deck_flange_radius]); } } } } }
+
+module ball_holder() {
+  difference() {
+    union() {
+      cylinder(r = holder_radius, h = holder_height);
+      translate([0, 0, holder_arms_length]) {
+        cylinder(r1 = holder_radius,
+                 r2 = holder_radius + wall_thickness,
+                 h = wall_thickness);
+        translate([0, 0, wall_thickness]) {
+          cylinder(r = wall_thickness + holder_radius,
+                   h = holder_height
+                       - holder_arms_length
+                       - wall_thickness); } } }
+    translate([0, 0, ball_radius + holder_floor + holder_arms_length]) {
+      sphere(r = ball_radius); }
+    translate([0, 0, holder_floor + (holder_height - holder_floor) / 2 + 0.5]) {
+      cube([holder_diameter + wall_thickness * 2 + 0.1,
+            gap,
+            holder_height - holder_floor + 0.1],
+           center = true); } } }
+
+module caster_standoff() {
+  cylinder(h = standoff_lower_portion_height,
+           r = standoff_radius);
+  deck_flange();
+  for (ii = [0:3]) {
+    rotate([0, 0, 45 + 90 * ii])
+    deck_flange_reinforcement(); }
+  translate([0, 0, standoff_lower_portion_height]) {
+    ball_holder(); } }
diff --git a/3d-printables/caster-standoff-dimensions.scad b/3d-printables/caster-standoff-dimensions.scad
deleted file mode 100644 (file)
index 9d6e9e6..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* measured with calipers */
-ball_diameter = 11 + 0.75; // extra bit added for printing imprecision
-ball_radius = ball_diameter / 2;
-
-standoff_height = 60; // kyle eyeballed
-
-gap = 3;
-wall_thickness = 1;
-holder_floor = 3;
-holder_arms_length = 20;
-holder_height =
-  holder_floor + holder_arms_length + (11 / 16) * ball_diameter;
-
-holder_radius = ball_radius + wall_thickness;
-holder_diameter = holder_radius * 2;
-
-standoff_radius = holder_radius; // 0.580 / 2 inches from spec sheet
-standoff_lower_portion_height = standoff_height - holder_height;
-
-// eyeballed caster flange height, (0.580/5) inches, times 2 to be stronger
-caster_flange_height = 5;
-caster_flange_width = 20.32;  // 0.800 inches
-
-deck_pitch = 25.4; // measured center to center on grid on pegboard
-deck_flange_height = 2.9464;
-deck_flange_screw_radius = 3.556 / 2;  // For #6 machine screws
-deck_flange_radius = (deck_pitch) / 2 + deck_flange_screw_radius + 3;
index 328bc8b7f47987ce09043a2590fa1218fb377adf..71ce35229cbf0db2def49db642d24fc8670d206e 100644 (file)
@@ -4,67 +4,6 @@
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
-include <caster-standoff-dimensions.scad>
-use <oshw.scad>
-
-// use 10 ish for development, 60 or so for printing
-$fn = 60;
-
-module deck_flange(){
-  deck_pitch_diagonal = sqrt(2 * pow(deck_pitch, 2));
-  difference(){
-    scale([0.35, 0.35, 1]){
-      linear_extrude(height = deck_flange_height){
-        oshw();}}
-    for(ii = [-1, 1]){
-      translate([deck_pitch_diagonal / 2 * ii, 0, -.1])
-        cylinder(h = deck_flange_height * 1.1,
-                 r = deck_flange_screw_radius);}
-    translate([0, deck_pitch_diagonal / 2, -.1])
-      cylinder(h = deck_flange_height * 1.1,
-               r = deck_flange_screw_radius);}}
-
-module deck_flange_reinforcement(){
-  translate([-deck_flange_radius,
-             -.5 * deck_flange_height / 2,
-             deck_flange_height]){
-    difference (){
-      cube([deck_flange_radius, deck_flange_height / 2, deck_flange_radius]);
-      translate([-.1, -.05 * deck_flange_height, 0]){
-        rotate([0, -45, 0]){
-          cube([deck_flange_radius * 1.5, // 1.5 is bigger than sqrt(2)
-                deck_flange_height * 1.1, // 1.1 is bigger than 1
-                deck_flange_radius]);}}}}}
-
-module ball_holder(){
-  difference (){
-    union(){
-      cylinder(r = holder_radius, h = holder_height);
-      translate([0, 0, holder_arms_length]){
-        cylinder(r1 = holder_radius,
-                 r2 = holder_radius + wall_thickness,
-                 h = wall_thickness);
-        translate([0, 0, wall_thickness]){
-          cylinder(r = wall_thickness + holder_radius,
-                   h = holder_height
-                       - holder_arms_length
-                       - wall_thickness); }}}
-    translate([0, 0, ball_radius + holder_floor + holder_arms_length]){
-      sphere(r = ball_radius);}
-    translate([0, 0, holder_floor + (holder_height - holder_floor) / 2 + 0.5]){
-      cube([holder_diameter + wall_thickness * 2 + 0.1,
-            gap,
-            holder_height - holder_floor + 0.1],
-           center = true);}}}
-
-module caster_standoff(){
-  cylinder(h = standoff_lower_portion_height,
-           r = standoff_radius);
-  deck_flange();
-  for(ii = [0:3]){
-    rotate([0, 0, 45 + 90 * ii])
-      deck_flange_reinforcement();}
-  translate([0, 0, standoff_lower_portion_height]){
-    ball_holder();}}
+include <caster-standoff-data.scad>
 
 caster_standoff();
 
 caster_standoff();
diff --git a/3d-printables/deck-data.scad b/3d-printables/deck-data.scad
new file mode 100644 (file)
index 0000000..e203cd1
--- /dev/null
@@ -0,0 +1,46 @@
+// 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
+
+// all measurements are in mm unless stated otherwise
+
+// metric version of deck:
+deck_length = 250;
+deck_width = deck_length;
+deck_depth = 5;
+deck_pitch = 10;
+deck_grid_hole = 3;
+deck_hole_type = "square";
+deck_centered = true;
+
+/*
+  // imperial version of deck
+deck_length = 203.2; // 8 inches
+deck_width = deck_length;
+deck_depth = 25.4 * 3 / 16; // 3 / 16 of an inch
+deck_pitch = 25.4; // 1 inch
+deck_grid_hole = 6.35 / 2; // 1/4 inch diameter, 1/8 inch radius
+deck_hole_type = "circle";
+*/
+
+module deck_2d(width, length, pitch, hole, hole_type, center = false) {
+  center_width_offset = center ? -(width / 2) : 0;
+  center_length_offset = center ? -(length / 2) : 0;
+  translate([center_width_offset, center_length_offset]) {
+    difference() {
+      square([width, length]);
+      for (y = [0:floor(length / pitch) - 1],
+           x = [0:floor(width / pitch) - 1]) {
+        translate([pitch * (x + 0.5), pitch * (y + 0.5)]) {
+          if (hole_type == "circle") {
+            circle(hole, center = true); }
+          else if (hole_type == "square") {
+            square(hole, center = true); }
+          else {
+            echo(str("don't know the hole type: ", hole_type)); } } } } } }
+
+module deck(width, length, depth, pitch, hole, hole_type, center = false) {
+  linear_extrude(height = depth) {
+    deck_2d(width, length, pitch, hole, hole_type, center); } }
diff --git a/3d-printables/deck-holder-data.scad b/3d-printables/deck-holder-data.scad
new file mode 100644 (file)
index 0000000..2526c9e
--- /dev/null
@@ -0,0 +1,145 @@
+// 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
+
+/*
+  this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
+  http://fritzing.org/projects/hc-sr04-project
+  it can hold the sonar sensor either facing down, or forwards.
+  when facing down, it can detect if it passes over the edge of a table.
+  when facing forwards, it can detect and follow something in front of it.
+ */
+
+$fn = 60;
+
+use <oshw.scad>
+// 3/16 inch in mm deck_depth = 4.7625;
+// 1/4 inch in mm = 6.35
+// subtract a little to be a squeeze fit
+deck_depth = 4.7625 - 0.4;
+// sonar sensor measurements taken with calipers:
+//  10.82 in between, 42.33 outside, 15.82 diameter
+// measured diameter of 15.82 with calipers,
+//  but when printed ends up being too small, so add some
+sonar_diameter = 15.82 + 0.4;
+sonar_radius = sonar_diameter / 2;
+sonar_height = 13.8;
+between_sonar_centers = sonar_diameter + 10.82;
+// the sonar cylinders are placed on the pcb at slightly different positions
+//  from one sensor to the next, so this allows for that variance.
+between_sonar_centers_variance = 2;
+// keep at least this much plastic surrounding the sonar cylinder on all sides
+buffer = 3;
+sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
+sonar_holder_width = buffer + sonar_diameter + buffer;
+// sonar_holder_depth is deck_depth minus a little bit to make arm fit
+//  into deck holder
+sonar_holder_depth = deck_depth - 0.7875;
+
+deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15;
+
+oshw_dy = 120.366;
+oshw_dx = 133.888;
+
+// 3/16 inch in mm deck_depth = 4.7625;
+// 1/4 inch in mm = 6.35
+// subtract a little to be a squeeze fit
+deck_depth = 4.7625 - 0.4;
+// sonar sensor measurements taken with calipers:
+//  10.82 in between, 42.33 outside, 15.82 diameter
+// measured diameter of 15.82 with calipers,
+//  but when printed ends up being too small, so add some
+sonar_diameter = 15.82 + 0.4;
+sonar_radius = sonar_diameter / 2;
+sonar_height = 13.8;
+between_sonar_centers = sonar_diameter + 10.82;
+// the sonar cylinders are placed on the pcb at slightly different positions
+//  from one sensor to the next, so this allows for that variance.
+between_sonar_centers_variance = 2;
+// keep at least this much plastic surrounding the sonar cylinder on all sides
+buffer = 3;
+sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
+sonar_holder_width = buffer + sonar_diameter + buffer;
+// sonar_holder_depth is deck_depth minus a little bit to make arm fit
+//  into deck holder
+sonar_holder_depth = deck_depth - 0.7875;
+
+deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15;
+
+module sonars() {
+  translate([between_sonar_centers / 2, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height); }
+  // for the variance with which the physical sonar cylinders are placed
+  translate([between_sonar_centers / 2 - between_sonar_centers_variance, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height);
+    translate([0, -sonar_radius, 0]) {
+      cube([between_sonar_centers_variance, sonar_diameter, sonar_height]); } }
+  translate([-between_sonar_centers / 2, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height); } }
+
+module sonar_holder() {
+  elbow_length = deck_depth;
+  rounded_corner_radius = buffer;
+  difference() {
+    cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
+    translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]) {
+      sonars(); }
+    translate([sonar_holder_length - rounded_corner_radius,
+               sonar_holder_width - rounded_corner_radius,
+               0]) {
+      corner_rounder(rounded_corner_radius, sonar_holder_depth); } }
+  translate([sonar_holder_length, 0, 0]) {
+    cube([elbow_length, deck_depth, sonar_holder_depth]);
+    translate([elbow_length, 0, 0]) {
+      linear_extrude(height = sonar_holder_depth) {
+        polygon([[                 0, 0],
+                 [sonar_holder_depth, 0],
+                 [sonar_holder_depth, sonar_holder_width / 2],
+                 [                 0,
+                                   sonar_holder_width / 2 + sonar_holder_depth]]); }
+      translate([0, (sonar_holder_width + sonar_holder_depth) / 2, 0]) {
+        cube([sonar_holder_depth / 2,
+              (sonar_holder_width - sonar_holder_depth) / 2 + 0.8,
+              sonar_holder_depth]); }
+      translate([-1.7, sonar_holder_width + 0.8, 0]) {
+        linear_extrude(height = sonar_holder_depth) {
+          polygon([[                           0, 0],
+                   [sonar_holder_depth / 2 + 1.7, 4],
+                   [sonar_holder_depth / 2 + 1.7, 0]]); } } } } }
+
+module deck_holder() {
+  deck_holder_width = sonar_holder_width - deck_depth;
+  deck_holder_height = sonar_holder_depth * 2 + deck_depth;
+  linear_extrude(height = deck_holder_width) {
+    difference() {
+      square([deck_holder_length, deck_holder_height]);
+      translate([sonar_holder_depth - 0.15, sonar_holder_depth - 0.15]) {
+        square(deck_depth + 0.3); }
+      translate([deck_holder_height, sonar_holder_depth - 0.3]) {
+        square([deck_holder_length - (deck_holder_height),
+                deck_depth + 0.6]); } } }
+  translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2])
+  scale([0.1, 1, 0.1])
+  rotate(v = [1, 0, 0], a = 90)
+  rotate(90)
+  linear_extrude(height = 0.5)
+  oshw();
+  translate([deck_holder_length - oshw_dy * 0.05,
+             deck_holder_height + 0.5,
+             deck_holder_width / 2])
+  rotate(v = [1, 0, 0], a = 90)
+  rotate(90)
+  scale([0.1, 0.1, 1])
+  linear_extrude(height = 0.5)
+  oshw(); }
+
+module corner_rounder_2d(radius) {
+  difference() {
+    square(radius);
+    circle(radius); } }
+
+module corner_rounder(radius, height) {
+  linear_extrude(height = height) {
+    corner_rounder_2d(radius); } }
diff --git a/3d-printables/deck-holder.scad b/3d-printables/deck-holder.scad
new file mode 100644 (file)
index 0000000..d993635
--- /dev/null
@@ -0,0 +1,25 @@
+// 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
+
+/*
+  this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
+  http://fritzing.org/projects/hc-sr04-project
+  it can hold the sonar sensor either facing down, or forwards.
+  when facing down, it can detect if it passes over the edge of a table.
+  when facing forwards, it can detect and follow something in front of it.
+ */
+
+$fn = 60;
+
+use <oshw.scad>
+include <deck-holder-data.scad>
+
+for (jj = [0:0]) {
+  for (ii = [0:0]) {
+    translate([ii * (sonar_holder_length + 10),
+               jj * (26 + deck_depth * 3),
+               0]) {
+      deck_holder(); } } }
index 77f64980cd65297cf2d14683530b248e4d77dbdd..e45ce6eeddc43cc2d686d29aa443c481c109d320 100644 (file)
@@ -4,50 +4,11 @@
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
-// all measurements are in mm unless stated otherwise
-
-  // metric version of deck:
-deck_length = 250;
-deck_width = deck_length;
-deck_depth = 5;
-deck_pitch = 10;
-deck_grid_hole = 3;
-deck_hole_type = "square";
-deck_centered = true;
-
-  /*
-    // imperial version of deck
-deck_length = 203.2; // 8 inches
-deck_width = deck_length;
-deck_depth = 25.4 * 3 / 16; // 3 / 16 of an inch
-deck_pitch = 25.4; // 1 inch
-deck_grid_hole = 6.35 / 2; // 1/4 inch diameter, 1/8 inch radius
-deck_hole_type = "circle";
-  */
-
-module deck_2d(width, length, pitch, hole, hole_type, center=false){
-  center_width_offset = center ? -(width / 2): 0;
-  center_length_offset = center ? -(length / 2): 0;
-  translate([center_width_offset, center_length_offset]){
-    difference(){
-      square([width, length]);
-      for (y = [0:floor(length / pitch) - 1],
-           x = [0:floor(width / pitch) - 1]){
-        translate([pitch * (x + 0.5), pitch * (y + 0.5)]){
-          if (hole_type == "circle"){
-            circle(hole, center = true);}
-          else if (hole_type == "square") {
-            square(hole, center = true);}
-          else {
-            echo(str("don't know the hole type: ", hole_type));}}}}}}
-
-module deck(width, length, depth, pitch, hole, hole_type, center=false){
-  linear_extrude (height = depth){
-    deck_2d(width, length, pitch, hole, hole_type, center);}}
+include <deck-data.scad>
 
 deck_2d(deck_width,
         deck_length,
         deck_pitch,
         deck_grid_hole,
         deck_hole_type,
 
 deck_2d(deck_width,
         deck_length,
         deck_pitch,
         deck_grid_hole,
         deck_hole_type,
-        center=deck_centered);
+        center = deck_centered);
diff --git a/3d-printables/makerfarm-i3-v-8in.ini b/3d-printables/makerfarm-i3-v-8in.ini
new file mode 100644 (file)
index 0000000..56ef152
--- /dev/null
@@ -0,0 +1,308 @@
+# generated by Slic3r 1.2.5 on Fri Feb 27 00:58:04 2015
+
+[filament:makerfarmi3v8in-filament-settings]
+bed_temperature = 70
+bridge_fan_speed = 100
+cooling = 1
+disable_fan_first_layers = 1
+extrusion_multiplier = 1
+fan_always_on = 0
+fan_below_layer_time = 60
+filament_diameter = 1.75
+first_layer_bed_temperature = 80
+first_layer_temperature = 235
+max_fan_speed = 100
+min_fan_speed = 35
+min_print_speed = 10
+slowdown_below_layer_time = 30
+temperature = 225
+
+[presets]
+filament = makerfarmi3v8in-filament-settings.ini
+print = makerfarmi3v8in-print-settings.ini
+printer = makerfarmi3v8in-printer-settings.ini
+
+[print:Simple Mode]
+bottom_solid_layers = 3
+brim_width = 0
+complete_objects = 0
+extruder_clearance_height = 20
+extruder_clearance_radius = 20
+fill_density = 40%
+fill_pattern = 3dhoneycomb
+infill_speed = 60
+layer_height = 0.3
+perimeter_speed = 30
+perimeters = 3
+raft_layers = 0
+support_material = 0
+support_material_spacing = 2.5
+top_solid_layers = 3
+travel_speed = 130
+
+[print:makerfarmi3v8in-print-settings]
+avoid_crossing_perimeters = 1
+bottom_solid_layers = 3
+bridge_acceleration = 0
+bridge_flow_ratio = 1
+bridge_speed = 60
+brim_width = 0
+complete_objects = 0
+default_acceleration = 0
+dont_support_bridges = 1
+external_fill_pattern = rectilinear
+external_perimeter_extrusion_width = 0
+external_perimeter_speed = 70%
+external_perimeters_first = 0
+extra_perimeters = 1
+extruder_clearance_height = 20
+extruder_clearance_radius = 20
+extrusion_width = 0
+fill_angle = 45
+fill_density = 20%
+fill_pattern = 3dhoneycomb
+first_layer_acceleration = 0
+first_layer_extrusion_width = 200%
+first_layer_height = 0.35
+first_layer_speed = 30%
+gap_fill_speed = 20
+gcode_comments = 1
+infill_acceleration = 0
+infill_every_layers = 1
+infill_extruder = 1
+infill_extrusion_width = 0
+infill_first = 0
+infill_only_where_needed = 0
+infill_speed = 60
+interface_shells = 0
+layer_height = 0.2
+min_skirt_length = 0
+notes = 
+only_retract_when_crossing_perimeters = 1
+ooze_prevention = 0
+output_filename_format = [input_filename_base].gcode
+overhangs = 1
+perimeter_acceleration = 0
+perimeter_extruder = 1
+perimeter_extrusion_width = 0
+perimeter_speed = 30
+perimeters = 3
+post_process = 
+raft_layers = 0
+resolution = 0
+seam_position = aligned
+skirt_distance = 6
+skirt_height = 1
+skirts = 1
+small_perimeter_speed = 30
+solid_infill_below_area = 70
+solid_infill_every_layers = 0
+solid_infill_extruder = 1
+solid_infill_extrusion_width = 0
+solid_infill_speed = 60
+spiral_vase = 0
+standby_temperature_delta = -5
+support_material = 0
+support_material_angle = 0
+support_material_enforce_layers = 0
+support_material_extruder = 1
+support_material_extrusion_width = 0
+support_material_interface_extruder = 1
+support_material_interface_layers = 3
+support_material_interface_spacing = 0
+support_material_interface_speed = 100%
+support_material_pattern = pillars
+support_material_spacing = 2.5
+support_material_speed = 60
+support_material_threshold = 0
+thin_walls = 1
+threads = 2
+top_infill_extrusion_width = 0
+top_solid_infill_speed = 50
+top_solid_layers = 3
+travel_speed = 130
+xy_size_compensation = 0
+
+[printer:makerfarmi3v8in]
+bed_shape = 0x0,200x0,200x200,0x200
+end_gcode = M104 S0 ; turn off temperature\nG28 X0  ; home X axis\nM84     ; disable motors\n
+extruder_offset = 0x0
+gcode_flavor = reprap
+layer_gcode = 
+nozzle_diameter = 0.5
+octoprint_apikey = 
+octoprint_host = 
+pressure_advance = 0
+retract_before_travel = 2
+retract_layer_change = 1
+retract_length = 1
+retract_length_toolchange = 10
+retract_lift = 0
+retract_restart_extra = 0
+retract_restart_extra_toolchange = 0
+retract_speed = 30
+start_gcode = G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n
+toolchange_gcode = 
+use_firmware_retraction = 0
+use_relative_e_distances = 0
+use_volumetric_e = 0
+vibration_limit = 0
+wipe = 0
+z_offset = 0
+
+[printer:makerfarmi3v8in-printer-settings]
+bed_shape = 0x0,200x0,200x200,0x200
+end_gcode = M104 S0 ; turn off temperature\nG28 X0  ; home X axis\nM84     ; disable motors\n
+extruder_offset = 0x0
+gcode_flavor = reprap
+layer_gcode = 
+nozzle_diameter = 0.5
+octoprint_apikey = 
+octoprint_host = 
+pressure_advance = 0
+retract_before_travel = 2
+retract_layer_change = 1
+retract_length = 1
+retract_length_toolchange = 10
+retract_lift = 0
+retract_restart_extra = 0
+retract_restart_extra_toolchange = 0
+retract_speed = 30
+start_gcode = G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n
+toolchange_gcode = 
+use_firmware_retraction = 0
+use_relative_e_distances = 0
+use_volumetric_e = 0
+vibration_limit = 0
+wipe = 0
+z_offset = 0
+
+[settings]
+autocenter = 1
+mode = expert
+
+[simple]
+avoid_crossing_perimeters = 1
+bed_shape = 0x0,200x0,200x200,0x200
+bed_temperature = 70
+bottom_solid_layers = 3
+bridge_acceleration = 0
+bridge_fan_speed = 100
+bridge_flow_ratio = 1
+bridge_speed = 60
+brim_width = 0
+complete_objects = 0
+cooling = 1
+default_acceleration = 0
+disable_fan_first_layers = 1
+dont_support_bridges = 1
+duplicate_distance = 6
+end_gcode = M104 S0 ; turn off temperature\nG28 X0  ; home X axis\nM84     ; disable motors\n
+external_fill_pattern = rectilinear
+external_perimeter_extrusion_width = 0
+external_perimeter_speed = 70%
+external_perimeters_first = 0
+extra_perimeters = 1
+extruder_clearance_height = 20
+extruder_clearance_radius = 20
+extruder_offset = 0x0
+extrusion_axis = E
+extrusion_multiplier = 1
+extrusion_width = 0
+fan_always_on = 0
+fan_below_layer_time = 60
+filament_diameter = 1.75
+fill_angle = 45
+fill_density = 40%
+fill_pattern = 3dhoneycomb
+first_layer_acceleration = 0
+first_layer_bed_temperature = 75
+first_layer_extrusion_width = 200%
+first_layer_height = 0.4
+first_layer_speed = 30%
+first_layer_temperature = 230
+gap_fill_speed = 20
+gcode_arcs = 0
+gcode_comments = 0
+gcode_flavor = reprap
+infill_acceleration = 0
+infill_every_layers = 10
+infill_extruder = 1
+infill_extrusion_width = 0
+infill_first = 0
+infill_only_where_needed = 0
+infill_speed = 60
+interface_shells = 0
+layer_gcode = 
+layer_height = 0.3
+max_fan_speed = 100
+min_fan_speed = 35
+min_print_speed = 10
+min_skirt_length = 0
+notes = 
+nozzle_diameter = 0.4
+octoprint_apikey = 
+octoprint_host = 
+only_retract_when_crossing_perimeters = 1
+ooze_prevention = 0
+output_filename_format = [input_filename_base].gcode
+overhangs = 1
+perimeter_acceleration = 0
+perimeter_extruder = 1
+perimeter_extrusion_width = 0
+perimeter_speed = 30
+perimeters = 3
+post_process = 
+pressure_advance = 0
+raft_layers = 0
+resolution = 0
+retract_before_travel = 2
+retract_layer_change = 1
+retract_length = 1
+retract_length_toolchange = 10
+retract_lift = 0
+retract_restart_extra = 0
+retract_restart_extra_toolchange = 0
+retract_speed = 30
+seam_position = aligned
+skirt_distance = 6
+skirt_height = 1
+skirts = 1
+slowdown_below_layer_time = 30
+small_perimeter_speed = 30
+solid_infill_below_area = 70
+solid_infill_every_layers = 0
+solid_infill_extruder = 1
+solid_infill_extrusion_width = 0
+solid_infill_speed = 60
+spiral_vase = 0
+standby_temperature_delta = -5
+start_gcode = G28 ; home all axes\nG1 Z5 F5000 ; lift nozzle\n
+support_material = 0
+support_material_angle = 0
+support_material_enforce_layers = 0
+support_material_extruder = 1
+support_material_extrusion_width = 0
+support_material_interface_extruder = 1
+support_material_interface_layers = 3
+support_material_interface_spacing = 0
+support_material_interface_speed = 100%
+support_material_pattern = pillars
+support_material_spacing = 2.5
+support_material_speed = 60
+support_material_threshold = 0
+temperature = 225
+thin_walls = 1
+threads = 2
+toolchange_gcode = 
+top_infill_extrusion_width = 0
+top_solid_infill_speed = 50
+top_solid_layers = 3
+travel_speed = 130
+use_firmware_retraction = 0
+use_relative_e_distances = 0
+use_volumetric_e = 0
+vibration_limit = 0
+wipe = 0
+xy_size_compensation = 0
+z_offset = 0
diff --git a/3d-printables/motor-mount-data.scad b/3d-printables/motor-mount-data.scad
new file mode 100644 (file)
index 0000000..ccf88f5
--- /dev/null
@@ -0,0 +1,45 @@
+// from schematic http://goo.gl/96RKol
+collar_radius = 9.2 / 2 + 0.25;
+nubbin_radius = 4.48 / 2;
+screw_radius = 2.9 / 2 + 0.35; // a little bigger so screws fit through
+
+motor_height = 22.23;
+
+// http://freespace.virgin.net/matt.waite/resource/handy/screwsize.htm
+_6_radius = 3.5 / 2 + 0.25;
+
+// measurements we made up:
+mount_total_x = 38;
+mount_total_y = mount_total_x;
+mount_total_z = 3.175; // 3/16 in mm
+
+module motor_holes() {
+  collar_x_offset = 10.8;
+  nubbin_x_offset = 22.23;
+  // actual motor screw holes are 0.2 further than spec says
+  screw_x_offset = 30.81 + 0.2;
+  screw_y_offset = 17.44 / 2;
+
+  translate([collar_x_offset, 0, 0]) {
+    cylinder(r = collar_radius, h = mount_total_z + 0.1); }
+  translate([nubbin_x_offset, 0, 0]) {
+    cylinder(r = nubbin_radius, h = mount_total_z + 0.1); }
+  translate([screw_x_offset, 0, 0]) {
+    translate([0, screw_y_offset, 0]) {
+      cylinder(r = screw_radius, h = mount_total_z + 0.1); }
+    translate([0, -screw_y_offset, 0]) {
+      cylinder(r = screw_radius, h = mount_total_z + 0.1); } } }
+
+module bracket_holes() {
+  translate([6.2, 0, 0])
+  cylinder(r = _6_radius, h = mount_total_z + 0.1);
+  translate([mount_total_x - 6.2, 0, 0])
+  cylinder(r = _6_radius, h = mount_total_z + 0.1); }
+
+module motor_mount() {
+  difference() {
+    cube([mount_total_x, mount_total_y, mount_total_z]);
+    translate([0, 6.2, -0.05]) {
+      bracket_holes(); }
+    translate([1, mount_total_y - motor_height / 2 - 3, -0.05]) {
+      motor_holes(); } } }
diff --git a/3d-printables/motor-mount-dimensions.scad b/3d-printables/motor-mount-dimensions.scad
deleted file mode 100644 (file)
index 8cb78f5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-// from schematic http://goo.gl/96RKol
-collar_radius = 9.2 / 2 + 0.25;
-nubbin_radius = 4.48 / 2;
-screw_radius = 2.9 / 2 + 0.35; // a little bigger so screws fit through
-
-motor_height = 22.23;
-
-// http://freespace.virgin.net/matt.waite/resource/handy/screwsize.htm
-_6_radius = 3.5 / 2 + 0.25;
-
-// measurements we made up:
-mount_total_x = 38;
-mount_total_y = mount_total_x;
-mount_total_z = 3.175; // 3/16 in mm
diff --git a/3d-printables/motor-mount-drill-jig.scad b/3d-printables/motor-mount-drill-jig.scad
deleted file mode 100644 (file)
index 9e9673f..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-// 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
-
-// use this drill jig for putting holes in a motor mount for screws
-//  and motor shaft.  the four tabs at the bottom are for clamping
-//  the jig down.
-
-mm_per_inch = 25.4;
-
-material_width = (1 / 8) * mm_per_inch;
-
-board_length = 1.75 * mm_per_inch;
-board_width = 1.5 * mm_per_inch;
-board_depth = (3 / 16) * mm_per_inch;
-tab_length = 3 * mm_per_inch;
-tab_width = (1 / 4) * mm_per_inch;
-
-union(){
-  rotate(a = 90, v = [1, 0, 0]) {
-    cube([board_length + material_width,
-          1.75 * mm_per_inch + material_width,
-          material_width]);}
-
-  translate(v = [0, -material_width, 0]){
-    rotate(a = -90, v = [0, 1, 0]) {
-      cube( [1.75 * mm_per_inch + material_width,
-             1.5 * mm_per_inch + 2 * material_width,
-             material_width]);}}
-
-  translate(v = [(1.75 * mm_per_inch + material_width) / 2 + tab_width,
-                 -tab_length,
-                 0]){
-    rotate(a = 90, v = [0 ,0 ,1 ]){
-      cube([3 * mm_per_inch, 0.5 * mm_per_inch , material_width]);}}
-
-  translate(v = [-tab_length,
-                 (1.5 * mm_per_inch + material_width) / 2 - tab_width,
-                 0]){
-    cube([3 * mm_per_inch, 0.5 * mm_per_inch , material_width]);}
-
-  translate(v = [(1.75 * mm_per_inch + material_width) / 2 + tab_width,
-                 (1.5 * mm_per_inch),
-                 0]){
-    rotate(a = 90, v = [0, 0, 1]){
-      cube([3 * mm_per_inch, 0.5 * mm_per_inch , material_width]);}}
-
-  translate(v = [(1.75 * mm_per_inch),
-                 (1.5 * mm_per_inch + material_width) / 2 - tab_width,
-                 0]){
-    cube([3 * mm_per_inch, 0.5 * mm_per_inch , material_width]);}}
-
-_4_40 = 0.1285 * mm_per_inch / 2; // size of hole for 4x40
-_6_32 = 0.1495 * mm_per_inch / 2; // size of hole for 6x32
-
-module collar_hole(){
-  cylinder(h = board_depth, r = 2 * _6_32, $fn = 20);}
-
-module nubbin_hole(){
-  cylinder(h = board_depth, r = _6_32, $fn = 20);}
-
-module mounting_screw_hole(){
-  cylinder(h = board_depth, r = _6_32, $fn = 20);}
-
-module bracket_screw_hole(){
-  cylinder(h = board_depth, r = _6_32, $fn = 20);}
-
-module wheel_motor_holes(scale){
-  translate([51 - 26.78, 38 - 10.8, 0] * scale) {
-    collar_hole();}
-  translate([51 - 26.78, 38 - 22.23, 0] * scale){
-    nubbin_hole();}
-  translate([51 - 18.05 - 17.45, 38 - 30.81,  0] * scale){
-    mounting_screw_hole();}
-  translate([51 - 18.05, 38 - 30.81, 0] * scale){
-    mounting_screw_hole();}
-  translate([7.5, 8.5, 0] * scale){
-    bracket_screw_hole();}
-  translate([7.5, 21 + 8.5,   0] * scale){
-    bracket_screw_hole();}}
-
-module wheel_mount(scale){
-  difference(){
-    cube(scale * [board_length + material_width,
-                  board_width + material_width,
-                  material_width]);
-    wheel_motor_holes(scale);}}
-
-wheel_mount(1);
-
-translate(v = [0, 0, board_length]) jig_lid();
-
-module jig_lid() {
-  union() {
-    wheel_mount(1);
-    translate(v = [0, -2.1 * material_width, material_width]){
-      cube([board_length + material_width,
-            3.1 * material_width,
-            material_width]);}
-    translate(v = [0, -2.1 * material_width, 0]){
-      cube([board_length + material_width, material_width, material_width]);}
-    translate(v = [-2.1 * material_width, 0, material_width]){
-      cube([3.1 * material_width,
-            board_width + material_width,
-            material_width]);}
-    translate(v = [-2.1 * material_width, 0, 0]){
-      cube([material_width, board_width+material_width, material_width]);}}}
index b15e5a7b7f9483a187f1cf65672b0936c68c68b6..f70fb997c52c04e6f5876869ddeb99268da23631 100644 (file)
@@ -6,37 +6,6 @@
 
 $fn = 60;
 
 
 $fn = 60;
 
-include <motor-mount-dimensions.scad>
-
-module motor_holes(){
-  collar_x_offset = 10.8;
-  nubbin_x_offset = 22.23;
-  // actual motor screw holes are 0.2 further than spec says
-  screw_x_offset = 30.81 + 0.2;
-  screw_y_offset = 17.44 / 2;
-
-  translate([collar_x_offset, 0, 0]){
-    cylinder(r = collar_radius, h = mount_total_z + 0.1);}
-  translate([nubbin_x_offset, 0, 0]){
-    cylinder(r = nubbin_radius, h = mount_total_z + 0.1);}
-  translate([screw_x_offset, 0, 0]){
-    translate([0, screw_y_offset, 0]){
-      cylinder(r = screw_radius, h = mount_total_z + 0.1);}
-    translate([0, -screw_y_offset, 0]){
-      cylinder(r = screw_radius, h = mount_total_z + 0.1);}}}
-
-module bracket_holes(){
-  translate([6.2, 0, 0])
-    cylinder(r = _6_radius, h = mount_total_z + 0.1);
-  translate([mount_total_x - 6.2, 0, 0])
-    cylinder(r = _6_radius, h = mount_total_z + 0.1);}
-
-module motor_mount(){
-  difference(){
-    cube([mount_total_x, mount_total_y, mount_total_z]);
-    translate([0, 6.2, -0.05]){
-      bracket_holes();}
-    translate([1, mount_total_y - motor_height / 2 - 3, -0.05]){
-      motor_holes();}}}
+include <motor-mount-data.scad>
 
 motor_mount();
 
 motor_mount();
diff --git a/3d-printables/nut-data.scad b/3d-printables/nut-data.scad
new file mode 100644 (file)
index 0000000..c18f91e
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+Copyright (C) 2015 Daniel Watson
+See the end of the file for license conditions.
+*/
+
+module nut_2d(size) {
+  side_length = size * sin(30) / sin(120);
+  for (ii = [-1:1]) {
+    rotate(a = 120 * ii, v = [0, 0, 1]) {
+      square([side_length, size], center = true); } } }
+
+module nut(size, height) {
+  linear_extrude(height = height) {
+    nut_2d(size); } }
+
+/*
+This file is part of challenge-bot.
+
+Printables 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 Printables.  If not, see <http://www.gnu.org/licenses/>.
+*/
diff --git a/3d-printables/nut.scad b/3d-printables/nut.scad
deleted file mode 100644 (file)
index 16d0b8e..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
-Copyright (C) 2014 Daniel Watson
-See the end of the file for license conditions.
-*/
-
-module nut_2d(size) {
-  side_length = size * sin(30) / sin(120);
-  for(ii = [-1:1]) {
-    rotate(a = 120 * ii, v = [0, 0, 1]) {
-      square([side_length, size], center = true); } } }
-
-module nut(size, height) {
-  linear_extrude(height = height) {
-    nut_2d(size); } }
-
-/*
-This file is part of challenge-bot.
-
-Printables 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 Printables.  If not, see <http://www.gnu.org/licenses/>.
-*/
diff --git a/3d-printables/oshw-data.scad b/3d-printables/oshw-data.scad
new file mode 100644 (file)
index 0000000..a42361e
--- /dev/null
@@ -0,0 +1,7 @@
+oshw_dx = 133.888;
+oshw_dy = 120.366;
+module oshw() {
+  x_center_offset = 66.9175;
+  y_center_offset = 53.2655;
+  translate([-x_center_offset, -y_center_offset]) {
+    import("oshw.dxf"); } }
index e351a7b7d90574d1720d733f9893509f147dd8c5..57d9ab0d3312f68c28486a551fb0ddfe2a22be9d 100644 (file)
@@ -1,9 +1,4 @@
-oshw_dx = 133.888;
-oshw_dy = 120.366;
-module oshw(){
-  x_center_offset = 66.9175;
-  y_center_offset = 53.2655;
-  translate([-x_center_offset, -y_center_offset]){
-    import("oshw.dxf");}}
+
+include <oshw-data.scad>
 
 oshw();
 
 oshw();
diff --git a/3d-printables/qr.scad b/3d-printables/qr.scad
deleted file mode 100644 (file)
index 4e38717..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-matrix_rows = 21;
-matrix_cols = 21;
-module qr(){
-  block_size = 2;
-  max_x_index = matrix_cols - 1;
-  max_y_index = matrix_rows - 1;
-  fudge = block_size / 1000;
-
-  matrix =
-    [[1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1],
-     [1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1],
-     [1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1],
-     [1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 1],
-     [1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1],
-     [1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 1],
-     [1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1],
-     [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0],
-     [1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1],
-     [1, 0, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 1, 0, 1],
-     [0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1],
-     [1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0],
-     [0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 1, 0, 1, 0],
-     [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1],
-     [1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 1],
-     [1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 1],
-     [1, 0, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 0],
-     [1, 0, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0],
-     [1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1],
-     [1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0],
-     [1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1]];
-
-  scale(25/21){
-    for(y = [0 : max_y_index]){
-      for(x = [0 : max_x_index]){
-        if(matrix[y][x] == 1){
-          translate([(x - max_x_index / 2.0) * block_size,
-                     (y - max_y_index / 2.0) * block_size]){
-            square(block_size + fudge, center = true);}}}}}}
-
-module qr_black_flat(){
-  qr();}
-module qr_black(){
-  color("black")
-    linear_extrude(height = 2){
-      qr_black_flat();}}
-
-module qr_white_flat(){
-  difference(){
-    square(54, center = true);
-    qr();}}
-module qr_white(){
-  color("white")
-    linear_extrude(height = 2){
-      qr_white_flat();}}
-
-qr();
diff --git a/3d-printables/schematic-3d-printable.scad b/3d-printables/schematic-3d-printable.scad
deleted file mode 100644 (file)
index b78304a..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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
-
-// using
-// https://github.com/josefprusa/Prusa3/blob/master/box_frame/x-carriage.scad
-// as an example of how to code in scad
-
-scale=10;
-
-deck_width = 8;
-deck_length = 8;
-deck_depth = 3/16;
-deck_dimensions = [deck_width, deck_length, deck_depth];
-
-module deck(scale){
-  cube(deck_dimensions * scale, center = true);}
-
-module collar_hole(scale){
-  cylinder(h = 5/16 * scale, r = 0.362/2 * scale);}
-
-module nubbin_hole(scale){
-  cylinder(h = 5/16 * scale, r = 0.145/2 * scale);}
-
-module mounting_screw_hole(scale){
-  cylinder(h = 5/16 * scale, r = 0.114/2 * scale);}
-
-module wheel_mount_reinforcement(scale){
-  diagonal = sqrt(deck_depth * deck_depth + deck_depth * deck_depth);
-  difference(){
-    cube([deck_depth * 2, deck_depth * 2, deck_depth * 2] * scale);
-    translate([-(diagonal - deck_depth) / 2, 0, 0] * scale)
-      rotate([45, 0, 0])
-        translate([0, -(diagonal * 1.1 - deck_depth) / 2, 0])
-          cube([diagonal * 2, diagonal * 2 * 1.1, deck_depth * 2] * scale);}}
-
-module wheel_motor_holes(scale){
-  translate([0.5, 0.938, -1/16] * scale) {
-    collar_hole(scale);}
-  translate([0.5 + 0.875 - 0.425, 0.938, -1/16] * scale){
-    nubbin_hole(scale);}
-  translate([0.5 + 1.213 - 0.425, 0.938 - 0.687/2, -1/16] * scale){
-    mounting_screw_hole(scale);}
-  translate([0.5 + 1.213 - 0.425, 0.938 + 0.687/2, -1/16] * scale){
-    mounting_screw_hole(scale);}}
-
-module wheel_mount(scale){
-  width = 1.5;
-  length = 2;
-  depth = deck_depth;
-
-  difference(){
-    cube([width, length, depth] * scale);
-    wheel_motor_holes(scale);}
-  translate([2 * depth, 2 * depth, depth] * scale)
-    rotate([0, 0, 180])
-      wheel_mount_reinforcement(scale);
-  translate([width, 2 * depth, depth] * scale)
-    rotate([0, 0, 180])
-      wheel_mount_reinforcement(scale);}
-
-module robot(scale){
-  translate([0, 0, (deck_depth)/2 * scale]){
-    color("blue") deck(scale);
-    translate([1.5, 4, (deck_depth)/2] * scale)
-      rotate([90, 0, 0])
-        wheel_mount(scale);
-    mirror([0, 1, 0])
-      translate([1.5, 4, (deck_depth)/2] * scale)
-        rotate([90, 0, 0])
-          wheel_mount(scale);}}
-
-robot(scale);
diff --git a/3d-printables/schematic.scad b/3d-printables/schematic.scad
deleted file mode 100644 (file)
index 1d7e15b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-// challenge-bot phase-2
-// GNU AGPLv3 (or later at your option)
-// project available at these locations:
-// https://gitorious.org/ozzloy/challenge-bot
-// https://github.com/waynegramlich/challenge-bot
-
-// using
-// https://github.com/josefprusa/Prusa3/blob/master/box_frame/x-carriage.scad
-// as an example of how to code in scad
-
-deck_dimensions = [8, 8, 3/16];
-
-module deck(){
-  cube(deck_dimensions);}
-
-module wheel_mount(){
-  difference(){
-    cube([1.5, 2, 3/16]);
-    // motor shaft and collar hole
-    translate([0.5, 0.938, -1/16]) {
-      cylinder(h = 5/16, r = 0.362/2, $fn = 100);}
-    // nubbin hole
-    translate([0.5 + 0.875 - 0.425, 0.938, -1/16]){
-      cylinder(h = 5/16, r = 0.145/2, $fn = 100);}
-    // mounting screw hole
-    translate([0.5 + 1.213 - 0.425, 0.938 - 0.687/2, -1/16]){
-      cylinder(h = 5/16, r = 0.114/2, $fn = 100);}
-    translate([0.5 + 1.213 - 0.425, 0.938 + 0.687/2, -1/16]){
-      cylinder(h = 5/16, r = 0.114/2, $fn = 100);}}}
-
-module wheel(){
-  cylinder(r = 2.75/2, h = 3/16, $fn = 100);}
-
-color("blue") deck();
-rotate([90, 0, 0]) translate([1.5, -2, 0]) wheel_mount();
-rotate([90, 0, 0]) translate([1.5, -2, -(8+3/16)]) wheel_mount();
-color("red") rotate([90, 0, 0]) translate([2, -(.938), 3/16]) wheel();
-color("red") rotate([90, 0, 0]) translate([2, -(.938), -(8 + 3/8)]) wheel();
diff --git a/3d-printables/sonar-table-top-holder-data.scad b/3d-printables/sonar-table-top-holder-data.scad
new file mode 100644 (file)
index 0000000..e349b7b
--- /dev/null
@@ -0,0 +1,129 @@
+// 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
+
+/*
+  this holds an hc-sr04 sonar sensor to a 3/16 inch deck.
+  http://fritzing.org/projects/hc-sr04-project
+  it can hold the sonar sensor either facing down, or forwards.
+  when facing down, it can detect if it passes over the edge of a table.
+  when facing forwards, it can detect and follow something in front of it.
+ */
+
+$fn = 60;
+
+include <oshw-data.scad>
+
+// 3/16 inch in mm deck_depth = 4.7625;
+// 1/4 inch in mm = 6.35
+// subtract a little to be a squeeze fit
+deck_depth = 4.7625 - 0.4;
+// sonar sensor measurements taken with calipers:
+//  10.82 in between, 42.33 outside, 15.82 diameter
+// measured diameter of 15.82 with calipers,
+//  but when printed ends up being too small, so add some
+sonar_diameter = 15.82 + 0.4;
+sonar_radius = sonar_diameter / 2;
+sonar_height = 13.8;
+between_sonar_centers = sonar_diameter + 10.82;
+// the sonar cylinders are placed on the pcb at slightly different positions
+//  from one sensor to the next, so this allows for that variance.
+between_sonar_centers_variance = 2;
+// keep at least this much plastic surrounding the sonar cylinder on all sides
+buffer = 3;
+sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
+sonar_holder_width = buffer + sonar_diameter + buffer;
+// sonar_holder_depth is deck_depth minus a little bit to make arm fit
+//  into deck holder
+sonar_holder_depth = deck_depth - 0.7875;
+
+deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15;
+module sonar_holder_2d() {
+  difference() {
+    square([sonar_holder_length, sonar_holder_width]); } }
+
+module sonars() {
+  translate([between_sonar_centers / 2, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height); }
+  // for the variance with which the physical sonar cylinders are placed
+  translate([between_sonar_centers / 2 - between_sonar_centers_variance, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height);
+    translate([0, -sonar_radius, 0]) {
+      cube([between_sonar_centers_variance, sonar_diameter, sonar_height]); } }
+  translate([-between_sonar_centers / 2, 0, 0]) {
+    cylinder(r = sonar_radius, h = sonar_height); } }
+
+module sonar_holder() {
+  elbow_length = deck_depth - 0.5;
+  rounded_corner_radius = buffer;
+  difference() {
+    cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
+    translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]) {
+      sonars(); }
+    translate([sonar_holder_length,
+               sonar_holder_width,
+               0]) {
+      corner_rounder(rounded_corner_radius,
+                     sonar_holder_depth,
+                     "bottom-right"); } }
+  translate([sonar_holder_length, 0, 0]) {
+    cube([elbow_length, deck_depth, sonar_holder_depth]);
+    translate([elbow_length, 0, 0]) {
+      linear_extrude(height = sonar_holder_depth) {
+        polygon([[                 0, 0],
+                 [sonar_holder_depth, 0],
+                 [sonar_holder_depth, sonar_holder_width / 2],
+                 [                 0,
+                                   sonar_holder_width / 2 + sonar_holder_depth]]); }
+      translate([0, (sonar_holder_width + sonar_holder_depth) / 2, 0]) {
+        cube([sonar_holder_depth / 2,
+              (sonar_holder_width - sonar_holder_depth) / 2 + 0.8,
+              sonar_holder_depth]); }
+      translate([-1.7, sonar_holder_width + 0.8, 0]) {
+        linear_extrude(height = sonar_holder_depth) {
+          polygon([[                           0, 0],
+                   [sonar_holder_depth / 2 + 1.7, 4],
+                   [sonar_holder_depth / 2 + 1.7, 0]]); } } } } }
+
+module deck_holder() {
+  deck_holder_width = sonar_holder_width - deck_depth;
+  deck_holder_height = sonar_holder_depth * 2 + deck_depth;
+  linear_extrude(height = deck_holder_width) {
+    difference() {
+      square([deck_holder_length, deck_holder_height]);
+      translate([sonar_holder_depth, sonar_holder_depth]) {
+        square(deck_depth); }
+      translate([deck_holder_height, sonar_holder_depth]) {
+        square([deck_holder_length - (deck_holder_height), deck_depth]); } } }
+  translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2])
+  scale([0.1, 1, 0.1])
+  rotate(v = [1, 0, 0], a = 90)
+  rotate(90)
+  linear_extrude(height = 0.5)
+  oshw();
+  translate([deck_holder_length - oshw_dy * 0.05,
+             deck_holder_height + 0.5,
+             deck_holder_width / 2])
+  rotate(v = [1, 0, 0], a = 90)
+  rotate(90)
+  scale([0.1, 0.1, 1])
+  linear_extrude(height = 0.5)
+  oshw(); }
+
+module corner_rounder_2d(radius, corner_name = "top-left") {
+  rotate_for_corner = (corner_name == "top-left") ? 0 :
+                      ((corner_name == "top-right") ? -90 :
+                       ((corner_name == "bottom-left") ? 90 :
+                        ((corner_name == "bottom-right") ? 180 :
+                         1 / 0)));
+  rotate(rotate_for_corner) {
+    difference() {
+      square(radius);
+      translate([radius, radius]) {
+        circle(radius); } } } }
+
+module corner_rounder(radius, height, corner_name = "top-left") {
+  linear_extrude(height = height) {
+    corner_rounder_2d(radius, corner_name); } }
diff --git a/3d-printables/sonar-table-top-holder-dimensions.scad b/3d-printables/sonar-table-top-holder-dimensions.scad
deleted file mode 100644 (file)
index 171721e..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-// 3/16 inch in mm deck_depth = 4.7625;
-// 1/4 inch in mm = 6.35
-// subtract a little to be a squeeze fit
-deck_depth = 4.7625 - 0.4;
-// sonar sensor measurements taken with calipers:
-//  10.82 in between, 42.33 outside, 15.82 diameter
-// measured diameter of 15.82 with calipers,
-//  but when printed ends up being too small, so add some
-sonar_diameter = 15.82 + 0.4;
-sonar_radius = sonar_diameter / 2;
-sonar_height = 13.8;
-between_sonar_centers = sonar_diameter + 10.82;
-// the sonar cylinders are placed on the pcb at slightly different positions
-//  from one sensor to the next, so this allows for that variance.
-between_sonar_centers_variance = 2;
-// keep at least this much plastic surrounding the sonar cylinder on all sides
-buffer = 3;
-sonar_holder_length = buffer + between_sonar_centers + sonar_diameter + buffer;
-sonar_holder_width = buffer + sonar_diameter + buffer;
-// sonar_holder_depth is deck_depth minus a little bit to make arm fit
-//  into deck holder
-sonar_holder_depth = deck_depth - 0.7875;
-
-deck_holder_length = sonar_holder_depth * 2 + deck_depth + 15;
index 23279e40736dbab68368ba2076d4f6a0c7e70093..bc7a96ba0baa8bd752657d7c93053c58f78890db 100644 (file)
 
 $fn = 60;
 
 
 $fn = 60;
 
-include <sonar-table-top-holder-dimensions.scad>
-use <oshw.scad>
-oshw_dy = 120.366;
-oshw_dx = 133.888;
-
-module sonar_holder_2d() {
-  difference() {
-    square([sonar_holder_length, sonar_holder_width]); } }
-
-module sonars(){
-  translate([between_sonar_centers / 2, 0, 0]){
-    cylinder(r = sonar_radius, h = sonar_height);}
-  // for the variance with which the physical sonar cylinders are placed
-  translate([between_sonar_centers / 2 - between_sonar_centers_variance, 0, 0]){
-    cylinder(r = sonar_radius, h = sonar_height);
-    translate([0, -sonar_radius, 0]){
-      cube([between_sonar_centers_variance, sonar_diameter, sonar_height]);}}
-  translate([-between_sonar_centers / 2, 0, 0]){
-    cylinder(r = sonar_radius, h = sonar_height);}}
-
-module sonar_holder(){
-  elbow_length = deck_depth - 0.5;
-  rounded_corner_radius = buffer;
-  difference(){
-    cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
-    translate([sonar_holder_length / 2, sonar_holder_width / 2, -0.05]){
-      sonars();}
-    translate([sonar_holder_length,
-               sonar_holder_width,
-               0]){
-      corner_rounder(rounded_corner_radius,
-                     sonar_holder_depth,
-                     "bottom-right");}}
-  translate([sonar_holder_length, 0, 0]){
-    cube([elbow_length, deck_depth, sonar_holder_depth]);
-    translate([elbow_length, 0, 0]){
-      linear_extrude(height = sonar_holder_depth){
-        polygon([[                 0, 0],
-                 [sonar_holder_depth, 0],
-                 [sonar_holder_depth, sonar_holder_width / 2],
-                 [                 0,
-                  sonar_holder_width / 2 + sonar_holder_depth]]);}
-      translate([0, (sonar_holder_width + sonar_holder_depth) / 2, 0]){
-        cube([sonar_holder_depth / 2,
-              (sonar_holder_width - sonar_holder_depth) / 2 + 0.8,
-              sonar_holder_depth]);}
-      translate([-1.7, sonar_holder_width + 0.8, 0]){
-        linear_extrude(height = sonar_holder_depth){
-          polygon([[                           0, 0],
-                   [sonar_holder_depth / 2 + 1.7, 4],
-                   [sonar_holder_depth / 2 + 1.7, 0]]);}}}}}
-
-module deck_holder(){
-  deck_holder_width = sonar_holder_width - deck_depth;
-  deck_holder_height = sonar_holder_depth * 2 + deck_depth;
-  linear_extrude(height = deck_holder_width){
-    difference(){
-      square([deck_holder_length, deck_holder_height]);
-      translate([sonar_holder_depth, sonar_holder_depth]){
-        square(deck_depth);}
-      translate([deck_holder_height, sonar_holder_depth]){
-        square([deck_holder_length - (deck_holder_height), deck_depth]);}}}
-  translate([deck_holder_length - oshw_dy * 0.05, 0, deck_holder_width / 2])
-    scale([0.1, 1, 0.1])
-      rotate(v = [1, 0, 0], a = 90)
-        rotate(90)
-          linear_extrude(height = 0.5)
-            oshw();
-  translate([deck_holder_length - oshw_dy * 0.05,
-             deck_holder_height + 0.5,
-             deck_holder_width / 2])
-    rotate(v = [1, 0, 0], a = 90)
-      rotate(90)
-        scale([0.1, 0.1, 1])
-          linear_extrude(height = 0.5)
-            oshw();}
-
-module corner_rounder_2d(radius, corner_name="top-left"){
-  rotate_for_corner = (corner_name == "top-left") ? 0 :
-    ((corner_name == "top-right") ? -90 :
-     ((corner_name == "bottom-left") ? 90 :
-      ((corner_name == "bottom-right") ? 180 :
-       1 / 0)));
-  rotate(rotate_for_corner){
-    difference (){
-      square(radius);
-      translate([radius, radius]){
-        circle(radius);}}}}
-
-module corner_rounder(radius, height, corner_name="top-left"){
-  linear_extrude(height = height){
-    corner_rounder_2d(radius, corner_name);}}
+include <sonar-table-top-holder-data.scad>
 
 sonar_holder();
 
 sonar_holder();
diff --git a/3d-printables/wheel-black.scad b/3d-printables/wheel-black.scad
deleted file mode 100644 (file)
index f875378..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-// 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
-
-use <wheel.scad>
-
-qr_size = 54;
-qr_height = 2;
-
-wall_width = 3;
-
-wheel_width = 6;
-wheel_radius = sqrt(2 * pow(qr_size / 2, 2)) + wall_width / 2;
-
-motor_shaft_radius = 3.7;
-motor_shaft_flat_width = 4.8;
-
-translate([-30.4, -1.6, 0]){
-  rim(wheel_radius + 5, 5, 0.4);
-  rim(wheel_radius + 3, 0.4, qr_height + 1);
-
-  wheel_black(wheel_radius,
-              wheel_width,
-              motor_shaft_radius,
-              motor_shaft_flat_width,
-              wall_width);}
diff --git a/3d-printables/wheel-data.scad b/3d-printables/wheel-data.scad
new file mode 100644 (file)
index 0000000..940228a
--- /dev/null
@@ -0,0 +1,120 @@
+// 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
+
+// use $fn = 20 while developing, 100 when about to print
+//  20 will make previews fast
+//  100 will make printing smooth
+$fn = 100;
+
+qr_size = 45;
+qr_height = 2;
+
+wall_width = 3;
+
+wheel_width = 9;
+wheel_radius = sqrt(2 * pow(qr_size / 2, 2)) + wall_width / 2;
+
+motor_shaft_radius = 3.7;
+motor_shaft_flat_width = 4.8;
+
+tread_radius = 4 / 2;
+
+module mounting_screw_flat() {
+  circle(0.9); }
+
+module motor_shaft_flat(radius, flat_width) {
+  intersection() {
+    circle(radius);
+    square([flat_width, radius * 2], center = true); } }
+
+module motor_shaft(radius,
+                   flat_width,
+                   shaft_length) {
+  linear_extrude(height = shaft_length) {
+    motor_shaft_flat(radius, flat_width); } }
+
+module rim(radius, wall_width, wheel_width) {
+  linear_extrude(height = wheel_width) {
+    difference() {
+      circle(radius);
+      circle(radius - wall_width); } } }
+
+module motor_shaft_holder_flat(radius, flat_width, wall_width) {
+  difference() {
+    motor_shaft_flat(radius + wall_width,
+                     flat_width + wall_width);
+    motor_shaft_flat(radius, flat_width); } }
+
+module motor_shaft_holder(radius, flat_width, wall_width, height) {
+  linear_extrude(height = height) {
+    motor_shaft_holder_flat(radius, flat_width, wall_width); } }
+
+module tread(wheel_radius, tread_radius) {
+  rotate_extrude(convexity = 10) {
+    translate([wheel_radius, 0]) {
+      circle(tread_radius); } } }
+
+module wheel_black(radius,
+                   width,
+                   shaft_radius,
+                   shaft_flat_width,
+                   wall_width,
+                   tread_radius) {
+  color("black") {
+    difference() {
+      rim(radius, wall_width, width);
+      translate([0, 0, width / 2]) {
+        tread(radius, tread_radius); } }
+    linear_extrude(height = qr_height) {
+      difference() {
+        qr_black_flat();
+        mounting_screw_flat(); } }
+    translate([0, 0, qr_height]) {
+      motor_shaft_holder(shaft_radius,
+                         shaft_flat_width,
+                         wall_width,
+                         width - qr_height); } } }
+
+module wheel_white() {
+  color("white") {
+    linear_extrude(height = qr_height) {
+      difference() {
+        qr_white_flat();
+        mounting_screw_flat(); } } } }
+
+module wheel(radius,
+             width,
+             shaft_radius,
+             shaft_flat_width,
+             wall_width,
+             tread_radius) {
+  wheel_black(radius,
+              width,
+              shaft_radius,
+              shaft_flat_width,
+              wall_width,
+              tread_radius);
+  wheel_white(); }
+
+module wheel_solid(radius,
+                   width,
+                   shaft_radius,
+                   shaft_flat_width,
+                   wall_width,
+                   tread_radius) {
+  difference() {
+    rim(radius, wall_width * 2, width);
+    translate([0, 0, width / 2]) {
+      tread(radius, tread_radius); } }
+  linear_extrude(height = qr_height) {
+    difference() {
+      square(qr_size, center = true);
+      mounting_screw_flat(); } }
+  translate([0, 0, qr_height]) {
+    motor_shaft_holder(shaft_radius,
+                       shaft_flat_width,
+                       wall_width,
+                       width - qr_height); } }
diff --git a/3d-printables/wheel-dimensions.scad b/3d-printables/wheel-dimensions.scad
deleted file mode 100644 (file)
index 496a8ee..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-qr_size = 45;
-qr_height = 2;
-
-wall_width = 3;
-
-wheel_width = 9;
-wheel_radius = sqrt(2 * pow(qr_size / 2, 2)) + wall_width / 2;
-
-motor_shaft_radius = 3.7;
-motor_shaft_flat_width = 4.8;
-
-tread_radius = 4 / 2;
diff --git a/3d-printables/wheel-white.scad b/3d-printables/wheel-white.scad
deleted file mode 100644 (file)
index f56db19..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-// 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
-
-use <wheel.scad>
-
-wheel_white();
index a37008333ae1207805cfa88ead7d60b11277d41e..eee5dd1dd3ec2e892efe04a5b3906eee85bd2b45 100644 (file)
@@ -9,105 +9,7 @@
 //  100 will make printing smooth
 $fn = 100;
 
 //  100 will make printing smooth
 $fn = 100;
 
-include <wheel-dimensions.scad>
-use <qr.scad>
-
-module mounting_screw_flat() {
-  circle(0.9); }
-
-module motor_shaft_flat(radius, flat_width) {
-  intersection() {
-    circle(radius);
-    square([flat_width, radius * 2], center = true); } }
-
-module motor_shaft(radius,
-                   flat_width,
-                   shaft_length) {
-  linear_extrude(height = shaft_length) {
-    motor_shaft_flat(radius, flat_width); } }
-
-module rim(radius, wall_width, wheel_width) {
-  linear_extrude(height = wheel_width) {
-    difference() {
-      circle(radius);
-      circle(radius - wall_width); } } }
-
-module motor_shaft_holder_flat(radius, flat_width, wall_width) {
-  difference() {
-    motor_shaft_flat(radius + wall_width,
-                     flat_width + wall_width);
-    motor_shaft_flat(radius, flat_width); } }
-
-module motor_shaft_holder(radius, flat_width, wall_width, height) {
-  linear_extrude(height = height) {
-    motor_shaft_holder_flat(radius, flat_width, wall_width); } }
-
-module tread(wheel_radius, tread_radius) {
-  rotate_extrude(convexity = 10) {
-    translate([wheel_radius, 0]) {
-      circle(tread_radius); } } }
-
-module wheel_black(radius,
-                   width,
-                   shaft_radius,
-                   shaft_flat_width,
-                   wall_width,
-                   tread_radius) {
-  color("black") {
-    difference() {
-      rim(radius, wall_width, width);
-      translate([0, 0, width / 2]) {
-        tread(radius, tread_radius); } }
-    linear_extrude(height = qr_height) {
-      difference() {
-        qr_black_flat();
-        mounting_screw_flat(); } }
-    translate([0, 0, qr_height]) {
-      motor_shaft_holder(shaft_radius,
-                         shaft_flat_width,
-                         wall_width,
-                         width - qr_height); } } }
-
-module wheel_white() {
-  color("white") {
-    linear_extrude(height = qr_height) {
-      difference() {
-        qr_white_flat();
-        mounting_screw_flat(); } } } }
-
-module wheel(radius,
-             width,
-             shaft_radius,
-             shaft_flat_width,
-             wall_width,
-             tread_radius) {
-  wheel_black(radius,
-              width,
-              shaft_radius,
-              shaft_flat_width,
-              wall_width,
-              tread_radius);
-  wheel_white(); }
-
-module wheel_solid(radius,
-                   width,
-                   shaft_radius,
-                   shaft_flat_width,
-                   wall_width,
-                   tread_radius) {
-  difference() {
-    rim(radius, wall_width * 2, width);
-    translate([0, 0, width / 2]) {
-      tread(radius, tread_radius); } }
-  linear_extrude(height = qr_height) {
-    difference() {
-      square(qr_size, center = true);
-      mounting_screw_flat(); } }
-  translate([0, 0, qr_height]) {
-    motor_shaft_holder(shaft_radius,
-                       shaft_flat_width,
-                       wall_width,
-                       width - qr_height); } }
+include <wheel-data.scad>
 
 /*
 wheel(wheel_radius,
 
 /*
 wheel(wheel_radius,
diff --git a/3d-printables/wire-jig-data.scad b/3d-printables/wire-jig-data.scad
new file mode 100644 (file)
index 0000000..1c51f0c
--- /dev/null
@@ -0,0 +1,30 @@
+$fn = 20;
+
+include <nut-data.scad>
+wire_channel_width = 14;
+wire_channel_height = 14;
+
+wire_diameter_measured = 1.17;
+// some of this fudge is due to using a hexagon instead of a circle
+wire_diameter_fudge = 1.4;
+wire_diameter = wire_diameter_measured + wire_diameter_fudge;
+wire_radius = wire_diameter / 2;
+
+wire_lengths = [10, //strip wire this much
+                35, //short breadboard wire
+                63, //ground to ground
+                120, //arduino breadboard wire
+                180 //motor wire
+               ];
+
+module wire_channel_groove_2d(width, height, wire_radius) {
+  difference() {
+    square([width, height]);
+    translate([width / 2, height / 2]) {
+      rotate(a = 90, v = [0, 0, 1]) {
+        nut_2d(wire_diameter); } } } }
+
+module wire_channel_groove(width, height, wire_radius, length) {
+  rotate(a = 90, v = [1, 0, 0]) {
+    linear_extrude(height = length) {
+      wire_channel_groove_2d(width, height, wire_radius); } } }
diff --git a/3d-printables/wire-jig-dimensions.scad b/3d-printables/wire-jig-dimensions.scad
deleted file mode 100644 (file)
index 69ea6f3..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-wire_channel_width = 14;
-wire_channel_height = 14;
-
-wire_diameter_measured = 1.17;
-// some of this fudge is due to using a hexagon instead of a circle
-wire_diameter_fudge = 1.4;
-wire_diameter = wire_diameter_measured + wire_diameter_fudge;
-wire_radius = wire_diameter / 2;
-
-wire_lengths = [10, //strip wire this much
-                35, //short breadboard wire
-                63, //ground to ground
-                120, //arduino breadboard wire
-                180 //motor wire
-               ];
index 3d1187ee8e6f61969247ad2f904e3a35ed5d4306..59f8434fd1372441a6e387b43c0c77b43d9f1a65 100644 (file)
@@ -4,32 +4,11 @@
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
 // https://gitorious.org/ozzloy/challenge-bot
 // https://github.com/waynegramlich/challenge-bot
 
-include <wire-jig-dimensions.scad>
-use <nut.scad>
+include <wire-jig-data.scad>
 
 
-$fn = 20;
-
-module wire_channel_groove_2d(width, height, wire_radius) {
-  difference() {
-    square([width, height]);
-    translate([width / 2, height / 2]) {
-      rotate(a = 90, v = [0, 0, 1]){
-        nut_2d(wire_diameter); } } } }
-
-/*
-wire_channel_groove_2d(wire_channel_width,
-                       wire_channel_height,
-                       wire_radius);
-                       */
-
-module wire_channel_groove(width, height, wire_radius, length){
-  rotate(a = 90, v = [1, 0, 0]){
-    linear_extrude(height = length){
-      wire_channel_groove_2d(width, height, wire_radius); } } }
-
-for(ii = [0:len(wire_lengths) - 1]) {
+for (ii = [0:len(wire_lengths) - 1]) {
   translate([ wire_channel_width * ii, 0, 0]) {
   translate([ wire_channel_width * ii, 0, 0]) {
-    #wire_channel_groove(wire_channel_width,
-                        wire_channel_height,
-                        wire_radius,
-                        wire_lengths[ii]); } }
+    wire_channel_groove(wire_channel_width,
+      wire_channel_height,
+      wire_radius,
+      wire_lengths[ii]); } }