chiark / gitweb /
sewing-table: Leg: test
[reprap-play.git] / bike-stalk-led-mount.scad
1 // -*- C -*-
2
3 include <commitid.scad>
4
5 stalk_dia = 6.4 + 0.25;
6
7 length = 50;
8 width = 12;
9
10 strap_below = 2;
11 strap_thick = 2;
12 strap_width = 5;
13 strap_above = 0.25;
14
15 arch_above = 2;
16
17 inside_gap = 0.5;
18
19 // calculated
20
21 height_base = stalk_dia/2 - inside_gap/2;
22 above_height = height_base + arch_above;
23 below_height = height_base + max(arch_above,
24                                  strap_below + strap_thick + strap_above);
25
26 module StalkCutout(){
27   translate([-length,0,0])
28     rotate([0,90,0])
29     cylinder(r= stalk_dia/2, h=length*2, $fn=40);
30 }
31
32 module SomeBlockBase(height){
33   translate([0,0, height/2 + inside_gap/2]) {
34     difference(){
35       cube([length, width, height], center=true);
36       translate([-length/2, 0, height/2])
37         Commitid_BestCount([length*.66, width/2]);
38     }
39   }
40 }
41
42 module BlockAbove(){ ////toplevel
43   difference(){
44     SomeBlockBase(above_height);
45     StalkCutout();
46   }
47 }
48
49 module BlockBelow(){ ////toplevel
50   difference(){
51     SomeBlockBase(below_height);
52     StalkCutout();
53     translate([0,0, inside_gap/2 + strap_above + stalk_dia/2 + strap_thick/2])
54       cube([strap_width, width*2, strap_thick], center=true);
55   }
56 }
57
58 module BlockAbovePrint(){ ////toplevel
59   rotate([180,0,0]) BlockAbove();
60 }
61
62 module BlockBelowPrint(){ ////toplevel
63   rotate([180,0,0]) BlockBelow();
64 }
65
66 module Demo(){ ////toplevel
67   BlockAbove();
68   rotate([180,0,0]) BlockBelow();
69 }
70
71 //Demo();