]> git.armaanb.net Git - atreides.git/commitdiff
Fix indentation
authorArmaan Bhojwani <me@armaanb.net>
Fri, 15 Jan 2021 16:17:34 +0000 (11:17 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Fri, 15 Jan 2021 16:17:34 +0000 (11:17 -0500)
case/openscad/atreus_case.scad
case/openscad_3D/atreus_3D.scad

index 3cc3ad3d8b38b2d7a083658573e9d51acdf2f611..2c9a9253f070c56e2ea7c24975d2b32a5cbaa3b8 100644 (file)
@@ -9,8 +9,8 @@ column_spacing   = 19;
 row_spacing      = column_spacing;
 
 /* This number should exceed row_spacing and column_spacing. The
 row_spacing      = column_spacing;
 
 /* This number should exceed row_spacing and column_spacing. The
- default gives a 1mm = (20mm - 19mm) gap between keycaps and cuts in
- the top plate.*/
  default gives a 1mm = (20mm - 19mm) gap between keycaps and cuts in
  the top plate.*/
 key_hole_size = 20;
 
 /* rotation angle; the angle between the halves is twice this
 key_hole_size = 20;
 
 /* rotation angle; the angle between the halves is twice this
@@ -79,7 +79,7 @@ module rz(angle, center=undef) {
    around center. Used to compute locations of screw holes near the
    USB cable hole. */
 function rz_fun(p, angle, center) = [cos(angle) * (p[0] - center[0]) - sin(angle) * (p[1] - center[1]) + center[0],
    around center. Used to compute locations of screw holes near the
    USB cable hole. */
 function rz_fun(p, angle, center) = [cos(angle) * (p[0] - center[0]) - sin(angle) * (p[1] - center[1]) + center[0],
-                                     sin(angle) * (p[0] - center[0]) + cos(angle) * (p[1] - center[1])+ center[1]];
+         sin(angle) * (p[0] - center[0]) + cos(angle) * (p[1] - center[1])+ center[1]];
 
 module switch_hole(position, notches=use_notched_holes) {
   /* Cherry MX switch hole with the center at `position`. Sizes come
 
 module switch_hole(position, notches=use_notched_holes) {
   /* Cherry MX switch hole with the center at `position`. Sizes come
@@ -151,7 +151,7 @@ module add_hand_separation() {
   for (i=[0:$children-1]) {
     translate([0.5*hand_separation, /* we get back the full separation
                                        because of mirroring */
   for (i=[0:$children-1]) {
     translate([0.5*hand_separation, /* we get back the full separation
                                        because of mirroring */
-               0]) children(i);
+        0]) children(i);
   }
 }
 
   }
 }
 
