Skip to content

Commit a4ef166

Browse files
committed
Change threading and screws to use 2*$slop
Per [my argument](BelfrySCAD#1679 (comment)), I believe this is the proper method. There is only one mating surface for each radius, so by following the documentation for `$slop`, we should only be adding one `$slop` for radius and not two.
1 parent b506db9 commit a4ef166

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

screws.scad

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ module screw(spec, head, drive, thread, drive_size,
593593
assert(is_undef(user_thread_len) || (is_finite(user_thread_len) && user_thread_len>=0), "Must specify nonnegative thread length");
594594
sides = max(pitch==0 ? 3 : 12, segs(nominal_diam/2));
595595
rad_scale = _internal? (1/cos(180/sides)) : 1;
596-
islop = _internal ? 4*get_slop() : 0;
596+
islop = _internal ? 2*get_slop() : 0;
597597
head_height = headless || flathead ? 0
598598
: counterbore==true || is_undef(counterbore) || counterbore==0 ? struct_val(spec, "head_height")
599599
: counterbore;
@@ -746,7 +746,7 @@ module screw(spec, head, drive, thread, drive_size,
746746
// The screw hole can be threaded to receive a screw or it can be an unthreaded clearance hole.
747747
// The tolerance determines the dimensions of the screw
748748
// based on ISO and ASME standards. Screws fabricated at those dimensions will mate properly with standard hardware.
749-
// The $slop argument makes the hole larger by 4*$slop to account for printing overextrusion. It defaults to 0.
749+
// The $slop argument makes the hole larger by 2*$slop to account for printing overextrusion. It defaults to 0.
750750
// .
751751
// You can generate a screw specification from {{screw_info()}}, possibly create a modified version, and pass that in rather than giving the parameters.
752752
// .

threading.scad

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@
174174
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
175175
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
176176
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
177-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
177+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
178178
// Example(2D):
179179
// projection(cut=true)
180180
// threaded_rod(d=10, l=15, pitch=1.5, orient=BACK);
@@ -327,7 +327,7 @@ module threaded_rod(
327327
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
328328
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
329329
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
330-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
330+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
331331
// Examples(Med):
332332
// threaded_nut(nutwidth=16, id=8, h=8, pitch=1.25, $slop=0.05, $fa=1, $fs=1);
333333
// threaded_nut(nutwidth=16, id=8, h=8, pitch=1.25, left_handed=true, bevel=false, $slop=0.1, $fa=1, $fs=1);
@@ -500,7 +500,7 @@ module threaded_nut(
500500
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
501501
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
502502
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
503-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
503+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
504504
// Example(2D):
505505
// projection(cut=true)
506506
// trapezoidal_threaded_rod(d=10, l=15, pitch=2, orient=BACK);
@@ -647,7 +647,7 @@ module trapezoidal_threaded_rod(
647647
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
648648
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
649649
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
650-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
650+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
651651
// Examples(Med):
652652
// trapezoidal_threaded_nut(nutwidth=16, id=8, h=8, pitch=2, $slop=0.1, anchor=UP);
653653
// trapezoidal_threaded_nut(nutwidth=16, id=8, h=8, pitch=2, bevel=false, $slop=0.05, anchor=UP);
@@ -769,7 +769,7 @@ module trapezoidal_threaded_nut(
769769
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
770770
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
771771
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
772-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
772+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
773773
// Example(2D):
774774
// projection(cut=true)
775775
// acme_threaded_rod(d=10, l=15, pitch=2, orient=BACK);
@@ -881,7 +881,7 @@ module acme_threaded_rod(
881881
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
882882
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
883883
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
884-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
884+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
885885
// Examples(Med):
886886
// acme_threaded_nut(nutwidth=16, id=3/8*INCH, h=8, tpi=8, $slop=0.05);
887887
// acme_threaded_nut(nutwidth=16, id=3/8*INCH, h=10, tpi=12, starts=3, $slop=0.1, $fa=1, $fs=1, ibevel=false);
@@ -968,7 +968,7 @@ module acme_threaded_nut(
968968
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
969969
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
970970
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
971-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
971+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
972972
// Example(2D): The straight gray rectangle reveals the tapered threads.
973973
// projection(cut=true) npt_threaded_rod(size=1/4, orient=BACK);
974974
// right(.533*INCH/2) color("gray") rect([2,0.5946*INCH],anchor=LEFT);
@@ -1108,7 +1108,7 @@ module npt_threaded_rod(
11081108
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
11091109
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
11101110
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1111-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1111+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
11121112
// Example(2D):
11131113
// projection(cut=true)
11141114
// buttress_threaded_rod(d=10, l=15, pitch=2, orient=BACK);
@@ -1223,7 +1223,7 @@ module buttress_threaded_rod(
12231223
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
12241224
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
12251225
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1226-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1226+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
12271227
// Examples(Med):
12281228
// buttress_threaded_nut(nutwidth=16, id=8, h=8, pitch=1.25, left_handed=true, $slop=0.05, $fa=1, $fs=1);
12291229
function buttress_threaded_nut(
@@ -1324,7 +1324,7 @@ module buttress_threaded_nut(
13241324
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
13251325
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
13261326
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1327-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1327+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
13281328
// Example(2D):
13291329
// projection(cut=true)
13301330
// square_threaded_rod(d=10, l=15, pitch=2, orient=BACK);
@@ -1432,7 +1432,7 @@ module square_threaded_rod(
14321432
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
14331433
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
14341434
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1435-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1435+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
14361436
// Examples(Med):
14371437
// square_threaded_nut(nutwidth=16, id=10, h=10, pitch=2, starts=2, $slop=0.1, $fn=32);
14381438
function square_threaded_nut(
@@ -1527,7 +1527,7 @@ module square_threaded_nut(
15271527
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
15281528
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
15291529
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1530-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1530+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
15311531
// Example(2D): Thread Profile, ball_diam=4, ball_arc=100
15321532
// projection(cut=true) ball_screw_rod(d=10, l=15, pitch=5, ball_diam=4, ball_arc=100, orient=BACK, $fn=24, blunt_start=false);
15331533
// Example(2D): Thread Profile, ball_diam=4, ball_arc=120
@@ -1616,8 +1616,8 @@ module ball_screw_rod(
16161616
// .
16171617
// If internal is true then produce a thread mask to difference from an object. When internal is true the rod
16181618
// diameter is enlarged to correct for the polygonal nature of circles to ensure that the internal diameter is the
1619-
// specified size. The diameter is also increased by `4 * $slop` to create clearance for threading by allowing a `2 *
1620-
// $slop` gap on each side. If bevel is set to true and internal is false then the ends of the rod will be beveled.
1619+
// specified size. The diameter is also increased by `2 * $slop` to create clearance for threading by allowing a
1620+
// `$slop` gap on each side. If bevel is set to true and internal is false then the ends of the rod will be beveled.
16211621
// When bevel is true and internal is true the ends of the rod will be filled in so that the rod mask will create a
16221622
// bevel when subtracted from an object. The bevel is at 45 deg and is the depth of the threads.
16231623
// .
@@ -1661,7 +1661,7 @@ module ball_screw_rod(
16611661
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
16621662
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
16631663
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
1664-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
1664+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
16651665
// Example(2DMed): Example Tooth Profile
16661666
// pitch = 2;
16671667
// depth = pitch * cos(30) * 5/8;
@@ -1741,7 +1741,7 @@ module generic_threaded_rod(
17411741
assert(is_undef(bevel2) || is_num(bevel2) || is_bool(bevel2) || bevel2=="reverse", "bevel2/bevel must be a number, boolean or \"reverse\"");
17421742
sides = quantup(segs(max(r1,r2)), starts);
17431743
rsc = internal? (1/cos(180/sides)) : 1; // Internal radius adjusted for faceting
1744-
islop = internal? 2*get_slop() : 0;
1744+
islop = internal? get_slop() : 0;
17451745
r1adj = r1 * rsc + islop;
17461746
r2adj = r2 * rsc + islop;
17471747

@@ -2004,7 +2004,7 @@ module generic_threaded_rod(
20042004
// anchor = Translate so anchor point is at origin (0,0,0). See [anchor](attachments.scad#subsection-anchor). Default: `CENTER`
20052005
// spin = Rotate this many degrees around the Z axis after anchor. See [spin](attachments.scad#subsection-spin). Default: `0`
20062006
// orient = Vector to rotate top towards, after spin. See [orient](attachments.scad#subsection-orient). Default: `UP`
2007-
// $slop = The printer-specific slop value, which adds clearance (`4*$slop`) to internal threads.
2007+
// $slop = The printer-specific slop value, which adds clearance (`2*$slop`) to internal threads.
20082008
function generic_threaded_nut(
20092009
nutwidth,
20102010
id,
@@ -2068,7 +2068,7 @@ module generic_threaded_nut(
20682068
difference() {
20692069
_nutshape(nutwidth,h, shape,bevel1,bevel2);
20702070
if (pitch==0)
2071-
cyl(l=h+extra, d1=full_id1+4*get_slop(), d2=full_id2+4*get_slop(),
2071+
cyl(l=h+extra, d1=full_id1+2*get_slop(), d2=full_id2+2*get_slop(),
20722072
chamfer1=ibevel1?-IBEV*full_id1:undef,
20732073
chamfer2=ibevel2?-IBEV*full_id2:undef);
20742074
else

0 commit comments

Comments
 (0)