-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest.scad
executable file
·134 lines (108 loc) · 3.42 KB
/
test.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
124
125
126
127
128
129
130
131
132
133
use <lib/servos.scad>
use <body.scad>
use <leg.scad>
$fn = 50;
SUPPORT_SPACE = 65.0;
BODY_THICKNESS = 6;
BODY_LEG_HOLE_DIAMETER = 5.5;
BODY_LEG_HOLE_HEAD_SCREW_HEIGHT = 3.3;
BODY_LEG_HOLE_HEAD_SCREW_DIAMETER = 10;
BODY_LEG_HOLE_NUT_DIAMETER = 9.5;
SERVO_HOLDER_SCREW_DIAMETER = 2;
SERVO_HOLDER_NUT_DIAMETER = 6;
SERVO_HOLDER_NUT_HEIGHT = 1.9;
module servo_nut_test(screw_diameter, nut_diameter, nut_height = 20) {
rotate([0, 180, 0]) {
translate([0, 0, - BODY_THICKNESS - 1]) {
cylinder(h = BODY_THICKNESS + 2 + 10, r = screw_diameter / 2);
}
translate([0, 0, - BODY_THICKNESS + 3.1 - 0.2]) {
cylinder(r = nut_diameter / 2, h = nut_height, $fn = 6);
}
}
}
module show() {
intersection() {
union() {
// Create body
difference() {
union() {
body();
translate([0, 0, SUPPORT_SPACE]) {
body_support();
}
}
// Hole
translate([90, 0, - BODY_THICKNESS / 2 + BODY_LEG_HOLE_HEAD_SCREW_HEIGHT - 0.01]) {
cylinder(r = BODY_LEG_HOLE_DIAMETER / 2, h = 150, center = true);
// Head screw footprint
rotate([180, 0, 0]) {
cylinder(r1 = BODY_LEG_HOLE_DIAMETER / 2, r2 = BODY_LEG_HOLE_HEAD_SCREW_DIAMETER / 2, h = BODY_LEG_HOLE_HEAD_SCREW_HEIGHT);
}
}
translate([150, 0, - BODY_THICKNESS / 2 + BODY_LEG_HOLE_HEAD_SCREW_HEIGHT - 0.01]) {
cylinder(r = BODY_LEG_HOLE_DIAMETER / 2, h = 150, center = true);
// Head screw footprint
rotate([180, 0, 0]) {
cylinder(r1 = BODY_LEG_HOLE_DIAMETER / 2, r2 = BODY_LEG_HOLE_HEAD_SCREW_DIAMETER / 2, h = BODY_LEG_HOLE_HEAD_SCREW_HEIGHT);
}
}
// Nut test
translate([100, 0, SUPPORT_SPACE]) {
servo_nut_test(SERVO_HOLDER_SCREW_DIAMETER, SERVO_HOLDER_NUT_DIAMETER, SERVO_HOLDER_NUT_HEIGHT);
}
translate([110, 0, SUPPORT_SPACE]) {
servo_nut_test(2.5, 5.8, 2.1);
}
translate([120, 0, SUPPORT_SPACE]) {
servo_nut_test(3, 6, 3.1);
}
translate([130, 0, SUPPORT_SPACE + 1.6]) {
cylinder(r = BODY_LEG_HOLE_NUT_DIAMETER / 2, h = 3, center = true, $fn = 6);
}
}
}
child();
}
}
/*
if (0) {
rotate([180, 0, 0]) {
show() {
translate([140, 50, 0]) {
cube(size = [120, 120, 50], center = true);
}
}
}
} else {
difference() {
show() {
translate([140, 50, 50]) {
cube(size = [120, 120, 50], center = true);
}
}
}
}
*/
module test_arm() {
SPACER_LENGTH = 6;
ARMS_SPACING = 20;
ARM_THICKNESS = 4;
ARM_WIDTH = 20;
difference() {
spacer(ARMS_SPACING, ARM_WIDTH, ARM_THICKNESS);
translate([6, 0, 0]) {
cube(size = [20, 30, 30], center = true);
}
}
}
if (0) {
test_arm();
} else {
difference() {
main_arm();
translate([0, 20, 0]) {
cube(size = [30, 90, 30], center = true);
}
}
}