chiark / gitweb /
poster-tube-lid: tuning in Cura
[reprap-play.git] / poster-tube-lid.scad
index 2ce691e9975526c9317d70fe23eb8e43e6bd67e8..3c60f532ab71708e5b3099b198d7d0785db3509a 100644 (file)
@@ -27,7 +27,10 @@ bayo_above_gap = 1.0;
 
 bayo_entry = bayo_behind/3;
 
-bayo_slice_size = 10;
+bayo_slice_size = 1;
+
+brace_hole_width = 1.0;
+brace_above_below = 1.2;
 
 // calculated
 
@@ -112,36 +115,40 @@ module MainProfile(){
           ]);
 }
 
-module BayonetCutoutSlice(offset){
-  rotate([0,0, atan2(offset, main_dia/2 + side_thick) ]){
+module RotateProjectSlice(offset, slice_size, nom_rad, real_rad){
+  // nom_rad > real_rad
+  rotate([0,0, atan2(offset, nom_rad) ]){
     intersection(){
       translate([-offset, -10, 0])
        rotate([90,0,0])
-       linear_extrude(height= main_dia*2)
-       polygon(bayo_polygon);
+       linear_extrude(height= nom_rad*2)
+       children(0);
+      translate([0,0, -25])
+       cylinder(h=50, r= real_rad);
       translate([0,0, -25])
-       cylinder(h=50, r= main_dia/2 + rivet_tall);
-      #translate([0,0, -25])
        linear_extrude(height= 50)
        polygon([ [ 0,0 ],
-                 [ -bayo_slice_size, -main_dia ],
-                 [ +bayo_slice_size, -main_dia ] ]);
+                 [ -slice_size, -real_rad*2 ],
+                 [ +slice_size, -real_rad*2 ] ]);
     }
   }
 }
 
-module BayonetCutout(){
-  offs = [ for (i=[-5 : +5]) i ] * bayo_slice_size;
+module RotateProject(x_min, x_max, slice_size, nom_rad, real_rad){
+  offs = [ for (i=[ x_min :
+                   slice_size :
+                   x_max + slice_size ]) i ];
   echo (offs);
-*    BayonetCutoutSlice(5);
-  for (off =offs
-        
-        //[ -20 : bayo_slice_size : 20 ]
-       ){
-    translate([ off * 5, 0,0 ])
-    echo(off);
-    BayonetCutoutSlice(off);
-  }
+  for (off=offs)
+    RotateProjectSlice(off, slice_size, nom_rad, real_rad)
+    children(0);
+}
+
+module BayonetCutout(){
+  RotateProject(bayo_c[0], bayo_i[0], bayo_slice_size,
+               main_dia/2 + side_thick, 
+               main_dia/2 + rivet_tall)
+    polygon(bayo_polygon);
 }
 
 module ProfilesDemo(){
@@ -149,5 +156,30 @@ module ProfilesDemo(){
   polygon(bayo_polygon);
 }
 
+module Cover(){
+  difference(){
+    union(){
+      rotate_extrude()
+       translate([main_dia/2, 0])
+       MainProfile();
+      translate([0,0, seal_thick])
+       cylinder(h= top_thick, r = main_dia/2);
+    }
+    for (r=[0,180])
+      rotate([0,0, r])
+       translate([0,0, -side_height])
+       BayonetCutout();
+    for (r=[0 : 60 : 179]) {
+      rotate([0,0, r]) {
+       height = top_thick - brace_above_below*2;
+       translate([0,0, seal_thick + brace_above_below + height/2 ])
+       cube(center=true, [ main_dia, brace_hole_width, height ]);
+      }
+    }
+  }
+}
+
 //ProfilesDemo();
-BayonetCutout();
+//BayonetCutout();
+//MainProfile();
+Cover();