Loading
Hey! This thing is still a Work in Progress. Files, instructions, and other stuff might change!
Mangatar

Screw Library

by syvwlch, published

Mangatar
Screw Library by syvwlch May 25, 2011

Description

This is the Thing page for the Screw Library I am working on. I could be talked into releasing it as Public Domain, but have left it as CC-BY-SA for now, at least until it's fully stabilized.

The latest code is available on GitHub here:

github.com/syvwlch/Thingiverse-Projects/tree/master/Threaded%20Library

Currently, the library allows you to create a threaded rod with a trapezoidal profile, like the Acme or metric lead screws that are so common in CNC machines.

The trapezoidThread module creates the rod along Z, centered in X and Y, but not in Z. Same logic as cylinders with center=false.

The parameters are the following:

length
// axial length of the threaded rod
// used to calculate how many turns to create
// the rod is NOT trimmed to this length!!!

pitch
// axial distance from crest to crest

pitchRadius
// radial distance from center to mid-profile

threadHeightToPitch
// ratio between profile height and pitch
// default value is 0.5

profileRatio
// ratio between raised profile and pitch
// default value is 0.5

threadAngle
// angle between the two faces of the thread, in degrees
// std value for Acme is 29 or for metric lead screw is 30
// default value is 30

RH
// true if thread winds clockwise along shaft
// i.e.follows the Right Hand Rule
// default value is true

clearance
// radial clearance, normalized to thread height
// default value is 0.1

backlash
// axial clearance, normalized to pitch
// default value is 0.1

stepsPerTurn
// number of facets to create per turn
// default value is 24

You can create a triangular profile thread by setting profileRatio to zero, but that is cumbersome. I will create a separate module for that and add it to this page, later.

UPDATE:

I have added a trapezoidThreadNegativeSpace module to create a negative space of a thread with the proper clearances to screw on, as long as you give it the same parameters. It can add two chamfered holes at the entries. It takes the following parameters on top of the ones needed for trapezoidThread:

length
// thickness of the part to be drilled out by this object

countersunk
// depth of the 45 degree chamfers, normalized to pitch
// default value is zero, no chamfer

I have also added a trapezoidNut module which uses the above negative space module to create a hexagonal lead nut with the right clearances to screw onto any thread that shares the same parameters. It takes the following additional parameters:

radius
// outer radius of the nut

Recent Comments

view all

This library is amazing!
I'm struggling to compile and render a screw using the settings below though:

trapezoidThread(length=15, pitch=1.3, pitchRadius=4.4, threadHeightToPitch=1, profileRatio=.3 );

With the library posted here the model compiles, but won't render; OpenSCAD gets about 99.9% of the way through and then just hangs there for hours. With the library on github I get the following error at about 99.9% again:

CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File: ../libraries/install/include/CGAL/Nef_S2/SM_overlayer.h
Line: 285

The github version spits that error out for as long as I'm willing to let it run.

Do you have any ideas?

Super-duper useful! Thanks so much for sharing this.

I am lost trying to make a multi start nut

wish I could find a good tutorial for open scad

Makes

Liked By

view all

License

Give a Shout Out

If you print this Thing and display it in public proudly give attribution by printing and displaying this tag. Print Thing Tag

Instructions

Obviously, the intent is not to print threaded rod. :-)

Rather, this should allow you to subtract threaded rod from an object to make it a lead nut.

To create two meshing threaded rods like in the demo images, they need to have different handedness (RH) but the same pitch, pitch radius and threadHeightToPitch. Their profileRatios must be complementary (sum up to 1) and they must be separated by a distance of twice their pitch radius.

Have fun with it and don't be shy about reporting bugs or requesting changes or extensions.

Comments

You must be logged in to post a comment.

txoof on Feb 9, 2014 said:

This library is amazing!
I'm struggling to compile and render a screw using the settings below though:

trapezoidThread(length=15, pitch=1.3, pitchRadius=4.4, threadHeightToPitch=1, profileRatio=.3 );

With the library posted here the model compiles, but won't render; OpenSCAD gets about 99.9% of the way through and then just hangs there for hours. With the library on github I get the following error at about 99.9% again:

CGAL error in CGAL_Nef_polyhedron's union operator: CGAL ERROR: assertion violation!
Expr: G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1)
File: ../libraries/install/include/CGAL/Nef_S2/SM_overlayer.h
Line: 285

The github version spits that error out for as long as I'm willing to let it run.

Do you have any ideas?

Anonymous on Jan 12, 2014 said:

Super-duper useful! Thanks so much for sharing this.

broncosis on Nov 14, 2013 said:

I am lost trying to make a multi start nut

wish I could find a good tutorial for open scad

voidptr69 on Sep 17, 2013 said:

Cool ! Very cool ! Thanks !

terramir on Jul 9, 2013 said:

hey I got a question can this make a thread that is non standard and how do measure the thread ?
terramir

SwimmingNaked on Jun 3, 2013 said:

This is excellent. I hope there will be a supplemental to common large threadings (garden hoses, bottle caps, etc.).

m4rten86 on Mar 24, 2013 said:

hey very nice idea !! good work here

wolfmanjm on Nov 30, 2012 said:

How would you do a multi start thread? I need to print something for an 8-start lead screw. -Thanks

wolfmanjm on Nov 30, 2012 said:

 Ok I think I figured it out, for an 8tpi 8 start thread...

