chiark / gitweb /
2210c9c4c5532a29caa7f59ead2e2f39db47cb75
[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 = 10;
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 TorchMovement(){
52   translate([0, -torch_out, 0]) {
53     translate([0, 0, -torch_recess])
54       Torch();
55     rotate([90,0,0])
56       linear_extrude(height= block_out)
57       projection() rotate([-90,0,0]) Torch();
58   }
59 }
60
61 module Bracket(){
62   difference(){
63     mirror([0,1,0])
64       translate([-stem_width/2, 0, -stem_len])
65       cube([stem_width, stem_thick, stem_len]);
66   }
67   difference(){
68     mirror([0,1,0])
69       translate([-block_width/2, 0, -block_thick])
70       cube([block_width, block_out, block_thick]);
71     TorchMovement();
72   }
73 }
74
75 module Demo(){
76   translate([0, -torch_out, 0])
77     %Torch();
78   Bracket();
79 }
80
81 Demo();
82