chiark / gitweb /
3532afb9db0066f9bb6c27e85b3c532f28e7dfa1
[reprap-play.git] / xeno-drivebay-bracket.scad
1 // -*- C -*-
2
3 basel = 23;
4 basew = 27;
5 baset = 4.0;
6
7 wallt = 2.5;
8
9 wallh = 42;
10
11 baseholesz = 4;
12 baseholeslot = 4;
13
14 topl = 20;
15
16 holeslop = 0.5;
17
18 webt = 3;
19
20 padt = 3;
21 padw = 20;
22 padl = padw;
23 padholesz = 5.0;
24
25 wallholeh = 6+14+2;
26 wallholesz = 3.0;
27 wallholeslot = 4.5;
28
29 walll = basel + webt + padl;;
30
31 webw = min(basew, padw);
32
33 module slothole(sz, slot, thick, csunk=true) {
34   hull(){
35     for (y = [-slot/2,slot/2]) {
36       translate([0,y,-0.05])
37         cylinder(r1=sz/2 + holeslop,
38                  r2=sz/2 + (csunk ? thick : 0) + holeslop,
39                  h=thick+0.10);
40     }
41   }
42 }
43
44 module Bracket(){
45   difference(){
46     translate([0, -basew, 0])
47       cube([basel, basew, baset]);
48
49     translate([basel/2, -(basew+wallt)/2, 0])
50       slothole(baseholesz, baseholeslot, baset);
51   }
52
53   difference(){
54     rotate([90,0,0]) {
55       linear_extrude(height=wallt){
56         polygon([[0,0],
57                  [0, wallh/2 + wallholesz/2 + wallt + wallt],
58                  [basel, wallh],
59                  [walll, wallh],
60                  [walll, wallh - padt - padt],
61                  [basel + webt, 0]]);
62       }
63     }
64
65     translate([basel/2, 0, wallholeh])
66       rotate([90,90,0])
67       slothole(wallholesz, wallholeslot, wallt, csunk=false);
68   }
69
70   translate([basel-0.01, 0, 0]) {
71     rotate([90,0,90]) {
72       linear_extrude(height=webt+0.02) {
73         polygon([[-basew, 0],
74                  [-basew, baset],
75                  [-webw, wallh],
76                  [0, wallh],
77                  [0, 0]]);
78       }
79     }
80   }
81
82   translate([basel+webt, -padw, wallh-padt]) {
83     difference(){
84       cube([padl, padw, padt]);
85       translate([padl/2, padw/2, -1])
86         cylinder(r=padholesz/2 + holeslop, h=padt+2);
87     }
88   }
89 }
90
91 module BracketR(){ ////toplevel
92   rotate([-90,0,0]) Bracket();
93 }
94
95 module BracketL(){ ////toplevel
96   mirror([1,0,0]) BracketR();
97 }
98
99 module Kit(){ ////toplevel
100   for (y=[0, -wallh-5]) {
101     translate([0,y,0]) {
102       translate([5,0,0]) BracketR();
103       BracketL();
104     }
105   }
106 }
107
108 //Kit();
109 BracketR();