chiark / gitweb /
belt-slot-cut-jig: MaybeRoundedCube utility, nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 14 Jun 2013 09:51:44 +0000 (10:51 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 14 Jun 2013 09:51:44 +0000 (10:51 +0100)
belt-slot-cut-jig.scad

index 09bec4a..ee51907 100644 (file)
@@ -119,6 +119,21 @@ module CrewPunch(){
   }
 }
 
   }
 }
 
+module MaybeRoundedCube(sizes, roundedness){
+  if (roundedness > 0) {
+    translate([roundedness, roundedness, 0]){
+      minkowski(){
+       cube([sizes[0] - roundedness*2,
+             sizes[1] - roundedness*2,
+             sizes[2]]);
+       cylinder(h=0.05, r=roundedness, $fn=20);
+      }
+    }
+  } else {
+    cube(sizes);
+  }
+}
+
 module PunchHolder(cutouts=true){
     difference(){
       translate([-holder_xsz/2, holder_block_min_y, 0])
 module PunchHolder(cutouts=true){
     difference(){
       translate([-holder_xsz/2, holder_block_min_y, 0])