txoof / OpenSCAD_fasteners

21 stars 7 forks source link

=====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:

demo(text = true/false);

show most of the the features

tSlotDemo();

demonstrate a t-slot joint with a bolt

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

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

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

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

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

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

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

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

list_types(fastener_type);

List all available sizes within a fasnter type

fastener_type array

predefined array of fastener sizes based on ISO threads

array descriptors