From b9864fe491562b0831bd2c7d516fb2dc407f092e Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Fri, 4 Jul 2025 23:39:22 -0700 Subject: [PATCH 1/4] Add insertion_mask_slide to dovetail() module insertion_mask_slide creates a space for the male dovetail to enter tangential to the sliding direction of the joint. It's part of dovetail() because computing the actual cross-section needed involves $slop and slope/angle and taper/back_width and width and height... so it's a lot simpler to add it in to the existing module. --- joiners.scad | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/joiners.scad b/joiners.scad index 900a1c08..63ebdf6a 100644 --- a/joiners.scad +++ b/joiners.scad @@ -559,7 +559,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // See Also: joiner(), snap_pin(), rabbit_clip(), partition(), partition_mask(), partition_cut_mask() // // Usage: -// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [$slop=]) +// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [insertion_mask_slide=], [$slop=]) // // Description: // Produces a possibly tapered dovetail joint shape to attach to or subtract from two parts you wish to join together. @@ -569,9 +569,13 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // parallel to the Y axis and projecting upwards, so in its default orientation it will slide together with a translation // in the positive Y direction. The gender determines whether the shape is meant to be added to your model or // differenced, and it also changes the anchor and orientation. The default anchor for dovetails is BOTTOM; -// the default orientation depends on the gender, with male dovetails oriented UP and female ones DOWN. The dovetails by default -// have extra extension of 0.01 for unions and differences. You should ensure that attachment is done with overlap=0 to ensure that -// the sizing and positioning is correct. To adjust the fit, use the $slop variable, which increases the depth and width of +// the default orientation depends on the gender, with male dovetails oriented UP and female ones DOWN. For a male +// untapered dovetail of length X to slide into a female dovetail, there must be at least X open space past the +// end of the dovetail; setting insertion_mask_slide to X will add a mask sticking out X forward to provide it. +// . +// The dovetails by default have extra extension of 0.01 for unions and differences. +// You should ensure that attachment is done with overlap=0 to ensure +// sizing and positioning is correct. To adjust the fit, use the $slop variable, which increases the depth and width of // the female part of the joint to allow a clearance gap of $slop on each of the three sides. // // Arguments: @@ -589,6 +593,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // round = true to round both corners of the dovetail and give it a puzzle piece look. Default: false. // $slop = Increase the width of socket by double this amount and depth by this amount to allow adjustment of the fit. // extra = amount of extra length and base extension added to dovetails for unions and differences. Default: 0.01 +// insertion_mask_slide = length of a mask of sufficient width and depth for a male dovetail to fit ahead of the female dovetail. Ignored when gender == "male". // Example: Ordinary straight dovetail, male version (sticking up) and female version (below the xy plane) // dovetail("male", width=15, height=8, slide=30); // right(20) dovetail("female", width=15, height=8, slide=30); @@ -640,8 +645,11 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // diff("remove") // cuboid([50,30,10]) // tag("remove")position(TOP+BACK) xcopies(10,5) dovetail("female", slide=10, width=7, taper=4, height=4, anchor=BOTTOM+FRONT,spin=180); -function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); -module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, r, radius, round=false, anchor=BOTTOM, spin=0, orient) +// Example: Blind housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the insertion opening, then slid backward, making a 40x40x20 cube with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble; with tapered dovetails, it's sometimes possible to make it shorter than the length (slide) of the male dovetail. +// left(30) cuboid([10,40,40]) fwd(5) attach(RIGHT,BOT,align=BACK,spin=90) dovetail("male", slide=15, width=20, height=8, slope=2); +// right(30) diff() cuboid([40,40,10]) fwd(5) attach(TOP,BOT,align=BACK,inside=true) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, insertion_mask_slide=17); +function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); +module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) { radius = get_radius(r1=radius,r2=r); slide = one_defined([slide,thickness],"slide,thickness"); @@ -730,7 +738,7 @@ module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, tap reverse(concat(smallend_points, xflip(p=reverse(smallend_points)))) ], slices=0, convexity=4 - ); + ) if(insertion_mask_slide>0 && gender=="female") align(FWD,TOP) cuboid([width-2*extra_offset,insertion_mask_slide,height]); } children(); } From d259cc80717d5baa74ba23301d73d5a88bfd946a Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Fri, 4 Jul 2025 23:50:05 -0700 Subject: [PATCH 2/4] use inset= from attach() instead of fwd() new to me --- joiners.scad | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/joiners.scad b/joiners.scad index 63ebdf6a..930ecb1a 100644 --- a/joiners.scad +++ b/joiners.scad @@ -646,8 +646,8 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // cuboid([50,30,10]) // tag("remove")position(TOP+BACK) xcopies(10,5) dovetail("female", slide=10, width=7, taper=4, height=4, anchor=BOTTOM+FRONT,spin=180); // Example: Blind housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the insertion opening, then slid backward, making a 40x40x20 cube with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble; with tapered dovetails, it's sometimes possible to make it shorter than the length (slide) of the male dovetail. -// left(30) cuboid([10,40,40]) fwd(5) attach(RIGHT,BOT,align=BACK,spin=90) dovetail("male", slide=15, width=20, height=8, slope=2); -// right(30) diff() cuboid([40,40,10]) fwd(5) attach(TOP,BOT,align=BACK,inside=true) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, insertion_mask_slide=17); +// left(30) cuboid([10,40,40]) attach(RIGHT,BOT,align=BACK,spin=90,inset=5) dovetail("male", slide=15, width=20, height=8, slope=2); +// right(30) diff() cuboid([40,40,10]) attach(TOP,BOT,align=BACK,inside=true,inset=5) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, insertion_mask_slide=17); function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) { From 2f76524a7786a41a13779923688fb248f8323fa5 Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Tue, 15 Jul 2025 14:59:14 -0700 Subject: [PATCH 3/4] Rename to use "escapement" instead of "insertion_mask" --- joiners.scad | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/joiners.scad b/joiners.scad index 930ecb1a..6835dc19 100644 --- a/joiners.scad +++ b/joiners.scad @@ -559,7 +559,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // See Also: joiner(), snap_pin(), rabbit_clip(), partition(), partition_mask(), partition_cut_mask() // // Usage: -// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [insertion_mask_slide=], [$slop=]) +// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [escapement_length=], [$slop=]) // // Description: // Produces a possibly tapered dovetail joint shape to attach to or subtract from two parts you wish to join together. @@ -571,7 +571,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // differenced, and it also changes the anchor and orientation. The default anchor for dovetails is BOTTOM; // the default orientation depends on the gender, with male dovetails oriented UP and female ones DOWN. For a male // untapered dovetail of length X to slide into a female dovetail, there must be at least X open space past the -// end of the dovetail; setting insertion_mask_slide to X will add a mask sticking out X forward to provide it. +// end of the dovetail; setting escapement_length to X will add a mask sticking out X forward to provide it. // . // The dovetails by default have extra extension of 0.01 for unions and differences. // You should ensure that attachment is done with overlap=0 to ensure @@ -593,7 +593,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // round = true to round both corners of the dovetail and give it a puzzle piece look. Default: false. // $slop = Increase the width of socket by double this amount and depth by this amount to allow adjustment of the fit. // extra = amount of extra length and base extension added to dovetails for unions and differences. Default: 0.01 -// insertion_mask_slide = length of a mask of sufficient width and depth for a male dovetail to fit ahead of the female dovetail. Ignored when gender == "male". +// escapement_length = length of a mask of sufficient width and depth for a male dovetail to fit ahead of the female dovetail. Ignored when gender == "male". // Example: Ordinary straight dovetail, male version (sticking up) and female version (below the xy plane) // dovetail("male", width=15, height=8, slide=30); // right(20) dovetail("female", width=15, height=8, slide=30); @@ -645,11 +645,11 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // diff("remove") // cuboid([50,30,10]) // tag("remove")position(TOP+BACK) xcopies(10,5) dovetail("female", slide=10, width=7, taper=4, height=4, anchor=BOTTOM+FRONT,spin=180); -// Example: Blind housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the insertion opening, then slid backward, making a 40x40x20 cube with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble; with tapered dovetails, it's sometimes possible to make it shorter than the length (slide) of the male dovetail. +// Example: Housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the escapement, then slid backward, making a 40x40x20 cuboid with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble. // left(30) cuboid([10,40,40]) attach(RIGHT,BOT,align=BACK,spin=90,inset=5) dovetail("male", slide=15, width=20, height=8, slope=2); -// right(30) diff() cuboid([40,40,10]) attach(TOP,BOT,align=BACK,inside=true,inset=5) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, insertion_mask_slide=17); -function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); -module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, insertion_mask_slide=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) +// right(30) diff() cuboid([40,40,10]) attach(TOP,BOT,align=BACK,inside=true,inset=5) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, escapement_length=17); +function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, escapement_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); +module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, escapement_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) { radius = get_radius(r1=radius,r2=r); slide = one_defined([slide,thickness],"slide,thickness"); @@ -738,7 +738,7 @@ module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, tap reverse(concat(smallend_points, xflip(p=reverse(smallend_points)))) ], slices=0, convexity=4 - ) if(insertion_mask_slide>0 && gender=="female") align(FWD,TOP) cuboid([width-2*extra_offset,insertion_mask_slide,height]); + ) if(escapement_length>0 && gender=="female") align(FWD,TOP) cuboid([width-2*extra_offset,escapement_length,height]); } children(); } From 78e5e41a9908e9ec34ed1e0449213819fff962db Mon Sep 17 00:00:00 2001 From: Cory Cross Date: Tue, 15 Jul 2025 19:19:45 -0700 Subject: [PATCH 4/4] Rename to entry_slot_length and add get_slop() to it Should have always had get_slop(). --- joiners.scad | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/joiners.scad b/joiners.scad index 6835dc19..5cf42d10 100644 --- a/joiners.scad +++ b/joiners.scad @@ -559,7 +559,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // See Also: joiner(), snap_pin(), rabbit_clip(), partition(), partition_mask(), partition_cut_mask() // // Usage: -// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [escapement_length=], [$slop=]) +// dovetail(gender, w=|width, h=|height, slide|thickness=, [slope=|angle=], [taper=|back_width=], [chamfer=], [r=|radius=], [round=], [extra=], [entry_slot_length=], [$slop=]) // // Description: // Produces a possibly tapered dovetail joint shape to attach to or subtract from two parts you wish to join together. @@ -570,8 +570,8 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // in the positive Y direction. The gender determines whether the shape is meant to be added to your model or // differenced, and it also changes the anchor and orientation. The default anchor for dovetails is BOTTOM; // the default orientation depends on the gender, with male dovetails oriented UP and female ones DOWN. For a male -// untapered dovetail of length X to slide into a female dovetail, there must be at least X open space past the -// end of the dovetail; setting escapement_length to X will add a mask sticking out X forward to provide it. +// untapered dovetail of length X to slide into a female dovetail, there must be at least X free space past the +// end of the dovetail; setting entry_slot_length to X will add a mask sticking out X forward to provide it. // . // The dovetails by default have extra extension of 0.01 for unions and differences. // You should ensure that attachment is done with overlap=0 to ensure @@ -593,7 +593,7 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // round = true to round both corners of the dovetail and give it a puzzle piece look. Default: false. // $slop = Increase the width of socket by double this amount and depth by this amount to allow adjustment of the fit. // extra = amount of extra length and base extension added to dovetails for unions and differences. Default: 0.01 -// escapement_length = length of a mask of sufficient width and depth for a male dovetail to fit ahead of the female dovetail. Ignored when gender == "male". +// entry_slot_length = length of a mask of sufficient width and depth for a male dovetail to fit ahead of the female dovetail. Ignored when gender == "male". // Example: Ordinary straight dovetail, male version (sticking up) and female version (below the xy plane) // dovetail("male", width=15, height=8, slide=30); // right(20) dovetail("female", width=15, height=8, slide=30); @@ -645,11 +645,11 @@ module joiner(l=40, w=10, base=10, ang=30, screwsize, anchor=CENTER, spin=0, ori // diff("remove") // cuboid([50,30,10]) // tag("remove")position(TOP+BACK) xcopies(10,5) dovetail("female", slide=10, width=7, taper=4, height=4, anchor=BOTTOM+FRONT,spin=180); -// Example: Housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the escapement, then slid backward, making a 40x40x20 cuboid with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble. +// Example: Housed sliding dovetail (similar to okuri ari). If the left piece is rotated 90 degrees clockwise, it can be inserted downward with the male dovetail entering the entry slot, then slid backward, making a 40x40x20 cuboid with no visible connectors. In this case, the opening is made slightly longer than the male dovetail (17 vs 15) so it's easier to assemble. // left(30) cuboid([10,40,40]) attach(RIGHT,BOT,align=BACK,spin=90,inset=5) dovetail("male", slide=15, width=20, height=8, slope=2); -// right(30) diff() cuboid([40,40,10]) attach(TOP,BOT,align=BACK,inside=true,inset=5) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, escapement_length=17); -function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, escapement_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); -module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, escapement_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) +// right(30) diff() cuboid([40,40,10]) attach(TOP,BOT,align=BACK,inside=true,inset=5) tag("remove") dovetail("female", slide=15, width=20, height=8, slope=2, entry_slot_length=17); +function dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, entry_slot_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) = no_function("dovetail"); +module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, taper, back_width, chamfer, extra=0.01, entry_slot_length=0, r, radius, round=false, anchor=BOTTOM, spin=0, orient) { radius = get_radius(r1=radius,r2=r); slide = one_defined([slide,thickness],"slide,thickness"); @@ -738,7 +738,7 @@ module dovetail(gender, width, height, slide, h, w, angle, slope, thickness, tap reverse(concat(smallend_points, xflip(p=reverse(smallend_points)))) ], slices=0, convexity=4 - ) if(escapement_length>0 && gender=="female") align(FWD,TOP) cuboid([width-2*extra_offset,escapement_length,height]); + ) if(entry_slot_length>0 && gender=="female") align(FWD,TOP) cuboid([width-2*extra_offset,entry_slot_length+get_slop(),height]); } children(); }