fill in outline of sonar binder holder skeleton
authordaniel watson <ozzloy@gmail.com>
Sun, 5 Jun 2016 00:26:02 +0000 (17:26 -0700)
committerdaniel watson <ozzloy@gmail.com>
Sun, 5 Jun 2016 00:26:41 +0000 (17:26 -0700)
3d-printables/sonar-binder-clip-holder-data.scad
3d-printables/sonar-binder-clip-holder.scad

index 0eff47d68a22dda0e2773def7b2a84a3010dd594..bc835d0c6097441b3ae20ce771ab1f6345daae9f 100644 (file)
@@ -38,9 +38,9 @@ screw_radius = screw_radius_measured + screw_radius_print_fudge;
 
 sonar_binder_clip_holder_height = 2;
 
-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 +48,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 +58,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(); } } }
+    sonar_holder_outline_2d(holder_radius, between_sonar_centers);
+    translate([sonar_holder_length, 0]) {
+      binder_clip_holder_outline_2d(holder_radius); } } }
 
-module sonar_holder_holes_2d() { }
+module binder_clip_holder_holes_2d(screw_radius) {
+  circle(screw_radius); }
 
-module binder_clip_holder_holes_2d() { }
-
-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.
index 633fb25afb1ccfed24d5addd7e531ed2caa39ac7..6890d0a58f2bb9f7085f383a5176fdaa8d748755 100644 (file)
@@ -21,15 +21,15 @@ include <sonar-binder-clip-holder-data.scad>
 sonar_binder_clip_holder(sonar_radius,
                          between_sonar_centers,
                          between_sonar_centers_variation,
+                         screw_radius,
                          wall_thickness,
                          sonar_binder_clip_holder_height);
 
 holder_radius = sonar_radius + wall_thickness;
-binder_clip_holder_length = 2 * holder_radius;
+
 translate([0, holder_radius * 2 + 2]) {
-  binder_clip_holder(binder_clip_holder_length,
+  binder_clip_holder(holder_radius,
                      screw_radius,
-                     holder_radius,
                      sonar_binder_clip_holder_height); }
 
 /*