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