+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){
+ roundedness = cutouts ? holder_corner_round : 0;
+ difference(){
+ translate([-holder_xsz/2, holder_block_min_y, 0])
+ MaybeRoundedCube([holder_xsz,
+ holder_max_y - holder_block_min_y,
+ holder_block_zsz],
+ roundedness);
+ if (cutouts)
+ rotate([0,0,-crewpunch_skew_angle])
+ translate([punch_dx,
+ punch_dy,
+ -crewpunch_smallest_shape[0]])
+ CrewPunch();
+ }
+ difference(){
+ translate([-holder_attach_xsz/2, holder_all_min_y, 0])
+ MaybeRoundedCube([holder_attach_xsz,
+ attach_ysz,
+ holder_block_zsz + punch_travel
+ + holder_ctie_thick + holder_attach_roof + 1],
+ roundedness);
+ if (cutouts)
+ translate([-30,
+ holder_all_min_y + holder_attach_walls,
+ holder_block_zsz + punch_travel])
+ cube([60, holder_ctie_width, holder_ctie_thick]);
+ }
+}
+
+module OneJigCutout(){
+ minkowski(){
+ cube([main_slop*2, main_slop*2, 50], center=true);
+ PunchHolder(false);
+ }
+}
+
+module JigT(){ ////toplevel
+ JigPrint();
+}
+
+module PunchHolderT(){ ////toplevel
+ PunchHolder(true);
+}
+
+module Demo(){ ////toplevel
+ %PunchHolder();
+ Jig();
+}
+
+module Kit(){ ////toplevel
+ JigT();
+ rotate([0,0,-45]){
+ translate([(jig_iters-1)*jig_interval/2,
+ jig_min_y - holder_max_y - 5,
+ 0])
+ PunchHolder();