chiark / gitweb /
b880291c5b9b609978ce81d3e15696e50e598935
[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 = 14;
17 arm_width = 10;
18 block_thick = 15;
19
20 torch_out_more = 10;
21
22 //$fa=5;
23
24 // calculated
25
26 above = torch_big_len + torch_clear + torch_clear_below;
27
28 holes = [ 172, 265 ];
29
30 stem_below = stem_width/2;
31
32 stem_len = holes[1] - above + stem_below;
33
34 torch_out = stem_thick + torch_big_dia/2 + torch_out_more;
35
36 block_width = arm_width*2 + torch_big_dia;
37
38 block_out = torch_out + torch_big_dia/2/sqrt(2);
39
40 module Torch(){
41   mirror([0,0,1]){
42     hull(){
43       rotate_extrude()
44         translate(dxf_off)
45         import(file="maglite-holder-torch-curve.dxf",
46                convexity=10, center=true);
47     }
48     translate([0,0, -1])
49       cylinder(r=torch_lit_dia/2, h= torch_tot_len - torch_big_len + 1);
50   }
51 }
52
53 module TorchMovement(){
54   translate([0, -torch_out, 0]) {
55     translate([0, 0, -torch_recess])
56       Torch();
57     rotate([90,0,0])
58       linear_extrude(height= block_out)
59       projection() rotate([-90,0,0]) Torch();
60   }
61 }
62
63 module Bracket(){
64   difference(){
65     mirror([0,1,0])
66       translate([-stem_width/2, 0, -stem_len])
67       cube([stem_width, stem_thick, stem_len]);
68   }
69   difference(){
70     mirror([0,1,0])
71       translate([-block_width/2, 0, -block_thick])
72       cube([block_width, block_out, block_thick]);
73     TorchMovement();
74   }
75 }
76
77 module Demo(){
78   translate([0, -torch_out, 0])
79     %Torch();
80   Bracket();
81 }
82
83 Demo();
84