Commits

uniqx  committed 0336ee3

cog sockets for faucet

  • Participants
  • Parent commits 58f0408

Comments (0)

Files changed (1)

File openscad/faucet.scad

 //                                                                     //
 /////////////////////////////////////////////////////////////////////////
 
-r1 = 25;
-r2 = 20;
-r3 = 13;
-r4  = 8/2;
+sides = 8;
+
+radius_front = 25;
+radius_rear = 20;
+recess_radius = 13;
+cog_socket_radius = 8/2;
 
 roundings = 5;
 
 cog_count = 20;
-cog_height = 1;
+cog_height = 2/4; 
+cog_width = 1/4;
 
-h = 50;
-o2 = h-18;
-o1 = h-40;
+height = 50;
+recess_height = 18;
+cog_socket_height = 40;
 
+union(){
 
-/*for(i = [1:cog_count] ){
+  
+  for(i = [1:cog_count] ){
 
-  rotate([i*360/cog_count,0,0])
-  translate([0,r1,0])
-  cube([cog_height,1,1]);
+    translate([0,0,height-cog_socket_height])
+    rotate([0,0,i*360/cog_count])
+    //cube([cog_socket_height-recess_height,cog_height,cog_width]);
+    translate([0,cog_socket_radius-cog_height])
+    linear_extrude(height=cog_socket_height-recess_height)
+    polygon(points=[[-cog_width/2,cog_height],[cog_width/2,cog_height],[0,0]], paths=[[0,1,2]]);
 
-}*/
+  }
 
-difference() {
+  difference() {
 
-        translate([0,0,roundings]){
-		minkowski(){
+    translate([0,0,roundings]){
+      minkowski(){
 
-			cylinder(r1 = r1-roundings, r2 = r2-roundings, h = h-(2*roundings), $fn = 8);
-			sphere(r=roundings);
-		}
-	}
+        cylinder(
+          r1 = radius_front - roundings,
+          r2 = radius_rear - roundings,
+          h = height - (2*roundings),
+          $fn = sides
+        );
 
-	translate([0, 0, o1])
-		cylinder(r = r4, h = h);
-	translate([0, 0, o2])
-		#cylinder(r = r3, h = h);
+        sphere(r=roundings);
+
+      }
+    }
+
+    translate([0, 0, height - cog_socket_height])
+      cylinder(r = cog_socket_radius, h = height, $fn=50);
+    translate([0, 0, height - recess_height])
+      cylinder(r = recess_radius, h = height);
+  }
 }