Nut and Bolt Cutouts M2 + M3 (OpenSCAD Library)
Please see the GitHub repository.
Nut and Bolt Cutouts
This library provides printable profiles of nuts and bolts. Currently, it includes M2 and M3 profiles.
The tolerance and part constants are based on empirical measurements from a digital caliper, using machine head metric nuts/screws/bolts, and from prints on my QIDI printer with various ABS filaments.
A calibration object for tuning this to your hardware is included as MetricCalibrationPlate.scad.
In my case, I have found that a tolerance (extra space around edges of profiles) of 0.1 millimeters results in tight fitting parts that aren't difficult to insert, and 0.2 millimeters results in a loose fitting part.
Usage
The intended usage is to use this library for difference cutouts:
use <Metric/M3.scad>;$fs = 0.5;$fa = 2;w = 10;h = 10;difference() { translate([-w/2, -w/2, -h]) cube([w, w, h]); BoltM3(l=15);}
Inset
By default, all parts have their origin extending in the negative Z direction, with the head of the part at [0, 0, 0]. You can place the head above the X-Y plane by specifying the optional parameter inset=0
use <Metric/M3.scad>;$fs = 0.5;$fa = 2;w = 10;h = 10;difference() { translate([-w/2, -w/2, -h]) cube([w, w, h]); BoltM3(l=15, inset=0);}
Parts
use <Metric/M3.scad>;use <Metric/M2.scad>;$fs = 0.5;$fa = 2;BoltM3();translate([0, -10, 0])NutM3();translate([10, 0, 0])BoltM2();translate([10, -10, 0])NutM2();Inset

No Inset
