You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Incorporating findings from Issue BelfrySCAD#1679
Describing why based on the diff on my screen, starting top to bottom:
Removing XY vs Z axis, because the printing direction isn't known for the parts. Even precise CNC machining still has tolerances and I tried to write a simple way of passing that along.
Adding the limitations we talked about in issue BelfrySCAD#1679.
Added some more written examples of where slop should be added. Now that I'm writing this, these would be better as an example.
I can't add a new line to the first "Calibration" line because that'll make a new number. I thought this was good info to add though.
Moved caveat to Limitations section.
Added line about filleting/chamfers now that I made the tester cut off corners, so you can test both ways.
Also fix a typo later in doc
// Synopsis: The slop amount to make printed items fit closely. `0.0` by default.
20
20
// Topics: Constants
21
21
// Description:
22
-
// A number of printers, particularly FDM/FFF printers, tend to be a bit sloppy in their printing.
23
-
// This has made it so that some parts won't fit together without adding a bit of extra slop space.
24
-
// That is what the `$slop` value is for. The value for this will vary from printer to printer.
25
-
// By default, we use a value of 0.00 so that parts should fit exactly for resin and other precision
26
-
// printers. This value is measured in millimeters. When making your own parts, you should add
27
-
// `$slop` to both sides of a hole that another part is to fit snugly into. For a loose fit, add
28
-
// `2*$slop` to each side. This should be done for both X and Y axes. The Z axis will require a
29
-
// slop that depends on your layer height and bridging settings, and hole sizes. We leave that as
30
-
// a more complicated exercise for the user.
22
+
// Engineering drawings always include allowable tolerance. You cannot ask for a 10mm hole and
23
+
// a 10mm cylinder and expect them to always fit together; instead you could say the hole must
24
+
// be _at least_ 10mm and the cylinder must be _no more than_ 10mm and you would expect them to
25
+
// always fit together. `$slop` is currently used [many libraries](https://github.com/search?q=repo%3ABelfrySCAD%2FBOSL2%20get_slop&type=code) to increase hole and internal
26
+
// feature sizes so joiners, partitions, and threaded parts can mate even though 3D printing
27
+
// is imperfect.
28
+
// .
29
+
// Slop has some limitations:
30
+
// 1. Slop generally works for a wide range of shapes and sizes, but problems like bulging corners,
31
+
// shrinkage, arc compensation, under- or over-extrusion, etc. means the ideal value for a large
32
+
// square peg and socket may not be the same as a small cylinder and hole without further
// 2. It only affects "internal" parts. If you were using the `screws.scad` library to produce a
35
+
// bolt intended to mate with a mass-manufactured nut, and your screw is printing smaller than
36
+
// expected, you cannot use `$slop` to help increase the size.
37
+
// 3. For smaller 3d-printed holes, `$slop` becomes inaccurate and varies based on printing
38
+
// orientation. See [issue#1679](https://github.com/BelfrySCAD/BOSL2/issues/1679) for a discussion on this point and a [design you can print](https://github.com/BelfrySCAD/BOSL2/issues/1679#issuecomment-2871104521)
39
+
// to measure the effect. The intended workaround is to pass `$slop` with a customized value as
40
+
// a keyword argument (i.e. `threaded_nut(..., $slop=0.17)`) to any functions or modules
41
+
// creating small internal features or by altering the requested internal diameter.
42
+
// 4. It may vary by printer and material type, along with slicer settings like wall order,
43
+
// seam settings, wall generator, etc.
44
+
// 5. It varies some depending on the final printing orientation. As this information isn't
45
+
// knowable at module instantiation, it's not possible to do better than a single constant.
46
+
// .
47
+
// Your own part libraries should add a single `$slop` to every mating surface. For holes, increase
48
+
// the hole radius by {{get_slop()}} or diameter by `2*`{{get_slop()}}. A shiplap pattern would reduce
49
+
// the tab thickness on only one end by {{get_slop()}} and the overall length by {{get_slop()}}, while
50
+
// a tongue-and-groove joint would increase the size of the groove thickness by `2*`{{get_slop()}}
51
+
// and reduce the overall length by {{get_slop()}}.
31
52
// .
32
53
// Note that the slop value is accessed using the {{get_slop()}} function. This function provides
33
54
// the default value of 0 if you have not set `$slop`. This approach makes it possible for you to
34
55
// set `$slop` in your programs without experiencing peculiar OpenSCAD issues having to do with multiple
35
56
// definitions of the variable. If you write code that uses `$slop` be sure to reference it using {{get_slop()}}.
36
57
// DefineHeader(NumList): Calibration
37
58
// Calibration: To calibrate the `$slop` value for your printer, follow this procedure:
38
-
// Print the Slop Calibration part from the example below.
59
+
// Print the Slop Calibration part from the example below. By default it uses cubes and that usually works well enough, but if you want to test cylinders, then adjust the code as the comments suggest. Suggest using 2 walls, 5% infill, and minimal top/bottom (3/2?) layers to save filament.
39
60
// Take the long block and orient it so the numbers are upright, facing you.
40
61
// Take the plug and orient it so that the arrow points down, facing you.
41
62
// Starting with the hole with the largest number in front of it, insert the small end of the plug into the hole.
// The correct hole should hold the plug when the long block is turned upside-down.
45
66
// The number in front of that hole will indicate the `$slop` value that is ideal for your printer.
46
67
// Remember to set that slop value in your scripts after you include the BOSL2 library: ie: `$slop = 0.15;`
47
-
// .
48
-
// Note that the `$slop` value may be different using different materials even on the same printer.
68
+
// If trying to test the proper `$slop` value for a mating cube and matching socket without any filleting or chamfers, you can turn the plug 180 degrees and follow the above procedure again.
49
69
// Example(3D,Med): Slop Calibration Part.
50
70
// min_slop = 0.00;
51
71
// slop_step = 0.05;
52
-
// holes = 8;
53
-
// holesize = [15,15,15];
54
-
// height = 20;
72
+
// holes = 6;
73
+
// holesize = [10,10,10];
55
74
// gap = 5;
56
75
// l = holes * (holesize.x + gap) + gap;
57
76
// w = holesize.y + 2*gap;
58
77
// h = holesize.z + 5;
78
+
//
79
+
// // To test cylinders instead, comment out the cuboid (add "//" to the beginning) and
80
+
// // remove the comment in front of the cyl in both hole() and plug().
0 commit comments