chiark / gitweb /
poster-tube-lid: add -parametric.scad to .gitignore
[reprap-play.git] / xeno-drivebay-bracket.scad
1 // -*- C -*-
2
3 basel = 16;
4 basew = 24;
5 baset = 4.0;
6
7 wallt = 2.5;
8
9 wallh = 42;
10
11 baseholesz = 3.7;
12 baseholeslot = 6.5;
13 baseholeslop = -0.5;
14
15 holeslop = 0.5;
16
17 webt = 2.5;
18
19 pad = false;
20 padw = 12;
21
22 padt = webt;
23 padl = padw;
24 padholesz = 3.0;
25
26 wallholeh = 6+14+2;
27 wallholesz = 3.0;
28 wallholeslot = 4.5;
29
30 walll = basel + webt + (pad ? padl : -0.1);
31
32 webw = min(basew, pad ? padw : padt);
33
34 module slothole(sz, slot, thick, csunk=true, slop=holeslop) {
35   hull(){
36     for (y = [-slot/2,slot/2]) {
37       translate([0,y,-0.15])
38         cylinder(r1=sz/2 + slop,
39                  r2=sz/2 + (csunk ? thick : 0) + slop,
40                  h=thick+0.30);
41     }
42   }
43 }
44
45 module Bracket(){
46   difference(){
47     translate([0, -basew, 0])
48       cube([basel, basew, baset]);
49
50     translate([basel/2, -(basew+wallt)/2, 0])
51       slothole(baseholesz, baseholeslot, baset, slop=baseholeslop);
52   }
53
54   difference(){
55     translate([0.1, 0.3, 0.1])
56     rotate([90,0,0]) {
57       linear_extrude(height=wallt){
58         polygon([[0,0],
59                  [0, wallh/2 + wallholesz/2 + wallt + wallt],
60                  [basel, wallh],
61                  [walll, wallh],
62                  [walll, wallh - padt - padt],
63                  [basel + webt, 0]]);
64       }
65     }
66
67     translate([basel/2, 0, wallholeh])
68       rotate([90,90,0])
69       slothole(wallholesz, wallholeslot, wallt, csunk=false);
70   }
71
72   translate([basel-0.01, 0, 0]) {
73     rotate([90,0,90]) {
74       linear_extrude(height=webt+0.02) {
75         polygon([[-basew, 0],
76                  [-basew, baset],
77                  [-webw, wallh],
78                  [0, wallh],
79                  [0, 0]]);
80       }
81     }
82   }
83
84   if (pad) {
85     translate([basel+webt, -padw, wallh-padt]) {
86       difference(){
87         cube([padl, padw, padt]);
88         translate([padl/2, padw/2, -1])
89           cylinder(r=padholesz/2 + holeslop, h=padt+2);
90       }
91     }
92   }
93 }
94
95 module BracketR(){ ////toplevel
96   rotate([-90,0,0]) Bracket();
97 }
98
99 module BracketL(){ ////toplevel
100   mirror([1,0,0]) BracketR();
101 }
102
103 protinnerh = 47;
104 protinnerw = 53;
105 protd = 45;
106 protbaset = 4;
107 protwallt = 2;
108 protlidt = protwallt;
109 protwingd = 28;
110 protwingw = 23;
111
112 module RearCableProtector(){
113   for (x = [-protwallt, protinnerw]) {
114     translate([x, 0, 0]) {
115       cube([protwallt, protd, protinnerh+protlidt]);
116     }
117   }
118   translate([-(protwallt-0.1), 0, protinnerh])
119     cube([protinnerw + (protwallt-0.1)*2, protd, protlidt]);
120   for (lr = [1,0]) {
121     translate([(lr ? -(protwingw + protwallt) : protinnerw), 0, 0]) {
122       difference(){
123         translate([0, 0, 0])
124           cube([protwingw, protwingd, protbaset]);
125         translate([protwingw/2, protwingd/2, 0])
126           rotate([0,0, lr ? 45 : -45])
127           slothole(baseholesz, baseholeslot, baset, slop=baseholeslop);
128       }
129     }
130   }
131 }
132
133 module RearCableProtectorT(){ ////toplevel
134   rotate([90,0,0]) RearCableProtector();
135 }
136
137 chabd = 20;
138 chablidw = 40;
139 chabinnerh = 11;
140 chabwallt = 2;
141 chablidt = 2;
142 chabwebt = 2.5;
143 chabbaset = baset;
144 chabbasew = 20;
145 chabslot = 3;
146 chablidholed = 3;
147 chabwebh = 5;
148
149 module ChannelBracket(){
150   translate([0, -chabd, 0])
151     cube([chabwallt, chabd, chabinnerh+chablidt]);
152   translate([-chablidw, -chabd, chabinnerh]) {
153     difference(){
154       cube([chablidw + chabwallt - 0.1, chabd - 0.1, chablidt]);
155       translate([chablidw/2, chabd/2, -1])
156         cylinder(r=chablidholed/2, h=chablidt+2, $fn=20);
157     }
158   }
159   translate([chabwallt-0.1, -chabd, 0]) {
160     difference(){
161       cube([chabbasew, chabd-0.1, chabbaset]);
162       translate([chabbasew/2, (chabd-chabwebt)/2, 0])
163         rotate([0,0,90])
164         slothole(baseholesz, chabslot, baset, slop=baseholeslop);
165     }
166   }
167   rotate([90,0,0]) linear_extrude(height=chabwebt) {
168     polygon([[-chablidw, chabinnerh],
169              [-chablidw, chablidt+chabinnerh],
170              [-chabwebh, chablidt+chabinnerh+chabwebh],
171              [+chabwebh, chablidt+chabinnerh+chabwebh],
172              [+chabbasew, chabbaset],
173              [+chabbasew, 0],
174              [0, 0],
175              [0, chabinnerh]]);
176   }
177 }
178
179 module ChannelBracketT(){
180   rotate([-90,0,0]) ChannelBracket();
181 }
182
183 module Kit(){ ////toplevel
184   for (y=[0, -wallh-5]) {
185     translate([0,y,0]) {
186       translate([5,0,0]) BracketR();
187       BracketL();
188     }
189   }
190 }
191
192 //Kit();
193 //BracketR();
194 //RearCableProtectorT();
195 //ChannelBracketT();