give lip to hold in penny and bearing
authordaniel watson <ozzloy@gmail.com>
Mon, 9 Jan 2017 22:07:24 +0000 (14:07 -0800)
committerdaniel watson <ozzloy@gmail.com>
Mon, 9 Jan 2017 22:07:24 +0000 (14:07 -0800)
spin-data.scad
spin.scad

index 9190e9a035145e49e674d07ede0097678ff018ab..e9a80b7f63e4d0312d731331c0cec86d44a19518 100644 (file)
@@ -7,25 +7,36 @@ $fn = 500;
 weight = "penny";
 // weight = "608zz";
 bearing = "608zz";
+weight_lip_thickness = 1;
 wall_thickness = 2;
+penny_thickness = 1.52;
+spinner_height = penny_thickness * 5 + 2;
 _608zz_radius = 22;
+_608zz_thickness = 7;
 penny_radius = 19.05 / 2;
-penny_thickness = 1.52;
 weight_radius = (weight == "penny") ? penny_radius : _608zz_radius;
+weight_thickness = (weight == "penny") ?
+     penny_thickness * 5 : _608zz_thickness;
 bearing_radius = (bearing == "608zz") ? _608zz_radius : 1/0;
+bearing_thickness = (bearing == "608zz") ? _608zz_thickness : 1/0;
 arms = 3;
 
-module spin(weight_radius,
-            arms,
-            wall_thickness,
-            bearing_radius) {
+module ring(outer_radius, inner_radius) {
+  difference() {
+    circle(outer_radius);
+    circle(inner_radius); } }
+
+module spin_2d(weight_radius,
+               arms,
+               wall_thickness,
+               bearing_radius) {
   bearing_holder_radius = bearing_radius + wall_thickness;
   weight_holder_radius = weight_radius + wall_thickness;
 
-  circle(bearing_holder_radius);
+  ring(bearing_holder_radius, bearing_radius);
 
   /*
-   * imagine a right triangle with one point at the origin, at the
+   * imagine a triangle with one point at the origin, at the
    * center of the spinning bearing holder, one point in the middle of
    * the weight holder, and one point at the center of a circle tangent
    * to the first two, called the joiner circle.
@@ -42,7 +53,8 @@ module spin(weight_radius,
   /* c: goes between origin and joiner circle. */
   c = bearing_holder_radius + joiner_radius;
 
-  /* A: angle at the origin, between the base and hypotenuse.
+  /* A: angle at the origin, between the base and segment from origin
+     to center of joiner circle.
      it is calculated using law of cosines, given the lengths of
      all 3 sides of the triangle. */
   A = acos((pow(b, 2) + pow(c, 2) - pow(a, 2)) / (2 * b * c));
@@ -68,16 +80,51 @@ module spin(weight_radius,
                  bearing_joiner_point,
                  weight_joiner_point]);
         translate([joiner_x, joiner_y]) {
-          circle(joiner_radius); } }
+          circle(joiner_radius); }
+        translate([weight_holder_radius + bearing_holder_radius, 0]) {
+          circle(weight_holder_radius); } }
       mirror(v = [0, 1, 0]) {
         difference() {
           polygon([bearing_weight_point,
                    bearing_joiner_point,
                    weight_joiner_point]);
           translate([joiner_x, joiner_y]) {
-            circle(joiner_radius); } } }
+            circle(joiner_radius); }
+        translate([weight_holder_radius + bearing_holder_radius, 0]) {
+          circle(weight_holder_radius); } } }
       translate([weight_holder_radius + bearing_holder_radius, 0]) {
-        circle(weight_holder_radius); } } } }
+        ring(weight_holder_radius, weight_radius); } } } }
+
+module spin(weight_radius,
+            weight_thickness,
+            weight_lip_thickness,
+            arms,
+            wall_thickness,
+            bearing_radius,
+            bearing_thickness,
+            spinner_height) {
+  /* TODO: make window size parameter */
+  /* TODO: rethink how lips are done */
+  /* TODO: right now, weight is assumed to be thicker than bearing*/
+  bearing_lip_thickness = (spinner_height - bearing_thickness) / 2;
+  linear_extrude(height = weight_lip_thickness) {
+    spin_2d(weight_radius - 1,
+            arms,
+            wall_thickness + 1,
+            bearing_radius - 1); }
+  linear_extrude(height = bearing_lip_thickness) {
+    ring(bearing_radius, bearing_radius - 1); }
+  linear_extrude(height = spinner_height) {
+    spin_2d(weight_radius, arms, wall_thickness, bearing_radius); }
+  translate([0, 0, spinner_height - bearing_lip_thickness]) {
+    linear_extrude(height = bearing_lip_thickness) {
+    ring(bearing_radius, bearing_radius - 1); } }
+  translate([0, 0, spinner_height - weight_lip_thickness]) {
+    linear_extrude(height = weight_lip_thickness) {
+      spin_2d(weight_radius - 1,
+              arms,
+              wall_thickness + 1,
+              bearing_radius - 1); } } }
 
 /*
   This file is part of 3d-printables.
index e07088207c7be6a7ea6f09efe062e9bb093023c3..995bf34f532c1db63ed5b94f336019ef49ffe0ab 100644 (file)
--- a/spin.scad
+++ b/spin.scad
@@ -4,7 +4,14 @@
 /* spin thing that erin likes */
 include<spin-data.scad>
 
-spin(weight_radius, arms, wall_thickness, bearing_radius);
+spin(weight_radius,
+     weight_thickness,
+     weight_lip_thickness,
+     arms,
+     wall_thickness,
+     bearing_radius,
+     bearing_thickness,
+     spinner_height);
 
 /*
   This file is part of 3d-printables.