OpenSCAD Metric Nut, Bolt & Threads Library

Remix of Trevor Moseley's "OpenSCAD ISO metric thread library / functions (updated)", tweaked to work on Ultimaker 2 with Cura.

Maker/DIY

Creative Commons Public Domain Dedication

All rights to this work are waived and you can use it however you please.

Learn more or download attribution tags

Description

This is just a remix of Trevor Moseley's "OpenSCAD ISO metric thread library / functions (updated)", found here: http://www.thingiverse.com/thing:311031.

I just tweaked it to work on Ultimaker 2 and Cura, as Trevor's version seemed to create spaces between model segments and the results would not print correctly. Also, Trevor's version did not seem to match actual steel nuts and bolts.

I calibrated my testing against an M6 nut and several M6 bolts, plus M6 threaded rod. I did not test other sizes. YMMV.

All credit goes to Trevor for his excellent library. It may or may not be exactly metric standard but it (now) is compatible with steel threading and the only OpenSCAD metric library that actually works for me. :)

I have also kept the same licence as it is almost all his code anyway.

(Nuts and bolt ThreadTest example, with an extra cylinder for a smooth shaft provided courtesy of DonMilne (http://umforum.ultimaker.com/index.php?/user/33340-donmilne/).

Materials and methods

- OpenSCAD (2015.03 works, earlier versions might too but are untested.)
- A steel nut and bolt for testing (Optional). :)
- Optimized for Ulitmaker 2 and Cura (2015.02.1), but should also work for other printers and slicers.
- Printed on Cura's Normal quick profile. (0.1mm layers, 0.8mm shells, 0.6mm top/bottom, 20% infill, <50mm/s effectively.)

Documents

Issues

Issues are used to track todos, bugs or requests. To get started, you could create an issue.

Comments

5ecd4ebbd6c5bbd870d7b2ef24aa55c3?default=blank&size=40ashish81in added this to the MayDo collection ago
Mini bvd avatarbvd1940 added this to the #1 collection ago
B18d21a03261cf67fb2826cd4c95651b?default=blank&size=40Jblisch added this to the Handy collection ago
Mini big cheesy creeper grin   paintingShane Paul added this to the Tools: Mech Parts collection ago
Fa580e3fc8d1871d32799ae9192e3304?default=blank&size=40qdsace added this to the Engineering collection ago
5840ce71345dd0029206371858f94ad2?default=blank&size=40dwayneatwood added this to the Parts collection ago
9ef739d4d6527d3d8c186425fecfe13a?default=blank&size=40Pegase_Sk added this to the A voir... collection ago
233aadb02022628d2479007c694dc2b2?default=blank&size=40RiComikka added this to the hardware collection ago
Da90b05e5c69a9fa5501972852b95635?default=blank&size=40Raymond De Cock added this to the a voir collection ago
26646b2fcc50b8871fb338de85c86356?default=blank&size=40Aedryan13 added this to the Make it collection ago
Da7cd7fdc5462a58ba8e38335fc471ad?default=blank&size=40Martin Heath added this to the to print collection ago
01fc29fff0d1ccf0501dad94dba732fb?default=blank&size=40Okay added this to the wanna print collection ago
65f8b12857405648dda939c5cb88b10d?default=blank&size=40Emrah Γ‡elik added this to the nuts collection ago
0132effc4f0f7fde2460468593cce7d0?default=blank&size=40benkeller3 added this to the to make collection ago
918f1592725f8e10dc431fb9b01859d7?default=blank&size=40FredsGW added this to the 3D Cura collection ago
Fe652372f80f6344f663c87913d8d86a?default=blank&size=40Powerpaco added this to the Workshop Tools collection ago
Ad9d02dba80c1faf377b4fb64fec6ff5?default=blank&size=40pemo added this to the per collection ago
110b5832413fd4da70db35b255a202ff?default=blank&size=40kadito added this to the utiles collection ago
F253ab2d712136fa18b547dadb27cf1e?default=blank&size=40Scott Frock added this to the Nuts&Bolts collection ago
8fe024dda9e45eaf8862ef54c0001721?default=blank&size=40ThisChildsLife added this to the Stuff collection ago
Cefd29ec5608da6b0c5e3d434dd914fc?default=blank&size=40Rofel51 added this to the Tools collection ago
Mini 1Dubai Bunnies added this to the Print collection ago
73b090bbb30b82ff3598f118b45181b8?default=blank&size=40Zepco added this to the NarzΔ™dzia collection ago
5c073bbd00f850a42498f364d73b6a2d?default=blank&size=40Anton Belov commented ago

ISOThreadUM2.scad

Removed error in threadinring function (thinknes dont work)

module threadinring(dia,hi,thk)

{

difference()

{

cylinder(r = (dia/2)+thk,h = hi);

translate([0,0,-1]) cylinder(r = (dia/2)+0.1, h = hi+thk);

}

}

And add champfer on thread equal 20% of pitch.

module threadinpitch(dia,hi,p,thr=$fn)

// make an inside thread (as used on a nut)

// dia = diameter, 6=M6 etc

// hi = height, 10=make a 10mm long thread

// p=pitch

// thr = thread quality, 10=make a thread with 10 segments per turn

{

h=(cos(30)p)/8;

Rmin=(dia/2)-(5h); // as wiki Dmin

s=360/thr; // length of segment in degrees

t1=(hi-p)/p; // number of full turns

r=t1%1.0; // length remaining (not full turn)

t=t1-r; // integer number of turns

n=r/(p/thr); // number of segments for remainder

difference(){
for(tn=[0:t-1])
translate([0,0,tn*p]) th_in_turn(dia,p,thr);
for(sg=[0:n])
th_in_pt(Rmin+0.1,p,s,sg+(t*thr),thr,h,p/thr);
cylinder ( d=dia-p*0.8, h=hi);
} // make champfer on thread = 0.8*thread pitch // Anton Belov 18.05.2017

}

and make champfer on nut bottom

difference()

{

union() {

threadinring(30,6,3); // make a ring to enclose an M8 x 10 ISO thread with thickness 2 mm

threadinpitch(30,6,1.5); // make an M8 x 10 thread with 1mm pitch

}

cylinder ( d1=33, d2=28.5,h=3); // make champfer on nut

}

5c073bbd00f850a42498f364d73b6a2d?default=blank&size=40Anton Belov commented ago

ISOThreadUM2.scad

Removed error in threadinring function (thinknes dont work)

module threadinring(dia,hi,thk)

{

difference()

{

cylinder(r = (dia/2)+thk,h = hi);

translate([0,0,-1]) cylinder(r = (dia/2)+0.1, h = hi+thk);

}

}

And add champfer on thread equal 20% of pitch.

module threadinpitch(dia,hi,p,thr=$fn)

// make an inside thread (as used on a nut)

// dia = diameter, 6=M6 etc

// hi = height, 10=make a 10mm long thread

// p=pitch

// thr = thread quality, 10=make a thread with 10 segments per turn

{

h=(cos(30)p)/8;

Rmin=(dia/2)-(5h); // as wiki Dmin

s=360/thr; // length of segment in degrees

t1=(hi-p)/p; // number of full turns

r=t1%1.0; // length remaining (not full turn)

t=t1-r; // integer number of turns

n=r/(p/thr); // number of segments for remainder

difference(){
for(tn=[0:t-1])
translate([0,0,tn*p]) th_in_turn(dia,p,thr);
for(sg=[0:n])
th_in_pt(Rmin+0.1,p,s,sg+(t*thr),thr,h,p/thr);
cylinder ( d=dia-p*0.8, h=hi);
} // make champfer on thread = 0.8*thread pitch // Anton Belov 18.05.2017

}

and make champfer on nut bottom

difference()

{

union() {

threadinring(30,6,3); // make a ring to enclose an M8 x 10 ISO thread with thickness 2 mm

threadinpitch(30,6,1.5); // make an M8 x 10 thread with 1mm pitch

}

cylinder ( d1=33, d2=28.5,h=3); // make champfer on nut

}

Mini  sushi chops trans more centeredSushi Desires added this to the Mechanisms collection ago
Mini  sushi chops trans more centeredSushi Desires added this to the Gears, Threads, Bearings, Pulleys, & Other Interfaces collection ago
Mini  sushi chops trans more centeredSushi Desires added this to the Workshop collection ago
B21da4db0cf3410d41103e3338b481fd?default=blank&size=40ProjectCentral added this to the UTILITY collection ago
D79c33ce898647deef4b56bbc6962020?default=blank&size=40Alican Barkan added this to the Tools collection ago
8868941f6a32bdf2206f476aa360642b?default=blank&size=40eric777 added this to the Tools collection ago
8868941f6a32bdf2206f476aa360642b?default=blank&size=40eric777 added this to the Hardware collection ago
Mini ocieicon101 squareOcie Ward added this to the household collection ago
Mini ocieicon101 squareOcie Ward added this to the tools collection ago
14e28028249e2878d860e91d889ee3bc?default=blank&size=40Mentros added this to the Varios collection ago
9ca3d819e1448dfcd7edeef0fb36c2e7?default=blank&size=40David G. added this to the Eines collection ago
Mini imageRflynn added this to the Mechanical things collection ago
A53194e1827aecdaecbf40c72a125fdd?default=blank&size=40moonshizle added this to the Marshalls Stuff collection ago
02c0e4a45277fae90fd149455014b3d2?default=blank&size=40Saqhara added this to the Tools collection ago
4fd08744d56e30ddcec28e96d5719412?default=blank&size=40ask4help added this to the General collection ago
F409bcf45b7ffd69e0beba45f9aea8f7?default=blank&size=40Melog added this to the For review collection ago
0ba58ecfc226ffb4bd74ff4d9719c7fd?default=blank&size=40Kramer Cosmo added this to the Things to print collection ago
C56bb8a7a01df4e38fc1e58135de6d23?default=blank&size=40JustKrys commented ago

Small note: For ABS (and maybe PLA too), scale nuts up by about 2% else they are quite tight.

Mini um1Joerg Torhoff added this to the things to make collection ago
2341055c4728c8b0f8480e8b1551618a?default=blank&size=40Kevin Justice added this to the ToPrint collection ago
68c0e016ce3c4bbf00d47a64a94a6359?default=blank&size=40chmax added this to the MyPrintPlan collection ago
Aedd24c23ddc2e0651228adf2e7aa623?default=blank&size=40tinkerology added this to the OpenSCAD collection ago
Mini sp logo grain 400x390Stamos added this to the tools collection ago
Mini lisca mangaLisca added this to the coisinhas collection ago
Mini lisca mangaLisca added this to the Gears collection ago
Cb534ebea51ea51e10522c17823c5964?default=blank&size=40cds099 added this to the things to print collection ago
69adc8990515124deee8340415ccfaac?default=blank&size=40Matt LaRussa added this to the Tools collection ago
2da9a88a6449e23b580bad4b42a84f54?default=blank&size=40Abcopp added this to the Parts collection ago
F6255ee0dadfb1bb858c901e855bd9d5?default=blank&size=40Zoran Vila added this to the To be made collection ago
9be3cf826dbb4a308a34fc1dfe13f7f8?default=blank&size=40wwilson83 added this to the New collection ago
3f07db8af071677da6f74f86b02c7dc9?default=blank&size=40arkcle added this to the outils collection ago
Mini twitter mattarlauckas 400x400marlauckas added this to the To Make collection ago
4d3fab1519e6cafb99720c9a9e6f48b1?default=blank&size=40ymcc3d added this to the Gears etc collection ago
92a30e952f99219f35d41acc5c58c9a5?default=blank&size=40Crossfire 0mega added this to the Nuts & Bolts collection ago
7b80cb1f51216ed66fa299979307185a?default=blank&size=40loic19871 added this to the Things to make collection ago
439130abc394994d73efaa17a8ea12d5?default=blank&size=40filch20049 added this to the Technik collection ago
Mini aimeeprofileavatarAimeethyst added this to the Components collection ago
82a953778ff40733df2c54f663b8029a?default=blank&size=40solbot added this to the Tools collection ago
E63ea23cd8fccb2567797bae37b39c58?default=blank&size=40chapelmagine added this to the mine collection ago
2656324c206c773aa86d324c73e68d95?default=blank&size=40Robert Gibson added this to the Tools collection ago
2058db33b3521265973bc268281bc800?default=blank&size=40Tateums added this to the Stuff to Make collection ago
Mini elfen lied 11 thumb large 1 Da6oN added this to the Tool collection ago
7132a5b72a1be56000406b297b99106c?default=blank&size=40Dizzee Jones added this to the 3D Printer collection ago
Dbb743597ca91e38558532c3c38a4d04?default=blank&size=40Stuart Miles added this to the Stuff collection ago
Bbacbac9163544771dc7f31358185c9c?default=blank&size=40MarkusArning added this to the remember collection ago
396e53047db5fedbd8c27c2ef7509f97?default=blank&size=40drofnas added this to the Parts collection ago
C56bb8a7a01df4e38fc1e58135de6d23?default=blank&size=40JustKrys published this design ago