chiark / gitweb /
1821b99711f079df407ac9a48489589d950b85e3
[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 //padw = 12;
20 padw = 0;
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 + padl;;
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.05])
38         cylinder(r1=sz/2 + slop,
39                  r2=sz/2 + (csunk ? thick : 0) + slop,
40                  h=thick+0.10);
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     rotate([90,0,0]) {
56       linear_extrude(height=wallt){
57         polygon([[0,0],
58                  [0, wallh/2 + wallholesz/2 + wallt + wallt],
59                  [basel, wallh],
60                  [walll, wallh],
61                  [walll, wallh - padt - padt],
62                  [basel + webt, 0]]);
63       }
64     }
65
66     translate([basel/2, 0, wallholeh])
67       rotate([90,90,0])
68       slothole(wallholesz, wallholeslot, wallt, csunk=false);
69   }
70
71   translate([basel-0.01, 0, 0]) {
72     rotate([90,0,90]) {
73       linear_extrude(height=webt+0.02) {
74         polygon([[-basew, 0],
75                  [-basew, baset],
76                  [-webw, wallh],
77                  [0, wallh],
78                  [0, 0]]);
79       }
80     }
81   }
82
83   translate([basel+webt, -padw, wallh-padt]) {
84     difference(){
85       cube([padl, padw, padt]);
86       translate([padl/2, padw/2, -1])
87         cylinder(r=padholesz/2 + holeslop, h=padt+2);
88     }
89   }
90 }
91
92 module BracketR(){ ////toplevel
93   rotate([-90,0,0]) Bracket();
94 }
95
96 module BracketL(){ ////toplevel
97   mirror([1,0,0]) BracketR();
98 }
99
100 module Kit(){ ////toplevel
101   for (y=[0, -wallh-5]) {
102     translate([0,y,0]) {
103       translate([5,0,0]) BracketR();
104       BracketL();
105     }
106   }
107 }
108
109 //Kit();
110 //BracketR();