=====start documentation=====
Create nuts, bolts, washers, tslots
This library was created to make adding nuts and bolts to 3D and 2D designs easier. The library provides features for making cut-outs for captive nuts and washers, bolt holes and t-slot joints. Check the documentation below for more information.
Aaron Ciuffo - http://www.thingiverse.com/txoof/about,
Reach me also at gmail: aaron.ciuffo
These fasteners are close aproximations to the ISO standards, but in many cases are fudged. Most notably the thread algorithm is not at all ISO compliant.
Latest version available on GitHub
Revision of http://www.thingiverse.com/thing:1220331
Thanks to:
How To Use:
Available Nut, Bolt, Washer array sets:
- metric_fasteners (alias: m)
demo(text = true/false);
show most of the the features
- text = true/false - add descriptive text
tSlotDemo();
demonstrate a t-slot joint with a bolt
- for a working example of t-slot consturction see this box built with t-slots
bolt(size = fastener_type[index], head = "<type>", length = N*, threadType = "type", quality = N, tolerance = R, list = true/false, center = true/false, v = true/false);
draw a predefined bolt from fastener_type array
- size = metric_fastener[index] - see the fastener_type array below
- head = "button", "hex", "flatSocket"/"flatHead", "conical", "socket", "grub"/"set"
- length = thread length - *in the case of a flat-head socket, the TOTAL length
- threadType = "metric", "none"
- quality = N - N = number of curve segments (integer)
- tolerance = R - R = amount to increase/decrease all dimensions other than length
- list = true/false - list the available types
- center = true/false - center the length of the THREADS excluding head
- v = true/false - verbose echo for debugging
Examples:
//M4 x 15mm
bolt(size = metric_fastner[4], length = 15);
//M3 x 6 No thread
bolt(size = metric_fastener[3], length = 6, threadType = "none");
nut(size = fastener_type[index], threadType = thread type, quality = N, list = false, quality = N, center = false, v = false);
draw a predefined nut from fastener_type array
- size = metric_fastener[index] - see the fastener_type array below
- default: M3
- quality = N - N = number of curve segments (integer)
- default: 32
- center = true/false - center the object
- v = true/false - verbose echo for debugging
Examples:
//M4 Nut
nut(metric_fastener[4]);
//M3 Nut - low resolution
nut(metric_fastener[4], quality = 15);
washer(size =fastener_type[index] , quality = N, , tolerance = R, quality = N, center = false, v = false)
draw a predefined washer from fastener_type array
- size = metric_fastener[index] - see the fastener_type array below
- quality = N - N = number of curve segments (integer)
- tolerance = R - total amount to add or subtract from the washer dimensions
- center = true/false - center the length of the THREADS excluding head
- v = true/false - verbose echo for debugging
Examples:
//M10 washer
washer(metric_fastener[10]);
//M3 washer, +0.4 tolerance
washer(metric_fastener[3], tolerance = 0.4);
boltHole(size = fastener_type[index], length = N, quality = N, tolerance = R, quality =N, 2d = true/false, center = true/false, v = true/false)
draw a predefined bolt hole from fastener_type array
- size = metric_fastener[index] + tolerance - see the fastener_type array below
- length = N - N = length of bolt hole
- quality = N - N = number of curve segments (integer)
- tolerance = R - total amount to add or subtract from the washer dimensions
- quality = N - N = number of curve segments (integer)
- 2d = true/false - true for working with 2 dimensional objects
- center = true/false - center the length of the THREADS excluding head
- v = true/false - verbose echo for debugging
Examples:
//M3 hole +0.3 tolerance through 3mm material
mat = 10;
thick = 3;
difference() {
cube([mat, mat, thick], center = true);
#boltHole(size = metric_fastener[3], tolerance = 0.3, center = true);
}
nutHole(size = fastener_type[index], tolerance = R, 2d = true/false, center = true/false, v = true/false);
draw a predefined nut for making negative spaces based on fastener_type array
- this is useful for creating spaces for captive nuts
- size = metric_fastener[index] - see the fastener_type array below
- default: M3
- tolerance = R - total amount to add or subtract from the nut dimensions
- default: 0.2
- 2d = true/false - true for working with 2 dimensional objectsa
- default: false
- center = true/false - center the object
- v = true/false - verbose echo for debugging
Examples:
//M2 Nut hole in 3mm material with +0.7 tolerance
mat = 10;
thick = 3;
nutThick = 2.09; //the nut thicknes can be found using the v = true option
difference() {
cube([mat, mat, thick], center = true);
translate([0, 0, thick/2-nutThick])
nutHole(size = metric_fastener[2], tolerance = 0.7, v = true);
}
color("silver")
translate([0, 0, thick/2 - 1.6/2])
nut(metric_fastener[2], v = true, center = true);
washerHole(size = fastener_type[index], tolerance = R, 2d = true/false, center = true/false, v = true/false);
draw a predefined washer for making negative spaces based on fastener_type array
- this is useful for creating spaces for captive washers
- size = metric_fastener[index] - see the fastener_type array below
- default: M3
- tolerance = R - total amount to add or subtract from the washer dimensions
- default: 0.2
- quality = N - N = number of curve segments (integer)
- default: 24
- 2d = true/false - true for working with 2 dimensional objects
- default: false
- center = true/false - center the object
- v = true/false - verbose echo for debugging
tSlot(size = fastener_type[index], material = N, length = N, tolerance = R, node = P, 2d = true/false, v = true/false);
draw a T-Slot for making cutouts using CNC or laser cutter
- T-Slot example: https://planiverse.wordpress.com/2014/04/07/construction-technique-tab-and-slot-with-t-nut/
- size = metric_fastener[index] - see the fastener_type array belowa
- material = N - thickness of material the bolt goes through (see the demo)
- length = N - length of bolt
- tolerance = R - total amount to add or subtract from the nut dimensions
- node = P - node size as percentage of nut thickness
- 2d = true/false - true for working with 2 dimensional objects
tSlotBolt(size = fastner_type[index], length = N, head = "head type", threadType = "type", quality = N, v = true/false);
draw a bolt with a nut attached in appropriate position for a tSlot
- This is useful for visualizing the tSlot placement
- size = metric_fastener[index] - see the fastener_type array below
- default: M3
- length = N - length of bolt
- default: 10
- head = "head type" - socket, hex, conical, set, flatHead (try list = true to see all types)
- default: socket
- threadType = "thread type" - metric, none (try list = true to see all types)
- default: none
- quality = N - N = number of curve segments (integer); if quality is set < 24 simpler forms of bolts will be used
- default: 24
- v = true/false - verbose echo for debugging
list_types(fastener_type);
List all available sizes within a fasnter type
-
array_name = predefined array containing bolt information in metric
list_types(metric_fastener);
Output is as follows:
ECHO: "name: M1 - UNDEFINED"
ECHO: "array_index[1]"
ECHO: "============================="
ECHO: "name: M2 Bolt, Nut & Washer"
ECHO: "array_index[2]"
ECHO: " [1] thread diameter: 2"
ECHO: " [2] hex head thickess: 2"
ECHO: " [3] hex head & nut size: 4"
ECHO: " [4] socket head diameter: 3.5"
ECHO: " [5] socket head thickness: 2"
ECHO: " [6] socket tool size: 1.5"
ECHO: " [7] nut thickness,: 1.6"
ECHO: " [8] pitch: 0.4"
ECHO: " [9] washer thickness: 0.3"
ECHO: " [10] washer diameter: 5.5"
ECHO: "============================="
fastener_type array
predefined array of fastener sizes based on ISO threads
- array is zero-indexed; element[0] contains human readable descriptions
- measurements based on the following sources:
- elements are arranged in increasing size
- for metric sizes, M3 is indexed [3], M4 is indexed [4], etc.
array descriptors