Skip to content

$slop used incorrectly for threading and screws, or $slop doesn't work at small scales #1679

Open
@coryrc

Description

@coryrc

Describe the bug

Following the $slop calibration does not result in properly-sized holes for #6-32 holes or M7 nuts.

I have a Bambu A1 Mini, using PETG, and am printing some self-tap and clearance holes for #6-32 screws. I have the following diameters:

$slop self-tap dia self-tap measured clearance dia clearance measured
0.00 2.94 unk 3.91 unk
0.04 3.1 ~3.0 unk unk
0.08 unk unk 4.23 3.9
0.22 3.81 3.67 4.79 4.45

In both cases, the calibrated $slop value resulted in holes far too big.

Yesterday I printed the slop tester and calculated 0.22 for slop. Using the raw threading.scad and with a printed M7 buttress thread and $slop = 0.22, I created working nut and screws printed vertically. Some numbers from that print:

$slop nut innermost diameter nut innermost measured
0.00 5.53 unk
0.22 6.38 6.22

However this just happened to work, because the tol_gap for a normal M7 in the screws.scad library would be about 0.8, which is passed to screw() as shaft_undersize=-0.8 so a normal fit would be 6.33mm innermost diameter and setting $slop = 0.22 coincidentally got a working value. (The threading.scad library does not have any tolerance adjustment besides $slop). Had I correctly compensated diameter for fit, then the nut would have been far too large.

This also resulted in holes too big having followed the calibration procedure and applying it.

Code To Reproduce Bug

module clamp_block() {
    diff() cube([1.9,6.5,12],anchor=BOT+RIGHT) {
        position(TOP+RIGHT) cube([2,6.3,1.9], anchor=TOP+LEFT);
        tag("remove") up(tapping_hole_z) position(BOTTOM) screw_hole(screw_info("#6-32"), tolerance="tight", l=10, orient=LEFT, $slop=0.22);
    }
}
module tapping_hole() {
    screw_hole(screw_info("#6-32"), tolerance="self tap", l=10, orient=LEFT, $slop=get_slop()/2);
}

// Has #6-32 Clearance hole
translate([-8.8,1.3,0]) recolor("blue") clamp_block();
// Has #6-32 tapping hole
difference() {
    translate([-5.7,1.3,0]) flatten_block();
    translate([-7,1.3,4]) tapping_hole();
}
// M7x1.0 Buttress-threaded nut
fwd(18.6)
buttress_threaded_nut(nutwidth=10,id=7,h=6,pitch=1,shape="square",orient=DOWN,anchor=BOT, $slop=0.22);

Printed in PETG, 0.2mm layer, 0.4mm nozzle.

Expected behavior

Following the documentation at https://github.com/BelfrySCAD/BOSL2/wiki/screws.scad and https://github.com/BelfrySCAD/BOSL2/wiki/threading.scad should yield holes with the intended diameter, or at least warn when the instructions are incorrect for certain edge cases.

Additional context
Add any other context about the problem here.

  • OpenSCAD Version: 2025.02.19 (git 91070a09f)
  • Other libraries used: BOSL2 master downloaded 2025-2-23 I believe

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions