chiark / gitweb /
cable-splice-clamp: Add commitid
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 9 Feb 2016 19:09:34 +0000 (19:09 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 9 Feb 2016 19:09:34 +0000 (19:09 +0000)
cable-splice-clamp.scad

index 7533bcd..a64415d 100644 (file)
@@ -1,5 +1,7 @@
 // -*- C -*-
 
+include <commitid.scad>
+
 cable_maxdia = 12;
 cable_mindia = 6;
 strap_width = 4 + 0.5;
@@ -25,6 +27,9 @@ outerdia = 2*(roundoff_rad / cos(30) + wallmin);
 
 delta_shift_gap = (cable_maxdia-cable_mindia) * delta_shift;
 
+writing_dx = outerdia * sin(30);
+writing_dz = total_len / 3;
+
 module CrossSection(plus=0) {
   difference(){
     for (dx = [-plus, 0, plus])
@@ -61,19 +66,32 @@ module CrossSectionDemo(){ ////toplevel
 }
 
 module CompleteClamp(){ ////toplevel
-  linear_extrude(height=total_len)
-    CrossSection();
-
-  for (i=[0 : strap_count]){
-    if (i*2 != strap_count) {
-      translate([0, 0,
-                total_len * (i + 0.5) / (strap_count + 1)])
-       for (m=[0,1]){
-         mirror([0,0,m])
-           translate([0,0, strap_width/2])
-           linear_extrude(height=strap_wall_l)
-           CrossSection(strap_wall_h);
+  difference(){
+    union(){
+      linear_extrude(height=total_len)
+       CrossSection();
+
+      for (i=[0 : strap_count]){
+       if (i*2 != strap_count) {
+         translate([0, 0,
+                    total_len * (i + 0.5) / (strap_count + 1)])
+           for (m=[0,1]){
+             mirror([0,0,m])
+               translate([0,0, strap_width/2])
+               linear_extrude(height=strap_wall_l)
+               CrossSection(strap_wall_h);
+           }
        }
+      }
+    }
+
+    for (my = [0,1]) {
+      mirror([0,my,0])
+       translate([-writing_dx/2,
+                  cos(30) * outerdia/2,
+                  (total_len - writing_dz)/2])
+       rotate([90,0,0])
+       Commitid_BestCount([writing_dx, writing_dz]);
     }
   }
 }