chiark / gitweb /
light-bracket: wip hollow base
[reprap-play.git] / light-bracket.scad
1 remote_width=56.2;
2 remote_height=124.7;
3 remote_thick=6.8;
4 mainhole_thick=remote_thick+1;
5 hook_hook_thick=1.5;
6 hook_stem_thick=1.5;
7 hook_hook_len=1.5;
8 base_thick=6;
9 base_margin=4.0;
10 base_width=remote_width-base_margin*2;
11 base_height=remote_height-base_margin*2;
12 base_edgewidth=4;
13
14 // origin is base of mainhole
15
16 module mainhole() {
17         translate([ -remote_width/2, 0, 0 ])
18         cube(center=false,
19                 size=[ remote_width, remote_height, mainhole_thick ] );
20 }
21
22 module hhook(extent) {
23         difference() {
24                 translate([ -hook_stem_thick, 0, -base_thick*2 ])
25                         cube(center=false,
26                                 size=[
27                         hook_stem_thick+base_margin+base_edgewidth-1,
28                         extent,
29                         base_thick*2 + mainhole_thick + hook_hook_thick
30                                         ]);
31                 translate([hook_hook_len, -5, 0])
32                          cube(center=false, size=[ 20, extent+10, 30 ]);
33         }
34 }
35
36 module hhookside(extent) {
37         translate([ -remote_width/2, 0, 0 ])
38                 hhook(extent);
39 }
40
41 module hhookbot(extent) {
42         rotate(a=90, v=[0,0,1]) hhook(extent);
43 }
44
45 module hstuff() {
46         translate([0,70,0]) hhookside(15);
47         translate([0,10,0]) hhookside(15);
48         translate([-10,0,0]) hhookbot(15);
49 }
50
51 module base() {
52         translate([ 0, base_height/2 + base_margin, -base_thick/2 ])
53         difference() {
54                 cube(center=true,
55                         [ base_width, base_height, base_thick+10 ]);
56                 cube(center=true,
57                         [ base_width - base_edgewidth*2,
58                           base_height - base_edgewidth*2,
59                           base_thick + 15 ]);
60                 
61         }
62 //      translate([-base_width/2, base_margin, -base_thick*2])
63 //              cube(center=false, [base_width,base_height,base_thick+10]);
64 }
65
66 screw_ys=[ 20, remote_height-30 ];
67
68 module stuff() {
69         hstuff();
70         mirror([1,0,0]) hstuff();
71         base();
72         for (y=screw_ys) translate([0, y, -20])
73                 cylinder(r=7.5, h=21);
74 }
75
76 module screwhole(holedia, csdia) {
77         // screw goes along z axis downwards
78         // origin is base of countersink
79         // results are positive, so this should be subtracted
80         translate([0,0,-100]) cylinder(h=200, r=holedia/2);
81         cylinder(h=100, r=csdia/2);
82 }
83
84 difference() {
85         stuff();
86         mainhole();
87         for (y=screw_ys) translate([0, y, -base_thick+2]) screwhole(4,10);
88         translate([0,0,-50 - base_thick])
89                 cube(center=true,[300,300,100]); // print bed
90 }