@@ -201,7 +201,7 @@ module screw_hole(radius, offset_radius, position, direction) {
 module right_screw_holes(hole_radius) {
   /* coordinates of the back right screw hole before rotation... */
   back_right = [(n_cols+n_thumb_keys)*row_spacing,
 module right_screw_holes(hole_radius) {
   /* coordinates of the back right screw hole before rotation... */
   back_right = [(n_cols+n_thumb_keys)*row_spacing,
-               staggering_offsets[n_cols-1] + n_rows * column_spacing];
+             staggering_offsets[n_cols-1] + n_rows * column_spacing];
   /* and after */
   tmp = rz_fun(back_right, angle, [0, 2.25*column_spacing]);
 
   /* and after */
   tmp = rz_fun(back_right, angle, [0, 2.25*column_spacing]);
 
@@ -210,26 +210,26 @@ module right_screw_holes(hole_radius) {
   rotate_half() {
     add_hand_separation() {
       screw_hole(hole_radius, washer_radius,
   rotate_half() {
     add_hand_separation() {
       screw_hole(hole_radius, washer_radius,
-                 [row_spacing, 0],
-                 [-nudge, -nudge]);
+          [row_spacing, 0],
+          [-nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
       screw_hole(hole_radius, washer_radius,
-                 [(n_cols+n_thumb_keys)*row_spacing, staggering_offsets[n_cols-1]],
-                 [nudge, -nudge]);
+          [(n_cols+n_thumb_keys)*row_spacing, staggering_offsets[n_cols-1]],
+          [nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
       screw_hole(hole_radius, washer_radius,
-                 back_right,
-                 [nudge, nudge]);
+          back_right,
+          [nudge, nudge]);
     }
   }
 
   /* add the screw hole near the cable hole */
   translate([washer_radius - tmp[0] - 0.5*hand_separation,
     }
   }
 
   /* add the screw hole near the cable hole */
   translate([washer_radius - tmp[0] - 0.5*hand_separation,
-             back_screw_hole_offset]) {
+      back_screw_hole_offset]) {
     rotate_half() {
       add_hand_separation() {
         screw_hole(hole_radius,
     rotate_half() {
       add_hand_separation() {
         screw_hole(hole_radius,
-                   washer_radius,
-                   back_right,
-                   [nudge, nudge]);
+            washer_radius,
+            back_right,
+            [nudge, nudge]);
       }
     }
   }
       }
     }
   }
@@ -281,10 +281,10 @@ module spacer() {
           right_half(switch_holes=false, key_size=switch_hole_size + 3);
           left_half(switch_holes=false, key_size=switch_hole_size + 3);
         }
           right_half(switch_holes=false, key_size=switch_hole_size + 3);
           left_half(switch_holes=false, key_size=switch_hole_size + 3);
         }
-    /* add the USB cable hole: */
-    translate([-0.5*cable_hole_width, 2*column_spacing]) {
-      square([cable_hole_width, (2*n_rows) * column_spacing]);
-    }
+        /* add the USB cable hole: */
+        translate([-0.5*cable_hole_width, 2*column_spacing]) {
+          square([cable_hole_width, (2*n_rows) * column_spacing]);
+        }
       }
       screw_holes(washer_radius);
     }
       }
       screw_holes(washer_radius);
     }
index 1d409505a72f4546fdb859f67da4ac7df2d5efe9..5e67527acd0529c8a53edb780273c1974d807057 100644 (file)
@@ -9,8 +9,8 @@ column_spacing   = 19;
 row_spacing      = column_spacing;
 
 /* This number should exceed row_spacing and column_spacing. The
 row_spacing      = column_spacing;
 
 /* This number should exceed row_spacing and column_spacing. The
- default gives a 1mm = (20mm - 19mm) gap between keycaps and cuts in
- the top plate.*/
  default gives a 1mm = (20mm - 19mm) gap between keycaps and cuts in
  the top plate.*/
 key_hole_size = 20;
 
 /* rotation angle; the angle between the halves is twice this
 key_hole_size = 20;
 
 /* rotation angle; the angle between the halves is twice this
@@ -79,7 +79,7 @@ module rz(angle, center=undef) {
    around center. Used to compute locations of screw holes near the
    USB cable hole. */
 function rz_fun(p, angle, center) = [cos(angle) * (p[0] - center[0]) - sin(angle) * (p[1] - center[1]) + center[0],
    around center. Used to compute locations of screw holes near the
    USB cable hole. */
 function rz_fun(p, angle, center) = [cos(angle) * (p[0] - center[0]) - sin(angle) * (p[1] - center[1]) + center[0],
-                                     sin(angle) * (p[0] - center[0]) + cos(angle) * (p[1] - center[1])+ center[1]];
+         sin(angle) * (p[0] - center[0]) + cos(angle) * (p[1] - center[1])+ center[1]];
 
 module switch_hole(position, notches=use_notched_holes) {
   /* Cherry MX switch hole with the center at `position`. Sizes come
 
 module switch_hole(position, notches=use_notched_holes) {
   /* Cherry MX switch hole with the center at `position`. Sizes come
@@ -90,8 +90,8 @@ module switch_hole(position, notches=use_notched_holes) {
   notch_depth  = 0.8128;
   translate(position) {
     union() {
   notch_depth  = 0.8128;
   translate(position) {
     union() {
-        translate([0,0,-1])
-      cube([hole_size, hole_size,50], center=true);
+      translate([0,0,-1])
+        cube([hole_size, hole_size,50], center=true);
       if (notches == true) {
         translate([0, notch_offset,-1]) {
           cube([hole_size+2*notch_depth, notch_width,50], center=true);
       if (notches == true) {
         translate([0, notch_offset,-1]) {
           cube([hole_size+2*notch_depth, notch_width,50], center=true);
@@ -152,7 +152,7 @@ module add_hand_separation() {
   for (i=[0:$children-1]) {
     translate([0.5*hand_separation, /* we get back the full separation
                                        because of mirroring */
   for (i=[0:$children-1]) {
     translate([0.5*hand_separation, /* we get back the full separation
                                        because of mirroring */
-               0]) children(i);
+        0]) children(i);
   }
 }
 
   }
 }
 
