use qr code for wheel
[challenge-bot] / 3d-printables / wheel.scad
CommitLineData
bc02cd24 1// challenge-bot
2// GNU AGPLv3 (or later at your option)
3// project available at these locations:
4// https://gitorious.org/ozzloy/challenge-bot
5// https://github.com/waynegramlich/challenge-bot
6
136c3fb0 7// use $fn = 20 while developing, 100 when about to print
8// 20 will make previews fast
9// 100 will make printing smooth
8464810c 10$fn = 100;
136c3fb0 11
8464810c 12use <qr.scad>
0d781ab9 13
8464810c 14qr_size = 54;
15qr_height = 2;
bc02cd24 16
8464810c 17wall_width = 3;
18
19wheel_width = 6;
20wheel_radius = sqrt(2 * pow(qr_size / 2, 2)) + wall_width / 2;
21
22motor_shaft_radius = 3.7;
23motor_shaft_flat_width = 4.8;
24
25module mounting_screw_flat(){
26 square(2, center = true);}
27
28module motor_shaft_flat(radius, flat_width){
bc02cd24 29 intersection(){
8464810c 30 circle(radius);
31 square([flat_width, radius * 2], center = true);}}
bc02cd24 32
8464810c 33module motor_shaft(radius,
34 flat_width,
35 shaft_length){
36 linear_extrude(height = shaft_length){
37 motor_shaft_flat(radius, flat_width);}}
0d781ab9 38
8464810c 39module rim(radius, wall_width, wheel_width){
40 linear_extrude(height = wheel_width){
0d781ab9 41 difference(){
8464810c 42 circle(radius);
43 circle(radius - wall_width);}}}
44
45module motor_shaft_holder_flat(radius, flat_width, wall_width){
46 difference(){
47 motor_shaft_flat(radius + wall_width,
48 flat_width + wall_width);
49 motor_shaft_flat(radius, flat_width);}}
50
51module motor_shaft_holder(radius, flat_width, wall_width, height){
52 linear_extrude(height = height){
53 motor_shaft_holder_flat(radius, flat_width, wall_width);}}
54
55module wheel_black(radius, width, shaft_radius, shaft_flat_width, wall_width){
56 color("black"){
57 rim(radius, wall_width, width);
58 linear_extrude(height = qr_height){
59 difference(){
60 qr_black_flat();
61 mounting_screw_flat();}}
62 translate([0, 0, qr_height]){
63 motor_shaft_holder(shaft_radius,
64 shaft_flat_width,
65 wall_width,
66 width - qr_height);}}}
67
68module wheel_white(){
69 color("white"){
70 linear_extrude(height = qr_height){
71 difference(){
72 qr_white_flat();
73 mounting_screw_flat();}}}}
74
75module wheel(radius, width, shaft_radius, shaft_flat_width, wall_width){
76 wheel_black(radius,
77 width,
78 shaft_radius,
79 shaft_flat_width,
80 wall_width);
81 wheel_white();}
82
83wheel(wheel_radius,
84 wheel_width,
85 motor_shaft_radius,
86 motor_shaft_flat_width,
87 wall_width);