forked from GregFrost/PrusaMendel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pla-bushing.scad
123 lines (109 loc) · 3.55 KB
/
pla-bushing.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// PRUSA Mendel
// Bushings
// GNU GPL v2
// Josef Průša
// prusadjs.cz
// http://www.reprap.org/wiki/Prusa_Mendel
// http://github.com/prusajr/PrusaMendel
// Print them in PLA and glue them to place
// if they are too tight, define bigger rodsize
// or you can try to sand a bt off
// TYPE Can generate three versions
// 1 - regular old ones
// 2 - helical ones
// 3 - holders for brass or any other bought bushings
include <configuration.scad>
/**
* @name Bushing
* @category Printed
* @link bushing
*/
rodsize = bushing_rodsize;
outerDiameter = bushing_outerDiameter;
lenght = bushing_lenght;
type = bushing_type;
module bushing_core_straight(){
union(){
rotate(a=[0,0,45])
difference(){
union(){
//outer ring
difference(){
union(){
cylinder(h = lenght, r=outerDiameter/2); //1mm lemování
//cylinder(h = 1, r=outerDiameter/2+2);
}
translate(v=[0,0,-1]) cylinder(h = lenght+2, r=(outerDiameter/2)-2);
}
//nipples inside touching the rod
difference(){
union(){
translate(v=[0,0,lenght/2]) cube(size = [outerDiameter-1,2,lenght], center = true);
translate(v=[0,0,lenght/2]) cube(size = [2,outerDiameter-1,lenght], center = true);
}
translate(v=[0,0,-1]) cylinder(h = lenght+2, r=rodsize/2, $fn=20);
}
}
//opening cutout
translate(v=[(outerDiameter/2)+1,(outerDiameter/2)+1,(lenght)/2]) cube(size = [outerDiameter,outerDiameter,lenght+2], center = true);
}
}
}
module bushing_core_holder(){
union(){
rotate(a=[0,0,45])
difference(){
union(){
//outer ring
difference(){
union(){
cylinder(h = lenght, r=outerDiameter/2); //1mm lemování
//cylinder(h = 1, r=outerDiameter/2+2);
}
translate(v=[0,0,-1]) cylinder(h = lenght+2, r=(rodsize/2));
}
}
//opening cutout
translate(v=[(outerDiameter/2)+1,(outerDiameter/2)+1,(lenght)/2]) cube(size = [outerDiameter,outerDiameter,lenght+2], center = true);
}
}
}
module bushing_core_helical(){
difference(){
rotate(a=[0,0,44]) translate(v=[0,0,(lenght)/2]) linear_extrude(center = true, height = lenght, twist = 90,convexity = 20) projection(cut = true) bushing_core_straight();
translate(v=[0,-2.3,0]) rotate(a=[0,0,45]) translate(v=[(outerDiameter/2)+1,(outerDiameter/2)+1,(lenght)/2]) cube(size = [outerDiameter,outerDiameter,lenght+2], center = true);
// hack for easier cleanup
translate(v=[0,0,-0.5]) cylinder(h = 1, r=rodsize/2+1, $fn=20);
}
}
module bushing(){
difference(){
translate(v=[0,-outerDiameter/4,lenght/2]) cube(size = [outerDiameter, outerDiameter/2,lenght], center = true);
translate(v=[0,0,-1]) cylinder(h = lenght+2, r=(outerDiameter/2)-2);//
}
if(type == 1){
bushing_core_straight();
}
if(type == 2){
bushing_core_helical();
}
if(type == 3){
bushing_core_holder();
}
}
union(){
translate(v=[(rodsize+1),(rodsize+1),0]) bushing();
translate(v=[-(rodsize+1),(rodsize+1),0]) bushing();
translate(v=[(rodsize+1),-(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
translate(v=[-(rodsize+1),-(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
translate(v=[3*(rodsize+1),(rodsize+1),0]) bushing();
translate(v=[-3*(rodsize+1),(rodsize+1),0]) bushing();
translate(v=[3*(rodsize+1),-(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
translate(v=[-3*(rodsize+1),-(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
translate(v=[(rodsize+1),3*(rodsize+1),0]) bushing();
translate(v=[-(rodsize+1),3*(rodsize+1),0]) bushing();
translate(v=[(rodsize+1),-3*(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
translate(v=[-(rodsize+1),-3*(rodsize+1),0]) mirror([ 0, 1, 0 ]) bushing();
}
%cube([100,100,0.01],true);