chiark / gitweb /
filamentspool: FilamentGuideClipSpacerClip wip
[reprap-play.git] / light-bracket.scad
1 shrinkage = 1.0126; // width of 56.2 gives 55.5
2 remote_width= 56.35 * shrinkage;
3 remote_height=124.7 * shrinkage;
4 remote_thick=6.1; // height of 6.8 gives 6.3
5 mainhole_thick=remote_thick+1;
6 hook_hook_thick=1.5;
7 hook_stem_thick=1.5;
8 hook_hook_len=1.5;
9 base_thick=3.5;
10 base_margin=3.0;
11 base_width=remote_width-base_margin*2;
12 base_height=remote_height-base_margin*2;
13 base_edgewidth=4;
14
15 screw_ys=[ 28, remote_height-28 ];
16
17 // origin is base of mainhole
18
19 module mainhole() {
20         translate([ -remote_width/2, 0, 0 ])
21         cube(center=false,
22                 size=[ remote_width, remote_height, mainhole_thick ] );
23 }
24
25 module hhook(extent) {
26         translate([ -hook_stem_thick, 0, -base_thick*2 ])
27                 cube(center=false,
28                         size=[
29                                 hook_stem_thick,
30                                 extent,
31                                 base_thick*2 + mainhole_thick + hook_hook_thick
32                         ]);
33         translate([ -hook_stem_thick, 0, -base_thick*2 ])
34                 cube(center=false,
35                         size=[
36                                 hook_stem_thick+base_margin+base_edgewidth-1,
37                                 extent,
38                                 base_thick*2
39                         ]);
40         translate([ -hook_stem_thick+1.0, 0, mainhole_thick ])
41                 rotate(v=[0,1,0], a=-30)
42                 cube(center=false,
43                         size=[
44                                 3,
45                                 extent,
46                                 hook_hook_thick
47                         ]);
48         //difference() {
49         //      #translate([ -hook_stem_thick, 0, -base_thick*2 ])
50         //              cube(center=false,
51         //                      size=[
52         //              hook_stem_thick+base_margin+base_edgewidth-1,
53         //              extent,
54         //              base_thick*2 + mainhole_thick + hook_hook_thick
55         //                              ]);
56         //      translate([hook_hook_len, -5, 0])
57         //               cube(center=false, size=[ 20, extent+10, 30 ]);
58         //}
59 }
60
61 module hhookside(extent) {
62         translate([ -remote_width/2, 0, 0 ])
63                 hhook(extent);
64 }
65
66 module hhookbot(extent) {
67         rotate(a=90, v=[0,0,1]) hhook(extent);
68 }
69
70 module hstuff() {
71         translate([0,70,0]) hhookside(15);
72         translate([0,10,0]) hhookside(15);
73         translate([-10,0,0]) hhookbot(15);
74 }
75
76 module slashes() {
77         for (y=[-30 : 60 : +40])
78                 translate([0,y,0])
79                         rotate(v=[0,0,1],a=45)
80                                 cube(center=true, [ 5,200,200 ]);
81 }
82
83 module base() {
84         translate([ 0, base_height/2 + base_margin, -base_thick/2 ])
85         intersection() {
86                 cube(center=true,
87                         [ base_width, base_height, base_thick+10 ]);
88                 union() {
89                         difference() {
90                                 cube(center=true, [ 200,200,200 ]);
91                                 cube(center=true,
92                                         [ base_width - base_edgewidth*2,
93                                           base_height - base_edgewidth*2,
94                                           base_thick + 15 ]);
95                                 
96                         }
97                         slashes();
98                         mirror([1,0,0]) slashes();
99                 }
100         }
101 //      translate([-base_width/2, base_margin, -base_thick*2])
102 //              cube(center=false, [base_width,base_height,base_thick+10]);
103 }
104
105 module stuff() {
106         hstuff();
107         mirror([1,0,0]) hstuff();
108         base();
109         for (y=screw_ys) translate([0, y, -20])
110                 cylinder(r=6.5, h=21);
111 }
112
113 module screwhole(holedia, csdia) {
114         // screw goes along z axis downwards
115         // origin is top of head
116         // results are positive, so this should be subtracted
117         translate([0,0,-100]) cylinder(h=200, r=holedia/2);
118         csdist=(csdia-holedia)/2;
119         translate([0,0,-csdist]) cylinder(h=csdist, r1=holedia/2, r2=csdia/2);
120         cylinder(h=100, r=csdia/2);
121 }
122
123 module bracket() {
124         // this is the actual thing we want
125         difference() {
126                 stuff();
127                 mainhole();
128                 for (y=screw_ys) translate([0, y, 0])   
129                         screwhole(5.4,10); //dia=4 gives 2.9
130                                          //holedia=10 gives 9.0 want 7.0
131                 translate([0,0,-50 - base_thick])
132                         cube(center=true,[300,300,100]); // print bed
133         }
134 }
135
136 intersection() {
137         !bracket();
138         translate([-50,6,-50]) #cube(center=false, [100,27,100]);
139 }