-
Notifications
You must be signed in to change notification settings - Fork 1
/
knurled_knob.scad
68 lines (48 loc) · 1.18 KB
/
knurled_knob.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
// Knurled Knob for a 6.5mm shaft
// by ftoad, 03/15/2011
// hinge_pin part
// CC-SA / toilet-seat alike
// knob variables
shaft_id = 6.9;
shaft_length = 15;
granularity = 50;
od = 20;
extra = 0.1;
Pi = 3.14;
// the object
difference() {
rotate([180,0,0])blank_knob();
rotate([0,0,0])translate ([0,0,-shaft_length]) lozenge_polar_array();
}
// modules to build the object
module blank_knob(){
difference(){
shafting();
cylinder (r=shaft_id/2, h=shaft_length, $fn=granularity);
}
}
// half sphere for the top of the knob
module half_sphere(r){
difference(){
sphere (r, $fn=granularity);
translate([-od,-od,0]) cube([2*od,2*od,od]);
}
}
// shaft of the knob
module shafting(){
half_sphere( od/2);
cylinder (r=od/2, h=shaft_length, $fn=granularity);
}
//lozenge to scoop out 'knurls'
module lozenge(){
union(){
cylinder ( r= (Pi*od)/10 , h=shaft_length, $fn=granularity);
translate ([0,0,shaft_length]) sphere (r = (Pi*od)/10, $fn=granularity);
translate([0,0,0]) sphere ( r = (Pi*od)/10, $fn=granularity);
}
}
module lozenge_polar_array(){
for ( i = [0:4] ) {
rotate( i*360/5 , [0,0,1]) translate( [od/2, od/2, 0] ) lozenge();
}
}