make cap fit new spinner shape
[ozzloy@gmail.com/3d-printables] / spin-data.scad
index 4d4fd0dec60f9b947024b8c9a82fec96f9878f67..46c2f80fc39dcb6adc62296cae8958ad29f09096 100644 (file)
@@ -11,15 +11,13 @@ weight = "penny";
 bearing = "608zz";
 weight_lip_overhang = 0.3;
 bearing_lip_overhang = weight_lip_overhang;
-// TODO: switch wall_thickness -> wall
-wall_thickness = 3;
 wall = 3;
 penny_thickness = 1.52;
 penny_radius = 19.05 / 2;
 
 _608zz_radius = 22 / 2;
 _608zz_inner_radius = 8.1 / 2;
-_608zz_cover_radius = 19.4 / 2;
+_608zz_cover_radius = _608zz_radius;
 _608zz_cap_footprint_radius = 12 / 2;
 _608zz_thickness = 7;
 
@@ -28,9 +26,10 @@ weight_thickness = (weight == "penny") ?
      penny_thickness * 5 : _608zz_thickness;
 
 bearing_radius = (bearing == "608zz") ? _608zz_radius : 1/0;
+bearing_window_radius = bearing_radius - bearing_lip_overhang - 1;
 bearing_inner_radius = (bearing == "608zz") ? _608zz_inner_radius : 1/0;
 bearing_cover_radius = (bearing == "608zz")
-                       ? _608zz_cover_radius + wall
+                       ? _608zz_cover_radius
                        : 1/0;
 bearing_cap_footprint_radius =
      (bearing == "608zz") ? _608zz_cap_footprint_radius : 1/0;
@@ -42,29 +41,50 @@ arms = 3;
 module cap(bearing_inner_radius,
            bearing_cap_footprint_radius,
            bearing_cover_radius,
-           bearing_thickness) {
-  footprint_height = 1.6;
-  footprint_radius_safety = 0.25;
+           bearing_thickness,
+           bearing_window_radius) {
+  footprint_height = 4.5;
+  footprint_radius_safety = 0.2;
   cap_height = 3;
-  bearing_cover_radius_safety = 0.75;
-  bearing_thickness_safety = 0.2;
+  bearing_thickness_safety = 0.6;
+  finger_spot_height = cap_height / 10;
 
   difference() {
     union() {
       cylinder(r1 = bearing_cover_radius - tan(30) * cap_height,
                r2 = bearing_cover_radius,
                h = cap_height);
+      linear_extrude(height = cap_height
+                              + footprint_height
+                              - 1.05) {
+        circle(bearing_window_radius - 1); }
       linear_extrude(height = cap_height + footprint_height) {
         circle(bearing_cap_footprint_radius - footprint_radius_safety); }
       linear_extrude(height = cap_height
                               + footprint_height
                               + bearing_thickness / 2
                               - bearing_thickness_safety) {
-        circle(bearing_inner_radius); } }
+        circle(bearing_inner_radius); }
+    }
     translate([0, 0, -0.01]) {
-      cylinder(r1 = bearing_inner_radius + tan(30) * (cap_height - 1),
-               r2 = bearing_inner_radius,
-               h = cap_height - 1); } } }
+      cylinder(r1 = bearing_inner_radius,
+               r2 = bearing_inner_radius - tan(30) * finger_spot_height,
+               h = finger_spot_height); } } }
+
+module donut(height, footprint_radius) {
+  bread_radius = height / 2;
+  rotate_extrude() {
+    translate([footprint_radius, 0]) {
+      circle(bread_radius); } } }
+
+module donut_hole(height, footprint_radius) {
+  difference() {
+    cylinder(r = footprint_radius, h = height, center = true);
+    donut(height, footprint_radius); } }
+
+module jelly_filled(height, footprint_radius) {
+  cylinder(r = footprint_radius, h = height, center = true);
+  donut(height, footprint_radius); }
 
 module fillet(r) {
   offset(r = -r) { offset(delta = r) { children(); } } }