@@ -202,7 +202,7 @@ module screw_hole(radius, offset_radius, position, direction) {
 module right_screw_holes(hole_radius) {
   /* coordinates of the back right screw hole before rotation... */
   back_right = [(n_cols+n_thumb_keys)*row_spacing,
 module right_screw_holes(hole_radius) {
   /* coordinates of the back right screw hole before rotation... */
   back_right = [(n_cols+n_thumb_keys)*row_spacing,
-               staggering_offsets[n_cols-1] + n_rows * column_spacing];
+             staggering_offsets[n_cols-1] + n_rows * column_spacing];
   /* and after */
   tmp = rz_fun(back_right, angle, [0, 2.25*column_spacing]);
 
   /* and after */
   tmp = rz_fun(back_right, angle, [0, 2.25*column_spacing]);
 
@@ -211,26 +211,26 @@ module right_screw_holes(hole_radius) {
   rotate_half() {
     add_hand_separation() {
       screw_hole(hole_radius, washer_radius,
   rotate_half() {
     add_hand_separation() {
       screw_hole(hole_radius, washer_radius,
-                 [row_spacing, 0],
-                 [-nudge, -nudge]);
+          [row_spacing, 0],
+          [-nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
       screw_hole(hole_radius, washer_radius,
-                 [(n_cols+n_thumb_keys)*row_spacing, staggering_offsets[n_cols-1]],
-                 [nudge, -nudge]);
+          [(n_cols+n_thumb_keys)*row_spacing, staggering_offsets[n_cols-1]],
+          [nudge, -nudge]);
       screw_hole(hole_radius, washer_radius,
       screw_hole(hole_radius, washer_radius,
-                 back_right,
-                 [nudge, nudge]);
+          back_right,
+          [nudge, nudge]);
     }
   }
 
   /* add the screw hole near the cable hole */
   translate([washer_radius - tmp[0],
     }
   }
 
   /* add the screw hole near the cable hole */
   translate([washer_radius - tmp[0],
-             back_screw_hole_offset]) {
+      back_screw_hole_offset]) {
     rotate_half() {
       add_hand_separation() {
         screw_hole(hole_radius,
     rotate_half() {
       add_hand_separation() {
         screw_hole(hole_radius,
-                   washer_radius,
-                   back_right,
-                   [nudge, nudge]);
+            washer_radius,
+            back_right,
+            [nudge, nudge]);
       }
     }
   }
       }
     }
   }
@@ -282,10 +282,10 @@ module spacer() {
           right_half(switch_holes=false, key_size=switch_hole_size + 3);
           left_half(switch_holes=false, key_size=switch_hole_size + 3);
         }
           right_half(switch_holes=false, key_size=switch_hole_size + 3);
           left_half(switch_holes=false, key_size=switch_hole_size + 3);
         }
-    /* add the USB cable hole: */
-    translate([-0.5*cable_hole_width, 2*column_spacing,0]) {
-      cube([cable_hole_width, (2*n_rows) * column_spacing,50]);
-    }
+        /* add the USB cable hole: */
+        translate([-0.5*cable_hole_width, 2*column_spacing,0]) {
+          cube([cable_hole_width, (2*n_rows) * column_spacing,50]);
+        }
       }
       screw_holes(washer_radius);
     }
       }
       screw_holes(washer_radius);
     }