p, li { white-space: pre-wrap; }

 threadHeightToPitch=0.5/8,

profileRatio=0.5/8,
pitch=3.175*8,

then just create 8 threads each starting 45degrees apart by rotating the thread.

ttsalo on Jul 22, 2012 said:

There seems to be a bug... when I increase the thread angle, a gap appears between the threads and the shaft. It's easiest to see when you take a difference and seems to reproduce with the following:

trapezoidNut(threadAngle=45);

This already shows erroneous shapes at the apex of the cut thread. Larger angles show even larger gap (or larger extra polygons if the thread was subtracted from a shape).

I'm using OpenSCAD 2011.12 and wanted to use a larger angle to reduce the overhangs when prin
ting.

ttsalo on Jul 24, 2012 said:

I checked out the latest code with git and now the problem seems to be gone.

Xendi on Feb 4, 2012 said:

This is wonderful, thanks! I now have printed 5/16" ACME nuts running my Z leadscrews. Printed well in PLA at 0.1mm layers with 0.2 clearance/backlash set.

phenry on Oct 31, 2011 said:

Great library. The models look awesome...on the screen at least!

Overhang is a big issue on my makerbot, because skeinforge thinks it can print a circular shell in empty space, so it just ends up drooping. Anybody know a mod/setting that will tell it to print the overhang layers as loops or radial lines, and then switch back to normal shells once the support st
ructure is in place?

Anonymous on Sep 12, 2011 said:

Syvwich,

I started with printing the full screw (as presented) to see how the overhang would come out from my Ultimaker.
Then I started with the full nut, but unfortunately the scale of the nut (as presented) does not match with the screw, consequently I stopped the printing.
Yes, the intention is providi
ng a library, but .... a pity, I am not so much a sketcher.

Wim

Anonymous on Aug 19, 2011 said:

Is there chart available for "pitch" and "pitchRadius" and how they should be set for standard bolts like M3 or 1/2"x32?

I've been setting pitchRadius to half the nominal size but I'm not certain that is the correct way to do this.

Anonymous on Aug 19, 2011 said:

http://euler9.tripod.com/bolt-...

This chart looks pretty good. Use the pitch diameter/2. These are internal threads based on my hand calculations.

jag on Jun 5, 2011 said:

I love this. I'm trying to use it to generate threads to make a device to screw onto the end of a dremel tool which I believe has triangular 3/4-12 60 degree threads. I can't seem to get it to work for 60 degree threads. Have you tried that yet? Am I missing something?

Here's my snippet:
trapezoidThread(
length=6,
pitch=2.12,
pitchRadius=8.607,
threadHeightToPitch=cos(30),
profileRatio=0.0,
threadAngle=60,
stepsPerTurn=24
);

syvwlch on Jun 5, 2011 said:

Does the image below look about right?

I generated it with:

trapezoidThread(
length=60,
pitch=2.12,
pitchRadius=8.607,
threadHeightToPitch=cos(30),
profileRatio=0.615,
threadAngle=30,
stepsPerTurn=24
);

Looks like I broke two things when I changed to vectorial math for the thread profile. One is that I changed the thr
ead angle definition so that you have to specify half the previous value. The other is that profile ratio is less than intuitive now, 0 does not correspond to a triangular profile like you would expect. I will fix both in the next release but in the mean-time the above is probably what you want.

caru on Jun 3, 2011 said:

Fantastic library!

Could we have a function that allows to create a thread with an exagonal head (a bolt), if you are still interested in writing code after you got a makerbot? :)
I know it's not difficult, but that would be very handy.

syvwlch on Jun 3, 2011 said:

Yes, I can do that. I've disappeared down a rabbit hole made of printer assembly and trying to get the throated worm drive to work... but there are a couple simple upgrades to this library that I can definitely publish as is.

That includes progressive starts to the threads, and definitely bolts. I'll try to get that out the door soon!

booktinker on May 28, 2011 said:

Well, this is far superior to the one I did. Great Job! :)

syvwlch on May 28, 2011 said:

I like the structural system you designed it for, where has that led?

syvwlch on May 26, 2011 said:

Added a negative space version of the thread module, which can be used to create a threaded hole with all the right clearances and some chamfered entries in anything you want, as well as a module to create an hexagonal nut that will screw onto the threaded rod.

You just need to make sure to feed them the same parameters.

WilliamAAdams on May 26, 2011 said:

I was wanting to play with some worm gears. This will make it relatively easy.

syvwlch on May 26, 2011 said:

Worm gears... great idea! :-)

MakeALot on May 26, 2011 said:

Now I need to play with this to make negative threads for nuts etc, maybe I'll revisit my
<
i
>
Bolt Pencil Case
<
/i
>
and do it properly this time :)

syvwlch on May 26, 2011 said:

Making a lead nut right now, using difference() and setting clearance and backlash to negative values. I hope it fits the screw! :-)

aubenc on May 26, 2011 said:

I love it!

Anyway... :-D I'm going to upload my poor man version :-P in 3.... 2.......... 1...................

syvwlch on May 26, 2011 said:

Publish or perish. :-)

I'll be stealing ideas from your version in 3, 2, 1....

freakinhuge on May 26, 2011 said:

This is so awesome!

JelleAtProtospace on May 26, 2011 said:

Cool!

Top