-
Notifications
You must be signed in to change notification settings - Fork 1
/
arm.scad
67 lines (58 loc) · 1.71 KB
/
arm.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
/**
* Copyright 2018 Mike and Nathan Fairhurst. See LICENSE for licensing.
*/
include <constants.scad>;
use <util.scad>;
use <gear.scad>;
// Begin config specific to this piece.
arm_length = 100;
width = 20;
grip_width = 2;
extend_retract_gear_size = 1;
// Begin how to print this piece (orientation, etc)
rotate([0, 90, 0]) arm();
// Begin modules that can be used to assemble this piece in solver_3.scad
module arm(include_gears=true) {
rotate([0, 270, 0]) {
translate([0, 0, cube_size/2])
if (include_gears)
opposing_gears(arm_length, width, extend_retract_gear_size);
else cylinder(d=width, arm_length);
difference() {
translate([0, 0, cube_size/3/2 + grip_width / 2])
ccube([
cube_size + grip_width * 2,
cube_size / 3,
cube_size/3 * 2 + grip_width
], x + y + z);
ccube(cube_size, x + y + z);
}
}
}
module opposing_gears(length, width, extend_retract_gear_size) {
intersection() {
fixed_outer_size_gear(width, 10, length);
ccube([width, width, length], y);
}
difference() {
movable_cylinder(extend_retract_gear_size, width, length);
ccube([width, width, length], y);
}
}
module movable_cylinder(teeth_size = 1, width = width, length=arm_length) {
iters = floor(length / teeth_size);
radial_offset = gear_tooth_additional_radius(teeth_size) + teeth_size /2;
intersection() {
// restrict to the actual length
ccube([width, width, length], x+y);
// each tooth
for (i=[0:iters]) {
up(i * teeth_size)
rotate_extrude()
translate([width / 2 - radial_offset, 0, 0])
circle(teeth_size, $fn=3);
}
}
// without this its hollow
cylinder(r=width / 2 - radial_offset, h=length);
}