forked from jcrocholl/kossel
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsocket.scad
More file actions
92 lines (60 loc) · 1.88 KB
/
socket.scad
File metadata and controls
92 lines (60 loc) · 1.88 KB
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
socket_extra=2;
module socket(ball_dia, screw_dia, adisp) {
assign(ball_rad=ball_dia/2){
assign(screw_rad=screw_dia/2){
assign(body_height = ball_dia+socket_extra){
assign(cone_min=screw_rad/cos(adisp)){
assign(cone_max=body_height*tan(adisp)+cone_min){
%if (1) {
// Show ball and attachment screw
sphere(r=ball_rad, center=true, $fn=30);
for (a = [adisp, 0, -adisp]) {
rotate([0, a, 0])
cylinder(r=screw_rad, h=ball_dia, $fn=30);
}
}
difference() {
union() {
translate([0, -body_height*.5, 0])
cube([body_height, body_height, body_height], true);
rotate([0, 90, 0])
cylinder(r=body_height/2, h=body_height, center=true, $fn=30);
}
cube([screw_dia, 1000, 1000], true);
sphere(r=ball_rad, center=true, $fn=30);
// relieve center of socketball_dia*tan(adisp)+
rotate([0, 90, 0]) {
cylinder(r=ball_dia*.25, h=body_height+2,
center=true, $fn=30);
cylinder(r=ball_rad, h=ball_rad*cos(adisp)+screw_dia-2,
center=true, $fn=30);
}
// create clearance for screw attaching ball to rod
intersection() {
rotate([0, 90, 0]) rotate_extrude($fn=30)
polygon(points=[[0, -cone_min],
[0, cone_min],
[body_height, cone_max],
[body_height, -cone_max]],
paths=[[0, 1, 2, 3]]);
translate([0, 50, 50]) cube(100, center=true);
}
for (r = [0,-90]) {
rotate([r, 0, 0])
cylinder(r1=cone_min, r2=cone_max, h=body_height, $fn=30);
}
translate([0, -(ball_rad+1.5+1), 0])
rotate([0, 90, 0])
cylinder(r=1.5, h=body_height+1, center=true, $fn=30);
}
}}}}}}
ball_dia = .5*25.4;
screw_dia = .112*25.4;
adisp = 30; // Max angular displacement of rod to socket
union() {
cube([ball_dia+socket_extra,
ball_dia+socket_extra,
ball_dia+socket_extra], center=true);
translate([0, (ball_dia+socket_extra)*1.5, 0])
socket(ball_dia, screw_dia, adisp);
}