add box cat
[ozzloy@gmail.com/3d-printables] / spin-data.scad
index 24214f1499e475ce74688b24cc4f44d3bd2714fc..534df16c0124c70f6b72ff1ab2fcbbe09ac04c75 100644 (file)
@@ -26,6 +26,7 @@ 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
@@ -40,29 +41,35 @@ 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;
@@ -149,7 +156,7 @@ module spin_slices(weight_radius,
 
   /* add one to have some thickness all around weight holes
      for first layer */
-  new_start = old_end / 8 + 1;
+  new_start = old_end / 16 + 1;
   new_end = old_end;
 
   old_range = old_end - old_start;
@@ -180,8 +187,8 @@ module spin_slices(weight_radius,
     cylinder(h = actual_height + 0.1,
              r = bearing_radius - bearing_lip_overhang,
              center = true);
-    cylinder(h = bearing_thickness + 0.1,
-             r = bearing_radius + 0.1,
+    cylinder(h = bearing_thickness + 0.05,
+             r = bearing_radius + 0.15,
              center = true);
     for(arm = [0 : arms - 1]) {
       rotate(arm * (360 / arms)) {
@@ -189,10 +196,30 @@ module spin_slices(weight_radius,
           cylinder(h = actual_height + 0.1,
                    r = weight_radius - weight_lip_overhang,
                    center = true);
-          cylinder(h = weight_thickness + 0.1,
-                   r = weight_radius + 0.1,
+          cylinder(h = weight_thickness + 0.05,
+                   r = weight_radius + 0.15,
                    center = true); } } } } }
 
+module spin_donut(weight_radius,
+                  weight_thickness,
+                  bearing_radius,
+                  bearing_thickness,
+                  weight_lip_overhang,
+                  bearing_lip_overhang,
+                  wall,
+                  arms) {
+  thicker_thickness = (bearing_thickness > weight_thickness)
+    ? bearing_thickness : weight_thickness;
+  height = thicker_thickness + wall * 2;
+
+  center_to_arm_center = bearing_radius + wall + weight_radius;
+
+  jelly_filled(height, bearing_radius);
+  for(arm = [0 : arms]) {
+    rotate(arm * (360 / arms)) {
+      translate([center_to_arm_center, 0, 0]) {
+        jelly_filled(height, weight_radius); } } } }
+
 /*
   This file is part of 3d-printables.