forked from josefprusa/PrusaMendel
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathfunctions.scad
34 lines (28 loc) · 805 Bytes
/
functions.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
// PRUSA Mendel
// Functions used in many files
// GNU GPL v2
// Josef Průša
// josefprusa@me.com
// prusadjs.cz
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
module nut(d,h,horizontal=true){
cornerdiameter = (d / 2) / cos (180 / 6);
cylinder(h = h, r = cornerdiameter, $fn = 6);
if(horizontal){
for(i = [1:6]){
rotate([0,0,60*i]) translate([-cornerdiameter-0.2,0,0]) rotate([0,0,-45]) cube(size = [2,2,h]);
}}
}
// By nophead
module polyhole(d,h) {
n = max(round(2 * d),3);
rotate([0,0,180])
cylinder(h = h, r = (d / 2) / cos (180 / n), $fn = n);
}
module roundcorner(diameter){
difference(){
cube(size = [diameter,diameter,99], center = false);
translate(v = [diameter, diameter, 0]) cylinder(h = 100, r=diameter, center=true);
}
}