chiark / gitweb /
bike-stalk-led-mount: wip
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Oct 2016 20:16:17 +0000 (21:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 4 Oct 2016 20:16:17 +0000 (21:16 +0100)
bike-stalk-led-mount.scad [new file with mode: 0644]

diff --git a/bike-stalk-led-mount.scad b/bike-stalk-led-mount.scad
new file mode 100644 (file)
index 0000000..43d2ade
--- /dev/null
@@ -0,0 +1,56 @@
+// -*- C -*-
+
+stalk_dia = 6.4 + 0.25;
+
+length = 50;
+width = 12;
+
+strap_below = 2;
+strap_thick = 2;
+strap_width = 5;
+strap_above = 0.25;
+
+arch_above = 2;
+
+inside_gap = 0.5;
+
+// calculated
+
+height_base = stalk_dia/2 - inside_gap/2;
+above_height = height_base + arch_above;
+below_height = height_base + max(arch_above,
+                                strap_below + strap_thick + strap_above);
+
+module StalkCutout(){
+  translate([-length,0,0])
+    rotate([0,90,0])
+    cylinder(r= stalk_dia/2, h=length*2, $fn=40);
+}
+
+module SomeBlockBase(height){
+  translate([0,0, height/2 + inside_gap/2])
+    cube([length, width, height], center=true);
+}
+
+module BlockAbove(){
+  difference(){
+    SomeBlockBase(above_height);
+    StalkCutout();
+  }
+}
+
+module BlockBelow(){
+  difference(){
+    SomeBlockBase(below_height);
+    StalkCutout();
+    translate([0,0, inside_gap/2 + strap_above + stalk_dia/2 + strap_thick/2])
+      cube([strap_width, width*2, strap_thick], center=true);
+  }
+}
+
+module Demo(){
+  BlockAbove();
+  rotate([180,0,0]) BlockBelow();
+}
+
+Demo();