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 |
12 | use <qr.scad> |
0d781ab9 |
13 | |
8464810c |
14 | qr_size = 54; |
15 | qr_height = 2; |
bc02cd24 |
16 | |
8464810c |
17 | wall_width = 3; |
18 | |
19 | wheel_width = 6; |
20 | wheel_radius = sqrt(2 * pow(qr_size / 2, 2)) + wall_width / 2; |
21 | |
22 | motor_shaft_radius = 3.7; |
23 | motor_shaft_flat_width = 4.8; |
24 | |
403f9f0c |
25 | tread_radius = 2.5 / 2; |
26 | |
8464810c |
27 | module mounting_screw_flat(){ |
28 | square(2, center = true);} |
29 | |
30 | module motor_shaft_flat(radius, flat_width){ |
bc02cd24 |
31 | intersection(){ |
8464810c |
32 | circle(radius); |
33 | square([flat_width, radius * 2], center = true);}} |
bc02cd24 |
34 | |
8464810c |
35 | module motor_shaft(radius, |
36 | flat_width, |
37 | shaft_length){ |
38 | linear_extrude(height = shaft_length){ |
39 | motor_shaft_flat(radius, flat_width);}} |
0d781ab9 |
40 | |
8464810c |
41 | module rim(radius, wall_width, wheel_width){ |
42 | linear_extrude(height = wheel_width){ |
0d781ab9 |
43 | difference(){ |
8464810c |
44 | circle(radius); |
45 | circle(radius - wall_width);}}} |
46 | |
47 | module motor_shaft_holder_flat(radius, flat_width, wall_width){ |
48 | difference(){ |
49 | motor_shaft_flat(radius + wall_width, |
50 | flat_width + wall_width); |
51 | motor_shaft_flat(radius, flat_width);}} |
52 | |
53 | module motor_shaft_holder(radius, flat_width, wall_width, height){ |
54 | linear_extrude(height = height){ |
55 | motor_shaft_holder_flat(radius, flat_width, wall_width);}} |
56 | |
403f9f0c |
57 | module tread(wheel_radius, tread_radius){ |
58 | rotate_extrude(convexity = 10){ |
59 | translate([wheel_radius, 0]){ |
60 | circle(tread_radius);}}} |
61 | |
62 | module wheel_black(radius, |
63 | width, |
64 | shaft_radius, |
65 | shaft_flat_width, |
66 | wall_width, |
67 | tread_radius){ |
8464810c |
68 | color("black"){ |
403f9f0c |
69 | difference(){ |
70 | rim(radius, wall_width, width); |
71 | translate([0, 0, width / 2]){ |
72 | tread(radius, tread_radius);}} |
8464810c |
73 | linear_extrude(height = qr_height){ |
74 | difference(){ |
75 | qr_black_flat(); |
76 | mounting_screw_flat();}} |
77 | translate([0, 0, qr_height]){ |
78 | motor_shaft_holder(shaft_radius, |
79 | shaft_flat_width, |
80 | wall_width, |
81 | width - qr_height);}}} |
82 | |
83 | module wheel_white(){ |
84 | color("white"){ |
85 | linear_extrude(height = qr_height){ |
86 | difference(){ |
87 | qr_white_flat(); |
88 | mounting_screw_flat();}}}} |
89 | |
403f9f0c |
90 | module wheel(radius, |
91 | width, |
92 | shaft_radius, |
93 | shaft_flat_width, |
94 | wall_width, |
95 | tread_radius){ |
8464810c |
96 | wheel_black(radius, |
97 | width, |
98 | shaft_radius, |
99 | shaft_flat_width, |
403f9f0c |
100 | wall_width, |
101 | tread_radius); |
8464810c |
102 | wheel_white();} |
103 | |
104 | wheel(wheel_radius, |
105 | wheel_width, |
106 | motor_shaft_radius, |
107 | motor_shaft_flat_width, |
403f9f0c |
108 | wall_width, |
109 | tread_radius); |