chiark / gitweb /
e00091f6204d133a79b7cd1e07d09c1ea0d4793d
[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, padw);
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 module Kit(){ ////toplevel
104   for (y=[0, -wallh-5]) {
105     translate([0,y,0]) {
106       translate([5,0,0]) BracketR();
107       BracketL();
108     }
109   }
110 }
111
112 //Kit();
113 //BracketR();