-
Notifications
You must be signed in to change notification settings - Fork 13
/
briefcasefix.scad
executable file
·52 lines (47 loc) · 1.49 KB
/
briefcasefix.scad
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
use <Bezier.scad>;
//<params>
length = 30;
width = 21;
spacingSmaller = 7.5;
spacingBigger = 8.5;
bottomLength = 16;
thickness = 2;
taperLength = 6;
holeSpacing = 4.5;
holeRows = 2;
holeDiameter = 1.75;
rounding = 2;
//</params>
function outline(extra=0)
= [ [ 0, spacingSmaller/2 ], LINE(),LINE(),
[ taperLength, spacingSmaller/2+extra ], POLAR(taperLength,0), POLAR(taperLength,180),
[ length-bottomLength+extra, spacingBigger/2+extra ],
POLAR(spacingBigger,0),
POLAR(spacingBigger*0.75+extra, 90),
[ length+extra, 0 ],
REPEAT_MIRRORED([0,1])
];
$fn = 16;
module holes() {
for (i=[0:holeRows-1])
translate([holeSpacing*(i+1),0,width/2])
for (z=[holeSpacing/2:holeSpacing:width/2-holeDiameter])
for (s=[-1,1])
translate([0,0,z*s])
rotate([90,0,0]) cylinder(d=holeDiameter,h=100,center=true);
}
intersection() {
difference() {
linear_extrude(height=width)
difference() {
polygon(Bezier(outline(thickness)));
polygon(Bezier(outline(0)));
}
holes();
}
hull() {
translate([rounding,0,rounding]) rotate([90,0,0]) cylinder(d=rounding*2,h=100,center=true);
translate([rounding,0,width-rounding]) rotate([90,0,0]) cylinder(d=rounding*2,h=100,center=true);
translate([length,-50,0]) cube([1,100,width]);
}
}