-
Notifications
You must be signed in to change notification settings - Fork 1
/
servo.scad
60 lines (54 loc) · 1.63 KB
/
servo.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
/**
* 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.
// nothing
// Begin how to print this piece (orientation, etc)
// nothing: doesn't print.
// Begin modules that can be used to assemble this piece in solver_3.scad
module servo(
block_size=servo_block_size,
flange_length=servo_flange_length,
flange_thickness=servo_flange_thickness,
flange_offset=servo_flange_offset,
screw_offsets=servo_screw_offsets,
screw_size=servo_screw_size,
gear_teeth_size=servo_gear_teeth_size,
gear_num_teeth=servo_gear_num_teeth,
gear_thickness=servo_gear_thickness
) {
down(gear_thickness) {
servo_block(block_size);
servo_flange(
block_size,
flange_length,
flange_thickness,
flange_offset,
screw_offsets,
screw_size);
}
servo_gear(gear_teeth_size, gear_num_teeth, gear_thickness);
}
module servo_gear(
gear_teeth_size=servo_gear_teeth_size,
gear_num_teeth=servo_gear_num_teeth,
gear_thickness=servo_gear_thickness
) {
down(gear_thickness) {
gear(gear_teeth_size, gear_num_teeth, gear_thickness);
}
}
module servo_flange(block_size, length, thickness, offset, screw_offsets, screw_size) {
down(offset) difference() {
ccube([length + block_size[0], block_size[1], thickness], x + y);
mirrored([x, y])
translate([block_size[0]/2 + screw_offsets[0], screw_offsets[1], 0])
up(thickness/2) cylinder(thickness*2, d=screw_size, center=true, $fn=20);
}
}
module servo_block(size) {
down(size[2]) ccube(size, x + y);
}