add TODOs for sonar binder clip holder
[challenge-bot] / 3d-printables / sonar-binder-clip-holder-data.scad
index 0eff47d68a22dda0e2773def7b2a84a3010dd594..250bc9acccad015b68359c7c6216d42f22dfa44d 100644 (file)
   of it.
 */
 
-$fn = 50;
+/*
+ *  * TODO make hole for thing between cans
+ *  * TODO make hole for screws in corners of pcb
+ */
+
+$fn = 150;
 
 sonar_diameter_measured = 15.82;
 sonar_diameter_print_fudge = 0.5;
@@ -32,15 +37,16 @@ between_sonar_centers_variation = 2;
 
 wall_thickness = 3;
 
-screw_radius_measured = 2.8;
+screw_diameter_measured = 3.45;
+screw_radius_measured = screw_diameter_measured / 2;
 screw_radius_print_fudge = 0.3;
 screw_radius = screw_radius_measured + screw_radius_print_fudge;
 
-sonar_binder_clip_holder_height = 2;
+sonar_binder_clip_holder_height = 4;
 
-module sonar_sensors_2d(sonar_radius,
-                        between_sonar_centers,
-                        between_sonar_centers_variation) {
+module sonar_sensor_holes_2d(sonar_radius,
+                             between_sonar_centers,
+                             between_sonar_centers_variation) {
   hull(){
     circle(sonar_radius);
     translate([between_sonar_centers_variation, 0]){
@@ -48,11 +54,8 @@ module sonar_sensors_2d(sonar_radius,
   translate([between_sonar_centers, 0]) {
     circle(sonar_radius); } }
 
-module sonar_holder_outline_2d(sonar_radius,
-                               between_sonar_centers,
-                               wall_thickness) {
-  holder_radius = sonar_radius + wall_thickness;
-  holder_diameter = holder_radius * 2;
+module sonar_holder_outline_2d(holder_radius,
+                               between_sonar_centers) {
   hull() {
     circle(holder_radius);
     translate([between_sonar_centers, 0]) {
@@ -61,76 +64,71 @@ module sonar_holder_outline_2d(sonar_radius,
 module binder_clip_holder_outline_2d(holder_radius) {
      circle(holder_radius); }
 
-module sonar_binder_clip_holder_outline_2d() {
+module sonar_binder_clip_holder_outline_2d(holder_radius,
+                                           between_sonar_centers) {
+  sonar_holder_length = between_sonar_centers + 2 * holder_radius;
   hull(){
-    sonar_holder_outline_2d();
-    translate([0,0,0]) {
-      binder_clip_holder_outline_2d(); } } }
-
-module sonar_holder_holes_2d() { }
+    sonar_holder_outline_2d(holder_radius, between_sonar_centers);
+    translate([sonar_holder_length, 0]) {
+      binder_clip_holder_outline_2d(holder_radius); } } }
 
-module binder_clip_holder_holes_2d() { }
+module binder_clip_holder_holes_2d(screw_radius) {
+  circle(screw_radius); }
 
-module sonar_binder_clip_holder_holes_2d(){ }
-
-module sonar_binder_clip_holder_2d() {
+module binder_clip_holder_2d(holder_radius,
+                             screw_radius) {
   difference() {
-    sonar_binder_clip_holder_outline_2d();
-    sonar_binder_clip_holder_holes(); } }
+       binder_clip_holder_outline_2d(holder_radius);
+       binder_clip_holder_holes_2d(screw_radius); } }
 
-module sonar_holder_2d(sonar_radius,
-                       between_sonar_centers,
-                       between_sonar_centers_variation,
-                       wall_thickness) {
-  difference() {
-    sonar_holder_outline_2d(sonar_radius,
-                            between_sonar_centers,
-                            wall_thickness);
-    sonar_sensors_2d(sonar_radius,
-                     between_sonar_centers,
-                     between_sonar_centers_variation); } }
-
-module binder_clip_holder_2d(binder_clip_holder_length,
-                             screw_radius,
-                             holder_radius){
-  difference() {
-    circle(holder_radius);
-    circle(screw_radius); } }
+module binder_clip_holder(holder_radius,
+                          screw_radius,
+                          sonar_binder_clip_holder_height) {
+  linear_extrude(height = sonar_binder_clip_holder_height) {
+    binder_clip_holder_2d(holder_radius,
+                          screw_radius); } }
+
+module sonar_binder_clip_holder_holes_2d(sonar_radius,
+                                         between_sonar_centers,
+                                         between_sonar_centers_variation,
+                                         screw_radius,
+                                         wall_thickness) {
+  holder_radius = sonar_radius + wall_thickness;
+  holder_diameter = holder_radius * 2;
+  holder_length = between_sonar_centers + holder_diameter;
+  sonar_sensor_holes_2d(sonar_radius,
+                        between_sonar_centers,
+                        between_sonar_centers_variation);
+  translate([holder_length, 0]){
+    binder_clip_holder_holes_2d(screw_radius); } }
 
 module sonar_binder_clip_holder_2d(sonar_radius,
                                    between_sonar_centers,
                                    between_sonar_centers_variation,
+                                   screw_radius,
                                    wall_thickness) {
-  sonar_holder_2d(sonar_radius,
-                  between_sonar_centers,
-                  between_sonar_centers_variation,
-                  wall_thickness);
   holder_radius = sonar_radius + wall_thickness;
-  binder_clip_holder_length = 2 * holder_radius;
-  translate([between_sonar_centers + holder_radius * 2, 0]){
-    binder_clip_holder_2d(binder_clip_holder_length,
-                       screw_radius,
-                       holder_radius); } }
+  difference() {
+    sonar_binder_clip_holder_outline_2d(holder_radius,
+                                        between_sonar_centers);
+    sonar_binder_clip_holder_holes_2d(sonar_radius,
+                                      between_sonar_centers,
+                                      between_sonar_centers_variation,
+                                      screw_radius,
+                                      wall_thickness); } }
 
 module sonar_binder_clip_holder(sonar_radius,
                                 between_sonar_centers,
                                 between_sonar_centers_variation,
+                                screw_radius,
                                 wall_thickness,
                                 sonar_binder_clip_holder_height) {
-  linear_extrude(height = sonar_binder_clip_holder_height) {
-    sonar_binder_clip_holder_2d(sonar_radius,
-                                between_sonar_centers,
-                                between_sonar_centers_variation,
-                                wall_thickness); } }
-
-module binder_clip_holder(binder_clip_holder_length,
-                          screw_radius,
-                          holder_radius,
-                          binder_clip_holder_height) {
-     linear_extrude(height = binder_clip_holder_height) {
-          binder_clip_holder_2d(binder_clip_holder_length,
-                                screw_radius,
-                                holder_radius); } }
+     linear_extrude(height = sonar_binder_clip_holder_height) {
+          sonar_binder_clip_holder_2d(sonar_radius,
+                                      between_sonar_centers,
+                                      between_sonar_centers_variation,
+                                      screw_radius,
+                                      wall_thickness); } }
 
 /*
   This file is part of challenge-bot.