chiark / gitweb /
maglite-holder: wip holder, before project
[reprap-play.git] / maglite-holder.scad
1 // -*- C -*-
2
3 dxf_off = [ -40, -85 ];
4
5 torch_lit_dia = 37.5;
6 torch_big_dia = 56.5;
7 torch_tot_len = 256;
8 torch_big_len = 60;
9
10 torch_clear = 30;
11 torch_clear_below = 10;
12
13 stem_width = 20;
14 stem_thick = 4;
15
16 torch_recess = 15;
17 arm_width = 10;
18 block_thick = 30;
19
20 //$fa=5;
21
22 // calculated
23
24 above = torch_big_len + torch_clear + torch_clear_below;
25
26 holes = [ 172, 265 ];
27
28 stem_below = stem_width/2;
29
30 stem_len = holes[1] - above + stem_below;
31
32 torch_out = stem_thick + torch_big_dia/2;
33
34 block_width = arm_width*2 + torch_big_dia;
35
36 block_out = torch_out + torch_big_dia/sqrt(2);
37
38 module Torch(){
39   mirror([0,0,1]){
40     hull(){
41       rotate_extrude()
42         translate(dxf_off)
43         import(file="maglite-holder-torch-curve.dxf",
44                convexity=10, center=true);
45     }
46     translate([0,0, -1])
47       cylinder(r=torch_lit_dia/2, h= torch_tot_len - torch_big_len + 1);
48   }
49 }
50
51 module Bracket(){
52   difference(){
53     mirror([0,1,0])
54       translate([-stem_width/2, 0, -stem_len])
55       cube([stem_width, stem_thick, stem_len]);
56   }
57   difference(){
58     mirror([0,1,0])
59       translate([-block_width/2, 0, -block_thick])
60       cube([block_width, block_out, block_thick]);
61   }
62   for (out=[ torch_out, torch_out + block_out*2 ])
63     translate([ 0, -out, -torch_recess ])
64       Torch();
65 }
66
67 module Demo(){
68   translate([0, -torch_out, 0])
69     %Torch();
70   Bracket();
71 }
72
73 Demo();