set '$fn' globally based on develop or print for wheel
[challenge-bot] / sonar-table-top-holder.scad
CommitLineData
dac38b58 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
dac38b58 7// sonar sensor measurements from https://www.thingiverse.com/thing:92869,
74f8c088 8
9// 3/8 inch in mm
10deck_depth = 4.7625;
dac38b58 11sonar_plate_width = 20;
12sonar_plate_length = 45;
dac38b58 13sonar_sensor_radius = 8;
14sonar_sensor_height = 13.8;
74f8c088 15sonar_holder_length = sonar_plate_length + 10;
16sonar_holder_width = sonar_plate_width + 3;
dac38b58 17sonar_holder_depth = 3;
74f8c088 18between_sensor_centers = 27;
19
20module sensors(){
21 translate([between_sensor_centers / 2, 0, 0]){
22 cylinder(r = sonar_sensor_radius, h = sonar_sensor_height);}
23 translate([-between_sensor_centers / 2, 0, 0]){
24 cylinder(r = sonar_sensor_radius, h = sonar_sensor_height);}}
25
26module deck_holder(){
27 deck_holder_length = 25;
28 deck_holder_width = sonar_holder_width;
29 cube([deck_holder_length, deck_holder_width, sonar_holder_depth]);
30 translate([0, 0, sonar_holder_depth]){
31 cube([deck_depth, deck_holder_width, deck_depth]);
32 translate([0, 0, deck_depth]){
33 cube([deck_holder_length, deck_holder_width, sonar_holder_depth]);}}}
34
35module sonar_table_top_holder(){
36 difference(){
37 union(){
38 cube([sonar_holder_length, sonar_holder_width, sonar_holder_depth]);
39 translate([sonar_holder_length, 0, 0]){
40 deck_holder();}}
41 translate([between_sensor_centers / 2 + sonar_sensor_radius + 3,
42 sonar_holder_width / 2,
43 -1]){
44 sensors();}
45 // cut out a bit of the circle to make it 3d printable,
46 // no severe overhang
47 translate([3 + sonar_sensor_radius,
48 sonar_holder_width - 3.025,
49 sonar_holder_depth / 2 - 0.025]){
50 cube([10, 6.1, sonar_holder_depth + .1], center = true);
51 translate([between_sensor_centers, 0, 0]){
52 cube([10, 6.1, sonar_holder_depth + .1], center = true);}}}}
dac38b58 53
74f8c088 54rotate([90, 0, 0]){
55 sonar_table_top_holder();}