add scale factor and use modules for more pieces
authordaniel watson <ozzloy@gmail.com>
Sun, 1 Sep 2013 15:29:54 +0000 (08:29 -0700)
committerdaniel watson <ozzloy@gmail.com>
Sun, 1 Sep 2013 15:29:54 +0000 (08:29 -0700)
schematic-3d-printable.scad

index 3e11090dc14e170c732f37a12c4bb8014efa9813..5a2d4e4ae5eed766a2552ee30b14a394114331fa 100644 (file)
@@ -8,33 +8,37 @@
 // https://github.com/josefprusa/Prusa3/blob/master/box_frame/x-carriage.scad
 // as an example of how to code in scad
 
+scale=10;
+
 deck_dimensions = [8, 8, 3/16];
 
-module deck() {
-       cube(deck_dimensions);
-}
-
-module wheel_mount() {
-       difference() {
-               cube([1.5, 2.1, 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);
-               }
-       }
-}
-
-color("blue") deck();
+module deck(scale){
+  cube(deck_dimensions * scale);}
+
+module collar_hole(scale){
+       cylinder(h = 5/16 * scale, r = 0.362/2 * scale, $fn = 100);}
+
+module nubin_hole(scale){
+       cylinder(h = 5/16 * scale, r = 0.145/2 * scale, $fn = 100);}
+
+module mounting_screw_hole(scale){
+       cylinder(h = 5/16 * scale, r = 0.114/2 * scale, $fn = 100);}
+
+module wheel_mount(scale){
+  difference(){
+    cube([1.5, 2, 3/16] * scale);
+    // motor shaft collar hole
+    translate([0.5, 0.938, -1/16] * scale) {
+      collar_hole(scale);}
+    // nubbin hole
+    translate([0.5 + 0.875 - 0.425, 0.938, -1/16] * scale){
+      nubin_hole(scale);}
+    // mounting screw hole
+    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);}}}
+
+color("blue") deck(scale);
 rotate([90, 0, 0]) translate([1.5, -2, -(3/16)]) wheel_mount();
 rotate([90, 0, 0]) translate([1.5, -2, -8]) wheel_mount();