diff --git a/joiners.scad b/joiners.scad index 0acc998..6af8c8e 100644 --- a/joiners.scad +++ b/joiners.scad @@ -1224,7 +1224,7 @@ module rabbit_clip(type, length, width, snap, thickness, depth, compression=0.1 // Module: hirth() // Usage: -// hirth(n, ir|id=, or|od=, tooth_angle, [cone_angle=], [chamfer=], [base=], [crop=], [anchor=], [spin=], [orient=] +// hirth(n, ir|id=, or|od=, tooth_angle, [cone_angle=], [chamfer=], [rounding=], [base=], [crop=], [anchor=], [spin=], [orient=] // Description: // Create a Hirth face spline. The Hirth face spline is a joint that locks together two cylinders using radially // positioned triangular teeth on the ends of the cylinders. If the joint is held together (e.g. with a screw) then @@ -1256,22 +1256,27 @@ module rabbit_clip(type, length, width, snap, thickness, depth, compression=0.1 // or/od = outer radius or diameter // tooth_angle = nominal tooth angle. Default: 60 // cone_angle = raise or lower the angle of the teeth in the radial direction. Default: 0 -// chamfer = chamfer teeth by this fraction at tips and half this fraction at valleys. Default: 0.05 +// chamfer = chamfer teeth by this fraction at tips and half this fraction at valleys. Default: 0 +// roudning = round the teeth by this fraction at the tips, and half this fraction at valleys. Default: 0 // base = add base of this height to the bottom. Default: 1 // crop = crop to a cylindrical shape. Default: false // anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER` // spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0` // orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP` // Example: Basic uncropped hirth spline -// hirth(32,20,50, tooth_angle=60,chamfer=.05); +// hirth(32,20,50); // Example: Raise cone angle -// hirth(32,20,50, tooth_angle=60,cone_angle=30,chamfer=.05); +// hirth(32,20,50,cone_angle=30); // Example: Lower cone angle -// hirth(32,20,50, tooth_angle=60,cone_angle=-30,chamfer=.05); -// Example: Only 8 teeth +// hirth(32,20,50 cone_angle=-30); +// Example: Only 8 teeth, with chamfering // hirth(8,20,50, tooth_angle=60,base=10,chamfer=.05); // Example: Only 8 teeth, cropped // hirth(8,20,50, tooth_angle=60,base=10,chamfer=.05, crop=true); +// Example: Only 8 teeth, with rounding +// hirth(8,20,50, tooth_angle=60,base=10,rounding=.05); +// Example: Only 8 teeth, different tooth angle, cropping with $fn to crop cylinder aligned with teeth +// hirth(8,20,50, tooth_angle=90,base=10,rounding=.05,crop=true,$fn=48); // Example: Two identical parts joined together (with 1 unit offset to reveal the joint line). With odd tooth count you can use the CENTER anchor for the child and the teeth line up correctly. // hirth(27,20,50, tooth_angle=60,base=2,chamfer=.05) // up(1) attach(CENTER,CENTER) @@ -1281,103 +1286,81 @@ module rabbit_clip(type, length, width, snap, thickness, depth, compression=0.1 // up(1) attach(CENTER,"mate") // hirth(26,20,50, tooth_angle=60,base=2,cone_angle=-30, chamfer=.05); -module hirth(n, ir, or, id, od, tooth_angle=60, cone_angle=0, chamfer=0.05, base=1, crop=false, orient,anchor,spin) +module hirth(n, ir, or, id, od, tooth_angle=60, cone_angle=0, chamfer, rounding, base=1, crop=false, orient,anchor,spin) { ir = get_radius(r=ir,d=id); or = get_radius(r=or,d=od); dummy = assert(all_positive([ir]), "ir/id must be a positive value") - assert(all_positive([or]), "or/od must be a positive value") + assert(all_positive([or]), "or/od must be a positive value") + assert(is_int(n) && n>1, "n must be an integer larger than 1") assert(ir